Commit 11e2c782 LN

增加料架位置的配置

1 个父辈 9717704f
......@@ -28,11 +28,15 @@
<add key="ACBaudRate" value="115200" />
<add key="InOutDefaultPosition" value="8000"/>
<add key="Config_Pwd" value="123456"/>
<!--二维码类型列表配置,用#分割,一维码=Barcode 二维码: QR Code#Data Matrix ECC 200#Micro QR Code-->
<add key="CodeType" value="QR Code" />
<!--出库等待料盘拿走的时间,秒-->
<add key="OutStoreWaitSeconds" value="10"/>
<!--温控器类型,0=壁挂王字壳温湿度变送器,1=妙昕温湿度记录仪-->
<add key="HumitureControllerType" value="0"/>
<add key="UseAIOBOX" value="1"/>
<add key ="DIMS" value ="120"/>
<add key ="DOMS" value ="300"/>
<!--流水线地址和端口配置-->
<add key ="LineServerIp" value ="192.168.101.11"/>
<add key ="LineServerPort" value ="5246"/>
......
......@@ -40,7 +40,7 @@
this.button2 = new System.Windows.Forms.Button();
this.label10 = new System.Windows.Forms.Label();
this.txtBusyStatus = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.btnMPA = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.txtAlarmStatus = new System.Windows.Forms.TextBox();
this.btnGetAlarm = new System.Windows.Forms.Button();
......@@ -58,7 +58,6 @@
this.btnAxisRMove = new System.Windows.Forms.Button();
this.btnAxisReturnHome = new System.Windows.Forms.Button();
this.btnAxisAMove = new System.Windows.Forms.Button();
this.Bt_ClearCounter = new System.Windows.Forms.Button();
this.btnComAlarmClear = new System.Windows.Forms.Button();
this.txtAPosition = new System.Windows.Forms.TextBox();
this.label48 = new System.Windows.Forms.Label();
......@@ -172,6 +171,18 @@
this.panel1 = new System.Windows.Forms.Panel();
this.lblCid = new System.Windows.Forms.Label();
this.btnScanTest = new System.Windows.Forms.Button();
this.cmbShelfPosition = new System.Windows.Forms.ComboBox();
this.groupShelf = new System.Windows.Forms.GroupBox();
this.label13 = new System.Windows.Forms.Label();
this.txtInoutPA = new System.Windows.Forms.TextBox();
this.btnInoutPA = new System.Windows.Forms.Button();
this.txtMPA = new System.Windows.Forms.TextBox();
this.button5 = new System.Windows.Forms.Button();
this.txtUpdownPA1 = new System.Windows.Forms.TextBox();
this.txtUpdownPA2 = new System.Windows.Forms.TextBox();
this.btnUpdownPA1 = new System.Windows.Forms.Button();
this.btnUpdownPA2 = new System.Windows.Forms.Button();
this.btnSaveShelf = new System.Windows.Forms.Button();
this.groupAxis.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupInout.SuspendLayout();
......@@ -182,6 +193,7 @@
this.groupHistory.SuspendLayout();
this.groupBox7.SuspendLayout();
this.panel1.SuspendLayout();
this.groupShelf.SuspendLayout();
this.SuspendLayout();
//
// timer1
......@@ -216,7 +228,7 @@
this.groupAxis.Controls.Add(this.button2);
this.groupAxis.Controls.Add(this.label10);
this.groupAxis.Controls.Add(this.txtBusyStatus);
this.groupAxis.Controls.Add(this.button1);
this.groupAxis.Controls.Add(this.btnMPA);
this.groupAxis.Controls.Add(this.label2);
this.groupAxis.Controls.Add(this.txtAlarmStatus);
this.groupAxis.Controls.Add(this.btnGetAlarm);
......@@ -234,7 +246,6 @@
this.groupAxis.Controls.Add(this.btnAxisRMove);
this.groupAxis.Controls.Add(this.btnAxisReturnHome);
this.groupAxis.Controls.Add(this.btnAxisAMove);
this.groupAxis.Controls.Add(this.Bt_ClearCounter);
this.groupAxis.Controls.Add(this.btnComAlarmClear);
this.groupAxis.Controls.Add(this.txtAPosition);
this.groupAxis.Controls.Add(this.label48);
......@@ -249,7 +260,7 @@
this.groupAxis.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupAxis.Location = new System.Drawing.Point(6, 6);
this.groupAxis.Name = "groupAxis";
this.groupAxis.Size = new System.Drawing.Size(789, 351);
this.groupAxis.Size = new System.Drawing.Size(529, 351);
this.groupAxis.TabIndex = 216;
this.groupAxis.TabStop = false;
this.groupAxis.Text = "伺服运动";
......@@ -293,7 +304,7 @@
// chbAutoRead
//
this.chbAutoRead.AutoSize = true;
this.chbAutoRead.Location = new System.Drawing.Point(418, 205);
this.chbAutoRead.Location = new System.Drawing.Point(395, 205);
this.chbAutoRead.Name = "chbAutoRead";
this.chbAutoRead.Size = new System.Drawing.Size(99, 21);
this.chbAutoRead.TabIndex = 296;
......@@ -371,15 +382,15 @@
this.txtBusyStatus.Size = new System.Drawing.Size(25, 23);
this.txtBusyStatus.TabIndex = 288;
//
// button1
// btnMPA
//
this.button1.Location = new System.Drawing.Point(278, 228);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(105, 33);
this.button1.TabIndex = 287;
this.button1.Text = "读BUSY状态";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click_1);
this.btnMPA.Location = new System.Drawing.Point(278, 228);
this.btnMPA.Name = "btnMPA";
this.btnMPA.Size = new System.Drawing.Size(105, 33);
this.btnMPA.TabIndex = 287;
this.btnMPA.Text = "读BUSY状态";
this.btnMPA.UseVisualStyleBackColor = true;
this.btnMPA.Click += new System.EventHandler(this.button1_Click_1);
//
// label2
//
......@@ -414,7 +425,7 @@
this.btnReadPosition.Cursor = System.Windows.Forms.Cursors.Default;
this.btnReadPosition.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnReadPosition.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnReadPosition.Location = new System.Drawing.Point(418, 298);
this.btnReadPosition.Location = new System.Drawing.Point(321, 146);
this.btnReadPosition.Name = "btnReadPosition";
this.btnReadPosition.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnReadPosition.Size = new System.Drawing.Size(90, 33);
......@@ -587,24 +598,9 @@
this.btnAxisAMove.UseVisualStyleBackColor = true;
this.btnAxisAMove.Click += new System.EventHandler(this.btnAxisAMove_Click);
//
// Bt_ClearCounter
//
this.Bt_ClearCounter.BackColor = System.Drawing.SystemColors.Control;
this.Bt_ClearCounter.Cursor = System.Windows.Forms.Cursors.Default;
this.Bt_ClearCounter.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Bt_ClearCounter.ForeColor = System.Drawing.SystemColors.ControlText;
this.Bt_ClearCounter.Location = new System.Drawing.Point(319, 146);
this.Bt_ClearCounter.Name = "Bt_ClearCounter";
this.Bt_ClearCounter.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.Bt_ClearCounter.Size = new System.Drawing.Size(90, 33);
this.Bt_ClearCounter.TabIndex = 170;
this.Bt_ClearCounter.Text = "重置位置";
this.Bt_ClearCounter.UseVisualStyleBackColor = true;
this.Bt_ClearCounter.Click += new System.EventHandler(this.Bt_ClearCounter_Click);
//
// btnComAlarmClear
//
this.btnComAlarmClear.Location = new System.Drawing.Point(203, 148);
this.btnComAlarmClear.Location = new System.Drawing.Point(400, 295);
this.btnComAlarmClear.Name = "btnComAlarmClear";
this.btnComAlarmClear.Size = new System.Drawing.Size(105, 33);
this.btnComAlarmClear.TabIndex = 50;
......@@ -754,7 +750,7 @@
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox1.Location = new System.Drawing.Point(6, 368);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(789, 182);
this.groupBox1.Size = new System.Drawing.Size(529, 182);
this.groupBox1.TabIndex = 217;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "伺服状态";
......@@ -978,7 +974,7 @@
this.groupInout.Enabled = false;
this.groupInout.Location = new System.Drawing.Point(7, 224);
this.groupInout.Name = "groupInout";
this.groupInout.Size = new System.Drawing.Size(496, 545);
this.groupInout.Size = new System.Drawing.Size(503, 545);
this.groupInout.TabIndex = 100;
this.groupInout.TabStop = false;
this.groupInout.Text = "料仓操作";
......@@ -1058,7 +1054,7 @@
this.txtComP1.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtComP1.Size = new System.Drawing.Size(89, 23);
this.txtComP1.TabIndex = 214;
this.txtComP1.Text = "-12388";
this.txtComP1.Text = "999";
//
// txtInOutP2
//
......@@ -1073,7 +1069,7 @@
this.txtInOutP2.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtInOutP2.Size = new System.Drawing.Size(89, 23);
this.txtInOutP2.TabIndex = 212;
this.txtInOutP2.Text = "-17000";
this.txtInOutP2.Text = "999";
//
// txtInOutP1
//
......@@ -1088,7 +1084,7 @@
this.txtInOutP1.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtInOutP1.Size = new System.Drawing.Size(89, 23);
this.txtInOutP1.TabIndex = 210;
this.txtInOutP1.Text = "3000";
this.txtInOutP1.Text = "999";
//
// txtMiddleP1
//
......@@ -1103,7 +1099,7 @@
this.txtMiddleP1.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtMiddleP1.Size = new System.Drawing.Size(89, 23);
this.txtMiddleP1.TabIndex = 208;
this.txtMiddleP1.Text = "-52388";
this.txtMiddleP1.Text = "999";
//
// txtUpDownP7
//
......@@ -1118,7 +1114,7 @@
this.txtUpDownP7.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtUpDownP7.Size = new System.Drawing.Size(89, 23);
this.txtUpDownP7.TabIndex = 204;
this.txtUpDownP7.Text = "-836025";
this.txtUpDownP7.Text = "999";
//
// txtUpDownP8
//
......@@ -1133,7 +1129,7 @@
this.txtUpDownP8.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtUpDownP8.Size = new System.Drawing.Size(89, 23);
this.txtUpDownP8.TabIndex = 206;
this.txtUpDownP8.Text = "-816491";
this.txtUpDownP8.Text = "999";
//
// txtUpDownP1
//
......@@ -1148,7 +1144,7 @@
this.txtUpDownP1.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtUpDownP1.Size = new System.Drawing.Size(89, 23);
this.txtUpDownP1.TabIndex = 200;
this.txtUpDownP1.Text = "-816491";
this.txtUpDownP1.Text = "999";
//
// txtUpDownP2
//
......@@ -1163,7 +1159,7 @@
this.txtUpDownP2.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtUpDownP2.Size = new System.Drawing.Size(89, 23);
this.txtUpDownP2.TabIndex = 202;
this.txtUpDownP2.Text = "-836025";
this.txtUpDownP2.Text = "999";
//
// txtComP3
//
......@@ -1178,7 +1174,7 @@
this.txtComP3.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtComP3.Size = new System.Drawing.Size(89, 23);
this.txtComP3.TabIndex = 198;
this.txtComP3.Text = "-12388";
this.txtComP3.Text = "999";
//
// txtComP2
//
......@@ -1193,7 +1189,7 @@
this.txtComP2.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtComP2.Size = new System.Drawing.Size(89, 23);
this.txtComP2.TabIndex = 196;
this.txtComP2.Text = "-12388";
this.txtComP2.Text = "999";
//
// txtInOutP3
//
......@@ -1208,7 +1204,7 @@
this.txtInOutP3.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtInOutP3.Size = new System.Drawing.Size(89, 23);
this.txtInOutP3.TabIndex = 194;
this.txtInOutP3.Text = "-12388";
this.txtInOutP3.Text = "999";
//
// txtMiddleP2
//
......@@ -1223,7 +1219,7 @@
this.txtMiddleP2.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtMiddleP2.Size = new System.Drawing.Size(89, 23);
this.txtMiddleP2.TabIndex = 192;
this.txtMiddleP2.Text = "-12388";
this.txtMiddleP2.Text = "999";
//
// txtUpDownP5
//
......@@ -1238,7 +1234,7 @@
this.txtUpDownP5.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtUpDownP5.Size = new System.Drawing.Size(89, 23);
this.txtUpDownP5.TabIndex = 188;
this.txtUpDownP5.Text = "-16388";
this.txtUpDownP5.Text = "999";
//
// txtUpDownP6
//
......@@ -1253,7 +1249,7 @@
this.txtUpDownP6.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtUpDownP6.Size = new System.Drawing.Size(89, 23);
this.txtUpDownP6.TabIndex = 190;
this.txtUpDownP6.Text = "-12388";
this.txtUpDownP6.Text = "999";
//
// cmbPosition
//
......@@ -1293,7 +1289,7 @@
this.txtUpDownP3.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtUpDownP3.Size = new System.Drawing.Size(89, 23);
this.txtUpDownP3.TabIndex = 162;
this.txtUpDownP3.Text = "-16388";
this.txtUpDownP3.Text = "999";
//
// btnInStore
//
......@@ -1330,7 +1326,7 @@
this.txtUpDownP4.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtUpDownP4.Size = new System.Drawing.Size(89, 23);
this.txtUpDownP4.TabIndex = 166;
this.txtUpDownP4.Text = "-12388";
this.txtUpDownP4.Text = "999";
//
// btnComP1
//
......@@ -1630,7 +1626,7 @@
this.groupBox3.Controls.Add(this.lblThisSta);
this.groupBox3.Location = new System.Drawing.Point(7, 96);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(496, 124);
this.groupBox3.Size = new System.Drawing.Size(762, 124);
this.groupBox3.TabIndex = 268;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "设备状态";
......@@ -1666,10 +1662,10 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Location = new System.Drawing.Point(509, 95);
this.tabControl1.Location = new System.Drawing.Point(775, 94);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(814, 675);
this.tabControl1.Size = new System.Drawing.Size(554, 675);
this.tabControl1.TabIndex = 272;
//
// tabPage1
......@@ -1679,7 +1675,7 @@
this.tabPage1.Location = new System.Drawing.Point(4, 29);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(806, 642);
this.tabPage1.Size = new System.Drawing.Size(546, 642);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = " 伺服调试 ";
this.tabPage1.UseVisualStyleBackColor = true;
......@@ -1691,7 +1687,7 @@
this.tabPage2.Location = new System.Drawing.Point(4, 29);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(806, 642);
this.tabPage2.Size = new System.Drawing.Size(546, 642);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = " 温湿度 ";
this.tabPage2.UseVisualStyleBackColor = true;
......@@ -2079,11 +2075,194 @@
this.btnScanTest.UseVisualStyleBackColor = true;
this.btnScanTest.Click += new System.EventHandler(this.btnScanTest_Click);
//
// cmbShelfPosition
//
this.cmbShelfPosition.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbShelfPosition.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.cmbShelfPosition.FormattingEnabled = true;
this.cmbShelfPosition.Location = new System.Drawing.Point(19, 77);
this.cmbShelfPosition.Name = "cmbShelfPosition";
this.cmbShelfPosition.Size = new System.Drawing.Size(189, 28);
this.cmbShelfPosition.TabIndex = 272;
this.cmbShelfPosition.SelectedIndexChanged += new System.EventHandler(this.cmbShelfPosition_SelectedIndexChanged);
//
// groupShelf
//
this.groupShelf.Controls.Add(this.btnSaveShelf);
this.groupShelf.Controls.Add(this.label13);
this.groupShelf.Controls.Add(this.txtInoutPA);
this.groupShelf.Controls.Add(this.btnInoutPA);
this.groupShelf.Controls.Add(this.txtMPA);
this.groupShelf.Controls.Add(this.button5);
this.groupShelf.Controls.Add(this.txtUpdownPA1);
this.groupShelf.Controls.Add(this.txtUpdownPA2);
this.groupShelf.Controls.Add(this.btnUpdownPA1);
this.groupShelf.Controls.Add(this.btnUpdownPA2);
this.groupShelf.Controls.Add(this.cmbShelfPosition);
this.groupShelf.Enabled = false;
this.groupShelf.Location = new System.Drawing.Point(517, 224);
this.groupShelf.Name = "groupShelf";
this.groupShelf.Size = new System.Drawing.Size(252, 545);
this.groupShelf.TabIndex = 274;
this.groupShelf.TabStop = false;
this.groupShelf.Text = "料架位置";
//
// label13
//
this.label13.AutoSize = true;
this.label13.Cursor = System.Windows.Forms.Cursors.Default;
this.label13.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label13.ForeColor = System.Drawing.SystemColors.ControlText;
this.label13.Location = new System.Drawing.Point(16, 40);
this.label13.Name = "label13";
this.label13.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.label13.Size = new System.Drawing.Size(104, 17);
this.label13.TabIndex = 281;
this.label13.Text = "请选择料架位置:";
this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtInoutPA
//
this.txtInoutPA.AcceptsReturn = true;
this.txtInoutPA.BackColor = System.Drawing.SystemColors.Window;
this.txtInoutPA.Cursor = System.Windows.Forms.Cursors.IBeam;
this.txtInoutPA.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtInoutPA.ForeColor = System.Drawing.SystemColors.WindowText;
this.txtInoutPA.Location = new System.Drawing.Point(136, 294);
this.txtInoutPA.MaxLength = 0;
this.txtInoutPA.Name = "txtInoutPA";
this.txtInoutPA.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtInoutPA.Size = new System.Drawing.Size(89, 23);
this.txtInoutPA.TabIndex = 280;
this.txtInoutPA.Text = "999";
//
// btnInoutPA
//
this.btnInoutPA.AutoSize = true;
this.btnInoutPA.BackColor = System.Drawing.SystemColors.Control;
this.btnInoutPA.Cursor = System.Windows.Forms.Cursors.Default;
this.btnInoutPA.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnInoutPA.ForeColor = System.Drawing.Color.Green;
this.btnInoutPA.Location = new System.Drawing.Point(18, 289);
this.btnInoutPA.Name = "btnInoutPA";
this.btnInoutPA.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnInoutPA.Size = new System.Drawing.Size(114, 33);
this.btnInoutPA.TabIndex = 279;
this.btnInoutPA.Text = "进出轴位置PA:";
this.btnInoutPA.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnInoutPA.UseVisualStyleBackColor = true;
//
// txtMPA
//
this.txtMPA.AcceptsReturn = true;
this.txtMPA.BackColor = System.Drawing.SystemColors.Window;
this.txtMPA.Cursor = System.Windows.Forms.Cursors.IBeam;
this.txtMPA.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtMPA.ForeColor = System.Drawing.SystemColors.WindowText;
this.txtMPA.Location = new System.Drawing.Point(136, 135);
this.txtMPA.MaxLength = 0;
this.txtMPA.Name = "txtMPA";
this.txtMPA.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtMPA.Size = new System.Drawing.Size(89, 23);
this.txtMPA.TabIndex = 278;
this.txtMPA.Text = "999";
//
// button5
//
this.button5.AutoSize = true;
this.button5.BackColor = System.Drawing.SystemColors.Control;
this.button5.Cursor = System.Windows.Forms.Cursors.Default;
this.button5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
this.button5.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.button5.Location = new System.Drawing.Point(19, 130);
this.button5.Name = "button5";
this.button5.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.button5.Size = new System.Drawing.Size(114, 33);
this.button5.TabIndex = 277;
this.button5.Text = "旋转轴位置PA:";
this.button5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.button5.UseVisualStyleBackColor = true;
//
// txtUpdownPA1
//
this.txtUpdownPA1.AcceptsReturn = true;
this.txtUpdownPA1.BackColor = System.Drawing.SystemColors.Window;
this.txtUpdownPA1.Cursor = System.Windows.Forms.Cursors.IBeam;
this.txtUpdownPA1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtUpdownPA1.ForeColor = System.Drawing.SystemColors.WindowText;
this.txtUpdownPA1.Location = new System.Drawing.Point(137, 188);
this.txtUpdownPA1.MaxLength = 0;
this.txtUpdownPA1.Name = "txtUpdownPA1";
this.txtUpdownPA1.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtUpdownPA1.Size = new System.Drawing.Size(89, 23);
this.txtUpdownPA1.TabIndex = 274;
this.txtUpdownPA1.Text = "999";
//
// txtUpdownPA2
//
this.txtUpdownPA2.AcceptsReturn = true;
this.txtUpdownPA2.BackColor = System.Drawing.SystemColors.Window;
this.txtUpdownPA2.Cursor = System.Windows.Forms.Cursors.IBeam;
this.txtUpdownPA2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtUpdownPA2.ForeColor = System.Drawing.SystemColors.WindowText;
this.txtUpdownPA2.Location = new System.Drawing.Point(137, 241);
this.txtUpdownPA2.MaxLength = 0;
this.txtUpdownPA2.Name = "txtUpdownPA2";
this.txtUpdownPA2.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtUpdownPA2.Size = new System.Drawing.Size(89, 23);
this.txtUpdownPA2.TabIndex = 276;
this.txtUpdownPA2.Text = "999";
//
// btnUpdownPA1
//
this.btnUpdownPA1.AutoSize = true;
this.btnUpdownPA1.BackColor = System.Drawing.SystemColors.Control;
this.btnUpdownPA1.Cursor = System.Windows.Forms.Cursors.Default;
this.btnUpdownPA1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnUpdownPA1.ForeColor = System.Drawing.Color.Red;
this.btnUpdownPA1.Location = new System.Drawing.Point(19, 183);
this.btnUpdownPA1.Name = "btnUpdownPA1";
this.btnUpdownPA1.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnUpdownPA1.Size = new System.Drawing.Size(114, 33);
this.btnUpdownPA1.TabIndex = 273;
this.btnUpdownPA1.Text = "升降轴低点PA1:";
this.btnUpdownPA1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnUpdownPA1.UseVisualStyleBackColor = true;
//
// btnUpdownPA2
//
this.btnUpdownPA2.AutoSize = true;
this.btnUpdownPA2.BackColor = System.Drawing.SystemColors.Control;
this.btnUpdownPA2.Cursor = System.Windows.Forms.Cursors.Default;
this.btnUpdownPA2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnUpdownPA2.ForeColor = System.Drawing.Color.Red;
this.btnUpdownPA2.Location = new System.Drawing.Point(19, 236);
this.btnUpdownPA2.Name = "btnUpdownPA2";
this.btnUpdownPA2.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnUpdownPA2.Size = new System.Drawing.Size(114, 33);
this.btnUpdownPA2.TabIndex = 275;
this.btnUpdownPA2.Text = "升降轴高点PA2:";
this.btnUpdownPA2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnUpdownPA2.UseVisualStyleBackColor = true;
//
// btnSaveShelf
//
this.btnSaveShelf.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSaveShelf.Location = new System.Drawing.Point(70, 357);
this.btnSaveShelf.Name = "btnSaveShelf";
this.btnSaveShelf.Size = new System.Drawing.Size(105, 38);
this.btnSaveShelf.TabIndex = 282;
this.btnSaveShelf.Text = "保存位置";
this.btnSaveShelf.UseVisualStyleBackColor = true;
this.btnSaveShelf.Click += new System.EventHandler(this.btnSaveShelf_Click);
//
// FrmBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(1335, 775);
this.Controls.Add(this.groupShelf);
this.Controls.Add(this.panel1);
this.Controls.Add(this.tabControl1);
this.Controls.Add(this.groupBox3);
......@@ -2093,7 +2272,6 @@
this.Name = "FrmBox";
this.Opacity = 0D;
this.Text = "AC_SA_料仓";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmTest_FormClosing);
this.Load += new System.EventHandler(this.FrmTest_Load);
this.Shown += new System.EventHandler(this.FrmStoreBox_Shown);
this.groupAxis.ResumeLayout(false);
......@@ -2113,6 +2291,8 @@
this.groupBox7.PerformLayout();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.groupShelf.ResumeLayout(false);
this.groupShelf.PerformLayout();
this.ResumeLayout(false);
}
......@@ -2129,7 +2309,6 @@
public System.Windows.Forms.Button btnUpDownP4;
public System.Windows.Forms.Label label21;
private System.Windows.Forms.ComboBox cmbPosition;
public System.Windows.Forms.Button Bt_ClearCounter;
private System.Windows.Forms.Label label43;
private System.Windows.Forms.Label label42;
private System.Windows.Forms.TextBox lblOutPulse;
......@@ -2218,7 +2397,7 @@
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox txtBusyStatus;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button btnMPA;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtAlarmStatus;
private System.Windows.Forms.Button btnGetAlarm;
......@@ -2267,6 +2446,18 @@
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button btnScanTest;
private System.Windows.Forms.Label lblCid;
private System.Windows.Forms.ComboBox cmbShelfPosition;
private System.Windows.Forms.GroupBox groupShelf;
public System.Windows.Forms.TextBox txtInoutPA;
public System.Windows.Forms.Button btnInoutPA;
public System.Windows.Forms.TextBox txtMPA;
public System.Windows.Forms.Button button5;
public System.Windows.Forms.TextBox txtUpdownPA1;
public System.Windows.Forms.TextBox txtUpdownPA2;
public System.Windows.Forms.Button btnUpdownPA1;
public System.Windows.Forms.Button btnUpdownPA2;
public System.Windows.Forms.Label label13;
private System.Windows.Forms.Button btnSaveShelf;
}
}
......@@ -23,12 +23,12 @@ namespace OnlineStore.ACPackingStore
public partial class FrmBox : FrmBase
{
public AC_BOX_Bean BoxBean=null;
public AC_BOX_Bean BoxBean = null;
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public FrmBox()
{
Control.CheckForIllegalCrossThreadCalls = false;
InitializeComponent();
InitializeComponent();
}
#region "初始化界面数据"
......@@ -38,8 +38,8 @@ namespace OnlineStore.ACPackingStore
{
LoadStore();
}
public void LoadStore( )
{
public void LoadStore()
{
if (BoxBean == null)
{
LogUtil.error(LOGGER, "找不到对应的料仓");
......@@ -62,6 +62,20 @@ namespace OnlineStore.ACPackingStore
ktkPosition = CSVPositionReader<ACBoxPosition>.GetPositon(cmbPosition.Text);
//BoxBean.PositionNumList = positionNumList;
}
ShelfPosition shelrfP = null;
if (BoxBean.ShelfPosList.Count > 0)
{
cmbShelfPosition.DataSource = BoxBean.ShelfPosList;
cmbShelfPosition.SelectedIndex = 0;
shelrfP = CSVPositionReader<ShelfPosition>.GetPositon(cmbShelfPosition.Text);
}
if (shelrfP != null)
{
txtInoutPA.Text = shelrfP.InoutAxis_PA.ToString();
txtUpdownPA1.Text = shelrfP.UpDownAxis_LPA1.ToString();
txtUpdownPA2.Text = shelrfP.UpDownAxis_HPA2.ToString();
txtMPA.Text = shelrfP.MiddleAxis_PA.ToString();
}
txtMiddleP1.Text = BoxBean.Config.MiddleAxis_P1_Position.ToString();
txtUpDownP1.Text = BoxBean.Config.UpDownAxis_DoorOPosition_P1.ToString();
......@@ -90,15 +104,11 @@ namespace OnlineStore.ACPackingStore
txtInOutP2.Text = ktkPosition.InOutAxis_DoorPosition_P2.ToString();
//txtUpDownP1.Text = ktkPosition.UpDownAxis_DoorOPosition_P1.ToString();
}
timer1.Enabled = true;
chbDebug.Checked = BoxBean.IsDebug;
this.ShowInTaskbar = true;
this.Text = ConfigAppSettings.GetValue(Setting_Init.App_Title);
this.Opacity = 1;
txtTempPort.Text = BoxBean.Config.Humiture_Port;
if (HumitureController.HumitureControllerType.Equals(1))
{
......@@ -109,10 +119,10 @@ namespace OnlineStore.ACPackingStore
groupHistory.Visible = false;
}
LoadOk = true;
}
}
#endregion
private bool preOpen = false;
public void StoreOpenStatus(bool isOpen)
{
......@@ -123,14 +133,14 @@ namespace OnlineStore.ACPackingStore
preOpen = isOpen;
btnOutStore.Enabled = isOpen;
btnInStore.Enabled = isOpen;
btnInStore.Enabled = isOpen;
btnStoreStart.Enabled = !isOpen;
btnStoreStop.Enabled = isOpen;
btnSotreReset.Enabled = isOpen;
btnStoreStart.Enabled = !isOpen;
btnSotreReset.Enabled = isOpen;
btnStoreStop.Enabled = isOpen;
}
btnStoreStop.Enabled = isOpen;
}
private void timer1_Tick(object sender, EventArgs e)
{
if (!this.Visible)
......@@ -242,9 +252,9 @@ namespace OnlineStore.ACPackingStore
// lblWarnMsg.Text = msg;
//}
}
if (BoxBean.autoNext)
if (BoxBean.AutoInout.autoNext)
{
string msg = BoxBean.autoMsg;
string msg = BoxBean.AutoInout.autoMsg;
lblMsg.Text = msg;
if (btnStartAuTo.Text.Equals("开始自动出入库"))
{
......@@ -286,7 +296,7 @@ namespace OnlineStore.ACPackingStore
//判断私服是否打开、
if (ACServerManager.ServerOnStatus(portName, SlvAddr))
{
lblServerOn.Text = "伺服ON";
lblServerOn.Text = "伺服ON";
}
else
{
......@@ -302,7 +312,7 @@ namespace OnlineStore.ACPackingStore
int lCountPulse1 = ACServerManager.GetActualtPosition(BoxBean.Config.Middle_Axis.DeviceName, BoxBean.Config.Middle_Axis.GetAxisValue());
lblCountPulse1.Text = string.Format("{0:d}", lCountPulse1);
txtMiddleTarget.Text = BoxBean.Config.Middle_Axis.TargetPosition.ToString();
if ( BoxBean.Config.Middle_Axis.IsSameAxis(portName,SlvAddr))
if (BoxBean.Config.Middle_Axis.IsSameAxis(portName, SlvAddr))
{
lblOutPulse.Text = lblOutPulse1.Text;
lblCountPulse.Text = lblCountPulse1.Text;
......@@ -317,7 +327,7 @@ namespace OnlineStore.ACPackingStore
int lCountPulse2 = ACServerManager.GetActualtPosition(BoxBean.Config.UpDown_Axis.DeviceName, BoxBean.Config.UpDown_Axis.GetAxisValue());
lblCountPulse2.Text = string.Format("{0:d}", lCountPulse2);
txtInoutTarget.Text = BoxBean.Config.InOut_Axis.TargetPosition.ToString();
if ( BoxBean.Config.UpDown_Axis.IsSameAxis(portName, SlvAddr))
if (BoxBean.Config.UpDown_Axis.IsSameAxis(portName, SlvAddr))
{
lblOutPulse.Text = lblOutPulse2.Text;
lblCountPulse.Text = lblCountPulse2.Text;
......@@ -331,30 +341,13 @@ namespace OnlineStore.ACPackingStore
int lCountPulse3 = ACServerManager.GetActualtPosition(BoxBean.Config.InOut_Axis.DeviceName, BoxBean.Config.InOut_Axis.GetAxisValue());
lblCountPulse3.Text = string.Format("{0:d}", lCountPulse3);
txtUpdownTarget.Text = BoxBean.Config.UpDown_Axis.TargetPosition.ToString();
if ( BoxBean.Config.InOut_Axis.IsSameAxis(portName, SlvAddr))
if (BoxBean.Config.InOut_Axis.IsSameAxis(portName, SlvAddr))
{
lblOutPulse.Text = lblOutPulse3.Text;
lblCountPulse.Text = lblCountPulse3.Text;
}
}
}
private void Bt_ClearCounter_Click(object sender, EventArgs e)
{
string portName = txtAxisDeviceName.Text;
short SlvAddr = FormUtil.GetShortValue(txtAxisValue);
//KTKSMCManager.WSetCountPulse(portName, SlvAddr, 0);
//KTKSMCManager.WSetOutPulse(portName, SlvAddr, 0);
}
private void FrmTest_FormClosing(object sender, FormClosingEventArgs e)
{
if (e.CloseReason == CloseReason.UserClosing)//当用户点击窗体右上角X按钮或(Alt + F4)时 发生
{
e.Cancel = true;
}
}
}
private void btnOutStore_Click(object sender, EventArgs e)
{
if (BoxBean.storeRunStatus >= StoreRunStatus.HomeMoving)
......@@ -403,6 +396,11 @@ namespace OnlineStore.ACPackingStore
ktk.UpDown_P6 = FormUtil.GetIntValue(txtUpDownP6);
ktk.UpDown_P7 = FormUtil.GetIntValue(txtUpDownP7);
ktk.UpDown_P8 = FormUtil.GetIntValue(txtUpDownP8);
ktk.InOut_PA = FormUtil.GetIntValue(txtInoutPA);
ktk.UpDown_LPA1 = FormUtil.GetIntValue(txtUpdownPA1);
ktk.UpDown_HPA2 = FormUtil.GetIntValue(txtUpdownPA2);
ktk.Middle_PA = FormUtil.GetIntValue(txtMPA);
return ktk;
}
private void btnComAlarmClear_Click(object sender, EventArgs e)
......@@ -449,19 +447,7 @@ namespace OnlineStore.ACPackingStore
ConfigMoveAxis SlvAddr = BoxBean.moveAxisList[cmbAxisList.SelectedIndex];
txtAxisDeviceName.Text = SlvAddr.DeviceName;
txtAxisValue.Text = SlvAddr.GetAxisValue().ToString();
txtASpeed.Text = SlvAddr.TargetSpeed.ToString();
//if (SlvAddr.Equals(BoxBean.Config.InOut_Axis))
//{
// txtASpeed.Text = BoxBean.Config.InOutAxis_P1_Speed.ToString();
//}
//else if (SlvAddr.Equals(BoxBean.Config.Middle_Axis))
//{
// txtASpeed.Text = BoxBean.Config.MiddleAxis_P1_Speed.ToString();
//}
//else if (SlvAddr.Equals(BoxBean.Config.UpDown_Axis))
//{
// txtASpeed.Text = BoxBean.Config.UpDownAxis_P1_Speed.ToString();
//}
txtASpeed.Text = SlvAddr.TargetSpeed.ToString();
}
}
......@@ -477,20 +463,20 @@ namespace OnlineStore.ACPackingStore
// MessageBox.Show("位置超出" + axisC.Explain + "上下限(" + axisC.PositionMin + "-" + axisC.PositionMax + ")");
// return;
//}
if ( BoxBean.Config.InOut_Axis.IsSameAxis(portName, SlvAddr) && (BoxBean.InOutAxisCanMove().Equals(false)))
if (BoxBean.Config.InOut_Axis.IsSameAxis(portName, SlvAddr) && (BoxBean.InOutAxisCanMove().Equals(false)))
{
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
else if ( BoxBean.Config.Middle_Axis.IsSameAxis(portName, SlvAddr) || BoxBean.Config.UpDown_Axis.IsSameAxis(portName, SlvAddr))
else if (BoxBean.Config.Middle_Axis.IsSameAxis(portName, SlvAddr) || BoxBean.Config.UpDown_Axis.IsSameAxis(portName, SlvAddr))
{
if (!InOutIsIsP1())
{
return;
}
}
LogUtil.info("点击【绝对运动】,端口号【"+ portName + "】地址【" + SlvAddr + "】位置【" + position + "】速度【" + speed + "】");
ACServerManager.AbsMove(portName, SlvAddr, position, speed );
LogUtil.info("点击【绝对运动】,端口号【" + portName + "】地址【" + SlvAddr + "】位置【" + position + "】速度【" + speed + "】");
ACServerManager.AbsMove(portName, SlvAddr, position, speed);
}
private void btnAxisVMove_Click(object sender, EventArgs e)
{
......@@ -511,7 +497,7 @@ namespace OnlineStore.ACPackingStore
}
}
LogUtil.info("点击【匀速运动】,端口号【" + portName + "】地址【" + SlvAddr + "】 速度【" + speed + "】");
ACServerManager.SpeedMove(portName, SlvAddr, speed);
ACServerManager.SpeedMove(portName, SlvAddr, speed);
}
private void btnAxisRMove_Click(object sender, EventArgs e)
......@@ -545,7 +531,7 @@ namespace OnlineStore.ACPackingStore
ACServerManager.RelMove(portName, SlvAddr, position, speed);
}
private void btnAxisStop_Click(object sender, EventArgs e)
{
......@@ -601,12 +587,12 @@ namespace OnlineStore.ACPackingStore
if (!File.Exists(positionConfigFile))
{
string nameStr = BoxBean.DeviceID.ToString();
positionConfigFile = positionConfigFile.Replace(".csv", "_" + nameStr + ".csv");
positionConfigFile = positionConfigFile.Replace(".csv", "_" + nameStr + ".csv");
}
bool result = CSVPositionReader<ACBoxPosition>.SavePostion(positionConfigFile, ktkPosition);
if (!result)
{
MessageBox.Show("保存位置失败!");
MessageBox.Show("库位【"+selectPositionNum+ "】保存失败!");
}
//料仓固定位置保存
bool needUpdate = false;
......@@ -682,13 +668,13 @@ namespace OnlineStore.ACPackingStore
/// </summary>
private bool InOutIsIsP1()
{
int InOutDefaultPosition = ConfigAppSettings.GetIntValue(Setting_Init.InOutDefaultPosition);
int currValue = ACServerManager.GetActualtPosition(BoxBean.Config.InOut_Axis.DeviceName, BoxBean.Config.InOut_Axis.GetAxisValue());
int InOutDefaultPosition = ConfigAppSettings.GetIntValue(Setting_Init.InOutDefaultPosition);
int currValue = ACServerManager.GetActualtPosition(BoxBean.Config.InOut_Axis.DeviceName, BoxBean.Config.InOut_Axis.GetAxisValue());
if (currValue <= InOutDefaultPosition)
{
return true;
}
MessageBox.Show("叉子不在待机位,请先将叉子退回待机位("+InOutDefaultPosition+")", "警告(叉子在待机位时,才能移动升降轴和旋转轴) ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
MessageBox.Show("叉子不在待机位,请先将叉子退回待机位(" + InOutDefaultPosition + ")", "警告(叉子在待机位时,才能移动升降轴和旋转轴) ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return false;
}
private void btnCloseAxis_Click(object sender, EventArgs e)
......@@ -700,13 +686,13 @@ namespace OnlineStore.ACPackingStore
}
private void AxisABSMove(ConfigMoveAxis moveAxis, int targetPosition, int targetSpeed)
{
moveAxis.TargetPosition = targetPosition;
moveAxis.TargetPosition = targetPosition;
ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed);
}
private void btnUpDownP1_Click(object sender, EventArgs e)
{
if (InOutIsIsP1())
{
{
int value = FormUtil.GetIntValue(txtUpDownP1);
AxisABSMove(BoxBean.Config.UpDown_Axis, value, BoxBean.Config.UpDownAxis_P1_Speed);
}
......@@ -828,31 +814,31 @@ namespace OnlineStore.ACPackingStore
private void btnComP2_Click(object sender, EventArgs e)
{
int value = FormUtil.GetIntValue(txtComP2);
AxisABSMove(BoxBean.Config.Comp_Axis, value, BoxBean.Config.CompAxis_P2_Speed);
AxisABSMove(BoxBean.Config.Comp_Axis, value, BoxBean.Config.CompAxis_P2_Speed);
}
private void btnComP1_Click(object sender, EventArgs e)
{
int value = FormUtil.GetIntValue(txtComP1);
AxisABSMove(BoxBean.Config.Comp_Axis, value, BoxBean.Config.CompAxis_P1_Speed);
AxisABSMove(BoxBean.Config.Comp_Axis, value, BoxBean.Config.CompAxis_P1_Speed);
}
private void btnComP3_Click(object sender, EventArgs e)
{
int value = FormUtil.GetIntValue(txtComP3);
AxisABSMove(BoxBean.Config.Comp_Axis, value, BoxBean.Config.CompAxis_P3_Speed);
AxisABSMove(BoxBean.Config.Comp_Axis, value, BoxBean.Config.CompAxis_P3_Speed);
}
int xWidth = SystemInformation.PrimaryMonitorSize.Width;//获取显示器屏幕宽度
int yHeight = SystemInformation.PrimaryMonitorSize.Height;//高度
private void btnStartAuTo_Click(object sender, EventArgs e)
{
if (BoxBean.storeRunStatus >= StoreRunStatus.HomeMoving)
{
if (BoxBean.autoNext)
if (BoxBean.AutoInout.autoNext)
{
BoxBean.autoNext = false;
BoxBean.AutoInout.autoNext = false;
btnStartAuTo.Text = "开始自动出入库";
}
else
......@@ -860,19 +846,20 @@ namespace OnlineStore.ACPackingStore
DialogResult res = MessageBox.Show("确定开始自动出入库?", "提示", MessageBoxButtons.YesNo);
if (res.Equals(DialogResult.Yes))
{
BoxBean.autoNext = true;
BoxBean.AutoInout.autoNext = true;
int jiange = FormUtil.GetIntValue(txtJiange);
BoxBean.autoJiange = jiange;
BoxBean.AutoInout.Jiange = jiange;
if (cmbPosition.SelectedIndex >= 0)
{
int currIndex = cmbPosition.SelectedIndex;
BoxBean.autoPositionIndex = currIndex;
BoxBean.AutoStartIndex = currIndex;
BoxBean.AutoInout.positionIndex = currIndex;
BoxBean.AutoInout.startIndex = currIndex;
BoxBean.AutoInout.shelfPosId = cmbShelfPosition.Text;
string poText = cmbPosition.Text;
BoxBean.autoMsg = "自动出库:" + poText;
BoxBean.AutoInout.autoMsg = "自动出库:" + poText;
LogUtil.info(LOGGER, BoxBean.Name + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!");
//BoxBean.StartOutStoreMove(new InOutStoreParam("", poText));
BoxBean.StartInStoreMove(new InOutParam("", poText));
BoxBean.StartInStoreMove(new InOutParam("", poText, BoxBean.AutoInout.shelfPosId));
}
btnStartAuTo.Text = "停止自动出入库";
}
......@@ -882,11 +869,11 @@ namespace OnlineStore.ACPackingStore
{
MessageBox.Show("请先启动料仓!");
}
}
}
private void btnAxisP_Click(object sender, EventArgs e)
{
FormManager.ShowAxisDebug(BoxBean);
}
}
private void btnStoreStart_Click(object sender, EventArgs e)
{
......@@ -920,22 +907,22 @@ namespace OnlineStore.ACPackingStore
private void 查看IOToolStripMenuItem_Click(object sender, EventArgs e)
{
FormManager.ShowIOShow(BoxBean);
}
}
private void 料仓运转ONToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Enabled = false;
BoxBean.RunAxis(false );
BoxBean.RunAxis(false);
this.Enabled = true;
LogUtil.info("料仓运转ON完成");
}
private void 料仓运转OFFToolStripMenuItem_Click(object sender, EventArgs e)
{
BoxBean.CloseAllAxis();
LogUtil.info("料仓运转OFF完成");
}
private void 回待机点ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (BoxBean.storeRunStatus >= StoreRunStatus.HomeMoving)
......@@ -954,9 +941,9 @@ namespace OnlineStore.ACPackingStore
MessageBox.Show("请先启动料仓!");
}
}
private void FrmStoreBox_Shown(object sender, EventArgs e)
{
{
this.btnUpDownP1.ForeColor = System.Drawing.Color.Red;
this.btnUpDownP2.ForeColor = System.Drawing.Color.Red;
this.btnUpDownP3.ForeColor = System.Drawing.Color.Red;
......@@ -980,7 +967,7 @@ namespace OnlineStore.ACPackingStore
}
private int GetSlaveAddr()
{
return FormUtil.GetShortValue(txtAxisValue);
......@@ -1026,20 +1013,20 @@ namespace OnlineStore.ACPackingStore
private void button1_Click_1(object sender, EventArgs e)
{
int value = ACServerManager.GetBusyStatus(GetPortName(), GetSlaveAddr());
this.txtBusyStatus.Text = value.ToString();
this.txtBusyStatus.Text = value.ToString();
}
private void button2_Click(object sender, EventArgs e)
{
int value = ACServerManager.GetHomeEndStatus(GetPortName(), GetSlaveAddr());
this.txtHomeStatus.Text = value.ToString();
}
}
private void btnReadHomeSingle_Click(object sender, EventArgs e)
{
int value = ACServerManager.GetHomeSingle(GetPortName(), GetSlaveAddr());
this.txtHomeSingle.Text = value.ToString();
}
private void btnTempInit_Click(object sender, EventArgs e)
{
......@@ -1061,7 +1048,7 @@ namespace OnlineStore.ACPackingStore
ASTemperateParam param = HumitureController.QueryData();
txtTemp.Text = param.Temperate.ToString();
txtHum.Text = param.Humidity.ToString();
}
}
private void btnSelHistory_Click(object sender, EventArgs e)
{
......@@ -1084,9 +1071,10 @@ namespace OnlineStore.ACPackingStore
{
groupAxis.Enabled = isDebug;
groupInout.Enabled = isDebug;
groupShelf.Enabled = isDebug;
}
private void chbDebug_CheckedChanged(object sender, EventArgs e)
{
{
if (!LoadOk)
{
return;
......@@ -1114,7 +1102,7 @@ namespace OnlineStore.ACPackingStore
DialogResult result = MessageBox.Show("是否切换到正常工作状态?", "是否确认切换", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if (result.Equals(DialogResult.Yes))
{
BoxBean.IsDebug = false ;
BoxBean.IsDebug = false;
BoxBean.Config.IsInDebug = 0;
StoreManager.UpdateBoxConfig(BoxBean.Config);
LogUtil.info("用户切换到正常工作状态 ");
......@@ -1133,5 +1121,48 @@ namespace OnlineStore.ACPackingStore
}
LogUtil.info("扫到二维码:" + result);
}
private void cmbShelfPosition_SelectedIndexChanged(object sender, EventArgs e)
{
if (LoadOk.Equals(false))
{
return;
}
if (cmbShelfPosition.SelectedIndex >= 0)
{
string selText = cmbShelfPosition.Text;
ShelfPosition shelrfP = CSVPositionReader<ShelfPosition>.GetPositon(selText);
if (shelrfP != null)
{
txtInoutPA.Text = shelrfP.InoutAxis_PA.ToString();
txtUpdownPA1.Text = shelrfP.UpDownAxis_LPA1.ToString();
txtUpdownPA2.Text = shelrfP.UpDownAxis_HPA2.ToString();
txtMPA.Text = shelrfP.MiddleAxis_PA.ToString();
}
}
}
private void btnSaveShelf_Click(object sender, EventArgs e)
{
//料仓格子位置保存
string selectPositionNum = cmbShelfPosition.Text;
ShelfPosition pso = CSVPositionReader<ShelfPosition>.GetPositon(selectPositionNum);
if (pso != null)
{
pso.InoutAxis_PA = FormUtil.GetIntValue(txtInoutPA);
pso.MiddleAxis_PA = FormUtil.GetIntValue(txtMPA);
pso.UpDownAxis_LPA1 = FormUtil.GetIntValue(txtUpdownPA1);
pso.UpDownAxis_HPA2 = FormUtil.GetIntValue(txtUpdownPA2);
}
//位置配置
string positionConfigFile = Application.StartupPath + ConfigAppSettings.GetValue(Setting_Init.Shelf_Position_Config);
bool result = CSVPositionReader<ShelfPosition>.SavePostion(positionConfigFile, pso);
if (!result)
{
MessageBox.Show("库位【" + selectPositionNum + "】保存失败!");
}
}
}
}
......@@ -26,36 +26,35 @@ namespace OnlineStore.ACPackingStore
internal FrmStore()
{
InitializeComponent();
LogUtil.logBox = this.logBox;
startTimer = new System.Timers.Timer();
startTimer.Interval = 1000;
startTimer.Enabled = false;
startTimer.AutoReset = false;
}
private void FrmMain_Load(object sender, EventArgs e)
{
FrmBase. GetVersion();
FrmBase.GetVersion();
store = StoreManager.InitStore();
if (store == null)
{
this.Close();
return;
}
else
foreach (AC_BOX_Bean box in store.BoxMap.Values)
{
foreach (AC_BOX_Bean box in store.BoxMap.Values)
{
FrmBox frm = new FrmBox();
frm.BoxBean = box;
AddForm(box.Name, frm);
}
FrmBox frm = new FrmBox();
frm.BoxBean = box;
AddForm(box.Name, frm);
}
chbAutoRun.Checked = store.UseBuzzer;
this.Text = ConfigAppSettings.GetValue(Setting_Init.App_Title);
chbAutoRun.Checked = ConfigAppSettings.GetValue(Setting_Init.App_AutoRun).Equals(1);
HideForm();
chbAutoRun.Checked = store.UseBuzzer;
// LogUtil.logBox = this.logBox;
// HideForm();
LoadOk = true;
}
......@@ -88,8 +87,7 @@ namespace OnlineStore.ACPackingStore
this.Opacity = 0;
this.ShowInTaskbar = false;
this.notifyIcon1.Visible = true;
this.Hide();
GC.Collect();
this.Hide();
}
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
......


using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
......@@ -17,7 +17,7 @@ namespace OnlineStore.DeviceLibrary
public partial class AC_BOX_Bean : KTK_Store
{
private static bool IsIntSlvBlock = false;
public AutoInoutInfo AutoInout = new AutoInoutInfo();
public static bool IsRun = false;
public string CID = "";
public AC_BOX_Config Config;
......@@ -26,19 +26,9 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public string lastPosId = "";
public StoreStatus lastPosIdStatus = StoreStatus.StoreOnline;
/// <summary>
/// 轴列表
/// </summary>
public List<ConfigMoveAxis> moveAxisList = new List<ConfigMoveAxis>();
/// <summary>
/// 轴报警信息
/// </summary>
private Dictionary<string, AxisAlarmInfo> AxisAlarmCodeMap = new Dictionary<string, AxisAlarmInfo>();
/// <summary>
/// 料仓内所有的位置列表
/// </summary>
public List<string> PositionNumList = new List<string>();
public List<string> ShelfPosList = new List<string>();
private System.Timers.Timer serverConnectTimer = new System.Timers.Timer();
......@@ -73,12 +63,12 @@ namespace OnlineStore.DeviceLibrary
{
if (position.StoreId.Equals(DeviceID) && ACBoxPosition.CheckPosition(position, Config))
{
PositionNumList.Add(position.PositionNum);
PositionNumList.Add(position.PositionNum);
}
}
List<ShelfPosition> sPlist = CSVPositionReader<ShelfPosition>.getPositionList();
ShelfPosList = new List<string>();
foreach(ShelfPosition p in sPlist)
foreach (ShelfPosition p in sPlist)
{
if (p.StoreId.Equals(DeviceID))
{
......@@ -103,13 +93,13 @@ namespace OnlineStore.DeviceLibrary
if (isInSuddenDown.Equals(false))
{
isInSuddenDown = true;
LogUtil.error( Name + "收到急停信号,报警急停");
LogUtil.error(Name + "收到急停信号,报警急停");
WarnMsg = Name + "收到急停信号,报警急停";
//报警时会关闭所有轴
Alarm(StoreAlarmType.SuddenStop, "1", WarnMsg, StoreMoveType.None);
}
}
}
}
}
/// <summary>
......@@ -130,7 +120,7 @@ namespace OnlineStore.DeviceLibrary
this.AxisAlarmCodeMap.Add(this.Config.Middle_Axis.GetNameStr(), new AxisAlarmInfo());
moveAxisList.Add(Config.Comp_Axis);
this.AxisAlarmCodeMap.Add(this.Config.Comp_Axis.GetNameStr(), new AxisAlarmInfo());
this.AxisAlarmCodeMap.Add(this.Config.Comp_Axis.GetNameStr(), new AxisAlarmInfo());
}
/// <summary>
......@@ -138,17 +128,17 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public override bool StartRun()
{
LogInfo( "开始启动,启动时间:" + StartTime.ToString());
LogInfo("开始启动,启动时间:" + StartTime.ToString());
autoNext = false;
AutoInout.autoNext = false;
mainTimer.Enabled = false;
alarmType = StoreAlarmType.None;
//急停按钮和气压检测需要一起判断
IO_VALUE suddenBtn = IOValue(IO_Type.SuddenStop_BTN);
IO_VALUE airCheck = IOValue(IO_Type.Airpressure_Check);
if (suddenBtn.Equals(IO_VALUE.HIGH) && (airCheck.Equals(IO_VALUE.HIGH)) )
if (suddenBtn.Equals(IO_VALUE.HIGH) && (airCheck.Equals(IO_VALUE.HIGH)))
{
//lastAirValue = airCheck;
lastAirCloseTime = DateTime.Now;
......@@ -161,7 +151,7 @@ namespace OnlineStore.DeviceLibrary
storeRunStatus = StoreRunStatus.HomeMoving;
storeStatus = StoreStatus.ResetMove;
//启动温湿度服务器
HumitureController.Init(Config.Humiture_Port);
HumitureController.Init(Config.Humiture_Port);
ReturnHome();
StartTime = DateTime.Now;
......@@ -175,11 +165,11 @@ namespace OnlineStore.DeviceLibrary
{
if (suddenBtn.Equals(IO_VALUE.LOW))
{
LogUtil.error( " (" + Name + ")启动出现错误:急停没开 !启动失败!");
LogUtil.error(" (" + Name + ")启动出现错误:急停没开 !启动失败!");
}
else
{
LogUtil.error( " (" + Name + ")启动出现错误:没有气压信号 !启动失败!");
LogUtil.error(" (" + Name + ")启动出现错误:没有气压信号 !启动失败!");
}
return false;
}
......@@ -191,78 +181,64 @@ namespace OnlineStore.DeviceLibrary
{
isNoAirCheck = false;
isInSuddenDown = false;
WarnMsg = "";
CurrInOutACount = 0;
CurrInOutCount = 0;
WarnMsg = "";
AutoInout.ClearCount();
IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH);
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
storeRunStatus = StoreRunStatus.HomeMoving;
MoveInfo.NewMove(StoreMoveType.ReturnHome);
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_InOutBack);
ACAxisHomeMove(Config.InOut_Axis);
LogInfo( "开始原点返回,先把进出轴回原点");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
InoutStartReset();
}
public void MoveToP1()
{
//压紧轴回原点,叉子回到P1,关闭门旋转轴和升降轴回到P1
MoveInfo.NewMove(StoreMoveType.StoreReset);
MoveInfo.NextMoveStep(StoreMoveStep.BOX_M_H_TOP1_InOutToP1);
LogInfo( "到待机状态,进出轴到P1,判断叉子没有料盘");
LogInfo("到待机状态,进出轴到P1,判断叉子没有料盘");
ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed);
//ComBeforeHomeMove();
//判断叉子没有料盘
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
}
public override void Reset(bool isNeedClearAuto=true)
{
CurrInOutCount = 0;
CurrInOutACount = 0;
public override void Reset(bool isNeedClearAuto = true)
{
AutoInout.ClearCount();
IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH);
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
//复位之前先停止运行
if (isNeedClearAuto)
{
autoNext = false;
}
AutoInout.autoNext = false;
}
ACServerManager.SuddenStop(Config.Middle_Axis.DeviceName, Config.Middle_Axis.GetAxisValue());
ACServerManager.SuddenStop(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue());
ACServerManager.SuddenStop(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue());
isInSuddenDown = false;
isNoAirCheck = false;
isNoAirCheck = false;
alarmType = StoreAlarmType.None;
storeRunStatus = StoreRunStatus.Reset;
storeStatus = StoreStatus.ResetMove;
MoveInfo.NewMove(StoreMoveType.StoreReset);
WarnMsg = "";
if (!RunAxis(true))
////打开四个轴
//if (!OpenAllAxis())
{
LogInfo( "复位时打开轴失败,需要再次复位,直接报警停止复位");
if (!RunAxis(true)) {
LogInfo("复位时打开轴失败,需要再次复位,直接报警停止复位");
return;
}
InoutStartReset();
InoutStartReset();
isInPro = false;
}
private void InoutStartReset()
{
string portName = Config.InOut_Axis.DeviceName;
int slvAddr = Config.InOut_Axis.GetAxisValue();
{
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_InOutBack);
LogInfo( "复位中,进出轴开始原点返回");
LogInfo(MoveInfo.MoveType+": ,进出轴开始原点返回");
ACAxisHomeMove(Config.InOut_Axis);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
}
......@@ -287,13 +263,13 @@ namespace OnlineStore.DeviceLibrary
case StoreMoveStep.BOX_H_InOutMove:
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_InOutBack);
ACAxisHomeMove(Config.InOut_Axis);
LogInfo( "复位中:进出轴开始原点返回");
LogInfo(MoveInfo.MoveType + ": 进出轴开始原点返回");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
break;
case StoreMoveStep.BOX_H_InOutBack:
Thread.Sleep(200);
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_InOutToP1);
LogInfo( "复位中:进出轴到待机点P1,关闭舱门");
LogInfo(MoveInfo.MoveType + ": 进出轴到待机点P1,关闭舱门");
//进出轴原点返回完成,将进出轴的位置设置=0
AxisCountClear(Config.InOut_Axis);
ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed);
......@@ -305,28 +281,26 @@ namespace OnlineStore.DeviceLibrary
//如果此时轴三还在报警,需要提示错误并等待
if (ACServerManager.GetAlarmStatus(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue()) > 0)
{
LogUtil.error(Name+ "进出轴报警!复位失败,请检查!");
LogUtil.error(Name + MoveInfo.MoveType + "进出轴报警!复位失败,请检查!");
}
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
LogInfo( "复位中: 压紧轴,旋转轴,上下轴开始 原点返回");
LogInfo(MoveInfo.MoveType + ": 压紧轴,旋转轴,上下轴开始 原点返回");
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_OtherAxisBack);
ACAxisHomeMove(Config.Comp_Axis);
ACAxisHomeMove(Config.Middle_Axis);
ACAxisHomeMove(Config.UpDown_Axis);
break;
case StoreMoveStep.BOX_H_OtherAxisBack:
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_MiddleAxisToP1);
LogInfo( "复位中:旋转轴运动到P1,上下轴走到P1,压紧轴到P1!");
LogInfo(MoveInfo.MoveType + ": 旋转轴运动到P1,上下轴走到P1,压紧轴到P1!");
ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_DoorOPosition_P1, Config.UpDownAxis_P1_Speed);
ComMoveToPosition(Config.CompressAxis_P1_Position, Config.CompAxis_P1_Speed);
break;
case StoreMoveStep.BOX_H_MiddleAxisToP1:
LogInfo( "复位完成");
LogInfo(MoveInfo.MoveType + ": 完成");
storeRunStatus = StoreRunStatus.Runing;
MoveInfo.EndMove();
storeStatus = StoreStatus.StoreOnline;
......@@ -338,22 +312,20 @@ namespace OnlineStore.DeviceLibrary
case StoreMoveStep.BOX_M_H_TOP1_InOutToP1:
MoveInfo.NextMoveStep(StoreMoveStep.BOX_M_H_TOP1_CompressHome);
LogInfo( "到待机状态,压紧轴回原点,关闭舱门");
LogInfo("到待机状态,压紧轴回原点,关闭舱门");
ACAxisHomeMove(Config.Comp_Axis);
//关闭舱门
CloseDoor();
break;
case StoreMoveStep.BOX_M_H_TOP1_CompressHome:
MoveInfo.NextMoveStep(StoreMoveStep.BOX_M_H_TOP1_OtherAxisToP1);
LogInfo( "复位中:旋转轴运动到P1,上下轴走到P1,压紧轴到P1!");
LogInfo(MoveInfo.MoveType + ": 旋转轴运动到P1,上下轴走到P1,压紧轴到P1!");
ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_DoorOPosition_P1, Config.UpDownAxis_P1_Speed);
ComMoveToPosition(Config.CompressAxis_P1_Position, Config.CompAxis_P1_Speed);
break;
case StoreMoveStep.BOX_M_H_TOP1_OtherAxisToP1:
LogInfo( "到待机状态完成");
LogInfo("到待机状态完成");
MoveInfo.EndMove();
storeStatus = StoreStatus.StoreOnline;
storeRunStatus = StoreRunStatus.Runing;
......@@ -368,31 +340,14 @@ namespace OnlineStore.DeviceLibrary
}
private void ComMoveToPosition(int targetPosition, int targetSpeed)
{
ACAxisMove(Config.Comp_Axis, targetPosition, targetSpeed);
{
ACAxisMove(Config.Comp_Axis, targetPosition, targetSpeed);
}
public void OpenDoor(bool IsWait = true)
{
//Thread.Sleep(60);
//IOMove(IO_Type.Door_Down, IO_VALUE.LOW);
//IOMove(IO_Type.Door_Up, IO_VALUE.HIGH);
//if (IsWait)
//{
// MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Door_Down, IO_VALUE.LOW));
// MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Door_Up, IO_VALUE.HIGH));
//}
{
}
public void CloseDoor(bool IsWait = true)
{
//IOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
//IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
//if (IsWait)
//{
// MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Door_Down, IO_VALUE.HIGH));
// MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Door_Up, IO_VALUE.LOW));
//}
{
}
/// <summary>
......@@ -400,69 +355,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
protected override void ReturnHomeProcess()
{
if (MoveInfo.IsInWait)
{
CheckWait();
}
if (MoveInfo.IsInWait)
{
return;
}
switch (MoveInfo.MoveStep)
{
case StoreMoveStep.BOX_H_LocationCylinderBack:
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_InOutBack);
LogInfo( "原点返回中,进出轴回原点");
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
ACAxisHomeMove(Config.InOut_Axis);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
break;
case StoreMoveStep.BOX_H_InOutBack:
Thread.Sleep(200);
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_InOutToP1);
LogInfo( "原点返回中,进出轴退回P1点,关闭仓门,检测叉子没有料盘");
//进出轴原点返回完成,将进出轴的位置设置=0
AxisCountClear(Config.InOut_Axis);
ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed);
//ComBeforeHomeMove();
//判断叉子没有料盘
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
CloseDoor();
break;
case StoreMoveStep.BOX_H_InOutToP1:
//如果此时轴三还在报警,需要提示错误并等待
if (ACServerManager.GetAlarmStatus(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue()) > 0)
{
WarnMsg = "进出轴报警!复位失败,请检查!";
LogUtil.error(Name+ "进出轴报警!复位失败,请检查!");
}
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
LogInfo( "原点返回中 :压紧轴,旋转轴,上下轴开始原点返回");
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_OtherAxisBack);
ACAxisHomeMove(Config.Comp_Axis);
ACAxisHomeMove(Config.Middle_Axis);
ACAxisHomeMove(Config.UpDown_Axis);
break;
case StoreMoveStep.BOX_H_OtherAxisBack:
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_MiddleAxisToP1);
LogInfo( "回原点:旋转轴运动到P1,上下轴到P1,压紧轴到P1!");
ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_DoorOPosition_P1, Config.UpDownAxis_P1_Speed);
ComMoveToPosition(Config.CompressAxis_P1_Position, Config.CompAxis_P1_Speed);
break;
case StoreMoveStep.BOX_H_MiddleAxisToP1:
LogInfo( "回原点完成");
storeRunStatus = StoreRunStatus.Runing;
MoveInfo.EndMove();
storeStatus = StoreStatus.StoreOnline;
WarnMsg = "";
break;
default: break;
}
ResetProcess();
}
#endregion
......@@ -512,26 +405,26 @@ namespace OnlineStore.DeviceLibrary
{
if (ACServerManager.ServerOnStatus(axis.DeviceName, axis.GetAxisValue()))
{
LogInfo( "成功打开轴:" + axis.Explain);
LogInfo("成功打开轴:" + axis.Explain);
}
else
{
//清理报警,再重新打开一次
LogInfo( "第一次打开轴" + axis.Explain + "失败,先清理一下报警,再重新打开一次");
LogInfo("第一次打开轴" + axis.Explain + "失败,先清理一下报警,再重新打开一次");
ACServerManager.AlarmClear(axis.DeviceName, axis.GetAxisValue());
System.Threading.Thread.Sleep(1200);
ACServerManager.ServoOn(axis.DeviceName, axis.GetAxisValue());
System.Threading.Thread.Sleep(100);
if (ACServerManager.ServerOnStatus(axis.DeviceName, axis.GetAxisValue()))
{
LogInfo( "清理报警后重新打卡轴成功:" + axis.Explain);
LogInfo("清理报警后重新打卡轴成功:" + axis.Explain);
}
else
{
ACServerManager.ServoOff(axis.DeviceName, axis.GetAxisValue());
int alarmCode = GetAlarmCodeByAxis(axis);
WarnMsg = Name + "打开轴" + axis.Explain + "失败 ";
LogInfo( WarnMsg);
LogInfo(WarnMsg);
Alarm(StoreAlarmType.AxisAlarm, GetAlarmCodeByAxis(axis).ToString(), WarnMsg, MoveInfo.MoveType);
return false;
}
......@@ -548,23 +441,23 @@ namespace OnlineStore.DeviceLibrary
{
ACServerManager.ServoOff(axis.DeviceName, axis.GetAxisValue());
//关闭串口,等下次重新打开
// ACServerManager.ColsePort(axis.DeviceName);
// ACServerManager.ColsePort(axis.DeviceName);
}
Thread.Sleep(100);
IOMove(IO_Type.Run_Signal, IO_VALUE.LOW);
}
/// <summary>
/// 停止运行
/// </summary>
public override void StopRun()
{
WarnMsg = "";
autoNext = false;
AutoInout.autoNext = false;
IoCheckTimer.Enabled = false;
serverConnectTimer.Enabled = false;
StopMove( );
StopMove();
storeRunStatus = StoreRunStatus.Wait;
mainTimer.Enabled = false;
......@@ -573,44 +466,44 @@ namespace OnlineStore.DeviceLibrary
//LineConnect.StopConnect();
IOManager.instance.CloseAllDO();
LogInfo( ",停止运行,总运行时间:" + span.ToString());
LogInfo(",停止运行,总运行时间:" + span.ToString());
}
public override void Alarm(StoreAlarmType alarmType, string alarmDetial, string alarmMsg, StoreMoveType storeMoveType)
{
SaveAlarmInfo(alarmType, alarmDetial, alarmMsg, storeMoveType);
autoNext = false;
AutoInout.autoNext = false;
if (this.alarmType.Equals(alarmType) && alarmType != StoreAlarmType.SuddenStop && alarmType != StoreAlarmType.NoAirCheck)
{
return;
}
LogUtil.error( Name + " 报警,报警类型:" + alarmType);
LogUtil.error(Name + " 报警,报警类型:" + alarmType);
this.alarmType = alarmType;
if (alarmType.Equals(StoreAlarmType.AxisAlarm) | alarmType.Equals(StoreAlarmType.AxisMoveError))
{
LogUtil.error( Name + "轴报警,关闭刹车,停止运动,关闭轴,打开报警灯");
LogUtil.error(Name + "轴报警,关闭刹车,停止运动,关闭轴,打开报警灯");
IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
StopMove( );
StopMove();
}
else if (alarmType == StoreAlarmType.SuddenStop)
{
isInSuddenDown = true;
LogUtil.error( Name + "收到急停信号,关闭刹车,停止运动,关闭轴,打开报警灯 ");
LogUtil.error(Name + "收到急停信号,关闭刹车,停止运动,关闭轴,打开报警灯 ");
IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
MoveInfo.EndMove();
StopMove( );
StopMove();
storeStatus = StoreStatus.SuddenStop;
}
else if (alarmType.Equals(StoreAlarmType.NoAirCheck))
{
isNoAirCheck = true;
LogUtil.error( Name + " 未检测到气压信号 ,打开刹车,停止运动,关闭轴,打开报警灯 ");
LogUtil.error(Name + " 未检测到气压信号 ,打开刹车,停止运动,关闭轴,打开报警灯 ");
IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
MoveInfo.EndMove();
StopMove( );
StopMove();
storeStatus = StoreStatus.SuddenStop;
}
}
......@@ -660,7 +553,7 @@ namespace OnlineStore.DeviceLibrary
private IO_VALUE preAirValue = IO_VALUE.HIGH;
private void AirCheckProcess()
{
IO_VALUE currAirValue = IOValue(IO_Type.Airpressure_Check);
if (isInSuddenDown)
{
......@@ -704,8 +597,8 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info("【" + info + "】 处理完成,耗时:" + stopwatch.Elapsed.ToString());
}
}
private IO_VALUE lastAutoRun = IO_VALUE.LOW;
private IO_VALUE lastAutoRun = IO_VALUE.LOW;
public void IoCheckProcess()
{
DateTime time = DateTime.Now;
......@@ -718,11 +611,11 @@ namespace OnlineStore.DeviceLibrary
if (autoSingle.Equals(IO_VALUE.HIGH) && lastAutoRun.Equals(IO_VALUE.LOW))
{
//没有启动时收到复位按钮,相当于启动按钮
LogInfo( "没有启动时收到复位按钮,相当于启动按钮,开始调用启动方法!");
LogInfo("没有启动时收到复位按钮,相当于启动按钮,开始调用启动方法!");
bool result = StartRun();
if (result.Equals(false))
{
LogUtil.error(Name+"料仓启动失败,继续等待下次启动!");
LogUtil.error(Name + "料仓启动失败,继续等待下次启动!");
mainTimer.Enabled = true;
}
}
......@@ -750,20 +643,20 @@ namespace OnlineStore.DeviceLibrary
{
if (MoveInfo.MoveType.Equals(StoreMoveType.None))
{
LogUtil.info( Name+"收到复位信号,当前无报警,且空闲中,只回到待机点");
LogUtil.info(Name + "收到复位信号,当前无报警,且空闲中,只回到待机点");
MoveToP1();
}
else
{
LogUtil.info(Name+ "收到复位信号,当前无报警, 在" + MoveInfo.MoveType + "处理中,不处理复位");
LogUtil.info(Name + "收到复位信号,当前无报警, 在" + MoveInfo.MoveType + "处理中,不处理复位");
}
}
else
{
//收到复位信号
LogUtil.info( "收到复位信号,自动复位");
LogUtil.info("收到复位信号,自动复位");
WarnMsg = "收到复位信号,自动复位";
Reset();
Reset();
}
}
}
......@@ -782,22 +675,19 @@ namespace OnlineStore.DeviceLibrary
}
else if (storeRunStatus.Equals(StoreRunStatus.Runing))
{
ShowTimeLog("判断是否需要出入库");
AutoResetProcess();
ShowTimeLog("AutoResetProcess");
IOTimeOutProcess();
ShowTimeLog("IOTimeOutProcess");
}
}
catch (Exception ex)
{
LogUtil.error(Name + "定时处理出错"+ ex.ToString());
LogUtil.error(Name + "定时处理出错" + ex.ToString());
}
}
private DateTime preIoTimerOutTime = DateTime.Now;
/// <summary>
/// io检测异常
......@@ -822,7 +712,6 @@ namespace OnlineStore.DeviceLibrary
{
return;
}
//若BOX和移栽都没有在等待Io的过程中则此Io超时异常可能已经处理过
if (MoveInfo.IsInWait == false)
{
......@@ -834,7 +723,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error(Name+ "IOTimeOutProcess出错:" + ex.ToString());
LogUtil.error(Name + "IOTimeOutProcess出错:" + ex.ToString());
}
}
......@@ -845,59 +734,59 @@ namespace OnlineStore.DeviceLibrary
{
try
{
// bool noInStore = LineConnect.WaitInStoreList.Count <= 0;
// bool noInStore = LineConnect.WaitInStoreList.Count <= 0;
bool noInStore = true;
if (CurrInOutACount >= this.Config.Box_ResetACount &&noInStore)
if (AutoInout.CurrInOutACount >= this.Config.Box_ResetACount && noInStore)
{
if (storeRunStatus < StoreRunStatus.Runing || MoveInfo.MoveType == StoreMoveType.InStore || MoveInfo.MoveType == StoreMoveType.OutStore)
{
LogInfo( "已经累计出入库" + CurrInOutACount + "次,当时当前正在忙碌中暂不复位");
LogInfo("已经累计出入库" + AutoInout.CurrInOutACount + "次,当时当前正在忙碌中暂不复位");
}
else
{
LogInfo( "已经累计出入库" + CurrInOutACount + "次,需要复位一下");
LogInfo("已经累计出入库" + AutoInout.CurrInOutACount + "次,需要复位一下");
Reset();
}
}
else if (CurrInOutCount >= this.Config.Box_ResetMCount && noInStore)
{
if (storeRunStatus < StoreRunStatus.Runing || MoveInfo.MoveType == StoreMoveType.InStore || MoveInfo.MoveType == StoreMoveType.OutStore)
{
LogInfo( "已经累计出入库" + CurrInOutCount + "次,当时当前正在忙碌中暂不复位旋转轴");
}
else
{
LogInfo( "已经累计出入库" + CurrInOutCount + "次,需要复位一下旋转轴");
}
}
//else if (AutoInout.CurrInOutCount >= this.Config.Box_ResetMCount && noInStore)
//{
// if (storeRunStatus < StoreRunStatus.Runing || MoveInfo.MoveType == StoreMoveType.InStore || MoveInfo.MoveType == StoreMoveType.OutStore)
// {
// LogInfo( "已经累计出入库" + AutoInout.CurrInOutCount + "次,当时当前正在忙碌中暂不复位旋转轴");
// }
// else
// {
// LogInfo( "已经累计出入库" + AutoInout.CurrInOutCount + "次,需要复位一下旋转轴");
// }
//}
//else if (LineConnect.CanStartOut() || IsDebug)
else if ( IsDebug)
else
{
FixtureCodeInfo currInOutFixture = null;
InOutParam param = null;
lock (waitOutListLock)
{
if (waitOutStoreList.Count > 0 && CanStarInOut())
{
currInOutFixture = waitOutStoreList[0];
param = waitOutStoreList[0];
waitOutStoreList.RemoveAt(0);
}
}
if (currInOutFixture != null)
if (param != null)
{ //出库
LogInfo( "开始执行排队中的出库【" + currInOutFixture.ToStr() + "】");
bool result = StartOutStoreMove(new InOutParam("", currInOutFixture.PosId, currInOutFixture.plateH, currInOutFixture.plateW));
LogInfo("开始执行排队中的出库【" + param.ToStr() + "】");
bool result = StartOutStoreMove(new InOutParam(param.WareCode, param.PosID, param.PlateH, param.PlateW, param.ShelfPosID));
if (!result)
{
LogInfo( " 执行排队中的出库【" + currInOutFixture.ToStr() + "】失败,重新加入等待队列");
AddWaitOutInfo(currInOutFixture);
LogInfo(" 执行排队中的出库【" + param.ToStr() + "】失败,重新加入等待队列");
AddWaitOutInfo(param);
}
}
}
}
catch (Exception ex)
{
LogUtil.error(Name+ "处理出入库排队列表出错:" + ex.ToString());
LogUtil.error(Name + "处理出入库排队列表出错:" + ex.ToString());
}
}
......@@ -951,7 +840,7 @@ namespace OnlineStore.DeviceLibrary
{
if (!info.AlarmIoValue.Equals(alarmIo))
{
LogUtil.error( Name + " 运动轴 " + axisInfo.Explain + ",报警已解除!");
LogUtil.error(Name + " 运动轴 " + axisInfo.Explain + ",报警已解除!");
info.AlarmIoValue = alarmIo;
}
}
......@@ -964,7 +853,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 停止所有运行
/// </summary>
public override void StopMove( )
public override void StopMove()
{
IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
......@@ -972,16 +861,9 @@ namespace OnlineStore.DeviceLibrary
ACServerManager.SuddenStop(Config.Middle_Axis.DeviceName, Config.Middle_Axis.GetAxisValue());
ACServerManager.SuddenStop(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue());
ACServerManager.SuddenStop(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue());
ACServerManager.SuddenStop(Config.Comp_Axis.DeviceName, Config.Comp_Axis.GetAxisValue());
CloseAllAxis();
LogInfo( "StopMove");
//IOMove(IO_Type.Door_Down, IO_VALUE.LOW);
//IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
ACServerManager.SuddenStop(Config.Comp_Axis.DeviceName, Config.Comp_Axis.GetAxisValue());
CloseAllAxis();
LogInfo("StopMove");
isInPro = false;
}
......@@ -1019,8 +901,8 @@ namespace OnlineStore.DeviceLibrary
if (!(posArray.Length == 2))
{
WarnMsg = Name + "入库库位格式错误:二维码【" + message + "】库位【" + posId + "】";
LogUtil.error(Name+ "服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
LogUtil.info( "服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
LogUtil.error(Name + "服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
LogUtil.info("服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
return;
}
......@@ -1031,7 +913,7 @@ namespace OnlineStore.DeviceLibrary
{ //出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg = "入库未找到库位:二维码【" + message + "】库位【" + posId + "】 ";
LogUtil.error(Name + "收到服务器入库命令:入库未找到库位:二维码【" + message + "】库位【" + posId + "】");
LogUtil.info( "收到服务器入库命令:入库未找到库位:二维码【" + message + "】库位【" + posId + "】");
LogUtil.info("收到服务器入库命令:入库未找到库位:二维码【" + message + "】库位【" + posId + "】");
return;
}
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
......@@ -1040,11 +922,11 @@ namespace OnlineStore.DeviceLibrary
InOutParam param = new InOutParam(message, posId, plateH, plateW);
StartInStoreMove(param);
//如果当前正在出入库中,需要记录下来,等待空闲时执行
LogInfo( " 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 开始入库!");
LogInfo(" 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 开始入库!");
}
else
{
LogInfo( " 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 正在忙碌中,无法入库!");
LogInfo(" 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 正在忙碌中,无法入库!");
}
}
......@@ -1053,17 +935,16 @@ namespace OnlineStore.DeviceLibrary
public bool ReviceLineCheckInStoreCMD(string posId, string plateH, string plateW, string message)
{
string logName =Name+ "入库库位验证【 " + message + "】【" + posId + "】:";
string logName = Name + "入库库位验证【 " + message + "】【" + posId + "】:";
try
{
if (storeRunStatus.Equals(StoreRunStatus.Wait))
{
LogUtil.info( logName+ " 设备未启动,验证失败");
LogUtil.info(logName + " 设备未启动,验证失败");
return false;
}
// CodeMsg = "收到二维码【 " + message + "】,发送给服务器获取入库PosID";
LogUtil.debug( logName+"发送给服务器验证入库PosID");
LogUtil.debug(logName + "发送给服务器验证入库PosID");
//发送扫码内容到服务器进行入库操作
Operation operation = getLineBoxStatus();
operation.op = 1;
......@@ -1074,23 +955,23 @@ namespace OnlineStore.DeviceLibrary
if (resultOperation == null)
{
// CodeMsg = "二维码【" + message + "】没有收到服务器反馈";
LogUtil.info( logName + " 没有收到服务器反馈 ");
LogUtil.info(logName + " 没有收到服务器反馈 ");
}
else if (!string.IsNullOrEmpty(resultOperation.msg))
{
//如果有提示消息,直接显示提示
LogUtil.info( logName + "服务器反馈 :" + resultOperation.msg);
LogUtil.info(logName + "服务器反馈 :" + resultOperation.msg);
}
else if (resultOperation.op.Equals(1))
{
LogUtil.info( logName + " 成功");
LogUtil.info(logName + " 成功");
return true;
}
}
catch (Exception ex)
{
LogUtil.info( logName + " 出错:" + ex.ToString());
LogUtil.info(logName + " 出错:" + ex.ToString());
}
return false;
......@@ -1132,7 +1013,7 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil.info(logName + " 正在忙碌中,无法入库!");
}
}
}
#endregion
......@@ -1174,7 +1055,7 @@ namespace OnlineStore.DeviceLibrary
{
humidity = param.Humidity;
temp = param.Temperate;
currTempStr =Name+ ("当前湿度:" + humidity.ToString() + ",当前温度:" + temp);
currTempStr = Name + ("当前湿度:" + humidity.ToString() + ",当前温度:" + temp);
}
//double currMaxHumidity = HumitureServer.GetMaxHumidity(Config.GetTempAddrList());
double currMaxHumidity = param.Humidity;
......@@ -1268,7 +1149,7 @@ namespace OnlineStore.DeviceLibrary
#endregion
#region 与服务器通信定时器,每1秒向服务器通知一次状态,同时执行出库操作
private string CodeMsg = "";
private bool isInProcess = false;
public void server_connect_timer_Tick(object sender, EventArgs e)
......@@ -1276,10 +1157,10 @@ namespace OnlineStore.DeviceLibrary
if (isInProcess)
{
return;
}
}
isInProcess = true;
try
{
{
if (StoreManager.IsConnectServer)
{
try
......@@ -1288,15 +1169,16 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error (Name + "定时给服务器发送消息出错:"+ ex.ToString());
LogUtil.error(Name + "定时给服务器发送消息出错:" + ex.ToString());
}
}
HumitureController.QueryData();
HumidityProcess();
}catch(Exception ex)
HumidityProcess();
}
catch (Exception ex)
{
LogUtil.error(Name + "server_connect_timer_Tick出错:" +ex.ToString());
LogUtil.error(Name + "server_connect_timer_Tick出错:" + ex.ToString());
}
isInProcess = false;
}
......@@ -1326,7 +1208,7 @@ namespace OnlineStore.DeviceLibrary
BoxStatus boxStatus = new BoxStatus();
boxStatus.boxId = 1;
boxStatus.msg = WarnMsg;
lineOperation.msg = WarnMsg;
......@@ -1361,10 +1243,10 @@ namespace OnlineStore.DeviceLibrary
boxStatus.status = (int)lastPosIdStatus;
if (lastPosId != "")
{
LogUtil.info( "给服务器发送出入库完成消息:" + Name + ",status【" + lastPosIdStatus + "】posId【" + lastPosId + "】");
LogUtil.info("给服务器发送出入库完成消息:" + Name + ",status【" + lastPosIdStatus + "】posId【" + lastPosId + "】");
}
lastPosId = "";
}
}
//温湿度
//ASTemperateParam param = HumitureServer.GetTemperateParam(Config.Temperate_Serveraddress);
......@@ -1392,11 +1274,11 @@ namespace OnlineStore.DeviceLibrary
if (Max_Humidity <= 0 || (Max_Temperature <= 0))
{
lineOperation.op = 5;
LogInfo( "没有湿度预警范围,需要从服务器获取,发送OP=" + lineOperation.op);
LogInfo("没有湿度预警范围,需要从服务器获取,发送OP=" + lineOperation.op);
}
string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
Operation resultOperation = HttpHelper.Post(StoreManager.GetPostApi(server), lineOperation, false);
//发送状态信息到服务器
if (resultOperation == null || (resultOperation.op <= 0))
{
......@@ -1432,13 +1314,13 @@ namespace OnlineStore.DeviceLibrary
{
string maxHumidity = data[ParamDefine.maxHumidity];
string maxTemp = data[ParamDefine.maxTemperature];
LogUtil.info( "收到服务器温湿度预警值:maxHumidity=" + maxHumidity + ",maxTemperature=" + maxTemp);
LogUtil.info("收到服务器温湿度预警值:maxHumidity=" + maxHumidity + ",maxTemperature=" + maxTemp);
try
{
this.Max_Humidity = (float)Convert.ToDouble(maxHumidity);
this.Max_Temperature = (float)Convert.ToDouble(maxTemp);
LogUtil.info( "保存温湿度预警值:Max_Humidity=" + Max_Humidity + ",Max_Temperature=" + Max_Temperature);
LogUtil.info("保存温湿度预警值:Max_Humidity=" + Max_Humidity + ",Max_Temperature=" + Max_Temperature);
}
catch (Exception ex)
{
......@@ -1447,7 +1329,8 @@ namespace OnlineStore.DeviceLibrary
}
}
private void ReviceOutStoreProcess(Operation resultOperation) {
private void ReviceOutStoreProcess(Operation resultOperation)
{
DateTime time = DateTime.Now;
Dictionary<string, string> data = resultOperation.data;
if (data != null && data.ContainsKey(ParamDefine.posId)
......@@ -1457,7 +1340,7 @@ namespace OnlineStore.DeviceLibrary
string plateWStr = data[ParamDefine.plateW];
string plateHStr = data[ParamDefine.plateH];
LogUtil.info( "收到服务器出库消息:poaIs=" + posIdStr + ",platew=" + plateWStr + ",plateh=" + plateHStr);
LogUtil.info("收到服务器出库消息:poaIs=" + posIdStr + ",platew=" + plateWStr + ",plateh=" + plateHStr);
char splitChar = '|';
string[] posIdArray = posIdStr.Split(splitChar);
string[] plateWArray = plateWStr.Split(splitChar);
......@@ -1472,7 +1355,7 @@ namespace OnlineStore.DeviceLibrary
if (posArray.Length != 2)
{
WarnMsg = Name + "出库格式错误:库位号【" + posId + "】";
LogUtil.error(Name+ "收到服务器出库命令:库位号【" + posId + "】格式错误");
LogUtil.error(Name + "收到服务器出库命令:库位号【" + posId + "】格式错误");
continue;
}
int storeId = int.Parse(posArray[0]);
......@@ -1483,50 +1366,51 @@ namespace OnlineStore.DeviceLibrary
{
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg = Name + "出库未找库位:【" + posId + "】";
LogUtil.error(Name+ "收到服务器出库命令:未找到【" + posId + "】的库位信息");
LogUtil.error(Name + "收到服务器出库命令:未找到【" + posId + "】的库位信息");
continue;
}
else
{
FixtureCodeInfo currInOutFixture = new FixtureCodeInfo(0, "", posId, plateW, plateH);
InOutParam currInOutFixture = new InOutParam("", posId, plateW, plateH);
try
{
//判断是否接收过此库位的出库信息
if (MoveInfo.MoveType.Equals(StoreMoveType.OutStore) && MoveInfo.MoveParam.PositionNum.Equals(posId))
if (MoveInfo.MoveType.Equals(StoreMoveType.OutStore) && MoveInfo.MoveParam.PosID.Equals(posId))
{
LogInfo( " 收到出库【" + currInOutFixture.ToStr() + "】重复,当前已在【" + posId + "】出库中");
LogInfo(" 收到出库【" + currInOutFixture.ToStr() + "】重复,当前已在【" + posId + "】出库中");
continue;
}
else
{
//判断排队列表中是否已存在
List<FixtureCodeInfo> reviceList = new List<FixtureCodeInfo>(waitOutStoreList);
reviceList = (from m in reviceList where m.PosId.Equals(posId) select m).ToList<FixtureCodeInfo>();
List<InOutParam> reviceList = new List<InOutParam>(waitOutStoreList);
reviceList = (from m in reviceList where m.PosID.Equals(posId) select m).ToList<InOutParam>();
if (reviceList.Count > 0)
{
LogInfo( " 收到出库【" + currInOutFixture.ToStr() + "】重复,排队列表中已存在【" + reviceList[0].ToStr() + "】");
LogInfo(" 收到出库【" + currInOutFixture.ToStr() + "】重复,排队列表中已存在【" + reviceList[0].ToStr() + "】");
continue;
}
}
}catch(Exception ex)
}
catch (Exception ex)
{
LogUtil.error("验证出库【" + currInOutFixture.ToStr() + "】是否重复出错:"+ex.ToString());
LogUtil.error("验证出库【" + currInOutFixture.ToStr() + "】是否重复出错:" + ex.ToString());
}
if (CanStarInOut() )
//if (CanStarInOut() &&( LineConnect.CanStartOut()||IsDebug))
if (CanStarInOut())
//if (CanStarInOut() &&( LineConnect.CanStartOut()||IsDebug))
{
bool result = StartOutStoreMove(new InOutParam("", posId, plateW,plateH));
bool result = StartOutStoreMove(new InOutParam("", posId, plateW, plateH));
if (!result)
{
LogInfo( " 执行出库【" + currInOutFixture.ToStr() + "】失败,加入等待队列");
LogInfo(" 执行出库【" + currInOutFixture.ToStr() + "】失败,加入等待队列");
AddWaitOutInfo(currInOutFixture);
}
}
else
{
LogUtil.error(Name+ "执行出库【" + currInOutFixture.ToStr() + "】失败,当前在忙碌中,加入等待队列");
LogUtil.error(Name + "执行出库【" + currInOutFixture.ToStr() + "】失败,当前在忙碌中,加入等待队列");
AddWaitOutInfo(currInOutFixture);
}
}
......@@ -1541,7 +1425,7 @@ namespace OnlineStore.DeviceLibrary
}
#endregion
}
}
\ No newline at end of file
......@@ -11,79 +11,6 @@ namespace OnlineStore.DeviceLibrary
partial class AC_BOX_Bean
{
#region 自动出入库参数
/// <summary>
/// 入库完成后自动出库,出库完成后自动入库
/// </summary>
public bool autoNext = false;
/// <summary>
/// 自动出入库间隔
/// </summary>
public int autoJiange = 3;
public int autoPositionIndex = 0;
public string autoMsg = "";
public int AutoStartIndex = -1;
#endregion
#region 出入库参数
/// <summary>
/// 当前出入库的次数,超过配置的数量时,需要自动重置一下,再进行出入库
/// </summary>
private int CurrInOutCount = 0;
private int CurrInOutACount = 0;
private bool LoadParamPosition(InOutParam param)
{
if (param == null)
{
return false;
}
//加载位置
if (param.MoveP == null)
{
LineMoveP p = new LineMoveP();
ACBoxPosition position = param.GetACPosition();
if (position == null)
{
LogUtil.error(Name + "出入库时发现param中取到的Position=null,没有库位不能执行出入库");
return false;
}
p.ComPress_P1 = Config.CompressAxis_P1_Position;
p.InOut_P1 = Config.InOutAxis_P1_Position;
p.Middle_P1 = Config.MiddleAxis_P1_Position;
p.InOut_P2 = position.InOutAxis_DoorPosition_P2;
p.UpDown_P1 = Config.UpDownAxis_DoorOPosition_P1;
p.UpDown_P8 = Config.UpDownAxis_DoorIBPosition_P8;
p.UpDown_P2 = Config.UpDownAxis_DoorIPosition_P2;
p.UpDown_P7 = Config.UpDownAxis_DoorOBPosition_P7;
p.ComPress_P2 = position.CompressAxis_Position_P2;
p.ComPress_P3 = position.CompressAxis_CPosition_P3;
p.InOut_P3 = position.InOutAxis_Position_P3;
p.Middle_P2 = position.MiddleAxis_Position_P2;
p.UpDown_P3 = position.UpDownAxis_IHPosition_P3;
p.UpDown_P4 = position.UpDownAxis_ILPosition_P4;
p.UpDown_P5 = position.UpDownAxis_OHPosition_P5;
p.UpDown_P6 = position.UpDownAxis_OLPosition_P6;
param.MoveP = p;
if (String.IsNullOrEmpty(param.PlateH))
{
param.PlateH = position.BagHigh.ToString();
}
if (string.IsNullOrEmpty(param.PlateW))
{
param.PlateW = position.BagWidth.ToString();
}
return true;
}
return true;
}
#endregion
#region 出入库结果验证
private void InOutBackToP1(int InOut_P1)
{
......@@ -227,10 +154,10 @@ namespace OnlineStore.DeviceLibrary
public override void StartInStoreMove(InOutParam param)
{
startInStoreTime = DateTime.Now;
string posId = param != null ? param.PositionNum : "";
string posId = param != null ? param.PosID : "";
if (storeRunStatus == StoreRunStatus.Runing)
{
if (!LoadParamPosition(param))
if (!StoreManager.LoadInoutParam(param,this))
{
LogUtil.error(Name + " 启动入库【" + posId + "】出错,找不到库位信息");
return;
......@@ -279,10 +206,8 @@ namespace OnlineStore.DeviceLibrary
return;
}
if (MoveInfo.MoveStep == StoreMoveStep.SI_00_TrayCheck)
{
SI_02_Move(moveP);
{
SI_02_Move(moveP);
}
if (MoveInfo.MoveStep == StoreMoveStep.SI_01_LocationCylinderDown)
{
......@@ -298,11 +223,9 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.MoveStep == StoreMoveStep.SI_03_ReturnHome)
{
InStoreLog("入库:SI_04_CompressWare 压紧物品(有压紧轴的才需要此步骤),压紧轴至P3(压紧前点) 开始");
MoveInfo.NextMoveStep(StoreMoveStep.SI_04_CompressWare);
ComMoveToPosition(moveP.ComPress_P3, Config.CompAxis_P3_Speed);
}
else if (MoveInfo.MoveStep == StoreMoveStep.SI_04_CompressWare)
{
......@@ -325,49 +248,37 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.MoveStep == StoreMoveStep.SI_07_DeviceBackFromDoor)
{
InStoreLog("入库:SI_09 移动到库位点,旋转轴至P2(库位点),升降轴至P3(库位入库前点) ");
MoveInfo.NextMoveStep(StoreMoveStep.SI_09_MoveToBag);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P2, Config.MiddleAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P3, Config.UpDownAxis_P3_Speed);
//关闭舱门
//IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
//IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P3, Config.UpDownAxis_P3_Speed);
CloseDoor(false);
}
else if (MoveInfo.MoveStep == StoreMoveStep.SI_08_LocationCylinder_Up)
{
InStoreLog("入库:SI_09 移动到库位点,旋转轴至P2(库位点),升降轴至P3(库位入库前点)),关闭舱门 ");
MoveInfo.NextMoveStep(StoreMoveStep.SI_09_MoveToBag);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P2, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P3, Config.UpDownAxis_P3_Speed);
//关闭舱门
//IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
//IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P3, Config.UpDownAxis_P3_Speed);
CloseDoor(false);
}
else if (MoveInfo.MoveStep == StoreMoveStep.SI_09_MoveToBag)
{
InStoreLog("入库:SI_11 叉子进入库位中,进出轴至P3(库位取放料点) ");
MoveInfo.NextMoveStep(StoreMoveStep.SI_11_DeviceToBag);
ACAxisMove(Config.InOut_Axis, moveP.InOut_P3, Config.InOutAxis_P3_Speed);
}
else if (MoveInfo.MoveStep == StoreMoveStep.SI_10_LocationCylinder_Down)
{
//IOManager.IOMove(IO_Type.LocationCylinder_Down, IO_VALUE.LOW);
{
InStoreLog("入库:SI_11 叉子进入库位中,进出轴至P3(库位取放料点) ");
MoveInfo.NextMoveStep(StoreMoveStep.SI_11_DeviceToBag);
ACAxisMove(Config.InOut_Axis, moveP.InOut_P3, Config.InOutAxis_P3_Speed);
}
else if (MoveInfo.MoveStep == StoreMoveStep.SI_11_DeviceToBag)
{
InStoreLog("入库:SI_12 放下物品,升降轴至P4(库位入料缓冲点),压紧轴至P3(压紧前点) ");
// 5= 入仓位完成(料仓Box把料盘放入对应的库位中,装置还未恢复原始状态)
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PositionNum : "";
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : "";
lastPosId = posId;
lastPosIdStatus = StoreStatus.InStoreEnd;
storeStatus = StoreStatus.InStoreEnd;
......@@ -381,8 +292,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.MoveStep == StoreMoveStep.SI_12_PutWareToBag)
{
InStoreLog("入库:SI_13 叉子从库位中返回,进出轴动作至P1(待机点) ");
InStoreLog("入库:SI_13 叉子从库位中返回,进出轴动作至P1(待机点) ");
MoveInfo.NextMoveStep(StoreMoveStep.SI_13_DeviceBackFromBag);
InOutBackToP1(moveP.InOut_P1);
}
......@@ -398,17 +308,17 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep == StoreMoveStep.SI_14_GoBack)
{
TimeSpan span = DateTime.Now - startInStoreTime;
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PositionNum : "";
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : "";
LogInfo(" 【" + posId + "】 整个入库流程结束,耗时【" + FormUtil.GetSpanStr(span) + "】!");
MoveInfo.EndMove();
storeRunStatus = StoreRunStatus.Runing;
//设备连接,入库后,BOX恢复原始状态
storeStatus = StoreStatus.StoreOnline;
InOutEndProcess(StoreMoveType.InStore);
AutoInout.InOutEndProcess(this, StoreMoveType.InStore);
}
else
{
LogInfo(" 入库,moveStatus=" + MoveInfo.MoveStep + ",没有对应的处理!");
ShelfInStoreProcess();
}
}
......@@ -424,10 +334,10 @@ namespace OnlineStore.DeviceLibrary
public override bool StartOutStoreMove(InOutParam param)
{
startOutStoreTime = DateTime.Now;
string posId = param != null ? param.PositionNum : "";
string posId = param != null ? param.PosID : "";
if (storeRunStatus == StoreRunStatus.Runing)
{
if (!LoadParamPosition(param))
if (!StoreManager.LoadInoutParam(param,this))
{
LogUtil.error(Name + " 启动出库【" + posId + "】出错,找不到库位信息");
return false;
......@@ -501,7 +411,7 @@ namespace OnlineStore.DeviceLibrary
//ACAxisMove(Config.InOut_Axis, moveP.InOut_P1, Config.InOutAxis_P1_Speed);
InOutBackToP1(moveP.InOut_P1);
//把库位的物品放到取到叉子上之后是出仓完成
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PositionNum : "";
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : "";
lastPosId = posId;
lastPosIdStatus = StoreStatus.OutStoreBoxEnd;
storeStatus = StoreStatus.OutStoreBoxEnd;
......@@ -511,7 +421,7 @@ namespace OnlineStore.DeviceLibrary
{
if (IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW))
{
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PositionNum : "";
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : "";
CodeMsg = "出库[" + posId + "]叉子从库位退出后,未检测到料盘有料";
LogUtil.error(CodeMsg);
}
......@@ -597,19 +507,18 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep == StoreMoveStep.SO_14_WaitTake)
{
TimeSpan span = DateTime.Now - startOutStoreTime;
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PositionNum : "";
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : "";
storeStatus = StoreStatus.StoreOnline;
LogInfo(" 【" + posId + "】 整个出库流程结束,耗时【" + FormUtil.GetSpanStr(span) + "】!");
MoveInfo.EndMove();
storeRunStatus = StoreRunStatus.Runing;
InOutEndProcess(StoreMoveType.OutStore);
AutoInout.InOutEndProcess(this,StoreMoveType.OutStore);
}
else
{
LogUtil.error(Name + " 出库处理,moveStatus=" + MoveInfo.MoveStep + ",没有对应的处理!");
}
}
private void SendOutStoreEnd(StoreMoveInfo storeMove)
......@@ -650,131 +559,25 @@ namespace OnlineStore.DeviceLibrary
#endregion
public List<FixtureCodeInfo> waitOutStoreList = new List<FixtureCodeInfo>();
public List<InOutParam> waitOutStoreList = new List<InOutParam>();
public object waitOutListLock = "";
public void AddWaitOutInfo(FixtureCodeInfo code)
public void AddWaitOutInfo(InOutParam code)
{
lock (waitOutListLock)
{
waitOutStoreList.Add(code);
}
}
private void InOutEndProcess(StoreMoveType storeMoveType)
{
try
{
CurrInOutCount++;
CurrInOutACount++;
//是否自动进入出库状态
if (!autoNext)
{
return;
}
if (storeMoveType.Equals(StoreMoveType.InStore))
{
int newIndex = autoPositionIndex - 1;
if (newIndex < 0)
{
if (AutoStartIndex >= 0 && AutoStartIndex < PositionNumList.Count)
{
newIndex = AutoStartIndex;
LogInfo("下一个索引不存在,重新开始自动出入库,索引【" + AutoStartIndex + "】");
}
else
{
autoNext = false;
autoMsg = "自动出入库结束!";
LogInfo("下一个索引不存在,自动 出入库结束!");
}
}
else
{
autoPositionIndex = newIndex;
string posid = PositionNumList[autoPositionIndex];
//判断是否需要重置
if (CurrInOutACount >= Config.Box_ResetACount)
{
LogInfo("自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutACount + "次,需要重置BOX,先把出库信息存入排队列表中");
Reset(false);
autoMsg = "自动出库:" + posid;
AddWaitOutInfo(new FixtureCodeInfo(0, "", posid));
}
else if (CurrInOutCount >= Config.Box_ResetMCount)
{
LogInfo("自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutCount + "次,需要重置BOX旋转轴,先把出库信息存入排队列表中");
//ResetMiddleAxis(false);
autoMsg = "自动出库:" + posid;
AddWaitOutInfo(new FixtureCodeInfo(0, "", posid));
}
else
{
LogInfo("自动进入下一个出库:posid=" + posid);
autoMsg = "自动出库:" + posid;
StartOutStoreMove(new InOutParam("", posid));
}
}
}
else if (storeMoveType.Equals(StoreMoveType.OutStore))
{
int newIndex = autoPositionIndex - autoJiange;
if (newIndex < 0)
{
if (AutoStartIndex >= 0 && AutoStartIndex < PositionNumList.Count)
{
newIndex = AutoStartIndex;
LogInfo("下一个索引不存在,重新开始自动出入库,索引【" + AutoStartIndex + "】");
}
else
{
autoNext = false;
autoMsg = "自动出入库结束!";
LogInfo("下一个索引不存在,自动 出入库结束!");
}
}
else
{
string posid = PositionNumList[newIndex];
//判断是否需要重置
if (CurrInOutACount >= Config.Box_ResetACount)
{
LogInfo("自动进入下一个入库:posid=" + posid + ",当时已经出入库" + CurrInOutACount + "次,需要重置BOX,先把入库信息存入排队列表中");
Reset(false);
autoMsg = "自动入库:" + posid;
AddWaitOutInfo(new FixtureCodeInfo(0, "AAAA", posid));
}
else if (CurrInOutCount >= Config.Box_ResetMCount)
{
LogInfo("自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutCount + "次,需要重置BOX旋转轴,先把出库信息存入排队列表中");
//ResetMiddleAxis(false);
autoMsg = "自动入库:" + posid;
AddWaitOutInfo(new FixtureCodeInfo(0, "AAAA", posid));
}
else
{
LogInfo("自动进入下一个入库:posid=" + posid);
autoMsg = "自动入库:" + posid;
StartInStoreMove(new InOutParam("AAAA", posid));
}
}
}
}
catch (Exception ex)
{
LogUtil.error(Name + "InOutEndProcess ERROR:" + ex.ToString());
}
}
private void InStoreLog(string msg)
{
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PositionNum : "";
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : "";
LogInfo("【" + posId + "】" + msg);
}
private void OutStoreLog(string msg)
{
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PositionNum : "";
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : "";
LogInfo("【" + posId + "】" + msg);
}
}
......
......@@ -18,22 +18,81 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public void StartShelfInStore()
{
if (storeRunStatus == StoreRunStatus.Runing)
{
if(IOValue(IO_Type.LineIn_Check).Equals(IO_VALUE.HIGH))
if (IOValue(IO_Type.LineIn_Check).Equals(IO_VALUE.HIGH))
{
LogInfo(" 空闲中,检测到入料口有信号,入料口移门打开,");
LogInfo(" 空闲中,检测到入料口有信号,料架入库:入料口移门打开,");
storeRunStatus = StoreRunStatus.Busy;
storeStatus = StoreStatus.InStoreExecute;
MoveInfo.NewMove(StoreMoveType.InStore, new InOutParam());
MoveInfo.NextMoveStep(StoreMoveStep.BOX_M_H_TOP1_OtherAxisToP1)
MoveInfo.NextMoveStep(StoreMoveStep.SI_S02_DoorOpen);
CylinderMove(MoveInfo, IO_Type.EntranceDoor_Close, IO_Type.EntranceDoor_Open);
}
}
}
}
private void ShelfInStoreProcess()
{
if (MoveInfo.MoveStep.Equals(StoreMoveStep.SI_S01_LineIn_Check))
{
MoveInfo.NextMoveStep(StoreMoveStep.SI_S02_DoorOpen);
InStoreLog("SI_S02_DoorOpen:料架入库:入料口移门打开");
CylinderMove(MoveInfo, IO_Type.EntranceDoor_Close, IO_Type.EntranceDoor_Open);
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.SI_S02_DoorOpen))
{
MoveInfo.NextMoveStep(StoreMoveStep.SI_S03_LineRun);
InStoreLog("SI_S03_LineRun:料架入库:线体正转,等待取料位检测到信号");
IOMove(IO_Type.Line_BackRun, IO_VALUE.LOW);
IOMove(IO_Type.Line_Run, IO_VALUE.HIGH);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LineIn_Check, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LineTake_Check, IO_VALUE.HIGH));
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.SI_S03_LineRun))
{
MoveInfo.NextMoveStep(StoreMoveStep.SI_S04_LineStop);
InStoreLog("SI_S04_LineStop:料架入库:取料位检测到信号,停止线体正转");
IOMove(IO_Type.Line_Run, IO_VALUE.LOW);
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.SI_S04_LineStop))
{
MoveInfo.NextMoveStep(StoreMoveStep.SI_S05_DoorClose);
InStoreLog("SI_S05_DoorClose:料架入库:入料口移门关闭");
CylinderMove(MoveInfo, IO_Type.EntranceDoor_Open, IO_Type.EntranceDoor_Close);
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.SI_S05_DoorClose))
{
MoveInfo.NextMoveStep(StoreMoveStep.SI_S06_LocationUp);
InStoreLog("SI_S06_LocationUp:料架入库:定位装置上升");
CylinderMove(MoveInfo, IO_Type.LocationCylinder_Down, IO_Type.LocationCylinder_Up);
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.SI_S06_LocationUp))
{
MoveInfo.NextMoveStep(StoreMoveStep.SI_S07_TopCylinderUp);
InStoreLog("SI_S07_TopCylinderUp:料架入库:顶升装置上升");
CylinderMove(MoveInfo, IO_Type.TopCylinder_Down, IO_Type.TopCylinder_Up);
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.SI_S07_TopCylinderUp))
{
MoveInfo.NextMoveStep(StoreMoveStep.SI_S08_StartGetTray);
InStoreLog("SI_S07_TopCylinderUp:料架入库:开始循环从第一个空位逐个取料盘,扫码入库");
CylinderMove(MoveInfo, IO_Type.TopCylinder_Down, IO_Type.TopCylinder_Up);
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.SI_S08_StartGetTray))
{
}
else
{
LogInfo(" 入库,moveStatus=" + MoveInfo.MoveStep + ",没有对应的处理!");
}
}
}
}
......@@ -37,7 +37,8 @@ namespace OnlineStore.DeviceLibrary
{
if (valueList.Contains(item))
{
LogUtil.error(LOGGER, type.Name + "枚举值:" + item + "重复存在,请检查代码!");
LogUtil.error( type.Name + "枚举值:" + item + "重复存在,请检查代码,即将 退出程序!");
MessageBox.Show(type.Name + "枚举值:" + item + "重复存在,请检查代码,即将 退出程序!");
Application.Exit();
break;
}
......@@ -122,7 +123,7 @@ namespace OnlineStore.DeviceLibrary
{
LOGGER.Error("出错:", ex);
MessageBox.Show(ex.ToString(), "加载配置错误(请检查配置)");
Application.Exit();
}
return Store;
}
......@@ -153,6 +154,66 @@ namespace OnlineStore.DeviceLibrary
LOGGER.Error("出错:", ex);
}
}
public static bool LoadInoutParam(InOutParam param, AC_BOX_Bean box)
{
if (param == null)
{
return false;
}
//加载位置
if (param.MoveP == null)
{
LineMoveP p = new LineMoveP();
ACBoxPosition position = CSVPositionReader<ACBoxPosition>.GetPositon(param.PosID);
if (position == null)
{
LogUtil.error(box.Name + "GetPositon[" + param.PosID + "]=null,没有库位不能执行出入库");
return false;
}
ShelfPosition sp = CSVPositionReader<ShelfPosition>.GetPositon(param.ShelfPosID);
if (sp == null)
{
LogUtil.error(box.Name + "GetPositon[" + param.ShelfPosID + "]=null,没有库位不能执行出入库");
return false;
}
p.InOut_PA = sp.InoutAxis_PA;
p.UpDown_LPA1 = sp.UpDownAxis_LPA1;
p.UpDown_HPA2 = sp.UpDownAxis_HPA2;
p.Middle_PA = sp.MiddleAxis_PA;
p.ComPress_P1 = box.Config.CompressAxis_P1_Position;
p.InOut_P1 = box.Config.InOutAxis_P1_Position;
p.Middle_P1 = box.Config.MiddleAxis_P1_Position;
p.InOut_P2 = position.InOutAxis_DoorPosition_P2;
p.UpDown_P1 = box.Config.UpDownAxis_DoorOPosition_P1;
p.UpDown_P8 = box.Config.UpDownAxis_DoorIBPosition_P8;
p.UpDown_P2 = box.Config.UpDownAxis_DoorIPosition_P2;
p.UpDown_P7 = box.Config.UpDownAxis_DoorOBPosition_P7;
p.ComPress_P2 = position.CompressAxis_Position_P2;
p.ComPress_P3 = position.CompressAxis_CPosition_P3;
p.InOut_P3 = position.InOutAxis_Position_P3;
p.Middle_P2 = position.MiddleAxis_Position_P2;
p.UpDown_P3 = position.UpDownAxis_IHPosition_P3;
p.UpDown_P4 = position.UpDownAxis_ILPosition_P4;
p.UpDown_P5 = position.UpDownAxis_OHPosition_P5;
p.UpDown_P6 = position.UpDownAxis_OLPosition_P6;
param.MoveP = p;
if (String.IsNullOrEmpty(param.PlateH))
{
param.PlateH = position.BagHigh.ToString();
}
if (string.IsNullOrEmpty(param.PlateW))
{
param.PlateW = position.BagWidth.ToString();
}
return true;
}
return true;
}
private static string api_communication = "service/store/communication"; //流水线状态通信接口
private static string api_nextFeeder = "service/store/nextFeeder"; // 出库站位列表切换接口
public static string GetPostApi(string host)
......
......@@ -77,14 +77,14 @@
<Compile Include="device\PanasonicServo\ACServerManager.cs" />
<Compile Include="device\PanasonicServo\ACServerManager_Partial.cs" />
<Compile Include="device\RFID\RFIDManager.cs" />
<Compile Include="store\AutoInoutInfo.cs" />
<Compile Include="store\LineMoveP.cs" />
<Compile Include="store\LineAlarm.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="store\model\AxisAlarmInfo.cs" />
<Compile Include="store\model\FixtureCodeInfo.cs" />
<Compile Include="store\InOrOutStoreParam.cs">
<Compile Include="store\InOutParam.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="store\model\StoreMoveInfo.cs">
......
......@@ -113,7 +113,6 @@ PRO,预警湿度,WarnHumidity,80,,,,,, ,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,,,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
PRO,是否使用料盘检测信号,IsUse_Tray_Check,0,,,,,,,
PRO,需要吹气的温度(温度标准),Max_Temperature,0,,,,,,,
PRO,需要吹气的湿度(湿度标准),Max_Humidity,10,,,,,,,
PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,
......
......@@ -115,7 +115,6 @@ PRO,预警湿度,WarnHumidity,80,,,,,, ,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,,,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
PRO,是否使用料盘检测信号,IsUse_Tray_Check,0,,,,,,,
PRO,需要吹气的温度(温度标准),Max_Temperature,0,,,,,,,
PRO,需要吹气的湿度(湿度标准),Max_Humidity,10,,,,,,,
PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,
......
位置,优先级,高度,宽度,料仓ID,旋转轴位置,升降轴低点,升降轴高点,进出轴位置
1#AC1_1_1_4,1,8,7,1,211783,51884,55245,81000
1#AC1_1_1_5,2,8,7,1,211783,67807,71168,81000
1#AC1_1_1_6,3,8,7,1,211783,83730,87091,81000
1#AC1_1_1_7,4,8,7,1,211783,99653,103014,81000
1#AC1_1_1_8,5,8,7,1,211783,115576,118937,81000
1#AC1_1_1_9,6,8,7,1,211783,131499,134860,81000
1#AC1_1_1_10,7,8,7,1,211783,147422,150783,81000
1#AC1_1_1_11,8,8,7,1,211783,163345,166706,81000
1#AC1_1_1_12,9,8,7,1,211783,179268,182629,81000
1#AC1_1_1_13,10,8,7,1,211783,195191,198552,81000
1#AC1_1_1_14,11,8,7,1,211783,211114,214475,81000
1#AC1_1_1_15,12,8,7,1,211783,227037,230398,81000
1#AC1_1_1_16,13,8,7,1,211783,242960,246321,81000
1#AC1_1_1_17,14,8,7,1,211783,258883,262244,81000
1#AC1_1_1_18,15,8,7,1,211783,274806,278167,81000
1#AC1_1_1_19,16,8,7,1,211783,289000,294090,81000
1#AC1_1_1_20,17,8,7,1,211783,304652,310013,81000
1#AC1_1_1_21,18,8,7,1,211783,320575,325936,81000
1#AC1_1_1_22,19,8,7,1,211783,336498,341859,81000
1#AC1_1_2_3,20,8,7,1,211783,385700,389433,81000
1#AC1_1_2_4,21,8,7,1,211783,403000,405356,81000
1#AC1_1_2_5,22,8,7,1,211783,418345,421279,81000
1#AC1_1_2_6,23,8,7,1,211783,434000,437202,81000
1#AC1_1_2_7,24,8,7,1,211783,450000,453125,81000
1#AC1_1_2_8,25,8,7,1,211783,465900,469048,81000
1#AC1_1_2_9,26,8,7,1,211783,481800,484971,81000
1#AC1_1_2_10,27,8,7,1,211783,497660,500894,81000
1#AC1_1_2_11,28,8,7,1,211783,513600,516817,81000
1#AC1_1_2_12,29,8,7,1,211783,529200,532740,81000
1#AC1_1_2_13,30,8,7,1,211783,545100,548663,81000
1#AC1_1_2_14,31,8,7,1,211783,560500,564586,81000
1#AC1_1_2_15,32,8,7,1,211783,575500,580509,81000
1#AC1_1_2_16,33,8,7,1,211783,591500,596432,81000
1#AC1_1_2_17,34,8,7,1,211783,606000,612355,81000
1#AC1_1_2_18,35,8,7,1,211783,621000,628278,81000
位置,优先级,高度,宽度,料仓ID,旋转轴位置PA,升降轴低点PA1,升降轴高点PA2,进出轴位置PA
1#S_1_4,1,8,7,1,211783,51884,55245,81000
1#S_1_5,2,8,7,1,211783,67807,71168,81000
1#S_1_6,3,8,7,1,211783,83730,87091,81000
1#S_1_7,4,8,7,1,211783,99653,103014,81000
1#S_1_8,5,8,7,1,211783,115576,118937,81000
1#S_1_9,6,8,7,1,211783,131499,134860,81000
1#S_1_10,7,8,7,1,211783,147422,150783,81000
1#S_1_11,8,8,7,1,211783,163345,166706,81000
1#S_1_12,9,8,7,1,211783,179268,182629,81000
1#S_1_13,10,8,7,1,211783,195191,198552,81000
1#S_1_14,11,8,7,1,211783,211114,214475,81000
1#S_1_15,12,8,7,1,211783,227037,230398,81000
1#S_1_16,13,8,7,1,211783,242960,246321,81000
1#S_1_17,14,8,7,1,211783,258883,262244,81000
1#S_1_18,15,8,7,1,211783,274806,278167,81000
1#S_1_19,16,8,7,1,211783,289000,294090,81000
1#S_1_20,17,8,7,1,211783,304652,310013,81000
1#S_1_21,18,8,7,1,211783,320575,325936,81000
1#S_1_22,19,8,7,1,211783,336498,341859,81000
1#S_2_3,20,8,7,1,211783,385700,389433,81000
1#S_2_4,21,8,7,1,211783,403000,405356,81000
1#S_2_5,22,8,7,1,211783,418345,421279,81000
1#S_2_6,23,8,7,1,211783,434000,437202,81000
1#S_2_7,24,8,7,1,211783,450000,453125,81000
1#S_2_8,25,8,7,1,211783,465900,469048,81000
1#S_2_9,26,8,7,1,211783,481800,484971,81000
1#S_2_10,27,8,7,1,211783,497660,500894,81000
1#S_2_11,28,8,7,1,211783,513600,516817,81000
1#S_2_12,29,8,7,1,211783,529200,532740,81000
1#S_2_13,30,8,7,1,211783,545100,548663,81000
1#S_2_14,31,8,7,1,211783,560500,564586,81000
1#S_2_15,32,8,7,1,211783,575500,580509,81000
1#S_2_16,33,8,7,1,211783,591500,596432,81000
1#S_2_17,34,8,7,1,211783,606000,612355,81000
1#S_2_18,35,8,7,1,211783,621000,628278,81000
,,,,,,,,
2#AC1_1_1_4,1,8,7,2,211783,51884,55245,81000
2#AC1_1_1_5,2,8,7,2,211783,67807,71168,81000
2#AC1_1_1_6,3,8,7,2,211783,83730,87091,81000
2#AC1_1_1_7,4,8,7,2,211783,99653,103014,81000
2#AC1_1_1_8,5,8,7,2,211783,115576,118937,81000
2#AC1_1_1_9,6,8,7,2,211783,131499,134860,81000
2#AC1_1_1_10,7,8,7,2,211783,147422,150783,81000
2#AC1_1_1_11,8,8,7,2,211783,163345,166706,81000
2#AC1_1_1_12,9,8,7,2,211783,179268,182629,81000
2#AC1_1_1_13,10,8,7,2,211783,195191,198552,81000
2#AC1_1_1_14,11,8,7,2,211783,211114,214475,81000
2#AC1_1_1_15,12,8,7,2,211783,227037,230398,81000
2#AC1_1_1_16,13,8,7,2,211783,242960,246321,81000
2#AC1_1_1_17,14,8,7,2,211783,258883,262244,81000
2#AC1_1_1_18,15,8,7,2,211783,274806,278167,81000
2#AC1_1_1_19,16,8,7,2,211783,289000,294090,81000
2#AC1_1_1_20,17,8,7,2,211783,304652,310013,81000
2#AC1_1_1_21,18,8,7,2,211783,320575,325936,81000
2#AC1_1_1_22,19,8,7,2,211783,336498,341859,81000
2#AC1_1_2_3,20,8,7,2,211783,385700,389433,81000
2#AC1_1_2_4,21,8,7,2,211783,403000,405356,81000
2#AC1_1_2_5,22,8,7,2,211783,418345,421279,81000
2#AC1_1_2_6,23,8,7,2,211783,434000,437202,81000
2#AC1_1_2_7,24,8,7,2,211783,450000,453125,81000
2#AC1_1_2_8,25,8,7,2,211783,465900,469048,81000
2#AC1_1_2_9,26,8,7,2,211783,481800,484971,81000
2#AC1_1_2_10,27,8,7,2,211783,497660,500894,81000
2#AC1_1_2_11,28,8,7,2,211783,513600,516817,81000
2#AC1_1_2_12,29,8,7,2,211783,529200,532740,81000
2#AC1_1_2_13,30,8,7,2,211783,545100,548663,81000
2#AC1_1_2_14,31,8,7,2,211783,560500,564586,81000
2#AC1_1_2_15,32,8,7,2,211783,575500,580509,81000
2#AC1_1_2_16,33,8,7,2,211783,591500,596432,81000
2#AC1_1_2_17,34,8,7,2,211783,606000,612355,81000
2#AC1_1_2_18,35,8,7,2,211783,621000,628278,81000
2#S_1_4,1,8,7,2,211783,51884,55245,81000
2#S_1_5,2,8,7,2,211783,67807,71168,81000
2#S_1_6,3,8,7,2,211783,83730,87091,81000
2#S_1_7,4,8,7,2,211783,99653,103014,81000
2#S_1_8,5,8,7,2,211783,115576,118937,81000
2#S_1_9,6,8,7,2,211783,131499,134860,81000
2#S_1_10,7,8,7,2,211783,147422,150783,81000
2#S_1_11,8,8,7,2,211783,163345,166706,81000
2#S_1_12,9,8,7,2,211783,179268,182629,81000
2#S_1_13,10,8,7,2,211783,195191,198552,81000
2#S_1_14,11,8,7,2,211783,211114,214475,81000
2#S_1_15,12,8,7,2,211783,227037,230398,81000
2#S_1_16,13,8,7,2,211783,242960,246321,81000
2#S_1_17,14,8,7,2,211783,258883,262244,81000
2#S_1_18,15,8,7,2,211783,274806,278167,81000
2#S_1_19,16,8,7,2,211783,289000,294090,81000
2#S_1_20,17,8,7,2,211783,304652,310013,81000
2#S_1_21,18,8,7,2,211783,320575,325936,81000
2#S_1_22,19,8,7,2,211783,336498,341859,81000
2#S_2_3,20,8,7,2,211783,385700,389433,81000
2#S_2_4,21,8,7,2,211783,403000,405356,81000
2#S_2_5,22,8,7,2,211783,418345,421279,81000
2#S_2_6,23,8,7,2,211783,434000,437202,81000
2#S_2_7,24,8,7,2,211783,450000,453125,81000
2#S_2_8,25,8,7,2,211783,465900,469048,81000
2#S_2_9,26,8,7,2,211783,481800,484971,81000
2#S_2_10,27,8,7,2,211783,497660,500894,81000
2#S_2_11,28,8,7,2,211783,513600,516817,81000
2#S_2_12,29,8,7,2,211783,529200,532740,81000
2#S_2_13,30,8,7,2,211783,545100,548663,81000
2#S_2_14,31,8,7,2,211783,560500,564586,81000
2#S_2_15,32,8,7,2,211783,575500,580509,81000
2#S_2_16,33,8,7,2,211783,591500,596432,81000
2#S_2_17,34,8,7,2,211783,606000,612355,81000
2#S_2_18,35,8,7,2,211783,621000,628278,81000
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
public class AutoInoutInfo
{
/// <summary>
/// 入库完成后自动出库,出库完成后自动入库
/// </summary>
public bool autoNext = false;
/// <summary>
/// 自动出入库间隔
/// </summary>
public int Jiange = 3;
public int positionIndex = 0;
public string autoMsg = "";
public int startIndex = -1;
public string shelfPosId = "";
#region 出入库参数
/// <summary>
/// 当前出入库的次数,超过配置的数量时,需要自动重置一下,再进行出入库
/// </summary>
internal int CurrInOutCount = 0;
internal int CurrInOutACount = 0;
#endregion
internal void InOutEndProcess(AC_BOX_Bean boxBean, StoreMoveType storeMoveType)
{
try
{
CurrInOutCount++;
CurrInOutACount++;
//是否自动进入出库状态
if (!autoNext)
{
return;
}
if (storeMoveType.Equals(StoreMoveType.InStore))
{
int newIndex = positionIndex - 1;
if (newIndex < 0)
{
if (startIndex >= 0 && startIndex < boxBean.PositionNumList.Count)
{
newIndex = startIndex;
boxBean.LogInfo("下一个索引不存在,重新开始自动出入库,索引【" + startIndex + "】");
}
else
{
autoNext = false;
autoMsg = "自动出入库结束!";
boxBean.LogInfo("下一个索引不存在,自动 出入库结束!");
}
}
else
{
positionIndex = newIndex;
string posid = boxBean.PositionNumList[positionIndex];
//判断是否需要重置
if (CurrInOutACount >= boxBean.Config.Box_ResetACount)
{
boxBean.LogInfo("自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutACount + "次,需要重置BOX,先把出库信息存入排队列表中");
boxBean.Reset(false);
autoMsg = "自动出库:" + posid;
boxBean.AddWaitOutInfo(new InOutParam("", posid, shelfPosId));
}
else if (CurrInOutCount >= boxBean.Config.Box_ResetMCount)
{
boxBean.LogInfo("自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutCount + "次,需要重置BOX旋转轴,先把出库信息存入排队列表中");
//ResetMiddleAxis(false);
autoMsg = "自动出库:" + posid;
boxBean.AddWaitOutInfo(new InOutParam("", posid, shelfPosId));
}
else
{
boxBean.LogInfo("自动进入下一个出库:posid=" + posid);
autoMsg = "自动出库:" + posid;
boxBean.StartOutStoreMove(new InOutParam("", posid, shelfPosId));
}
}
}
else if (storeMoveType.Equals(StoreMoveType.OutStore))
{
int newIndex = positionIndex - Jiange;
if (newIndex < 0)
{
if (startIndex >= 0 && startIndex < boxBean.PositionNumList.Count)
{
newIndex = startIndex;
boxBean.LogInfo("下一个索引不存在,重新开始自动出入库,索引【" + startIndex + "】");
}
else
{
autoNext = false;
autoMsg = "自动出入库结束!";
boxBean.LogInfo("下一个索引不存在,自动 出入库结束!");
}
}
else
{
string posid = boxBean.PositionNumList[newIndex];
//判断是否需要重置
if (CurrInOutACount >= boxBean.Config.Box_ResetACount)
{
boxBean.LogInfo("自动进入下一个入库:posid=" + posid + ",当时已经出入库" + CurrInOutACount + "次,需要重置BOX,先把入库信息存入排队列表中");
boxBean.Reset(false);
autoMsg = "自动入库:" + posid;
boxBean.AddWaitOutInfo(new InOutParam("AAAA", posid, shelfPosId));
}
else if (CurrInOutCount >= boxBean.Config.Box_ResetMCount)
{
boxBean.LogInfo("自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutCount + "次,需要重置BOX旋转轴,先把出库信息存入排队列表中");
//ResetMiddleAxis(false);
autoMsg = "自动入库:" + posid;
boxBean.AddWaitOutInfo(new InOutParam("AAAA", posid, shelfPosId));
}
else
{
boxBean.LogInfo("自动进入下一个入库:posid=" + posid);
autoMsg = "自动入库:" + posid;
boxBean.StartInStoreMove(new InOutParam("AAAA", posid, shelfPosId));
}
}
}
}
catch (Exception ex)
{
LogUtil.error(boxBean.Name + "InOutEndProcess ERROR:" + ex.ToString());
}
}
internal void ClearCount()
{
CurrInOutACount = 0;
CurrInOutCount = 0;
}
}
}
......@@ -17,9 +17,8 @@ namespace OnlineStore.DeviceLibrary
{
public static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public InOutParam()
{
ACStoreP = null;
this.WareNumber = "";
{
this.WareCode = "";
MoveP = null;
}
/// <summary>
......@@ -27,71 +26,43 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// <param name="wareNo">物品二维码</param>
/// <param name="position">仓位号</param>
public InOutParam(string wareNo, string posId)
public InOutParam(string wareNo, string posId,string ShelfPosID)
{
ACStoreP = null;
WareNumber = wareNo;
PositionNum = posId;
this.ShelfPosID = ShelfPosID;
WareCode = wareNo;
PosID = posId;
MoveP = null;
IsSolderPaste = false;
}
public InOutParam(string wareNo, string posId,string plateH,string plateW)
public InOutParam(string wareNo, string posId,string plateH,string plateW, string ShelfPosID="")
{
ACStoreP = null;
WareNumber = wareNo;
PositionNum = posId;
this.ShelfPosID = ShelfPosID;
WareCode = wareNo;
PosID = posId;
MoveP = null;
this.PlateW = plateW;
this.PlateH = plateH;
IsSolderPaste = false;
}
public InOutParam(string wareNo, string posId, LineMoveP linePosition)
{
ACStoreP = null;
WareNumber = wareNo;
PositionNum = posId;
}
public InOutParam(string wareNo, string posId, LineMoveP linePosition )
{
WareCode = wareNo;
PosID = posId;
MoveP = linePosition;
IsSolderPaste = false;
}
//public InOutStoreParam(string wareNo, string posId, ACStorePosition movep)
//{
// ACStoreP = movep;
// WareNumber = wareNo;
// PositionNum = posId;
// MoveP = null;
// IsSolderPaste = false;
//}
private ACBoxPosition ACStoreP = null;
public ACBoxPosition GetACPosition()
{
try
{
if (ACStoreP == null)
{
ACStoreP = CSVPositionReader<ACBoxPosition>.GetPositon(PositionNum);
}
}
catch (Exception ex)
{
LogUtil.error(log, "出入库获取库位信息GetKTKPosition出错:" + ex.ToString());
}
return ACStoreP;
}
}
/// <summary>
/// 物品二维码信息
/// </summary>
public string WareNumber { get; set; }
public string WareCode { get; set; }
/// <summary>
/// 位置坐标名(对应配置表的位置)
/// </summary>
public string PositionNum { get; set; }
public string PosID { get; set; }
/// <summary>
/// 料架对应的库位号
/// </summary>
public string ShelfPosID = "";
public LineMoveP MoveP { get; set; }
/// <summary>
/// 料盘高度
......@@ -105,7 +76,100 @@ namespace OnlineStore.DeviceLibrary
/// 是否是放入锡膏(在线料仓才需要此字段)
/// </summary>
public bool IsSolderPaste { get; set; }
}
/// <summary>
/// 根据PosId获取对应的料仓ID,若PosId=="",返回-1
/// </summary>
/// <returns></returns>
public int GetStoreId()
{
if (!PosID.Equals(""))
{
string[] arr = PosID.Split('#');
if (arr.Length >= 2)
{
try
{
return int.Parse(arr[0]);
}
catch (Exception ex)
{
}
}
}
return -1;
}
public string ToStr()
{
return " ShelfPosID=["+ ShelfPosID + "],WareCode=【" + WareCode + "】,PosID=【" + PosID + "】,PlateW=【" + PlateW + "】,PlateH=【" + PlateH + "】";
}
}
///// <summary>
// /// 夹具编码信息(保存夹具检测到的IO数值,和对应的料仓位置)
// /// </summary>
//public class FixtureCodeInfo
//{
// public FixtureCodeInfo(string wareNum, string posId)
// {
// this.WareNum = wareNum;
// this.PosId = posId;
// this.plateH = "";
// this.plateW = "";
// }
// public FixtureCodeInfo(string wareNum, string posId, string platew, string plateh)
// {
// this.WareNum = wareNum;
// this.PosId = posId;
// this.plateW = platew;
// this.plateH = plateh;
// }
// /// <summary>
// /// 物品二维码
// /// </summary>
// public string WareNum { get; set; }
// /// <summary>
// /// 库位号编码
// /// </summary>
// public string PosId { get; set; }
// /// <summary>
// /// 料盘宽
// /// </summary>
// public string plateW { get; set; }
// /// <summary>
// /// 料盘高
// /// </summary>
// public string plateH { get; set; }
// public string ToStr()
// {
// return " WareNum=【" + WareNum + "】,PosId=【" + PosId + "】,plateW=【" + plateW + "】,plateH=【" + plateH + "】";
// }
// /// <summary>
// /// 根据PosId获取对应的料仓ID,若PosId=="",返回-1
// /// </summary>
// /// <returns></returns>
// public int GetStoreId()
// {
// if (!PosId.Equals(""))
// {
// string[] arr = PosId.Split('#');
// if (arr.Length >= 2)
// {
// try
// {
// return int.Parse(arr[0]);
// }
// catch (Exception ex)
// {
// }
// }
// }
// return -1;
// }
//}
}
......@@ -79,5 +79,22 @@ namespace OnlineStore.DeviceLibrary
/// 轴4( 压紧轴) 压紧前点P3
/// </summary>
public int ComPress_P3{ get; set; }
/// <summary>
/// 料架进出轴取料点
/// </summary>
public int InOut_PA = 0;
/// <summary>
/// 料架旋转轴位置
/// </summary>
public int Middle_PA = 0;
/// <summary>
/// 料架升降轴低点PA1
/// </summary>
public int UpDown_LPA1 = 0;
/// <summary>
/// 料架升降轴高点PA2
/// </summary>
public int UpDown_HPA2 = 0;
}
}
......@@ -316,7 +316,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 料架入库:检测到线体入料口信号
/// </summary>
SI_S01_LIneIn_Check= 20001,
SI_S01_LineIn_Check= 20001,
/// <summary>
/// 料架入库:入料口移门打开
/// </summary>
......@@ -342,6 +342,63 @@ namespace OnlineStore.DeviceLibrary
/// 料架入库:顶升装置上升
/// </summary>
SI_S07_TopCylinderUp = 20007,
/// <summary>
/// 料架入库:开始循环从第一个空位逐个取料盘,扫码入库
/// </summary>
SI_S08_StartGetTray= 20008,
///// <summary>
///// 入库。。压紧物品(有压紧轴的才需要此步骤),轴4( 压紧) 至P3(压紧前点)
///// </summary>
//SI_S03_CompressWare = 20103,
///// <summary>
///// 入库。。压紧物品(有压紧轴的才需要此步骤),轴4( 压紧) 至P3(压紧前点)
///// </summary>
//SI_S04_CompressWare = 20104,
///// <summary>
///// 入库。。叉子进入入料口,轴3( 叉子) 至P2( 进料口取料点)
///// </summary>
//SI_S05_DeviceToDoor = 20105,
///// <summary>
///// 入库。。把物品放入叉子上,轴2( 上下) 至P7( 进料口取料缓冲点),压紧物品(有压紧轴的才需要此步骤),轴4( 压紧) 至P2(压紧点)
///// </summary>
//SI_S06_DoorWarToDevice = 20106,
///// <summary>
///// 入库。。叉子 从入料口抽出,轴3( 叉子) 至P1( 待机点)
///// </summary>
//SI_S07_DeviceBackFromDoor = 20107,
///// <summary>
///// 入库。。,定位气缸伸出 (有压紧轴的不需要此步骤)
///// </summary>
//SI_S08_LocationCylinder_Up = 20108,
///// <summary>
///// 入库。。移动到库位点,轴1( 转盘) 至P2( 库位点)轴2(上下) 至P3(库位入库前点)
///// </summary>
//SI_S09_MoveToBag = 20109,
///// <summary>
///// 入库。。定位气缸退回 (有压紧轴的不需要此步骤)
///// </summary>
//SI_S10_LocationCylinder_Down = 20110,
///// <summary>
///// 入库。。叉子进入库位中,轴3( 叉子) 至P3(库位取放料点)
///// </summary>
//SI_S11_DeviceToBag = 20111,
///// <summary>
///// 入库。。放下物品,轴2( 上下) 至P4( 库位入料缓冲点)轴4( 压紧) 至P3( 压紧前点)
///// </summary>
//SI_S12_PutWareToBag = 20112,
///// <summary>
///// 入库。。叉子从库位中返回,轴3( 叉子) 动作至P1( 待机点)
///// </summary>
//SI_S13_DeviceBackFromBag = 20113,
///// <summary>
///// 入库。。返回待机点,轴2/轴1/轴4动作至P1( 待机点))开始
///// </summary>
//SI_S14_GoBack = 20114,
#endregion
}
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OnlineStore.DeviceLibrary
{
/// <summary>
/// 夹具编码信息(保存夹具检测到的IO数值,和对应的料仓位置)
/// </summary>
public class FixtureCodeInfo
{
public FixtureCodeInfo(int trayCode, string wareNum, string posId)
{
this.TrayCode = trayCode;
this.WareNum = wareNum;
this.PosId = posId;
this.plateH = "";
this.plateW = "";
}
public FixtureCodeInfo(int trayCode, string wareNum, string posId,string platew,string plateh)
{
this.TrayCode = trayCode;
this.WareNum = wareNum;
this.PosId = posId;
this.plateW = platew;
this.plateH = plateh;
}
/// <summary>
/// 夹具编码值(1-6)
/// </summary>
public int TrayCode { get; set; }
/// <summary>
/// 物品二维码
/// </summary>
public string WareNum { get; set; }
/// <summary>
/// 库位号编码
/// </summary>
public string PosId { get; set; }
/// <summary>
/// 料盘宽
/// </summary>
public string plateW { get; set; }
/// <summary>
/// 料盘高
/// </summary>
public string plateH { get; set; }
public string ToStr()
{
return "TrayCode【" + TrayCode + "】,WareNum=【" + WareNum + "】,PosId=【" + PosId + "】,plateW=【" + plateW + "】,plateH=【" + plateH + "】";
}
/// <summary>
/// 根据PosId获取对应的料仓ID,若PosId=="",返回-1
/// </summary>
/// <returns></returns>
public int GetStoreId()
{
if (!PosId.Equals(""))
{
string[] arr = PosId.Split('#');
if (arr.Length >= 2)
{
try
{
return int.Parse(arr[0]);
}
catch (Exception ex)
{
}
}
}
return -1;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OnlineStore.DeviceLibrary
{
/// <summary>
/// 托盘信息
/// </summary>
public class FixtureInfo
{
private int codeNum;
private int inOrOut;
public FixtureInfo(int codeNum, bool isFull, int inOrOut, int bagWidth)
{
this.codeNum = codeNum;
this.IsFull = isFull;
this.inOrOut = inOrOut;
BagWidth = bagWidth;
}
/// <summary>
/// 夹具编码值(1-6)
/// </summary>
public int TrayCode { get; set; }
/// <summary>
/// 是否有料盘,true=有料盘
/// </summary>
public bool IsFull { get; set; }
/// <summary>
/// 出库还是入库(有料盘时才有此操作)0=无操作,1=入库,2=出库
/// </summary>
public int InOrOutStore { get; set; }
/// <summary>
/// 如果是出库,需要记录盘宽,七寸小盘可以累积到托盘上
/// 只有出库才会有值
/// </summary>
public int BagWidth { get; set; }
}
}
......@@ -12,27 +12,27 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
[CSVAttribute("料仓ID")]
public int StoreId { get; set; }
/// <summary>
/// 旋转轴位置
/// 旋转轴位置PA
/// </summary>
[CSVAttribute("旋转轴位置")]
public int MiddleAxis_P100 { get; set; }
[CSVAttribute("旋转轴位置PA")]
public int MiddleAxis_PA{ get; set; }
/// <summary>
/// 升降轴高点
/// 升降轴低点PA1
/// </summary>
[CSVAttribute("升降轴低点")]
public int UpDownAxis_HP100 { get; set; }
[CSVAttribute("升降轴低点PA1")]
public int UpDownAxis_LPA1 { get; set; }
/// <summary>
/// 升降轴高点
/// 升降轴高点PA2
/// /// </summary>
[CSVAttribute("升降轴高点")]
public int UpDownAxis_LP100 { get; set; }
[CSVAttribute("升降轴高点PA2")]
public int UpDownAxis_HPA2{ get; set; }
/// <summary>
/// 进出轴位置
/// 进出轴位置PA
/// </summary>
[CSVAttribute("进出轴位置")]
public int UpDownAxis_P100 { get; set; }
[CSVAttribute("进出轴位置PA")]
public int InoutAxis_PA { get; set; }
}
}
......@@ -288,29 +288,14 @@ namespace OnlineStore.LoadCSVLibrary
{
IoValue = -1;
}
else if (ProType.Equals(ConfigItemType.DI))
else
{
IoValue = Convert.ToInt32(ProValue, 8);
IoValue = Convert.ToInt32(ProValue);
}
else if (ProType.Equals(ConfigItemType.DO))
{
if (ProValue.Length == 2)
{
int a = Convert.ToInt32(ProValue.Substring(0, 1), 16) - 8;
string str =a+ProValue.Substring(1,1);
IoValue = Convert.ToInt32( str, 8);
//IoValue = a + b;
}
else
{
IoValue = Convert.ToInt32(ProValue, 16) - Convert.ToInt32("80", 16);
}
}
//LOGGER.Info("IO转换:(" + ElectricalDefinition + ")" + ProVale + "=" + IoValue);
}
catch (Exception ex)
{
LOGGER.Error("出错了:", ex);
LOGGER.Error(ToString()+"出错了:", ex);
return -1;
}
return IoValue;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!