Commit b16c6142 几米阳光

1

1 个父辈 0fdd68d1
......@@ -130,7 +130,7 @@ namespace ACServoDriveTest
formStatus(false);
}
private void Form1_Load(object sender, EventArgs e)
{
{
ACServerManager.IsShowMsg = true;
LogUtil.logBox = this.richTextBox1;
//ACServerManager.richeBox = this.richTextBox1;
......
......@@ -18,6 +18,12 @@
this.components = new System.ComponentModel.Container();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnSXil = new System.Windows.Forms.Button();
this.btnSXi = new System.Windows.Forms.Button();
this.btnDClose = new System.Windows.Forms.Button();
this.btnDOpen = new System.Windows.Forms.Button();
this.btnSuckingDiscDown = new System.Windows.Forms.Button();
this.btnSuckingDiscUp = new System.Windows.Forms.Button();
this.btnCloseLed = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.txtSlaveId = new System.Windows.Forms.TextBox();
......@@ -46,12 +52,10 @@
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.btnSXil = new System.Windows.Forms.Button();
this.btnSXi = new System.Windows.Forms.Button();
this.btnDClose = new System.Windows.Forms.Button();
this.btnDOpen = new System.Windows.Forms.Button();
this.btnSuckingDiscDown = new System.Windows.Forms.Button();
this.btnSuckingDiscUp = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.button5 = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.groupBox4.SuspendLayout();
this.groupBox3.SuspendLayout();
......@@ -67,6 +71,10 @@
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.groupBox1.Controls.Add(this.button4);
this.groupBox1.Controls.Add(this.button5);
this.groupBox1.Controls.Add(this.button2);
this.groupBox1.Controls.Add(this.button3);
this.groupBox1.Controls.Add(this.btnSXil);
this.groupBox1.Controls.Add(this.btnSXi);
this.groupBox1.Controls.Add(this.btnDClose);
......@@ -98,15 +106,81 @@
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(482, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(332, 514);
this.groupBox1.Size = new System.Drawing.Size(382, 514);
this.groupBox1.TabIndex = 105;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "DO写入";
//
// btnSXil
//
this.btnSXil.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSXil.Location = new System.Drawing.Point(24, 438);
this.btnSXil.Name = "btnSXil";
this.btnSXil.Size = new System.Drawing.Size(102, 34);
this.btnSXil.TabIndex = 262;
this.btnSXil.Text = "停止吸料";
this.btnSXil.UseVisualStyleBackColor = true;
this.btnSXil.Click += new System.EventHandler(this.btnSXil_Click);
//
// btnSXi
//
this.btnSXi.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSXi.Location = new System.Drawing.Point(24, 401);
this.btnSXi.Name = "btnSXi";
this.btnSXi.Size = new System.Drawing.Size(102, 34);
this.btnSXi.TabIndex = 261;
this.btnSXi.Text = "开始吸料";
this.btnSXi.UseVisualStyleBackColor = true;
this.btnSXi.Click += new System.EventHandler(this.btnSXi_Click);
//
// btnDClose
//
this.btnDClose.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDClose.Location = new System.Drawing.Point(263, 348);
this.btnDClose.Name = "btnDClose";
this.btnDClose.Size = new System.Drawing.Size(102, 34);
this.btnDClose.TabIndex = 260;
this.btnDClose.Text = "门锁关闭";
this.btnDClose.UseVisualStyleBackColor = true;
this.btnDClose.Click += new System.EventHandler(this.btnDClose_Click);
//
// btnDOpen
//
this.btnDOpen.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDOpen.Location = new System.Drawing.Point(263, 311);
this.btnDOpen.Name = "btnDOpen";
this.btnDOpen.Size = new System.Drawing.Size(102, 34);
this.btnDOpen.TabIndex = 259;
this.btnDOpen.Text = "门锁打开";
this.btnDOpen.UseVisualStyleBackColor = true;
this.btnDOpen.Click += new System.EventHandler(this.btnDOpen_Click);
//
// btnSuckingDiscDown
//
this.btnSuckingDiscDown.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSuckingDiscDown.Location = new System.Drawing.Point(143, 348);
this.btnSuckingDiscDown.Name = "btnSuckingDiscDown";
this.btnSuckingDiscDown.Size = new System.Drawing.Size(102, 34);
this.btnSuckingDiscDown.TabIndex = 258;
this.btnSuckingDiscDown.Text = "吸盘下降";
this.btnSuckingDiscDown.UseVisualStyleBackColor = true;
this.btnSuckingDiscDown.Click += new System.EventHandler(this.btnSuckingDiscDown_Click);
//
// btnSuckingDiscUp
//
this.btnSuckingDiscUp.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSuckingDiscUp.Location = new System.Drawing.Point(143, 311);
this.btnSuckingDiscUp.Name = "btnSuckingDiscUp";
this.btnSuckingDiscUp.Size = new System.Drawing.Size(102, 34);
this.btnSuckingDiscUp.TabIndex = 257;
this.btnSuckingDiscUp.Text = "吸盘上升";
this.btnSuckingDiscUp.UseVisualStyleBackColor = true;
this.btnSuckingDiscUp.Click += new System.EventHandler(this.btnSuckingDiscUp_Click);
//
// btnCloseLed
//
this.btnCloseLed.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCloseLed.Location = new System.Drawing.Point(173, 281);
this.btnCloseLed.Location = new System.Drawing.Point(143, 260);
this.btnCloseLed.Name = "btnCloseLed";
this.btnCloseLed.Size = new System.Drawing.Size(102, 34);
this.btnCloseLed.TabIndex = 256;
......@@ -139,7 +213,7 @@
// btnOpenLed
//
this.btnOpenLed.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOpenLed.Location = new System.Drawing.Point(56, 281);
this.btnOpenLed.Location = new System.Drawing.Point(143, 223);
this.btnOpenLed.Name = "btnOpenLed";
this.btnOpenLed.Size = new System.Drawing.Size(102, 34);
this.btnOpenLed.TabIndex = 255;
......@@ -182,7 +256,7 @@
// btnCloseAxisBreak
//
this.btnCloseAxisBreak.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCloseAxisBreak.Location = new System.Drawing.Point(173, 247);
this.btnCloseAxisBreak.Location = new System.Drawing.Point(24, 260);
this.btnCloseAxisBreak.Name = "btnCloseAxisBreak";
this.btnCloseAxisBreak.Size = new System.Drawing.Size(102, 34);
this.btnCloseAxisBreak.TabIndex = 253;
......@@ -216,7 +290,7 @@
// btnOpenAxisBreak
//
this.btnOpenAxisBreak.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOpenAxisBreak.Location = new System.Drawing.Point(56, 247);
this.btnOpenAxisBreak.Location = new System.Drawing.Point(24, 223);
this.btnOpenAxisBreak.Name = "btnOpenAxisBreak";
this.btnOpenAxisBreak.Size = new System.Drawing.Size(102, 34);
this.btnOpenAxisBreak.TabIndex = 252;
......@@ -336,22 +410,22 @@
// btnCloseDoor
//
this.btnCloseDoor.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCloseDoor.Location = new System.Drawing.Point(173, 213);
this.btnCloseDoor.Location = new System.Drawing.Point(25, 348);
this.btnCloseDoor.Name = "btnCloseDoor";
this.btnCloseDoor.Size = new System.Drawing.Size(102, 34);
this.btnCloseDoor.TabIndex = 249;
this.btnCloseDoor.Text = "关闭进料口仓门";
this.btnCloseDoor.Text = "关闭仓门";
this.btnCloseDoor.UseVisualStyleBackColor = true;
this.btnCloseDoor.Click += new System.EventHandler(this.btnCloseDoor_Click);
//
// btnOpenDoor
//
this.btnOpenDoor.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOpenDoor.Location = new System.Drawing.Point(56, 213);
this.btnOpenDoor.Location = new System.Drawing.Point(24, 311);
this.btnOpenDoor.Name = "btnOpenDoor";
this.btnOpenDoor.Size = new System.Drawing.Size(102, 34);
this.btnOpenDoor.TabIndex = 248;
this.btnOpenDoor.Text = "打开进料口仓门";
this.btnOpenDoor.Text = "打开仓门";
this.btnOpenDoor.UseVisualStyleBackColor = true;
this.btnOpenDoor.Click += new System.EventHandler(this.btnOpenDoor_Click);
//
......@@ -370,8 +444,10 @@
//
this.chbAutoRead.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.chbAutoRead.AutoSize = true;
this.chbAutoRead.Checked = true;
this.chbAutoRead.CheckState = System.Windows.Forms.CheckState.Checked;
this.chbAutoRead.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbAutoRead.Location = new System.Drawing.Point(499, 536);
this.chbAutoRead.Location = new System.Drawing.Point(546, 536);
this.chbAutoRead.Name = "chbAutoRead";
this.chbAutoRead.Size = new System.Drawing.Size(75, 21);
this.chbAutoRead.TabIndex = 244;
......@@ -432,77 +508,55 @@
this.tableLayoutPanel1.Size = new System.Drawing.Size(218, 542);
this.tableLayoutPanel1.TabIndex = 102;
//
// btnSXil
//
this.btnSXil.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSXil.Location = new System.Drawing.Point(173, 393);
this.btnSXil.Name = "btnSXil";
this.btnSXil.Size = new System.Drawing.Size(102, 34);
this.btnSXil.TabIndex = 262;
this.btnSXil.Text = "停止吸料";
this.btnSXil.UseVisualStyleBackColor = true;
this.btnSXil.Click += new System.EventHandler(this.btnSXil_Click);
//
// btnSXi
//
this.btnSXi.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSXi.Location = new System.Drawing.Point(56, 393);
this.btnSXi.Name = "btnSXi";
this.btnSXi.Size = new System.Drawing.Size(102, 34);
this.btnSXi.TabIndex = 261;
this.btnSXi.Text = "开始吸料";
this.btnSXi.UseVisualStyleBackColor = true;
this.btnSXi.Click += new System.EventHandler(this.btnSXi_Click);
//
// btnDClose
//
this.btnDClose.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDClose.Location = new System.Drawing.Point(173, 359);
this.btnDClose.Name = "btnDClose";
this.btnDClose.Size = new System.Drawing.Size(102, 34);
this.btnDClose.TabIndex = 260;
this.btnDClose.Text = "门锁关闭";
this.btnDClose.UseVisualStyleBackColor = true;
this.btnDClose.Click += new System.EventHandler(this.btnDClose_Click);
//
// btnDOpen
//
this.btnDOpen.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDOpen.Location = new System.Drawing.Point(56, 359);
this.btnDOpen.Name = "btnDOpen";
this.btnDOpen.Size = new System.Drawing.Size(102, 34);
this.btnDOpen.TabIndex = 259;
this.btnDOpen.Text = "门锁打开";
this.btnDOpen.UseVisualStyleBackColor = true;
this.btnDOpen.Click += new System.EventHandler(this.btnDOpen_Click);
//
// btnSuckingDiscDown
//
this.btnSuckingDiscDown.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSuckingDiscDown.Location = new System.Drawing.Point(173, 325);
this.btnSuckingDiscDown.Name = "btnSuckingDiscDown";
this.btnSuckingDiscDown.Size = new System.Drawing.Size(102, 34);
this.btnSuckingDiscDown.TabIndex = 258;
this.btnSuckingDiscDown.Text = "吸盘下降";
this.btnSuckingDiscDown.UseVisualStyleBackColor = true;
this.btnSuckingDiscDown.Click += new System.EventHandler(this.btnSuckingDiscDown_Click);
//
// btnSuckingDiscUp
//
this.btnSuckingDiscUp.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSuckingDiscUp.Location = new System.Drawing.Point(56, 325);
this.btnSuckingDiscUp.Name = "btnSuckingDiscUp";
this.btnSuckingDiscUp.Size = new System.Drawing.Size(102, 34);
this.btnSuckingDiscUp.TabIndex = 257;
this.btnSuckingDiscUp.Text = "吸盘上升";
this.btnSuckingDiscUp.UseVisualStyleBackColor = true;
this.btnSuckingDiscUp.Click += new System.EventHandler(this.btnSuckingDiscUp_Click);
// button2
//
this.button2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button2.Location = new System.Drawing.Point(263, 260);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(102, 34);
this.button2.TabIndex = 264;
this.button2.Text = "关闭运转ON";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button3
//
this.button3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button3.Location = new System.Drawing.Point(263, 223);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(102, 34);
this.button3.TabIndex = 263;
this.button3.Text = "打开运转ON";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// button4
//
this.button4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button4.Location = new System.Drawing.Point(143, 438);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(102, 34);
this.button4.TabIndex = 266;
this.button4.Text = "停止吹气";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// button5
//
this.button5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button5.Location = new System.Drawing.Point(143, 401);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(102, 34);
this.button5.TabIndex = 265;
this.button5.Text = "开始吹气";
this.button5.UseVisualStyleBackColor = true;
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// FrmIOStatus
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(829, 580);
this.ClientSize = new System.Drawing.Size(876, 580);
this.Controls.Add(this.button1);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.groupBox4);
......@@ -562,6 +616,10 @@
private System.Windows.Forms.Button btnDOpen;
private System.Windows.Forms.Button btnSuckingDiscDown;
private System.Windows.Forms.Button btnSuckingDiscUp;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button button5;
}
}
......@@ -318,5 +318,25 @@ namespace OnlineStore.AutoInOutStore
{
KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW);
}
private void button3_Click(object sender, EventArgs e)
{
KND.IOMove(IO_Type.Run_Sign, IO_VALUE.HIGH);
}
private void button2_Click(object sender, EventArgs e)
{
KND.IOMove(IO_Type.Run_Sign, IO_VALUE.LOW);
}
private void button5_Click(object sender, EventArgs e)
{
KND.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.HIGH);
}
private void button4_Click(object sender, EventArgs e)
{
KND.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
}
}
}
......@@ -223,6 +223,10 @@
this.btnGetOutTray = new System.Windows.Forms.Button();
this.lblDoorStatus = new System.Windows.Forms.Label();
this.btnBatchInStore = new System.Windows.Forms.Button();
this.批量上下轴ONToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.批量上下轴OFFToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator();
this.groupBox5.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
......@@ -1894,55 +1898,55 @@
// 启动ToolStripMenuItem
//
this.启动ToolStripMenuItem.Name = "启动ToolStripMenuItem";
this.启动ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.启动ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.启动ToolStripMenuItem.Text = "启动";
this.启动ToolStripMenuItem.Click += new System.EventHandler(this.启动ToolStripMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator1.Size = new System.Drawing.Size(141, 6);
//
// 停止ToolStripMenuItem
//
this.停止ToolStripMenuItem.Name = "停止ToolStripMenuItem";
this.停止ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.停止ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.停止ToolStripMenuItem.Text = "停止";
this.停止ToolStripMenuItem.Click += new System.EventHandler(this.停止ToolStripMenuItem_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator2.Size = new System.Drawing.Size(141, 6);
//
// 复位ToolStripMenuItem
//
this.复位ToolStripMenuItem.Name = "复位ToolStripMenuItem";
this.复位ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.复位ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.复位ToolStripMenuItem.Text = "复位";
this.复位ToolStripMenuItem.Click += new System.EventHandler(this.复位ToolStripMenuItem_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator3.Size = new System.Drawing.Size(141, 6);
//
// 回待机点ToolStripMenuItem
//
this.回待机点ToolStripMenuItem.Name = "回待机点ToolStripMenuItem";
this.回待机点ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.回待机点ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.回待机点ToolStripMenuItem.Text = "回待机点";
this.回待机点ToolStripMenuItem.Click += new System.EventHandler(this.回待机点ToolStripMenuItem_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator4.Size = new System.Drawing.Size(141, 6);
//
// 退出ToolStripMenuItem
//
this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.退出ToolStripMenuItem.Text = "退出系统";
this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click);
//
......@@ -1956,8 +1960,12 @@
this.料仓运转OFFToolStripMenuItem,
this.toolStripSeparator7,
this.打开舱门ToolStripMenuItem,
this.toolStripSeparator14,
this.关闭仓门ToolStripMenuItem,
this.toolStripSeparator8,
this.关闭仓门ToolStripMenuItem});
this.批量上下轴ONToolStripMenuItem,
this.toolStripSeparator13,
this.批量上下轴OFFToolStripMenuItem});
this.iO状态查看ToolStripMenuItem.Name = "iO状态查看ToolStripMenuItem";
this.iO状态查看ToolStripMenuItem.Size = new System.Drawing.Size(104, 25);
this.iO状态查看ToolStripMenuItem.Text = "IO状态查看";
......@@ -2528,6 +2536,30 @@
this.btnBatchInStore.UseVisualStyleBackColor = true;
this.btnBatchInStore.Click += new System.EventHandler(this.btnBatchInStore_Click);
//
// 批量上下轴ONToolStripMenuItem
//
this.批量上下轴ONToolStripMenuItem.Name = "批量上下轴ONToolStripMenuItem";
this.批量上下轴ONToolStripMenuItem.Size = new System.Drawing.Size(192, 26);
this.批量上下轴ONToolStripMenuItem.Text = "批量上下轴ON";
this.批量上下轴ONToolStripMenuItem.Click += new System.EventHandler(this.批量上下轴ONToolStripMenuItem_Click);
//
// 批量上下轴OFFToolStripMenuItem
//
this.批量上下轴OFFToolStripMenuItem.Name = "批量上下轴OFFToolStripMenuItem";
this.批量上下轴OFFToolStripMenuItem.Size = new System.Drawing.Size(192, 26);
this.批量上下轴OFFToolStripMenuItem.Text = "批量上下轴OFF";
this.批量上下轴OFFToolStripMenuItem.Click += new System.EventHandler(this.批量上下轴OFFToolStripMenuItem_Click);
//
// toolStripSeparator13
//
this.toolStripSeparator13.Name = "toolStripSeparator13";
this.toolStripSeparator13.Size = new System.Drawing.Size(189, 6);
//
// toolStripSeparator14
//
this.toolStripSeparator14.Name = "toolStripSeparator14";
this.toolStripSeparator14.Size = new System.Drawing.Size(189, 6);
//
// FrmStoreBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
......@@ -2773,6 +2805,10 @@
private System.Windows.Forms.Button btnReadLimit1;
private System.Windows.Forms.TextBox txtLimit1;
public System.Windows.Forms.Button btnUpdateStatus;
private System.Windows.Forms.ToolStripMenuItem 批量上下轴ONToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 批量上下轴OFFToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator14;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator13;
}
}
......@@ -1524,5 +1524,32 @@ namespace OnlineStore.AutoInOutStore
btnReadLimit1_Click(null, null);
btnReadLimit2_Click(null, null);
}
private void 批量上下轴ONToolStripMenuItem_Click(object sender, EventArgs e)
{
KND.IOMove(IO_Type.Run_Sign, IO_VALUE.HIGH);
Thread.Sleep(1000);
string portName = store.Config.Batch_Axis.DeviceName;
int slvAddr = store.Config.Batch_Axis.GetAxisValue();
ACServerManager.OpenPort(portName);
Thread.Sleep(50);
ACServerManager.InitSlvAddr(portName, slvAddr, store.Config.Batch_Axis.TargetSpeed, store.Config.Batch_Axis.AddSpeed, store.Config.Batch_Axis.DelSpeed);
Thread.Sleep(100);
ACServerManager.AlarmClear(portName, slvAddr);
Thread.Sleep(50);
ACServerManager.ServoOn(portName, slvAddr);
}
private void 批量上下轴OFFToolStripMenuItem_Click(object sender, EventArgs e)
{
ACServerManager.ServoOff(store.Config.Batch_Axis.DeviceName, store.Config.Batch_Axis.GetAxisValue());
//关闭串口,等下次重新打开
ACServerManager.ColsePort(store.Config.Batch_Axis.DeviceName);
Thread.Sleep(100);
KND.IOMove(IO_Type.Run_Sign, IO_VALUE.LOW);
}
}
}
......@@ -71,9 +71,6 @@
<Compile Include="store\LineAlarm.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="store\IOUtil.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ShuoKe\ShuoKeControls.cs" />
<Compile Include="store\model\AxisAlarmInfo.cs" />
......
......@@ -9,6 +9,7 @@ using System.Diagnostics;
using log4net;
using System.Reflection;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
namespace OnlineStore.DeviceLibrary
{
......
......@@ -42,7 +42,7 @@ DI,左侧门关闭,DoorColse_Single,203,192.168.200.11,0,左侧门关闭,X20,DI-24,0,
AXIS,(轴一)旋转轴,Middle_Axis,1,COM4,0,,,,,
AXIS,(轴二)升降轴轴,UpDown_Axis,1,COM5,0,,,,,
AXIS,(轴三)进出轴,InOut_Axis,1,COM6,0,,,,,
AXIS,(轴五)批量上下料轴,Batch_Axis,1,COM7,0,,,,,
AXIS,(轴五)批量上下料轴,Batch_Axis,1,COM3,0,,,,,
,,,,,,,,,,
,,,,,,,,,,
PRO,升降轴 进料口取料点 P1,UpDownAxis_DoorOPosition_P1,403000,,,,,,,
......@@ -114,7 +114,7 @@ PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,,
PRO,温湿度端口号,Humiture_Port,COM1,,,,,,,
,,,,,,,,,,
PRO,硕科步进电机(压紧轴)控制端口号,CompressAxis_PortName,COM3,,,,,,,
PRO,硕科步进电机(压紧轴)控制端口号,CompressAxis_PortName,COM2,,,,,,,
PRO,硕科步进电机(压紧轴)控制波特率,CompressAxis_PortBaudrate,9600,,,,,,,
PRO,硕科步进电机(压紧轴)控制奇偶校验,CompressAxis_PortParity,0,,,,,,,
PRO,硕科步进电机(压紧轴)控制停止位,CompressAxis_StopBits,1,,,,,,,
......
......@@ -1252,106 +1252,105 @@ namespace OnlineStore.DeviceLibrary
#region datalogic扫码枪代码
private bool IsNotScanCode = false;
private bool IsScanCode = false;
/// <summary>
/// 扫码枪数据接收
/// </summary>
/// <param name="message"></param>
public void onCodeReceived(string message)
{
try
{
message = ScanCodeManager.ReplaceCode(message);
if (message.Equals("") || string.IsNullOrEmpty(message))
{
IsNotScanCode = true;
IsScanCode = false;
CodeMsg = "没有收到二维码信息,请重新放入料盘";
LogUtil.info(LOGGER, StoreName + "没有收到二维码信息,请重新放入料盘");
return;
}
IsNotScanCode = false;
if (storeRunStatus.Equals(StoreRunStatus.Wait))
{
LogUtil.info(LOGGER, StoreName + "收到二维码【 " + message + "】,设备未启动,不需要发送服务器");
IsScanCode = false;
return;
}
// CodeMsg = "收到二维码【 " + message + "】,发送给服务器获取入库PosID";
LogUtil.info(LOGGER, StoreName + "收到二维码【 " + message + "】,发送给服务器获取入库PosID");
//发送扫码内容到服务器进行入库操作
Operation operation = getLineBoxStatus();
operation.op = 1;
operation.data = new Dictionary<string, string>() { { "code", message }, { "boxId", StoreID.ToString() } };
string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
Operation resultOperation = HttpHelper.Post(StoreManager.GetPostApi(server), operation, false);
if (resultOperation == null)
{
// CodeMsg = "二维码【" + message + "】没有收到服务器反馈";
LogUtil.info(LOGGER, StoreName + "二维码【" + message + "】没有收到服务器反馈!");
IsScanCode = false;
return;
}
else if (!string.IsNullOrEmpty(resultOperation.msg))
{
//如果有提示消息,直接显示提示
LogUtil.info(LOGGER, StoreName + "服务器反馈 二维码【" + message + "】 :" + resultOperation.msg);
IsScanCode = false;
return;
}
IsScanCode = false;
Dictionary<string, string> data = resultOperation.data;
if (data != null && data.ContainsKey(ParamDefine.posId) && data.ContainsKey(ParamDefine.plateH) && data.ContainsKey(ParamDefine.plateW))
{
//服务器返回时有:posId库位编号,plateW:料盘宽度,plateH:料盘高度,
//postId格式BoxId#位置
string posId = data[ParamDefine.posId];
string plateW = data[ParamDefine.plateW];
string plateH = data[ParamDefine.plateH];
string[] posArray = posId.Split('#');
if (!(posArray.Length == 2))
{
WarnMsg = StoreName + "入库库位格式错误:二维码【" + message + "】库位【" + posId + "】";
LogUtil.error(LOGGER, "服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
LogUtil.info(LOGGER, "服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
return;
}
int storeId = int.Parse(posArray[0]);
//根据发送的posId获取位置列表
AutoStorePosition position = CSVPositionReader<AutoStorePosition>.GetPositon(posId);
if (position == null)
{ //出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg = "入库未找到库位:二维码【" + message + "】库位【" + posId + "】 ";
LogUtil.error(LOGGER, "收到服务器入库命令:入库未找到库位:二维码【" + message + "】库位【" + posId + "】");
LogUtil.info(LOGGER, "收到服务器入库命令:入库未找到库位:二维码【" + message + "】库位【" + posId + "】");
return;
}
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
if (CanStarInOut())
{
IsScanCode = false;
InOutStoreParam param = new InOutStoreParam(message, posId, plateH, plateW, 0);
StartInStoreMove(param, true);
//如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil.info(LOGGER, StoreName + " 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 开始入库!");
}
else
{
LogUtil.info(LOGGER, StoreName + " 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 正在忙碌中,无法入库!");
IsScanCode = false;
}
}
}
catch (Exception ex)
{
IsScanCode = false;
LOGGER.Error(StoreName + ex.StackTrace);
}
}
//private bool IsNotScanCode = false;
//private bool IsScanCode = false;
///// <summary>
///// 发送二维码到服务器获取PosID
///// </summary>
//public void GetInStorePosId(string message)
//{
// try
// {
// message = ScanCodeManager.ReplaceCode(message);
// if (message.Equals("") || string.IsNullOrEmpty(message))
// {
// IsNotScanCode = true;
// IsScanCode = false;
// CodeMsg = "没有收到二维码信息,请重新放入料盘";
// LogUtil.info(LOGGER, StoreName + "没有收到二维码信息,请重新放入料盘");
// return;
// }
// IsNotScanCode = false;
// if (storeRunStatus.Equals(StoreRunStatus.Wait))
// {
// LogUtil.info(LOGGER, StoreName + "收到二维码【 " + message + "】,设备未启动,不需要发送服务器");
// IsScanCode = false;
// return;
// }
// // CodeMsg = "收到二维码【 " + message + "】,发送给服务器获取入库PosID";
// LogUtil.info(LOGGER, StoreName + "收到二维码【 " + message + "】,发送给服务器获取入库PosID");
// //发送扫码内容到服务器进行入库操作
// Operation operation = getLineBoxStatus();
// operation.op = 1;
// operation.data = new Dictionary<string, string>() { { "code", message }, { "boxId", StoreID.ToString() } };
// string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
// Operation resultOperation = HttpHelper.Post(StoreManager.GetPostApi(server), operation, false);
// if (resultOperation == null)
// {
// // CodeMsg = "二维码【" + message + "】没有收到服务器反馈";
// LogUtil.info(LOGGER, StoreName + "二维码【" + message + "】没有收到服务器反馈!");
// IsScanCode = false;
// return;
// }
// else if (!string.IsNullOrEmpty(resultOperation.msg))
// {
// //如果有提示消息,直接显示提示
// LogUtil.info(LOGGER, StoreName + "服务器反馈 二维码【" + message + "】 :" + resultOperation.msg);
// IsScanCode = false;
// return;
// }
// IsScanCode = false;
// Dictionary<string, string> data = resultOperation.data;
// if (data != null && data.ContainsKey(ParamDefine.posId) && data.ContainsKey(ParamDefine.plateH) && data.ContainsKey(ParamDefine.plateW))
// {
// //服务器返回时有:posId库位编号,plateW:料盘宽度,plateH:料盘高度,
// //postId格式BoxId#位置
// string posId = data[ParamDefine.posId];
// string plateW = data[ParamDefine.plateW];
// string plateH = data[ParamDefine.plateH];
// string[] posArray = posId.Split('#');
// if (!(posArray.Length == 2))
// {
// WarnMsg = StoreName + "入库库位格式错误:二维码【" + message + "】库位【" + posId + "】";
// LogUtil.error(LOGGER, "服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
// LogUtil.info(LOGGER, "服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
// return;
// }
// int storeId = int.Parse(posArray[0]);
// //根据发送的posId获取位置列表
// AutoStorePosition position = CSVPositionReader<AutoStorePosition>.GetPositon(posId);
// if (position == null)
// { //出入库没有找到服务器发送的库位,需要打印日志方便查询原因
// WarnMsg = "入库未找到库位:二维码【" + message + "】库位【" + posId + "】 ";
// LogUtil.error(LOGGER, "收到服务器入库命令:入库未找到库位:二维码【" + message + "】库位【" + posId + "】");
// LogUtil.info(LOGGER, "收到服务器入库命令:入库未找到库位:二维码【" + message + "】库位【" + posId + "】");
// return;
// }
// //TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
// if (CanStarInOut())
// {
// IsScanCode = false;
// InOutStoreParam param = new InOutStoreParam(message, posId, plateH, plateW, 0);
// StartInStoreMove(param, true);
// //如果当前正在出入库中,需要记录下来,等待空闲时执行
// LogUtil.info(LOGGER, StoreName + " 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 开始入库!");
// }
// else
// {
// LogUtil.info(LOGGER, StoreName + " 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 正在忙碌中,无法入库!");
// IsScanCode = false;
// }
// }
// }
// catch (Exception ex)
// {
// IsScanCode = false;
// LOGGER.Error(StoreName + ex.StackTrace);
// }
//}
#endregion
......@@ -1480,16 +1479,13 @@ namespace OnlineStore.DeviceLibrary
#region 与服务器通信定时器,每1秒向服务器通知一次状态,同时执行出库操作
private string CodeMsg = "";
private bool isInProcess = false;
private void server_connect_timer_Tick(object sender, EventArgs e)
{
if (isInProcess)
{
return;
}
//HumitureServer.RandomData(Config.GetTempAddrList());
}
isInProcess = true;
if (StoreManager.IsConnectServer)
{
......@@ -1511,7 +1507,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 获取整个料仓的状态
/// </summary>
private Operation getLineBoxStatus()
public Operation getLineBoxStatus()
{
//构建发送给服务器的对象
Operation lineOperation = new Operation();
......@@ -1543,9 +1539,9 @@ namespace OnlineStore.DeviceLibrary
if (WarnMsg.Equals(""))
{
boxStatus.msg = CodeMsg;
lineOperation.msg = CodeMsg;
CodeMsg = "";
boxStatus.msg = AutomaticBaiting.CodeMsg;
lineOperation.msg = AutomaticBaiting.CodeMsg;
AutomaticBaiting.CodeMsg = "";
}
//WarnMsg = "";
//状态
......
......@@ -13,21 +13,22 @@ namespace OnlineStore.DeviceLibrary
/// 0=未知。1=门打开,2=门关闭
/// </summary>
public static int DoorStatus = 2;
public static int LastHeight = 0;
public static int LastSize = 0;
public static string LastCode = "";
public static string LastPosId = "";
private static int LastHeight = 0;
private static int LastSize = 0;
private static string LastCode = "";
private static string LastPosId = "";
public static int AxisChangeValue = ConfigAppSettings.GetIntValue(Setting_Init.AxisChangeValue);
public static string WarnMsg = "";
public static string Name = "自动上下料";
public static StoreMoveInfo StoreMove = null;
public static string CodeMsg = "";
public static string Name = "批量上下料 ";
public static StoreMoveInfo StoreMove = null;
public static StoreRunStatus AutoBaitingStatus = StoreRunStatus.Wait;
//记录没开门状态下,已经出库的数量
public static int BatchOutStoreCount = 0;
public static int BatchOutStoreHeight = 0;
/// <summary>
/// 初始化数据
/// </summary>
......@@ -61,16 +62,16 @@ namespace OnlineStore.DeviceLibrary
/// 判断是否可以启动
/// </summary>
/// <returns></returns>
public static string CanStart()
public static string CanStart()
{
string msg = "";
//需要判断门关闭
if (!DoorIsClose())
{
msg = "上料机构门未关闭";
msg = "上料机构门未关闭";
return msg;
}
return msg;
}
......@@ -80,7 +81,7 @@ namespace OnlineStore.DeviceLibrary
BatchOutStoreHeight = 0;
LastCode = "";
LastPosId = "";
LastHeight = 0;
LastHeight = 0;
LastSize = 0;
}
......@@ -90,7 +91,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove.EndMove();
ClearInOutInfo();
KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW);
CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down,false);
CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, false);
BatchDoorClose(false);
}
public static bool Reset()
......@@ -98,7 +99,7 @@ namespace OnlineStore.DeviceLibrary
string msg = CanStart();
if (!String.IsNullOrEmpty(msg))
{
LogUtil.info(Name+"复位失败:"+msg);
LogUtil.info(Name + "复位失败:" + msg);
return false;
}
ClearInOutInfo();
......@@ -129,11 +130,11 @@ namespace OnlineStore.DeviceLibrary
{
case StoreMoveStep.AUTO_R01_CloseDoor:
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R02_AutoAxisHome);
LogUtil.info(Name + "复位中:自动轴原点返回");
LogUtil.info(Name + "复位中:批量上下料轴原点返回");
ACAxisHomeMove(StoreManager.Config.Batch_Axis);
break;
case StoreMoveStep.AUTO_R02_AutoAxisHome:
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R03_AutoAxisHome);
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R03_AutoAxisHome);
LogUtil.info(Name + "复位中:匀速向上运动,检测 是否有料盘");
ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.Batch_Axis.TargetSpeed);
break;
......@@ -142,7 +143,7 @@ namespace OnlineStore.DeviceLibrary
if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.LOW))
{
LogUtil.info(Name + "复位中: 没有料盘,不需要上料,上料轴回0点");
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R04_AutoBack);
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R04_AutoBack);
ACAxisHomeMove(StoreManager.Config.Batch_Axis);
}
else
......@@ -152,8 +153,8 @@ namespace OnlineStore.DeviceLibrary
AutoBaitingStatus = StoreRunStatus.Runing;
//TODO
StartInOut();
}
break;
}
break;
case StoreMoveStep.AUTO_R04_AutoBack:
LogUtil.info(Name + "复位完成");
StoreMove.EndMove();
......@@ -166,7 +167,7 @@ namespace OnlineStore.DeviceLibrary
public static bool StartInOut()
{
if((!StoreManager.Store.storeRunStatus.Equals(StoreRunStatus.Runing))||
if ((!StoreManager.Store.storeRunStatus.Equals(StoreRunStatus.Runing)) ||
(!StoreManager.Store.StoreMove.MoveType.Equals(StoreMoveType.None)))
{
LogUtil.error(Name + " 启动入料失败,料仓不在待机状态" + StoreManager.Store.storeRunStatus + ",MoveType" + StoreManager.Store.StoreMove.MoveType);
......@@ -190,11 +191,11 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogUtil.error(Name + " 启动入料失败, Status=" + AutoBaitingStatus+ ",MoveType="+ StoreMove.MoveType);
LogUtil.error(Name + " 启动入料失败, Status=" + AutoBaitingStatus + ",MoveType=" + StoreMove.MoveType);
return false;
}
}
private static int SuckingDisc_WorkCount = 0;
private static int SuckingDisc_WorkCount = 0;
private static void InStoreProcess()
{
......@@ -249,24 +250,24 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(IO_Type.Door_Up, IO_Type.Door_Down, true);
}
else if (StoreManager.Store.CanStarInOut())
{
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I05_GetPosId);
//计算高度
EndMovePosition = ACServerManager.GetActualtPosition(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue());
int height = Math.Abs(EndMovePosition - StartMovePosition) / AxisChangeValue;
int size = GetSize();
LogUtil.info(Name + "入料: 从服务器获取入库PosId,尺寸:【" + size + "*" + height + "】二维码【" + LastCode + "】");
LastHeight = height;
LastSize = size;
LastHeight = Math.Abs(EndMovePosition - StartMovePosition) / AxisChangeValue;
LastSize = GetSize();
LogUtil.info(Name + "入料: 从服务器获取入库PosId,尺寸:【" + LastSize + "*" + LastHeight + "】二维码【" + LastCode + "】");
GetInStorePosId(ProcessMsg());
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000));
StoreMove.OneWaitCanEndStep = true;
}
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.AUTO_I05_GetPosId))
{
//判断是否开始入库
if(StoreManager.Store.StoreMove.MoveType.Equals(StoreMoveType.InStore))
if (StoreManager.Store.StoreMove.MoveType.Equals(StoreMoveType.InStore))
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I06_WaitTrayLeave);
LogUtil.info(Name + "入料: 开始入料,等待料盘拿走");
......@@ -319,15 +320,15 @@ namespace OnlineStore.DeviceLibrary
}
}
private static void SuckingDiscWork()
{
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I03_SuckingDisc_Work);
SuckingDisc_WorkCount++;
LogUtil.info(Name + "入料: 吸盘开始第"+SuckingDisc_WorkCount+"次工作");
LogUtil.info(Name + "入料: 吸盘开始第" + SuckingDisc_WorkCount + "次工作");
KND.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.HIGH);
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(500));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SuckingDisc_Air, IO_VALUE.HIGH));
StoreMove.OneWaitCanEndStep = true;
}
}
private static void IsNeedScanCode()
{
LastCode = "";
......@@ -338,7 +339,7 @@ namespace OnlineStore.DeviceLibrary
if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH))
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I01_ScanCode);
LogUtil.info(Name + "入料: 开始扫码 ");
LogUtil.info(Name + "入料: 开始扫码 ");
StoreMove.WaitList.Add(WaitResultInfo.WaitCodeOK());
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000));
GetCameraCode();
......@@ -352,7 +353,7 @@ namespace OnlineStore.DeviceLibrary
AutoBaitingStatus = StoreRunStatus.Runing;
}
}
//public static bool StartOutStore(string PosId)
//{
......@@ -452,10 +453,10 @@ namespace OnlineStore.DeviceLibrary
// }
//}
public static bool DoorIsClose()
{
if (KND.IOValue(IO_Type.DoorClose_LoadMaterial).Equals(IO_VALUE.HIGH))
if (KND.IOValue(IO_Type.DoorClose_LoadMaterial).Equals(IO_VALUE.HIGH))
{
return true;
}
......@@ -473,11 +474,10 @@ namespace OnlineStore.DeviceLibrary
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.BatchDoor_Close, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.BatchDoor_Open, IO_VALUE.HIGH));
}
}
}
public static void BatchDoorClose(bool isWait)
{
{
ClearInOutInfo();
DoorStatus = 2;
if (isWait)
......@@ -488,6 +488,6 @@ namespace OnlineStore.DeviceLibrary
KND.IOMove(IO_Type.BatchDoor_Open, IO_VALUE.LOW);
KND.IOMove(IO_Type.BatchDoor_Close, IO_VALUE.HIGH);
}
}
}
......@@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
public partial class AutomaticBaiting
public partial class AutomaticBaiting
{
private static int StartMovePosition = 0;
......@@ -17,13 +17,13 @@ namespace OnlineStore.DeviceLibrary
private static void ACAxisSpeedMove(ConfigMoveAxis moveAxis, int targetSpeed)
{
AutoAxisIsMove = 1;
StartMovePosition = ACServerManager.GetActualtPosition(moveAxis.DeviceName,moveAxis.GetAxisValue());
StartMovePosition = ACServerManager.GetActualtPosition(moveAxis.DeviceName, moveAxis.GetAxisValue());
EndMovePosition = StartMovePosition;
StoreMove.WaitList.Add(WaitResultInfo.WaitAutoAxisStop(moveAxis));
StoreMove.WaitList.Add(WaitResultInfo.WaitAutoAxisStop(moveAxis));
ACServerManager.SpeedMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetSpeed);
}
private static void ACAxisRelMove(ConfigMoveAxis moveAxis, int targetPosition, int targetSpeed)
private static void ACAxisRelMove(ConfigMoveAxis moveAxis, int targetPosition, int targetSpeed)
{
StoreMove.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, targetPosition, targetSpeed));
moveAxis.TargetPosition = targetPosition;
......@@ -33,10 +33,10 @@ namespace OnlineStore.DeviceLibrary
{
moveAxis.TargetPosition = 0;
LogUtil.debug(Name + moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回");
StoreMove.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true));
StoreMove.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true));
ACServerManager.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed);
}
private static bool ACHomeMoveIsEnd(ConfigMoveAxis moveAxis, out string msg)
private static bool ACHomeMoveIsEnd(ConfigMoveAxis moveAxis, out string msg)
{
msg = "";
if (ACServerManager.IsHomeMoveEnd(moveAxis.DeviceName, moveAxis.GetAxisValue()))
......@@ -55,27 +55,27 @@ namespace OnlineStore.DeviceLibrary
//}
//else
//{
msg = Name + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警";
LogUtil.error( msg);
return false;
msg = Name + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警";
LogUtil.error(msg);
return false;
//}
}
}
return true;
}
return false;
}
private static void CheckWait()
{
List<WaitResultInfo> list = StoreMove.WaitList;
List<WaitResultInfo> list = StoreMove.WaitList;
if (list.Count <= 0)
{
StoreMove.EndStepWait();
return;
}
}
//当等待超过一分钟时,需要打印提示
TimeSpan span = DateTime.Now - StoreMove.LastSetpTime;
string NotOkMsg = "";
bool isOk = !StoreMove.OneWaitCanEndStep;
bool isOk = !StoreMove.OneWaitCanEndStep;
foreach (WaitResultInfo wait in list)
{
if (wait.IsEnd)
......@@ -181,16 +181,16 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
private static bool ACAxisMoveIsEnd(ConfigMoveAxis moveAxis, int targetPosition, int targetSpeed, out string msg)
{
msg = "";
msg = "";
bool isOk = ACServerManager.GetBusyStatus(moveAxis.DeviceName, moveAxis.GetAxisValue()).Equals(0);
if (isOk)
{
{
int outCount = ACServerManager.GetActualtPosition(moveAxis.DeviceName, moveAxis.GetAxisValue());
int errorCount = Math.Abs(outCount - targetPosition);
if (errorCount <= moveAxis.CanErrorCountMax)
{
return true;
}
}
//判断是否需要重新运动
if (StoreMove.CanWhileCount > 0)
{
......@@ -203,8 +203,8 @@ namespace OnlineStore.DeviceLibrary
{
msg = Name + moveAxis.DisplayStr + "目标[" + targetPosition + "]当前[" + outCount + "],误差过大,需要报警";
LogUtil.error(msg);
}
}
}
}
return false;
}
private static bool AxisMoveISEnd(WaitResultInfo wait)
......@@ -213,7 +213,8 @@ namespace OnlineStore.DeviceLibrary
if (wait.IsHomeMove)
{
wait.IsEnd = ACHomeMoveIsEnd(wait.AxisInfo, out msg);
}else
}
else
{
wait.IsEnd = ACAxisMoveIsEnd(wait.AxisInfo, wait.TargetPosition, wait.TargetSpeed, out msg);
}
......@@ -228,9 +229,9 @@ namespace OnlineStore.DeviceLibrary
}
}
if (!msg.Equals(""))
{
{
WarnMsg = msg;
StoreManager.Store.Alarm(StoreAlarmType.AxisMoveError, StoreManager.Store.GetAlarmCodeByAxis(wait.AxisInfo).ToString(), WarnMsg, StoreMove.MoveType);
StoreManager.Store.Alarm(StoreAlarmType.AxisMoveError, StoreManager.Store.GetAlarmCodeByAxis(wait.AxisInfo).ToString(), WarnMsg, StoreMove.MoveType);
}
return wait.IsEnd;
}
......@@ -258,7 +259,7 @@ namespace OnlineStore.DeviceLibrary
return result;
}
public static int GetSize()
public static int GetSize()
{
if (KND.IOValue(IO_Type.WidthCheck1).Equals(IO_VALUE.HIGH))
{
......@@ -270,17 +271,17 @@ namespace OnlineStore.DeviceLibrary
{
return 7;
}
}
}
return 0;
}
#region Halcon扫码枪代码
public bool IsTestCamera = false;
private static string spiltStr = "##";
private static char spiltStr = '#';
public static void GetCameraCode()
{
Task.Factory.StartNew(delegate ()
{
{
KND.IOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH);
string message = "";
List<string> codeList = CodeManager.CameraScan();
......@@ -290,7 +291,7 @@ namespace OnlineStore.DeviceLibrary
}
foreach (string str in codeList)
{
message = message + spiltStr + str ;
message = message + spiltStr + str;
//message = message + "=1+0x0-" + LastSize + "x" + LastHeight + " =" + str + spiltStr;
}
LastCode = message;
......@@ -300,9 +301,9 @@ namespace OnlineStore.DeviceLibrary
WarnMsg = "未扫到二维码,请拿走料盘";
}
KND.IOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW);
// StoreManager.Store.onCodeReceived(message);
});
}
// StoreManager.Store.onCodeReceived(message);
});
}
#endregion
private static void CylinderMove(string highType, string lowType, bool isWait)
......@@ -315,5 +316,118 @@ namespace OnlineStore.DeviceLibrary
KND.IOMove(lowType, IO_VALUE.LOW);
KND.IOMove(highType, IO_VALUE.HIGH);
}
private static string ProcessMsg()
{
string msg = "";
string[] codeArray = LastCode.Split(spiltStr);
foreach (string code in codeArray)
{
if (!code.Equals(""))
{
msg = msg + "=1+0x0-" + LastSize + "x" + LastHeight + " =" + code + spiltStr + spiltStr;
}
}
return msg;
}
private static bool IsNotScanCode = false;
private static bool IsScanCode = false;
/// <summary>
/// 发送二维码到服务器获取PosID
/// </summary>
private static void GetInStorePosId(string message)
{
try
{
message = ScanCodeManager.ReplaceCode(message);
if (message.Equals("") || string.IsNullOrEmpty(message))
{
IsNotScanCode = true;
IsScanCode = false;
CodeMsg = "没有收到二维码信息,请重新放入料盘";
LogUtil.info(Name + "没有收到二维码信息,请重新放入料盘");
return;
}
IsNotScanCode = false;
if (StoreManager.Store.storeRunStatus.Equals(StoreRunStatus.Wait))
{
LogUtil.info(Name + "收到二维码【 " + message + "】,设备未启动,不需要发送服务器");
IsScanCode = false;
return;
}
// CodeMsg = "收到二维码【 " + message + "】,发送给服务器获取入库PosID";
LogUtil.info(Name + "收到二维码【 " + message + "】,发送给服务器获取入库PosID");
//发送扫码内容到服务器进行入库操作
Operation operation = StoreManager.Store.getLineBoxStatus();
operation.op = 1;
operation.data = new Dictionary<string, string>() { { "code", message }, { "boxId", StoreManager.Store.StoreID.ToString() } };
string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
Operation resultOperation = HttpHelper.Post(StoreManager.GetPostApi(server), operation, false);
if (resultOperation == null)
{
// CodeMsg = "二维码【" + message + "】没有收到服务器反馈";
LogUtil.info(Name + "二维码【" + message + "】没有收到服务器反馈!");
IsScanCode = false;
return;
}
else if (!string.IsNullOrEmpty(resultOperation.msg))
{
//如果有提示消息,直接显示提示
LogUtil.info(Name + "服务器反馈 二维码【" + message + "】 :" + resultOperation.msg);
IsScanCode = false;
return;
}
IsScanCode = false;
Dictionary<string, string> data = resultOperation.data;
if (data != null && data.ContainsKey(ParamDefine.posId) && data.ContainsKey(ParamDefine.plateH) && data.ContainsKey(ParamDefine.plateW))
{
//服务器返回时有:posId库位编号,plateW:料盘宽度,plateH:料盘高度,
//postId格式BoxId#位置
string posId = data[ParamDefine.posId];
string plateW = data[ParamDefine.plateW];
string plateH = data[ParamDefine.plateH];
string[] posArray = posId.Split('#');
if (!(posArray.Length == 2))
{
WarnMsg = Name + "入库库位格式错误:二维码【" + message + "】库位【" + posId + "】";
LogUtil.error("服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
LogUtil.info("服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
return;
}
int storeId = int.Parse(posArray[0]);
//根据发送的posId获取位置列表
AutoStorePosition position = CSVPositionReader<AutoStorePosition>.GetPositon(posId);
if (position == null)
{ //出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg = "入库未找到库位:二维码【" + message + "】库位【" + posId + "】 ";
LogUtil.error("收到服务器入库命令:入库未找到库位:二维码【" + message + "】库位【" + posId + "】");
return;
}
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
if (StoreManager.Store.CanStarInOut())
{
LastPosId = posId;
IsScanCode = false;
InOutStoreParam param = new InOutStoreParam(message, posId, plateH, plateW, 0);
StoreManager.Store.StartInStoreMove(param, true);
//如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil.info(Name + " 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 开始入库!");
}
else
{
LogUtil.info(Name + " 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 正在忙碌中,无法入库!");
IsScanCode = false;
}
}
}
catch (Exception ex)
{
IsScanCode = false;
LogUtil.error(Name + ex.StackTrace);
}
}
}
}
......@@ -6,19 +6,17 @@ using System.Text;
namespace OnlineStore.DeviceLibrary
{
public enum IO_VALUE
public enum IO_VALUE
{
/// <summary>
/// 低位
/// </summary>
LOW = 0,
/// <summary>
/// 高位
/// </summary>
HIGH = 1,
/// <summary>
/// 低位
/// </summary>
LOW = 0,
/// <summary>
/// 高位
/// </summary>
HIGH = 1,
}
}
......@@ -129,20 +129,7 @@ namespace OnlineStore.DeviceLibrary
IsInWait = false;
WaitList = new List<WaitResultInfo>();
CanWhileCount = 0;
}
//public StoreMoveInfo clone()
//{
// return (StoreMoveInfo)this.MemberwiseClone();
//}
///// <summary>
///// 重置之后继续出入库时,退回上一个步骤执行
///// </summary>
//public void BackStep()
//{
// moveStep = PreMoveStep;
// IsInWait = false;
//}
}
}
public class WaitResultInfo
......@@ -227,6 +214,12 @@ namespace OnlineStore.DeviceLibrary
wait.IsEnd = false;
return wait;
}
/// <summary>
/// 6=等待轴原点信号亮
/// </summary>
/// <param name="axis"></param>
/// <param name="value"></param>
/// <returns></returns>
public static WaitResultInfo WaitAxisOrg(ConfigMoveAxis axis,IO_VALUE value )
{
WaitResultInfo wait = new WaitResultInfo();
......@@ -248,7 +241,7 @@ namespace OnlineStore.DeviceLibrary
// return wait;
//}
/// <summary>
/// 等待轴的反限位为指定值
///8= 等待轴的反限位为指定值
/// </summary>
public static WaitResultInfo WaitAxistNegativeLimit(ConfigMoveAxis moveAxis ,IO_VALUE ioValue)
{
......@@ -262,7 +255,7 @@ namespace OnlineStore.DeviceLibrary
return wait;
}
/// <summary>
/// 等待轴的正限位为指定值
///9= 等待轴的正限位为指定值
/// </summary>
public static WaitResultInfo WaitAxistPositiveLimit(ConfigMoveAxis moveAxis, IO_VALUE ioValue)
{
......@@ -278,7 +271,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 等待上料轴运动 停止
/// 10=等待上料轴运动 停止
/// </summary>
/// <returns></returns>
public static WaitResultInfo WaitAutoAxisStop(ConfigMoveAxis moveAxis)
......@@ -291,6 +284,10 @@ namespace OnlineStore.DeviceLibrary
wait.IsEnd = false;
return wait;
}
/// <summary>
/// 11=扫码OK
/// </summary>
/// <returns></returns>
public static WaitResultInfo WaitCodeOK()
{
WaitResultInfo wait = new WaitResultInfo();
......
......@@ -7,6 +7,18 @@ using System.Text;
namespace OnlineStore.LoadCSVLibrary
{
public enum IO_VALUE
{
/// <summary>
/// 低位
/// </summary>
LOW = 0,
/// <summary>
/// 高位
/// </summary>
HIGH = 1,
}
public class IO_Type
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!