Commit 47660d67 张东亮

HY11阻挡放行托盘等待到达HY22信号等待修改

1 个父辈 f3c975c4
......@@ -279,7 +279,7 @@ namespace OnlineStore.AssemblyLine
{
if (lineBean.runStatus != LineRunStatus.Wait)
{
MessageBox.Show(lineBean.Name + "当前状态:" + lineBean.runStatus + ",不能启动!","提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
MessageBox.Show(lineBean.Name + "当前状态:" + lineBean.runStatus + ",不能启动!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
LogUtil.info("点击 开始启动");
......@@ -424,6 +424,8 @@ namespace OnlineStore.AssemblyLine
}
private void timer1_Tick(object sender, EventArgs e)
{
lock (timer1)
{
LogM();
StopRunProcess();
UpdateControl();
......@@ -492,6 +494,7 @@ namespace OnlineStore.AssemblyLine
SetMenuS(停止TToolStripMenuItem, false);
}
}
}
bool stopRun = false;
bool stopRequest = false;
DateTime stopTime = new DateTime();
......@@ -664,11 +667,11 @@ namespace OnlineStore.AssemblyLine
}
}
storeMsg=("BOX[" + storeId + "]").PadLeft(16, ' ') + " ✔ " + LineServer.ClientMap[storeId].AddStr + " " + doorTray + "\n";
storeMsg = ("BOX[" + storeId + "]").PadLeft(16, ' ') + " ✔ " + LineServer.ClientMap[storeId].AddStr + " " + doorTray + "\n";
}
else
{
storeMsg=("BOX[" + storeId + "]").PadLeft(16, ' ') + " ✘ " + "\n";
storeMsg = ("BOX[" + storeId + "]").PadLeft(16, ' ') + " ✘ " + "\n";
}
LogUtil.info(storeMsg);
msg += storeMsg;
......@@ -852,9 +855,9 @@ namespace OnlineStore.AssemblyLine
List<HYEquipBase> hyList = new List<HYEquipBase>(lineBean.HYEquipMap.Values);
int num = 0;
List<int> moveIDList = new List<int>() { 1,3,5,7,9,11,2,4,6,8,10,12,13,15,17,19,21,23,14,16,18,20,22,24 };
List<int> moveIDList = new List<int>() { 1, 3, 5, 7, 9, 11, 2, 4, 6, 8, 10, 12, 13, 15, 17, 19, 21, 23, 14, 16, 18, 20, 22, 24 };
//for (int i = 0; i < moveEquipList.Count; i++)
foreach(int i in moveIDList)
foreach (int i in moveIDList)
{
int index = i - 1;
MoveEquip equip = moveEquipList[index];
......@@ -900,7 +903,7 @@ namespace OnlineStore.AssemblyLine
{
if (i > 0)
{
int index = i - 200-1;
int index = i - 200 - 1;
HYEquipBase equip = hyList[index];
EquipControl control = EquipControl.NewControl(equip);
......@@ -931,7 +934,7 @@ namespace OnlineStore.AssemblyLine
private EquipBase seleEquip = null;
private EquipControl selControl = null;
private Dictionary<int, FrmEquipBase> FormMap = new Dictionary<int, FrmEquipBase>();
private void Control_Click(object sender ,EventArgs s)
private void Control_Click(object sender, EventArgs s)
{
if (sender is EquipControl)
{
......@@ -946,15 +949,15 @@ namespace OnlineStore.AssemblyLine
if (lineBean.MoveEquipMap.ContainsKey(deviceId))
{
seleEquip=lineBean.MoveEquipMap[deviceId];
seleEquip = lineBean.MoveEquipMap[deviceId];
}
else if (lineBean.FeedingEquipMap.ContainsKey(deviceId))
{
seleEquip=lineBean.FeedingEquipMap[deviceId];
seleEquip = lineBean.FeedingEquipMap[deviceId];
}
else if (lineBean.HYEquipMap.ContainsKey(deviceId))
{
seleEquip=lineBean.HYEquipMap[deviceId];
seleEquip = lineBean.HYEquipMap[deviceId];
}
if (seleEquip.runStatus > LineRunStatus.Wait)
......@@ -1054,7 +1057,7 @@ namespace OnlineStore.AssemblyLine
bool result = seleEquip.Reset();
if (!result)
{
MessageBox.Show("[" + seleEquip.Name + "]复位失败:" + seleEquip.WarnMsg,"错误",MessageBoxButtons.OK,MessageBoxIcon.Error);
MessageBox.Show("[" + seleEquip.Name + "]复位失败:" + seleEquip.WarnMsg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else
......@@ -1158,7 +1161,7 @@ namespace OnlineStore.AssemblyLine
}
bool result = 自动保存托盘信息ToolStripMenuItem.Text.Contains(gouStr);
if (result.Equals( TrayManager.DisTraySave))
if (result.Equals(TrayManager.DisTraySave))
{
return;
}
......@@ -1189,7 +1192,7 @@ namespace OnlineStore.AssemblyLine
if (LineManager.DisLeftOutLine)
{
LogUtil.info("界面点击勾选:" + chbLeftDis.Text + "=" + LineManager.DisLeftOutLine+",设置 HY5,HY7,HY10 为调试状态");
LogUtil.info("界面点击勾选:" + chbLeftDis.Text + "=" + LineManager.DisLeftOutLine + ",设置 HY5,HY7,HY10 为调试状态");
}
else
{
......@@ -1198,7 +1201,7 @@ namespace OnlineStore.AssemblyLine
List<int> leftHYs = new List<int>() { 205, 207, 210 };
foreach (int id in leftHYs)
{
bool isD = LineManager.DisLeftOutLine ? true: LineManager.Line.HYEquipMap[id].Config.IsDebug.Equals(1);
bool isD = LineManager.DisLeftOutLine ? true : LineManager.Line.HYEquipMap[id].Config.IsDebug.Equals(1);
LineManager.Line.HYEquipMap[id].IsDebug = isD;
}
}
......@@ -1293,7 +1296,7 @@ namespace OnlineStore.AssemblyLine
Bitmap bitmap = new Bitmap("test.bmp");
List<CodeInfo> LastCodeList = RemoteDecodeHelper.DecodeRequest(bitmap, remoteDecodeParam);
List<string> test = new List<string>();
foreach(CodeInfo codeInfo in LastCodeList)
foreach (CodeInfo codeInfo in LastCodeList)
{
test.Add(codeInfo.CodeStr);
}
......
......@@ -247,11 +247,11 @@ namespace OnlineStore.DeviceLibrary
}
else
{
bool check2IsOk = CheckStopWatch(trayCheckLowWait, TrayWaitTime, false)||String.IsNullOrEmpty(RFIDIP);
bool check2IsOk = CheckStopWatch(trayCheckLowWait, TrayWaitTime, false) || String.IsNullOrEmpty(RFIDIP);
bool isHY11 = DeviceID.Equals(211);//HY11优先处理C5出来的托盘
isHY11 = false;
if ((preTrayIsC1Line||isHY11) && Config.IsOutLineOut && IOValue(IO_Type.HY_OL_Tray_Check).Equals(IO_VALUE.HIGH))
if ((preTrayIsC1Line || isHY11) && Config.IsOutLineOut && IOValue(IO_Type.HY_OL_Tray_Check).Equals(IO_VALUE.HIGH))
{
StopDownCount = 0;
//C1线和出料线交替处理
......@@ -290,9 +290,9 @@ namespace OnlineStore.DeviceLibrary
private bool IsHY11()
{
if ( DeviceID.Equals(211))
if (DeviceID.Equals(211))
{
return true ;
return true;
}
return false;
}
......@@ -383,7 +383,7 @@ namespace OnlineStore.DeviceLibrary
{
if (!IsHY11())
{
return false ;
return false;
}
if (IOValue(IO_Type.HY22_FStopDown).Equals(IO_VALUE.HIGH))
{
......@@ -434,7 +434,7 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(null, IO_Type.HY_TopCylinder_Up, IO_Type.HY_TopCylinder_Down);
IOMove(IO_Type.HY_OL_StopDown, IO_VALUE.LOW);
MoveInfo.OneWaitCanEndStep = true;
if ( IOValue(IO_Type.HY_FrontStopDown).Equals(IO_VALUE.LOW))
if (IOValue(IO_Type.HY_FrontStopDown).Equals(IO_VALUE.LOW))
{
LogInfo(" 托盘检测:" + MoveInfo.SLog + ",重新写前阻挡下降");
IOMove(IO_Type.HY_FrontStopDown, IO_VALUE.HIGH);
......@@ -556,7 +556,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(Name + " HY71_OL_Wait " + "失败,未得到锁");
}
}
internal void HY03_FrontStopUp(int timeout= 20000,bool frontStopUp=true)
internal void HY03_FrontStopUp(int timeout = 20000, bool frontStopUp = true)
{
frontTrayCheckWait.Stop();
trayCheckLowWait.Stop();
......@@ -577,7 +577,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(timeout));
}
private int StopDownCount = 0;
private void EndOrReStopDown(string msg )
private void EndOrReStopDown(string msg)
{
if (StopDownCount == 0)
{
......@@ -1022,7 +1022,8 @@ namespace OnlineStore.DeviceLibrary
OL_StopCylinderDown(MoveInfo);
HY_StopCylinderUp(MoveInfo);
}
}else if (MoveInfo.IsStep(LineMoveStep.HY72_OL_WaitHY22))
}
else if (MoveInfo.IsStep(LineMoveStep.HY72_OL_WaitHY22))
{
MoveInfo.NextMoveStep(LineMoveStep.HY73_OL_TopUp);
CheckLog("托盘阻挡" + MoveInfo.SLog + " 开始横移,顶升上升,出料线阻挡气缸下降,横移阻挡气缸上升");
......@@ -1043,11 +1044,16 @@ namespace OnlineStore.DeviceLibrary
CheckLog("托盘阻挡" + MoveInfo.SLog + " 等待出料线托盘检测无信号");
IOMove(IO_Type.HY_OL_StopDown, IO_VALUE.HIGH, 1200);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_OL_Tray_Check, IO_VALUE.LOW));
if (DeviceID.Equals(211) && Config.DIList.ContainsKey(IO_Type.HY22_TrayCheck))
{
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY22_TrayCheck, IO_VALUE.HIGH));
MoveInfo.OneWaitCanEndStep = true;
}
}
else if (MoveInfo.IsStep(LineMoveStep.HY75_OL_StopDown))
{
MoveInfo.NextMoveStep(LineMoveStep.HY76_OL_WaitTray);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_OL_Tray_Check, IO_VALUE.LOW));
// MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_OL_Tray_Check, IO_VALUE.LOW));
if (DeviceID.Equals(211) && Config.DIList.ContainsKey(IO_Type.HY22_TrayCheck))
{
......@@ -1185,7 +1191,7 @@ namespace OnlineStore.DeviceLibrary
private int hyIndex = 0;
private void HY11_TopUpToHY()
{
HY_C1Line hyout =(HY_C1Line) GetHyOutEquip();
HY_C1Line hyout = (HY_C1Line)GetHyOutEquip();
if (hyout.HYOut51_WaitFree())
{
MoveInfo.NextMoveStep(LineMoveStep.HY13_WaitHY2Ready);
......@@ -1218,7 +1224,7 @@ namespace OnlineStore.DeviceLibrary
if (Config.IsSideWayIn && trayNum > 0)
{
//出口启动才能横移
HYEquipBase hyE= GetHyOutEquip();
HYEquipBase hyE = GetHyOutEquip();
if (hyE == null || hyE.runStatus <= LineRunStatus.Wait)
{
return false;
......@@ -1318,7 +1324,7 @@ namespace OnlineStore.DeviceLibrary
MoveEquip move14 = LineManager.Line.MoveEquipMap[14];
MoveEquip move15 = LineManager.Line.MoveEquipMap[15];
MoveEquip move16 = LineManager.Line.MoveEquipMap[16];
if (move14.hasTray()&& move15.hasTray() && move16.hasTray())
if (move14.hasTray() && move15.hasTray() && move16.hasTray())
{
return true;
}
......@@ -1343,7 +1349,7 @@ namespace OnlineStore.DeviceLibrary
{
return false;
}
if (tray.InoutPar.cutReel )
if (tray.InoutPar.cutReel)
{
if (preToOut4)
......@@ -1409,7 +1415,7 @@ namespace OnlineStore.DeviceLibrary
{
//如果横移20和横移21都有托盘, ,空托盘需要横移,不需要判断是否都在 顶升
if (IOManager.IOValue(IO_Type.HY_TrayCheck, 220).Equals(IO_VALUE.HIGH)
&& IOManager.IOValue(IO_Type.HY_TrayCheck, 221).Equals(IO_VALUE.HIGH) )
&& IOManager.IOValue(IO_Type.HY_TrayCheck, 221).Equals(IO_VALUE.HIGH))
// if (IOManager.IOValue(IO_Type.HY_TrayCheck, 220).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.HY_TopCylinder_Up, 220).Equals(IO_VALUE.HIGH)
//&& IOManager.IOValue(IO_Type.HY_TrayCheck, 221).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.HY_TopCylinder_Up, 221).Equals(IO_VALUE.HIGH))
{
......@@ -1427,7 +1433,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error(Name+"TrayNeed 出错:" + ex.ToString());
LogUtil.error(Name + "TrayNeed 出错:" + ex.ToString());
}
return false;
}
......@@ -1665,7 +1671,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error(Name+"TrayNeedToOutLine 出错:" + ex.ToString());
LogUtil.error(Name + "TrayNeedToOutLine 出错:" + ex.ToString());
}
return false;
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!