Commit 7f90f9b6 LN

修改扫码方式

1 个父辈 ea1d88e6
......@@ -21,30 +21,23 @@
<add key="Store_Position_Config" value="\StoreConfig\AC\linePositions.csv"/>
<add key="Store_ConfigPath" value="\StoreConfig\AC\StoreConfig.csv"/>
<add key="Store_Type" value="RC_AC_SA"/>
<add key="Store_CID" value="rc1258ac-1"/>
<add key="Store_CID" value="rc-ac-1"/>
<!--end one store config-->
<!--摄像机名称列表配置,用#分割-->
<add key="CameraName" value="GigE:MV-CE100-30GC (00C69898483)"/>
<!--二维码类型列表配置,用#分割,二维码:QR Code#Data Matrix ECC 200#Micro QR Code,一维码=Barcode-->
<add key="CodeType" value="QR Code"/>
<!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<add key="CodeParamPath" value="\CodeParam\"/>
<add key="InOutDefaultPosition" value="8000"/>
<add key="Config_Pwd" value="123456"/>
<!--出库等待料盘拿走的时间,秒-->
<add key="OutStoreWaitSeconds" value="10"/>
<!--温控器类型,0=壁挂王字壳温湿度变送器,1=妙昕温湿度记录仪-->
<add key="HumitureControllerType" value="0"/>
<!--流水线地址和端口配置-->
<add key="LineServerIp" value="192.168.200.69"/>
<add key="LineServerPort" value="1234"/>
<!--解码方式,0=halcon 解码,1=西安料仓 使用zxing解码,2=成都料仓-->
<add key="DeCodeType" value="0"/>
<add key ="DefaultPWD" value ="123456"/>
<add key="UseAIOBOX" value="1"/>
<!--是否使用蜂鸣器-->
<add key ="UseBuzzer" value ="1"/>
<add key ="StartScan_CMD" value ="S"/>
</appSettings>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
......@@ -44,7 +44,7 @@ namespace OnlineStore.ACSingleStore
}
return str;
}
internal static string GetCodeNum(string codeName = "RC1258-ACSingleStore")
internal static string GetCodeNum(string codeName = "RC-DL-ACSingleStore")
{
byte[] byteArray = System.Text.Encoding.ASCII.GetBytes(codeName);
string result = "";
......
......@@ -39,12 +39,12 @@
this.btnStoreStop = new System.Windows.Forms.Button();
this.btnStoreStart = new System.Windows.Forms.Button();
this.tabPage5 = new System.Windows.Forms.TabPage();
this.btnUpdown = new System.Windows.Forms.Button();
this.btnDebug = new System.Windows.Forms.Button();
this.btnAxisOff = new System.Windows.Forms.Button();
this.btnAxisOn = new System.Windows.Forms.Button();
this.btnScanCode = new System.Windows.Forms.Button();
this.btnAxisP = new System.Windows.Forms.Button();
this.btnCodeLearn = new System.Windows.Forms.Button();
this.btnIO = new System.Windows.Forms.Button();
this.tabPage6 = new System.Windows.Forms.TabPage();
this.button4 = new System.Windows.Forms.Button();
......@@ -169,7 +169,6 @@
this.开启DEBUGToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator();
this.清理日志ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.btnUpdown = new System.Windows.Forms.Button();
this.contextMenuStrip1.SuspendLayout();
this.tabControl2.SuspendLayout();
this.tabPage4.SuspendLayout();
......@@ -194,23 +193,24 @@
//
// contextMenuStrip1
//
this.contextMenuStrip1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.显示ToolStripMenuItem,
this.toolStripMenuItem1});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(116, 48);
this.contextMenuStrip1.Size = new System.Drawing.Size(125, 52);
//
// 显示ToolStripMenuItem
//
this.显示ToolStripMenuItem.Name = "显示ToolStripMenuItem";
this.显示ToolStripMenuItem.Size = new System.Drawing.Size(115, 22);
this.显示ToolStripMenuItem.Size = new System.Drawing.Size(124, 24);
this.显示ToolStripMenuItem.Text = "显示(&S)";
this.显示ToolStripMenuItem.Click += new System.EventHandler(this.显示ToolStripMenuItem_Click);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(115, 22);
this.toolStripMenuItem1.Size = new System.Drawing.Size(124, 24);
this.toolStripMenuItem1.Text = "退出(&E)";
this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click);
//
......@@ -341,7 +341,6 @@
this.tabPage5.Controls.Add(this.btnAxisOn);
this.tabPage5.Controls.Add(this.btnScanCode);
this.tabPage5.Controls.Add(this.btnAxisP);
this.tabPage5.Controls.Add(this.btnCodeLearn);
this.tabPage5.Controls.Add(this.btnIO);
this.tabPage5.Location = new System.Drawing.Point(4, 30);
this.tabPage5.Name = "tabPage5";
......@@ -351,10 +350,21 @@
this.tabPage5.Text = " 设备调试 ";
this.tabPage5.UseVisualStyleBackColor = true;
//
// btnUpdown
//
this.btnUpdown.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUpdown.Location = new System.Drawing.Point(672, 4);
this.btnUpdown.Name = "btnUpdown";
this.btnUpdown.Size = new System.Drawing.Size(132, 39);
this.btnUpdown.TabIndex = 272;
this.btnUpdown.Text = "升降轴位置调试";
this.btnUpdown.UseVisualStyleBackColor = true;
this.btnUpdown.Click += new System.EventHandler(this.btnUpdown_Click);
//
// btnDebug
//
this.btnDebug.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnDebug.Location = new System.Drawing.Point(939, 4);
this.btnDebug.Location = new System.Drawing.Point(806, 4);
this.btnDebug.Name = "btnDebug";
this.btnDebug.Size = new System.Drawing.Size(132, 39);
this.btnDebug.TabIndex = 12;
......@@ -365,7 +375,7 @@
// btnAxisOff
//
this.btnAxisOff.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisOff.Location = new System.Drawing.Point(672, 4);
this.btnAxisOff.Location = new System.Drawing.Point(539, 4);
this.btnAxisOff.Name = "btnAxisOff";
this.btnAxisOff.Size = new System.Drawing.Size(132, 39);
this.btnAxisOff.TabIndex = 11;
......@@ -376,7 +386,7 @@
// btnAxisOn
//
this.btnAxisOn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisOn.Location = new System.Drawing.Point(539, 4);
this.btnAxisOn.Location = new System.Drawing.Point(406, 4);
this.btnAxisOn.Name = "btnAxisOn";
this.btnAxisOn.Size = new System.Drawing.Size(132, 39);
this.btnAxisOn.TabIndex = 10;
......@@ -398,7 +408,7 @@
// btnAxisP
//
this.btnAxisP.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisP.Location = new System.Drawing.Point(406, 4);
this.btnAxisP.Location = new System.Drawing.Point(273, 4);
this.btnAxisP.Name = "btnAxisP";
this.btnAxisP.Size = new System.Drawing.Size(132, 39);
this.btnAxisP.TabIndex = 8;
......@@ -406,17 +416,6 @@
this.btnAxisP.UseVisualStyleBackColor = true;
this.btnAxisP.Click += new System.EventHandler(this.轴卡点动ToolStripMenuItem_Click);
//
// btnCodeLearn
//
this.btnCodeLearn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCodeLearn.Location = new System.Drawing.Point(273, 4);
this.btnCodeLearn.Name = "btnCodeLearn";
this.btnCodeLearn.Size = new System.Drawing.Size(132, 39);
this.btnCodeLearn.TabIndex = 7;
this.btnCodeLearn.Text = "二维码学习";
this.btnCodeLearn.UseVisualStyleBackColor = true;
this.btnCodeLearn.Click += new System.EventHandler(this.学习二维码ToolStripMenuItem_Click);
//
// btnIO
//
this.btnIO.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
......@@ -1688,7 +1687,7 @@
this.日志ToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(1089, 33);
this.menuStrip1.Size = new System.Drawing.Size(1101, 33);
this.menuStrip1.TabIndex = 257;
this.menuStrip1.Text = "menuStrip1";
this.menuStrip1.Visible = false;
......@@ -1923,17 +1922,6 @@
this.清理日志ToolStripMenuItem.Text = "清理日志";
this.清理日志ToolStripMenuItem.Click += new System.EventHandler(this.清理日志ToolStripMenuItem_Click);
//
// btnUpdown
//
this.btnUpdown.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUpdown.Location = new System.Drawing.Point(805, 4);
this.btnUpdown.Name = "btnUpdown";
this.btnUpdown.Size = new System.Drawing.Size(132, 39);
this.btnUpdown.TabIndex = 272;
this.btnUpdown.Text = "升降轴位置调试";
this.btnUpdown.UseVisualStyleBackColor = true;
this.btnUpdown.Click += new System.EventHandler(this.btnUpdown_Click);
//
// FrmStoreBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
......@@ -2097,7 +2085,6 @@
private System.Windows.Forms.Button btnStoreStop;
private System.Windows.Forms.Button btnScanCode;
private System.Windows.Forms.Button btnAxisP;
private System.Windows.Forms.Button btnCodeLearn;
private System.Windows.Forms.Button btnIO;
private System.Windows.Forms.Button btnAxisOff;
private System.Windows.Forms.Button btnAxisOn;
......
......@@ -156,15 +156,9 @@ namespace OnlineStore.ACSingleStore
{
groupHistory.Visible = false;
}
if (CodeManager.DeCodeType.Equals(1))
{
groupCode.Visible = true;
;
}
else
{
groupCode.Visible = false;
}
}
private DateTime preReadModblsTime = DateTime.Now;
private void timer1_Tick(object sender, EventArgs e)
......@@ -174,29 +168,6 @@ namespace OnlineStore.ACSingleStore
return;
}
lblTemp.Text = store.currTempStr;
//忙碌状态不读取状态
//if (!store.storeRunStatus.Equals(StoreRunStatus.Busy))
//{
// if (chbAutoRead.Checked)
// {
// string portName = GetPortName();
// int SlvAddr = GetSlaveAddr();
// //判断私服是否打开、
// if (ACServerManager.ServerOnStatus(portName, SlvAddr))
// {
// lblServerOn.Text = "伺服ON";
// int lOutPulse = ACServerManager.GetTargetPosition(portName, SlvAddr);
// lblOutPulse.Text = string.Format("{0:d}", lOutPulse);
// int lCountPulse = ACServerManager.GetActualtPosition(portName, SlvAddr);
// lblCountPulse.Text = string.Format("{0:d}", lCountPulse);
// }
// else
// {
// lblServerOn.Text = "伺服OFF";
// }
// }
//}
//ReadPosistion();
if (store.storeRunStatus > StoreRunStatus.Wait)
......@@ -781,15 +752,18 @@ namespace OnlineStore.ACSingleStore
private void 扫码测试ToolStripMenuItem_Click(object sender, EventArgs e)
{
IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH);
string message = "";
List<string> codeList = CodeManager.CameraScan();
foreach (string str in codeList)
{
message = message + str + "##";
}
LogUtil.info("扫码测试收到二维码 :" + message);
IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.LOW);
//IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH);
//string message = "";
//List<string> codeList = CodeManager.CameraScan();
//foreach (string str in codeList)
//{
// message = message + str + "##";
//}
//LogUtil.info("扫码测试收到二维码 :" + message);
//IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.LOW);
store.dlScanSocket.StartConnect();
store.GetCameraCode();
}
private void 打开舱门ToolStripMenuItem_Click(object sender, EventArgs e)
......
......@@ -1263,7 +1263,7 @@
<value>107, 16</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>25</value>
<value>90</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
......
......@@ -23,7 +23,7 @@ namespace OnlineStore.Common
/// <summary>
/// 扫码枪开始命令发送给socket的消息
/// </summary>
public static string scanner_start_command = "scanner_start_command";
public static string StartScan_CMD = "StartScan_CMD";
public static string http_server = "http.server";
public static string Store_CID = "Store_CID";
......@@ -39,14 +39,14 @@ namespace OnlineStore.Common
public static string Store_ConfigPath = "Store_ConfigPath";
public static string Store_Position_Config = "Store_Position_Config";
/// <summary>
/// 摄像机名称,多个中间使用#分割
/// </summary>
public static string CameraName = "CameraName";
/// <summary>
/// 需要识别的二维码类型,多个中间使用#分割
/// </summary>
public static string CodeType = "CodeType";
///// <summary>
///// 摄像机名称,多个中间使用#分割
///// </summary>
//public static string CameraName = "CameraName";
///// <summary>
///// 需要识别的二维码类型,多个中间使用#分割
///// </summary>
//public static string CodeType = "CodeType";
/// <summary>
/// 开始吹气的判断值(配置值=服务器发送的湿度值-开始吹气值)
......@@ -57,10 +57,10 @@ namespace OnlineStore.Common
/// </summary>
public static string StopBlowValue = "StopBlowValue";
/// <summary>
/// 配置文件路径 Data Matrix ECC 200.dcm
/// </summary>
public static string CodeParamPath = "CodeParamPath";
///// <summary>
///// 配置文件路径 Data Matrix ECC 200.dcm
///// </summary>
//public static string CodeParamPath = "CodeParamPath";
/// <summary>
/// 进出轴最大待机点,需要小于3000
......
......@@ -39,12 +39,6 @@
<Reference Include="Asa.IOModule.AIOBOX">
<HintPath>..\..\dll\Asa.IOModule.AIOBOX.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary">
<HintPath>..\..\dll\CodeLibrary.dll</HintPath>
</Reference>
<Reference Include="halcondotnet">
<HintPath>..\..\..\RC32-SZBOSCH-ACSingleStore\dll\halcondotnet.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\log4net.dll</HintPath>
......@@ -66,7 +60,6 @@
<Compile Include="acSingleStore\AC_SA_BoxBean_Partial.cs" />
<Compile Include="acSingleStore\StoreManager.cs" />
<Compile Include="dataLogic\DLScanSocket.cs" />
<Compile Include="halcon\CodeManager.cs" />
<Compile Include="IO\AIManager.cs" />
<Compile Include="IO\AIOBOX\AIOAIManager.cs" />
<Compile Include="IO\AIOBOX\AIOBOXManager.cs" />
......
......@@ -130,5 +130,8 @@ PRO,模拟信号4的地址,AIDI4_Addr,3,,,,,,,
,,,,,,,,, ,
PRO,模拟转换系数,AI_ConvertPosition,55,,,,,,,
,,,,,,,,, ,
PRO,默认的料盘宽度(多种尺寸为0),Default_TrayWidth,0,,,,,,,
PRO,默认的料盘宽度(多种尺寸为0),Default_TrayWidth,7,,,,,,,
PRO,特殊二维码尺寸配置,CodeSizeConfig,XA=13x48#XB=13x32#FA=7x32,,,,,,,
,,,,,,,,, ,
PRO,扫码枪IP,Scanner_Ip,192.168.201.201,,,,,,,
PRO,扫码枪端口号,Scanner_Port,51236,,,,,,,
......@@ -16,6 +16,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public partial class AC_SA_BoxBean : KTK_Store
{
public DLScanSocket dlScanSocket;
private static bool IsIntSlvBlock = false;
/// <summary>
/// 开始运行
......@@ -88,8 +89,9 @@ namespace OnlineStore.DeviceLibrary
}
}
dlScanSocket = new DLScanSocket(config.Scanner_Ip, config.Scanner_Port, onCodeReceived);
//初始化摄像机配置
CodeManager.LoadConfig( );
// CodeManager.LoadConfig( );
IOManager.Init();
//初始化 //连接设备
IOManager.instance.ConnectionIOList(Config.DIODeviceNameList);
......@@ -167,14 +169,6 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil.info(LOGGER, StoreName + "开始启动,启动时间:" + StartTime.ToString());
//if (IsHasCompress_Axis)
//{
// if (ShuoKeControls.isRun == false && (!StoreManager.OpenShuoKe(this)))
// {
// LogUtil.info(StoreName + "打开驱动器串口失败,启动失败!");
// return false;
// }
//}
autoNext = false;
mainTimer.Enabled = false;
alarmType = StoreAlarmType.None;
......@@ -198,7 +192,7 @@ namespace OnlineStore.DeviceLibrary
storeStatus = StoreStatus.ResetMove;
//启动温湿度服务器
HumitureController.Init(Config.Humiture_Port);
dlScanSocket.StartConnect();
ReturnHome();
StartTime = DateTime.Now;
mainTimer.Enabled = true;
......@@ -648,12 +642,8 @@ namespace OnlineStore.DeviceLibrary
mainTimer.Enabled = false;
TimeSpan span = DateTime.Now - StartTime;
IsRun = false;
dlScanSocket.Close();
IOManager.instance.CloseAllDO();
//if (IsHasCompress_Axis)
//{
// ShuoKeControls.ClosePort();
//}
LogUtil.info(LOGGER, StoreName + ",停止运行,总运行时间:" + span.ToString());
}
......@@ -694,10 +684,6 @@ namespace OnlineStore.DeviceLibrary
StopMove(true);
storeStatus = StoreStatus.SuddenStop;
}
//if (alarmType != StoreAlarmType.IoSingleTimeOut)
//{
// StopMove();
//}
}
private bool InProcess = false;
//private DateTime preProcessTime = DateTime.Now;
......@@ -1095,11 +1081,6 @@ namespace OnlineStore.DeviceLibrary
}
}
//private void BeginScannering()
//{
// scanSocket.BeginScannering();
//}
private DateTime preIoTimerOutTime = DateTime.Now;
/// <summary>
/// io检测异常
......@@ -1325,10 +1306,12 @@ namespace OnlineStore.DeviceLibrary
/// 扫码枪数据接收
/// </summary>
/// <param name="message"></param>
private void onCodeReceived(string message)
private void onCodeReceived(string[] codeList )
{
try
{
IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.LOW);
string message = ProcessCode(codeList);
message = ScanCodeManager.ReplaceCode(message);
if (message.Equals("") || string.IsNullOrEmpty(message))
{
......@@ -1442,35 +1425,27 @@ namespace OnlineStore.DeviceLibrary
}
#endregion
#region Halcon扫码枪代码
private DateTime LastScanTime = DateTime.Now;
#region Halcon扫码枪代码
public bool IsTestCamera = false;
//private System.Timers.Timer scanTimer = null;
public void GetCameraCode()
{
if (IsTestCamera && IsInScan())
TimeSpan span = DateTime.Now - LastScanTime;
if (IsTestCamera && IsScanCode && (span.TotalSeconds < 60))
{
LogUtil.info("上次扫码还未执行完毕,请稍后!");
return;
}
Task.Factory.StartNew(delegate { scanTimer_Elapsed(null, null); });
IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH);
dlScanSocket.BeginScan();
}
private string spiltStr = "##";
private void scanTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
private string ProcessCode(string[] codeList)
{
DateTime date = DateTime.Now;
//scanTimer.Enabled = false;
IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH);
// string outMsg = "";
string message = "";
bool hasSpecialCode = false;
List<string> codeList = CodeManager.CameraScan();
if (codeList.Count <= 0)
{
codeList = CodeManager.CameraScan();
}
//= 1 + 123.4x100.5 - 7x12 = CODE
foreach (string str in codeList)
......@@ -1483,84 +1458,13 @@ namespace OnlineStore.DeviceLibrary
//无固定尺寸,判断宽度是否是固定,如果不是固定,直接获取当前高度宽度
codeSize = GetSize() + "x" + GetHeight();
}
else
{
hasSpecialCode = true;
}
if (str.Trim().ToUpper().StartsWith("XA"))//西安料仓
{
hasSpecialCode = true;
code = "=1+0x0-13x48" + "=" + str.Trim();
}
else if (str.Trim().ToUpper().StartsWith("XB"))//西安料仓
{
hasSpecialCode = true;
code = "=1+0x0-13x32" + "=" + str.Trim();
}
else if (str.ToUpper().StartsWith("FA"))//孝感料仓
{
hasSpecialCode = true;
code = "=1+0x0-7x32" + "=" + str.Trim();
}
if (CodeManager.DeCodeType.Equals(1))
{
//只有西安料仓使用此解码类型
string codea = CodeManager.GetBarcode(str);
if (String.IsNullOrEmpty(codea))
{
code = "";
}
else
{
code = "=1+0x0-" + codeSize + "=" + codea;
}
}
else
{
code = "=1+0x0-" + codeSize + "=" + str.Trim();
}
if (!String.IsNullOrEmpty(code))
{
message = message + code + spiltStr;
message = message + code + dlScanSocket.spiltStr;
}
}
//成都料仓条码处理
if ((!hasSpecialCode) && CodeManager.DeCodeType.Equals(2) && codeList.Count > 0)
{
string code = CodeManager.ProcessChengDuCode(codeList);
if (!String.IsNullOrEmpty(code))
{
message = "=1+0x0-" + GetSize() + "x" + GetHeight() + "=" + code;
}
return message;
}
//if (!outMsg.Equals(""))
//{
// CodeMsg = "盘尺寸错误,清理二维码【" + message + "】";
// LogUtil.error("盘尺寸错误,清理二维码【" + message + "】");
// message = "";
//}
IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.LOW);
onCodeReceived(message);
}
private DateTime LastScanTime = DateTime.Now;
private bool IsInScan()
{
if (!IsScanCode)
{
return false;
}
TimeSpan span = DateTime.Now - LastScanTime;
if (span.TotalSeconds > 60)
{
//大于60秒表示超时了,可以重新开始扫码
return false;
}
return true;
}
#endregion
#region 高度传感器处理
......@@ -1609,7 +1513,7 @@ namespace OnlineStore.DeviceLibrary
return 0;
}
int result = 0;
if (IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.LOW))
if (Config.Default_TrayWidth.Equals(7).Equals(false)&&IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.LOW))
{
return result;
}
......@@ -1628,14 +1532,14 @@ namespace OnlineStore.DeviceLibrary
return 0;
}
int result = 0;
if (IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.LOW))
if (Config.Default_TrayWidth.Equals(13).Equals(false) && IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.LOW))
{
return result;
}
double ai1Value = AIManager.ConvertAI(AIManager.Instance.GetAIValue(Config.AIDevice_IP, Config.AIDI3_Addr), Config.AIDI3_DefaultPosition);
// double ai2Value = AIManager.ConvertAI(AIManager.Instance.GetAIValue(Config.AIDevice_IP, Config.AIDI4_Addr), Config.AIDI4_DefaultPosition);
// double Value = Math.Round((ai1Value + ai2Value) / 2, 1);
return CalHeight(ai1Value);
double ai2Value = AIManager.ConvertAI(AIManager.Instance.GetAIValue(Config.AIDevice_IP, Config.AIDI4_Addr), Config.AIDI4_DefaultPosition);
double Value = Math.Round((ai1Value + ai2Value) / 2, 1);
return CalHeight(Value);
}
private int CalHeight(double Value)
......@@ -1816,6 +1720,7 @@ namespace OnlineStore.DeviceLibrary
{
LOGGER.Error("定时给服务器发送消息出错:", ex);
}
dlScanSocket.TimerCheck();
}
HumitureController.QueryData();
HumidityProcess();
......
......@@ -18,8 +18,6 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public static int CurrInOutType = 0;
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public static AC_SA_BoxBean Store = null;
public static AC_SA_Config Config = null;
......
......@@ -57,7 +57,7 @@ namespace OnlineStore.DeviceLibrary
{
if (!scannerSocket.IsConnected())
{
StartConnect( true);
StartConnect( false );
LogUtil.info( "重新连接扫码枪【" + ScannerIP + "】 ");
}
}
......@@ -83,7 +83,7 @@ namespace OnlineStore.DeviceLibrary
{
try
{
string str = ConfigAppSettings.GetValue(Setting_Init.scanner_start_command);
string str = ConfigAppSettings.GetValue(Setting_Init.StartScan_CMD);
scannerSocket.send(str);
}
catch (Exception ex)
......
......@@ -60,12 +60,12 @@ namespace OnlineStore.LoadCSVLibrary
/// <summary>
/// PRO 扫码枪IP Scanner_Ip 192.168.200.13
/// </summary>
[ConfigProAttribute("Scanner_Ip",false)]
[ConfigProAttribute("Scanner_Ip")]
public string Scanner_Ip { get; set; }
/// <summary>
/// PRO 扫码枪端口号 Scanner_Port 51236
/// </summary>
[ConfigProAttribute("Scanner_Port",false)]
[ConfigProAttribute("Scanner_Port")]
public int Scanner_Port { get; set; }
/// <summary>
/// PRO (轴一)旋转轴原点目标速度 MiddleAxis_TargetSpeed 30000
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!