Commit 73023c7c LN

1

1 个父辈 eb08dc23
......@@ -32,6 +32,7 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmLineStore));
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.lblMoveInfo = new System.Windows.Forms.Label();
this.chbAutoRun = new System.Windows.Forms.CheckBox();
this.btnUpdateStatus = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
......@@ -77,11 +78,13 @@
this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox1.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// tabControl1
......@@ -102,14 +105,10 @@
//
// tabPage1
//
this.tabPage1.Controls.Add(this.chbAutoRun);
this.tabPage1.Controls.Add(this.btnUpdateStatus);
this.tabPage1.Controls.Add(this.lblMoveInfo);
this.tabPage1.Controls.Add(this.groupBox2);
this.tabPage1.Controls.Add(this.groupBox1);
this.tabPage1.Controls.Add(this.lblCID);
this.tabPage1.Controls.Add(this.chkDebug);
this.tabPage1.Controls.Add(this.listView1);
this.tabPage1.Controls.Add(this.btnCopyLog);
this.tabPage1.Controls.Add(this.btnClearLog);
this.tabPage1.Controls.Add(this.logBox);
this.tabPage1.Location = new System.Drawing.Point(4, 29);
this.tabPage1.Name = "tabPage1";
......@@ -118,11 +117,22 @@
this.tabPage1.Text = "状态信息";
this.tabPage1.UseVisualStyleBackColor = true;
//
// lblMoveInfo
//
this.lblMoveInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.lblMoveInfo.AutoSize = true;
this.lblMoveInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblMoveInfo.Location = new System.Drawing.Point(18, 496);
this.lblMoveInfo.Name = "lblMoveInfo";
this.lblMoveInfo.Size = new System.Drawing.Size(29, 17);
this.lblMoveInfo.TabIndex = 196;
this.lblMoveInfo.Text = "CID";
//
// chbAutoRun
//
this.chbAutoRun.AutoSize = true;
this.chbAutoRun.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbAutoRun.Location = new System.Drawing.Point(271, 19);
this.chbAutoRun.Location = new System.Drawing.Point(137, 32);
this.chbAutoRun.Name = "chbAutoRun";
this.chbAutoRun.Size = new System.Drawing.Size(140, 24);
this.chbAutoRun.TabIndex = 94;
......@@ -132,10 +142,10 @@
//
// btnUpdateStatus
//
this.btnUpdateStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnUpdateStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnUpdateStatus.BackColor = System.Drawing.Color.White;
this.btnUpdateStatus.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUpdateStatus.Location = new System.Drawing.Point(9, 568);
this.btnUpdateStatus.Location = new System.Drawing.Point(629, 28);
this.btnUpdateStatus.Name = "btnUpdateStatus";
this.btnUpdateStatus.Size = new System.Drawing.Size(222, 35);
this.btnUpdateStatus.TabIndex = 195;
......@@ -148,12 +158,13 @@
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.lblPosId);
this.groupBox1.Controls.Add(this.btnUpdateStatus);
this.groupBox1.Controls.Add(this.txtPosId);
this.groupBox1.Controls.Add(this.cmbBoxIndex);
this.groupBox1.Controls.Add(this.btnInStoreTset);
this.groupBox1.Controls.Add(this.button2);
this.groupBox1.Controls.Add(this.button1);
this.groupBox1.Location = new System.Drawing.Point(460, 3);
this.groupBox1.Location = new System.Drawing.Point(460, 85);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(860, 78);
this.groupBox1.TabIndex = 195;
......@@ -163,17 +174,17 @@
// lblPosId
//
this.lblPosId.AutoSize = true;
this.lblPosId.Location = new System.Drawing.Point(428, 35);
this.lblPosId.Location = new System.Drawing.Point(366, 35);
this.lblPosId.Name = "lblPosId";
this.lblPosId.Size = new System.Drawing.Size(65, 20);
this.lblPosId.Size = new System.Drawing.Size(51, 20);
this.lblPosId.TabIndex = 197;
this.lblPosId.Text = "库位:";
this.lblPosId.Text = "库位:";
//
// txtPosId
//
this.txtPosId.Location = new System.Drawing.Point(499, 32);
this.txtPosId.Location = new System.Drawing.Point(426, 32);
this.txtPosId.Name = "txtPosId";
this.txtPosId.Size = new System.Drawing.Size(111, 26);
this.txtPosId.Size = new System.Drawing.Size(80, 26);
this.txtPosId.TabIndex = 196;
//
// cmbBoxIndex
......@@ -182,14 +193,14 @@
this.cmbBoxIndex.FormattingEnabled = true;
this.cmbBoxIndex.Location = new System.Drawing.Point(272, 31);
this.cmbBoxIndex.Name = "cmbBoxIndex";
this.cmbBoxIndex.Size = new System.Drawing.Size(121, 28);
this.cmbBoxIndex.Size = new System.Drawing.Size(85, 28);
this.cmbBoxIndex.TabIndex = 195;
//
// btnInStoreTset
//
this.btnInStoreTset.BackColor = System.Drawing.Color.White;
this.btnInStoreTset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnInStoreTset.Location = new System.Drawing.Point(636, 28);
this.btnInStoreTset.Location = new System.Drawing.Point(515, 28);
this.btnInStoreTset.Name = "btnInStoreTset";
this.btnInStoreTset.Size = new System.Drawing.Size(105, 35);
this.btnInStoreTset.TabIndex = 194;
......@@ -201,7 +212,7 @@
//
this.button2.BackColor = System.Drawing.Color.White;
this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button2.Location = new System.Drawing.Point(122, 28);
this.button2.Location = new System.Drawing.Point(118, 28);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(105, 35);
this.button2.TabIndex = 193;
......@@ -225,7 +236,7 @@
//
this.lblCID.AutoSize = true;
this.lblCID.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblCID.Location = new System.Drawing.Point(18, 19);
this.lblCID.Location = new System.Drawing.Point(19, 34);
this.lblCID.Name = "lblCID";
this.lblCID.Size = new System.Drawing.Size(33, 20);
this.lblCID.TabIndex = 95;
......@@ -233,10 +244,10 @@
//
// chkDebug
//
this.chkDebug.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.chkDebug.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.chkDebug.AutoSize = true;
this.chkDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chkDebug.Location = new System.Drawing.Point(366, 574);
this.chkDebug.Location = new System.Drawing.Point(755, 32);
this.chkDebug.Name = "chkDebug";
this.chkDebug.Size = new System.Drawing.Size(76, 24);
this.chkDebug.TabIndex = 194;
......@@ -251,10 +262,10 @@
this.listView1.FullRowSelect = true;
this.listView1.GridLines = true;
this.listView1.HideSelection = false;
this.listView1.Location = new System.Drawing.Point(9, 63);
this.listView1.Location = new System.Drawing.Point(9, 7);
this.listView1.MultiSelect = false;
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(433, 499);
this.listView1.Size = new System.Drawing.Size(433, 475);
this.listView1.TabIndex = 191;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.Details;
......@@ -262,27 +273,27 @@
//
// btnCopyLog
//
this.btnCopyLog.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnCopyLog.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnCopyLog.BackColor = System.Drawing.Color.White;
this.btnCopyLog.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCopyLog.Location = new System.Drawing.Point(232, 568);
this.btnCopyLog.Location = new System.Drawing.Point(515, 27);
this.btnCopyLog.Name = "btnCopyLog";
this.btnCopyLog.Size = new System.Drawing.Size(63, 35);
this.btnCopyLog.Size = new System.Drawing.Size(105, 35);
this.btnCopyLog.TabIndex = 191;
this.btnCopyLog.Text = "复制";
this.btnCopyLog.Text = "复制日志";
this.btnCopyLog.UseVisualStyleBackColor = false;
this.btnCopyLog.Click += new System.EventHandler(this.btnCopyLog_Click);
//
// btnClearLog
//
this.btnClearLog.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnClearLog.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnClearLog.BackColor = System.Drawing.Color.White;
this.btnClearLog.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClearLog.Location = new System.Drawing.Point(296, 568);
this.btnClearLog.Location = new System.Drawing.Point(635, 27);
this.btnClearLog.Name = "btnClearLog";
this.btnClearLog.Size = new System.Drawing.Size(63, 35);
this.btnClearLog.Size = new System.Drawing.Size(105, 35);
this.btnClearLog.TabIndex = 190;
this.btnClearLog.Text = "清空";
this.btnClearLog.Text = "清空日志";
this.btnClearLog.UseVisualStyleBackColor = false;
this.btnClearLog.Click += new System.EventHandler(this.btnClearLog_Click);
//
......@@ -292,9 +303,9 @@
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.logBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.logBox.Location = new System.Drawing.Point(448, 87);
this.logBox.Location = new System.Drawing.Point(460, 169);
this.logBox.Name = "logBox";
this.logBox.Size = new System.Drawing.Size(872, 516);
this.logBox.Size = new System.Drawing.Size(860, 433);
this.logBox.TabIndex = 106;
this.logBox.Text = "";
//
......@@ -315,9 +326,9 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.lblWarnMsg.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWarnMsg.ForeColor = System.Drawing.Color.Red;
this.lblWarnMsg.Location = new System.Drawing.Point(257, 3);
this.lblWarnMsg.Location = new System.Drawing.Point(308, 3);
this.lblWarnMsg.Name = "lblWarnMsg";
this.lblWarnMsg.Size = new System.Drawing.Size(1079, 68);
this.lblWarnMsg.Size = new System.Drawing.Size(1028, 68);
this.lblWarnMsg.TabIndex = 96;
this.lblWarnMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
......@@ -529,6 +540,22 @@
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// groupBox2
//
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox2.Controls.Add(this.lblCID);
this.groupBox2.Controls.Add(this.chbAutoRun);
this.groupBox2.Controls.Add(this.chkDebug);
this.groupBox2.Controls.Add(this.btnClearLog);
this.groupBox2.Controls.Add(this.btnCopyLog);
this.groupBox2.Location = new System.Drawing.Point(460, 4);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(860, 75);
this.groupBox2.TabIndex = 196;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "状态信息";
//
// FrmLineStore
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......@@ -557,6 +584,8 @@
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
......@@ -611,6 +640,8 @@
private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator9;
private System.Windows.Forms.ToolStripMenuItem iO模块状态ToolStripMenuItem;
private System.Windows.Forms.Label lblMoveInfo;
private System.Windows.Forms.GroupBox groupBox2;
}
}
......@@ -413,6 +413,7 @@ namespace OnlineStore.AssemblyLine
//{
// lblWarnMsg.Text = "未扫到二维码,请重新放入料盘";
//}
lblMoveInfo.Text = LineManager.Line.GetMoveStr();
if (lblWarnMsg.Text.Equals(""))
{
lblWarnMsg.Text = TrayManager.TrayErrorMsg;
......
......@@ -487,11 +487,11 @@ namespace OnlineStore.DeviceLibrary
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosId : "";
if (String.IsNullOrEmpty( posId))
{
LogUtil.info(Name + msg);
LogUtil.info(Name + " " + msg);
}
else
{
LogUtil.info(Name + "[" + posId + "]" + msg);
LogUtil.info(Name + " " + "[" + posId + "]" + msg);
}
}
protected void OutStoreLog(string msg)
......@@ -499,18 +499,18 @@ namespace OnlineStore.DeviceLibrary
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosId : "";
if (String.IsNullOrEmpty(posId))
{
LogUtil.info(Name + msg);
LogUtil.info(Name +" "+ msg);
}
else
{
LogUtil.info(Name + "[" + posId + "]" + msg);
LogUtil.info(Name + " " + "[" + posId + "] " + msg);
}
}
public string GetMoveStr()
{
string msg = "";
int tLength = 12;
int tLength = 15;
msg += "preTrayNum:".PadRight(tLength, ' ') + preTrayNum + "\n";
msg += "currTrayNum:".PadRight(tLength, ' ') + currTrayNum + "\n";
......@@ -519,7 +519,7 @@ namespace OnlineStore.DeviceLibrary
msg += "MoveType:".PadRight(tLength, ' ') + MoveInfo.MoveType+"\n";
msg += "MoveStep:".PadRight(tLength, ' ') + MoveInfo.MoveStep + "\n";
msg += "SMoveType:".PadRight(tLength, ' ') + SecondMoveInfo.MoveType + "\n";
msg += "SMoveType:".PadRight(tLength, ' ') + SecondMoveInfo.MoveStep + "";
msg += "SMoveStep:".PadRight(tLength, ' ') + SecondMoveInfo.MoveStep + "";
return msg;
}
}
......
......@@ -49,24 +49,42 @@ namespace OnlineStore.DeviceLibrary
if (Config.SidesWayNum > 0)
{
int num = TrayManager.GetTrayNum(DeviceID);
bool isTestNeed =( LineManager.Line.runStatus <= LineRunStatus.Wait) && IOValue(IO_Type.SW_TrayCheck).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SW_ReelCheck).Equals(IO_VALUE.LOW);
bool isNeedTray = IOValue(IO_Type.SW_TrayCheck).Equals(IO_VALUE.HIGH) && num > 0 && preTrayNum.Equals(num).Equals(false) && LineManager.Line.SwNoProcess(Config.SidesWayNum);
if (isTestNeed||isNeedTray)
bool isTestNeed = (LineManager.Line.runStatus <= LineRunStatus.Wait);
bool isNeedTray = (num > 0) && (LineManager.Line.SwNoProcess(Config.SidesWayNum));
if (IOValue(IO_Type.SW_TrayCheck).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SW_ReelCheck).Equals(IO_VALUE.LOW) && (isTestNeed || isNeedTray))
{
//判断是否是需要的托盘
if (NeedCurrTray())
{
SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
TrayManager.UpdateSWState(Config.SidesWayNum, 2);
CheckLog("托盘检测:(MIO_06_TopCylinderUp 横移顶升气缸上 升 )");
CheckLog("检测到SW_TrayCheck:" + SecondMoveInfo.SLog + "横移顶升气缸上升 )");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_06_TopCylinderUp);
CylinderMove(SecondMoveInfo, IO_Type.SW_TopCylinder_Down, IO_Type.SW_TopCylinder_Up);
}
else
{
preTrayNum = num;
TrayManager.UpdateSWState(Config.SidesWayNum, 1);
TrayManager.UpdateSWState(Config.SidesWayNum, 1);
}
}
else if (IOValue(IO_Type.SW_StopCheck).Equals(IO_VALUE.HIGH) && (isTestNeed || isNeedTray))
{
//判断是否是需要的托盘
if (NeedCurrTray())
{
SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
TrayManager.UpdateSWState(Config.SidesWayNum, 2);
CheckLog("检测到SW_StopCheck:" + SecondMoveInfo.SLog + "阻挡气缸下降 ,最多等待1秒");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_01_StopCylinder1Down);
IOMove(IO_Type.SW_StopDown, IO_VALUE.HIGH);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_StopDown, IO_VALUE.HIGH));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
}
else
{
preTrayNum = num;
TrayManager.UpdateSWState(Config.SidesWayNum, 1);
}
}
}
......@@ -79,7 +97,7 @@ namespace OnlineStore.DeviceLibrary
if (num > 0 && IOValue(IO_Type.FL_TrayCheck).Equals(IO_VALUE.HIGH))
{
SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
CheckLog("托盘检测:" + SecondMoveInfo.SLog + " FL阻挡1上升)");
CheckLog("检测到FL_TrayCheck:" + SecondMoveInfo.SLog + " FL阻挡1上升)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down);
IOMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW));
......@@ -89,7 +107,7 @@ namespace OnlineStore.DeviceLibrary
//托盘在第一个阻挡处
SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_01_StopCylinder1Down);
CheckLog(" 托盘检测:FL_StopCheck" + SecondMoveInfo.SLog + " FL阻挡1下降 ,最多等待1秒)");
CheckLog(" 检测到FL_StopCheck:" + SecondMoveInfo.SLog + " FL阻挡1下降 ,最多等待1秒)");
IOMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.HIGH);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.FL_StopCylinder_Down1, IO_VALUE.HIGH));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
......@@ -117,10 +135,20 @@ namespace OnlineStore.DeviceLibrary
if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_01_StopCylinder1Down))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_03_StopCylinder2Down);
CheckLog("托盘检测:" + SecondMoveInfo.SLog + "阻挡1上升,等待FL_TrayCheck=1)");
IOMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.FL_TrayCheck, IO_VALUE.HIGH));
if (Config.SidesWayNum <= 0)
{
CheckLog("托盘检测:" + SecondMoveInfo.SLog + "阻挡1上升,等待FL_TrayCheck=1)");
IOMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.FL_TrayCheck, IO_VALUE.HIGH));
}
else
{
CheckLog("托盘检测:" + SecondMoveInfo.SLog + "阻挡气缸上升,等待SW_TrayCheck=1)");
IOMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_StopDown, IO_VALUE.LOW));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_TrayCheck, IO_VALUE.HIGH));
}
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_02_FixtureCheck))
{
......@@ -137,15 +165,10 @@ namespace OnlineStore.DeviceLibrary
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_04_Wait))
{
//此处先对托盘号进行验证
preTrayNum = currTrayNum;
currTrayNum = TrayManager.GetTrayNum(DeviceID);
if (TrayManager.RightTrayCode(currTrayNum, preTrayNum, false))
if (Config.SidesWayNum <= 0)
{
if (TrayManager.ErrorStoreId.Equals(DeviceID))
{
TrayManager.UpdateTrayNumError(-1, "");
}
//出料中,需要拦盘
if (NeedCurrTray(true))
{
......@@ -161,14 +184,25 @@ namespace OnlineStore.DeviceLibrary
bool isFull = TrayManager.TrayIsFull(currTrayNum);
LogInfo(SecondMoveInfo.MoveNum + "***************上个托盘号【" + preTrayNum + "】,当前" + (isFull ? "有料托盘" : "空托盘") + "【" + currTrayNum + "】没有出入料任务,放盘通过~");
CheckLog("托盘放行 " + SecondMoveInfo.SLog + " ,移栽2,需要判断是否可以放盘通过,最多等待10000)");
}
}
}
else
{
string msg = Name + " 托盘顺序错乱,上个托盘号【" + preTrayNum + "】当前托盘号 【" + currTrayNum + "】最大盘号【" + TrayManager.MaxTrayNum + "】";
TrayManager.UpdateTrayNumError(DeviceID, msg);
LogUtil.error(msg);
return;
//判断是否是需要的托盘
if (NeedCurrTray())
{
SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
TrayManager.UpdateSWState(Config.SidesWayNum, 2);
CheckLog("托盘检测:" + SecondMoveInfo.SLog + " 需要此托盘,横移顶升气缸上 升 )");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_06_TopCylinderUp);
CylinderMove(SecondMoveInfo, IO_Type.SW_TopCylinder_Down, IO_Type.SW_TopCylinder_Up);
}
else
{
CheckLog("托盘检测:不需要次托盘,结束处理 )");
TrayManager.UpdateSWState(Config.SidesWayNum, 1);
SecondMoveInfo.EndMove();
}
}
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_05_WaitTime))
......@@ -223,7 +257,7 @@ namespace OnlineStore.DeviceLibrary
#region 不需要托盘或移栽入库料盘完成
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_12_MoveOk))
{
{
if (Config.SidesWayNum > 0)
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_13_LoactionCylinder_Down);
......@@ -568,22 +602,31 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(LineMoveStep.FI_13_ScanCode);
bool isScan = ConfigAppSettings.GetIntValue(Setting_Init.NeedScanCode).Equals(1);
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":开始扫码:是否需要扫码【"+isScan+"】");
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":开始扫码:是否需要扫码【" + isScan + "】");
LastCodeList = new List<string>();
if (isScan)
{
MoveInfo.OneWaitCanEndStep = true;
MoveInfo.WaitList.Add(WaitResultInfo.WaitFeedScanCode());
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
Task<List<string>> scanTask = Task.Factory.StartNew(delegate
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(6000));
try
{
LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
if (LastCodeList.Count <= 0)
Task<List<string>> scanTask = Task.Factory.StartNew(delegate
{
LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
}
return LastCodeList;
});
if (LastCodeList.Count <= 0)
{
LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
}
return LastCodeList;
});
}
catch (Exception ex)
{
LogUtil.error("FI_13_ScanCode扫码出错:" + ex.ToString());
}
}
}
else
......@@ -796,7 +839,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.EndMove();
runStatus = LineRunStatus.Runing;
// MoveInfo.NextMoveStep(LineMoveStep.FI_39_OutLineRun);
InStoreLog(" 上料完成,料架到达出口处, 通知AGV取空料架, 入料流程结束");
InStoreLog("上料完成,料架到达出口处, 通知AGV取空料架, 入料流程结束");
AgvClient.ReadyEmpty(Config.AgvOutName);
}
......@@ -807,14 +850,14 @@ namespace OnlineStore.DeviceLibrary
if (MoveCylineCanTakeOrGive())
{
MoveInfo.NextMoveStep(LineMoveStep.FI_12_MoveCylinder_Give);
InStoreLog(" 料盘移栽 " + MoveInfo.SLog + ":上料机构检测到料盘,横移机构到放料端");
InStoreLog("料盘移栽" + MoveInfo.SLog + ":上料机构检测到料盘,横移机构到放料端");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
}
else
{
//有料盘
MoveInfo.NextMoveStep(LineMoveStep.FI_11_MoveCylinder_Up);
InStoreLog(" 料盘移栽 " + MoveInfo.SLog + ":上料机构检测到料盘,横移机构上升");
InStoreLog("料盘移栽" + MoveInfo.SLog + ":上料机构检测到料盘,横移机构上升");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
}
......@@ -977,7 +1020,7 @@ namespace OnlineStore.DeviceLibrary
{
//定位工位有料架,直接开始入料
MoveInfo.NextMoveStep(LineMoveStep.FO_07_LocationCylinder_Up);
OutStoreLog(" 定位工位检测到料架"+MoveInfo.MoveStep+":缓冲阻挡上升, 定位气缸上升");
OutStoreLog("定位工位检测到料架"+MoveInfo.MoveStep+":缓冲阻挡上升, 定位气缸上升");
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW);//缓冲阻挡下降
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Down, IO_Type.SW4_LocationCylinder_Up);
}
......@@ -990,7 +1033,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.SL_Line_Run, IO_VALUE.HIGH);
//等待指定时间
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
OutStoreLog(" 出料检测" + MoveInfo.SLog + ":阻挡工位有料架,进料阻挡上升,缓冲阻挡下降,流水线转动2000");
OutStoreLog("出料检测" + MoveInfo.SLog + ":阻挡工位有料架,进料阻挡上升,缓冲阻挡下降,流水线转动2000");
}
else if (IOValue(IO_Type.SL_Entry_Check).Equals(IO_VALUE.HIGH))
{
......@@ -1000,7 +1043,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.SL_Line_Run, IO_VALUE.HIGH);
//等待指定时间
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
OutStoreLog(" 出料检测" + MoveInfo.SLog + ":入料工位有料架,进料阻挡下降,缓冲阻挡上升,流水线转动2000");
OutStoreLog("出料检测" + MoveInfo.SLog + ":入料工位有料架,进料阻挡下降,缓冲阻挡上升,流水线转动2000");
}
else
{
......@@ -1023,7 +1066,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(LineMoveStep.FO_01_TrayLocation_After);
TrayLCylinderAfter(MoveInfo);
OutStoreLog(" 出料检测" + MoveInfo.SLog + ":升降盘定位气缸后退");
OutStoreLog("出料检测" + MoveInfo.SLog + ":升降盘定位气缸后退");
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_01_TrayLocation_After))
{
......
......@@ -917,6 +917,22 @@ namespace OnlineStore.DeviceLibrary
}
}
}
public string GetMoveStr()
{
string msg = "";
int tLength = 20;
//msg += "preTrayNum:".PadRight(tLength, ' ') + preTrayNum + "\n";
//msg += "currTrayNum:".PadRight(tLength, ' ') + currTrayNum + "\n";
msg += "runStatus: "+ runStatus + "\n";
msg += "lineStatus: "+ lineStatus + "\n";
msg += "MoveType: " + MoveInfo.MoveType + "\n";
msg += "MoveStep: " + MoveInfo.MoveStep + "\n";
msg += "SW41_Move: "+ SW41_MoveInfo.MoveType + " "+ SW41_MoveInfo.MoveStep + "\n";
msg += "SW23_Move: " + SW23_MoveInfo.MoveType + " " + SW23_MoveInfo.MoveStep + "\n";
return msg;
}
}
}
\ No newline at end of file
......@@ -33,6 +33,7 @@ namespace OnlineStore.DeviceLibrary
IOManager.IOValue(IO_Type.DriveMotor_Run3, 0).Equals(IO_VALUE.HIGH) &&
IOManager.IOValue(IO_Type.DriveMotor_Run4, 0).Equals(IO_VALUE.HIGH))
{
return true;
if (isCheckSleep)
{
if (runStatus >= LineRunStatus.Runing && IsSleep.Equals(false))
......
......@@ -15,17 +15,18 @@ namespace OnlineStore.DeviceLibrary
string msg = "";
try
{
string codeStr = "";
string codeStr = "";
List<string> list = new List<string>();
foreach (string str in codeList)
{
if (codeStr.Equals(""))
if (list.Contains(str.Trim()))
{
codeStr = str;
}
else
{
codeStr += spiltStr + str;
continue;
}
list.Add(str.Trim());
//string code = "=1+0x0-" + width + "x" + height + "=" + str.Trim();
string code = width + "x" + height + "%3D" + str.Trim();
codeStr = codeStr + code + spiltStr;
}
if (String.IsNullOrEmpty(codeStr))
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!