Commit c94c8fec LN

IO断开bug修改。

1 个父辈 eced8df3
...@@ -85,7 +85,6 @@ ...@@ -85,7 +85,6 @@
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.退出ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.退出ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.设置TToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.设置TToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.扫码测试ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
this.二维码学习ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.二维码学习ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
...@@ -93,8 +92,6 @@ ...@@ -93,8 +92,6 @@
this.托盘初始化ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.托盘初始化ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();
this.iO模块状态ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.iO模块状态ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator();
this.查看托盘信息ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.查看托盘信息ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator();
...@@ -116,8 +113,8 @@ ...@@ -116,8 +113,8 @@
this.启用分流横移1ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.启用分流横移1ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator18 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator18 = new System.Windows.Forms.ToolStripSeparator();
this.启用分流横移2ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.启用分流横移2ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.自动保存托盘信息ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator19 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator19 = new System.Windows.Forms.ToolStripSeparator();
this.自动保存托盘信息ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout(); this.tabPage1.SuspendLayout();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
...@@ -701,16 +698,13 @@ ...@@ -701,16 +698,13 @@
// 设置TToolStripMenuItem // 设置TToolStripMenuItem
// //
this.设置TToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.设置TToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.扫码测试ToolStripMenuItem,
this.toolStripSeparator6, this.toolStripSeparator6,
this.二维码学习ToolStripMenuItem, this.二维码学习ToolStripMenuItem,
this.toolStripSeparator7, this.toolStripSeparator7,
this.iO模块状态ToolStripMenuItem,
this.toolStripSeparator9,
this.toolStripMenuItem3, this.toolStripMenuItem3,
this.托盘初始化ToolStripMenuItem, this.托盘初始化ToolStripMenuItem,
this.toolStripSeparator9,
this.iO模块状态ToolStripMenuItem,
this.toolStripSeparator13,
this.toolStripMenuItem2,
this.toolStripSeparator14, this.toolStripSeparator14,
this.查看托盘信息ToolStripMenuItem, this.查看托盘信息ToolStripMenuItem,
this.toolStripSeparator12, this.toolStripSeparator12,
...@@ -719,43 +713,35 @@ ...@@ -719,43 +713,35 @@
this.设置TToolStripMenuItem.Size = new System.Drawing.Size(91, 25); this.设置TToolStripMenuItem.Size = new System.Drawing.Size(91, 25);
this.设置TToolStripMenuItem.Text = "设备调试 "; this.设置TToolStripMenuItem.Text = "设备调试 ";
// //
// 扫码测试ToolStripMenuItem
//
this.扫码测试ToolStripMenuItem.Name = "扫码测试ToolStripMenuItem";
this.扫码测试ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
this.扫码测试ToolStripMenuItem.Text = "扫码测试";
this.扫码测试ToolStripMenuItem.Visible = false;
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(173, 6); this.toolStripSeparator6.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator6.Visible = false; this.toolStripSeparator6.Visible = false;
// //
// 二维码学习ToolStripMenuItem // 二维码学习ToolStripMenuItem
// //
this.二维码学习ToolStripMenuItem.Name = "二维码学习ToolStripMenuItem"; this.二维码学习ToolStripMenuItem.Name = "二维码学习ToolStripMenuItem";
this.二维码学习ToolStripMenuItem.Size = new System.Drawing.Size(176, 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(173, 6); this.toolStripSeparator7.Size = new System.Drawing.Size(177, 6);
// //
// toolStripMenuItem3 // toolStripMenuItem3
// //
this.toolStripMenuItem3.Name = "toolStripMenuItem3"; this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(176, 26); this.toolStripMenuItem3.Size = new System.Drawing.Size(180, 26);
this.toolStripMenuItem3.Text = "查看禁用托盘"; this.toolStripMenuItem3.Text = "查看禁用托盘";
this.toolStripMenuItem3.Click += new System.EventHandler(this.toolStripMenuItem3_Click); this.toolStripMenuItem3.Click += new System.EventHandler(this.toolStripMenuItem3_Click);
// //
// 托盘初始化ToolStripMenuItem // 托盘初始化ToolStripMenuItem
// //
this.托盘初始化ToolStripMenuItem.Name = "托盘初始化ToolStripMenuItem"; this.托盘初始化ToolStripMenuItem.Name = "托盘初始化ToolStripMenuItem";
this.托盘初始化ToolStripMenuItem.Size = new System.Drawing.Size(176, 26); this.托盘初始化ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.托盘初始化ToolStripMenuItem.Text = "托盘编码"; this.托盘初始化ToolStripMenuItem.Text = "托盘编码";
this.托盘初始化ToolStripMenuItem.Visible = false; this.托盘初始化ToolStripMenuItem.Visible = false;
this.托盘初始化ToolStripMenuItem.Click += new System.EventHandler(this.托盘初始化ToolStripMenuItem_Click); this.托盘初始化ToolStripMenuItem.Click += new System.EventHandler(this.托盘初始化ToolStripMenuItem_Click);
...@@ -763,52 +749,36 @@ ...@@ -763,52 +749,36 @@
// toolStripSeparator9 // toolStripSeparator9
// //
this.toolStripSeparator9.Name = "toolStripSeparator9"; this.toolStripSeparator9.Name = "toolStripSeparator9";
this.toolStripSeparator9.Size = new System.Drawing.Size(173, 6); this.toolStripSeparator9.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator9.Visible = false;
// //
// iO模块状态ToolStripMenuItem // iO模块状态ToolStripMenuItem
// //
this.iO模块状态ToolStripMenuItem.Name = "iO模块状态ToolStripMenuItem"; this.iO模块状态ToolStripMenuItem.Name = "iO模块状态ToolStripMenuItem";
this.iO模块状态ToolStripMenuItem.Size = new System.Drawing.Size(176, 26); this.iO模块状态ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.iO模块状态ToolStripMenuItem.Text = "IO模块状态"; this.iO模块状态ToolStripMenuItem.Text = "IO模块状态";
this.iO模块状态ToolStripMenuItem.Visible = false;
this.iO模块状态ToolStripMenuItem.Click += new System.EventHandler(this.iO模块状态ToolStripMenuItem_Click); this.iO模块状态ToolStripMenuItem.Click += new System.EventHandler(this.iO模块状态ToolStripMenuItem_Click);
// //
// toolStripSeparator13
//
this.toolStripSeparator13.Name = "toolStripSeparator13";
this.toolStripSeparator13.Size = new System.Drawing.Size(173, 6);
this.toolStripSeparator13.Visible = false;
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(176, 26);
this.toolStripMenuItem2.Text = "AGV调试";
this.toolStripMenuItem2.Visible = false;
this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click);
//
// toolStripSeparator14 // toolStripSeparator14
// //
this.toolStripSeparator14.Name = "toolStripSeparator14"; this.toolStripSeparator14.Name = "toolStripSeparator14";
this.toolStripSeparator14.Size = new System.Drawing.Size(173, 6); this.toolStripSeparator14.Size = new System.Drawing.Size(177, 6);
// //
// 查看托盘信息ToolStripMenuItem // 查看托盘信息ToolStripMenuItem
// //
this.查看托盘信息ToolStripMenuItem.Name = "查看托盘信息ToolStripMenuItem"; this.查看托盘信息ToolStripMenuItem.Name = "查看托盘信息ToolStripMenuItem";
this.查看托盘信息ToolStripMenuItem.Size = new System.Drawing.Size(176, 26); this.查看托盘信息ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.查看托盘信息ToolStripMenuItem.Text = "查看托盘信息"; this.查看托盘信息ToolStripMenuItem.Text = "查看托盘信息";
this.查看托盘信息ToolStripMenuItem.Click += new System.EventHandler(this.btnTrayInfo_Click); this.查看托盘信息ToolStripMenuItem.Click += new System.EventHandler(this.btnTrayInfo_Click);
// //
// toolStripSeparator12 // toolStripSeparator12
// //
this.toolStripSeparator12.Name = "toolStripSeparator12"; this.toolStripSeparator12.Name = "toolStripSeparator12";
this.toolStripSeparator12.Size = new System.Drawing.Size(173, 6); this.toolStripSeparator12.Size = new System.Drawing.Size(177, 6);
// //
// 清空托盘信息ToolStripMenuItem // 清空托盘信息ToolStripMenuItem
// //
this.清空托盘信息ToolStripMenuItem.Name = "清空托盘信息ToolStripMenuItem"; this.清空托盘信息ToolStripMenuItem.Name = "清空托盘信息ToolStripMenuItem";
this.清空托盘信息ToolStripMenuItem.Size = new System.Drawing.Size(176, 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);
// //
...@@ -943,6 +913,11 @@ ...@@ -943,6 +913,11 @@
this.启用分流横移2ToolStripMenuItem.Text = "✔启用分流横移2"; this.启用分流横移2ToolStripMenuItem.Text = "✔启用分流横移2";
this.启用分流横移2ToolStripMenuItem.Click += new System.EventHandler(this.启用分流横移2ToolStripMenuItem_Click); this.启用分流横移2ToolStripMenuItem.Click += new System.EventHandler(this.启用分流横移2ToolStripMenuItem_Click);
// //
// toolStripSeparator19
//
this.toolStripSeparator19.Name = "toolStripSeparator19";
this.toolStripSeparator19.Size = new System.Drawing.Size(205, 6);
//
// 自动保存托盘信息ToolStripMenuItem // 自动保存托盘信息ToolStripMenuItem
// //
this.自动保存托盘信息ToolStripMenuItem.Name = "自动保存托盘信息ToolStripMenuItem"; this.自动保存托盘信息ToolStripMenuItem.Name = "自动保存托盘信息ToolStripMenuItem";
...@@ -950,11 +925,6 @@ ...@@ -950,11 +925,6 @@
this.自动保存托盘信息ToolStripMenuItem.Text = "自动保存托盘信息"; this.自动保存托盘信息ToolStripMenuItem.Text = "自动保存托盘信息";
this.自动保存托盘信息ToolStripMenuItem.Click += new System.EventHandler(this.自动保存托盘信息ToolStripMenuItem_Click); this.自动保存托盘信息ToolStripMenuItem.Click += new System.EventHandler(this.自动保存托盘信息ToolStripMenuItem_Click);
// //
// toolStripSeparator19
//
this.toolStripSeparator19.Name = "toolStripSeparator19";
this.toolStripSeparator19.Size = new System.Drawing.Size(205, 6);
//
// FrmLineStore // FrmLineStore
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
...@@ -1041,15 +1011,12 @@ ...@@ -1041,15 +1011,12 @@
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripMenuItem 退出ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 退出ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 设置TToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 设置TToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 扫码测试ToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator6; private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
private System.Windows.Forms.ToolStripMenuItem 二维码学习ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 二维码学习ToolStripMenuItem;
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.ToolStripSeparator toolStripSeparator9; private System.Windows.Forms.ToolStripSeparator toolStripSeparator9;
private System.Windows.Forms.ToolStripMenuItem iO模块状态ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem iO模块状态ToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator13;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator14; private System.Windows.Forms.ToolStripSeparator toolStripSeparator14;
private System.Windows.Forms.ToolStripMenuItem 查看托盘信息ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 查看托盘信息ToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator12; private System.Windows.Forms.ToolStripSeparator toolStripSeparator12;
......
...@@ -1263,15 +1263,15 @@ namespace OnlineStore.AssemblyLine ...@@ -1263,15 +1263,15 @@ namespace OnlineStore.AssemblyLine
return; return;
} }
TrayInfo tray = TrayManager.GetTrayInfo(num); TrayInfo tray = TrayManager.GetTrayInfo(num);
string oldStr = tray.ToStr();
DialogResult resut = MessageBox.Show("确定手动清空托盘【" + num + "】的信息?\r\n " + tray.ToStr() + "", "提示", MessageBoxButtons.YesNo); DialogResult resut = MessageBox.Show("确定手动清空托盘【" + num + "】的信息?\r\n " + oldStr + "", "提示", MessageBoxButtons.YesNo);
if (resut.Equals(DialogResult.Yes)) if (resut.Equals(DialogResult.Yes))
{ {
TrayManager.ClearInstore(tray,"手动清空托盘"); TrayManager.ClearInstore(tray,"手动清空托盘");
TrayManager.UpdateTrayInfo(num); TrayManager.UpdateTrayInfo(num);
TrayInfo info = TrayManager.GetTrayInfo(num); TrayInfo info = TrayManager.GetTrayInfo(num);
MessageBox.Show("更新成功:\r" + info.ToStr()); MessageBox.Show("更新成功:\r" + info.ToStr());
LogUtil.info("界面点击手动清空托盘,清空前【" + tray.ToStr() + "】,清空后:" + info.ToStr()); LogUtil.info("界面点击手动清空托盘,清空前【" + oldStr + "】,清空后:" + info.ToStr());
} }
} }
......
...@@ -290,6 +290,12 @@ namespace Asa.IOModule ...@@ -290,6 +290,12 @@ namespace Asa.IOModule
{ {
try try
{ {
if (!IsConn)
{
LogUtil.error(LogName + "WriteDO Fail : IsConn= "+ IsConn);
log.Error(LogName + "WriteDO Fail : IsConn= " + IsConn);
return false;
}
log.Info(LogName+ "call WriteDO"); log.Info(LogName+ "call WriteDO");
byte[] data = Command(); byte[] data = Command();
...@@ -644,7 +650,8 @@ namespace Asa.IOModule ...@@ -644,7 +650,8 @@ namespace Asa.IOModule
buff = GetReadDO_Command(); buff = GetReadDO_Command();
SendToDevice(buff); SendToDevice(buff);
log.Info(LogName + "Socket Connect"); LogUtil.error(LogName+ "Socket Connect OK");
log.Info(LogName + "Socket Connect OK");
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -310,7 +310,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -310,7 +310,7 @@ namespace OnlineStore.DeviceLibrary
{ {
AIOBOX aioBox = getAIO(ioIp); AIOBOX aioBox = getAIO(ioIp);
if (aioBox != null) if (aioBox != null && aioBox.IsConn)
{ {
bool result = aioBox.WriteDO(StartAddress, GetBox_Sta(onOff)); bool result = aioBox.WriteDO(StartAddress, GetBox_Sta(onOff));
if (!result) if (!result)
...@@ -333,7 +333,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -333,7 +333,7 @@ namespace OnlineStore.DeviceLibrary
try try
{ {
AIOBOX aioBox = getAIO(ioIp); AIOBOX aioBox = getAIO(ioIp);
if (aioBox != null) if (aioBox != null && aioBox.IsConn)
{ {
Box_Sta currBox_Sta = GetBox_Sta(onOff); Box_Sta currBox_Sta = GetBox_Sta(onOff);
aioBox.WriteDO(StartAddress, currBox_Sta); aioBox.WriteDO(StartAddress, currBox_Sta);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!