Commit 5d86a6d0 LN

1

1 个父辈 c0a0de6a
......@@ -310,22 +310,7 @@ namespace OnlineStore.AssemblyLine
equipBean.Reset();
}
}
private void btnStop1Up_Click(object sender, EventArgs e)
{
LogUtil.info("点击【" + btnStop1Up.Text + "】 ");
if (btnStop1Up.Text.Equals("定位气缸上升"))
{
equipBean.CylinderMove(null, IO_Type.SeparateDevice_Down, IO_Type.SeparateDevice_Up);
btnStop1Up.Text = "定位气缸下降";
btnStop1Up.BackColor = Color.Aqua;
}
else
{
equipBean.CylinderMove(null, IO_Type.SeparateDevice_Up, IO_Type.SeparateDevice_Down);
btnStop1Up.Text = "定位气缸上升";
btnStop1Up.BackColor = Color.SkyBlue;
}
}
private void btnCloseAll_Click(object sender, EventArgs e)
{
......@@ -338,7 +323,29 @@ namespace OnlineStore.AssemblyLine
}
}
}
private void btnStop1Up_Click(object sender, EventArgs e)
{
BtnMove(btnStop1Up, "定位气缸上升", "定位气缸下降", IO_Type.SeparateDevice_Down, IO_Type.SeparateDevice_Up);
}
private void btnRun1_Click(object sender, EventArgs e)
{
BtnMove(btnRun1, "皮带线1运转", "皮带线1停止", IO_Type.DLine_Run1);
}
private void btnRun2_Click(object sender, EventArgs e)
{
BtnMove(btnRun2, "皮带线2运转", "皮带线2停止", IO_Type.DLine_Run2);
}
private void btnRun3_Click(object sender, EventArgs e)
{
BtnMove(btnRun3, "皮带线3运转", "皮带线3停止", IO_Type.DLine_Run3);
}
private void btnSRun_Click(object sender, EventArgs e)
{
BtnMove(btnRun3, "分盘装置电机1驱动", "分盘装置电机1停止", IO_Type.SeparateDevice_Run);
}
}
}
......
......@@ -626,6 +626,30 @@ namespace OnlineStore.AssemblyLine
}
private void btnLineRun_Click(object sender, EventArgs e)
{
BtnMove(btnLineRun, "SL进料线体运转", "SL进料线体停止", IO_Type.SL_Line_Run);
}
private void btnLSWRun_Click(object sender, EventArgs e)
{
BtnMove(btnLSWRun, "SL线体定位横移电机运转", "SL线体定位横移电机停止", IO_Type.SL_LocationSideWay_Run);
}
private void btnOSWRun_Click(object sender, EventArgs e)
{
BtnMove(btnOSWRun, "SL线体出口横移电机运转", "SL线体出口横移电机停止", IO_Type.SL_OutSideWay_Run);
}
private void btnEStopDown_Click(object sender, EventArgs e)
{
BtnMove(btnEStopDown, "SL进料阻挡下降", "SL进料阻挡上升", IO_Type.SL_Entry_StopDown);
}
private void btnBStopDown_Click(object sender, EventArgs e)
{
BtnMove(btnBStopDown, "缓冲阻挡下降", "缓冲阻挡上升", IO_Type.SL_Buffer_StopDown);
}
}
}
......
......@@ -378,7 +378,7 @@
this.btnStop2Up.Name = "btnStop2Up";
this.btnStop2Up.Size = new System.Drawing.Size(140, 34);
this.btnStop2Up.TabIndex = 258;
this.btnStop2Up.Text = "阻挡气缸2下降";
this.btnStop2Up.Text = "阻挡2下降";
this.btnStop2Up.UseVisualStyleBackColor = false;
this.btnStop2Up.Click += new System.EventHandler(this.btnStop2Up_Click);
//
......@@ -391,7 +391,7 @@
this.btnStop1Up.Name = "btnStop1Up";
this.btnStop1Up.Size = new System.Drawing.Size(140, 34);
this.btnStop1Up.TabIndex = 256;
this.btnStop1Up.Text = "阻挡气缸1下降";
this.btnStop1Up.Text = "阻挡1下降";
this.btnStop1Up.UseVisualStyleBackColor = false;
this.btnStop1Up.Click += new System.EventHandler(this.btnStop1Up_Click);
//
......@@ -400,7 +400,7 @@
this.btnClampSlack.BackColor = System.Drawing.Color.White;
this.btnClampSlack.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClampSlack.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClampSlack.Location = new System.Drawing.Point(220, 72);
this.btnClampSlack.Location = new System.Drawing.Point(44, 116);
this.btnClampSlack.Name = "btnClampSlack";
this.btnClampSlack.Size = new System.Drawing.Size(140, 34);
this.btnClampSlack.TabIndex = 255;
......@@ -426,11 +426,11 @@
this.btnBeforeAfterBefore.BackColor = System.Drawing.Color.White;
this.btnBeforeAfterBefore.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBeforeAfterBefore.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnBeforeAfterBefore.Location = new System.Drawing.Point(44, 116);
this.btnBeforeAfterBefore.Location = new System.Drawing.Point(220, 72);
this.btnBeforeAfterBefore.Name = "btnBeforeAfterBefore";
this.btnBeforeAfterBefore.Size = new System.Drawing.Size(140, 34);
this.btnBeforeAfterBefore.TabIndex = 249;
this.btnBeforeAfterBefore.Text = "前后气缸前进";
this.btnBeforeAfterBefore.Text = "横移前进";
this.btnBeforeAfterBefore.UseVisualStyleBackColor = false;
this.btnBeforeAfterBefore.Click += new System.EventHandler(this.btnBeforeAfterBefore_Click);
//
......@@ -622,7 +622,7 @@
this.tabPage2.Location = new System.Drawing.Point(4, 26);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(1288, 646);
this.tabPage2.Size = new System.Drawing.Size(1365, 776);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = " 伺服信息 ";
this.tabPage2.UseVisualStyleBackColor = true;
......
......@@ -320,7 +320,7 @@
this.btnStop2Up.Name = "btnStop2Up";
this.btnStop2Up.Size = new System.Drawing.Size(140, 34);
this.btnStop2Up.TabIndex = 258;
this.btnStop2Up.Text = "阻挡气缸2下降";
this.btnStop2Up.Text = "阻挡2下降";
this.btnStop2Up.UseVisualStyleBackColor = false;
this.btnStop2Up.Click += new System.EventHandler(this.btnStop2Up_Click);
//
......@@ -333,7 +333,7 @@
this.btnStop1Up.Name = "btnStop1Up";
this.btnStop1Up.Size = new System.Drawing.Size(140, 34);
this.btnStop1Up.TabIndex = 256;
this.btnStop1Up.Text = "阻挡气缸1下降";
this.btnStop1Up.Text = "阻挡1下降";
this.btnStop1Up.UseVisualStyleBackColor = false;
this.btnStop1Up.Click += new System.EventHandler(this.btnStop1Up_Click);
//
......@@ -342,7 +342,7 @@
this.btnClampSlack.BackColor = System.Drawing.Color.White;
this.btnClampSlack.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClampSlack.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClampSlack.Location = new System.Drawing.Point(220, 72);
this.btnClampSlack.Location = new System.Drawing.Point(44, 116);
this.btnClampSlack.Name = "btnClampSlack";
this.btnClampSlack.Size = new System.Drawing.Size(140, 34);
this.btnClampSlack.TabIndex = 255;
......@@ -368,7 +368,7 @@
this.btnBeforeAfterBefore.BackColor = System.Drawing.Color.White;
this.btnBeforeAfterBefore.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBeforeAfterBefore.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnBeforeAfterBefore.Location = new System.Drawing.Point(44, 116);
this.btnBeforeAfterBefore.Location = new System.Drawing.Point(220, 72);
this.btnBeforeAfterBefore.Name = "btnBeforeAfterBefore";
this.btnBeforeAfterBefore.Size = new System.Drawing.Size(140, 34);
this.btnBeforeAfterBefore.TabIndex = 249;
......
类型,分类编号,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义
PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,1,,,,,
PRO,0,扫码的相机名称(多个用#分隔),CameraNameList,Name1#Name1,,,,,
,,,,,,,,,
DI,0,出料皮带线体1急停,DLine_SuddenStop,0,192.168.200.12,0,出料皮带线体1急停,X021,X021
DI,0,出料皮带线体1复位,DLine_Reset,1,192.168.200.12,0,出料皮带线体1复位,X022,X022
......
类型,分类编号,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义
PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,1,,,,,
PRO,0,扫码的相机名称(多个用#分隔),CameraNameList,Name1#Name1,,,,,
,,,,,,,,,
DI,0,出料皮带线体2急停,DLine_SuddenStop,0,192.168.200.13,0,出料皮带线体2急停,X041,X041
DI,0,出料皮带线体2复位,DLine_Reset,1,192.168.200.13,0,出料皮带线体2复位,X042,X042
......
......@@ -437,7 +437,7 @@ namespace OnlineStore.DeviceLibrary
continue;
}
NotOkMsg = wait.ToStr();
if (wait.WaitType.Equals(1))
if (wait.WaitType.Equals(WaitEnum.W001_AxisMove))
{
string msg = "";
if (wait.IsHomeMove)
......@@ -452,11 +452,11 @@ namespace OnlineStore.DeviceLibrary
{
isOk = false;
WarnMsg = msg;
Alarm(LineAlarmType.AxisMoveError );
Alarm(LineAlarmType.AxisMoveError);
break;
}
}
else if (wait.WaitType.Equals(2))
else if (wait.WaitType.Equals(WaitEnum.W002_IOValue))
{
NotOkMsg = " (" + baseConfig.GetDisplayName(wait.IoType) + "=" + wait.IoValue + ") ";
wait.IsEnd = IOValue(wait.IoType).Equals(wait.IoValue);
......@@ -469,7 +469,7 @@ namespace OnlineStore.DeviceLibrary
// LogUtil.debug(moveInfo.Name + "未检测到:IsUse_Tray_Check= " + wait.IoValue + ",直接跳过检测继续下一步");
//}
//夹紧按钮若果超过一秒钟还未收到,默认成功
if (wait.IoType.Equals(IO_Type.ClampCylinder_Slack) && wait.IoValue.Equals(IO_VALUE.HIGH) && span.TotalMilliseconds > 4000)
if (wait.IoType.Equals(IO_Type.ClampCylinder_Slack) && wait.IoValue.Equals(IO_VALUE.HIGH) && span.TotalMilliseconds > 4000)
{
LogInfo("未检测到:ClampCylinder_Slack=HIGH,超过4秒钟,默认下一步骤");
wait.IsEnd = true;
......@@ -482,8 +482,8 @@ namespace OnlineStore.DeviceLibrary
{
ConfigIO io = baseConfig.getWaitIO(wait.IoType);
WarnMsg = Name + "等待" + NotOkMsg + " 超时";
Alarm(LineAlarmType.IoSingleTimeOut );
LogUtil.error(MoveInfo.Name + WarnMsg, 13);
Alarm(LineAlarmType.IoSingleTimeOut);
LogUtil.error(MoveInfo.Name + WarnMsg, DeviceID+ 13);
}
else if (rwSpan.TotalSeconds > 3 && span.TotalSeconds > 3)
{
......@@ -509,21 +509,25 @@ namespace OnlineStore.DeviceLibrary
}
}
}
else if (wait.WaitType.Equals(3))
else if (wait.WaitType.Equals(WaitEnum.W003_Time))
{
wait.IsEnd = (span.TotalMilliseconds >= wait.TimeMSeconds);
}
else if (wait.WaitType.Equals(8))
else if (wait.WaitType.Equals(WaitEnum.W008_InStoreCheckOK))
{
string posId = moveInfo.MoveParam.PosId;
int id = moveInfo.MoveParam.GetStoreId();
wait.IsEnd = LineServer.RightInPosId(id, posId);
}
else if (wait.WaitType.Equals(9))
else if (wait.WaitType.Equals(WaitEnum.W009_BoxCanInstore))
{
int storeId = moveInfo.MoveParam.GetStoreId();
wait.IsEnd = LineServer.BoxCanReviceTray(storeId);
}
else
{
wait.IsEnd = CheckWaitResult(wait);
}
//else if (wait.WaitType.Equals(10))
//{
// wait.IsEnd = LineManager.Line.SideWay34HasTray().Equals(false);
......@@ -547,12 +551,17 @@ namespace OnlineStore.DeviceLibrary
{
WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "]等待[" + NotOkMsg
+ "]超时[" + Math.Round(span.TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, 18);
LogUtil.error(WarnMsg,DeviceID+ 18);
Alarm(LineAlarmType.IoSingleTimeOut );
}
}
protected virtual bool CheckWaitResult(WaitResultInfo wait)
{
return false;
}
#endregion
protected void CheckLog(string msg)
......
......@@ -99,7 +99,7 @@ namespace OnlineStore.DeviceLibrary
{
//preTrayNum = currMoveTrayNum;
SecondMoveInfo.MoveParam = new InOutParam(currMoveTrayNum);
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_05_CodeRember);
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_11_CodeRember);
SecondMoveInfo.EndStepWait();
return;
}
......@@ -118,8 +118,8 @@ namespace OnlineStore.DeviceLibrary
{
TrayManager.UpdateTrayNumError(-1, "");
}
CheckLog("托盘放行 SecondStoreMove:(MO_07_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_07_WaitCanGo);
CheckLog("托盘放行 SecondStoreMove:(MO_13_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_13_WaitCanGo);
}
catch (Exception ex)
......@@ -150,7 +150,7 @@ namespace OnlineStore.DeviceLibrary
{
SecondMoveInfo.MoveParam = new InOutParam(currMoveTrayNum);
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currMoveTrayNum + "】可以放出料托盘,正在出料中,移栽料盘");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_05_CodeRember);
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_11_CodeRember);
SecondMoveInfo.EndStepWait();
}
else
......@@ -160,8 +160,8 @@ namespace OnlineStore.DeviceLibrary
{
TrayManager.UpdateTrayNumError(-1, "");
}
CheckLog("托盘检测 SecondStoreMove:(MO_09_TopCylinder_Down ,托盘号【" + currMoveTrayNum + "】,直接放盘通过,顶升气缸下降)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_06_TopCylinder_Down);
CheckLog("托盘检测 SecondStoreMove:(MO_12_TopCylinder_Down ,托盘号【" + currMoveTrayNum + "】,直接放盘通过,顶升气缸下降)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_TopCylinder_Down);
CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
}
......@@ -175,10 +175,10 @@ namespace OnlineStore.DeviceLibrary
#endregion
#region 不需要出出料,直接放行
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_06_TopCylinder_Down))
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_12_TopCylinder_Down))
{
CheckLog("托盘放行 SecondStoreMove:(MO_07_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_07_WaitCanGo);
CheckLog("托盘放行 SecondStoreMove:(MO_13_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_13_WaitCanGo);
//更新横移托盘已处理完成
TrayManager.UpdateSWState(Config.SidesWayNum, 1);
//if (DeviceID.Equals(2))
......@@ -189,29 +189,29 @@ namespace OnlineStore.DeviceLibrary
//}
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_07_WaitCanGo))
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_13_WaitCanGo))
{
CheckLog("托盘放行 SecondStoreMove:(MO_10_StopCylinder2_Down ,阻挡气缸1-2下降)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_10_StopCylinder2_Down);
CheckLog("托盘放行 SecondStoreMove:(MO_14_StopCylinder2_Down ,阻挡气缸1-2下降)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_StopCylinder2_Down);
IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.HIGH);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Down2, IO_VALUE.HIGH));
// SecondMoveInfo.EndStepWait();
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_10_StopCylinder2_Down))
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_14_StopCylinder2_Down))
{
CheckLog("托盘放行 SecondStoreMove:(MO_11_Tray_Check , 阻挡2托盘检测=0), 延时2秒)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_11_Tray_Check);
CheckLog("托盘放行 SecondStoreMove:(MO_15_Tray_Check , 阻挡2托盘检测=0), 延时2秒)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_15_Tray_Check);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Check2, IO_VALUE.LOW));
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_11_Tray_Check))
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_15_Tray_Check))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_StopCylinder_Back);
CheckLog("托盘放行 SecondStoreMove:(MO_12_StopCylinder_Back , 阻挡气缸1-2上升 )");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_16_StopCylinder_Back);
CheckLog("托盘放行 SecondStoreMove:(MO_16_StopCylinder_Back , 阻挡气缸1-2上升 )");
IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.LOW);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Down2, IO_VALUE.LOW));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200));
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_12_StopCylinder_Back))
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_16_StopCylinder_Back))
{
preTrayNum = currMoveTrayNum;
CheckLog("托盘放行 SecondStoreMove:(托盘放行结束) ");
......
......@@ -284,7 +284,7 @@ namespace OnlineStore.DeviceLibrary
continue;
}
NotOkMsg = wait.ToStr();
if (wait.WaitType == 2)
if (wait.WaitType .Equals(WaitEnum.W002_IOValue))
{
NotOkMsg = " (" + Config.GetDisplayName(wait.IoType) + "=" + wait.IoValue + ") ";
wait.IsEnd = IOValue(wait.IoType).Equals(wait.IoValue);
......@@ -317,17 +317,17 @@ namespace OnlineStore.DeviceLibrary
}
}
}
else if (wait.WaitType == 3)
else if (wait.WaitType.Equals(WaitEnum.W003_Time))
{
wait.IsEnd = (span.TotalMilliseconds >= wait.TimeMSeconds);
}
else if (wait.WaitType == 8)
else if (wait.WaitType.Equals(WaitEnum.W008_InStoreCheckOK))
{
string posId = checkWaitInfo.MoveParam.PosId;
int id = checkWaitInfo.MoveParam.GetStoreId();
wait.IsEnd = LineServer.RightInPosId(id, posId);
}
else if (wait.WaitType.Equals(9))
else if (wait.WaitType.Equals(WaitEnum.W009_BoxCanInstore))
{
int storeId = checkWaitInfo.MoveParam.GetStoreId();
wait.IsEnd = LineServer.BoxCanReviceTray(storeId);
......
......@@ -104,7 +104,7 @@ namespace OnlineStore.DeviceLibrary
#endregion
#region 移载装置,放物品到流水线操作
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_05_CodeRember)
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_11_CodeRember)
&& MoveInfo.MoveStep.Equals(LineMoveStep.MO_56_BeforeAfterCylinderAfter)
&& !SecondMoveInfo.IsInWait)
{
......@@ -163,7 +163,7 @@ namespace OnlineStore.DeviceLibrary
TrayManager.DelNeedEmptyTrayNum();
OutStoreLog("出库 SecondStoreMove:移栽完成,放行托盘");
SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_06_TopCylinder_Down);
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_TopCylinder_Down);
CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
LogInfo("【" + posId + "】出库处理结束,!");
......@@ -252,9 +252,9 @@ namespace OnlineStore.DeviceLibrary
TrayManager.UpdateFixtureValue(num );
//阻挡气缸移动
InStoreLog("放托盘(放开阻挡):SecondStoreMove=MO_09_TopCylinder_Down 物品已移走,顶升气缸1下降)");
InStoreLog("放托盘(放开阻挡):SecondStoreMove=MO_12_TopCylinder_Down 物品已移走,顶升气缸1下降)");
SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_06_TopCylinder_Down);
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_TopCylinder_Down);
CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_10_WaitBox))
......@@ -499,7 +499,7 @@ namespace OnlineStore.DeviceLibrary
{
//preTrayNum = currMoveTrayNum;
SecondMoveInfo.MoveParam = new InOutParam(currMoveTrayNum);
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_05_CodeRember);
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_11_CodeRember);
SecondMoveInfo.EndStepWait();
return;
}
......@@ -529,8 +529,8 @@ namespace OnlineStore.DeviceLibrary
{
TrayManager.UpdateTrayNumError(-1, "");
}
CheckLog("托盘放行 SecondStoreMove:(MO_07_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_07_WaitCanGo);
CheckLog("托盘放行 SecondStoreMove:(MO_13_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_13_WaitCanGo);
if (DeviceID.Equals(2))
{
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000));
......@@ -569,7 +569,7 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo.MoveParam = new InOutParam(currMoveTrayNum);
isNeedMove = true;
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currMoveTrayNum + "】可以放出库托盘,正在出库中,移栽料盘");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_05_CodeRember);
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_11_CodeRember);
SecondMoveInfo.EndStepWait();
}
else
......@@ -592,8 +592,8 @@ namespace OnlineStore.DeviceLibrary
{
TrayManager.UpdateTrayNumError(-1, "");
}
CheckLog("托盘检测 SecondStoreMove:(MO_09_TopCylinder_Down ,托盘号【" + currMoveTrayNum + "】,直接放盘通过,顶升气缸下降)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_06_TopCylinder_Down);
CheckLog("托盘检测 SecondStoreMove:(MO_12_TopCylinder_Down ,托盘号【" + currMoveTrayNum + "】,直接放盘通过,顶升气缸下降)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_TopCylinder_Down);
CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
}
......@@ -607,10 +607,10 @@ namespace OnlineStore.DeviceLibrary
#endregion
#region 不需要出入库,直接放行
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_06_TopCylinder_Down))
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_12_TopCylinder_Down))
{
CheckLog("托盘放行 SecondStoreMove:(MO_07_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_07_WaitCanGo);
CheckLog("托盘放行 SecondStoreMove:(MO_13_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_13_WaitCanGo);
if (DeviceID.Equals(2))
{
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000));
......@@ -619,29 +619,29 @@ namespace OnlineStore.DeviceLibrary
}
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_07_WaitCanGo))
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_13_WaitCanGo))
{
CheckLog("托盘放行 SecondStoreMove:(MO_10_StopCylinder2_Down ,阻挡气缸1-2下降)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_10_StopCylinder2_Down);
CheckLog("托盘放行 SecondStoreMove:(MO_14_StopCylinder2_Down ,阻挡气缸1-2下降)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_StopCylinder2_Down);
IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.HIGH);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Down2, IO_VALUE.HIGH));
// SecondMoveInfo.EndStepWait();
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_10_StopCylinder2_Down))
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_14_StopCylinder2_Down))
{
CheckLog("托盘放行 SecondStoreMove:(MO_11_Tray_Check , 阻挡2托盘检测=0), 延时2秒)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_11_Tray_Check);
CheckLog("托盘放行 SecondStoreMove:(MO_15_Tray_Check , 阻挡2托盘检测=0), 延时2秒)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_15_Tray_Check);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Check2, IO_VALUE.LOW));
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_11_Tray_Check))
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_15_Tray_Check))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_StopCylinder_Back);
CheckLog("托盘放行 SecondStoreMove:(MO_12_StopCylinder_Back , 阻挡气缸1-2上升 )");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_16_StopCylinder_Back);
CheckLog("托盘放行 SecondStoreMove:(MO_16_StopCylinder_Back , 阻挡气缸1-2上升 )");
IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.LOW);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Down2, IO_VALUE.LOW));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200));
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_12_StopCylinder_Back))
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_16_StopCylinder_Back))
{
preTrayNum = currMoveTrayNum;
CheckLog("托盘放行 SecondStoreMove:(托盘放行结束) ");
......
......@@ -76,6 +76,18 @@ namespace OnlineStore.DeviceLibrary
}
return false;
}
internal static TrayInfo GetTrayInfo(int trayNum)
{
lock (fixtureMapLock)
{
if (fixtureCodeFullMap.ContainsKey(trayNum))
{
return fixtureCodeFullMap[trayNum];
}
}
return null;
}
///// <summary>
///// 托盘是否可以累积扔盘,判断是出库的托盘,并且所放的托盘为七寸
///// </summary>
......
......@@ -170,7 +170,7 @@ namespace OnlineStore.DeviceLibrary
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 0;
wait.WaitType = 2;
wait.WaitType = WaitEnum.W002_IOValue;
wait.IoType = ioType;
wait.IoValue = ioValue;
wait.IsEnd = false;
......@@ -180,7 +180,7 @@ namespace OnlineStore.DeviceLibrary
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 0;
wait.WaitType = 1;
wait.WaitType = WaitEnum.W001_AxisMove;
wait.AxisInfo = axis;
wait.IsHomeMove = false;
wait.TargetPosition = targetPosition;
......@@ -192,7 +192,7 @@ namespace OnlineStore.DeviceLibrary
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 0;
wait.WaitType = 1;
wait.WaitType = WaitEnum.W001_AxisMove;
wait.AxisInfo = axis;
wait.IsHomeMove = true;
wait.IsEnd = false;
......@@ -202,7 +202,7 @@ namespace OnlineStore.DeviceLibrary
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount =10;
wait.WaitType = 4;
wait.WaitType = WaitEnum.W004_StellMove;
wait.SlvAddr = slvAddr;
wait.IsHomeMove = false;
wait.TargetPosition = targetPosition;
......@@ -214,7 +214,7 @@ namespace OnlineStore.DeviceLibrary
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 10;
wait.WaitType = 4;
wait.WaitType = WaitEnum.W004_StellMove;
wait.SlvAddr = slvAddr;
wait.IsHomeMove = true;
wait.TargetPosition = 0;
......@@ -226,8 +226,8 @@ namespace OnlineStore.DeviceLibrary
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 0;
wait.WaitType = 5;
wait.SlvAddr =(byte) slvAddr;
wait.WaitType = WaitEnum.W005_ShuoKe;
wait.SlvAddr =(byte) slvAddr;
wait.TargetPosition = targetPosition;
wait.IsHomeMove = isHome;
return wait;
......@@ -236,7 +236,7 @@ namespace OnlineStore.DeviceLibrary
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 0;
wait.WaitType = 3;
wait.WaitType = WaitEnum.W003_Time;
wait.TimeMSeconds = MScends;
wait.IsEnd = false;
return wait;
......@@ -245,7 +245,7 @@ namespace OnlineStore.DeviceLibrary
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 0;
wait.WaitType = 6;
wait.WaitType = WaitEnum.W006_AxisOrg;
wait.AxisInfo = axis;
wait.IsHomeMove = true;
wait.IoValue = value;
......@@ -256,7 +256,7 @@ namespace OnlineStore.DeviceLibrary
public static WaitResultInfo WaitHeight(int height)
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = 7;
wait.WaitType = WaitEnum.W007_ReelHeight;
wait.HeightValue = height;
wait.IsEnd = false;
return wait;
......@@ -264,24 +264,34 @@ namespace OnlineStore.DeviceLibrary
public static WaitResultInfo WaitCanInstore()
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = 8;
wait.WaitType = WaitEnum.W008_InStoreCheckOK;
return wait;
}
public static WaitResultInfo WaitBoxCanReviceTray( )
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = 9;
wait.WaitType = WaitEnum.W009_BoxCanInstore;
return wait;
}
public static WaitResultInfo WaitSideWay()
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = 10;
wait.WaitType = WaitEnum.W010_SW34NoTray;
return wait;
}
/// <summary>
/// 等待出料移栽可以开始移栽
/// </summary>
/// <returns></returns>
public static WaitResultInfo WaitProvidingEquipCanOut()
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = WaitEnum.W201_ProvidingCanOut;
return wait;
}
public string ToStr()
{
if (WaitType == 1)
if (WaitType.Equals(WaitEnum.W001_AxisMove))
{
if (IsHomeMove)
{
......@@ -292,38 +302,41 @@ namespace OnlineStore.DeviceLibrary
return "轴【" + AxisInfo.DisplayStr + "】绝对运动,目标位置【" + TargetPosition + "】";
}
}
else if (WaitType == 2)
else if (WaitType.Equals(WaitEnum.W002_IOValue))
{
return "等待【" + IoType + "】=【" + IoValue + "】";
}
else if (WaitType == 3)
else if (WaitType.Equals(WaitEnum.W003_Time))
{
return "时间等待:【" + TimeMSeconds + "】毫秒";
}
else if (WaitType == 4)
else if (WaitType.Equals(WaitEnum.W004_StellMove))
{
return "电钢目标位置:【" + TargetPosition + "】 ";
}
else if (WaitType == 5)
else if (WaitType.Equals(WaitEnum.W005_ShuoKe))
{
return "硕科电机目标位置:【" + TargetPosition + "】 ";
}
else if (WaitType == 6)
else if (WaitType.Equals(WaitEnum.W006_AxisOrg))
{
return "轴【" + AxisInfo.DisplayStr + "】ORG信号:【" + IoValue + "】 ";
}else if (WaitType == 7)
}else if (WaitType.Equals(WaitEnum.W007_ReelHeight))
{
return "料盘高度【" + HeightValue + "】 ";
}else if (WaitType == 8)
}else if (WaitType.Equals(WaitEnum.W008_InStoreCheckOK))
{
return "入库库位验证完成";
}
else if (WaitType == 9)
else if (WaitType.Equals(WaitEnum.W009_BoxCanInstore))
{
return "BOX可以开始入库";
}else if (WaitType == 10)
}else if (WaitType.Equals(WaitEnum.W010_SW34NoTray))
{
return "等待横移34无托盘";
}else if (WaitType.Equals(WaitEnum.W201_ProvidingCanOut))
{
return "移栽模块可移栽出库";
}
else
{
......@@ -382,6 +395,53 @@ namespace OnlineStore.DeviceLibrary
}
internal class WaitEnum
{
/// <summary>
/// 伺服运动
/// </summary>
internal static int W001_AxisMove = 1;
/// <summary>
/// 信号到达
/// </summary>
internal static int W002_IOValue = 2;
/// <summary>
/// 时间等待
/// </summary>
internal static int W003_Time = 3;
/// <summary>
/// 电钢运动
/// </summary>
internal static int W004_StellMove = 4;
/// <summary>
/// 硕科电机
/// </summary>
internal static int W005_ShuoKe = 5;
/// <summary>
/// 轴原点信号
/// </summary>
internal static int W006_AxisOrg = 6;
/// <summary>
/// 料盘高度
/// </summary>
internal static int W007_ReelHeight = 7;
/// <summary>
/// 入库库位验证完成
/// </summary>
internal static int W008_InStoreCheckOK = 8;
/// <summary>
/// BOX可以开始入库
/// </summary>
internal static int W009_BoxCanInstore = 9;
/// <summary>
/// 等待横移34无托盘
/// </summary>
internal static int W010_SW34NoTray = 10;
/// <summary>
/// 移栽模块可移栽出库
/// </summary>
internal static int W201_ProvidingCanOut = 201;
}
public enum LineMoveType
{
/// <summary>
......
......@@ -234,27 +234,27 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 移载(流水线)装置出库处理, 检测夹具编码并记忆,托盘 是空盘,并且BOX在出库等待中,开始移栽料盘
/// </summary>
MO_05_CodeRember = 3105,
MO_11_CodeRember = 3101,
/// <summary>
/// 移载(流水线)装置出库处理 ,顶升气缸1下降
/// </summary>
MO_06_TopCylinder_Down = 3106,
MO_12_TopCylinder_Down = 3102,
/// <summary>
/// 如果是移栽2需要等待托盘是否可以走
/// </summary>
MO_07_WaitCanGo=3107,
MO_13_WaitCanGo=3103,
/// <summary>
/// 移载(流水线)装置出库处理, 阻挡气缸1-2下降
/// </summary>
MO_10_StopCylinder2_Down = 3110,
MO_14_StopCylinder2_Down = 3104,
/// <summary>
/// 移载(流水线)装置出库处理, 阻挡2托盘检测=0,
/// </summary>
MO_11_Tray_Check = 3111,
MO_15_Tray_Check = 3105,
/// <summary>
/// 移载(流水线)装置出库处理, 阻挡气缸1-1下降 阻挡气缸1-2上升
/// </summary>
MO_12_StopCylinder_Back = 3112,
MO_16_StopCylinder_Back = 3106,
/// <summary>
/// 移栽装置出库处理,开始出库
......
......@@ -28,5 +28,12 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("IsDebug")]
public int IsDebug { get; set; }
/// <summary>
/// PRO,0,扫码的相机名称(多个用#分隔),CameraNameList,Name1#Name1,,,,,
/// </summary>
[ConfigProAttribute("CameraNameList")]
public string CameraNameList { get; set; }
}
}
......@@ -27,6 +27,12 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("IsDebug")]
public int IsDebug { get; set; }
/// <summary>
/// PRO,0,扫码的相机名称(多个用#分隔),CameraNameList,Name1#Name1,,,,,
/// </summary>
[ConfigProAttribute("CameraNameList")]
public string CameraNameList { get; set; }
/// <summary>
/// PRO,0,对应的横移模块,SidesWayNum,3,,,,,
......@@ -162,6 +168,27 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("IsCanOut", false)]
public int IsCanOut { get; set; }
private List<string> CameraList = null;
public List<string> GetCameraList()
{
if (CameraList == null)
{
CameraList = new List<string>();
string[] arrayList = CameraNameList.Split('#');
foreach (string str in arrayList)
{
string camera = str.Trim();
if (string.IsNullOrEmpty(camera).Equals(false))
{
CameraList.Add(camera);
}
}
}
return CameraList;
}
private Dictionary<int, int> UpDownPositionMap = null;
public int GetUpdownPosition(int trayHeight)
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!