Commit 351f8cbf 刘韬

1

1 个父辈 5a1faba9
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<add key="StartBlowValue" value="2"/> <add key="StartBlowValue" value="2"/>
<!-- 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)--> <!-- 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)-->
<add key="StopBlowValue" value="4"/> <add key="StopBlowValue" value="4"/>
<add key="UseAirBlow" value="-1"/> <add key="UseAirBlow" value="1"/>
<add key="DoorOpenAirBlow" value="0"/> <add key="DoorOpenAirBlow" value="0"/>
<add key="humidityadjust" value="-11"/> <add key="humidityadjust" value="-11"/>
<add key="humiditylimited" value="4"/> <add key="humiditylimited" value="4"/>
......
...@@ -84,37 +84,43 @@ namespace OnlineStore.ACSingleStore ...@@ -84,37 +84,43 @@ namespace OnlineStore.ACSingleStore
LogUtil.error(LOGGER, "找不到对应的料仓"); LogUtil.error(LOGGER, "找不到对应的料仓");
return; return;
} }
try
{
uc_boxdebug1.Init(store); uc_boxdebug1.Init(store);
txtMiddleP1.Text = store.Config.MiddleAxis_P1_Position.ToString(); txtMiddleP1.Text = store.Config.MiddleAxis_P1_Position.ToString();
txtUpDownP1.Text = store.Config.UpDownAxis_DoorOPosition_P1.ToString(); txtUpDownP1.Text = store.Config.UpDownAxis_DoorOPosition_P1.ToString();
txtInOutP1.Text = store.Config.InOutAxis_P1_Position.ToString(); txtInOutP1.Text = store.Config.InOutAxis_P1_Position.ToString();
txtComP1.Text = store.Config.CompressAxis_P1_Position.ToString(); txtComP1.Text = store.Config.CompressAxis_P1_Position.ToString();
txtUpDownP2.Text = store.Config.UpDownAxis_DoorIPosition_P2.ToString(); txtUpDownP2.Text = store.Config.UpDownAxis_DoorIPosition_P2.ToString();
txtUpDownP7.Text = store.Config.UpDownAxis_DoorOBPosition_P7.ToString(); txtUpDownP7.Text = store.Config.UpDownAxis_DoorOBPosition_P7.ToString();
txtUpDownP8.Text = store.Config.UpDownAxis_DoorIBPosition_P8.ToString(); txtUpDownP8.Text = store.Config.UpDownAxis_DoorIBPosition_P8.ToString();
//txtInOutP2.Text = store.Config.InOutAxis_DoorPosition_P2.ToString(); //txtInOutP2.Text = store.Config.InOutAxis_DoorPosition_P2.ToString();
if (store.Config.StoreDOList.ContainsKey(IO_Type.Device_Led)) if (store.Config.StoreDOList.ContainsKey(IO_Type.Device_Led))
{ {
btnOpenDLed.Visible = true; btnOpenDLed.Visible = true;
btnCloseDLed.Visible = true; btnCloseDLed.Visible = true;
}
else
{
btnOpenDLed.Visible = false;
btnCloseDLed.Visible = false;
}
timer1.Enabled = true;
setAxisPopup(txtUpDownP1, btnUpDownP1, store.Config.UpDown_Axis);
setAxisPopup(txtUpDownP7, btnUpDownP7, store.Config.UpDown_Axis);
setAxisPopup(txtUpDownP8, btnUpDownP8, store.Config.UpDown_Axis);
setAxisPopup(txtUpDownP2, btnUpDownP2, store.Config.UpDown_Axis);
setAxisPopup(txtMiddleP1, btnMiddleP1, store.Config.Middle_Axis);
setAxisPopup(txtInOutP1, btnInOutP1, store.Config.InOut_Axis);
setAxisPopup(txtComP1, btnComP1, store.Config.Comp_Axis);
} }
else catch(Exception ex) {
{ LogUtil.error(LOGGER, "加载界面出错"+ ex.ToString());
btnOpenDLed.Visible = false;
btnCloseDLed.Visible = false;
} }
timer1.Enabled = true;
setAxisPopup(txtUpDownP1, btnUpDownP1, store.Config.UpDown_Axis);
setAxisPopup(txtUpDownP7, btnUpDownP7, store.Config.UpDown_Axis);
setAxisPopup(txtUpDownP8, btnUpDownP8, store.Config.UpDown_Axis);
setAxisPopup(txtUpDownP2, btnUpDownP2, store.Config.UpDown_Axis);
setAxisPopup(txtMiddleP1, btnMiddleP1, store.Config.Middle_Axis);
setAxisPopup(txtInOutP1, btnInOutP1, store.Config.InOut_Axis);
setAxisPopup(txtComP1, btnComP1, store.Config.Comp_Axis);
} }
#endregion #endregion
...@@ -778,7 +784,7 @@ namespace OnlineStore.ACSingleStore ...@@ -778,7 +784,7 @@ namespace OnlineStore.ACSingleStore
{ {
stop_button_Click(null, null); stop_button_Click(null, null);
} }
HIKCamera.Current.Close();
ResourceCulture.LogDefaultMap(); ResourceCulture.LogDefaultMap();
IOManager.instance.CloseAllDO(); IOManager.instance.CloseAllDO();
StoreOpenStatus(false); StoreOpenStatus(false);
......
...@@ -130,7 +130,7 @@ namespace OnlineStore.ACSingleStore ...@@ -130,7 +130,7 @@ namespace OnlineStore.ACSingleStore
// SISO.IO.X01_Reset // SISO.IO.X01_Reset
// SISO.Servo.InOut // SISO.Servo.InOut
public string DevicePath; public string DevicePath;
public string DeviceName; //设别名称 比如AC01, Store02 public string CID; //设别名称 比如AC01, Store02
public string ErrorDescKey; //报警描述语言Key public string ErrorDescKey; //报警描述语言Key
public string ErrorDescription; //报警描述 支持{0}替换字符 public string ErrorDescription; //报警描述 支持{0}替换字符
public string[] ErrorDescParameters; //报警描述参数 public string[] ErrorDescParameters; //报警描述参数
......
...@@ -9,7 +9,7 @@ using System.Runtime.InteropServices; ...@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SO951-HC-ACSingleStore 173c9a22466568332d0190b45847fb52e2b6d28f")] [assembly: AssemblyProduct("SO951-HC-ACSingleStore 5a1faba90251847885c81b6291b50d083a8262c9")]
[assembly: AssemblyCopyright("Copyright ? 2017")] [assembly: AssemblyCopyright("Copyright ? 2017")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
......
...@@ -18,7 +18,7 @@ DI,前门限位,Door_Limit,9,HC,0,前门限位,X09,X09,0 ...@@ -18,7 +18,7 @@ DI,前门限位,Door_Limit,9,HC,0,前门限位,X09,X09,0
DI,左侧门限位,Door_LeftLimit,10,HC,0,左侧门限位,X10,X10,0 DI,左侧门限位,Door_LeftLimit,10,HC,0,左侧门限位,X10,X10,0
DI,右侧门限位,Door_RightLimit,11,HC,0,右侧门限位,X11,X11,0 DI,右侧门限位,Door_RightLimit,11,HC,0,右侧门限位,X11,X11,0
DI,激光对点检测,Laser_detection,12,HC,0,激光对点检测,X12,X12,0 DI,激光对点检测,Laser_detection,12,HC,0,激光对点检测,X12,X12,0
DI,进料口电机异常,Motor_Error,13,HC,0,进料口电机异常,X13,X13,0 DIX,进料口电机异常,Motor_Error,13,HC,0,进料口电机异常,X13,X13,0
DI,料盘检测3(进料口),TrayCheck_Door_13,14,HC,0,料盘检测3(进料口),X14,X14,0 DI,料盘检测3(进料口),TrayCheck_Door_13,14,HC,0,料盘检测3(进料口),X14,X14,0
,,,,,,,,, ,,,,,,,,,
DO,自动指示灯,AutoRun_HddLed,0,HC,0,自动指示灯,Y00,Y01,0 DO,自动指示灯,AutoRun_HddLed,0,HC,0,自动指示灯,Y00,Y01,0
......
...@@ -1174,7 +1174,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1174,7 +1174,7 @@ namespace OnlineStore.DeviceLibrary
//光栅不遮挡时才扫码 //光栅不遮挡时才扫码
if ((checkIO.Equals(IO_VALUE.HIGH)) &&IOManager.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH)&& height > 0 ) if ((checkIO.Equals(IO_VALUE.HIGH)) &&IOManager.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH)&& height > 0 )
{ {
if (!CanStartCode() || IsDebug || InStoreFail || IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) if (!CanStartCode() || IsDebug || InStoreFail)// || IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{ {
// return; // return;
} }
...@@ -1193,19 +1193,23 @@ namespace OnlineStore.DeviceLibrary ...@@ -1193,19 +1193,23 @@ namespace OnlineStore.DeviceLibrary
// GetCameraCode(); // GetCameraCode();
IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH); IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH);
LastScanTime = DateTime.Now; LastScanTime = DateTime.Now;
dlScanSocket.BeginScan(); var isdl = dlScanSocket.BeginScan();
Task.Run(()=> { if (isdl)
List<string> codelist; {
if (CodeManager.IsServerAccess()) { Task.Run(() =>
codelist = new List<string>() { "server" };
}
else
{ {
codelist = CodeManager.CameraScan(); List<string> codelist;
} if (CodeManager.IsServerAccess())
onCodeReceived(codelist.ToArray()); {
}); codelist = new List<string>() { "server" };
}
else
{
codelist = CodeManager.CameraScan();
}
onCodeReceived(codelist.ToArray());
});
}
} }
} }
else else
...@@ -1551,7 +1555,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1551,7 +1555,7 @@ namespace OnlineStore.DeviceLibrary
catch (Exception ex) catch (Exception ex)
{ {
IsScanCode = false; IsScanCode = false;
LOGGER.Error(StoreName + ex.StackTrace); LOGGER.Error(StoreName + ex.ToString());
} }
} }
private void ReviceInStoreProcess(string message, Operation resultOperation) private void ReviceInStoreProcess(string message, Operation resultOperation)
...@@ -1564,18 +1568,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -1564,18 +1568,18 @@ namespace OnlineStore.DeviceLibrary
string posId = data[ParamDefine.posId]; string posId = data[ParamDefine.posId];
string plateW = data[ParamDefine.plateW]; string plateW = data[ParamDefine.plateW];
string plateH = data[ParamDefine.plateH]; string plateH = data[ParamDefine.plateH];
string[] posArray = posId.Split('#'); //string[] posArray = posId.Split('#');
if (!(posArray.Length == 2)) //if (!(posArray.Length == 2))
{ //{
InStoreFail = true; // InStoreFail = true;
//WarnMsg = StoreName + "入库库位格式错误:二维码【" + message + "】库位【" + posId + "】"; // //WarnMsg = StoreName + "入库库位格式错误:二维码【" + message + "】库位【" + posId + "】";
SetWarnMsg(ResourceControl.InStoreError, message, posId); // SetWarnMsg(ResourceControl.InStoreError, message, posId);
LogUtil.error(LOGGER, "服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】"); // LogUtil.error(LOGGER, "服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
LogUtil.info(LOGGER, "服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】"); // LogUtil.info(LOGGER, "服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
return; // return;
} //}
int storeId = int.Parse(posArray[0]); //int storeId = int.Parse(posArray[0]);
//根据发送的posId获取位置列表 //根据发送的posId获取位置列表
ACStorePosition position = CSVPositionReader<ACStorePosition>.GetPositon(posId); ACStorePosition position = CSVPositionReader<ACStorePosition>.GetPositon(posId);
if (position == null) if (position == null)
...@@ -1670,7 +1674,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -1670,7 +1674,12 @@ namespace OnlineStore.DeviceLibrary
{ {
//无固定尺寸,判断宽度是否是固定,如果不是固定,直接获取当前高度宽度 //无固定尺寸,判断宽度是否是固定,如果不是固定,直接获取当前高度宽度
codeSize = GetSize() + "x" + GetHeight(); codeSize = GetSize() + "x" + GetHeight();
if (codeList.Count() == 1 && codeList[0] == "server") {
codeSize = IOManager.IOValue(IO_Type.TrayCheck_Door_13).Equals(IO_VALUE.HIGH)?"13":"7" + "x0";
}
} }
foreach (string code in codelists.ToArray()) foreach (string code in codelists.ToArray())
{ {
message = message + "=" + "1+0x0-" + codeSize + "=" + code + dlScanSocket.spiltStr; message = message + "=" + "1+0x0-" + codeSize + "=" + code + dlScanSocket.spiltStr;
......
...@@ -267,11 +267,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -267,11 +267,11 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(LOGGER, StoreName + " 启动入库【" + posId + "】出错,找不到库位信息"); LogUtil.error(LOGGER, StoreName + " 启动入库【" + posId + "】出错,找不到库位信息");
return; return;
} }
if (IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) //if (IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{ //{
LogUtil.error(LOGGER, StoreName + " 启动入库【" + posId + "】出错,叉子料盘检测有料"); // LogUtil.error(LOGGER, StoreName + " 启动入库【" + posId + "】出错,叉子料盘检测有料");
return; // return;
} //}
LogUtil.info(LOGGER, StoreName + " 启动入库【" + posId + "】", storeMoveColor); LogUtil.info(LOGGER, StoreName + " 启动入库【" + posId + "】", storeMoveColor);
storeRunStatus = StoreRunStatus.Busy; storeRunStatus = StoreRunStatus.Busy;
storeStatus = StoreStatus.InStoreExecute; storeStatus = StoreStatus.InStoreExecute;
...@@ -368,6 +368,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -368,6 +368,7 @@ namespace OnlineStore.DeviceLibrary
ComMoveToPosition(moveP.ComPress_P3, Config.CompAxis_P3_Speed); ComMoveToPosition(moveP.ComPress_P3, Config.CompAxis_P3_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed); ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
} }
else else
{ {
...@@ -568,11 +569,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -568,11 +569,11 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(LOGGER, StoreName + " 启动出库【" + posId + "】出错,找不到库位信息"); LogUtil.error(LOGGER, StoreName + " 启动出库【" + posId + "】出错,找不到库位信息");
return false; return false;
} }
if (IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) //if (IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{ //{
LogUtil.error(LOGGER, StoreName + " 启动出库【" + posId + "】出错,叉子料盘检测有料"); // LogUtil.error(LOGGER, StoreName + " 启动出库【" + posId + "】出错,叉子料盘检测有料");
return false; // return false;
} //}
storeStatus = StoreStatus.OutStoreExecute; storeStatus = StoreStatus.OutStoreExecute;
LogUtil.info(LOGGER, StoreName + "启动出库【" + posId + "】 ", storeMoveColor); LogUtil.info(LOGGER, StoreName + "启动出库【" + posId + "】 ", storeMoveColor);
storeRunStatus = StoreRunStatus.Busy; storeRunStatus = StoreRunStatus.Busy;
...@@ -629,6 +630,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -629,6 +630,7 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.Middle_Axis, StoreMove.MoveParam.MoveP.Middle_P2, Config.MiddleAxis_P2_Speed); ACAxisMove(Config.Middle_Axis, StoreMove.MoveParam.MoveP.Middle_P2, Config.MiddleAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.MoveP.UpDown_P5, Config.UpDownAxis_P5_Speed); ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.MoveP.UpDown_P5, Config.UpDownAxis_P5_Speed);
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_03_ToBagPosition) else if (StoreMove.MoveStep == StoreMoveStep.SO_03_ToBagPosition)
{ {
......
...@@ -85,10 +85,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -85,10 +85,10 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 发送扫码命令开始扫码 /// 发送扫码命令开始扫码
/// </summary> /// </summary>
public void BeginScan() public bool BeginScan()
{ {
if (!isScannerRun) if (!isScannerRun)
return; return false;
try try
{ {
string str = ConfigAppSettings.GetValue(Setting_Init.StartScan_CMD); string str = ConfigAppSettings.GetValue(Setting_Init.StartScan_CMD);
...@@ -98,6 +98,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -98,6 +98,7 @@ namespace OnlineStore.DeviceLibrary
{ {
LogUtil.error("【" + ScannerIP + "】开始扫码错误:" + ex.ToString()); LogUtil.error("【" + ScannerIP + "】开始扫码错误:" + ex.ToString());
} }
return true;
} }
......
...@@ -28,6 +28,7 @@ namespace OnlineStore ...@@ -28,6 +28,7 @@ namespace OnlineStore
public string Name = ""; public string Name = "";
public event EventHandler<Bitmap> camera_event; public event EventHandler<Bitmap> camera_event;
public string DeviceName= "monitor1"; public string DeviceName= "monitor1";
bool loop=true;
public void LoadCameraConfig() public void LoadCameraConfig()
{ {
string path = @".\StoreConfig\Camera.json"; string path = @".\StoreConfig\Camera.json";
...@@ -58,6 +59,7 @@ namespace OnlineStore ...@@ -58,6 +59,7 @@ namespace OnlineStore
{ {
LogUtil.error(Name + $"监控相机打开失败"); LogUtil.error(Name + $"监控相机打开失败");
} }
loop = true;
camerathread = new Thread(new ThreadStart(startCamera)); camerathread = new Thread(new ThreadStart(startCamera));
camerathread.Start(); camerathread.Start();
GC.KeepAlive(camerathread); GC.KeepAlive(camerathread);
...@@ -66,7 +68,7 @@ namespace OnlineStore ...@@ -66,7 +68,7 @@ namespace OnlineStore
int errortimes = 0; int errortimes = 0;
void startCamera() void startCamera()
{ {
while (true) while (loop)
{ {
try try
{ {
...@@ -83,24 +85,27 @@ namespace OnlineStore ...@@ -83,24 +85,27 @@ namespace OnlineStore
} }
else if (errortimes == 5) else if (errortimes == 5)
{ {
camera.Open(); camera.Close(DeviceName);
errortimes++; Thread.Sleep(1000);
camera.Open(DeviceName);
errortimes=0;
LogUtil.error(Name + $"相机错误次数过多,重新打开,{errortimes}"); LogUtil.error(Name + $"相机错误次数过多,重新打开,{errortimes}");
Thread.Sleep(5000);
} }
else if (errortimes == 6)
{
LogUtil.error(Name + $"相机连接失败, 相机线程退出,{errortimes}");
break;
}
Thread.Sleep(1000 / 7); Thread.Sleep(1000 / 7);
} }
catch { catch {
errortimes++; errortimes++;
} }
} }
camera.Close(); camera.Close(DeviceName);
camera.Dispose(); camera.Dispose();
} }
public void Close() {
LogUtil.info(Name + "线程退出");
loop = false;
}
public void CameraGrabOne(string filename) public void CameraGrabOne(string filename)
{ {
try try
......
...@@ -86,7 +86,10 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -86,7 +86,10 @@ namespace OnlineStore.LoadCSVLibrary
/// DI 进料口电机异常 Door_RightLimit X13 /// DI 进料口电机异常 Door_RightLimit X13
/// </summary> /// </summary>
public static string Motor_Error = "Motor_Error"; public static string Motor_Error = "Motor_Error";
/// <summary>
/// DI 料盘检测3(进料口) TrayCheck_Door_13 X14
/// </summary>
public static string TrayCheck_Door_13 = "TrayCheck_Door_13";
/// <summary> /// <summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!