Commit ef9490c0 刘韬

同步491修改

1 个父辈 8887225f
...@@ -171,11 +171,12 @@ namespace OnlineStore.Common ...@@ -171,11 +171,12 @@ namespace OnlineStore.Common
} }
public static void ClearLog() public static void ClearLog()
{ {
showLogEvent?.Invoke("",Color.Black);
logList.Clear();
if (logBox != null) if (logBox != null)
{ {
LastText = ""; LastText = "";
logList.Clear(); logBox.Text = "";
logBox.Text = "";
} }
} }
......
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
<add key="Store_CID" value="duo-store" /> <add key="Store_CID" value="duo-store" />
<add key="Store_CID_1" value="duo-1" /> <add key="Store_CID_1" value="duo-1" />
<add key="Store_CID_2" value="duo-2" /> <add key="Store_CID_2" value="duo-2" />
<add key="Store_CID_1_disabled" value="1" />
<add key="Store_CID_2_disabled" value="1" />
<!--end one store config--> <!--end one store config-->
<add key="ACBaudRate" value="115200" /> <add key="ACBaudRate" value="115200" />
<add key="Config_Pwd" value="123456" /> <add key="Config_Pwd" value="123456" />
......
...@@ -64,6 +64,7 @@ namespace OnlineStore.DUOStore ...@@ -64,6 +64,7 @@ namespace OnlineStore.DUOStore
this.txtMiddleP3 = new System.Windows.Forms.TextBox(); this.txtMiddleP3 = new System.Windows.Forms.TextBox();
this.btnMiddleP3 = new System.Windows.Forms.Button(); this.btnMiddleP3 = new System.Windows.Forms.Button();
this.axisMoveControl1 = new OnlineStore.DUOStore.AxisMoveControl(); this.axisMoveControl1 = new OnlineStore.DUOStore.AxisMoveControl();
this.btnSotreReset = new System.Windows.Forms.Button();
this.groupInout.SuspendLayout(); this.groupInout.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
...@@ -701,11 +702,23 @@ namespace OnlineStore.DUOStore ...@@ -701,11 +702,23 @@ namespace OnlineStore.DUOStore
this.axisMoveControl1.Size = new System.Drawing.Size(568, 407); this.axisMoveControl1.Size = new System.Drawing.Size(568, 407);
this.axisMoveControl1.TabIndex = 274; this.axisMoveControl1.TabIndex = 274;
// //
// btnSotreReset
//
this.btnSotreReset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSotreReset.Location = new System.Drawing.Point(12, 414);
this.btnSotreReset.Name = "btnSotreReset";
this.btnSotreReset.Size = new System.Drawing.Size(128, 39);
this.btnSotreReset.TabIndex = 276;
this.btnSotreReset.Text = "复位";
this.btnSotreReset.UseVisualStyleBackColor = true;
this.btnSotreReset.Click += new System.EventHandler(this.btnSotreReset_Click);
//
// FrmAxisMove // FrmAxisMove
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(1323, 559); this.ClientSize = new System.Drawing.Size(1323, 559);
this.Controls.Add(this.btnSotreReset);
this.Controls.Add(this.groupInout); this.Controls.Add(this.groupInout);
this.Controls.Add(this.axisMoveControl1); this.Controls.Add(this.axisMoveControl1);
this.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
...@@ -761,6 +774,7 @@ namespace OnlineStore.DUOStore ...@@ -761,6 +774,7 @@ namespace OnlineStore.DUOStore
public System.Windows.Forms.Button btnInOutP2; public System.Windows.Forms.Button btnInOutP2;
public System.Windows.Forms.TextBox txtInOutP3; public System.Windows.Forms.TextBox txtInOutP3;
public System.Windows.Forms.Button btnInOutP3; public System.Windows.Forms.Button btnInOutP3;
private System.Windows.Forms.Button btnSotreReset;
} }
} }
...@@ -220,5 +220,13 @@ namespace OnlineStore.DUOStore ...@@ -220,5 +220,13 @@ namespace OnlineStore.DUOStore
AxisABSMove(StoreManager.Store.T2_MiddleAxis, txtT2P4, StoreManager.Store.Config.MiddleAxis_P4Speed); AxisABSMove(StoreManager.Store.T2_MiddleAxis, txtT2P4, StoreManager.Store.Config.MiddleAxis_P4Speed);
} }
private void btnSotreReset_Click(object sender, EventArgs e)
{
if (StoreManager.Store.runStatus >= StoreRunStatus.HomeMoving)
{
StoreManager.Store.ResetLine();
//btnSotreReset.Enabled = false;
}
}
} }
} }
...@@ -110,6 +110,7 @@ namespace OnlineStore.DUOStore ...@@ -110,6 +110,7 @@ namespace OnlineStore.DUOStore
this.btnStoreStart = new System.Windows.Forms.Button(); this.btnStoreStart = new System.Windows.Forms.Button();
this.lblWarnMsg = new System.Windows.Forms.Label(); this.lblWarnMsg = new System.Windows.Forms.Label();
this.lblThisSta = new System.Windows.Forms.Label(); this.lblThisSta = new System.Windows.Forms.Label();
this.chbDisable = new System.Windows.Forms.CheckBox();
this.groupBox4.SuspendLayout(); this.groupBox4.SuspendLayout();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
...@@ -130,7 +131,7 @@ namespace OnlineStore.DUOStore ...@@ -130,7 +131,7 @@ namespace OnlineStore.DUOStore
this.chbDebug.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.chbDebug.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.chbDebug.AutoSize = true; this.chbDebug.AutoSize = true;
this.chbDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.chbDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbDebug.Location = new System.Drawing.Point(20, 405); this.chbDebug.Location = new System.Drawing.Point(10, 597);
this.chbDebug.Name = "chbDebug"; this.chbDebug.Name = "chbDebug";
this.chbDebug.Size = new System.Drawing.Size(84, 24); this.chbDebug.Size = new System.Drawing.Size(84, 24);
this.chbDebug.TabIndex = 271; this.chbDebug.TabIndex = 271;
...@@ -222,7 +223,7 @@ namespace OnlineStore.DUOStore ...@@ -222,7 +223,7 @@ namespace OnlineStore.DUOStore
this.tabControl1.Location = new System.Drawing.Point(239, 112); this.tabControl1.Location = new System.Drawing.Point(239, 112);
this.tabControl1.Name = "tabControl1"; this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0; this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(1054, 612); this.tabControl1.Size = new System.Drawing.Size(1054, 605);
this.tabControl1.TabIndex = 272; this.tabControl1.TabIndex = 272;
// //
// tabPage4 // tabPage4
...@@ -231,7 +232,7 @@ namespace OnlineStore.DUOStore ...@@ -231,7 +232,7 @@ namespace OnlineStore.DUOStore
this.tabPage4.Controls.Add(this.groupInout); this.tabPage4.Controls.Add(this.groupInout);
this.tabPage4.Location = new System.Drawing.Point(4, 29); this.tabPage4.Location = new System.Drawing.Point(4, 29);
this.tabPage4.Name = "tabPage4"; this.tabPage4.Name = "tabPage4";
this.tabPage4.Size = new System.Drawing.Size(1046, 579); this.tabPage4.Size = new System.Drawing.Size(1046, 572);
this.tabPage4.TabIndex = 3; this.tabPage4.TabIndex = 3;
this.tabPage4.Text = " 库位信息 "; this.tabPage4.Text = " 库位信息 ";
this.tabPage4.UseVisualStyleBackColor = true; this.tabPage4.UseVisualStyleBackColor = true;
...@@ -443,6 +444,7 @@ namespace OnlineStore.DUOStore ...@@ -443,6 +444,7 @@ namespace OnlineStore.DUOStore
this.txtComP2.AcceptsReturn = true; this.txtComP2.AcceptsReturn = true;
this.txtComP2.BackColor = System.Drawing.SystemColors.Window; this.txtComP2.BackColor = System.Drawing.SystemColors.Window;
this.txtComP2.Cursor = System.Windows.Forms.Cursors.IBeam; this.txtComP2.Cursor = System.Windows.Forms.Cursors.IBeam;
this.txtComP2.Enabled = false;
this.txtComP2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.txtComP2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtComP2.ForeColor = System.Drawing.SystemColors.WindowText; this.txtComP2.ForeColor = System.Drawing.SystemColors.WindowText;
this.txtComP2.Location = new System.Drawing.Point(408, 309); this.txtComP2.Location = new System.Drawing.Point(408, 309);
...@@ -680,6 +682,7 @@ namespace OnlineStore.DUOStore ...@@ -680,6 +682,7 @@ namespace OnlineStore.DUOStore
this.btnComP2.AutoSize = true; this.btnComP2.AutoSize = true;
this.btnComP2.BackColor = System.Drawing.SystemColors.Control; this.btnComP2.BackColor = System.Drawing.SystemColors.Control;
this.btnComP2.Cursor = System.Windows.Forms.Cursors.Default; this.btnComP2.Cursor = System.Windows.Forms.Cursors.Default;
this.btnComP2.Enabled = false;
this.btnComP2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnComP2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnComP2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnComP2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnComP2.ForeColor = System.Drawing.Color.Purple; this.btnComP2.ForeColor = System.Drawing.Color.Purple;
...@@ -1042,7 +1045,6 @@ namespace OnlineStore.DUOStore ...@@ -1042,7 +1045,6 @@ namespace OnlineStore.DUOStore
// tabPage1 // tabPage1
// //
this.tabPage1.Controls.Add(this.btnUpdown); this.tabPage1.Controls.Add(this.btnUpdown);
this.tabPage1.Controls.Add(this.chbDebug);
this.tabPage1.Controls.Add(this.groupBox7); this.tabPage1.Controls.Add(this.groupBox7);
this.tabPage1.Controls.Add(this.btnAxisOff); this.tabPage1.Controls.Add(this.btnAxisOff);
this.tabPage1.Controls.Add(this.btnAxisOn); this.tabPage1.Controls.Add(this.btnAxisOn);
...@@ -1050,7 +1052,7 @@ namespace OnlineStore.DUOStore ...@@ -1050,7 +1052,7 @@ namespace OnlineStore.DUOStore
this.tabPage1.Location = new System.Drawing.Point(4, 29); this.tabPage1.Location = new System.Drawing.Point(4, 29);
this.tabPage1.Name = "tabPage1"; this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3); this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(1046, 579); this.tabPage1.Size = new System.Drawing.Size(1046, 572);
this.tabPage1.TabIndex = 0; this.tabPage1.TabIndex = 0;
this.tabPage1.Text = " 伺服/温湿度 "; this.tabPage1.Text = " 伺服/温湿度 ";
this.tabPage1.UseVisualStyleBackColor = true; this.tabPage1.UseVisualStyleBackColor = true;
...@@ -1330,11 +1332,26 @@ namespace OnlineStore.DUOStore ...@@ -1330,11 +1332,26 @@ namespace OnlineStore.DUOStore
this.lblThisSta.TabIndex = 216; this.lblThisSta.TabIndex = 216;
this.lblThisSta.Text = "等待启动"; this.lblThisSta.Text = "等待启动";
// //
// chbDisable
//
this.chbDisable.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.chbDisable.AutoSize = true;
this.chbDisable.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbDisable.Location = new System.Drawing.Point(10, 617);
this.chbDisable.Name = "chbDisable";
this.chbDisable.Size = new System.Drawing.Size(84, 24);
this.chbDisable.TabIndex = 274;
this.chbDisable.Text = "禁用料仓";
this.chbDisable.UseVisualStyleBackColor = true;
this.chbDisable.CheckedChanged += new System.EventHandler(this.chbDisable_CheckedChanged);
//
// FrmBox // FrmBox
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(1294, 729); this.ClientSize = new System.Drawing.Size(1294, 729);
this.Controls.Add(this.chbDisable);
this.Controls.Add(this.chbDebug);
this.Controls.Add(this.groupBox4); this.Controls.Add(this.groupBox4);
this.Controls.Add(this.lblTemp); this.Controls.Add(this.lblTemp);
this.Controls.Add(this.btnDoorDown); this.Controls.Add(this.btnDoorDown);
...@@ -1357,7 +1374,6 @@ namespace OnlineStore.DUOStore ...@@ -1357,7 +1374,6 @@ namespace OnlineStore.DUOStore
this.groupInout.ResumeLayout(false); this.groupInout.ResumeLayout(false);
this.groupInout.PerformLayout(); this.groupInout.PerformLayout();
this.tabPage1.ResumeLayout(false); this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.groupBox7.ResumeLayout(false); this.groupBox7.ResumeLayout(false);
this.groupBox7.PerformLayout(); this.groupBox7.PerformLayout();
this.groupBox3.ResumeLayout(false); this.groupBox3.ResumeLayout(false);
...@@ -1453,6 +1469,7 @@ namespace OnlineStore.DUOStore ...@@ -1453,6 +1469,7 @@ namespace OnlineStore.DUOStore
private System.Windows.Forms.Button btnSingleOut; private System.Windows.Forms.Button btnSingleOut;
private System.Windows.Forms.Button btnNgPro; private System.Windows.Forms.Button btnNgPro;
private System.Windows.Forms.Label lblCanOut; private System.Windows.Forms.Label lblCanOut;
private System.Windows.Forms.CheckBox chbDisable;
} }
} }
...@@ -59,7 +59,7 @@ namespace OnlineStore.DUOStore ...@@ -59,7 +59,7 @@ namespace OnlineStore.DUOStore
acPosition = CSVPositionReader<ACBoxPosition>.GetPositon(cmbPosition.Text); acPosition = CSVPositionReader<ACBoxPosition>.GetPositon(cmbPosition.Text);
//BoxBean.PositionNumList = positionNumList; //BoxBean.PositionNumList = positionNumList;
} }
chbDisable.Checked = ConfigAppSettings.GetIntValue("Store_CID_" + BoxBean.ID + "_disabled") == 1 ? true : false;
txtMiddleP1.Text = BoxBean.Config.MiddleAxis_P1.ToString(); txtMiddleP1.Text = BoxBean.Config.MiddleAxis_P1.ToString();
txtUpdownP11.Text = BoxBean.Config.UpDownAxis_P11.ToString(); txtUpdownP11.Text = BoxBean.Config.UpDownAxis_P11.ToString();
...@@ -277,7 +277,7 @@ namespace OnlineStore.DUOStore ...@@ -277,7 +277,7 @@ namespace OnlineStore.DUOStore
txtUpDownP6.Text = acPosition.UpdownAxis_OL_P6.ToString(); txtUpDownP6.Text = acPosition.UpdownAxis_OL_P6.ToString();
txtInOutP3.Text = acPosition.InoutAxis_P3.ToString(); txtInOutP3.Text = acPosition.InoutAxis_P3.ToString();
txtMiddleP2.Text = acPosition.MiddleAxis_P2.ToString(); txtMiddleP2.Text = acPosition.MiddleAxis_P2.ToString();
txtComP2.Text = acPosition.ComAxis_P2.ToString(); //txtComP2.Text = BoxBean.Config.GetComP2(acPosition.BagHigh).ToString();
txtComP3.Text = acPosition.ComAxis_P3.ToString(); txtComP3.Text = acPosition.ComAxis_P3.ToString();
lblSize.Text = "尺寸:" + acPosition.BagWidth + "*" + acPosition.BagHigh; lblSize.Text = "尺寸:" + acPosition.BagWidth + "*" + acPosition.BagHigh;
...@@ -323,7 +323,7 @@ namespace OnlineStore.DUOStore ...@@ -323,7 +323,7 @@ namespace OnlineStore.DUOStore
int comp1 = FormUtil.GetIntValue(txtComP1); int comp1 = FormUtil.GetIntValue(txtComP1);
int comp2 = FormUtil.GetIntValue(txtComP2); int comp2 = FormUtil.GetIntValue(txtComP2);
int comp3 = FormUtil.GetIntValue(txtComP3); //int comp3 = FormUtil.GetIntValue(txtComP3);
int mP1 = FormUtil.GetIntValue(txtMiddleP1); int mP1 = FormUtil.GetIntValue(txtMiddleP1);
int mp11 = FormUtil.GetIntValue(txtMiddleP11); int mp11 = FormUtil.GetIntValue(txtMiddleP11);
...@@ -471,7 +471,7 @@ namespace OnlineStore.DUOStore ...@@ -471,7 +471,7 @@ namespace OnlineStore.DUOStore
} }
private void btnInoutP11_Click(object sender, EventArgs e) private void btnInoutP11_Click(object sender, EventArgs e)
{ {
AxisAbsMove(BoxBean.Config.UpDown_Axis, txtInoutP11, BoxBean.Config.InOutAxis_P11_Speed); AxisAbsMove(BoxBean.Config.InOut_Axis, txtInoutP11, BoxBean.Config.InOutAxis_P11_Speed);
} }
private void btnMiddleP11_Click(object sender, EventArgs e) private void btnMiddleP11_Click(object sender, EventArgs e)
...@@ -830,5 +830,12 @@ namespace OnlineStore.DUOStore ...@@ -830,5 +830,12 @@ namespace OnlineStore.DUOStore
MessageBox.Show("请先启动料仓!"); MessageBox.Show("请先启动料仓!");
} }
} }
private void chbDisable_CheckedChanged(object sender, EventArgs e)
{
BoxBean.Disabled = chbDisable.Checked;
ConfigAppSettings.SaveValue("Store_CID_" + BoxBean.ID + "_disabled", chbDisable.Checked ? 1 : 0);
}
} }
} }
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.button1 = new System.Windows.Forms.Button();
this.chbInstoreEnd = new System.Windows.Forms.CheckBox(); this.chbInstoreEnd = new System.Windows.Forms.CheckBox();
this.chkDebug = new System.Windows.Forms.CheckBox(); this.chkDebug = new System.Windows.Forms.CheckBox();
this.lblMoveInfo = new System.Windows.Forms.Label(); this.lblMoveInfo = new System.Windows.Forms.Label();
...@@ -65,6 +64,7 @@ ...@@ -65,6 +64,7 @@
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
this.扫码测试ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.扫码测试ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();
this.显示日志ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.帮助ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.帮助ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.版本号ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.版本号ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components); this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
...@@ -114,7 +114,6 @@ ...@@ -114,7 +114,6 @@
// //
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.panel1.Controls.Add(this.button1);
this.panel1.Controls.Add(this.chbInstoreEnd); this.panel1.Controls.Add(this.chbInstoreEnd);
this.panel1.Controls.Add(this.chkDebug); this.panel1.Controls.Add(this.chkDebug);
this.panel1.Controls.Add(this.lblMoveInfo); this.panel1.Controls.Add(this.lblMoveInfo);
...@@ -129,19 +128,6 @@ ...@@ -129,19 +128,6 @@
this.panel1.Size = new System.Drawing.Size(182, 623); this.panel1.Size = new System.Drawing.Size(182, 623);
this.panel1.TabIndex = 271; this.panel1.TabIndex = 271;
// //
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.button1.BackColor = System.Drawing.Color.White;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Location = new System.Drawing.Point(12, 490);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(105, 35);
this.button1.TabIndex = 272;
this.button1.Text = "测试";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// chbInstoreEnd // chbInstoreEnd
// //
this.chbInstoreEnd.AutoSize = true; this.chbInstoreEnd.AutoSize = true;
...@@ -199,6 +185,7 @@ ...@@ -199,6 +185,7 @@
this.btnCopyLog.TabIndex = 191; this.btnCopyLog.TabIndex = 191;
this.btnCopyLog.Text = "复制日志"; this.btnCopyLog.Text = "复制日志";
this.btnCopyLog.UseVisualStyleBackColor = false; this.btnCopyLog.UseVisualStyleBackColor = false;
this.btnCopyLog.Visible = false;
this.btnCopyLog.Click += new System.EventHandler(this.btnCopyLog_Click); this.btnCopyLog.Click += new System.EventHandler(this.btnCopyLog_Click);
// //
// btnClearLog // btnClearLog
...@@ -212,6 +199,7 @@ ...@@ -212,6 +199,7 @@
this.btnClearLog.TabIndex = 190; this.btnClearLog.TabIndex = 190;
this.btnClearLog.Text = "清空日志"; this.btnClearLog.Text = "清空日志";
this.btnClearLog.UseVisualStyleBackColor = false; this.btnClearLog.UseVisualStyleBackColor = false;
this.btnClearLog.Visible = false;
this.btnClearLog.Click += new System.EventHandler(this.btnClearLog_Click); this.btnClearLog.Click += new System.EventHandler(this.btnClearLog_Click);
// //
// lblShelf // lblShelf
...@@ -285,6 +273,7 @@ ...@@ -285,6 +273,7 @@
this.logBox.Size = new System.Drawing.Size(1098, 500); this.logBox.Size = new System.Drawing.Size(1098, 500);
this.logBox.TabIndex = 106; this.logBox.TabIndex = 106;
this.logBox.Text = ""; this.logBox.Text = "";
this.logBox.Visible = false;
this.logBox.VisibleChanged += new System.EventHandler(this.logBox_VisibleChanged); this.logBox.VisibleChanged += new System.EventHandler(this.logBox_VisibleChanged);
// //
// lblWarnMsg // lblWarnMsg
...@@ -333,54 +322,54 @@ ...@@ -333,54 +322,54 @@
// toolStripSeparator1 // toolStripSeparator1
// //
this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6); this.toolStripSeparator1.Size = new System.Drawing.Size(114, 6);
// //
// 启动AToolStripMenuItem // 启动AToolStripMenuItem
// //
this.启动AToolStripMenuItem.Name = "启动AToolStripMenuItem"; this.启动AToolStripMenuItem.Name = "启动AToolStripMenuItem";
this.启动AToolStripMenuItem.Size = new System.Drawing.Size(180, 26); this.启动AToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.启动AToolStripMenuItem.Text = "启动 "; this.启动AToolStripMenuItem.Text = "启动 ";
this.启动AToolStripMenuItem.Click += new System.EventHandler(this.启动所有料仓AToolStripMenuItem_Click); this.启动AToolStripMenuItem.Click += new System.EventHandler(this.启动所有料仓AToolStripMenuItem_Click);
// //
// toolStripSeparator4 // toolStripSeparator4
// //
this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(177, 6); this.toolStripSeparator4.Size = new System.Drawing.Size(114, 6);
// //
// 复位RToolStripMenuItem // 复位RToolStripMenuItem
// //
this.复位RToolStripMenuItem.Name = "复位RToolStripMenuItem"; this.复位RToolStripMenuItem.Name = "复位RToolStripMenuItem";
this.复位RToolStripMenuItem.Size = new System.Drawing.Size(180, 26); this.复位RToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.复位RToolStripMenuItem.Text = "复位"; this.复位RToolStripMenuItem.Text = "复位";
this.复位RToolStripMenuItem.Click += new System.EventHandler(this.复位RToolStripMenuItem_Click); this.复位RToolStripMenuItem.Click += new System.EventHandler(this.复位RToolStripMenuItem_Click);
// //
// toolStripSeparator3 // toolStripSeparator3
// //
this.toolStripSeparator3.Name = "toolStripSeparator3"; this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(177, 6); this.toolStripSeparator3.Size = new System.Drawing.Size(114, 6);
// //
// 停止TToolStripMenuItem // 停止TToolStripMenuItem
// //
this.停止TToolStripMenuItem.Name = "停止TToolStripMenuItem"; this.停止TToolStripMenuItem.Name = "停止TToolStripMenuItem";
this.停止TToolStripMenuItem.Size = new System.Drawing.Size(180, 26); this.停止TToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.停止TToolStripMenuItem.Text = "停止"; this.停止TToolStripMenuItem.Text = "停止";
this.停止TToolStripMenuItem.Click += new System.EventHandler(this.停止所有料仓TToolStripMenuItem_Click); this.停止TToolStripMenuItem.Click += new System.EventHandler(this.停止所有料仓TToolStripMenuItem_Click);
// //
// toolStripSeparator5 // toolStripSeparator5
// //
this.toolStripSeparator5.Name = "toolStripSeparator5"; this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(177, 6); this.toolStripSeparator5.Size = new System.Drawing.Size(114, 6);
// //
// toolStripSeparator2 // toolStripSeparator2
// //
this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6); this.toolStripSeparator2.Size = new System.Drawing.Size(114, 6);
this.toolStripSeparator2.Visible = false; this.toolStripSeparator2.Visible = false;
// //
// 退出ToolStripMenuItem // 退出ToolStripMenuItem
// //
this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem"; this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(180, 26); this.退出ToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.退出ToolStripMenuItem.Text = "退出"; this.退出ToolStripMenuItem.Text = "退出";
this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click_1); this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click_1);
// //
...@@ -392,7 +381,8 @@ ...@@ -392,7 +381,8 @@
this.二维码学习ToolStripMenuItem, this.二维码学习ToolStripMenuItem,
this.toolStripSeparator7, this.toolStripSeparator7,
this.扫码测试ToolStripMenuItem, this.扫码测试ToolStripMenuItem,
this.toolStripSeparator9}); this.toolStripSeparator9,
this.显示日志ToolStripMenuItem});
this.设置TToolStripMenuItem.Name = "设置TToolStripMenuItem"; this.设置TToolStripMenuItem.Name = "设置TToolStripMenuItem";
this.设置TToolStripMenuItem.Size = new System.Drawing.Size(91, 25); this.设置TToolStripMenuItem.Size = new System.Drawing.Size(91, 25);
this.设置TToolStripMenuItem.Text = "设备调试 "; this.设置TToolStripMenuItem.Text = "设备调试 ";
...@@ -433,6 +423,13 @@ ...@@ -433,6 +423,13 @@
this.toolStripSeparator9.Name = "toolStripSeparator9"; this.toolStripSeparator9.Name = "toolStripSeparator9";
this.toolStripSeparator9.Size = new System.Drawing.Size(157, 6); this.toolStripSeparator9.Size = new System.Drawing.Size(157, 6);
// //
// 显示日志ToolStripMenuItem
//
this.显示日志ToolStripMenuItem.Name = "显示日志ToolStripMenuItem";
this.显示日志ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
this.显示日志ToolStripMenuItem.Text = "显示日志";
this.显示日志ToolStripMenuItem.Click += new System.EventHandler(this.显示日志ToolStripMenuItem_Click);
//
// 帮助ToolStripMenuItem // 帮助ToolStripMenuItem
// //
this.帮助ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.帮助ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
...@@ -566,7 +563,7 @@ ...@@ -566,7 +563,7 @@
private System.Windows.Forms.Label lblMoveInfo; private System.Windows.Forms.Label lblMoveInfo;
private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.CheckBox chbInstoreEnd; private System.Windows.Forms.CheckBox chbInstoreEnd;
private System.Windows.Forms.Button button1; private System.Windows.Forms.ToolStripMenuItem 显示日志ToolStripMenuItem;
} }
} }
...@@ -170,7 +170,7 @@ namespace OnlineStore.DUOStore ...@@ -170,7 +170,7 @@ namespace OnlineStore.DUOStore
//BoxBean _equip = (BoxBean)equip; //BoxBean _equip = (BoxBean)equip;
//LogUtil.info(_equip.MoveInfo.ToString()); //LogUtil.info(_equip.MoveInfo.ToString());
//LogUtil.info(_equip.MoveInfo.MoveParam.ToString()); //LogUtil.info(_equip.MoveInfo.MoveParam.ToString());
if (equip.MoveInfo.MoveParam != null) if (equip.MoveInfo != null && equip.MoveInfo.MoveParam != null)
trayInfo = equip.MoveInfo.MoveParam.ToStr(); trayInfo = equip.MoveInfo.MoveParam.ToStr();
} }
SetItemText(i, item_move_info_index, trayInfo); SetItemText(i, item_move_info_index, trayInfo);
...@@ -730,40 +730,13 @@ namespace OnlineStore.DUOStore ...@@ -730,40 +730,13 @@ namespace OnlineStore.DUOStore
} }
private async void button1_Click(object sender, EventArgs e)
{
int contentLength = await AccessTheWebAsync();
this.logBox.Text+= $"\r\nLength of the downloaded string: {contentLength}.\r\n"; private void 显示日志ToolStripMenuItem_Click(object sender, EventArgs e)
}
async Task<int> AccessTheWebAsync()
{ {
// You need to add a reference to System.Net.Http to declare client. logBox.Visible = logBox.Visible ? false : true;
var client = new HttpClient(); btnCopyLog.Visible = logBox.Visible;
btnClearLog.Visible = logBox.Visible;
// GetStringAsync returns a Task<string>. That means that when you await the
// task you'll get a string (urlContents).
Task<string> getStringTask = client.GetStringAsync("https://docs.microsoft.com/dotnet");
// You can do work here that doesn't rely on the string from GetStringAsync.
DoIndependentWork();
// The await operator suspends AccessTheWebAsync.
// - AccessTheWebAsync can't continue until getStringTask is complete.
// - Meanwhile, control returns to the caller of AccessTheWebAsync.
// - Control resumes here when getStringTask is complete.
// - The await operator then retrieves the string result from getStringTask.
string urlContents = await getStringTask;
// The return statement specifies an integer result.
// Any methods that are awaiting AccessTheWebAsync retrieve the length value.
return urlContents.Length;
}
private void DoIndependentWork()
{
Console.WriteLine("Working ... .... ");
this.logBox.Text += $"\r\nWorking ... .... .\r\n";
} }
} }
} }
...@@ -33,7 +33,7 @@ namespace OnlineStore.DUOStore ...@@ -33,7 +33,7 @@ namespace OnlineStore.DUOStore
{ {
InitializeComponent(); InitializeComponent();
this.PortName = configMoveAxis.ProName; this.PortName = configMoveAxis.ProName;
this.SlvAddr = configMoveAxis.SlaveID; this.SlvAddr = configMoveAxis.GetAxisValue();
this.IoIp = ""; this.IoIp = "";
this.IoIndex = ioIndex; this.IoIndex = ioIndex;
this.subType = ioSubType; this.subType = ioSubType;
......
...@@ -90,20 +90,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -90,20 +90,18 @@ namespace OnlineStore.DeviceLibrary
{ {
try try
{ {
//UpdateAction(id, ClientAction.Ready);
LogUtil.info("收到 AgvClient_Ready [" + id + "] [" + rfid + "] " + GetAction(id).ToString()); LogUtil.info("收到 AgvClient_Ready [" + id + "] [" + rfid + "] " + GetAction(id).ToString());
if (GetAction(id) == ClientAction.NeedEnter || id == "D1") if (GetAction(id) == ClientAction.NeedEnter || id == StoreManager.Config.AgvInName)
{ {
SetStatus(id, "", ClientAction.MayEnter); SetStatus(id, "", ClientAction.MayEnter);
_ = StoreManager.Store.AgvSendShelfIn();
} }
else if (GetAction(id) == ClientAction.NeedLeave || id == "D2") else if (GetAction(id) == ClientAction.NeedLeave || id == StoreManager.Config.AgvOutName)
{ {
SetStatus(id, "", ClientAction.MayLeave); SetStatus(id, "", ClientAction.MayLeave);
StoreManager.Store.OneShelfOutProcess();
} }
else else
{ {
LogUtil.error("收到 AgvClient_Arrive [" + id + "] [" + rfid + "] 未找到对应的设备 ,暂不处理"); LogUtil.error("收到 AgvClient_Arrive [" + id + "] [" + rfid + "] 未找到对应的设备 ,暂不处理");
......
...@@ -36,8 +36,9 @@ ...@@ -36,8 +36,9 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Asa.IOModule.AIOBOX"> <Reference Include="Asa.IOModule.AIOBOX, Version=2.4.0.7, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\dll\Asa.IOModule.AIOBOX.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\AIOBOX\AIOBOX\bin\Debug\Asa.IOModule.AIOBOX.dll</HintPath>
</Reference> </Reference>
<Reference Include="Client, Version=1.0.0.1, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Client, Version=1.0.0.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
......
...@@ -10,6 +10,7 @@ PRO,,L2_上下轴_P2入料口高点,UpDownAxis_P2,10,,,,,,,,,,,, ...@@ -10,6 +10,7 @@ PRO,,L2_上下轴_P2入料口高点,UpDownAxis_P2,10,,,,,,,,,,,,
PRO,,L1_旋转轴_P1待机点/入料口位置,MiddleAxis_P1,10,,,,,,,,,,,, PRO,,L1_旋转轴_P1待机点/入料口位置,MiddleAxis_P1,10,,,,,,,,,,,,
PRO,,L3_进出轴_P1待机点,InOutAxis_P1,10,,,,,,,,,,,, PRO,,L3_进出轴_P1待机点,InOutAxis_P1,10,,,,,,,,,,,,
PRO,,L4_压紧轴_P1待机点,CompAxis_P1,10,,,,,,,,,,,, PRO,,L4_压紧轴_P1待机点,CompAxis_P1,10,,,,,,,,,,,,
PRO,,L4_压紧轴_P2压紧点范围对应值,CompAxis_P2_List,8=247455;12=383001;16=379001;,,,,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,,L2_上下轴_P11-出料口-低点,UpDownAxis_P11,10,,,,,,,,,,,, PRO,,L2_上下轴_P11-出料口-低点,UpDownAxis_P11,10,,,,,,,,,,,,
PRO,,L2_上下轴_P12-出料口-高点,UpDownAxis_P12,10,,,,,,,,,,,, PRO,,L2_上下轴_P12-出料口-高点,UpDownAxis_P12,10,,,,,,,,,,,,
......
...@@ -10,6 +10,7 @@ PRO,,R2_上下轴_P2扫码放料高点缓冲点,UpDownAxis_P2,10,,,,,,,,,,,, ...@@ -10,6 +10,7 @@ PRO,,R2_上下轴_P2扫码放料高点缓冲点,UpDownAxis_P2,10,,,,,,,,,,,,
PRO,,R1_旋转轴_P1待机点/扫码放料点,MiddleAxis_P1,10,,,,,,,,,,,, PRO,,R1_旋转轴_P1待机点/扫码放料点,MiddleAxis_P1,10,,,,,,,,,,,,
PRO,,R3_进出轴_P1待机点,InOutAxis_P1,10,,,,,,,,,,,, PRO,,R3_进出轴_P1待机点,InOutAxis_P1,10,,,,,,,,,,,,
PRO,,R4_压紧轴_P1待机点,CompAxis_P1,10,,,,,,,,,,,, PRO,,R4_压紧轴_P1待机点,CompAxis_P1,10,,,,,,,,,,,,
PRO,,L4_压紧轴_P2压紧点范围对应值,CompAxis_P2_List,8=247455;12=383001;16=379001;,,,,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,,R2_上下轴_P11-出料口-低点,UpDownAxis_P11,10,,,,,,,,,,,, PRO,,R2_上下轴_P11-出料口-低点,UpDownAxis_P11,10,,,,,,,,,,,,
PRO,,R2_上下轴_P12-出料口-高点,UpDownAxis_P12,10,,,,,,,,,,,, PRO,,R2_上下轴_P12-出料口-高点,UpDownAxis_P12,10,,,,,,,,,,,,
......
...@@ -50,14 +50,6 @@ DI,0,设备左侧防护门打开端,LeftDoor_Open,35,HC,X35,*,,,,,,,,, ...@@ -50,14 +50,6 @@ DI,0,设备左侧防护门打开端,LeftDoor_Open,35,HC,X35,*,,,,,,,,,
DI,0,设备左侧防护门关闭端,LeftDoor_Close,36,HC,X36,*,,,,,,,,, DI,0,设备左侧防护门关闭端,LeftDoor_Close,36,HC,X36,*,,,,,,,,,
DI,0,设备右侧防护门打开端,RightDoor_Open,37,HC,X37,*,,,,,,,,, DI,0,设备右侧防护门打开端,RightDoor_Open,37,HC,X37,*,,,,,,,,,
DI,0,设备右侧防护门关闭端,RightDoor_Close,38,HC,X38,*,,,,,,,,, DI,0,设备右侧防护门关闭端,RightDoor_Close,38,HC,X38,*,,,,,,,,,
DI,0,卡爪到位确认,Clamp_OnPosition,39,HC,X39,*,,,,,,,,,
DI,0,卡爪范围确认,Clamp_InRange,40,HC,X40,*,,,,,,,,,
DI,0,卡爪动作中,Clamp_Busy,41,HC,X41,*,,,,,,,,,
DI,0,卡爪异常代码1,Clamp_Abnormal1,42,HC,X42,*,,,,,,,,,
DI,0,卡爪异常代码2,Clamp_Abnormal2,43,HC,X43,*,,,,,,,,,
DI,0,卡爪物件辨识1,Clamp_ObjRecognize1,44,HC,X44,*,,,,,,,,,
DI,0,卡爪物件辨识2,Clamp_ObjRecognize2,45,HC,X45,*,,,,,,,,,
DI,0,卡爪物件辨识3,Clamp_ObjRecognize3,46,HC,X46,*,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
DO,0,自动指示灯,AutoRun_HddLed,0,HC,Y00,,,,,,,,,, DO,0,自动指示灯,AutoRun_HddLed,0,HC,Y00,,,,,,,,,,
DO,0,故障指示灯,Alarm_HddLed,1,HC,Y01,,,,,,,,,, DO,0,故障指示灯,Alarm_HddLed,1,HC,Y01,,,,,,,,,,
...@@ -90,12 +82,6 @@ DO,0,设备右侧防护门打开,RightDoor_Open,27,HC,Y27,*,,,,,,,,, ...@@ -90,12 +82,6 @@ DO,0,设备右侧防护门打开,RightDoor_Open,27,HC,Y27,*,,,,,,,,,
DO,0,设备右侧防护门关闭,RightDoor_Close,28,HC,Y28,*,,,,,,,,, DO,0,设备右侧防护门关闭,RightDoor_Close,28,HC,Y28,*,,,,,,,,,
DO,2,右侧出料口门上升,OutDoor_Up,29,HC,Y29,,,,,,,,,, DO,2,右侧出料口门上升,OutDoor_Up,29,HC,Y29,,,,,,,,,,
DO,2,右侧出料口门下降,OutDoor_Down,30,HC,Y30,,,,,,,,,, DO,2,右侧出料口门下降,OutDoor_Down,30,HC,Y30,,,,,,,,,,
DO,0,卡爪指令编码0,Clamp_SetPos0,31,HC,Y31,*,,,,,,,,,
DO,1,卡爪指令编码1,Clamp_SetPos1,32,HC,Y32,*,,,,,,,,,
DO,2,卡爪指令编码2,Clamp_SetPos2,33,HC,Y33,*,,,,,,,,,
DO,3,卡爪指令编码3,Clamp_SetPos3,34,HC,Y34,*,,,,,,,,,
DO,4,卡爪指令编码4,Clamp_SetPos4,35,HC,Y35,*,,,,,,,,,
DO,5,卡爪动作指令,Clamp_DoAction,36,HC,Y36,*,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,0,T1_提升轴待机点 P1,BatchAxis_P1,5000,,,,, ,,,,,,, PRO,0,T1_提升轴待机点 P1,BatchAxis_P1,5000,,,,, ,,,,,,,
PRO,0,T1_提升轴上升目标点_P2,BatchAxis_P2,4000,,,,, ,,,,,,, PRO,0,T1_提升轴上升目标点_P2,BatchAxis_P2,4000,,,,, ,,,,,,,
......
...@@ -147,7 +147,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -147,7 +147,7 @@ namespace OnlineStore.DeviceLibrary
string r = ""; string r = "";
List<CodeInfo> tlci = EyemDecode.Decoder(ref bmp); List<CodeInfo> tlci = EyemDecode.Decoder(ref bmp,null,15);
foreach (CodeInfo code in tlci) foreach (CodeInfo code in tlci)
{ {
......
...@@ -28,6 +28,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -28,6 +28,7 @@ namespace OnlineStore.DeviceLibrary
public AxisBean ComAxis = null; public AxisBean ComAxis = null;
public AxisBean InoutAxis = null; public AxisBean InoutAxis = null;
public bool Disabled = false;
/// <summary> /// <summary>
/// 出料口最后一盘料信息,0=暂无,1=单盘出库料亮绿灯,2=入库NG料亮红灯 /// 出料口最后一盘料信息,0=暂无,1=单盘出库料亮绿灯,2=入库NG料亮红灯
/// </summary> /// </summary>
...@@ -107,6 +108,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -107,6 +108,12 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(Name + "启动失败:设备未初始化完成"); LogUtil.error(Name + "启动失败:设备未初始化完成");
return false; return false;
} }
if (Disabled)
{
WarnMsg = "启动失败:设备被禁用";
LogUtil.error(Name + "启动失败:设备被禁用");
return false;
}
LogInfo("开始启动,启动时间:" + StartTime.ToString()); LogInfo("开始启动,启动时间:" + StartTime.ToString());
AutoInout.StopAuto(); AutoInout.StopAuto();
mainTimer.Enabled = false; mainTimer.Enabled = false;
...@@ -166,6 +173,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -166,6 +173,8 @@ namespace OnlineStore.DeviceLibrary
public override void Reset(bool isNeedClearAuto = true) public override void Reset(bool isNeedClearAuto = true)
{ {
if (Disabled)
return;
AutoInout.ClearCount(); AutoInout.ClearCount();
//复位之前先停止运行 //复位之前先停止运行
if (isNeedClearAuto) if (isNeedClearAuto)
...@@ -310,13 +319,33 @@ namespace OnlineStore.DeviceLibrary ...@@ -310,13 +319,33 @@ namespace OnlineStore.DeviceLibrary
CheckAxisAlarm(new AxisBean[] { MiddleAxis, UpdownAxis, InoutAxis, ComAxis }); CheckAxisAlarm(new AxisBean[] { MiddleAxis, UpdownAxis, InoutAxis, ComAxis });
ShowTimeLog("轴报警检测完成"); ShowTimeLog("轴报警检测完成");
} }
if (runStatus >= StoreRunStatus.Runing)
{
IOMinoitor();
}
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(Name + "定时处理出错" + ex.ToString()); LogUtil.error(Name + "定时处理出错" + ex.ToString());
} }
} }
int OutDoorCloseCountDown = 5;
void IOMinoitor() {
if (IOValue(IO_Type.OutDoor_Up).Equals(IO_VALUE.HIGH)
&& IOValue(IO_Type.OutDoor_Check).Equals(IO_VALUE.LOW)
&& IOValue(IO_Type.OutDoor_SafeSignal).Equals(IO_VALUE.LOW))
{
OutDoorCloseCountDown--;
while (OutDoorCloseCountDown == 0)
{
CylinderMove(MoveInfo, IO_Type.OutDoor_Up, IO_Type.OutDoor_Down);
LogInfo("料已被取走,关门");
}
}
else {
OutDoorCloseCountDown = 5;
}
}
private void AutoResetProcess() private void AutoResetProcess()
{ {
...@@ -336,6 +365,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -336,6 +365,21 @@ namespace OnlineStore.DeviceLibrary
} }
return; return;
} }
else if (IOValue(IO_Type.OutDoor_Check).Equals(IO_VALUE.HIGH) && noInStore && IsDebug.Equals(false))
{
LogInfo("发现紧急出口有料");
InOutParam inOutParam = new InOutParam(MoveType.InStore);
inOutParam.InStoreNg = true;
inOutParam.TargetPosition = 1;
inOutParam.moveType = MoveType.InStore;
StoreManager.LoadInoutParam(inOutParam, MoveType.InStore, true, this);
runStatus = StoreRunStatus.Busy;
storeStatus = StoreStatus.InStoreExecute;
MoveInfo.NewMove(MoveType.InStore, inOutParam);
MoveInfo.NextMoveStep(StoreMoveStep.SI_24_PurReel);
//InoutAxis.AbsMove(MoveInfo, Config.InOutAxis_P1, Config.InOutAxis_P1_Speed);
}
else if (waitInStoreParam != null && noInStore && IsDebug.Equals(false)) else if (waitInStoreParam != null && noInStore && IsDebug.Equals(false))
{ {
if (!StartInStoreMove(waitInStoreParam)) if (!StartInStoreMove(waitInStoreParam))
...@@ -383,11 +427,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -383,11 +427,11 @@ namespace OnlineStore.DeviceLibrary
public bool OpenAllAxis(bool isCheck) public bool OpenAllAxis(bool isCheck)
{ {
return RunMultiAxis(true,new AxisBean[] { MiddleAxis, UpdownAxis, InoutAxis, ComAxis }); return RunMultiAxis(isCheck, new AxisBean[] { MiddleAxis, UpdownAxis, InoutAxis, ComAxis });
} }
public void CloseAllAxis() public void CloseAllAxis()
{ {
LogUtil.info(Name + "关闭刹车,关闭伺服"); LogUtil.info(Name + "关闭伺服");
CloseMultiAxis(new AxisBean[] { MiddleAxis, UpdownAxis, InoutAxis, ComAxis }); CloseMultiAxis(new AxisBean[] { MiddleAxis, UpdownAxis, InoutAxis, ComAxis });
} }
......
...@@ -89,6 +89,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -89,6 +89,12 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
LogInfo(" 启动入库【" + param.ToStr() + "】 "); LogInfo(" 启动入库【" + param.ToStr() + "】 ");
if (!AutoInout.autoNext)
{
if (!param.InStoreNg && !ReviceInStoreCMD(param.PosID, param.PlateH, param.PlateW, param.WareCode))
return false;
}
runStatus = StoreRunStatus.Busy; runStatus = StoreRunStatus.Busy;
if (param.TargetPosition.Equals(0)) if (param.TargetPosition.Equals(0))
{ {
...@@ -130,7 +136,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -130,7 +136,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.IsStep(StoreMoveStep.SI_02_AxisBack)) else if (MoveInfo.IsStep(StoreMoveStep.SI_02_AxisBack))
{ {
if (StoreManager.Store.BoxDoorFree(ID)) if (true || StoreManager.Store.BoxDoorFree(ID))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SI_03_InoutToP2); MoveInfo.NextMoveStep(StoreMoveStep.SI_03_InoutToP2);
InOutStoreLog(outType + "进出轴到P2[" + moveP.InOut_P2 + "] "); InOutStoreLog(outType + "进出轴到P2[" + moveP.InOut_P2 + "] ");
...@@ -234,8 +240,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -234,8 +240,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StoreMoveStep.SI_21_ToOutDoor)) else if (MoveInfo.IsStep(StoreMoveStep.SI_21_ToOutDoor))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SI_22_OpenOutDoor); MoveInfo.NextMoveStep(StoreMoveStep.SI_22_OpenOutDoor);
InOutStoreLog(outType + "打开出料口门 ");
CylinderMove(MoveInfo, IO_Type.OutDoor_Down, IO_Type.OutDoor_Up);
} }
else if (MoveInfo.IsStep(StoreMoveStep.SI_22_OpenOutDoor)) else if (MoveInfo.IsStep(StoreMoveStep.SI_22_OpenOutDoor))
{ {
...@@ -257,19 +262,30 @@ namespace OnlineStore.DeviceLibrary ...@@ -257,19 +262,30 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StoreMoveStep.SI_25_InoutToP1); MoveInfo.NextMoveStep(StoreMoveStep.SI_25_InoutToP1);
InOutStoreLog(outType + "进出轴返回P1 ["+ moveP.InOut_P1 + "] "); InOutStoreLog(outType + "进出轴返回P1 ["+ moveP.InOut_P1 + "] ");
InOutBackToP1(moveP.InOut_P1); InOutBackToP1(moveP.InOut_P1);
OutDoorReelType = 1; if (MoveInfo.MoveParam.InStoreNg)
OutDoorReelType = 2;
else
OutDoorReelType = 1;
InOutStoreLog(outType + "打开出料口门 ");
CylinderMove(MoveInfo, IO_Type.OutDoor_Down, IO_Type.OutDoor_Up);
} }
else if (MoveInfo.IsStep(StoreMoveStep.SI_25_InoutToP1)) else if (MoveInfo.IsStep(StoreMoveStep.SI_25_InoutToP1))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SI_26_GoBack); if (IOValue(IO_Type.OutDoor_SafeSignal).Equals(IO_VALUE.HIGH))
InOutStoreLog(outType + "升降轴到P1[" + moveP.UpDown_P1 + "],旋转轴到P1[" + moveP.Middle_P1 + "] ,压紧轴到P1[" + moveP.ComPress_P1 + "],关闭出料口门"); {
CylinderMove(MoveInfo, IO_Type.OutDoor_Up, IO_Type.OutDoor_Down); MoveInfo.NextMoveStep(StoreMoveStep.SI_26_GoBack);
ComAxis.AbsMove(MoveInfo, moveP.ComPress_P1, Config.CompAxis_P1_Speed); InOutStoreLog(outType + "升降轴到P1[" + moveP.UpDown_P1 + "],旋转轴到P1[" + moveP.Middle_P1 + "] ,压紧轴到P1[" + moveP.ComPress_P1 + "],关闭出料口门");
MiddleAxis.AbsMove(MoveInfo, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed); ComAxis.AbsMove(MoveInfo, moveP.ComPress_P1, Config.CompAxis_P1_Speed);
MiddleAxis.AbsMove(MoveInfo, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
}
} }
else if (MoveInfo.IsStep(StoreMoveStep.SI_26_GoBack)) else if (MoveInfo.IsStep(StoreMoveStep.SI_26_GoBack))
{ {
CylinderMove(MoveInfo, IO_Type.OutDoor_Up, IO_Type.OutDoor_Down);
OutDoorReelType = 0;
TimeSpan span = DateTime.Now - startInStoreTime; TimeSpan span = DateTime.Now - startInStoreTime;
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : ""; string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : "";
LogUtil.info(Name + " 【" + posId + "】NG料送料结束,耗时【" + FormUtil.GetSpanStr(span) + "】"); LogUtil.info(Name + " 【" + posId + "】NG料送料结束,耗时【" + FormUtil.GetSpanStr(span) + "】");
...@@ -298,8 +314,22 @@ namespace OnlineStore.DeviceLibrary ...@@ -298,8 +314,22 @@ namespace OnlineStore.DeviceLibrary
if (!result) if (!result)
{ {
LogInfo(" 执行出库【" + param.ToStr() + "】失败,加入等待队列"); lock (waitOutStoreList)
waitOutStoreList.Enqueue(param); {
LogInfo(" 执行出库【" + param.ToStr() + "】失败,加入等待队列");
if (MoveInfo.MoveType.Equals(MoveType.OutStore) && MoveInfo.MoveParam.PosID.Equals(param.PosID))
{
LogUtil.error(Name + " 出库命令【" + param.ToStr() + "】重复,正在【" + MoveInfo.MoveParam.PosID + "】出库中");
return;
}
List<InOutParam> reviceList = new List<InOutParam>(waitOutStoreList);
reviceList = (from m in reviceList where m.PosID.Equals(param.PosID) select m).ToList<InOutParam>();
if (reviceList.Count == 0)
{
waitOutStoreList.Enqueue(param);
}
}
} }
} }
...@@ -483,19 +513,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -483,19 +513,12 @@ namespace OnlineStore.DeviceLibrary
#endregion #endregion
else if (MoveInfo.IsStep(StoreMoveStep.SO_07_FixtureCheck)) else if (MoveInfo.IsStep(StoreMoveStep.SO_07_FixtureCheck))
{ {
if (StoreManager.Store.BoxDoorFree(ID))
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_08_InoutToP2); MoveInfo.NextMoveStep(StoreMoveStep.SO_08_InoutToP2);
InOutStoreLog(outType + "进出轴到P2 [" + moveP.InOut_P2 + "]"); InOutStoreLog(outType + "进出轴到P2 [" + moveP.InOut_P2 + "]");
InoutAxis.AbsMove(MoveInfo, moveP.InOut_P2, Config.InOutAxis_P2_Speed); InoutAxis.AbsMove(MoveInfo, moveP.InOut_P2, Config.InOutAxis_P2_Speed);
ClearTimeoutAlarm("进出轴可以到P2"); ClearTimeoutAlarm("进出轴可以到P2");
}
else if (MoveInfo.IsTimeOut(60))
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 等待 进出轴可以到P2 超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, ID * 1000 + 30);
Alarm(AlarmType.IoSingleTimeOut);
}
} }
else if (MoveInfo.IsStep(StoreMoveStep.SO_08_InoutToP2)) else if (MoveInfo.IsStep(StoreMoveStep.SO_08_InoutToP2))
{ {
...@@ -539,7 +562,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -539,7 +562,7 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SO_12_WaitTrayGo); MoveInfo.NextMoveStep(StoreMoveStep.SO_12_WaitTrayGo);
InOutStoreLog(outType + "等待提升机构拿走料盘 "); InOutStoreLog(outType + "等待提升机构拿走料盘 ");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); //MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.InDoor_Check, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.InDoor_Check, IO_VALUE.LOW));
ClearTimeoutAlarm("提升机构夹爪开始取料"); ClearTimeoutAlarm("提升机构夹爪开始取料");
...@@ -570,7 +593,35 @@ namespace OnlineStore.DeviceLibrary ...@@ -570,7 +593,35 @@ namespace OnlineStore.DeviceLibrary
AutoInout.InOutEndProcess(this, MoveType.OutStore); AutoInout.InOutEndProcess(this, MoveType.OutStore);
} }
#endregion #endregion
#region 出料移栽失败,送至紧急出料口
else if (MoveInfo.IsStep(StoreMoveStep.SO_14_InoutToP1))
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_15_AxisBack);
InOutStoreLog(outType + " 升降轴到P1[" + moveP.UpDown_P1 + "],旋转轴到P1[" + moveP.Middle_P1 + "] ,压紧轴到P3[" + moveP.ComPress_P3 + "]");
ComAxis.AbsMove(MoveInfo, moveP.ComPress_P3, Config.CompAxis_P3_Speed);
UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
MiddleAxis.AbsMove(MoveInfo, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
}
else if (MoveInfo.IsStep(StoreMoveStep.SO_15_AxisBack))
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_16_InoutToP2);
InOutStoreLog(outType + "进出轴到P2[" + moveP.InOut_P2 + "] ");
InoutAxis.AbsMove(MoveInfo, moveP.InOut_P2, Config.InOutAxis_P2_Speed);
}
else if (MoveInfo.IsStep(StoreMoveStep.SO_16_InoutToP2))
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_17_GetReel);
InOutStoreLog(outType + "升降轴到入料口高点P2 [" + moveP.UpDown_P2 + "],压紧轴到P2 [" + moveP.ComPress_P2 + "] ");
ComAxis.AbsMove(MoveInfo, moveP.ComPress_P2, Config.CompAxis_P2_Speed);
UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P2, Config.UpDownAxis_P2_Speed);
}
else if (MoveInfo.IsStep(StoreMoveStep.SO_17_GetReel))
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_05_InoutBack);
InOutStoreLog(outType + "进出轴返回P1 [" + moveP.InOut_P1 + "] ");
InOutBackToP1(moveP.InOut_P1);
}
#endregion
#region 单盘出料,到出料口 #region 单盘出料,到出料口
else if (MoveInfo.IsStep(StoreMoveStep.SO_21_ToOutDoor)) else if (MoveInfo.IsStep(StoreMoveStep.SO_21_ToOutDoor))
...@@ -578,6 +629,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -578,6 +629,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StoreMoveStep.SO_22_FixtureCheck); MoveInfo.NextMoveStep(StoreMoveStep.SO_22_FixtureCheck);
InOutStoreLog(outType + "等待料叉检测信号 "); InOutStoreLog(outType + "等待料叉检测信号 ");
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Fixture_Check, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Fixture_Check, IO_VALUE.HIGH));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.OutDoor_Check, IO_VALUE.LOW));
} }
else if (MoveInfo.IsStep(StoreMoveStep.SO_22_FixtureCheck)) else if (MoveInfo.IsStep(StoreMoveStep.SO_22_FixtureCheck))
{ {
...@@ -589,34 +641,55 @@ namespace OnlineStore.DeviceLibrary ...@@ -589,34 +641,55 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SO_24_InoutToP11); MoveInfo.NextMoveStep(StoreMoveStep.SO_24_InoutToP11);
InOutStoreLog(outType + "进出轴到_P11-出料口取放料点 [" + Config.InOutAxis_P11 + "] "); InOutStoreLog(outType + "进出轴到_P11-出料口取放料点 [" + Config.InOutAxis_P11 + "] ");
InoutAxis.AbsMove(MoveInfo, Config.InOutAxis_P11, Config.InOutAxis_P11_Speed); InoutAxis.AbsMove(null, Config.InOutAxis_P11, Config.InOutAxis_P11_Speed);
//关闭舱门 //关闭舱门
} }
else if (MoveInfo.IsStep(StoreMoveStep.SO_24_InoutToP11)) else if (MoveInfo.IsStep(StoreMoveStep.SO_24_InoutToP11))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SO_25_PurReel); bool IsInoutAxisBusy = AxisManager.instance.GetBusyStatus(InoutAxis.Config.DeviceName, InoutAxis.Config.GetAxisValue()).Equals(1);
InOutStoreLog(outType + "升降轴到_P11-出料口-低点[" + Config.UpDownAxis_P11 + "],压紧轴到压紧前点P3 [" + moveP.ComPress_P3 + "]"); if (!IsInoutAxisBusy && InoutAxis.IsInPosition(Config.InOutAxis_P11))
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_25_PurReel);
InOutStoreLog(outType + "升降轴到_P11-出料口-低点[" + Config.UpDownAxis_P11 + "],压紧轴到压紧前点P3 [" + moveP.ComPress_P3 + "]");
ComAxis.AbsMove(MoveInfo, moveP.ComPress_P3, Config.CompAxis_P3_Speed); ComAxis.AbsMove(MoveInfo, moveP.ComPress_P3, Config.CompAxis_P3_Speed);
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxis_P11, Config.UpDownAxis_P11_Speed); UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxis_P11, Config.UpDownAxis_P11_Speed);
}
else if (IsInoutAxisBusy && IOValue(IO_Type.OutDoor_SafeSignal).Equals(IO_VALUE.LOW))
{
InOutStoreLog(outType + "触发出口安全光栅,进出轴暂停运行");
InoutAxis.SuddenStop();
}
else if (!IsInoutAxisBusy) {
InOutStoreLog(outType + "进出轴恢复运行");
InoutAxis.AbsMove(null, Config.InOutAxis_P11, Config.InOutAxis_P11_Speed);
}
} }
else if (MoveInfo.IsStep(StoreMoveStep.SO_25_PurReel)) else if (MoveInfo.IsStep(StoreMoveStep.SO_25_PurReel))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SO_26_InoutToP1); MoveInfo.NextMoveStep(StoreMoveStep.SO_26_InoutToP1);
InOutStoreLog(outType + "进出轴返回待机点P1 [" + moveP.InOut_P1 + "] "); InOutStoreLog(outType + "进出轴返回待机点P1 [" + moveP.InOut_P1 + "] ");
InOutBackToP1(moveP.InOut_P1); InOutBackToP1(moveP.InOut_P1);
OutDoorReelType = 1;
CylinderMove(MoveInfo, IO_Type.OutDoor_Down, IO_Type.OutDoor_Up);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.OutDoor_Check, IO_VALUE.LOW));
} }
else if (MoveInfo.IsStep(StoreMoveStep.SO_26_InoutToP1)) else if (MoveInfo.IsStep(StoreMoveStep.SO_26_InoutToP1))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SO_27_GoBack); if (IOValue(IO_Type.OutDoor_SafeSignal).Equals(IO_VALUE.HIGH))
InOutStoreLog(outType + "升降轴到P1[" + moveP.UpDown_P1 + "],旋转轴到P1[" + moveP.Middle_P1 + "],压紧轴到P1[" + moveP.ComPress_P1 + "],关闭出料口门"); {
CylinderMove(MoveInfo, IO_Type.OutDoor_Up, IO_Type.OutDoor_Down); MoveInfo.NextMoveStep(StoreMoveStep.SO_27_GoBack);
ComAxis.AbsMove(MoveInfo, moveP.ComPress_P1, Config.CompAxis_P1_Speed); InOutStoreLog(outType + "升降轴到P1[" + moveP.UpDown_P1 + "],旋转轴到P1[" + moveP.Middle_P1 + "],压紧轴到P1[" + moveP.ComPress_P1 + "],关闭出料口门");
MiddleAxis.AbsMove(MoveInfo, moveP.Middle_P1, Config.MiddleAxis_P1_Speed); //CylinderMove(MoveInfo, IO_Type.OutDoor_Up, IO_Type.OutDoor_Down);
UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed); ComAxis.AbsMove(MoveInfo, moveP.ComPress_P1, Config.CompAxis_P1_Speed);
MiddleAxis.AbsMove(MoveInfo, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
}
} }
else if (MoveInfo.IsStep(StoreMoveStep.SO_27_GoBack)) else if (MoveInfo.IsStep(StoreMoveStep.SO_27_GoBack))
{ {
CylinderMove(MoveInfo, IO_Type.OutDoor_Up, IO_Type.OutDoor_Down);
OutDoorReelType = 0;
TimeSpan span = DateTime.Now - startInStoreTime; TimeSpan span = DateTime.Now - startInStoreTime;
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : ""; string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : "";
LogUtil.info(Name + " 【" + posId + "】 单盘出库结束,耗时【" + FormUtil.GetSpanStr(span) + "】!"); LogUtil.info(Name + " 【" + posId + "】 单盘出库结束,耗时【" + FormUtil.GetSpanStr(span) + "】!");
......
...@@ -198,6 +198,58 @@ namespace OnlineStore.DeviceLibrary ...@@ -198,6 +198,58 @@ namespace OnlineStore.DeviceLibrary
} }
} }
public bool ReviceInStoreCMD(string posId, int plateH, int plateW, string message)
{
string logName = "入库库位验证【 " + message + "】【" + posId + "】:";
try
{
if (runStatus.Equals(StoreRunStatus.Wait))
{
LogUtil.info(logName + " 设备未启动,验证失败");
return false;
}
//发送扫码内容到服务器进行入库操作
Operation operation = getLineBoxStatus();
operation.op = 1;
operation.data = new Dictionary<string, string>() { { "code", message }, { "boxId", this.ID.ToString() } };
operation.data.Add("inPos", posId);
string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
for (int i = 1; i <= 3; i++)
{
bool timeOut = false;
Operation resultOperation = HttpHelper.PostOperation(StoreManager.GetPostApi(server), operation);
if (timeOut)
{
LogUtil.info(logName + " 第" + i + "次发送超时 ");
continue;
}
if (resultOperation == null)
{
// CodeMsg = "二维码【" + message + "】没有收到服务器反馈";
LogUtil.info(logName + " 没有收到服务器反馈 ");
}
else if (!string.IsNullOrEmpty(resultOperation.msg))
{
//如果有提示消息,直接显示提示
LogUtil.info(logName + "服务器反馈 :" + resultOperation.msg);
}
else if (resultOperation.op.Equals(1))
{
LogUtil.info(logName + " 成功");
return true;
}
break;
}
}
catch (Exception ex)
{
LogUtil.info(logName + " 出错:" + ex.ToString());
}
return false;
}
private void ReviceOutStoreProcess(Operation resultOperation) private void ReviceOutStoreProcess(Operation resultOperation)
{ {
......
...@@ -77,7 +77,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -77,7 +77,8 @@ namespace OnlineStore.DeviceLibrary
foreach (BOX_Config config in configList.Values) foreach (BOX_Config config in configList.Values)
{ {
BoxBean equip = new BoxBean(config); BoxBean equip = new BoxBean(config);
bool boxDisable = ConfigAppSettings.GetIntValue("Store_CID_" + config.Id + "_disabled") == 1 ? true : false;
equip.Disabled = boxDisable;
AddDeviceName(ioList, config.IOIPList); AddDeviceName(ioList, config.IOIPList);
BoxMap.Add(config.Id, equip); BoxMap.Add(config.Id, equip);
BoxConfigMap.Add(config.Id, config); BoxConfigMap.Add(config.Id, config);
...@@ -103,6 +104,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -103,6 +104,7 @@ namespace OnlineStore.DeviceLibrary
CodeManager.LoadConfig(); CodeManager.LoadConfig();
CurrShelfNum = ConfigAppSettings.GetIntValue(Setting_Init.CurrShelfNum); CurrShelfNum = ConfigAppSettings.GetIntValue(Setting_Init.CurrShelfNum);
CurrShelfType = ConfigAppSettings.GetIntValue(Setting_Init.CurrShelfType); CurrShelfType = ConfigAppSettings.GetIntValue(Setting_Init.CurrShelfType);
UpdateShelfNum(CurrShelfNum, CurrShelfType);
HasT4Axis = Convert.ToBoolean(ConfigAppSettings.GetValue(Setting_Init.HasT4Axis)); HasT4Axis = Convert.ToBoolean(ConfigAppSettings.GetValue(Setting_Init.HasT4Axis));
Task.Factory.StartNew(delegate Task.Factory.StartNew(delegate
{ {
...@@ -194,7 +196,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -194,7 +196,7 @@ namespace OnlineStore.DeviceLibrary
} }
return false; return false;
} }
bool boxreset = true;
public override void Reset(bool isNeedClearAuto = true) public override void Reset(bool isNeedClearAuto = true)
{ {
mainTimer.Enabled = false; mainTimer.Enabled = false;
...@@ -208,7 +210,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -208,7 +210,7 @@ namespace OnlineStore.DeviceLibrary
} }
runStatus = StoreRunStatus.Reset; runStatus = StoreRunStatus.Reset;
StartResetMove(); StartResetMove();
boxreset = true;
foreach (BoxBean equip in BoxMap.Values) foreach (BoxBean equip in BoxMap.Values)
{ {
if (!equip.alarmType.Equals(AlarmType.None)) if (!equip.alarmType.Equals(AlarmType.None))
...@@ -223,6 +225,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -223,6 +225,21 @@ namespace OnlineStore.DeviceLibrary
} }
mainTimer.Enabled = true; mainTimer.Enabled = true;
} }
public void ResetLine()
{
mainTimer.Enabled = false;
boxreset = false;
//停止运动
MoveInfo.EndMove();
if (!OpenAllAxis(true))
{
LogInfo("复位时打开轴失败,需要再次复位,直接报警停止复位");
return;
}
runStatus = StoreRunStatus.Reset;
StartResetMove();
mainTimer.Enabled = true;
}
private void StartResetMove() private void StartResetMove()
{ {
mainTimer.Enabled = false; mainTimer.Enabled = false;
...@@ -313,10 +330,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -313,10 +330,19 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StoreMoveStep.LR_07_WaitBox)) else if (MoveInfo.IsStep(StoreMoveStep.LR_07_WaitBox))
{ {
bool isOk = true; bool isOk = true;
if (!boxreset)
{
LogUtil.info(Name + "线体重置完成");
MoveEndP();
return;
}
//判断是否所有的已经返回完成 //判断是否所有的已经返回完成
string msg = "等待BOX复位完成超时"; string msg = "等待BOX复位完成超时";
foreach (BoxBean box in this.BoxMap.Values) foreach (BoxBean box in this.BoxMap.Values)
{ {
if (box.Disabled)
continue;
if ((box.runStatus.Equals(StoreRunStatus.HomeMoving) || box.runStatus.Equals(StoreRunStatus.Reset))) if ((box.runStatus.Equals(StoreRunStatus.HomeMoving) || box.runStatus.Equals(StoreRunStatus.Reset)))
//if ((box.storeRunStatus.Equals(StoreRunStatus.HomeMoving) || box.storeRunStatus.Equals(StoreRunStatus.Reset)) && box.IsDebug.Equals(false)) //if ((box.storeRunStatus.Equals(StoreRunStatus.HomeMoving) || box.storeRunStatus.Equals(StoreRunStatus.Reset)) && box.IsDebug.Equals(false))
{ {
...@@ -465,6 +491,22 @@ namespace OnlineStore.DeviceLibrary ...@@ -465,6 +491,22 @@ namespace OnlineStore.DeviceLibrary
{ {
IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW); IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
} }
if (IOValue(IO_Type.Line_OutCheck).Equals(IO_VALUE.HIGH))
{
//IOMove(IO_Type.LineOut_Led, IO_VALUE.HIGH);
}
else
{
//IOMove(IO_Type.LineOut_Led, IO_VALUE.LOW);
}
if (IOValue(IO_Type.Line_InCheck).Equals(IO_VALUE.LOW))
{
//IOMove(IO_Type.LineIn_Led, IO_VALUE.HIGH);
}
else
{
//IOMove(IO_Type.LineIn_Led, IO_VALUE.LOW);
}
} }
catch (Exception ex) catch (Exception ex)
...@@ -618,6 +660,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -618,6 +660,7 @@ namespace OnlineStore.DeviceLibrary
if (runStatus.Equals(StoreRunStatus.Runing) || runStatus.Equals(StoreRunStatus.Busy)) if (runStatus.Equals(StoreRunStatus.Runing) || runStatus.Equals(StoreRunStatus.Busy))
{ {
ShelfOutProcess(); ShelfOutProcess();
IOMinoitor();
ShowTimeLog("ShelfOutProcess"); ShowTimeLog("ShelfOutProcess");
} }
} }
...@@ -667,7 +710,54 @@ namespace OnlineStore.DeviceLibrary ...@@ -667,7 +710,54 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(Name + " ShelfOutProcess 出错:" + ex.ToString()); LogUtil.error(Name + " ShelfOutProcess 出错:" + ex.ToString());
} }
} }
public void OneShelfOutProcess()
{
try
{
if (IOValue(IO_Type.Line_OutCheck).Equals(IO_VALUE.HIGH) &&
IOValue(IO_Type.Line_Run).Equals(IO_VALUE.LOW) &&
LowProcess.Equals(false))
{
if (StoreManager.checkWatch(lowWatch, 3000))
{
//左侧下层需要放个料架
Task.Run(() =>
{
LowProcess = true;
LogUtil.info(Name + "送出一个料架");
IOMove(IO_Type.Line_Run, IO_VALUE.HIGH, false, 30000);
IOMove(IO_Type.Line_Stop4_Out, IO_VALUE.HIGH, false, 1000);
if (WaitIo(IO_Type.Line_OutCheck, IO_VALUE.LOW, 30000, "送出一个料架"))
{
LineStop();
}
LowProcess = false;
});
}
}
else
{
lowWatch.Stop();
}
}
catch (Exception ex)
{
LogUtil.error(Name + " OneShelfOutProcess 出错:" + ex.ToString());
}
}
#endregion #endregion
void IOMinoitor() {
if (IOValue(IO_Type.Line_WaitCheck).Equals(IO_VALUE.LOW) && AgvClient.GetAction(Config.AgvInName) == ClientAction.None)
{
AgvClient.NeedEnter(Config.AgvInName);
}
if (IOValue(IO_Type.Line_OutCheck).Equals(IO_VALUE.HIGH) && AgvClient.GetAction(Config.AgvOutName) == ClientAction.None)
{
AgvClient.NeedLeave(Config.AgvOutName);
}
}
public int GetShelfNum() public int GetShelfNum()
{ {
......
...@@ -95,7 +95,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -95,7 +95,7 @@ namespace OnlineStore.DeviceLibrary
{ {
if (IOValue(IO_Type.Line_WorkCheck).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.Line_WorkCheck).Equals(IO_VALUE.HIGH))
{ {
if (CurrShelfNum >= 0 && (CurrShelfType.Equals(0) || CurrShelfType.Equals(2))) if (CurrShelfType.Equals(0) || CurrShelfType.Equals(2))
{ {
if (IsStart) if (IsStart)
{ {
...@@ -127,7 +127,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -127,7 +127,7 @@ namespace OnlineStore.DeviceLibrary
//判断是哪个工位有料架 //判断是哪个工位有料架
else if (IOValue(IO_Type.Line_WorkCheck).Equals(IO_VALUE.HIGH)) else if (IOValue(IO_Type.Line_WorkCheck).Equals(IO_VALUE.HIGH))
{ {
if (CurrShelfNum >= 0 && (CurrShelfType.Equals(0) || CurrShelfType.Equals(2))) if (CurrShelfType.Equals(0) || CurrShelfType.Equals(2))
{ {
runStatus = StoreRunStatus.Busy; runStatus = StoreRunStatus.Busy;
storeStatus = StoreStatus.OutStoreExecute; storeStatus = StoreStatus.OutStoreExecute;
...@@ -163,7 +163,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -163,7 +163,7 @@ namespace OnlineStore.DeviceLibrary
targetPosition = Config.BatchAxis_P1; targetPosition = Config.BatchAxis_P1;
} }
InOutStoreLog(" StartTrayOut 出库移栽:" + outParam.ToStr() +" 提升伺服下降" + height + "mm,目标:" + targetPosition); InOutStoreLog(" StartTrayOut 出库移栽:" + outParam.ToStr() +" 提升伺服下降" + height + "mm,目标:" + targetPosition);
T1_BatchAxis.AbsMove(MoveInfo, targetPosition, Config.BatchAxis_P2Speed); T1_BatchAxis.AbsMove(null, targetPosition, Config.BatchAxis_P2Speed);
return true; return true;
} }
else else
...@@ -242,7 +242,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -242,7 +242,7 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.NextMoveStep(StoreMoveStep.LO_12_ToBoxDoor); MoveInfo.NextMoveStep(StoreMoveStep.LO_12_ToBoxDoor);
if (LastPosParam.TargetBox.Equals(1)) if (MoveInfo.MoveParam.TargetBox.Equals(1))
{ {
InOutStoreLog("取料, BOX1 升降轴到料门口高点[" + Config.UpdownAxis_P4 + "],旋转轴到料仓门口 P2 [" + Config.MiddleAxis_P2 + "]"); InOutStoreLog("取料, BOX1 升降轴到料门口高点[" + Config.UpdownAxis_P4 + "],旋转轴到料仓门口 P2 [" + Config.MiddleAxis_P2 + "]");
T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P4, Config.UpdownAxis_P4Speed); T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P4, Config.UpdownAxis_P4Speed);
...@@ -262,7 +262,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -262,7 +262,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StoreMoveStep.LO_12_ToBoxDoor)) else if (MoveInfo.IsStep(StoreMoveStep.LO_12_ToBoxDoor))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.LO_13_UpdownDown); MoveInfo.NextMoveStep(StoreMoveStep.LO_13_UpdownDown);
if (LastPosParam.TargetBox.Equals(1)) if (MoveInfo.MoveParam.TargetBox.Equals(1))
{ {
InOutStoreLog("取料:BOX1 升降轴到料门口低点P3[" + Config.UpdownAxis_P3 + "]"); InOutStoreLog("取料:BOX1 升降轴到料门口低点P3[" + Config.UpdownAxis_P3 + "]");
T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P3, Config.UpdownAxis_P3Speed); T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P3, Config.UpdownAxis_P3Speed);
...@@ -282,7 +282,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -282,7 +282,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StoreMoveStep.LO_14_CylinderTighten)) else if (MoveInfo.IsStep(StoreMoveStep.LO_14_CylinderTighten))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.LO_15_UpdownUp); MoveInfo.NextMoveStep(StoreMoveStep.LO_15_UpdownUp);
if (LastPosParam.TargetBox.Equals(1)) if (MoveInfo.MoveParam.TargetBox.Equals(1))
{ {
InOutStoreLog("取料:BOX1 升降轴上升到料门口高点P4 [" + Config.UpdownAxis_P4 + "]"); InOutStoreLog("取料:BOX1 升降轴上升到料门口高点P4 [" + Config.UpdownAxis_P4 + "]");
T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P4, Config.UpdownAxis_P4Speed); T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P4, Config.UpdownAxis_P4Speed);
...@@ -295,6 +295,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -295,6 +295,11 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.IsStep(StoreMoveStep.LO_15_UpdownUp)) else if (MoveInfo.IsStep(StoreMoveStep.LO_15_UpdownUp))
{ {
if (BoxMap[MoveInfo.MoveParam.TargetBox].IOValue(IO_Type.InDoor_Check).Equals(IO_VALUE.LOW))
{
BoxMap[MoveInfo.MoveParam.TargetBox].MoveInfo.MoveParam.TargetPosition = 1;
BoxMap[MoveInfo.MoveParam.TargetBox].MoveInfo.NextMoveStep(StoreMoveStep.SO_14_InoutToP1);
}
MoveInfo.NextMoveStep(StoreMoveStep.LO_16_MiddleToP1); MoveInfo.NextMoveStep(StoreMoveStep.LO_16_MiddleToP1);
InOutStoreLog("取料:旋转轴到料串位置P1 ["+Config.MiddleAxis_P1+"]"); InOutStoreLog("取料:旋转轴到料串位置P1 ["+Config.MiddleAxis_P1+"]");
T2_MiddleAxis.AbsMove(MoveInfo, Config.MiddleAxis_P1, Config.MiddleAxis_P1Speed); T2_MiddleAxis.AbsMove(MoveInfo, Config.MiddleAxis_P1, Config.MiddleAxis_P1Speed);
...@@ -390,7 +395,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -390,7 +395,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StoreMoveStep.LO_33_TopCylinderDown); MoveInfo.NextMoveStep(StoreMoveStep.LO_33_TopCylinderDown);
InOutStoreLog("送出料架:顶升气缸下降"); InOutStoreLog("送出料架:顶升气缸下降");
CylinderMove(MoveInfo, IO_Type.TopCylinder_Up, IO_Type.TopCylinder_Up); CylinderMove(MoveInfo, IO_Type.TopCylinder_Up, IO_Type.TopCylinder_Down);
} }
else if (MoveInfo.IsStep(StoreMoveStep.LO_33_TopCylinderDown)) else if (MoveInfo.IsStep(StoreMoveStep.LO_33_TopCylinderDown))
{ {
...@@ -478,13 +483,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -478,13 +483,19 @@ namespace OnlineStore.DeviceLibrary
} }
return false; return false;
} }
public async Task AgvSendShelfIn() {
private void ShelfEnterProcess() bool result = await ShelfEnterProcess();
if (result) {
AgvClient.SetStatus(StoreManager.Config.AgvInName, "", Asa.ClientAction.FinishEnter);
}
}
private Task<bool> ShelfEnterProcess()
{ {
//入口有料架,需要转动链条 //入口有料架,需要转动链条
Task.Run(()=> return Task<bool>.Run(new Func<bool>(()=>
{ {
InShelfInProcess = true; InShelfInProcess = true;
bool result = false;
try try
{ {
InOutStoreLog("检测到入口(X03-Line_InCheck)有料"); InOutStoreLog("检测到入口(X03-Line_InCheck)有料");
...@@ -492,7 +503,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -492,7 +503,7 @@ namespace OnlineStore.DeviceLibrary
LineRun(null); LineRun(null);
//等待进料检测信号 //等待进料检测信号
//bool result = WaitIo(IO_Type.Line_InCheck, IO_VALUE.LOW, 10000); //bool result = WaitIo(IO_Type.Line_InCheck, IO_VALUE.LOW, 10000);
bool result = WaitIo(IO_Type.Line_WaitCheck, IO_VALUE.HIGH, 10000); result = WaitIo(IO_Type.Line_WaitCheck, IO_VALUE.HIGH, 10000);
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -503,7 +514,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -503,7 +514,8 @@ namespace OnlineStore.DeviceLibrary
InShelfInProcess = false; InShelfInProcess = false;
LineStop(null); LineStop(null);
} }
}); return result;
}));
} }
private void L_05_WaitTime(StoreMoveStep step) private void L_05_WaitTime(StoreMoveStep step)
...@@ -514,7 +526,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -514,7 +526,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.Line_Stop1_Wait, IO_VALUE.LOW); IOMove(IO_Type.Line_Stop1_Wait, IO_VALUE.LOW);
IOMove(IO_Type.Line_Stop2_Work, IO_VALUE.LOW); IOMove(IO_Type.Line_Stop2_Work, IO_VALUE.LOW);
LineRun(MoveInfo); LineRun(MoveInfo);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_WorkCheck, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_WorkCheck, IO_VALUE.HIGH));
} }
...@@ -527,7 +539,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -527,7 +539,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (IOValue(IO_Type.Line_WaitCheck).Equals(IO_VALUE.HIGH)) else if (IOValue(IO_Type.Line_WaitCheck).Equals(IO_VALUE.HIGH))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.LI_04_LineStart); MoveInfo.NextMoveStep(StoreMoveStep.LI_05_WaitTime);
InOutStoreLog("入料检测: 上料等待区有料架 ,阻挡1下降2000,阻挡2上升,流水线转动 ,等待料架到达上料区"); InOutStoreLog("入料检测: 上料等待区有料架 ,阻挡1下降2000,阻挡2上升,流水线转动 ,等待料架到达上料区");
IOMove(IO_Type.Line_Stop1_Wait, IO_VALUE.HIGH, false, 2000);//进料阻挡下降 IOMove(IO_Type.Line_Stop1_Wait, IO_VALUE.HIGH, false, 2000);//进料阻挡下降
...@@ -551,25 +563,28 @@ namespace OnlineStore.DeviceLibrary ...@@ -551,25 +563,28 @@ namespace OnlineStore.DeviceLibrary
public override bool StartInStoreMove(InOutParam param) public override bool StartInStoreMove(InOutParam param)
{ {
if (IOValue(IO_Type.RaiseStation_FrontCheck).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.RaiseStation_BackendCheck).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.RaiseStation_BackendCheck).Equals(IO_VALUE.HIGH)
|| IOValue(IO_Type.Line_WorkCheck).Equals(IO_VALUE.HIGH))
{ {
runStatus = StoreRunStatus.Busy; if (CurrShelfType.Equals(1))
storeStatus = StoreStatus.InStoreExecute;
MoveInfo.NewMove(MoveType.InStore, new InOutParam(MoveType.InStore));
MoveInfo.NextMoveStep(StoreMoveStep.LI_06_TopUp);
return true;
}
//判断是哪个工位有料架
if (IOValue(IO_Type.Line_WorkCheck).Equals(IO_VALUE.HIGH))
{
//InOutStoreLog($"CurrShelfNum:{CurrShelfNum},CurrShelfType={CurrShelfType}");
if (CurrShelfNum < 0 || CurrShelfType.Equals(1))
{ {
runStatus = StoreRunStatus.Busy; if (IOValue(IO_Type.Line_WorkCheck).Equals(IO_VALUE.HIGH))
storeStatus = StoreStatus.InStoreExecute; {
MoveInfo.NewMove(MoveType.InStore,new InOutParam(MoveType.InStore)); runStatus = StoreRunStatus.Busy;
L_05_WaitTime(StoreMoveStep.LI_05_WaitTime); storeStatus = StoreStatus.InStoreExecute;
return true; MoveInfo.NewMove(MoveType.InStore, new InOutParam(MoveType.InStore));
L_05_WaitTime(StoreMoveStep.LI_05_WaitTime);
return true;
//InOutStoreLog($"CurrShelfNum:{CurrShelfNum},CurrShelfType={CurrShelfType}");
}
else {
runStatus = StoreRunStatus.Busy;
storeStatus = StoreStatus.InStoreExecute;
MoveInfo.NewMove(MoveType.InStore, new InOutParam(MoveType.InStore));
MoveInfo.NextMoveStep(StoreMoveStep.LI_06_TopUp);
return true;
}
} }
else if (IOValue(IO_Type.Line_WaitCheck).Equals(IO_VALUE.HIGH)) else if (IOValue(IO_Type.Line_WaitCheck).Equals(IO_VALUE.HIGH))
{ {
...@@ -642,7 +657,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -642,7 +657,19 @@ namespace OnlineStore.DeviceLibrary
InOutStoreLog("入料检测:链条停止转动, 进出机构上升"); InOutStoreLog("入料检测:链条停止转动, 进出机构上升");
LineStop(MoveInfo); LineStop(MoveInfo);
InOutStation_RasieUp(); InOutStation_RasieUp();
CurrShelfNum = ConfigAppSettings.GetIntValue(Setting_Init.CurrShelfNum);
CurrShelfType = ConfigAppSettings.GetIntValue(Setting_Init.CurrShelfType);
if (GetShelfNum() == CurrShelfNum && CurrShelfType == 2)
{
UpdateShelfNum(GetShelfNum(), CurrShelfType);
MoveEndP();
}
else
{
CurrShelfType = 1;
UpdateShelfNum(GetShelfNum(), CurrShelfType);
}
UpdateShelfNum(GetShelfNum(), CurrShelfType);
} }
else if (MoveInfo.IsStep(StoreMoveStep.LI_06_TopUp)) else if (MoveInfo.IsStep(StoreMoveStep.LI_06_TopUp))
{ {
...@@ -661,7 +688,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -661,7 +688,9 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.NextMoveStep(StoreMoveStep.LI_08_AxisUpToP2); MoveInfo.NextMoveStep(StoreMoveStep.LI_08_AxisUpToP2);
InOutStoreLog("入料检测:上料轴开始慢速上升到P2 [" + Config.BatchAxis_P2 + "],等待检测到料盘"); InOutStoreLog("入料检测:上料轴开始慢速上升到P2 [" + Config.BatchAxis_P2 + "],等待检测到料盘");
T2_MiddleAxis.AbsMove(MoveInfo, Config.MiddleAxis_P1, Config.MiddleAxis_P1Speed);
BatchAxisToP2(true); BatchAxisToP2(true);
ShelfNoTray = false;
} }
else if (MoveInfo.IsStep(StoreMoveStep.LI_08_AxisUpToP2)) else if (MoveInfo.IsStep(StoreMoveStep.LI_08_AxisUpToP2))
{ {
...@@ -719,13 +748,29 @@ namespace OnlineStore.DeviceLibrary ...@@ -719,13 +748,29 @@ namespace OnlineStore.DeviceLibrary
LastWidth = GetWidth(); LastWidth = GetWidth();
LastHeight = GetHeight(); LastHeight = GetHeight();
InOutStoreLog($"取料:记录高度尺寸 LastWidth:{LastWidth}, LastHeight{LastHeight}"); InOutStoreLog($"取料:记录高度尺寸 LastWidth:{LastWidth}, LastHeight{LastHeight}");
}
else if (MoveInfo.IsStep(StoreMoveStep.LI_17_SaveSize))
{
LI_18_GetPosID();
InOutStoreLog("取料:进出轴回到待机点到P1 [" + Config.InOutAxis_P1 + "],计算高度,"); InOutStoreLog("取料:进出轴回到待机点到P1 [" + Config.InOutAxis_P1 + "],计算高度,");
if (HasT4Axis) if (HasT4Axis)
T4_InOut_Axis.AbsMove(MoveInfo, Config.InOutAxis_P1, Config.InOutAxis_P1Speed); T4_InOut_Axis.AbsMove(MoveInfo, Config.InOutAxis_P1, Config.InOutAxis_P1Speed);
}
else if (MoveInfo.IsStep(StoreMoveStep.LI_17_SaveSize))
{
bool hasbox = false;
foreach (int k in BoxMap.Keys)
{
if (BoxMap[k].runStatus >= StoreRunStatus.Runing && BoxMap[k].IOValue(IO_Type.InDoor_Check).Equals(IO_VALUE.LOW))
{
hasbox = true;
}
}
if (hasbox)
LI_18_GetPosID();
else if (MoveInfo.IsTimeOut(120))
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 等待料仓空闲 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, ID * 1000 + 30);
Alarm(AlarmType.IoSingleTimeOut);
}
} }
else if (MoveInfo.IsStep(StoreMoveStep.LI_18_GetPosID)) else if (MoveInfo.IsStep(StoreMoveStep.LI_18_GetPosID))
...@@ -736,6 +781,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -736,6 +781,8 @@ namespace OnlineStore.DeviceLibrary
{ {
int box = GetInstoreNgBox(); int box = GetInstoreNgBox();
LastPosParam.TargetBox = box; LastPosParam.TargetBox = box;
LastPosParam.TargetPosition = 1;
MoveInfo.MoveParam = LastPosParam;
} }
else else
{ {
...@@ -764,10 +811,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -764,10 +811,12 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StoreMoveStep.LI_21_WaitToBox)) else if (MoveInfo.IsStep(StoreMoveStep.LI_21_WaitToBox))
{ {
int storeId = LastPosParam.GetStoreId(); int storeId = LastPosParam.GetStoreId();
if (storeId == -1)
storeId = LastPosParam.TargetBox;
InOutStoreLog($"料盘移栽:storeId :{storeId}"); InOutStoreLog($"料盘移栽:storeId :{storeId}");
BoxBean box = BoxMap[storeId]; BoxBean box = BoxMap[storeId];
bool waitRightLeave = false; bool waitRightLeave = false;
if (HasT4Axis&&storeId == 1 && IOManager.IOValue(IO_Type.InDoor_Check, 2).Equals(IO_VALUE.HIGH)) { if (HasT4Axis&&storeId == 1 && IOManager.IOValue(IO_Type.InDoor_Check, storeId).Equals(IO_VALUE.HIGH)) {
waitRightLeave = true; waitRightLeave = true;
} }
if (IOManager.IOValue(IO_Type.InDoor_Check, storeId).Equals(IO_VALUE.LOW) && box.waitInStoreParam == null && !waitRightLeave) if (IOManager.IOValue(IO_Type.InDoor_Check, storeId).Equals(IO_VALUE.LOW) && box.waitInStoreParam == null && !waitRightLeave)
...@@ -806,6 +855,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -806,6 +855,14 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StoreMoveStep.LI_22_ToBoxDoor)) else if (MoveInfo.IsStep(StoreMoveStep.LI_22_ToBoxDoor))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.LI_23_UpdownDown); MoveInfo.NextMoveStep(StoreMoveStep.LI_23_UpdownDown);
int storeId = LastPosParam.GetStoreId();
BoxBean box;
if (storeId == -1)
storeId = LastPosParam.TargetBox;
box = BoxMap[storeId];
InOutStoreLog($"料盘移栽:storeId={storeId},targetpos={LastPosParam.TargetPosition}");
box.waitInStoreParam = LastPosParam.clone();
YuScanCode(); YuScanCode();
if (LastPosParam.TargetBox.Equals(1)) if (LastPosParam.TargetBox.Equals(1))
{ {
...@@ -935,28 +992,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -935,28 +992,14 @@ namespace OnlineStore.DeviceLibrary
private int GetInstoreNgBox() private int GetInstoreNgBox()
{ {
//空闲且门口无料盘 //空闲且门口无料盘
foreach(BoxBean box in BoxMap.Values)
{
if (box.MoveInfo.MoveType.Equals(MoveType.None) && IOManager.IOValue(IO_Type.InDoor_Check, box.ID).Equals(IO_VALUE.LOW))
{
return box.ID;
}
}
//忙碌且目标是出料口
foreach (BoxBean box in BoxMap.Values) foreach (BoxBean box in BoxMap.Values)
{ {
if (box.MoveInfo.MoveType.Equals(MoveType.None)) if (IOManager.IOValue(IO_Type.InDoor_Check, box.ID).Equals(IO_VALUE.LOW))
{
if (IOManager.IOValue(IO_Type.InDoor_Check, box.ID).Equals(IO_VALUE.LOW))
{
return box.ID;
}
}
else if (box.MoveInfo.MoveParam.TargetPosition.Equals(1))
{ {
return box.ID; return box.ID;
} }
} }
return 1; return 1;
} }
...@@ -990,16 +1033,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -990,16 +1033,16 @@ namespace OnlineStore.DeviceLibrary
} }
else if (!result.Msg.Equals("")) else if (!result.Msg.Equals(""))
{ {
LastPosParam = result.Param; result.Param.InStoreNg = true;
LastPosParam.PosID = "2#2"; LastPosParam = result.Param.clone();
LastPosParam.TargetBox = 2;
LastPosParam.InStoreNg = true;
LogUtil.error(Name + "【" + code + "】第[" + count + "]次 LI_18_GetPosID 入库NG:" + result.Msg); LogUtil.error(Name + "【" + code + "】第[" + count + "]次 LI_18_GetPosID 入库NG:" + result.Msg);
break; break;
} }
else else
{ {
LastPosParam = result.Param; LastPosParam = result.Param.clone();
break; break;
} }
count++; count++;
...@@ -1041,7 +1084,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1041,7 +1084,7 @@ namespace OnlineStore.DeviceLibrary
InOutStoreLog("料盘移栽 :开始扫码"); InOutStoreLog("料盘移栽 :开始扫码");
MoveInfo.OneWaitCanEndStep = true; MoveInfo.OneWaitCanEndStep = true;
MoveInfo.WaitList.Add(WaitResultInfo.WaitScanCode()); MoveInfo.WaitList.Add(WaitResultInfo.WaitScanCode());
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(7000)); //MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(7000));
try try
{ {
Task<List<string>> scanTask = Task.Factory.StartNew(delegate Task<List<string>> scanTask = Task.Factory.StartNew(delegate
...@@ -1078,8 +1121,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -1078,8 +1121,10 @@ namespace OnlineStore.DeviceLibrary
{ {
Task<List<string>> scanTask = Task.Factory.StartNew(delegate Task<List<string>> scanTask = Task.Factory.StartNew(delegate
{ {
Thread.Sleep(500); IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH);
Task.Delay(10).Wait();
YuCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name.Trim() + "预扫码"); YuCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name.Trim() + "预扫码");
IOMove(IO_Type.Camera_Led, IO_VALUE.LOW);
bool isCanUse = true; bool isCanUse = true;
//判断是否可用 //判断是否可用
foreach (string nC in YuCodeList) foreach (string nC in YuCodeList)
...@@ -1147,7 +1192,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1147,7 +1192,7 @@ namespace OnlineStore.DeviceLibrary
InOutStoreLog("料盘移栽 :未检测到料盘,提升伺服到P1点 ["+ Config.BatchAxis_P1 + "] "); InOutStoreLog("料盘移栽 :未检测到料盘,提升伺服到P1点 ["+ Config.BatchAxis_P1 + "] ");
UpdateShelfNum(CurrShelfNum, 0); UpdateShelfNum(CurrShelfNum, 0);
T1_BatchAxis.SuddenStop(); T1_BatchAxis.SuddenStop();
T1_BatchAxis.AbsMove(MoveInfo, Config.BatchAxis_P1, Config.BatchAxis_P2Speed); T1_BatchAxis.AbsMove(MoveInfo, Config.BatchAxis_P1, Config.BatchAxis_P1Speed);
} }
private void BatchAxisToP2(bool isFirstMove = true) private void BatchAxisToP2(bool isFirstMove = true)
......
...@@ -239,7 +239,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -239,7 +239,6 @@ namespace OnlineStore.DeviceLibrary
} }
else if (span.TotalMilliseconds > timeOutMs && NoAlarm()) else if (span.TotalMilliseconds > timeOutMs && NoAlarm())
{ {
WarnMsg = Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "] 等待(" + io.DisplayStr + "=" + wait.IoValue + ") 超时"; WarnMsg = Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "] 等待(" + io.DisplayStr + "=" + wait.IoValue + ") 超时";
Alarm(AlarmType.IoSingleTimeOut, io.ElectricalDefinition, WarnMsg, MoveInfo.MoveType); Alarm(AlarmType.IoSingleTimeOut, io.ElectricalDefinition, WarnMsg, MoveInfo.MoveType);
LogUtil.error(Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "] 等待(" + io.DisplayStr + "=" + wait.IoValue + ") 超时", logType + 14); LogUtil.error(Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "] 等待(" + io.DisplayStr + "=" + wait.IoValue + ") 超时", logType + 14);
...@@ -289,9 +288,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -289,9 +288,8 @@ namespace OnlineStore.DeviceLibrary
{ {
WarnMsg = Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "]等待" + NotOkMsg WarnMsg = Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "]等待" + NotOkMsg
+ "超时[" + Math.Round(span.TotalSeconds, 1) + "]秒"; + "超时[" + Math.Round(span.TotalSeconds, 1) + "]秒";
int second = 10;
second = (int)(MoveInfo.TimeOutSeconds / span.TotalSeconds) * 10; int second = (int)(MoveInfo.TimeOutSeconds / span.TotalSeconds) * 10;
if (second > 120) if (second > 120)
{ {
second = 120; second = 120;
......
...@@ -201,35 +201,43 @@ namespace OnlineStore.DeviceLibrary ...@@ -201,35 +201,43 @@ namespace OnlineStore.DeviceLibrary
p.UpDown_P2 = box.Config.UpDownAxis_P2; p.UpDown_P2 = box.Config.UpDownAxis_P2;
// p.UpDown_P7 = box.Config.UpDownAxis_DoorOBPosition_P7; // p.UpDown_P7 = box.Config.UpDownAxis_DoorOBPosition_P7;
ACBoxPosition position = CSVPositionReader<ACBoxPosition>.GetPositon(param.PosID); if (param.TargetPosition == 1)
if (position == null)
{ {
if (movetype.Equals(MoveType.InStore) && param.TargetPosition.Equals(1)) p.ComPress_P2 = box.Config.GetComP2(param.PlateH);
{ p.ComPress_P3 = box.Config.CompAxis_P1;
return true;
}
LogUtil.error(box.Name + "GetPositon[" + param.PosID + "]=null,没有库位不能执行出入库");
return false;
}
if (param.PlateH<=0)
{
param.PlateH = position.BagHigh;
} }
if (param.PlateW<=0) else
{ {
param.PlateW = position.BagWidth; ACBoxPosition position = CSVPositionReader<ACBoxPosition>.GetPositon(param.PosID);
if (position == null)
{
if (movetype.Equals(MoveType.InStore) && param.TargetPosition.Equals(1))
{
return true;
}
LogUtil.error(box.Name + "GetPositon[" + param.PosID + "]=null,没有库位不能执行出入库");
return false;
}
if (param.PlateH <= 0)
{
param.PlateH = position.BagHigh;
}
if (param.PlateW <= 0)
{
param.PlateW = position.BagWidth;
}
//p.ComPress_P2 = box.Config.GetComP2(position.BagHigh);
//p.ComPress_P3 = box.Config.CompAxis_P3;
p.ComPress_P2 = position.ComAxis_P2;
p.ComPress_P3 = position.ComAxis_P3;
p.InOut_P3 = position.InoutAxis_P3;
p.Middle_P2 = position.MiddleAxis_P2;
p.UpDown_P3 = position.UpdownAxis_IH_P3;
p.UpDown_P4 = position.UpdownAxis_IL_P4;
p.UpDown_P5 = position.UpdownAxis_OH_P5;
p.UpDown_P6 = position.UpdownAxis_OL_P6;
} }
//p.ComPress_P2 = box.Config.GetComP2(position.BagHigh);
//p.ComPress_P3 = box.Config.CompAxis_P3;
p.ComPress_P2 = position.ComAxis_P2;
p.ComPress_P3 = position.ComAxis_P3;
p.InOut_P3 = position.InoutAxis_P3;
p.Middle_P2 = position.MiddleAxis_P2;
p.UpDown_P3 = position.UpdownAxis_IH_P3;
p.UpDown_P4 = position.UpdownAxis_IL_P4;
p.UpDown_P5 = position.UpdownAxis_OH_P5;
p.UpDown_P6 = position.UpdownAxis_OL_P6;
param.MoveP = p; param.MoveP = p;
...@@ -357,7 +365,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -357,7 +365,17 @@ namespace OnlineStore.DeviceLibrary
// 参数:cids: 多个 cid // 参数:cids: 多个 cid
//code: 条码内容 //code: 条码内容
Dictionary<string, string> paramMap = new Dictionary<string, string>(); Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("cids", Config.All_CIDs); string cids = "";
foreach(int k in Store.BoxMap.Keys)
{
if (Store.BoxMap[k].runStatus > StoreRunStatus.Wait && Store.BoxMap[k].IOValue(IO_Type.InDoor_Check).Equals(IO_VALUE.LOW))
{
cids += Store.BoxMap[k].CID+",";
}
}
cids = cids.TrimEnd(',');
paramMap.Add("cids", cids);
paramMap.Add("code", codeStr); paramMap.Add("code", codeStr);
paramMap.Add(ParamDefine.rfid, shelfNum.ToString()); paramMap.Add(ParamDefine.rfid, shelfNum.ToString());
...@@ -402,22 +420,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -402,22 +420,10 @@ namespace OnlineStore.DeviceLibrary
if (Store.BoxMap.ContainsKey(storeId)) if (Store.BoxMap.ContainsKey(storeId))
{ {
BoxBean box = Store.BoxMap[storeId]; BoxBean box = Store.BoxMap[storeId];
if (box.IsReviceInPosId( posId))
{
result.Param.InStoreNg = true;
result.Param.NgMsg = "入库库位重复";
result.Msg = deviceName + ("收到入库命令:" + "入库库位重复: " + result.Param.ToStr() + " ,入库失败!");
return result;
}
LogUtil.info(deviceName + "收到入库命令: " + result.Param.ToStr() + " "); LogUtil.info(deviceName + "收到入库命令: " + result.Param.ToStr() + " ");
if (!box.StartInStoreMove(result.Param)) result.Param.InStoreNg = false;
{ result.Msg = "";
if (box.waitInStoreParam == null) return result;
{
result.Msg = deviceName + ("收到入库命令:" + "启动入库失败,缓存到waitInStoreList等待稍后入库: " + result.Param.ToStr() + " ");
box.waitInStoreParam = result.Param;
}
}
} }
else else
{ {
......
...@@ -55,7 +55,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -55,7 +55,7 @@ namespace OnlineStore.DeviceLibrary
} }
if (storeMoveType.Equals(MoveType.InStore)) if (storeMoveType.Equals(MoveType.InStore))
{ {
int newIndex = positionIndex; int newIndex = positionIndex - Jiange;
if (newIndex < 0) if (newIndex < 0)
{ {
if (startIndex >= 0 && startIndex < boxBean.PositionNumList.Count) if (startIndex >= 0 && startIndex < boxBean.PositionNumList.Count)
...@@ -92,7 +92,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -92,7 +92,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (storeMoveType.Equals(MoveType.OutStore)) else if (storeMoveType.Equals(MoveType.OutStore))
{ {
int newIndex = positionIndex - Jiange; int newIndex = positionIndex;
if (newIndex < 0) if (newIndex < 0)
{ {
if (startIndex >= 0 && startIndex < boxBean.PositionNumList.Count) if (startIndex >= 0 && startIndex < boxBean.PositionNumList.Count)
......
...@@ -149,7 +149,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -149,7 +149,10 @@ namespace OnlineStore.DeviceLibrary
} }
} }
} }
public InOutParam clone()
{
return (InOutParam)this.MemberwiseClone();
}
} }
} }
...@@ -494,19 +494,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -494,19 +494,6 @@ namespace OnlineStore.DeviceLibrary
} }
} }
Thread.Sleep(500); Thread.Sleep(500);
//打开所有轴
//if (isCheck)
//{
// foreach (AxisBean axis in axisArray)
// {
// if (!axis.OpenAxis(out msg))
// {
// SetWarnMsg(Name + msg);
// Alarm(AlarmType.AxisAlarm);
// return false;
// }
// }
//}
return true; return true;
} }
......
...@@ -285,7 +285,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -285,7 +285,10 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
SO_12_WaitTrayGo, SO_12_WaitTrayGo,
SO_14_InoutToP1,
SO_15_AxisBack,
SO_16_InoutToP2,
SO_17_GetReel,
/// <summary> /// <summary>
/// 单盘出库:移动到出料口,旋转轴到P11,升降轴到P12高点 /// 单盘出库:移动到出料口,旋转轴到P11,升降轴到P12高点
/// </summary> /// </summary>
......
...@@ -87,7 +87,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -87,7 +87,7 @@ namespace OnlineStore.DeviceLibrary
{ {
param = new InOutParam(type); param = new InOutParam(type);
} }
this.MoveParam = param; this.MoveParam = param.clone(); ;
LastSetpTime = DateTime.Now; LastSetpTime = DateTime.Now;
WaitList = new List<WaitResultInfo>(); WaitList = new List<WaitResultInfo>();
} }
......
...@@ -68,11 +68,11 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -68,11 +68,11 @@ namespace OnlineStore.LoadCSVLibrary
///// </summary> ///// </summary>
//[ConfigProAttribute("CompAxis_P3")] //[ConfigProAttribute("CompAxis_P3")]
//public int CompAxis_P3 { get; set; } //public int CompAxis_P3 { get; set; }
///// <summary> /// <summary>
///// PRO,,L4_压紧轴_P2压紧点范围对应值,CompAxis_P2_List,8=385001;12=383001;16=379001; /// PRO,,L4_压紧轴_P2压紧点范围对应值,CompAxis_P2_List,8=385001;12=383001;16=379001;
///// </summary> /// </summary>
//[ConfigProAttribute("CompAxis_P2_List")] [ConfigProAttribute("CompAxis_P2_List")]
//public string CompAxis_P2_List { get; set; } public string CompAxis_P2_List { get; set; }
/// <summary> /// <summary>
/// PRO,,L2_上下轴_P11-出料口-低点,UpDownAxis_P11,1000000 /// PRO,,L2_上下轴_P11-出料口-低点,UpDownAxis_P11,1000000
/// </summary> /// </summary>
...@@ -211,70 +211,69 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -211,70 +211,69 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("IsInDebug")] [ConfigProAttribute("IsInDebug")]
public int IsInDebug { get; set; } public int IsInDebug { get; set; }
//private Dictionary< int,int > ComP2Map =null ; private Dictionary<int, int> ComP2Map = null;
//public int GetComP2(int plateh) public int GetComP2(int plateh)
//{ {
// //查找指定的高度 //查找指定的高度
// analysisComP2(); analysisComP2();
// if (ComP2Map.ContainsKey(plateh)) if (ComP2Map.ContainsKey(plateh))
// { {
// return ComP2Map[plateh]; return ComP2Map[plateh];
// } }
// return new List<int>(ComP2Map.Values).First<int>(); return new List<int>(ComP2Map.Values).First<int>();
//} }
public void UpdateComP2(int height, int p2)
{
analysisComP2();
if (ComP2Map.ContainsKey(height))
{
ComP2Map[height] = p2;
}
else
{
ComP2Map.Add(height, p2);
}
string tt = "";
foreach (int p in ComP2Map.Keys)
{
tt += p + "=" + ComP2Map[p] + ";";
}
CompAxis_P2_List = tt;
}
private void analysisComP2()
{
if (ComP2Map == null)
{
try
{
// 8=385001;424000#12=383001;385000#16=379001;
ComP2Map = new Dictionary<int, int>();
string[] arrayList = CompAxis_P2_List.Split(';');
foreach (string str in arrayList)
{
if (str.Equals(""))
{
continue;
}
string[] com2A = str.Split('=');
if (com2A.Length.Equals(2))
{
int plateH = Convert.ToInt32(com2A[0]);
int p2 = Convert.ToInt32(com2A[1]);
ComP2Map.Add(plateH, p2);
}
}
}
catch (Exception ex)
{
LogUtil.error("解析CompAxis_P2_List【" + CompAxis_P2_List + "】出错:" + ex.ToString());
}
}
}
//public void UpdateComP2(int height, int p2)
//{
// analysisComP2();
// if (ComP2Map.ContainsKey(height))
// {
// ComP2Map[height] = p2;
// }
// else
// {
// ComP2Map.Add(height, p2);
// }
// string tt = "";
// foreach (int p in ComP2Map.Keys)
// {
// tt += p + "=" + ComP2Map[p] + ";";
// }
// CompAxis_P2_List = tt;
//}
//private void analysisComP2()
//{
// if (ComP2Map == null)
// {
// try
// {
// // 8=385001;424000#12=383001;385000#16=379001;
// ComP2Map = new Dictionary<int, int>();
// string[] arrayList = CompAxis_P2_List.Split(';');
// foreach (string str in arrayList)
// {
// if (str.Equals(""))
// {
// continue;
// }
// string[] com2A = str.Split('=');
// if (com2A.Length.Equals(2))
// {
// int plateH = Convert.ToInt32(com2A[0]);
// int p2 = Convert.ToInt32(com2A[1]);
// ComP2Map.Add(plateH, p2);
// }
// }
// }
// catch (Exception ex)
// {
// LogUtil.error("解析CompAxis_P2_List【" + CompAxis_P2_List + "】出错:" + ex.ToString());
// }
// }
//}
} }
......
...@@ -299,10 +299,10 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -299,10 +299,10 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("Clamp1Port")] [ConfigProAttribute("Clamp1Port")]
public string Clamp1Port { get; set; } public string Clamp1Port { get; set; }
private List<string> CameraList = new List<string>(); private List<string> CameraList = null;
public List<string> GetCameraList() public List<string> GetCameraList()
{ {
if (CameraList.Count==0) if (CameraList==null)
{ {
CameraList = new List<string>(); CameraList = new List<string>();
string[] arrayList = CameraNameList.Split('#'); string[] arrayList = CameraNameList.Split('#');
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!