Commit da1049af LN

ip配置修改

1 个父辈 8f727f6b
此文件类型无法预览
...@@ -28,13 +28,16 @@ ...@@ -28,13 +28,16 @@
this.txtWriteTime = new System.Windows.Forms.TextBox(); this.txtWriteTime = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label();
this.txtSlaveId = new System.Windows.Forms.TextBox(); this.txtSlaveId = new System.Windows.Forms.TextBox();
this.chbAutoRead = new System.Windows.Forms.CheckBox();
this.cmbWriteIO = new System.Windows.Forms.ComboBox(); this.cmbWriteIO = new System.Windows.Forms.ComboBox();
this.groupBox4 = new System.Windows.Forms.GroupBox(); this.groupBox4 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.groupBox3 = new System.Windows.Forms.GroupBox(); this.groupBox3 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.groupBox5 = new System.Windows.Forms.GroupBox(); this.groupBox5 = new System.Windows.Forms.GroupBox();
this.btnSRun = new System.Windows.Forms.Button();
this.btnRun2 = new System.Windows.Forms.Button();
this.btnRun3 = new System.Windows.Forms.Button();
this.btnRun1 = new System.Windows.Forms.Button();
this.btnCloseAll = new System.Windows.Forms.Button(); this.btnCloseAll = new System.Windows.Forms.Button();
this.btnStop1Up = new System.Windows.Forms.Button(); this.btnStop1Up = new System.Windows.Forms.Button();
this.chbDebug = new System.Windows.Forms.CheckBox(); this.chbDebug = new System.Windows.Forms.CheckBox();
...@@ -50,10 +53,6 @@ ...@@ -50,10 +53,6 @@
this.lblTrayNum = new System.Windows.Forms.Label(); this.lblTrayNum = new System.Windows.Forms.Label();
this.lblInstoreList = new System.Windows.Forms.Label(); this.lblInstoreList = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.btnRun1 = new System.Windows.Forms.Button();
this.btnRun3 = new System.Windows.Forms.Button();
this.btnRun2 = new System.Windows.Forms.Button();
this.btnSRun = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.groupBox4.SuspendLayout(); this.groupBox4.SuspendLayout();
this.groupBox3.SuspendLayout(); this.groupBox3.SuspendLayout();
...@@ -80,7 +79,6 @@ ...@@ -80,7 +79,6 @@
this.groupBox1.Controls.Add(this.txtWriteTime); this.groupBox1.Controls.Add(this.txtWriteTime);
this.groupBox1.Controls.Add(this.label5); this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.txtSlaveId); this.groupBox1.Controls.Add(this.txtSlaveId);
this.groupBox1.Controls.Add(this.chbAutoRead);
this.groupBox1.Controls.Add(this.cmbWriteIO); this.groupBox1.Controls.Add(this.cmbWriteIO);
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); 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(497, 6); this.groupBox1.Location = new System.Drawing.Point(497, 6);
...@@ -195,20 +193,6 @@ ...@@ -195,20 +193,6 @@
this.txtSlaveId.Text = "0"; this.txtSlaveId.Text = "0";
this.txtSlaveId.Visible = false; this.txtSlaveId.Visible = false;
// //
// chbAutoRead
//
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(370, 69);
this.chbAutoRead.Name = "chbAutoRead";
this.chbAutoRead.Size = new System.Drawing.Size(75, 21);
this.chbAutoRead.TabIndex = 244;
this.chbAutoRead.Text = "自动读取";
this.chbAutoRead.UseVisualStyleBackColor = true;
this.chbAutoRead.Visible = false;
//
// cmbWriteIO // cmbWriteIO
// //
this.cmbWriteIO.DisplayMember = "ProName"; this.cmbWriteIO.DisplayMember = "ProName";
...@@ -296,6 +280,58 @@ ...@@ -296,6 +280,58 @@
this.groupBox5.TabStop = false; this.groupBox5.TabStop = false;
this.groupBox5.Text = "IO操作测试"; this.groupBox5.Text = "IO操作测试";
// //
// btnSRun
//
this.btnSRun.BackColor = System.Drawing.Color.White;
this.btnSRun.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSRun.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSRun.Location = new System.Drawing.Point(199, 68);
this.btnSRun.Name = "btnSRun";
this.btnSRun.Size = new System.Drawing.Size(140, 34);
this.btnSRun.TabIndex = 263;
this.btnSRun.Text = "分盘装置电机1驱动";
this.btnSRun.UseVisualStyleBackColor = false;
this.btnSRun.Click += new System.EventHandler(this.btnSRun_Click);
//
// btnRun2
//
this.btnRun2.BackColor = System.Drawing.Color.White;
this.btnRun2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnRun2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnRun2.Location = new System.Drawing.Point(199, 26);
this.btnRun2.Name = "btnRun2";
this.btnRun2.Size = new System.Drawing.Size(140, 34);
this.btnRun2.TabIndex = 262;
this.btnRun2.Text = "皮带线2运转";
this.btnRun2.UseVisualStyleBackColor = false;
this.btnRun2.Click += new System.EventHandler(this.btnRun2_Click);
//
// btnRun3
//
this.btnRun3.BackColor = System.Drawing.Color.White;
this.btnRun3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnRun3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnRun3.Location = new System.Drawing.Point(44, 68);
this.btnRun3.Name = "btnRun3";
this.btnRun3.Size = new System.Drawing.Size(140, 34);
this.btnRun3.TabIndex = 261;
this.btnRun3.Text = "皮带线3运转";
this.btnRun3.UseVisualStyleBackColor = false;
this.btnRun3.Click += new System.EventHandler(this.btnRun3_Click);
//
// btnRun1
//
this.btnRun1.BackColor = System.Drawing.Color.White;
this.btnRun1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnRun1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnRun1.Location = new System.Drawing.Point(44, 26);
this.btnRun1.Name = "btnRun1";
this.btnRun1.Size = new System.Drawing.Size(140, 34);
this.btnRun1.TabIndex = 260;
this.btnRun1.Text = "皮带线1运转";
this.btnRun1.UseVisualStyleBackColor = false;
this.btnRun1.Click += new System.EventHandler(this.btnRun1_Click);
//
// btnCloseAll // btnCloseAll
// //
this.btnCloseAll.BackColor = System.Drawing.Color.White; this.btnCloseAll.BackColor = System.Drawing.Color.White;
...@@ -491,58 +527,6 @@ ...@@ -491,58 +527,6 @@
this.panel1.Size = new System.Drawing.Size(1369, 68); this.panel1.Size = new System.Drawing.Size(1369, 68);
this.panel1.TabIndex = 258; this.panel1.TabIndex = 258;
// //
// btnRun1
//
this.btnRun1.BackColor = System.Drawing.Color.White;
this.btnRun1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnRun1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnRun1.Location = new System.Drawing.Point(44, 26);
this.btnRun1.Name = "btnRun1";
this.btnRun1.Size = new System.Drawing.Size(140, 34);
this.btnRun1.TabIndex = 260;
this.btnRun1.Text = "皮带线1运转";
this.btnRun1.UseVisualStyleBackColor = false;
this.btnRun1.Click += new System.EventHandler(this.btnRun1_Click);
//
// btnRun3
//
this.btnRun3.BackColor = System.Drawing.Color.White;
this.btnRun3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnRun3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnRun3.Location = new System.Drawing.Point(44, 68);
this.btnRun3.Name = "btnRun3";
this.btnRun3.Size = new System.Drawing.Size(140, 34);
this.btnRun3.TabIndex = 261;
this.btnRun3.Text = "皮带先3运转";
this.btnRun3.UseVisualStyleBackColor = false;
this.btnRun3.Click += new System.EventHandler(this.btnRun3_Click);
//
// btnRun2
//
this.btnRun2.BackColor = System.Drawing.Color.White;
this.btnRun2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnRun2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnRun2.Location = new System.Drawing.Point(199, 26);
this.btnRun2.Name = "btnRun2";
this.btnRun2.Size = new System.Drawing.Size(140, 34);
this.btnRun2.TabIndex = 262;
this.btnRun2.Text = "皮带线2运转";
this.btnRun2.UseVisualStyleBackColor = false;
this.btnRun2.Click += new System.EventHandler(this.btnRun2_Click);
//
// btnSRun
//
this.btnSRun.BackColor = System.Drawing.Color.White;
this.btnSRun.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSRun.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSRun.Location = new System.Drawing.Point(199, 68);
this.btnSRun.Name = "btnSRun";
this.btnSRun.Size = new System.Drawing.Size(140, 34);
this.btnSRun.TabIndex = 263;
this.btnSRun.Text = "分盘装置电机1驱动";
this.btnSRun.UseVisualStyleBackColor = false;
this.btnSRun.Click += new System.EventHandler(this.btnSRun_Click);
//
// FrmDischargeLine // FrmDischargeLine
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
...@@ -582,7 +566,6 @@ ...@@ -582,7 +566,6 @@
private System.Windows.Forms.GroupBox groupBox4; private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.ComboBox cmbWriteIO; private System.Windows.Forms.ComboBox cmbWriteIO;
private System.Windows.Forms.CheckBox chbAutoRead;
private System.Windows.Forms.TextBox txtSlaveId; private System.Windows.Forms.TextBox txtSlaveId;
private System.Windows.Forms.GroupBox groupBox5; private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.Label lblThisSta; private System.Windows.Forms.Label lblThisSta;
......
...@@ -74,7 +74,7 @@ namespace OnlineStore.AssemblyLine ...@@ -74,7 +74,7 @@ namespace OnlineStore.AssemblyLine
{ {
return; return;
} }
if (chbAutoRead.Checked && this.Visible) if ( this.Visible)
{ {
ReadIOList(); ReadIOList();
lblTrayNum.Text = "托盘编码:" + TrayManager.GetTrayNum(equipBean.DeviceID); lblTrayNum.Text = "托盘编码:" + TrayManager.GetTrayNum(equipBean.DeviceID);
...@@ -312,8 +312,7 @@ namespace OnlineStore.AssemblyLine ...@@ -312,8 +312,7 @@ namespace OnlineStore.AssemblyLine
private void btnCloseAll_Click(object sender, EventArgs e) private void btnCloseAll_Click(object sender, EventArgs e)
{ {
IOManager.CloseDeviceDO(new List<ConfigIO>(equipBean.Config.DOList.Values));
foreach (Control con in groupBox5.Controls) foreach (Control con in groupBox5.Controls)
{ {
if (con is Button) if (con is Button)
...@@ -321,6 +320,10 @@ namespace OnlineStore.AssemblyLine ...@@ -321,6 +320,10 @@ namespace OnlineStore.AssemblyLine
con.BackColor = BackColor = Color.White; con.BackColor = BackColor = Color.White;
} }
} }
foreach(ConfigIO io in equipBase.baseConfig.DOList.Values)
{
IOManager.instance.WriteSingleDO(io.IO_IP, io.SlaveID, io.GetIOAddr(), IO_VALUE.LOW);
}
} }
private void btnStop1Up_Click(object sender, EventArgs e) private void btnStop1Up_Click(object sender, EventArgs e)
{ {
......
...@@ -112,18 +112,18 @@ ...@@ -112,18 +112,18 @@
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, internalKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, internalKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, internalKeyToken=b03f5f7f11d50a3a"> <metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 11</value> <value>17, 11</value>
</metadata> </metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, internalKeyToken=b77a5c561934e089"> <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>25</value> <value>25</value>
</metadata> </metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, internalKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
AAABAA8AMDAQAAEABABoBgAA9gAAACgoEAABAAQAyAQAAF4HAAAgIBAAAQAEAOgCAAAmDAAAGBgQAAEA AAABAA8AMDAQAAEABABoBgAA9gAAACgoEAABAAQAyAQAAF4HAAAgIBAAAQAEAOgCAAAmDAAAGBgQAAEA
......
...@@ -444,8 +444,7 @@ namespace OnlineStore.AssemblyLine ...@@ -444,8 +444,7 @@ namespace OnlineStore.AssemblyLine
private void btnCloseAll_Click(object sender, EventArgs e) private void btnCloseAll_Click(object sender, EventArgs e)
{ {
IOManager.CloseDeviceDO(new List<ConfigIO>(equipBean.Config.DOList.Values));
foreach (Control con in groupBox5.Controls) foreach (Control con in groupBox5.Controls)
{ {
if (con is Button) if (con is Button)
...@@ -453,6 +452,10 @@ namespace OnlineStore.AssemblyLine ...@@ -453,6 +452,10 @@ namespace OnlineStore.AssemblyLine
con.BackColor = BackColor = Color.White; con.BackColor = BackColor = Color.White;
} }
} }
foreach (ConfigIO io in equipBase.baseConfig.DOList.Values)
{
IOManager.instance.WriteSingleDO(io.IO_IP, io.SlaveID, io.GetIOAddr(), IO_VALUE.LOW);
}
} }
private void button3_Click(object sender, EventArgs e) private void button3_Click(object sender, EventArgs e)
...@@ -534,6 +537,23 @@ namespace OnlineStore.AssemblyLine ...@@ -534,6 +537,23 @@ namespace OnlineStore.AssemblyLine
LineManager.SaveFeedingEquipConfig(equipBean.Config); LineManager.SaveFeedingEquipConfig(equipBean.Config);
MessageBox.Show("保存成功!"); MessageBox.Show("保存成功!");
} }
private void btnScan_Click(object sender, EventArgs e)
{
List<string> LastCodeList = CodeManager.CameraScan(equipBean.Config.GetCameraList());
string msg = "";
if (LastCodeList.Count > 0)
{
foreach(string str in LastCodeList)
{
msg = str + "\r\n";
}
}
LogUtil.info(equipBean.Name+ "扫码测试结果:" + msg);
MessageBox.Show(equipBean.Name + "扫码测试结果:" + msg);
}
} }
} }
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmIOStatus)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmIOStatus));
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.button1 = new System.Windows.Forms.Button();
this.txtDOIndex = new System.Windows.Forms.TextBox(); this.txtDOIndex = new System.Windows.Forms.TextBox();
this.txtDoName = new System.Windows.Forms.TextBox(); this.txtDoName = new System.Windows.Forms.TextBox();
this.label17 = new System.Windows.Forms.Label(); this.label17 = new System.Windows.Forms.Label();
...@@ -27,7 +28,6 @@ ...@@ -27,7 +28,6 @@
this.txtWriteTime = new System.Windows.Forms.TextBox(); this.txtWriteTime = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label();
this.cmbWriteIO = new System.Windows.Forms.ComboBox(); this.cmbWriteIO = new System.Windows.Forms.ComboBox();
this.txtSlaveId = new System.Windows.Forms.TextBox();
this.chbAutoRead = new System.Windows.Forms.CheckBox(); this.chbAutoRead = new System.Windows.Forms.CheckBox();
this.groupBox4 = new System.Windows.Forms.GroupBox(); this.groupBox4 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
...@@ -53,7 +53,6 @@ ...@@ -53,7 +53,6 @@
this.btnSW4Run = new System.Windows.Forms.Button(); this.btnSW4Run = new System.Windows.Forms.Button();
this.btnDriveMotor_Run = new System.Windows.Forms.Button(); this.btnDriveMotor_Run = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.button1 = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.groupBox4.SuspendLayout(); this.groupBox4.SuspendLayout();
this.groupBox3.SuspendLayout(); this.groupBox3.SuspendLayout();
...@@ -78,7 +77,6 @@ ...@@ -78,7 +77,6 @@
this.groupBox1.Controls.Add(this.txtWriteTime); this.groupBox1.Controls.Add(this.txtWriteTime);
this.groupBox1.Controls.Add(this.label5); this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.cmbWriteIO); this.groupBox1.Controls.Add(this.cmbWriteIO);
this.groupBox1.Controls.Add(this.txtSlaveId);
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); 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(738, 5); this.groupBox1.Location = new System.Drawing.Point(738, 5);
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
...@@ -87,6 +85,18 @@ ...@@ -87,6 +85,18 @@
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "DO写入"; this.groupBox1.Text = "DO写入";
// //
// button1
//
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button1.Location = new System.Drawing.Point(238, 94);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(87, 34);
this.button1.TabIndex = 256;
this.button1.Text = "关闭";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// txtDOIndex // txtDOIndex
// //
this.txtDOIndex.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.txtDOIndex.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
...@@ -181,17 +191,6 @@ ...@@ -181,17 +191,6 @@
this.cmbWriteIO.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.cmbWriteIO_DrawItem); this.cmbWriteIO.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.cmbWriteIO_DrawItem);
this.cmbWriteIO.SelectedIndexChanged += new System.EventHandler(this.cmbWriteIO_SelectedIndexChanged); this.cmbWriteIO.SelectedIndexChanged += new System.EventHandler(this.cmbWriteIO_SelectedIndexChanged);
// //
// txtSlaveId
//
this.txtSlaveId.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtSlaveId.Location = new System.Drawing.Point(300, 24);
this.txtSlaveId.MaxLength = 10;
this.txtSlaveId.Name = "txtSlaveId";
this.txtSlaveId.Size = new System.Drawing.Size(43, 23);
this.txtSlaveId.TabIndex = 255;
this.txtSlaveId.Text = "0";
this.txtSlaveId.Visible = false;
//
// chbAutoRead // chbAutoRead
// //
this.chbAutoRead.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.chbAutoRead.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
...@@ -458,7 +457,8 @@ ...@@ -458,7 +457,8 @@
this.lblTrayNum.Size = new System.Drawing.Size(68, 17); this.lblTrayNum.Size = new System.Drawing.Size(68, 17);
this.lblTrayNum.TabIndex = 275; this.lblTrayNum.TabIndex = 275;
this.lblTrayNum.Text = "托盘编码:"; this.lblTrayNum.Text = "托盘编码:";
this.lblTrayNum.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.lblTrayNum.TextAlign = System.Drawing.ContentAlignment.BottomRight;
this.lblTrayNum.Visible = false;
// //
// btnCloseAll // btnCloseAll
// //
...@@ -523,18 +523,6 @@ ...@@ -523,18 +523,6 @@
this.panel1.Size = new System.Drawing.Size(1384, 881); this.panel1.Size = new System.Drawing.Size(1384, 881);
this.panel1.TabIndex = 248; this.panel1.TabIndex = 248;
// //
// button1
//
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button1.Location = new System.Drawing.Point(238, 94);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(87, 34);
this.button1.TabIndex = 256;
this.button1.Text = "关闭";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// FrmIOStatus // FrmIOStatus
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
...@@ -578,7 +566,6 @@ ...@@ -578,7 +566,6 @@
private System.Windows.Forms.ComboBox cmbWriteIO; private System.Windows.Forms.ComboBox cmbWriteIO;
private System.Windows.Forms.CheckBox chbAutoRead; private System.Windows.Forms.CheckBox chbAutoRead;
private System.Windows.Forms.TextBox txtDoName; private System.Windows.Forms.TextBox txtDoName;
private System.Windows.Forms.TextBox txtSlaveId;
private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
private System.Windows.Forms.GroupBox groupBox5; private System.Windows.Forms.GroupBox groupBox5;
......
...@@ -90,7 +90,7 @@ namespace OnlineStore.AssemblyLine ...@@ -90,7 +90,7 @@ namespace OnlineStore.AssemblyLine
if (chbAutoRead.Checked && this.Visible) if (chbAutoRead.Checked && this.Visible)
{ {
ReadIOList(); ReadIOList();
lblTrayNum.Text = "托盘编码:" + TrayManager.GetTrayNum(0); // lblTrayNum.Text = "托盘编码:" + TrayManager.GetTrayNum(0);
} }
} }
...@@ -128,14 +128,14 @@ namespace OnlineStore.AssemblyLine ...@@ -128,14 +128,14 @@ namespace OnlineStore.AssemblyLine
string deviceName = txtDoName.Text; string deviceName = txtDoName.Text;
int index = FormUtil.GetIntValue(txtDOIndex); int index = FormUtil.GetIntValue(txtDOIndex);
int time = FormUtil.GetIntValue(txtWriteTime); int time = FormUtil.GetIntValue(txtWriteTime);
int slaveId = FormUtil.GetIntValue(txtSlaveId);
if (time > 0) if (time > 0)
{ {
IOManager.instance.WriteSingleDO(deviceName, (byte)slaveId, (ushort)index, value, time); IOManager.instance.WriteSingleDO(deviceName, (byte)0, (ushort)index, value, time);
} }
else else
{ {
IOManager.instance.WriteSingleDO(deviceName, (byte)slaveId, (ushort)index, value); IOManager.instance.WriteSingleDO(deviceName, (byte)0, (ushort)index, value);
} }
} }
...@@ -148,8 +148,7 @@ namespace OnlineStore.AssemblyLine ...@@ -148,8 +148,7 @@ namespace OnlineStore.AssemblyLine
{ {
// txtIp.Text = io.DeviceName; // txtIp.Text = io.DeviceName;
txtDOIndex.Text = io.GetIOAddr().ToString(); txtDOIndex.Text = io.GetIOAddr().ToString();
txtDoName.Text = io.IO_IP; txtDoName.Text = io.IO_IP;
txtSlaveId.Text = io.SlaveID.ToString();
IOTextControl newControl = DOControlList[io.ProName]; IOTextControl newControl = DOControlList[io.ProName];
if (selectControl != null) { selectControl.BackColor = Color.White; } if (selectControl != null) { selectControl.BackColor = Color.White; }
newControl.BackColor = Color.SkyBlue; newControl.BackColor = Color.SkyBlue;
......
...@@ -112,18 +112,18 @@ ...@@ -112,18 +112,18 @@
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, internalKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, internalKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, internalKeyToken=b03f5f7f11d50a3a"> <metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 11</value> <value>17, 11</value>
</metadata> </metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, internalKeyToken=b77a5c561934e089"> <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>75</value> <value>75</value>
</metadata> </metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, internalKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
AAABAA8AMDAQAAEABABoBgAA9gAAACgoEAABAAQAyAQAAF4HAAAgIBAAAQAEAOgCAAAmDAAAGBgQAAEA AAABAA8AMDAQAAEABABoBgAA9gAAACgoEAABAAQAyAQAAF4HAAAgIBAAAQAEAOgCAAAmDAAAGBgQAAEA
......
...@@ -44,9 +44,8 @@ ...@@ -44,9 +44,8 @@
this.btnCopyLog = new System.Windows.Forms.Button(); this.btnCopyLog = new System.Windows.Forms.Button();
this.btnClearLog = new System.Windows.Forms.Button(); this.btnClearLog = new System.Windows.Forms.Button();
this.logBox = new System.Windows.Forms.RichTextBox(); this.logBox = new System.Windows.Forms.RichTextBox();
this.btnUpdateStatus = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox(); this.groupBox3 = new System.Windows.Forms.GroupBox();
this.chbLineDebug = new System.Windows.Forms.CheckBox(); this.btnUpdateStatus = new System.Windows.Forms.Button();
this.lblStatus = new System.Windows.Forms.Label(); this.lblStatus = new System.Windows.Forms.Label();
this.lblCID = new System.Windows.Forms.Label(); this.lblCID = new System.Windows.Forms.Label();
this.lblWarnMsg = new System.Windows.Forms.Label(); this.lblWarnMsg = new System.Windows.Forms.Label();
...@@ -131,6 +130,7 @@ ...@@ -131,6 +130,7 @@
this.groupBox1.TabIndex = 195; this.groupBox1.TabIndex = 195;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "料仓通信测试"; this.groupBox1.Text = "料仓通信测试";
this.groupBox1.Visible = false;
// //
// lblPosId // lblPosId
// //
...@@ -252,22 +252,9 @@ ...@@ -252,22 +252,9 @@
this.logBox.TabIndex = 106; this.logBox.TabIndex = 106;
this.logBox.Text = ""; this.logBox.Text = "";
// //
// btnUpdateStatus
//
this.btnUpdateStatus.BackColor = System.Drawing.Color.White;
this.btnUpdateStatus.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUpdateStatus.Location = new System.Drawing.Point(241, 82);
this.btnUpdateStatus.Name = "btnUpdateStatus";
this.btnUpdateStatus.Size = new System.Drawing.Size(213, 35);
this.btnUpdateStatus.TabIndex = 195;
this.btnUpdateStatus.Text = "更改为调试状态";
this.btnUpdateStatus.UseVisualStyleBackColor = false;
this.btnUpdateStatus.Click += new System.EventHandler(this.btnUpdateStatus_Click);
//
// groupBox3 // groupBox3
// //
this.groupBox3.Controls.Add(this.btnUpdateStatus); this.groupBox3.Controls.Add(this.btnUpdateStatus);
this.groupBox3.Controls.Add(this.chbLineDebug);
this.groupBox3.Controls.Add(this.lblStatus); this.groupBox3.Controls.Add(this.lblStatus);
this.groupBox3.Controls.Add(this.lblCID); this.groupBox3.Controls.Add(this.lblCID);
this.groupBox3.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.groupBox3.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
...@@ -278,17 +265,17 @@ ...@@ -278,17 +265,17 @@
this.groupBox3.TabStop = false; this.groupBox3.TabStop = false;
this.groupBox3.Text = "流水线信息"; this.groupBox3.Text = "流水线信息";
// //
// chbLineDebug // btnUpdateStatus
// //
this.chbLineDebug.AutoSize = true; this.btnUpdateStatus.BackColor = System.Drawing.Color.White;
this.chbLineDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnUpdateStatus.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.chbLineDebug.Location = new System.Drawing.Point(14, 82); this.btnUpdateStatus.Location = new System.Drawing.Point(241, 82);
this.chbLineDebug.Name = "chbLineDebug"; this.btnUpdateStatus.Name = "btnUpdateStatus";
this.chbLineDebug.Size = new System.Drawing.Size(126, 24); this.btnUpdateStatus.Size = new System.Drawing.Size(213, 35);
this.chbLineDebug.TabIndex = 196; this.btnUpdateStatus.TabIndex = 195;
this.chbLineDebug.Text = "流水线运转测试"; this.btnUpdateStatus.Text = "更改为调试状态";
this.chbLineDebug.UseVisualStyleBackColor = true; this.btnUpdateStatus.UseVisualStyleBackColor = false;
this.chbLineDebug.CheckedChanged += new System.EventHandler(this.chbLineDebug_CheckedChanged); this.btnUpdateStatus.Click += new System.EventHandler(this.btnUpdateStatus_Click);
// //
// lblStatus // lblStatus
// //
...@@ -431,31 +418,33 @@ ...@@ -431,31 +418,33 @@
// 扫码测试ToolStripMenuItem // 扫码测试ToolStripMenuItem
// //
this.扫码测试ToolStripMenuItem.Name = "扫码测试ToolStripMenuItem"; this.扫码测试ToolStripMenuItem.Name = "扫码测试ToolStripMenuItem";
this.扫码测试ToolStripMenuItem.Size = new System.Drawing.Size(160, 26); this.扫码测试ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.扫码测试ToolStripMenuItem.Text = "扫码测试"; this.扫码测试ToolStripMenuItem.Text = "扫码测试";
this.扫码测试ToolStripMenuItem.Visible = false;
this.扫码测试ToolStripMenuItem.Click += new System.EventHandler(this.扫码测试ToolStripMenuItem_Click); this.扫码测试ToolStripMenuItem.Click += new System.EventHandler(this.扫码测试ToolStripMenuItem_Click);
// //
// toolStripSeparator6 // toolStripSeparator6
// //
this.toolStripSeparator6.Name = "toolStripSeparator6"; this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(157, 6); this.toolStripSeparator6.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator6.Visible = false;
// //
// 二维码学习ToolStripMenuItem // 二维码学习ToolStripMenuItem
// //
this.二维码学习ToolStripMenuItem.Name = "二维码学习ToolStripMenuItem"; this.二维码学习ToolStripMenuItem.Name = "二维码学习ToolStripMenuItem";
this.二维码学习ToolStripMenuItem.Size = new System.Drawing.Size(160, 26); this.二维码学习ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.二维码学习ToolStripMenuItem.Text = "二维码学习"; this.二维码学习ToolStripMenuItem.Text = "二维码学习";
this.二维码学习ToolStripMenuItem.Click += new System.EventHandler(this.二维码学习ToolStripMenuItem_Click); this.二维码学习ToolStripMenuItem.Click += new System.EventHandler(this.二维码学习ToolStripMenuItem_Click);
// //
// toolStripSeparator7 // toolStripSeparator7
// //
this.toolStripSeparator7.Name = "toolStripSeparator7"; this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(157, 6); this.toolStripSeparator7.Size = new System.Drawing.Size(177, 6);
// //
// 托盘初始化ToolStripMenuItem // 托盘初始化ToolStripMenuItem
// //
this.托盘初始化ToolStripMenuItem.Name = "托盘初始化ToolStripMenuItem"; this.托盘初始化ToolStripMenuItem.Name = "托盘初始化ToolStripMenuItem";
this.托盘初始化ToolStripMenuItem.Size = new System.Drawing.Size(160, 26); this.托盘初始化ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.托盘初始化ToolStripMenuItem.Text = "托盘编码"; this.托盘初始化ToolStripMenuItem.Text = "托盘编码";
this.托盘初始化ToolStripMenuItem.Click += new System.EventHandler(this.托盘初始化ToolStripMenuItem_Click); this.托盘初始化ToolStripMenuItem.Click += new System.EventHandler(this.托盘初始化ToolStripMenuItem_Click);
// //
...@@ -607,10 +596,9 @@ ...@@ -607,10 +596,9 @@
private System.Windows.Forms.ComboBox cmbBoxIndex; private System.Windows.Forms.ComboBox cmbBoxIndex;
private System.Windows.Forms.Button btnInStoreTset; private System.Windows.Forms.Button btnInStoreTset;
private System.Windows.Forms.Label lblPosId; private System.Windows.Forms.Label lblPosId;
private System.Windows.Forms.Button btnUpdateStatus;
private System.Windows.Forms.CheckBox chbLineDebug;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator7; private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
private System.Windows.Forms.ToolStripMenuItem 托盘初始化ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 托盘初始化ToolStripMenuItem;
private System.Windows.Forms.Button btnUpdateStatus;
} }
} }
...@@ -76,7 +76,7 @@ namespace OnlineStore.AssemblyLine ...@@ -76,7 +76,7 @@ namespace OnlineStore.AssemblyLine
} }
lblCID.Text = ConfigAppSettings.GetValue(Setting_Init.Line_CID); lblCID.Text = ConfigAppSettings.GetValue(Setting_Init.Line_CID);
chbLineDebug.Checked = TrayManager.LineRunTest;
} }
private void AddForm(string text, Form form) private void AddForm(string text, Form form)
{ {
...@@ -124,24 +124,25 @@ namespace OnlineStore.AssemblyLine ...@@ -124,24 +124,25 @@ namespace OnlineStore.AssemblyLine
{ {
this.listView1.Columns.Clear(); this.listView1.Columns.Clear();
AddHealder("设备名称", 100); AddHealder("设备名称", 100);
AddHealder("报警", 100); AddHealder("启用", 40);
// AddHealder("设备状态", 100); AddHealder("报警", 100);
AddHealder("状态", 100); AddHealder("状态", 100);
AddHealder("BOX_CID", 80); AddHealder("BOX_CID", 80);
AddHealder("BOX报警", 100); AddHealder("BOX报警", 100);
AddHealder("更新时间", 80); AddHealder("更新时间", 80);
AddHealder("BOX状态", listView1.Size.Width - 100 - 80 - 80 - 100 - 100 - 100 - 8); AddHealder("BOX状态", listView1.Size.Width - 100 - 80 - 80 - 100 - 100 - 100 -40- 8);
foreach (MoveEquip move in lineBean.MoveEquipMap.Values) foreach (MoveEquip move in lineBean.MoveEquipMap.Values)
{ {
ListViewItem lvi = new ListViewItem(); ListViewItem lvi = new ListViewItem();
lvi.Text = move.Name; lvi.Text = move.Name;
lvi.SubItems.Add(move.Config.IsDebug.Equals(1) ? "✘" : "✔");
lvi.SubItems.Add(move.alarmType.ToString()); lvi.SubItems.Add(move.alarmType.ToString());
// lvi.SubItems.Add(move.lineStatus.ToString()); // lvi.SubItems.Add(move.lineStatus.ToString());
lvi.SubItems.Add(KTK_Store.GetRunStr(move.lineStatus, move.runStatus)); lvi.SubItems.Add(KTK_Store.GetRunStr(move.lineStatus, move.runStatus));
BoxInfo box = LineServer.GetBoxInfo(move.DeviceID); BoxInfo box = LineServer.GetBoxInfo(move.DeviceID);
if (box != null) if (box != null)
{ {
lvi.SubItems.Add(box.CId.ToString()); lvi.SubItems.Add(box.CId.ToString());
lvi.SubItems.Add(box.SAlarmType.ToString()); lvi.SubItems.Add(box.SAlarmType.ToString());
lvi.SubItems.Add(box.LastMsgTime.ToLongTimeString()); lvi.SubItems.Add(box.LastMsgTime.ToLongTimeString());
lvi.SubItems.Add(box.ToShowStr()); lvi.SubItems.Add(box.ToShowStr());
...@@ -162,7 +163,6 @@ namespace OnlineStore.AssemblyLine ...@@ -162,7 +163,6 @@ namespace OnlineStore.AssemblyLine
ListViewItem lvi = new ListViewItem(); ListViewItem lvi = new ListViewItem();
lvi.Text = equip.Name; lvi.Text = equip.Name;
lvi.SubItems.Add(equip.alarmType.ToString()); lvi.SubItems.Add(equip.alarmType.ToString());
// lvi.SubItems.Add(move.lineStatus.ToString());
lvi.SubItems.Add(KTK_Store.GetRunStr(equip.lineStatus, equip.runStatus)); lvi.SubItems.Add(KTK_Store.GetRunStr(equip.lineStatus, equip.runStatus));
this.listView1.Items.Add(lvi); this.listView1.Items.Add(lvi);
} }
...@@ -173,7 +173,6 @@ namespace OnlineStore.AssemblyLine ...@@ -173,7 +173,6 @@ namespace OnlineStore.AssemblyLine
ListViewItem lvi = new ListViewItem(); ListViewItem lvi = new ListViewItem();
lvi.Text = equip.Name; lvi.Text = equip.Name;
lvi.SubItems.Add(equip.alarmType.ToString()); lvi.SubItems.Add(equip.alarmType.ToString());
// lvi.SubItems.Add(move.lineStatus.ToString());
lvi.SubItems.Add(KTK_Store.GetRunStr(equip.lineStatus, equip.runStatus)); lvi.SubItems.Add(KTK_Store.GetRunStr(equip.lineStatus, equip.runStatus));
this.listView1.Items.Add(lvi); this.listView1.Items.Add(lvi);
} }
...@@ -424,44 +423,56 @@ namespace OnlineStore.AssemblyLine ...@@ -424,44 +423,56 @@ namespace OnlineStore.AssemblyLine
} }
} }
int i = 0; int i = 0;
int item_debug_index = 1;
int item_alarm_index = 2;
int item_runStr_index = 3;
int item_cid_index = 4;
int item_SAlarmType_index = 5;
int item_LastMsgTime_index = 6;
int item_BoxStr_index =7;
foreach (MoveEquip move in lineBean.MoveEquipMap.Values) foreach (MoveEquip move in lineBean.MoveEquipMap.Values)
{ {
ListViewItem lvi = new ListViewItem(); ListViewItem lvi = new ListViewItem();
lvi.Text = move.Name; lvi.Text = move.Name;
SetItemText(i, 1, move.alarmType.ToString()); SetItemText(i, item_debug_index, move.Config.IsDebug.Equals(1) ? "✘" : "✔");
SetItemText(i, 2, KTK_Store.GetRunStr(move.lineStatus, move.runStatus)); SetItemText(i, item_alarm_index, move.alarmType.ToString());
SetItemText(i, item_runStr_index, KTK_Store.GetRunStr(move.lineStatus, move.runStatus));
BoxInfo box = LineServer.GetBoxInfo(move.DeviceID); BoxInfo box = LineServer.GetBoxInfo(move.DeviceID);
if (box != null) if (box != null)
{ {
SetItemText(i, 3, box.CId.ToString()); SetItemText(i, item_cid_index, box.CId.ToString());
SetItemText(i, 4, box.SAlarmType.ToString()); SetItemText(i, item_SAlarmType_index, box.SAlarmType.ToString());
SetItemText(i, 5, box.LastMsgTime.ToLongTimeString()); SetItemText(i, item_LastMsgTime_index, box.LastMsgTime.ToLongTimeString());
SetItemText(i, 6, box.ToShowStr()); SetItemText(i, item_BoxStr_index, box.ToShowStr());
} }
SetItemColor(i,move.runStatus); SetItemColor(i,move.runStatus);
i++; i++;
} }
i++; i++;
foreach (FeedingEquip equip in lineBean.FeedingEquipMap.Values) foreach (FeedingEquip equip in lineBean.FeedingEquipMap.Values)
{ {
SetItemText(i, 1, equip.alarmType.ToString()); SetItemText(i, item_debug_index, equip.Config.IsDebug.Equals(1) ? "✘" : "✔");
SetItemText(i, 2, KTK_Store.GetRunStr(equip.lineStatus, equip.runStatus)); SetItemText(i, item_alarm_index, equip.alarmType.ToString());
SetItemText(i, item_runStr_index, KTK_Store.GetRunStr(equip.lineStatus, equip.runStatus));
SetItemColor(i, equip.runStatus); SetItemColor(i, equip.runStatus);
i++; i++;
} }
i++; i++;
foreach (ProvidingEquip equip in lineBean.ProvidingEquipMap.Values) foreach (ProvidingEquip equip in lineBean.ProvidingEquipMap.Values)
{ {
SetItemText(i, 1, equip.alarmType.ToString()); SetItemText(i, item_debug_index, equip.Config.IsDebug.Equals(1) ? "✘" : "✔");
SetItemText(i, 2, KTK_Store.GetRunStr(equip.lineStatus, equip.runStatus)); SetItemText(i, item_alarm_index, equip.alarmType.ToString());
SetItemText(i, item_runStr_index, KTK_Store.GetRunStr(equip.lineStatus, equip.runStatus));
SetItemColor(i, equip.runStatus); SetItemColor(i, equip.runStatus);
i++; i++;
} }
i++; i++;
foreach (DischargeLine equip in lineBean.DisLineMap.Values) foreach (DischargeLine equip in lineBean.DisLineMap.Values)
{ {
SetItemText(i, 1, equip.alarmType.ToString()); SetItemText(i, item_debug_index, equip.Config.IsDebug.Equals(1) ? "✘" : "✔");
SetItemText(i, 2, KTK_Store.GetRunStr(equip.lineStatus, equip.runStatus)); SetItemText(i, item_alarm_index, equip.alarmType.ToString());
SetItemText(i, item_runStr_index, KTK_Store.GetRunStr(equip.lineStatus, equip.runStatus));
SetItemColor(i, equip.runStatus); SetItemColor(i, equip.runStatus);
i++; i++;
} }
...@@ -488,7 +499,7 @@ namespace OnlineStore.AssemblyLine ...@@ -488,7 +499,7 @@ namespace OnlineStore.AssemblyLine
SetMenuS(停止TToolStripMenuItem, false); SetMenuS(停止TToolStripMenuItem, false);
} }
} }
private void SetItemColor(int i, LineRunStatus runStatus) private void SetItemColor(int i, LineRunStatus runStatus)
{ {
if (runStatus.Equals(LineRunStatus.Wait)) if (runStatus.Equals(LineRunStatus.Wait))
...@@ -526,10 +537,13 @@ namespace OnlineStore.AssemblyLine ...@@ -526,10 +537,13 @@ namespace OnlineStore.AssemblyLine
} }
private void SetItemText(int rowIndex, int subIndex, string value) private void SetItemText(int rowIndex, int subIndex, string value)
{ {
if (!this.listView1.Items[rowIndex].SubItems[subIndex].Text.Equals(value)) if (this.listView1.Items[rowIndex].SubItems.Count > subIndex)
{ {
this.listView1.Items[rowIndex].SubItems[subIndex].Text = value; if (!this.listView1.Items[rowIndex].SubItems[subIndex].Text.Equals(value))
} {
this.listView1.Items[rowIndex].SubItems[subIndex].Text = value;
}
}
} }
private void chbAutoRun_CheckedChanged(object sender, EventArgs e) private void chbAutoRun_CheckedChanged(object sender, EventArgs e)
{ {
...@@ -583,13 +597,13 @@ namespace OnlineStore.AssemblyLine ...@@ -583,13 +597,13 @@ namespace OnlineStore.AssemblyLine
private void 扫码测试ToolStripMenuItem_Click(object sender, EventArgs e) private void 扫码测试ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
//lineBean. GetCameraCode(); //lineBean. GetCameraCode();
List<string> codes = CodeManager.CameraScan(); //List<string> codes = CodeManager.CameraScan();
string result = ""; //string result = "";
foreach (string s in codes) //foreach (string s in codes)
{ //{
result += s + "\r\n"; // result += s + "\r\n";
} //}
LogUtil.info("扫到二维码:" + result); //LogUtil.info("扫到二维码:" + result);
} }
private void 二维码学习ToolStripMenuItem_Click(object sender, EventArgs e) private void 二维码学习ToolStripMenuItem_Click(object sender, EventArgs e)
...@@ -684,24 +698,7 @@ namespace OnlineStore.AssemblyLine ...@@ -684,24 +698,7 @@ namespace OnlineStore.AssemblyLine
} }
} }
private void chbLineDebug_CheckedChanged(object sender, EventArgs e)
{
if (!LoadOk)
{
return;
}
LogUtil.info("点击【流水线转动测试="+chbLineDebug.Checked+"】");
if (chbLineDebug.Checked)
{
ConfigAppSettings.SaveValue(Setting_Init.LineRunTest, 1);
TrayManager.LineRunTest = chbLineDebug.Checked;
}
else
{
ConfigAppSettings.SaveValue(Setting_Init.LineRunTest, 0);
TrayManager.LineRunTest = chbLineDebug.Checked;
}
}
private void 托盘初始化ToolStripMenuItem_Click(object sender, EventArgs e) private void 托盘初始化ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
this.txtWriteTime = new System.Windows.Forms.TextBox(); this.txtWriteTime = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label();
this.txtSlaveId = new System.Windows.Forms.TextBox(); this.txtSlaveId = new System.Windows.Forms.TextBox();
this.chbAutoRead = new System.Windows.Forms.CheckBox();
this.cmbWriteIO = new System.Windows.Forms.ComboBox(); this.cmbWriteIO = new System.Windows.Forms.ComboBox();
this.groupBox4 = new System.Windows.Forms.GroupBox(); this.groupBox4 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
...@@ -96,7 +95,6 @@ ...@@ -96,7 +95,6 @@
this.groupBox1.Controls.Add(this.txtWriteTime); this.groupBox1.Controls.Add(this.txtWriteTime);
this.groupBox1.Controls.Add(this.label5); this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.txtSlaveId); this.groupBox1.Controls.Add(this.txtSlaveId);
this.groupBox1.Controls.Add(this.chbAutoRead);
this.groupBox1.Controls.Add(this.cmbWriteIO); this.groupBox1.Controls.Add(this.cmbWriteIO);
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); 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(497, 6); this.groupBox1.Location = new System.Drawing.Point(497, 6);
...@@ -211,20 +209,6 @@ ...@@ -211,20 +209,6 @@
this.txtSlaveId.Text = "0"; this.txtSlaveId.Text = "0";
this.txtSlaveId.Visible = false; this.txtSlaveId.Visible = false;
// //
// chbAutoRead
//
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(370, 69);
this.chbAutoRead.Name = "chbAutoRead";
this.chbAutoRead.Size = new System.Drawing.Size(75, 21);
this.chbAutoRead.TabIndex = 244;
this.chbAutoRead.Text = "自动读取";
this.chbAutoRead.UseVisualStyleBackColor = true;
this.chbAutoRead.Visible = false;
//
// cmbWriteIO // cmbWriteIO
// //
this.cmbWriteIO.DisplayMember = "ProName"; this.cmbWriteIO.DisplayMember = "ProName";
...@@ -791,7 +775,6 @@ ...@@ -791,7 +775,6 @@
private System.Windows.Forms.GroupBox groupBox4; private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.ComboBox cmbWriteIO; private System.Windows.Forms.ComboBox cmbWriteIO;
private System.Windows.Forms.CheckBox chbAutoRead;
private System.Windows.Forms.TextBox txtSlaveId; private System.Windows.Forms.TextBox txtSlaveId;
private System.Windows.Forms.GroupBox groupBox5; private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.Button btnClampSlack; private System.Windows.Forms.Button btnClampSlack;
......
...@@ -23,9 +23,8 @@ namespace OnlineStore.AssemblyLine ...@@ -23,9 +23,8 @@ namespace OnlineStore.AssemblyLine
internal partial class FrmMoveEquip : FrmEquipBase internal partial class FrmMoveEquip : FrmEquipBase
{ {
private bool IsLoad = false; private bool IsLoad = false;
private string portName = "";
private short SlvAddr = 0; private MoveEquip equipBean;
private MoveEquip equipBean;
internal FrmMoveEquip(MoveEquip moveEquip) internal FrmMoveEquip(MoveEquip moveEquip)
{ {
equipBase = moveEquip; equipBase = moveEquip;
...@@ -38,9 +37,7 @@ namespace OnlineStore.AssemblyLine ...@@ -38,9 +37,7 @@ namespace OnlineStore.AssemblyLine
{ {
chbDebug.Checked = equipBean.IsDebug; chbDebug.Checked = equipBean.IsDebug;
if (equipBean.UseAxis) if (equipBean.UseAxis)
{ {
portName = equipBean.Config.UpDown_Axis.DeviceName;
SlvAddr = equipBean.Config.UpDown_Axis.GetAxisValue();
axisMoveControl1.LoadData(equipBean, new AxisBean[] { equipBean.UpdownAxis }); axisMoveControl1.LoadData(equipBean, new AxisBean[] { equipBean.UpdownAxis });
btnUpDownUp.Visible = false; btnUpDownUp.Visible = false;
} }
...@@ -104,14 +101,14 @@ namespace OnlineStore.AssemblyLine ...@@ -104,14 +101,14 @@ namespace OnlineStore.AssemblyLine
{ {
return; return;
} }
if (chbAutoRead.Checked && this.Visible) if ( this.Visible)
{ {
ReadIOList(); ReadIOList();
lblTrayNum.Text = "托盘编码:" + TrayManager.GetTrayNum(equipBean.DeviceID); lblTrayNum.Text = "托盘编码:" + TrayManager.GetTrayNum(equipBean.DeviceID);
} }
string canOut = LineManager.Line.CanOutStore(equipBean.DeviceID) ? "可出库":"不可出库" ; string canOut = LineManager.Line.CanOutStore(equipBean.DeviceID) ? "可出库" : "不可出库";
lblStoreStatus.Text = KTK_Store.GetRunStr(equipBean.lineStatus, equipBean.runStatus)+"("+canOut+")"; lblStoreStatus.Text = KTK_Store.GetRunStr(equipBean.lineStatus, equipBean.runStatus) + "(" + canOut + ")";
lblThisSta.Text = equipBean.WarnMsg; lblThisSta.Text = equipBean.WarnMsg;
string text = ""; string text = "";
List<InOutParam> ps = new List<InOutParam>(equipBean.waitInStoreList); List<InOutParam> ps = new List<InOutParam>(equipBean.waitInStoreList);
...@@ -139,9 +136,10 @@ namespace OnlineStore.AssemblyLine ...@@ -139,9 +136,10 @@ namespace OnlineStore.AssemblyLine
{ {
lblInstoreList.Text = text; lblInstoreList.Text = text;
} }
}catch(Exception ex) }
catch (Exception ex)
{ {
LogUtil.error(equipBean.Name+ "界面定时器出错:"+ex.ToString()); LogUtil.error(equipBean.Name + "界面定时器出错:" + ex.ToString());
} }
} }
...@@ -219,7 +217,7 @@ namespace OnlineStore.AssemblyLine ...@@ -219,7 +217,7 @@ namespace OnlineStore.AssemblyLine
} }
private void cmbWriteIO_DrawItem(object sender, DrawItemEventArgs e) private void cmbWriteIO_DrawItem(object sender, DrawItemEventArgs e)
{ {
if (e.Index < 0) if (e.Index < 0)
...@@ -233,11 +231,11 @@ namespace OnlineStore.AssemblyLine ...@@ -233,11 +231,11 @@ namespace OnlineStore.AssemblyLine
ConfigIO io = (ConfigIO)cmbWriteIO.Items[e.Index]; ConfigIO io = (ConfigIO)cmbWriteIO.Items[e.Index];
e.Graphics.DrawString(io.DisplayStr, e.Font, new SolidBrush(e.ForeColor), e.Bounds.X, e.Bounds.Y + 3); e.Graphics.DrawString(io.DisplayStr, e.Font, new SolidBrush(e.ForeColor), e.Bounds.X, e.Bounds.Y + 3);
} }
} }
private void btnReadIO_Click(object sender, EventArgs e) private void btnReadIO_Click(object sender, EventArgs e)
{ {
ReadIOList(); ReadIOList();
} }
internal void FormStatus(bool isStart) internal void FormStatus(bool isStart)
{ {
btnStart.Enabled = !isStart; btnStart.Enabled = !isStart;
...@@ -247,7 +245,7 @@ namespace OnlineStore.AssemblyLine ...@@ -247,7 +245,7 @@ namespace OnlineStore.AssemblyLine
btnOutStore.Enabled = isStart; btnOutStore.Enabled = isStart;
} }
private void FrmIOStatus_Shown(object sender, EventArgs e) private void FrmIOStatus_Shown(object sender, EventArgs e)
{ {
timer1.Start(); timer1.Start();
...@@ -280,10 +278,10 @@ namespace OnlineStore.AssemblyLine ...@@ -280,10 +278,10 @@ namespace OnlineStore.AssemblyLine
if (result.Equals(DialogResult.Yes)) if (result.Equals(DialogResult.Yes))
{ {
equipBean.IsDebug = true; equipBean.IsDebug = true;
equipBean.Config.IsDebug = 1; equipBean.Config.IsDebug = 1;
LineManager.SaveMoveEquipConfig(equipBean.Config); LineManager.SaveMoveEquipConfig(equipBean.Config);
equipBean.ChangeDebug(true); equipBean.ChangeDebug(true);
LogUtil.info(equipBean.Name+ "用户切换到调试状态 "); LogUtil.info(equipBean.Name + "用户切换到调试状态 ");
} }
} }
} }
...@@ -306,9 +304,9 @@ namespace OnlineStore.AssemblyLine ...@@ -306,9 +304,9 @@ namespace OnlineStore.AssemblyLine
private void btnOutStore_Click(object sender, EventArgs e) private void btnOutStore_Click(object sender, EventArgs e)
{ {
if (equipBean.runStatus .Equals(LineRunStatus.Runing)) if (equipBean.runStatus.Equals(LineRunStatus.Runing))
{ {
equipBean.StartOutStoreMove(new InOutParam( )); equipBean.StartOutStoreMove(new InOutParam());
} }
else else
{ {
...@@ -336,29 +334,29 @@ namespace OnlineStore.AssemblyLine ...@@ -336,29 +334,29 @@ namespace OnlineStore.AssemblyLine
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error( "出错:" + ex.StackTrace); LogUtil.error("出错:" + ex.StackTrace);
} }
} }
private void btnReset_Click(object sender, EventArgs e) private void btnReset_Click(object sender, EventArgs e)
{ {
if (equipBean.runStatus>(LineRunStatus.Wait)) if (equipBean.runStatus > (LineRunStatus.Wait))
{ {
equipBean.Reset(); equipBean.Reset();
} }
} }
private void btnStop1Up_Click(object sender, EventArgs e) private void btnStop1Up_Click(object sender, EventArgs e)
{ {
BtnMove(btnStop1Up, "阻挡1下降", "阻挡1上升", IO_Type.StopCylinder_Down1); BtnMove(btnStop1Up, "阻挡1下降", "阻挡1上升", IO_Type.StopCylinder_Down1);
} }
private void btnStop2Up_Click(object sender, EventArgs e) private void btnStop2Up_Click(object sender, EventArgs e)
{ {
BtnMove(btnStop2Up, "阻挡2下降", "阻挡2上升", IO_Type.StopCylinder_Down2); BtnMove(btnStop2Up, "阻挡2下降", "阻挡2上升", IO_Type.StopCylinder_Down2);
} }
private void btnTopUp_Click(object sender, EventArgs e) private void btnTopUp_Click(object sender, EventArgs e)
{ {
BtnMove(btnTopUp, "顶升上升", "顶升下降", IO_Type.TopCylinder_Down, IO_Type.TopCylinder_UP); BtnMove(btnTopUp, "顶升上升", "顶升下降", IO_Type.TopCylinder_Down, IO_Type.TopCylinder_UP);
} }
private void btnBeforeAfterBefore_Click(object sender, EventArgs e) private void btnBeforeAfterBefore_Click(object sender, EventArgs e)
...@@ -373,7 +371,7 @@ namespace OnlineStore.AssemblyLine ...@@ -373,7 +371,7 @@ namespace OnlineStore.AssemblyLine
{ {
BtnMove(btnClampSlack, "夹料夹紧", "夹料放松", IO_Type.ClampCylinder_Tighten, IO_Type.ClampCylinder_Slack); BtnMove(btnClampSlack, "夹料夹紧", "夹料放松", IO_Type.ClampCylinder_Tighten, IO_Type.ClampCylinder_Slack);
} }
private void cmbSizeList_SelectedIndexChanged(object sender, EventArgs e) private void cmbSizeList_SelectedIndexChanged(object sender, EventArgs e)
{ {
if (cmbSizeList.SelectedIndex < 0) if (cmbSizeList.SelectedIndex < 0)
...@@ -382,57 +380,61 @@ namespace OnlineStore.AssemblyLine ...@@ -382,57 +380,61 @@ namespace OnlineStore.AssemblyLine
} }
int size = 0; int size = 0;
try {size= Convert.ToInt32(cmbSizeList.Text); } catch (Exception ex) { } try { size = Convert.ToInt32(cmbSizeList.Text); } catch (Exception ex) { }
txtP2.Text = equipBean.Config.GetUpdownP2(size).ToString(); txtP2.Text = equipBean.Config.GetUpdownP2(size).ToString();
txtP3.Text = equipBean.Config.GetUpdownP3(size).ToString(); txtP3.Text = equipBean.Config.GetUpdownP3(size).ToString();
btnP2.Text = size + "寸移栽位置 :"; btnP2.Text = size + "寸移栽位置 :";
btnP3.Text= size + "寸料仓门口位置 :"; btnP3.Text = size + "寸料仓门口位置 :";
// btnMoveto.Text = "尺寸" + size + "对应位置:"; // btnMoveto.Text = "尺寸" + size + "对应位置:";
} }
private void btnMoveto_Click(object sender, EventArgs e) private void btnMoveto_Click(object sender, EventArgs e)
{ {
int position = FormUtil.GetIntValue(txtP2); int position = FormUtil.GetIntValue(txtP2);
int speed = equipBean.Config.UpdownAxis_DownSpeed; int speed = equipBean.Config.UpdownAxis_DownSpeed;
LogUtil.info("点击【移栽位置】,料盘高度【" + cmbSizeList.Text + "】 位置【" + position + "】速度【" + speed + "】"); LogUtil.info("点击【移栽位置】,料盘高度【" + cmbSizeList.Text + "】 位置【" + position + "】速度【" + speed + "】");
equipBean.UpdownAxis.AbsMove(position, speed); equipBean.UpdownAxis.AbsMove(position, speed);
} }
private void btnAxisOn_Click(object sender, EventArgs e) private void btnAxisOn_Click(object sender, EventArgs e)
{ {
this.Enabled = false; this.Enabled = false;
equipBean.RunAxis(false,equipBase.UpdownAxis); equipBean.RunAxis(false, equipBase.UpdownAxis);
this.Enabled = true; this.Enabled = true;
LogUtil.info("伺服运转ON完成"); LogUtil.info("伺服运转ON完成");
} }
private void btnAxisOff_Click(object sender, EventArgs e) private void btnAxisOff_Click(object sender, EventArgs e)
{ {
equipBean.CloseAxis(equipBase.UpdownAxis); equipBean.CloseAxis(equipBase.UpdownAxis);
LogUtil.info("伺服运转OFF完成"); LogUtil.info("伺服运转OFF完成");
} }
private void btnCloseAll_Click(object sender, EventArgs e) private void btnCloseAll_Click(object sender, EventArgs e)
{ {
IOManager.CloseDeviceDO(new List<ConfigIO>( equipBean.Config.DOList.Values));
foreach(Control con in groupBox5.Controls) foreach (Control con in groupBox5.Controls)
{ {
if(con is Button) if (con is Button)
{ {
con.BackColor= BackColor = Color.White; con.BackColor = BackColor = Color.White;
} }
} }
foreach (ConfigIO io in equipBase.baseConfig.DOList.Values)
{
IOManager.instance.WriteSingleDO(io.IO_IP, io.SlaveID, io.GetIOAddr(), IO_VALUE.LOW);
}
} }
private void button3_Click(object sender, EventArgs e) private void button3_Click(object sender, EventArgs e)
{ {
int position = FormUtil.GetIntValue(txtP1); int position = FormUtil.GetIntValue(txtP1);
int speed =equipBean.Config.UpdownAxis_P1Speed; int speed = equipBean.Config.UpdownAxis_P1Speed;
LogUtil.info("点击【P1点测试】, 位置【" + position + "】速度【" + speed + "】"); LogUtil.info("点击【P1点测试】, 位置【" + position + "】速度【" + speed + "】");
equipBean.UpdownAxis.AbsMove(position, speed); equipBean.UpdownAxis.AbsMove(position, speed);
} }
private void btnSave_Click(object sender, EventArgs e) private void btnSave_Click(object sender, EventArgs e)
...@@ -453,14 +455,14 @@ namespace OnlineStore.AssemblyLine ...@@ -453,14 +455,14 @@ namespace OnlineStore.AssemblyLine
private void btnBoxP_Click(object sender, EventArgs e) private void btnBoxP_Click(object sender, EventArgs e)
{ {
int position = FormUtil.GetIntValue(txtP3); int position = FormUtil.GetIntValue(txtP3);
int speed = equipBean.Config.UpdownAxis_DownSpeed; int speed = equipBean.Config.UpdownAxis_DownSpeed;
LogUtil.info("点击【料仓门口下降位置】,料盘高度【" + cmbSizeList.Text + "】 位置【" + position + "】速度【" + speed + "】"); LogUtil.info("点击【料仓门口下降位置】,料盘高度【" + cmbSizeList.Text + "】 位置【" + position + "】速度【" + speed + "】");
equipBean.UpdownAxis.AbsMove(position, speed); equipBean.UpdownAxis.AbsMove(position, speed);
} }
} }
} }
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
this.txtWriteTime = new System.Windows.Forms.TextBox(); this.txtWriteTime = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label();
this.txtSlaveId = new System.Windows.Forms.TextBox(); this.txtSlaveId = new System.Windows.Forms.TextBox();
this.chbAutoRead = new System.Windows.Forms.CheckBox();
this.cmbWriteIO = new System.Windows.Forms.ComboBox(); this.cmbWriteIO = new System.Windows.Forms.ComboBox();
this.groupBox4 = new System.Windows.Forms.GroupBox(); this.groupBox4 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
...@@ -95,7 +94,6 @@ ...@@ -95,7 +94,6 @@
this.groupBox1.Controls.Add(this.txtWriteTime); this.groupBox1.Controls.Add(this.txtWriteTime);
this.groupBox1.Controls.Add(this.label5); this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.txtSlaveId); this.groupBox1.Controls.Add(this.txtSlaveId);
this.groupBox1.Controls.Add(this.chbAutoRead);
this.groupBox1.Controls.Add(this.cmbWriteIO); this.groupBox1.Controls.Add(this.cmbWriteIO);
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); 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(497, 6); this.groupBox1.Location = new System.Drawing.Point(497, 6);
...@@ -210,20 +208,6 @@ ...@@ -210,20 +208,6 @@
this.txtSlaveId.Text = "0"; this.txtSlaveId.Text = "0";
this.txtSlaveId.Visible = false; this.txtSlaveId.Visible = false;
// //
// chbAutoRead
//
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(370, 69);
this.chbAutoRead.Name = "chbAutoRead";
this.chbAutoRead.Size = new System.Drawing.Size(75, 21);
this.chbAutoRead.TabIndex = 244;
this.chbAutoRead.Text = "自动读取";
this.chbAutoRead.UseVisualStyleBackColor = true;
this.chbAutoRead.Visible = false;
//
// cmbWriteIO // cmbWriteIO
// //
this.cmbWriteIO.DisplayMember = "ProName"; this.cmbWriteIO.DisplayMember = "ProName";
...@@ -777,7 +761,6 @@ ...@@ -777,7 +761,6 @@
private System.Windows.Forms.GroupBox groupBox4; private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.ComboBox cmbWriteIO; private System.Windows.Forms.ComboBox cmbWriteIO;
private System.Windows.Forms.CheckBox chbAutoRead;
private System.Windows.Forms.TextBox txtSlaveId; private System.Windows.Forms.TextBox txtSlaveId;
private System.Windows.Forms.GroupBox groupBox5; private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.Button btnClampSlack; private System.Windows.Forms.Button btnClampSlack;
......
...@@ -75,7 +75,7 @@ namespace OnlineStore.AssemblyLine ...@@ -75,7 +75,7 @@ namespace OnlineStore.AssemblyLine
{ {
return; return;
} }
if (chbAutoRead.Checked && this.Visible) if ( this.Visible)
{ {
ReadIOList(); ReadIOList();
lblTrayNum.Text = "托盘编码:" + TrayManager.GetTrayNum(equipBean.DeviceID); lblTrayNum.Text = "托盘编码:" + TrayManager.GetTrayNum(equipBean.DeviceID);
...@@ -351,8 +351,7 @@ namespace OnlineStore.AssemblyLine ...@@ -351,8 +351,7 @@ namespace OnlineStore.AssemblyLine
BtnMove(btnClampSlack, "夹料夹紧", "夹料放松", IO_Type.ClampCylinder_Tighten, IO_Type.ClampCylinder_Slack); BtnMove(btnClampSlack, "夹料夹紧", "夹料放松", IO_Type.ClampCylinder_Tighten, IO_Type.ClampCylinder_Slack);
} }
private void btnCloseAll_Click(object sender, EventArgs e) private void btnCloseAll_Click(object sender, EventArgs e)
{ {
IOManager.CloseDeviceDO(new List<ConfigIO>( equipBean.Config.DOList.Values));
foreach (Control con in groupBox5.Controls) foreach (Control con in groupBox5.Controls)
{ {
if (con is Button) if (con is Button)
...@@ -360,6 +359,10 @@ namespace OnlineStore.AssemblyLine ...@@ -360,6 +359,10 @@ namespace OnlineStore.AssemblyLine
con.BackColor = BackColor = Color.White; con.BackColor = BackColor = Color.White;
} }
} }
foreach (ConfigIO io in equipBase.baseConfig.DOList.Values)
{
IOManager.instance.WriteSingleDO(io.IO_IP, io.SlaveID, io.GetIOAddr(), IO_VALUE.LOW);
}
} }
private void axisMoveControl1_Load(object sender, EventArgs e) private void axisMoveControl1_Load(object sender, EventArgs e)
......
...@@ -7,6 +7,8 @@ using System.ComponentModel; ...@@ -7,6 +7,8 @@ using System.ComponentModel;
using System.Data; using System.Data;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
...@@ -30,8 +32,30 @@ namespace OnlineStore.AssemblyLine ...@@ -30,8 +32,30 @@ namespace OnlineStore.AssemblyLine
rfMap.Add(key, value); rfMap.Add(key, value);
comboxType.Items.Add(key); comboxType.Items.Add(key);
} }
foreach (FeedingEquip b in LineManager.Line.FeedingEquipMap.Values)
{
string key = b.Name + "-料架RF";
string value = TrayManager.GetRFIP(b.DeviceID, 1);
rfMap.Add(key, value);
comboxType.Items.Add(key);
}
comboxType.SelectedIndex = 0; comboxType.SelectedIndex = 0;
comType.SelectedIndex = 0; comType.SelectedIndex = 0;
string hostN = Dns.GetHostName();
IPAddress[] addresss = Dns.GetHostAddresses(hostN);
cmbLocalIp.Items.Clear();
if (addresss != null && addresss.Length > 0)
{
foreach (IPAddress ip in addresss)
{
if (ip.AddressFamily.Equals(AddressFamily.InterNetwork))
{
cmbLocalIp.Items.Add(ip.ToString());
}
}
cmbLocalIp.SelectedIndex = 0;
}
} }
private void btnNext_Click(object sender, EventArgs e) private void btnNext_Click(object sender, EventArgs e)
...@@ -60,6 +84,13 @@ namespace OnlineStore.AssemblyLine ...@@ -60,6 +84,13 @@ namespace OnlineStore.AssemblyLine
if (data != null) if (data != null)
{ {
resul = data.ToStr(); resul = data.ToStr();
numNum.Value = data.Num;
int selIndex = data.RFType - 64;
if (selIndex >= 0 && selIndex <= comboxType.Items.Count)
{
comboxType.SelectedIndex = selIndex;
}
} }
MessageBox.Show("读取到数据:" + resul); MessageBox.Show("读取到数据:" + resul);
} }
...@@ -94,7 +125,8 @@ namespace OnlineStore.AssemblyLine ...@@ -94,7 +125,8 @@ namespace OnlineStore.AssemblyLine
private void btnSearch_Click(object sender, EventArgs e) private void btnSearch_Click(object sender, EventArgs e)
{ {
string ip = RFIDManager.SearchIP("192.168.1.88"); string text = cmbLocalIp.Text;
string ip = RFIDManager.SearchIP(text);
txtSearchIp.Text = ip; txtSearchIp.Text = ip;
} }
} }
......
...@@ -43,10 +43,10 @@ ...@@ -43,10 +43,10 @@
<HintPath>..\..\dll\RFID\Asa.RFID.dll</HintPath> <HintPath>..\..\dll\RFID\Asa.RFID.dll</HintPath>
</Reference> </Reference>
<Reference Include="CodeLibrary"> <Reference Include="CodeLibrary">
<HintPath>..\..\..\RC32-SZBOSCH-ACSingleStore\dll\CodeLibrary.dll</HintPath> <HintPath>..\..\dll\CodeLibrary.dll</HintPath>
</Reference> </Reference>
<Reference Include="halcondotnet"> <Reference Include="halcondotnet">
<HintPath>..\..\..\RC32-SZBOSCH-ACSingleStore\dll\halcondotnet.dll</HintPath> <HintPath>..\..\dll\halcondotnet.dll</HintPath>
</Reference> </Reference>
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
......
...@@ -41,66 +41,66 @@ DO,0,环形线横移4定位下降SOL,SW4_LocationCylinder_Down,12,PRO_AOI_IP_1,0,环形线横 ...@@ -41,66 +41,66 @@ DO,0,环形线横移4定位下降SOL,SW4_LocationCylinder_Down,12,PRO_AOI_IP_1,0,环形线横
,0,,,15,PRO_AOI_IP_1,0,,Y016,Y016 ,0,,,15,PRO_AOI_IP_1,0,,Y016,Y016
,,,,,,,,, ,,,,,,,,,
,,,,,,,,, ,,,,,,,,,
PRO,0,流水线总电器箱,PRO_AOI_IP_1,192.168.101.11,,,,, PRO,0,流水线总电器箱,PRO_AOI_IP_1,192.168.101.21,,,,,
PRO,0,出料皮带线1,PRO_AOI_IP_2,192.168.101.12,,,,, PRO,0,出料皮带线1,PRO_AOI_IP_2,192.168.101.22,,,,,
PRO,0,出料皮带线2,PRO_AOI_IP_3,192.168.101.13,,,,, PRO,0,出料皮带线2,PRO_AOI_IP_3,192.168.101.23,,,,,
,,,,,,,,, ,,,,,,,,,
PRO,0,上料流水线SL1-模块1,PRO_AOI_IP_11,192.168.101.21,,,,, PRO,0,上料流水线SL1-模块1,PRO_AOI_IP_11,192.168.101.24,,,,,
PRO,0,上料流水线SL1-模块2,PRO_AOI_IP_12,192.168.101.22,,,,, PRO,0,上料流水线SL1-模块2,PRO_AOI_IP_12,192.168.101.25,,,,,
PRO,0,上料流水线SL2-模块1,PRO_AOI_IP_13,192.168.101.23,,,,, PRO,0,上料流水线SL2-模块1,PRO_AOI_IP_13,192.168.101.26,,,,,
PRO,0,上料流水线SL2-模块2,PRO_AOI_IP_14,192.168.101.24,,,,, PRO,0,上料流水线SL2-模块2,PRO_AOI_IP_14,192.168.101.27,,,,,
PRO,0,上料流水线SL3-模块1,PRO_AOI_IP_15,192.168.101.25,,,,, PRO,0,上料流水线SL3-模块1,PRO_AOI_IP_15,192.168.101.28,,,,,
PRO,0,上料流水线SL3-模块2,PRO_AOI_IP_16,192.168.101.26,,,,, PRO,0,上料流水线SL3-模块2,PRO_AOI_IP_16,192.168.101.29,,,,,
PRO,0,下料流水线SL4-模块1,PRO_AOI_IP_17,192.168.101.27,,,,, PRO,0,下料流水线SL4-模块1,PRO_AOI_IP_17,192.168.101.30,,,,,
PRO,0,下料流水线SL4-模块2,PRO_AOI_IP_18,192.168.101.28,,,,, PRO,0,下料流水线SL4-模块2,PRO_AOI_IP_18,192.168.101.31,,,,,
,,,,,,,,, ,,,,,,,,,
PRO,0,移载装置(上下为伺服)01、02-模块1,PRO_AOI_IP_19,192.168.101.29,,,,, PRO,0,移载装置(上下为伺服)01、02-模块1,PRO_AOI_IP_19,192.168.101.32,,,,,
PRO,0,移载装置(上下为伺服)01、02-模块2,PRO_AOI_IP_20,192.168.101.30,,,,, PRO,0,移载装置(上下为伺服)01、02-模块2,PRO_AOI_IP_20,192.168.101.33,,,,,
PRO,0,移载装置(上下为伺服)03、04-模块1,PRO_AOI_IP_21,192.168.101.31,,,,, PRO,0,移载装置(上下为伺服)03、04-模块1,PRO_AOI_IP_21,192.168.101.34,,,,,
PRO,0,移载装置(上下为伺服)03、04-模块2,PRO_AOI_IP_22,192.168.101.32,,,,, PRO,0,移载装置(上下为伺服)03、04-模块2,PRO_AOI_IP_22,192.168.101.35,,,,,
PRO,0,移载装置(上下为伺服)05、06-模块1,PRO_AOI_IP_23,192.168.101.33,,,,, PRO,0,移载装置(上下为伺服)05、06-模块1,PRO_AOI_IP_23,192.168.101.36,,,,,
PRO,0,移载装置(上下为伺服)05、06-模块2,PRO_AOI_IP_24,192.168.101.34,,,,, PRO,0,移载装置(上下为伺服)05、06-模块2,PRO_AOI_IP_24,192.168.101.37,,,,,
PRO,0,移载装置(上下为伺服)07、08-模块1,PRO_AOI_IP_25,192.168.101.35,,,,, PRO,0,移载装置(上下为伺服)07、08-模块1,PRO_AOI_IP_25,192.168.101.38,,,,,
PRO,0,移载装置(上下为伺服)07、08-模块2,PRO_AOI_IP_26,192.168.101.36,,,,, PRO,0,移载装置(上下为伺服)07、08-模块2,PRO_AOI_IP_26,192.168.101.39,,,,,
PRO,0,移载装置(上下为伺服)09、10-模块1,PRO_AOI_IP_27,192.168.101.37,,,,, PRO,0,移载装置(上下为伺服)09、10-模块1,PRO_AOI_IP_27,192.168.101.40,,,,,
PRO,0,移载装置(上下为伺服)09、10-模块2,PRO_AOI_IP_28,192.168.101.38,,,,, PRO,0,移载装置(上下为伺服)09、10-模块2,PRO_AOI_IP_28,192.168.101.41,,,,,
PRO,0,移载装置(上下为气缸)11、12-模块1,PRO_AOI_IP_29,192.168.101.39,,,,, PRO,0,移载装置(上下为气缸)11、12-模块1,PRO_AOI_IP_29,192.168.101.42,,,,,
PRO,0,移载装置(上下为气缸)11、12-模块2,PRO_AOI_IP_30,192.168.101.40,,,,, PRO,0,移载装置(上下为气缸)11、12-模块2,PRO_AOI_IP_30,192.168.101.43,,,,,
PRO,0,移载装置(上下为气缸)13、14-模块1,PRO_AOI_IP_31,192.168.101.41,,,,, PRO,0,移载装置(上下为气缸)13、14-模块1,PRO_AOI_IP_31,192.168.101.44,,,,,
PRO,0,移载装置(上下为气缸)13、14-模块2,PRO_AOI_IP_32,192.168.101.42,,,,, PRO,0,移载装置(上下为气缸)13、14-模块2,PRO_AOI_IP_32,192.168.101.45,,,,,
PRO,0,移载装置(上下为气缸)15、16-模块1,PRO_AOI_IP_33,192.168.101.43,,,,, PRO,0,移载装置(上下为气缸)15、16-模块1,PRO_AOI_IP_33,192.168.101.46,,,,,
PRO,0,移载装置(上下为气缸)15、16-模块2,PRO_AOI_IP_34,192.168.101.44,,,,, PRO,0,移载装置(上下为气缸)15、16-模块2,PRO_AOI_IP_34,192.168.101.47,,,,,
PRO,0,移载装置(上下为气缸)17、18-模块1,PRO_AOI_IP_35,192.168.101.45,,,,, PRO,0,移载装置(上下为气缸)17、18-模块1,PRO_AOI_IP_35,192.168.101.48,,,,,
PRO,0,移载装置(上下为气缸)17、18-模块2,PRO_AOI_IP_36,192.168.101.46,,,,, PRO,0,移载装置(上下为气缸)17、18-模块2,PRO_AOI_IP_36,192.168.101.49,,,,,
,,,,,,,,, ,,,,,,,,,
,,,,,,,,, ,,,,,,,,,
PRO,0,移栽装置1-托盘-RFID-IP,PRO_RFIP_001,192.168.101.101,,,,, PRO,0,移栽装置1-托盘-RFID-IP,PRO_RFIP_001,192.168.210.103,,,,,
PRO,0,移栽装置2-托盘-RFID-IP,PRO_RFIP_002,192.168.101.102,,,,, PRO,0,移栽装置2-托盘-RFID-IP,PRO_RFIP_002,192.168.210.104,,,,,
PRO,0,移栽装置3-托盘-RFID-IP,PRO_RFIP_003,192.168.101.103,,,,, PRO,0,移栽装置3-托盘-RFID-IP,PRO_RFIP_003,192.168.210.105,,,,,
PRO,0,移栽装置4-托盘-RFID-IP,PRO_RFIP_004,192.168.101.104,,,,, PRO,0,移栽装置4-托盘-RFID-IP,PRO_RFIP_004,192.168.210.106,,,,,
PRO,0,移栽装置5-托盘-RFID-IP,PRO_RFIP_005,192.168.101.105,,,,, PRO,0,移栽装置5-托盘-RFID-IP,PRO_RFIP_005,192.168.210.107,,,,,
PRO,0,移栽装置6-托盘-RFID-IP,PRO_RFIP_006,192.168.101.106,,,,, PRO,0,移栽装置6-托盘-RFID-IP,PRO_RFIP_006,192.168.210.108,,,,,
PRO,0,移栽装置7-托盘-RFID-IP,PRO_RFIP_007,192.168.101.107,,,,, PRO,0,移栽装置7-托盘-RFID-IP,PRO_RFIP_007,192.168.210.111,,,,,
PRO,0,移栽装置8-托盘-RFID-IP,PRO_RFIP_008,192.168.101.108,,,,, PRO,0,移栽装置8-托盘-RFID-IP,PRO_RFIP_008,192.168.210.112,,,,,
PRO,0,移栽装置9-托盘-RFID-IP,PRO_RFIP_009,192.168.101.109,,,,, PRO,0,移栽装置9-托盘-RFID-IP,PRO_RFIP_009,192.168.210.113,,,,,
PRO,0,移栽装置10-托盘-RFID-IP,PRO_RFIP_010,192.168.101.110,,,,, PRO,0,移栽装置10-托盘-RFID-IP,PRO_RFIP_010,192.168.210.114,,,,,
PRO,0,移栽装置11-托盘-RFID-IP,PRO_RFIP_011,192.168.101.111,,,,, PRO,0,移栽装置11-托盘-RFID-IP,PRO_RFIP_011,192.168.210.120,,,,,
PRO,0,移栽装置12-托盘-RFID-IP,PRO_RFIP_012,192.168.101.112,,,,, PRO,0,移栽装置12-托盘-RFID-IP,PRO_RFIP_012,192.168.210.121,,,,,
PRO,0,移栽装置13-托盘-RFID-IP,PRO_RFIP_013,192.168.101.113,,,,, PRO,0,移栽装置13-托盘-RFID-IP,PRO_RFIP_013,192.168.210.123,,,,,
PRO,0,移栽装置14-托盘-RFID-IP,PRO_RFIP_014,192.168.101.114,,,,, PRO,0,移栽装置14-托盘-RFID-IP,PRO_RFIP_014,192.168.210.124,,,,,
PRO,0,移栽装置15-托盘-RFID-IP,PRO_RFIP_015,192.168.101.115,,,,, PRO,0,移栽装置15-托盘-RFID-IP,PRO_RFIP_015,192.168.210.125,,,,,
PRO,0,移栽装置16-托盘-RFID-IP,PRO_RFIP_016,192.168.101.116,,,,, PRO,0,移栽装置16-托盘-RFID-IP,PRO_RFIP_016,192.168.210.126,,,,,
PRO,0,移栽装置17-托盘-RFID-IP,PRO_RFIP_017,192.168.101.117,,,,, PRO,0,移栽装置17-托盘-RFID-IP,PRO_RFIP_017,192.168.210.128,,,,,
PRO,0,移栽装置18-托盘-RFID-IP,PRO_RFIP_018,192.168.101.118,,,,, PRO,0,移栽装置18-托盘-RFID-IP,PRO_RFIP_018,192.168.210.129,,,,,
PRO,0,出料移栽1-托盘-RFID-IP,PRO_RFIP_201,192.168.101.119,,,,, PRO,0,出料移栽1-托盘-RFID-IP,PRO_RFIP_201,192.168.210.119,,,,,
PRO,0,出料移栽2-托盘-RFID-IP,PRO_RFIP_202,192.168.101.120,,,,, PRO,0,出料移栽2-托盘-RFID-IP,PRO_RFIP_202,192.168.210.122,,,,,
PRO,0,出料移栽3-托盘-RFID-IP,PRO_RFIP_203,192.168.101.121,,,,, PRO,0,出料移栽3-托盘-RFID-IP,PRO_RFIP_203,192.168.210.127,,,,,
PRO,0,出料移栽4-托盘-RFID-IP,PRO_RFIP_204,192.168.101.122,,,,, PRO,0,出料移栽4-托盘-RFID-IP,PRO_RFIP_204,192.168.210.130,,,,,
PRO,0,入料流水线1-上料模块-RFID-IP,PRO_RFIP_101-1,192.168.101.123,,,,, PRO,0,入料流水线1-托盘-RFID-IP,PRO_RFIP_101,192.168.210.101,,,,,
PRO,0,入料流水线2-上料模块-RFID-IP,PRO_RFIP_102-1,192.168.101.124,,,,, PRO,0,入料流水线2-托盘-RFID-IP,PRO_RFIP_102,192.168.210.110,,,,,
PRO,0,入料流水线3-上料模块-RFID-IP,PRO_RFIP_103-1,192.168.101.125,,,,, PRO,0,入料流水线3-托盘-RFID-IP,PRO_RFIP_103,192.168.210.116,,,,,
PRO,0,入料流水线4-上料模块-RFID-IP,PRO_RFIP_104-1,192.168.101.126,,,,, PRO,0,入料流水线4-托盘-RFID-IP,PRO_RFIP_104,192.168.210.117,,,,,
PRO,0,入料流水线1-托盘-RFID-IP,PRO_RFIP_101-2,192.168.101.127,,,,, PRO,0,入料流水线1-上料模块-RFID-IP,PRO_RFIP_101-1,192.168.210.102,,,,,
PRO,0,入料流水线2-托盘-RFID-IP,PRO_RFIP_102-2,192.168.101.128,,,,, PRO,0,入料流水线2-上料模块-RFID-IP,PRO_RFIP_102-1,192.168.210.109,,,,,
PRO,0,入料流水线3-托盘-RFID-IP,PRO_RFIP_103-2,192.168.101.129,,,,, PRO,0,入料流水线3-上料模块-RFID-IP,PRO_RFIP_103-1,192.168.210.115,,,,,
PRO,0,入料流水线4-托盘-RFID-IP,PRO_RFIP_104-2,192.168.101.130,,,,, PRO,0,入料流水线4-上料模块-RFID-IP,PRO_RFIP_104-1,192.168.210.118,,,,,
...@@ -146,12 +146,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -146,12 +146,12 @@ namespace OnlineStore.DeviceLibrary
if (!LineRuning) if (!LineRuning)
{ {
isStop = true; isStop = true;
result = "用户中止"; result = "停止运动";
} }
else if (span.TotalMilliseconds > timeOutMS) else if (span.TotalMilliseconds > timeOutMS)
{ {
isStop = true; isStop = true;
result = "运行超时"; result = "转动超时";
} }
//判断Buzy及位置是否结束 //判断Buzy及位置是否结束
else if (IOValue(checkDI).Equals(IO_VALUE.LOW)) else if (IOValue(checkDI).Equals(IO_VALUE.LOW))
...@@ -172,12 +172,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -172,12 +172,12 @@ namespace OnlineStore.DeviceLibrary
if (!LineRuning) if (!LineRuning)
{ {
isStop = true; isStop = true;
result = "用户中止" ; result = "停止运动";
} }
else if (span.TotalMilliseconds > timeOutMS) else if (span.TotalMilliseconds > timeOutMS)
{ {
isStop = true; isStop = true;
result = "运行超时" ; result = "转动超时";
} }
//判断Buzy及位置是否结束 //判断Buzy及位置是否结束
else if (IOValue(checkDI).Equals(IO_VALUE.HIGH)) else if (IOValue(checkDI).Equals(IO_VALUE.HIGH))
......
...@@ -138,10 +138,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -138,10 +138,7 @@ namespace OnlineStore.DeviceLibrary
} }
isInPro = false; isInPro = false;
} }
protected DateTime preIoTimerOutTime = DateTime.Now; protected DateTime preIoTimerOutTime = DateTime.Now;
protected void IOTimeOutProcess() protected void IOTimeOutProcess()
{ {
...@@ -193,9 +190,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -193,9 +190,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
} }
/// <summary> /// <summary>
/// 下降所有阻挡气缸 /// 下降所有阻挡气缸
/// </summary> /// </summary>
......
...@@ -295,6 +295,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -295,6 +295,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.FL_TopCylinder_Down, IO_VALUE.LOW); IOMove(IO_Type.FL_TopCylinder_Down, IO_VALUE.LOW);
} }
} }
/// <summary> /// <summary>
/// 升降轴定位气缸前进 /// 升降轴定位气缸前进
/// </summary> /// </summary>
......
...@@ -585,14 +585,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -585,14 +585,15 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_MoveOk); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_MoveOk);
MoveInfo.WaitList.Add(WaitResultInfo.WaitFeedScanCode()); MoveInfo.WaitList.Add(WaitResultInfo.WaitFeedScanCode());
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
Task.Factory.StartNew(delegate Task<List<string>> scanTask = Task.Factory.StartNew(delegate
{ {
LastCodeList = CodeManager.CameraScan(Config.GetCameraList()); LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
if (LastCodeList.Count <= 0) if (LastCodeList.Count <= 0)
{ {
LastCodeList = CodeManager.CameraScan(Config.GetCameraList()); LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
} }
}); return LastCodeList;
});
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_22_MoveCylinder_Up)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_22_MoveCylinder_Up))
......
...@@ -179,25 +179,53 @@ namespace OnlineStore.DeviceLibrary ...@@ -179,25 +179,53 @@ namespace OnlineStore.DeviceLibrary
TrayErrorMsg = errorMsg; TrayErrorMsg = errorMsg;
ErrorStoreId = errorStoreID; ErrorStoreId = errorStoreID;
} }
public static int GetTrayNum(int subType, int rtType = 0) /// <summary>
/// 获取托盘编码
/// </summary>
public static int GetTrayNum(int subType)
{ {
string ip = GetRFIP(subType, rtType); string ip = GetRFIP(subType);
//获取盘号 //获取盘号
RFIDData data = RFIDManager.ReadData(ip); RFIDData data = RFIDManager.ReadData(ip);
if (data != null) if (data != null)
{ {
return data.Num; if (data.RFType.Equals("E"))
} {
return data.Num;
} else
{
LogUtil.error("读取托盘RFID[" + subType + "][" + ip + "]的数据出错:" + data.ToStr());
}
}
return 0;
}
public static int GetShelfNum(int subType)
{
string ip = GetRFIP(subType, 1);
//获取盘号
RFIDData data = RFIDManager.ReadData(ip);
if (data != null)
{
if (data.RFType.Equals("B"))
{
return data.Num;
}
else
{
LogUtil.error("读取料架RFID[" + subType + "][" + ip + "]的数据出错:" + data.ToStr());
}
}
return 0; return 0;
} }
public static string GetRFIP(int subType, int rtType = 0) public static string GetRFIP(int subType, int rtType = 0)
{ {
string ip = ""; string ip = "";
string rtName = DeviceConfig.RFIP_Str +"_"+ subType.ToString().PadLeft(3, '0'); string rtName = DeviceConfig.RFIP_Str +"_"+ subType.ToString().PadLeft(3, '0');
if (rtType > 0) if (rtType > 0)
{ {
rtName += "-" + rtType.ToString(); rtName += "-" + rtType.ToString();
} }
if (DeviceConfig.ProRFIpMap.ContainsKey(rtName)) if (DeviceConfig.ProRFIpMap.ContainsKey(rtName))
{ {
ip = DeviceConfig.ProRFIpMap[rtName]; ip = DeviceConfig.ProRFIpMap[rtName];
......
using CodeLibrary;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.ExceptionServices;
using System.Text;
using System.Windows.Forms;
namespace OnlineStore.DeviceLibrary
{
public class CodeManager
{
public static List<string> codeTypeList = new List<string>();
public static List<string> balserNameList = new List<string>();
public static List<string> hikNameList = new List<string>();
private static char spiltChar = '#';
/// <summary>
/// 初始化摄像机名称和二维码类型
/// </summary>
public static void LoadConfig()
{
string codeStr = ConfigAppSettings.GetValue(Setting_Init.CodeType);
codeTypeList = new List<string>();
HDLogUtil.LogName = "RollingLogFileAppender";
try
{
string[] codeArray = codeStr.Split(spiltChar);
foreach (string str in codeArray)
{
if (str.Trim().Equals(""))
{
continue;
}
LogUtil.info("加载到配置二维码类型:" + str.Trim());
codeTypeList.Add(str.Trim());
}
LoadCamera(false);
CodeLibrary.HDCodeLearnHelper.LoadConfig("", codeStr);
}
catch (Exception ex)
{
LogUtil.error("解析摄像机配置出错:" + ex.StackTrace);
}
}
private static void LoadCamera(bool isReLoad)
{
if (isReLoad)
{
try
{
CodeLibrary.HIKCamera.Instance.Load();
}
catch (Exception ex)
{
LogUtil.error("加载HIK相机出错:" + ex.ToString());
}
try
{
CodeLibrary.BaslerCamera.Instance.Load();
}
catch (Exception ex)
{
LogUtil.error("加载Basler相机出错:" + ex.ToString());
}
}
string[] names = CodeLibrary.HIKCamera.Instance.CameraName;
if (names != null)
{
hikNameList.AddRange(names);
foreach (string name in hikNameList)
{
LogUtil.info("加载到HIK相机:" + name);
}
}
names = CodeLibrary.BaslerCamera.Instance.CameraName;
if (names != null)
{
balserNameList.AddRange(names);
foreach (string name in balserNameList)
{
LogUtil.info("加载到Balser相机:" + name);
}
}
}
public static void CloseCamera()
{
BaslerCamera.Instance.Close();
HIKCamera.Instance.Close();
}
public static Bitmap GetCamerImage(string cameraName)
{
Bitmap bitm = null;
try
{
if (balserNameList.Contains(cameraName))
{
bool result = BaslerCamera.Instance.Open(cameraName);
// LogUtil.info("打开相机:" + cameraName + "(" + result + ")");
if (result)
{
BaslerCamera.Instance.GrabOne();
bitm = BaslerCamera.Instance.Image;
BaslerCamera.Instance.Close();
}
else
{
LogUtil.error("相机【" + cameraName + "】打开失败:" + BaslerCamera.Instance.ErrInfo);
}
}
else if (hikNameList.Contains(cameraName))
{
bool result = HIKCamera.Instance.Open(cameraName);
// LogUtil.info("打开相机:" + cameraName + "(" + result + ")");
if (result)
{
HIKCamera.Instance.GrabOne();
bitm = HIKCamera.Instance.Image;
HIKCamera.Instance.Close();
}
else
{
LogUtil.error("相机【" + cameraName + "】打开失败:" + HIKCamera.Instance.ErrInfo);
}
}
else
{
LogUtil.info("未找到相机【" + cameraName + "】无法获取图片");
//若未加载到相机,需要重新加载相机
if (balserNameList.Count <= 0 && hikNameList.Count <= 0)
{
LogUtil.error("获取图片时发现未加载到相机,重新加载相机");
LoadCamera(true);
}
}
}
catch (Exception ex)
{
LogUtil.error("从相机【" + cameraName + "】获取图片出错:" + ex.ToString());
}
return bitm;
}
[HandleProcessCorruptedStateExceptions]
public static List<string> CameraScan(List<string> cameraNameList = null)
{
List<string> codeList = new List<string>();
//List<CodeInfo> allCodeList = new List<CodeInfo>();
if (cameraNameList == null)
{
return codeList;
}
try
{
foreach (string cameraName in cameraNameList)
{
using (Bitmap bitmap = GetCamerImage(cameraName))
{
if (bitmap == null)
{
LogUtil.error(" 摄像机【" + cameraName + "】获取图片失败,关闭相机");
CloseCamera();
continue;
}
LogUtil.debug(" 摄像机【" + cameraName + "】获取图片完成");
System.Threading.Thread.Sleep(1);
HalconDotNet.HObject ho_Image = HDCodeHelper.Bitmap2HObjectBpp24(bitmap);
LogUtil.debug(" 摄像机【" + cameraName + "】转换图片完成,开始扫码");
List<CodeInfo> cc = new List<CodeInfo>();
foreach (string codeType in codeTypeList)
{
//判断是否是一维码
if (codeType.ToLower().Equals("barcode"))
{
cc = HDCodeHelper.DecodeBarCode(ho_Image);
}
else
{
cc = HDCodeHelper.DecodeCode(ho_Image, 1, GetCodeParamFilePath(codeType), codeType);
}
if (cc.Count > 0)
{
string r = "";
foreach (CodeInfo c in cc)
{
codeList.Add(c.CodeStr);
r = r + "##" + c.CodeStr;
}
LogUtil.debug(" 【" + cameraName + "】【" + codeType + "】扫码完成:"+r);
}
}
}
}
}
catch (AccessViolationException e)
{
LogUtil.error("扫码出现AccessViolationException异常:" + e.ToString());
GC.Collect();
}
catch (Exception ex)
{
LogUtil.error("扫码出错:" + ex.ToString());
}
return codeList;
}
public static string GetCodeParamFilePath(string codePath)
{
string appPath = Application.StartupPath;
string path = appPath + ConfigAppSettings.GetValue(Setting_Init.CodeParamPath);
string filePath = path + codePath + ".dcm";
if (File.Exists(filePath))
{
return filePath;
}
else
{
return "";
}
}
/// <summary>
/// 处理接收后的二维码
/// </summary>
/// <param name="message"></param>
/// <returns></returns>
private static string ReplaceCode(string message)
{
message = message.Trim();
message = message.Replace("\r", "");
message = message.Replace("\n", "");
char a = (char)02;
message = message.Replace(a.ToString(), "");
message = message.Trim();
System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding();
byte[] bytes = asciiEncoding.GetBytes(message);
List<byte> newBytes = new List<byte>();
foreach (byte by in bytes)
{
if (!by.Equals(24))
{
newBytes.Add(by);
}
}
message = asciiEncoding.GetString(newBytes.ToArray());
return message;
}
public static string ProcessCode(List<string> codeList)
{
string code = "";
foreach (string cc in codeList)
{
if (string.IsNullOrEmpty(cc))
{
continue;
}
code += cc + "##";
}
return ReplaceCode(code);
}
}
}
using CodeLibrary; using CodeLibrary;
using OnlineStore.Common; using OnlineStore.Common;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -6,7 +6,7 @@ using System.Drawing; ...@@ -6,7 +6,7 @@ using System.Drawing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Runtime.ExceptionServices; using System.Runtime.ExceptionServices;
using System.Text; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
namespace OnlineStore.DeviceLibrary namespace OnlineStore.DeviceLibrary
...@@ -53,7 +53,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -53,7 +53,7 @@ namespace OnlineStore.DeviceLibrary
{ {
try try
{ {
CodeLibrary.HIKCamera.Instance.Load(); CodeLibrary.HIKCManager.Load();
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -61,14 +61,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -61,14 +61,14 @@ namespace OnlineStore.DeviceLibrary
} }
try try
{ {
CodeLibrary.BaslerCamera.Instance.Load(); CodeLibrary.BaslerCManager.Load();
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("加载Basler相机出错:" + ex.ToString()); LogUtil.error("加载Basler相机出错:" + ex.ToString());
} }
} }
string[] names = CodeLibrary.HIKCamera.Instance.CameraName; string[] names = CodeLibrary.HIKCManager.CameraName;
if (names != null) if (names != null)
...@@ -79,7 +79,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -79,7 +79,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info("加载到HIK相机:" + name); LogUtil.info("加载到HIK相机:" + name);
} }
} }
names = CodeLibrary.BaslerCamera.Instance.CameraName; names = CodeLibrary.BaslerCManager.CameraName;
if (names != null) if (names != null)
{ {
balserNameList.AddRange(names); balserNameList.AddRange(names);
...@@ -89,10 +89,23 @@ namespace OnlineStore.DeviceLibrary ...@@ -89,10 +89,23 @@ namespace OnlineStore.DeviceLibrary
} }
} }
} }
public static void CloseCamera() public static void CloseCamera(string name)
{ {
BaslerCamera.Instance.Close(); //BaslerCamera.Instance.Close();
HIKCamera.Instance.Close(); //HIKCamera.Instance.Close();
if (HIKCManager.CameraName.Contains(name))
{
HIKCManager.Close(name);
}
else
{
BaslerCManager.Close(name);
}
}
public static void CloseAllCamera()
{
HIKCManager.CloseAll();
BaslerCManager.CloseAll();
} }
public static Bitmap GetCamerImage(string cameraName) public static Bitmap GetCamerImage(string cameraName)
...@@ -102,13 +115,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -102,13 +115,15 @@ namespace OnlineStore.DeviceLibrary
{ {
if (balserNameList.Contains(cameraName)) if (balserNameList.Contains(cameraName))
{ {
bool result = BaslerCamera.Instance.Open(cameraName); bool result = true;
if (!BaslerCManager.IsOpen(cameraName))
{
result = BaslerCManager.Open(cameraName);
}
// LogUtil.info("打开相机:" + cameraName + "(" + result + ")"); // LogUtil.info("打开相机:" + cameraName + "(" + result + ")");
if (result) if (result)
{ {
BaslerCamera.Instance.GrabOne(); bitm= BaslerCManager.GrabOne(cameraName);
bitm = BaslerCamera.Instance.Image;
BaslerCamera.Instance.Close();
} }
else else
{ {
...@@ -117,13 +132,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -117,13 +132,16 @@ namespace OnlineStore.DeviceLibrary
} }
else if (hikNameList.Contains(cameraName)) else if (hikNameList.Contains(cameraName))
{ {
bool result = HIKCamera.Instance.Open(cameraName); bool result = true;
if (!HIKCManager.IsOpen(cameraName))
{
result = HIKCManager.Open(cameraName);
}
// LogUtil.info("打开相机:" + cameraName + "(" + result + ")"); // LogUtil.info("打开相机:" + cameraName + "(" + result + ")");
if (result) if (result)
{ {
HIKCamera.Instance.GrabOne(); bitm = HIKCManager.GrabOne(cameraName);
bitm = HIKCamera.Instance.Image;
HIKCamera.Instance.Close();
} }
else else
{ {
...@@ -149,54 +167,55 @@ namespace OnlineStore.DeviceLibrary ...@@ -149,54 +167,55 @@ namespace OnlineStore.DeviceLibrary
} }
[HandleProcessCorruptedStateExceptions] [HandleProcessCorruptedStateExceptions]
public static List<string> CameraScan(List<string> cameraNameList = null) public static List<string> CameraScan(List<string> cameraNameList )
{ {
List<string> codeList = new List<string>(); List<string> codeList = new List<string>();
//List<CodeInfo> allCodeList = new List<CodeInfo>();
if (cameraNameList == null)
{
return codeList;
}
try try
{ {
List<Task<List<CodeInfo>>> taskList = new List<Task<List<CodeInfo>>>();
foreach (string cameraName in cameraNameList) foreach (string cameraName in cameraNameList)
{ {
using (Bitmap bitmap = GetCamerImage(cameraName)) Task.Factory.StartNew(delegate ()
{ {
if (bitmap == null) using (Bitmap bitmap = GetCamerImage(cameraName))
{ {
LogUtil.error(" 摄像机【" + cameraName + "】获取图片失败,关闭相机"); if (bitmap == null)
CloseCamera();
continue;
}
LogUtil.debug(" 摄像机【" + cameraName + "】获取图片完成");
System.Threading.Thread.Sleep(1);
HalconDotNet.HObject ho_Image = HDCodeHelper.Bitmap2HObjectBpp24(bitmap);
LogUtil.debug(" 摄像机【" + cameraName + "】转换图片完成,开始扫码");
List<CodeInfo> cc = new List<CodeInfo>();
foreach (string codeType in codeTypeList)
{
//判断是否是一维码
if (codeType.ToLower().Equals("barcode"))
{
cc = HDCodeHelper.DecodeBarCode(ho_Image);
}
else
{ {
cc = HDCodeHelper.DecodeCode(ho_Image, 1, GetCodeParamFilePath(codeType), codeType); LogUtil.error(" 摄像机【" + cameraName + "】获取图片失败,关闭相机");
CloseCamera(cameraName);
return;
} }
if (cc.Count > 0)
LogUtil.debug(" 摄像机【" + cameraName + "】获取图片完成");
System.Threading.Thread.Sleep(1);
HalconDotNet.HObject ho_Image = HDCodeHelper.Bitmap2HObjectBpp24(bitmap);
LogUtil.debug(" 摄像机【" + cameraName + "】转换图片完成,开始扫码");
List<CodeInfo> cc = new List<CodeInfo>();
foreach (string codeType in codeTypeList)
{ {
string r = ""; Task<List<CodeInfo>> typeDeCode = Task.Factory.StartNew(delegate ()
foreach (CodeInfo c in cc)
{ {
codeList.Add(c.CodeStr); return DeCode(ho_Image, codeType);
r = r + "##" + c.CodeStr; });
} taskList.Add(typeDeCode);
LogUtil.debug(" 【" + cameraName + "】【" + codeType + "】扫码完成:"+r);
} }
} }
});
}
Task.WaitAll(taskList.ToArray());
foreach (Task<List<CodeInfo>> t in taskList)
{
List<CodeInfo> cc = t.Result;
if (cc.Count > 0)
{
string r = "";
foreach (CodeInfo c in cc)
{
codeList.Add(c.CodeStr);
r = r + "##" + c.CodeStr;
}
} }
} }
} }
...@@ -208,10 +227,34 @@ namespace OnlineStore.DeviceLibrary ...@@ -208,10 +227,34 @@ namespace OnlineStore.DeviceLibrary
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("扫码出错:" + ex.ToString()); LogUtil.error("扫码出错:" + ex.ToString());
} }
return codeList; return codeList;
} }
private static List<CodeInfo> DeCode(HalconDotNet.HObject ho_Image,string codeType)
{
List<CodeInfo> cc = new List<CodeInfo>();
//判断是否是一维码
if (codeType.ToLower().Equals("barcode"))
{
cc = HDCodeHelper.DecodeBarCode(ho_Image);
}
else
{
cc = HDCodeHelper.DecodeCode(ho_Image, 1, GetCodeParamFilePath(codeType), codeType);
}
//if (cc.Count > 0)
//{
// string r = "";
// foreach (CodeInfo c in cc)
// {
// codeList.Add(c.CodeStr);
// r = r + "##" + c.CodeStr;
// }
// LogUtil.debug(" 【" + cameraName + "】【" + codeType + "】扫码完成:" + r);
//}
return cc;
}
public static string GetCodeParamFilePath(string codePath) public static string GetCodeParamFilePath(string codePath)
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!