Commit f311f7e0 LN

出料托盘修改

1 个父辈 5ad2883a
...@@ -46,30 +46,30 @@ ...@@ -46,30 +46,30 @@
// lblConInfo // lblConInfo
// //
this.lblConInfo.AutoSize = true; this.lblConInfo.AutoSize = true;
this.lblConInfo.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblConInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblConInfo.Location = new System.Drawing.Point(63, 62); this.lblConInfo.Location = new System.Drawing.Point(63, 62);
this.lblConInfo.Name = "lblConInfo"; this.lblConInfo.Name = "lblConInfo";
this.lblConInfo.Size = new System.Drawing.Size(80, 20); this.lblConInfo.Size = new System.Drawing.Size(70, 17);
this.lblConInfo.TabIndex = 0; this.lblConInfo.TabIndex = 0;
this.lblConInfo.Text = "IO连接信息"; this.lblConInfo.Text = "IO连接信息";
// //
// lblRFID // lblRFID
// //
this.lblRFID.AutoSize = true; this.lblRFID.AutoSize = true;
this.lblRFID.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblRFID.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblRFID.Location = new System.Drawing.Point(321, 62); this.lblRFID.Location = new System.Drawing.Point(321, 62);
this.lblRFID.Name = "lblRFID"; this.lblRFID.Name = "lblRFID";
this.lblRFID.Size = new System.Drawing.Size(82, 20); this.lblRFID.Size = new System.Drawing.Size(71, 17);
this.lblRFID.TabIndex = 1; this.lblRFID.TabIndex = 1;
this.lblRFID.Text = "RFID信息:"; this.lblRFID.Text = "RFID信息:";
// //
// lblBox // lblBox
// //
this.lblBox.AutoSize = true; this.lblBox.AutoSize = true;
this.lblBox.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblBox.Location = new System.Drawing.Point(627, 62); this.lblBox.Location = new System.Drawing.Point(570, 62);
this.lblBox.Name = "lblBox"; this.lblBox.Name = "lblBox";
this.lblBox.Size = new System.Drawing.Size(93, 20); this.lblBox.Size = new System.Drawing.Size(80, 17);
this.lblBox.TabIndex = 2; this.lblBox.TabIndex = 2;
this.lblBox.Text = "料仓连接信息"; this.lblBox.Text = "料仓连接信息";
// //
...@@ -79,9 +79,9 @@ ...@@ -79,9 +79,9 @@
this.lblMsg.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblMsg.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblMsg.Location = new System.Drawing.Point(56, 26); this.lblMsg.Location = new System.Drawing.Point(56, 26);
this.lblMsg.Name = "lblMsg"; this.lblMsg.Name = "lblMsg";
this.lblMsg.Size = new System.Drawing.Size(87, 17); this.lblMsg.Size = new System.Drawing.Size(94, 17);
this.lblMsg.TabIndex = 3; this.lblMsg.TabIndex = 3;
this.lblMsg.Text = "3秒钟刷新一次"; this.lblMsg.Text = "10秒钟刷新一次";
// //
// btnUpdate // btnUpdate
// //
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(980, 708); this.ClientSize = new System.Drawing.Size(990, 708);
this.Controls.Add(this.btnExit); this.Controls.Add(this.btnExit);
this.Controls.Add(this.btnUpdate); this.Controls.Add(this.btnUpdate);
this.Controls.Add(this.lblMsg); this.Controls.Add(this.lblMsg);
...@@ -116,6 +116,7 @@ ...@@ -116,6 +116,7 @@
this.Controls.Add(this.lblConInfo); this.Controls.Add(this.lblConInfo);
this.Name = "FrmIOMsg"; this.Name = "FrmIOMsg";
this.Text = "IO连接状态"; this.Text = "IO连接状态";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FrmIOMsg_FormClosed);
this.Load += new System.EventHandler(this.FrmIOMsg_Load); this.Load += new System.EventHandler(this.FrmIOMsg_Load);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
......
...@@ -21,7 +21,10 @@ namespace OnlineStore.AssemblyLine ...@@ -21,7 +21,10 @@ namespace OnlineStore.AssemblyLine
private void timer1_Tick(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e)
{ {
UpdateData(); if (this.Visible)
{
UpdateData();
}
} }
private void UpdateData() private void UpdateData()
...@@ -89,6 +92,7 @@ namespace OnlineStore.AssemblyLine ...@@ -89,6 +92,7 @@ namespace OnlineStore.AssemblyLine
private void btnExit_Click(object sender, EventArgs e) private void btnExit_Click(object sender, EventArgs e)
{ {
timer1.Stop();
this.Close(); this.Close();
} }
...@@ -96,5 +100,10 @@ namespace OnlineStore.AssemblyLine ...@@ -96,5 +100,10 @@ namespace OnlineStore.AssemblyLine
{ {
UpdateData(); UpdateData();
} }
private void FrmIOMsg_FormClosed(object sender, FormClosedEventArgs e)
{
timer1.Stop();
}
} }
} }
...@@ -135,14 +135,14 @@ namespace OnlineStore.AssemblyLine ...@@ -135,14 +135,14 @@ namespace OnlineStore.AssemblyLine
private void LoadListView() private void LoadListView()
{ {
this.listView1.Columns.Clear(); this.listView1.Columns.Clear();
AddHealder("设备名称", 100); AddHealder("设备名称", 90);
AddHealder("启用", 40); AddHealder("启用", 40);
AddHealder("报警", 100); AddHealder("报警", 110);
AddHealder("状态", 100); AddHealder("状态", 110);
AddHealder("BOX_CID", 80); AddHealder("BOX_CID", 80);
AddHealder("BOX报警", 100); AddHealder("在线", 40);
AddHealder("更新时间", 80); AddHealder("BOX_报警", 110);
AddHealder("BOX状态", 100); AddHealder("BOX状态", 110);
//AddHealder("BOX状态", listView1.Size.Width - 100 - 80 - 80 - 100 - 100 - 100 -40- 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)
{ {
...@@ -155,9 +155,15 @@ namespace OnlineStore.AssemblyLine ...@@ -155,9 +155,15 @@ namespace OnlineStore.AssemblyLine
BoxInfo box = LineServer.GetBoxInfo(move.DeviceID); BoxInfo box = LineServer.GetBoxInfo(move.DeviceID);
if (box != null) if (box != null)
{ {
string online = "✘";
lvi.SubItems.Add(box.CId.ToString()); lvi.SubItems.Add(box.CId.ToString());
if ((DateTime.Now - box.LastMsgTime).TotalSeconds < LineServer.ClientKeepSecond)
{
online = "✔";
}
lvi.SubItems.Add(online);
lvi.SubItems.Add(box.SAlarmType.ToString()); lvi.SubItems.Add(box.SAlarmType.ToString());
lvi.SubItems.Add(box.LastMsgTime.ToLongTimeString());
lvi.SubItems.Add(box.ToShowStr()); lvi.SubItems.Add(box.ToShowStr());
} }
else else
...@@ -506,8 +512,8 @@ namespace OnlineStore.AssemblyLine ...@@ -506,8 +512,8 @@ namespace OnlineStore.AssemblyLine
int item_alarm_index = 2; int item_alarm_index = 2;
int item_runStr_index = 3; int item_runStr_index = 3;
int item_cid_index = 4; int item_cid_index = 4;
int item_SAlarmType_index = 5; int item_SAlarmType_index = 6;
int item_LastMsgTime_index = 6; int item_LastMsgTime_index = 5;
int item_BoxStr_index = 7; int item_BoxStr_index = 7;
foreach (MoveEquip move in lineBean.MoveEquipMap.Values) foreach (MoveEquip move in lineBean.MoveEquipMap.Values)
{ {
...@@ -520,10 +526,22 @@ namespace OnlineStore.AssemblyLine ...@@ -520,10 +526,22 @@ namespace OnlineStore.AssemblyLine
if (box != null) if (box != null)
{ {
SetItemText(i, item_cid_index, box.CId.ToString()); SetItemText(i, item_cid_index, box.CId.ToString());
string online = "✘";
if ((DateTime.Now - box.LastMsgTime).TotalSeconds < LineServer.ClientKeepSecond)
{
online = "✔";
}
SetItemText(i, item_LastMsgTime_index, online);
SetItemText(i, item_SAlarmType_index, box.SAlarmType.ToString()); SetItemText(i, item_SAlarmType_index, box.SAlarmType.ToString());
SetItemText(i, item_LastMsgTime_index, box.LastMsgTime.ToLongTimeString());
SetItemText(i, item_BoxStr_index, box.ToShowStr()); SetItemText(i, item_BoxStr_index, box.ToShowStr());
} }
else
{
SetItemText(i, item_cid_index, "");
SetItemText(i, item_LastMsgTime_index, "");
SetItemText(i, item_SAlarmType_index, "");
SetItemText(i, item_BoxStr_index, "");
}
SetItemColor(i, move.runStatus); SetItemColor(i, move.runStatus);
i++; i++;
} }
......
...@@ -74,7 +74,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -74,7 +74,7 @@ namespace OnlineStore.DeviceLibrary
//托盘在第一个阻挡处 //托盘在第一个阻挡处
SecondMoveInfo.NewMove(LineMoveType.CheckFixture); SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_00_Stop1Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_00_Stop1Down);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200)); // SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200));
LogUtil.debug(Name + " [" + trayCount + "] 托盘检测:" + SecondMoveInfo.SLog + "阻挡气缸1-1下降 ,等待 StopCylinder_Check1=0"); LogUtil.debug(Name + " [" + trayCount + "] 托盘检测:" + SecondMoveInfo.SLog + "阻挡气缸1-1下降 ,等待 StopCylinder_Check1=0");
//CheckLog(" 托盘检测:" + SecondMoveInfo.SLog + "阻挡气缸1-1下降 ,等待 StopCylinder_Check1=0" ); //CheckLog(" 托盘检测:" + SecondMoveInfo.SLog + "阻挡气缸1-1下降 ,等待 StopCylinder_Check1=0" );
IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH, 1200); IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH, 1200);
......
...@@ -441,7 +441,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -441,7 +441,7 @@ namespace OnlineStore.DeviceLibrary
IO_VALUE tValue = value.Equals(IO_VALUE.HIGH) ? IO_VALUE.LOW : IO_VALUE.HIGH; IO_VALUE tValue = value.Equals(IO_VALUE.HIGH) ? IO_VALUE.LOW : IO_VALUE.HIGH;
if (IOValue(IoType).Equals(tValue).Equals(false)) if (IOValue(IoType).Equals(tValue).Equals(false))
{ {
if (IoType.Equals(IO_Type.StopCylinder_Down1).Equals(false)) if (IoType.Equals(IO_Type.StopCylinder_Down1).Equals(false)&&IoType.Equals(IO_Type.SW_StopDown).Equals(false))
{ {
LogUtil.info(Name + "定时回写IO: [" + IoType + "]=[" + value + "],[" + baseConfig.Id + "],msTime=" + msTime); LogUtil.info(Name + "定时回写IO: [" + IoType + "]=[" + value + "],[" + baseConfig.Id + "],msTime=" + msTime);
} }
......
...@@ -15,7 +15,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -15,7 +15,7 @@ namespace OnlineStore.DeviceLibrary
private static TcpServer tcpserver = null; private static TcpServer tcpserver = null;
public static bool IsStart = false; public static bool IsStart = false;
private static int ClientKeepSecond = 10; public static int ClientKeepSecond = 10;
public static Dictionary<int, BoxInfo> BoxMap = new Dictionary<int, BoxInfo>(); public static Dictionary<int, BoxInfo> BoxMap = new Dictionary<int, BoxInfo>();
public static Dictionary<int, TcpClientBean> ClientMap = new Dictionary<int, TcpClientBean>(); public static Dictionary<int, TcpClientBean> ClientMap = new Dictionary<int, TcpClientBean>();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!