Commit 7f829544 LN

灯状态修改

1 个父辈 8a4f38b7
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
<add key ="NeedScanCode" value ="1"/> <add key ="NeedScanCode" value ="1"/>
<add key ="Agv_Log_Open" value ="0"/> <add key ="Agv_Log_Open" value ="0"/>
<add key ="MaxTrayNum" value ="30"/> <add key ="MaxTrayNum" value ="30"/>
<add key ="UseBuzzer" value ="0"/>
</appSettings> </appSettings>
<!-- <log4net> --> <!-- <log4net> -->
<!-- <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> --> <!-- <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> -->
......
...@@ -99,6 +99,7 @@ ...@@ -99,6 +99,7 @@
this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.chbBuzzer = new System.Windows.Forms.CheckBox();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout(); this.tabPage1.SuspendLayout();
this.groupBox3.SuspendLayout(); this.groupBox3.SuspendLayout();
...@@ -308,6 +309,7 @@ ...@@ -308,6 +309,7 @@
// //
// groupBox2 // groupBox2
// //
this.groupBox2.Controls.Add(this.chbBuzzer);
this.groupBox2.Controls.Add(this.btnTrayInfo); this.groupBox2.Controls.Add(this.btnTrayInfo);
this.groupBox2.Controls.Add(this.chbAutoRun); this.groupBox2.Controls.Add(this.chbAutoRun);
this.groupBox2.Controls.Add(this.chkDebug); this.groupBox2.Controls.Add(this.chkDebug);
...@@ -347,7 +349,7 @@ ...@@ -347,7 +349,7 @@
// //
this.chkDebug.AutoSize = true; this.chkDebug.AutoSize = true;
this.chkDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.chkDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chkDebug.Location = new System.Drawing.Point(211, 25); this.chkDebug.Location = new System.Drawing.Point(158, 25);
this.chkDebug.Name = "chkDebug"; this.chkDebug.Name = "chkDebug";
this.chkDebug.Size = new System.Drawing.Size(72, 24); this.chkDebug.Size = new System.Drawing.Size(72, 24);
this.chkDebug.TabIndex = 194; this.chkDebug.TabIndex = 194;
...@@ -764,6 +766,18 @@ ...@@ -764,6 +766,18 @@
this.timer1.Interval = 2000; this.timer1.Interval = 2000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick); this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
// //
// chbBuzzer
//
this.chbBuzzer.AutoSize = true;
this.chbBuzzer.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbBuzzer.Location = new System.Drawing.Point(244, 25);
this.chbBuzzer.Name = "chbBuzzer";
this.chbBuzzer.Size = new System.Drawing.Size(98, 24);
this.chbBuzzer.TabIndex = 196;
this.chbBuzzer.Text = "启用蜂鸣器";
this.chbBuzzer.UseVisualStyleBackColor = true;
this.chbBuzzer.CheckedChanged += new System.EventHandler(this.chbBuzzer_CheckedChanged);
//
// FrmLineStore // FrmLineStore
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
...@@ -872,6 +886,7 @@ ...@@ -872,6 +886,7 @@
private System.Windows.Forms.ToolStripSeparator toolStripSeparator13; private System.Windows.Forms.ToolStripSeparator toolStripSeparator13;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
private System.Windows.Forms.CheckBox chbAGV; private System.Windows.Forms.CheckBox chbAGV;
private System.Windows.Forms.CheckBox chbBuzzer;
} }
} }
...@@ -45,31 +45,31 @@ namespace OnlineStore.AssemblyLine ...@@ -45,31 +45,31 @@ namespace OnlineStore.AssemblyLine
FrmIOStatus ioStatus = new FrmIOStatus(); FrmIOStatus ioStatus = new FrmIOStatus();
AddForm("流水线IO ", ioStatus); AddForm("流水线IO ", ioStatus);
List<MoveEquip> moveEquipList = new List<MoveEquip>(lineBean.MoveEquipMap.Values); List<MoveEquip> moveEquipList = new List<MoveEquip>(lineBean.MoveEquipMap.Values);
for (int i = 0; i < moveEquipList.Count; i++) for (int i = 0; i < moveEquipList.Count; i++)
{ {
MoveEquip equip = moveEquipList[i]; MoveEquip equip = moveEquipList[i];
FrmMoveEquip test = new FrmMoveEquip(equip); FrmMoveEquip test = new FrmMoveEquip(equip);
AddForm(" " + equip.Name, test); AddForm(" " + equip.Name, test);
} }
List<FeedingEquip> feeds = new List<FeedingEquip>(lineBean.FeedingEquipMap.Values); List<FeedingEquip> feeds = new List<FeedingEquip>(lineBean.FeedingEquipMap.Values);
for (int i = 0; i < feeds.Count; i++) for (int i = 0; i < feeds.Count; i++)
{ {
FeedingEquip feed = feeds[i]; FeedingEquip feed = feeds[i];
FrmFeedingEquip test = new FrmFeedingEquip(feed); FrmFeedingEquip test = new FrmFeedingEquip(feed);
AddForm(" " + feed.Name+ " ", test); AddForm(" " + feed.Name + " ", test);
} }
List<ProvidingEquip> provids = new List<ProvidingEquip>(lineBean.ProvidingEquipMap.Values); List<ProvidingEquip> provids = new List<ProvidingEquip>(lineBean.ProvidingEquipMap.Values);
for (int i = 0; i < provids.Count; i++) for (int i = 0; i < provids.Count; i++)
{ {
ProvidingEquip provid = provids[i]; ProvidingEquip provid = provids[i];
FrmProvidingEquip test = new FrmProvidingEquip(provid); FrmProvidingEquip test = new FrmProvidingEquip(provid);
AddForm(" " + provid.Name + " ", test); AddForm(" " + provid.Name + " ", test);
} }
List<DischargeLine> diss = new List<DischargeLine>(lineBean.DisLineMap.Values); List<DischargeLine> diss = new List<DischargeLine>(lineBean.DisLineMap.Values);
for(int i = 0; i < diss.Count; i++) for (int i = 0; i < diss.Count; i++)
{ {
DischargeLine line = diss[i]; DischargeLine line = diss[i];
FrmDischargeLine frm = new FrmDischargeLine(line); FrmDischargeLine frm = new FrmDischargeLine(line);
...@@ -77,13 +77,13 @@ namespace OnlineStore.AssemblyLine ...@@ -77,13 +77,13 @@ namespace OnlineStore.AssemblyLine
} }
lblCID.Text = ConfigAppSettings.GetValue(Setting_Init.Line_CID); lblCID.Text = ConfigAppSettings.GetValue(Setting_Init.Line_CID);
} }
private void AddForm(string text, Form form) private void AddForm(string text, Form form)
{ {
text = text.PadLeft(10, ' '); text = text.PadLeft(10, ' ');
TabPage lineTabPage = new TabPage(text); TabPage lineTabPage = new TabPage(text);
// lineTabPage.AutoScroll = true; // lineTabPage.AutoScroll = true;
lineTabPage.Tag = lineBean; lineTabPage.Tag = lineBean;
Panel linePan = new Panel(); Panel linePan = new Panel();
linePan.Dock = DockStyle.Fill; linePan.Dock = DockStyle.Fill;
...@@ -100,8 +100,8 @@ namespace OnlineStore.AssemblyLine ...@@ -100,8 +100,8 @@ namespace OnlineStore.AssemblyLine
tabControl1.Controls.Add(lineTabPage); tabControl1.Controls.Add(lineTabPage);
} }
private void FrmMain_Load(object sender, EventArgs e) private void FrmMain_Load(object sender, EventArgs e)
{ {
FrmBase.GetVersion(true); FrmBase.GetVersion(true);
if (!LineManager.Init()) if (!LineManager.Init())
{ {
LogUtil.error("加载配置失败,直接退出程序"); LogUtil.error("加载配置失败,直接退出程序");
...@@ -117,10 +117,10 @@ namespace OnlineStore.AssemblyLine ...@@ -117,10 +117,10 @@ namespace OnlineStore.AssemblyLine
LoadStoreData(); LoadStoreData();
LoadListView(); LoadListView();
托盘初始化ToolStripMenuItem.Visible = ConfigAppSettings.GetIntValue(Setting_Init.OpenRFIDWrite).Equals(1); 托盘初始化ToolStripMenuItem.Visible = ConfigAppSettings.GetIntValue(Setting_Init.OpenRFIDWrite).Equals(1);
cmbTray.Items.Clear(); cmbTray.Items.Clear();
for(int i = 1; i <= 30; i++) for (int i = 1; i <= 30; i++)
{ {
cmbTray.Items.Add(i.ToString()); cmbTray.Items.Add(i.ToString());
} }
...@@ -137,7 +137,7 @@ namespace OnlineStore.AssemblyLine ...@@ -137,7 +137,7 @@ namespace OnlineStore.AssemblyLine
this.listView1.Columns.Clear(); this.listView1.Columns.Clear();
AddHealder("设备名称", 100); AddHealder("设备名称", 100);
AddHealder("启用", 40); AddHealder("启用", 40);
AddHealder("报警", 100); AddHealder("报警", 100);
AddHealder("状态", 100); AddHealder("状态", 100);
AddHealder("BOX_CID", 80); AddHealder("BOX_CID", 80);
AddHealder("BOX报警", 100); AddHealder("BOX报警", 100);
...@@ -155,7 +155,7 @@ namespace OnlineStore.AssemblyLine ...@@ -155,7 +155,7 @@ namespace OnlineStore.AssemblyLine
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());
...@@ -177,10 +177,10 @@ namespace OnlineStore.AssemblyLine ...@@ -177,10 +177,10 @@ namespace OnlineStore.AssemblyLine
lvi.Text = equip.Name; lvi.Text = equip.Name;
lvi.SubItems.Add(equip.Config.IsDebug.Equals(1) ? "✘" : "✔"); lvi.SubItems.Add(equip.Config.IsDebug.Equals(1) ? "✘" : "✔");
lvi.SubItems.Add(equip.alarmType.ToString()); lvi.SubItems.Add(equip.alarmType.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);
} }
this.listView1.Items.Add((ListViewItem)emptyView.Clone()); this.listView1.Items.Add((ListViewItem)emptyView.Clone());
foreach (ProvidingEquip equip in lineBean.ProvidingEquipMap.Values) foreach (ProvidingEquip equip in lineBean.ProvidingEquipMap.Values)
{ {
...@@ -197,12 +197,12 @@ namespace OnlineStore.AssemblyLine ...@@ -197,12 +197,12 @@ namespace OnlineStore.AssemblyLine
ListViewItem lvi = new ListViewItem(); ListViewItem lvi = new ListViewItem();
lvi.Text = equip.Name; lvi.Text = equip.Name;
lvi.SubItems.Add(equip.Config.IsDebug.Equals(1) ? "✘" : "✔"); lvi.SubItems.Add(equip.Config.IsDebug.Equals(1) ? "✘" : "✔");
lvi.SubItems.Add(equip.alarmType.ToString()); lvi.SubItems.Add(equip.alarmType.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);
} }
cmbBoxIndex.Items.Clear(); cmbBoxIndex.Items.Clear();
foreach(int key in lineBean.MoveEquipMap.Keys) foreach (int key in lineBean.MoveEquipMap.Keys)
{ {
cmbBoxIndex.Items.Add("BOX-" + key); cmbBoxIndex.Items.Add("BOX-" + key);
...@@ -286,7 +286,7 @@ namespace OnlineStore.AssemblyLine ...@@ -286,7 +286,7 @@ namespace OnlineStore.AssemblyLine
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("退出出错:" ,ex); LogUtil.error("退出出错:", ex);
} }
//this.Close(); //this.Close();
} }
...@@ -311,7 +311,7 @@ namespace OnlineStore.AssemblyLine ...@@ -311,7 +311,7 @@ namespace OnlineStore.AssemblyLine
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("显示界面出错:" ,ex); LogUtil.error("显示界面出错:", ex);
} }
} }
...@@ -410,7 +410,7 @@ namespace OnlineStore.AssemblyLine ...@@ -410,7 +410,7 @@ namespace OnlineStore.AssemblyLine
{ {
停止所有料仓TToolStripMenuItem_Click(null, null); 停止所有料仓TToolStripMenuItem_Click(null, null);
} }
AgvClient.Dispose(); AgvClient.Dispose();
IOManager.instance.CloseAllDO(); IOManager.instance.CloseAllDO();
IOManager.instance.CloseAllConnection(); IOManager.instance.CloseAllConnection();
...@@ -447,7 +447,7 @@ namespace OnlineStore.AssemblyLine ...@@ -447,7 +447,7 @@ namespace OnlineStore.AssemblyLine
{ {
if (process.ProcessName.EndsWith("AssemblyLine")) if (process.ProcessName.EndsWith("AssemblyLine"))
{ {
sbResult.AppendFormat(DateTime.Now.ToLongTimeString() + ", 名称:{0} 内存大小:{1}M ", process.ProcessName, process.PrivateMemorySize64 / 1024/1024F); sbResult.AppendFormat(DateTime.Now.ToLongTimeString() + ", 名称:{0} 内存大小:{1}M ", process.ProcessName, process.PrivateMemorySize64 / 1024 / 1024F);
totalMemery += process.PrivateMemorySize64 / 1024; totalMemery += process.PrivateMemorySize64 / 1024;
// string result = string.Format("进程总数 {0} 个,共占内存:{1}MB \n", processes.Length, totalMemery / 1024) + sbResult.ToString(); // string result = string.Format("进程总数 {0} 个,共占内存:{1}MB \n", processes.Length, totalMemery / 1024) + sbResult.ToString();
LogUtil.info(sbResult.ToString()); LogUtil.info(sbResult.ToString());
...@@ -455,7 +455,8 @@ namespace OnlineStore.AssemblyLine ...@@ -455,7 +455,8 @@ namespace OnlineStore.AssemblyLine
} }
} }
}catch(Exception ex) }
catch (Exception ex)
{ {
LogUtil.error("LogM Error: ", ex); LogUtil.error("LogM Error: ", ex);
} }
...@@ -472,13 +473,13 @@ namespace OnlineStore.AssemblyLine ...@@ -472,13 +473,13 @@ namespace OnlineStore.AssemblyLine
//{ //{
// //canScanCode = lineBean.CanScanCode() ? "(可扫码入库)" : "(出库未完成,不可扫码入库)"; // //canScanCode = lineBean.CanScanCode() ? "(可扫码入库)" : "(出库未完成,不可扫码入库)";
//} //}
lblStatus.Text = KTK_Store.GetRunStr(lineBean.lineStatus, lineBean.runStatus)+canScanCode; lblStatus.Text = KTK_Store.GetRunStr(lineBean.lineStatus, lineBean.runStatus) + canScanCode;
string warnMsg= LineManager.Line.WarnMsg.Equals("")?"":LineManager.Line.WarnMsg+"\r\n"; string warnMsg = LineManager.Line.WarnMsg.Equals("") ? "" : LineManager.Line.WarnMsg + "\r\n";
lblMoveInfo.Text = LineManager.Line.GetMoveStr(); lblMoveInfo.Text = LineManager.Line.GetMoveStr();
if (TrayManager.TrayErrorMsg.Equals("").Equals(false)) if (TrayManager.TrayErrorMsg.Equals("").Equals(false))
{ {
warnMsg+= TrayManager.TrayErrorMsg + "\r\n"; warnMsg += TrayManager.TrayErrorMsg + "\r\n";
} }
foreach (EquipBase move in lineBean.AllEquipMap.Values) foreach (EquipBase move in lineBean.AllEquipMap.Values)
...@@ -488,7 +489,7 @@ namespace OnlineStore.AssemblyLine ...@@ -488,7 +489,7 @@ namespace OnlineStore.AssemblyLine
warnMsg += move.WarnMsg + "\r\n"; warnMsg += move.WarnMsg + "\r\n";
} }
} }
lblWarnMsg.Text = warnMsg; lblWarnMsg.Text = warnMsg;
int i = 0; int i = 0;
...@@ -498,13 +499,13 @@ namespace OnlineStore.AssemblyLine ...@@ -498,13 +499,13 @@ namespace OnlineStore.AssemblyLine
int item_cid_index = 4; int item_cid_index = 4;
int item_SAlarmType_index = 5; int item_SAlarmType_index = 5;
int item_LastMsgTime_index = 6; int item_LastMsgTime_index = 6;
int item_BoxStr_index =7; 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, item_debug_index, move.Config.IsDebug.Equals(1) ? "✘" : "✔"); SetItemText(i, item_debug_index, move.Config.IsDebug.Equals(1) ? "✘" : "✔");
SetItemText(i, item_alarm_index, move.alarmType.ToString()); SetItemText(i, item_alarm_index, move.alarmType.ToString());
SetItemText(i, item_runStr_index, KTK_Store.GetRunStr(move.lineStatus, move.runStatus)); 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)
...@@ -512,9 +513,9 @@ namespace OnlineStore.AssemblyLine ...@@ -512,9 +513,9 @@ namespace OnlineStore.AssemblyLine
SetItemText(i, item_cid_index, box.CId.ToString()); SetItemText(i, item_cid_index, box.CId.ToString());
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_LastMsgTime_index, box.LastMsgTime.ToLongTimeString());
SetItemText(i, item_BoxStr_index, box.ToShowStr()); SetItemText(i, item_BoxStr_index, box.ToShowStr());
} }
SetItemColor(i,move.runStatus); SetItemColor(i, move.runStatus);
i++; i++;
} }
i++; i++;
...@@ -549,7 +550,7 @@ namespace OnlineStore.AssemblyLine ...@@ -549,7 +550,7 @@ namespace OnlineStore.AssemblyLine
if (启动AToolStripMenuItem.Enabled.Equals(true)) if (启动AToolStripMenuItem.Enabled.Equals(true))
{ {
formLineStatus(true); formLineStatus(true);
} }
if ((lineBean.runStatus.Equals(LineRunStatus.HomeMoving) || lineBean.runStatus.Equals(LineRunStatus.Reset)) if ((lineBean.runStatus.Equals(LineRunStatus.HomeMoving) || lineBean.runStatus.Equals(LineRunStatus.Reset))
&& lineBean.alarmType.Equals(LineAlarmType.None)) && lineBean.alarmType.Equals(LineAlarmType.None))
{ {
...@@ -559,7 +560,7 @@ namespace OnlineStore.AssemblyLine ...@@ -559,7 +560,7 @@ namespace OnlineStore.AssemblyLine
else else
{ {
SetMenuS(复位RToolStripMenuItem, true); SetMenuS(复位RToolStripMenuItem, true);
} }
} }
else else
{ {
...@@ -572,8 +573,8 @@ namespace OnlineStore.AssemblyLine ...@@ -572,8 +573,8 @@ namespace OnlineStore.AssemblyLine
chbAGV.Checked = AgvClient.CurrCancelState; chbAGV.Checked = AgvClient.CurrCancelState;
} }
} }
private void SetItemColor(int i, LineRunStatus runStatus) private void SetItemColor(int i, LineRunStatus runStatus)
{ {
if (runStatus.Equals(LineRunStatus.Wait)) if (runStatus.Equals(LineRunStatus.Wait))
{ {
...@@ -591,17 +592,17 @@ namespace OnlineStore.AssemblyLine ...@@ -591,17 +592,17 @@ namespace OnlineStore.AssemblyLine
if (runStatus.Equals(LineRunStatus.Runing)) if (runStatus.Equals(LineRunStatus.Runing))
{ {
SetItemColor(i, Color.LightBlue); SetItemColor(i, Color.LightBlue);
} }
} }
private void SetMenuS(ToolStripMenuItem toolMenu,bool isEn) private void SetMenuS(ToolStripMenuItem toolMenu, bool isEn)
{ {
if (!toolMenu.Enabled.Equals(isEn)) if (!toolMenu.Enabled.Equals(isEn))
{ {
toolMenu.Enabled = isEn; toolMenu.Enabled = isEn;
} }
} }
private void SetItemColor(int i,Color color) private void SetItemColor(int i, Color color)
{ {
if (!listView1.Items[i].BackColor.Equals(color)) if (!listView1.Items[i].BackColor.Equals(color))
{ {
...@@ -617,7 +618,7 @@ namespace OnlineStore.AssemblyLine ...@@ -617,7 +618,7 @@ namespace OnlineStore.AssemblyLine
this.listView1.Items[rowIndex].SubItems[subIndex].Text = 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)
{ {
if (!LoadOk) if (!LoadOk)
...@@ -669,7 +670,7 @@ namespace OnlineStore.AssemblyLine ...@@ -669,7 +670,7 @@ 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)
...@@ -733,19 +734,19 @@ namespace OnlineStore.AssemblyLine ...@@ -733,19 +734,19 @@ namespace OnlineStore.AssemblyLine
string name = listView1.Items[index].SubItems[0].Text; string name = listView1.Items[index].SubItems[0].Text;
name = "BOX-" + (index + 1); name = "BOX-" + (index + 1);
BoxInfo boxInfo = LineServer.GetBoxInfo(index + 1); BoxInfo boxInfo = LineServer.GetBoxInfo(index + 1);
if (boxInfo != null&&boxInfo.SRunStatus>=1) if (boxInfo != null && boxInfo.SRunStatus >= 1)
{ {
if (boxInfo.SStatus.Equals((int)LineStatus.Debugging)) if (boxInfo.SStatus.Equals((int)LineStatus.Debugging))
{ {
btnUpdateStatus.Text = "更改[" + name + "]为工作状态"; btnUpdateStatus.Text = "更改[" + name + "]为工作状态";
} }
else else
{ {
btnUpdateStatus.Text = "更改[" + name + "]为调试状态"; btnUpdateStatus.Text = "更改[" + name + "]为调试状态";
} }
btnUpdateStatus.Visible = true; btnUpdateStatus.Visible = true;
} }
} }
} }
private void btnUpdateStatus_Click(object sender, EventArgs e) private void btnUpdateStatus_Click(object sender, EventArgs e)
...@@ -765,7 +766,7 @@ namespace OnlineStore.AssemblyLine ...@@ -765,7 +766,7 @@ namespace OnlineStore.AssemblyLine
} }
else else
{ {
LogUtil.info("点击【 更改[" + name + "]为调试状态 】"); LogUtil.info("点击【 更改[" + name + "]为调试状态 】");
LineServer.UpdateBoxDebug(boxInfo.ID, 1); LineServer.UpdateBoxDebug(boxInfo.ID, 1);
} }
btnUpdateStatus.Visible = false; btnUpdateStatus.Visible = false;
...@@ -773,7 +774,7 @@ namespace OnlineStore.AssemblyLine ...@@ -773,7 +774,7 @@ namespace OnlineStore.AssemblyLine
} }
} }
private void 托盘初始化ToolStripMenuItem_Click(object sender, EventArgs e) private void 托盘初始化ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
...@@ -791,7 +792,7 @@ namespace OnlineStore.AssemblyLine ...@@ -791,7 +792,7 @@ namespace OnlineStore.AssemblyLine
{ {
List<TrayInfo> tray = TrayManager.getTrayList(); List<TrayInfo> tray = TrayManager.getTrayList();
LogUtil.info("-------------------开始打印托盘信息:"); LogUtil.info("-------------------开始打印托盘信息:");
foreach(TrayInfo t in tray) foreach (TrayInfo t in tray)
{ {
LogUtil.info(t.ToStr()); LogUtil.info(t.ToStr());
} }
...@@ -817,16 +818,16 @@ namespace OnlineStore.AssemblyLine ...@@ -817,16 +818,16 @@ namespace OnlineStore.AssemblyLine
private void btnUpdateTray_Click(object sender, EventArgs e) private void btnUpdateTray_Click(object sender, EventArgs e)
{ {
int num = cmbTray.SelectedIndex + 1; int num = cmbTray.SelectedIndex + 1;
DialogResult resut = MessageBox.Show("确定手动更新托盘【"+num+"】的信息?", "提示", MessageBoxButtons.YesNo); DialogResult resut = MessageBox.Show("确定手动更新托盘【" + num + "】的信息?", "提示", MessageBoxButtons.YesNo);
if (resut.Equals(DialogResult.Yes)) if (resut.Equals(DialogResult.Yes))
{ {
int trayType = cmbTrayType.SelectedIndex; int trayType = cmbTrayType.SelectedIndex;
string posId = txtTrayPosid.Text; string posId = txtTrayPosid.Text;
int ph = FormUtil.GetIntValue(txtTrayH); int ph = FormUtil.GetIntValue(txtTrayH);
int pw = FormUtil.GetIntValue(txtTrayW); int pw = FormUtil.GetIntValue(txtTrayW);
bool hasTray = trayType > 0; bool hasTray = trayType > 0;
bool inNg = chbInStoNG.Checked; bool inNg = chbInStoNG.Checked;
if (hasTray) if (hasTray)
{ {
InOutParam inoutP = new InOutParam(num, "CodeTest", posId, ph, pw, inNg); InOutParam inoutP = new InOutParam(num, "CodeTest", posId, ph, pw, inNg);
...@@ -907,5 +908,20 @@ namespace OnlineStore.AssemblyLine ...@@ -907,5 +908,20 @@ namespace OnlineStore.AssemblyLine
AgvClient.SetCancelState(result); AgvClient.SetCancelState(result);
LogUtil.info("勾选:AgvClient.SetCancelState =" + result); LogUtil.info("勾选:AgvClient.SetCancelState =" + result);
} }
private void chbBuzzer_CheckedChanged(object sender, EventArgs e)
{
if (!LoadOk)
{
return;
}
if (chbBuzzer.Checked.Equals(LineManager.UseBuzzer))
{
return;
}
LineManager.UseBuzzer = chbBuzzer.Checked;
LogUtil.info("勾选:UseBuzzer =" + LineManager.UseBuzzer);
ConfigAppSettings.SaveValue(Setting_Init.UseBuzzer, (LineManager.UseBuzzer ? 1 : 0));
}
} }
} }
...@@ -264,11 +264,12 @@ PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,0X0=800 ...@@ -264,11 +264,12 @@ PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,0X0=800
问题:入料1 9:36,料架送走以后又发needLeave B20,B26 问题:入料1 9:36,料架送走以后又发needLeave B20,B26
托盘号增加一致性判断,不一致时打印日志并显示文字。 托盘号增加一致性判断,不一致时打印日志并显示文字。
托盘卡时,等待StopChecck2的报警不显示红灯 20200307
灯状态修改:启动流水线绿灯常亮,有出入库是绿灯闪烁
复位过程中黄灯闪烁,信号超时报警黄灯闪烁
急停或无气压报警 红灯闪烁,蜂鸣器亮
上料模块夹走料盘后,需要判断信号是否消失
......
...@@ -86,5 +86,7 @@ namespace OnlineStore.Common ...@@ -86,5 +86,7 @@ namespace OnlineStore.Common
public static string DefaultTrayNum = "DefaultTrayNum"; public static string DefaultTrayNum = "DefaultTrayNum";
public static string MaxTrayNum = "MaxTrayNum"; public static string MaxTrayNum = "MaxTrayNum";
public static string UseBuzzer = "UseBuzzer";
} }
} }
...@@ -319,7 +319,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -319,7 +319,7 @@ namespace OnlineStore.DeviceLibrary
TrayManager.TrayErrorMsg = DateTime.Now.ToLongTimeString() + " " + Name + "托盘号出现错乱:上一个托盘[" + preTrayNum + "] 当前托盘 [" + currTrayNum + "],连续两个托盘号一样"; TrayManager.TrayErrorMsg = DateTime.Now.ToLongTimeString() + " " + Name + "托盘号出现错乱:上一个托盘[" + preTrayNum + "] 当前托盘 [" + currTrayNum + "],连续两个托盘号一样";
LogUtil.error(Name + "托盘号错乱:上一个托盘[" + preTrayNum + "] 当前托盘 [" + currTrayNum + "],连续两个托盘号一样"); LogUtil.error(Name + "托盘号错乱:上一个托盘[" + preTrayNum + "] 当前托盘 [" + currTrayNum + "],连续两个托盘号一样");
} }
else if (TrayManager.CheckIsRightNum(currTrayNum, preTrayNum)) else if (!TrayManager.CheckIsRightNum(currTrayNum, preTrayNum))
{ {
TrayManager.TrayErrorMsg = DateTime.Now.ToLongTimeString() + " " + Name + "托盘号出现错乱:上一个托盘[" + preTrayNum + "] 当前托盘 [" + currTrayNum + "],托盘号不连续"; TrayManager.TrayErrorMsg = DateTime.Now.ToLongTimeString() + " " + Name + "托盘号出现错乱:上一个托盘[" + preTrayNum + "] 当前托盘 [" + currTrayNum + "],托盘号不连续";
LogUtil.error(Name + "托盘号错乱:上一个托盘[" + preTrayNum + "] 当前托盘 [" + currTrayNum + "],托盘号不连续"); LogUtil.error(Name + "托盘号错乱:上一个托盘[" + preTrayNum + "] 当前托盘 [" + currTrayNum + "],托盘号不连续");
...@@ -440,19 +440,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -440,19 +440,10 @@ namespace OnlineStore.DeviceLibrary
//一分钟还未检测到 //一分钟还未检测到
if (span.TotalSeconds > LineManager.Config.IOSingle_TimerOut && NoAlarm()) if (span.TotalSeconds > LineManager.Config.IOSingle_TimerOut && NoAlarm())
{ {
if (IsLowAlarm(moveInfo)) ConfigIO io = baseConfig.getWaitIO(wait.IoType);
{ WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] 等待" + NotOkMsg + " 超时";
ConfigIO io = baseConfig.getWaitIO(wait.IoType); Alarm(LineAlarmType.IoSingleTimeOut);
WarnMsg = "提示" + moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] 等待" + NotOkMsg + " 超时"; LogUtil.error(MoveInfo.Name + WarnMsg, DeviceID + 13);
LogUtil.error(MoveInfo.Name + WarnMsg, DeviceID + 13, 30);
}
else
{
ConfigIO io = baseConfig.getWaitIO(wait.IoType);
WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] 等待" + NotOkMsg + " 超时";
Alarm(LineAlarmType.IoSingleTimeOut);
LogUtil.error(MoveInfo.Name + WarnMsg, DeviceID + 13);
}
} }
else if (rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalSeconds < LineManager.Config.IOSingle_TimerOut * 2) else if (rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalSeconds < LineManager.Config.IOSingle_TimerOut * 2)
{ {
...@@ -519,15 +510,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -519,15 +510,18 @@ namespace OnlineStore.DeviceLibrary
{ {
WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "]等待" + NotOkMsg WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "]等待" + NotOkMsg
+ "超时[" + Math.Round(span.TotalSeconds, 1) + "]秒"; + "超时[" + Math.Round(span.TotalSeconds, 1) + "]秒";
if (IsLowAlarm(moveInfo) && span.TotalSeconds < moveInfo.TimeOutSeconds * 3) int ms = 10;
if (IsLowAlarm(moveInfo))
{ {
LogUtil.error(WarnMsg, DeviceID + 15,30); ms = 30;
} }
else ms = (int)(MoveInfo.TimeOutSeconds / span.TotalSeconds);
if (ms > 120)
{ {
LogUtil.error(WarnMsg, DeviceID + 15); ms = 120;
Alarm(LineAlarmType.IoSingleTimeOut);
} }
LogUtil.error(WarnMsg, DeviceID + 15, ms);
Alarm(LineAlarmType.IoSingleTimeOut);
} }
} }
catch (Exception ex) catch (Exception ex)
......
...@@ -632,14 +632,20 @@ namespace OnlineStore.DeviceLibrary ...@@ -632,14 +632,20 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_17_UpdownAxisToP1)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_17_UpdownAxisToP1))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_17_BatchAxisToP3); MoveInfo.NextMoveStep(LineMoveStep.FI_18_WaitNoLocationCheck);
InLog("料盘移栽" + MoveInfo.SLog + ":等待 SL_AxisLocationCheck=LOW");
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_AxisLocationCheck, IO_VALUE.LOW));
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_18_WaitNoLocationCheck))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_19_BatchAxisToP3);
InLog("料盘移栽" + MoveInfo.SLog + ":提升伺服运动到P3,横移气缸上升"); InLog("料盘移栽" + MoveInfo.SLog + ":提升伺服运动到P3,横移气缸上升");
CylinderMove(null, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up); CylinderMove(null, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
BatchAxisToP3(); BatchAxisToP3();
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_17_BatchAxisToP3)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_19_BatchAxisToP3))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_18_SaveSize); MoveInfo.NextMoveStep(LineMoveStep.FI_20_SaveSize);
LastHeight = GetHeight(); LastHeight = GetHeight();
LastWidth = GetWidth(); LastWidth = GetWidth();
...@@ -665,24 +671,24 @@ namespace OnlineStore.DeviceLibrary ...@@ -665,24 +671,24 @@ namespace OnlineStore.DeviceLibrary
InLog("料盘移栽" + MoveInfo.SLog + ":记录 高度【" + LastHeight + "】宽度【" + LastWidth + "】"); InLog("料盘移栽" + MoveInfo.SLog + ":记录 高度【" + LastHeight + "】宽度【" + LastWidth + "】");
} }
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_18_SaveSize)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_20_SaveSize))
{ {
if (MoveCylineCanTakeOrGive()) if (MoveCylineCanTakeOrGive())
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_19_CylinderGive); MoveInfo.NextMoveStep(LineMoveStep.FI_21_CylinderGive);
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL"); InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give); CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
} }
else else
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_18_SaveSize); MoveInfo.NextMoveStep(LineMoveStep.FI_20_SaveSize);
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL前先上升横移气缸"); InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL前先上升横移气缸");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up); CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
} }
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_19_CylinderGive)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_21_CylinderGive))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_20_WaitTray); MoveInfo.NextMoveStep(LineMoveStep.FI_22_WaitTray);
int targetPositon = Config.GetUpdownP2Detial(LastHeight, LastWidth); int targetPositon = Config.GetUpdownP2Detial(LastHeight, LastWidth);
string log = ":移栽伺服下降到P2:" + targetPositon; string log = ":移栽伺服下降到P2:" + targetPositon;
UpdownAxis.AbsMove(MoveInfo, targetPositon, Config.UpdownAxis_P2Speed); UpdownAxis.AbsMove(MoveInfo, targetPositon, Config.UpdownAxis_P2Speed);
...@@ -690,7 +696,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -690,7 +696,7 @@ namespace OnlineStore.DeviceLibrary
//TODO 此处需要等待空托盘 //TODO 此处需要等待空托盘
if (MoveInfo.ShelfNoTray.Equals(false) && isScan) if (MoveInfo.ShelfNoTray.Equals(false) && isScan)
{ {
InLog("料盘移栽" + MoveInfo.SLog + ":等待空托盘到达 "+ log + ",预扫码"); InLog("料盘移栽" + MoveInfo.SLog + ":等待空托盘到达 " + log + ",预扫码");
//还有料盘,直接扫码 //还有料盘,直接扫码
NextCodeList = new List<string>(); NextCodeList = new List<string>();
try try
...@@ -698,10 +704,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -698,10 +704,10 @@ namespace OnlineStore.DeviceLibrary
Task<List<string>> scanTask = Task.Factory.StartNew(delegate Task<List<string>> scanTask = Task.Factory.StartNew(delegate
{ {
NextCodeList = CodeManager.CameraScan(Config.GetCameraList(),Name); NextCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name);
if (NextCodeList.Count <= 0) if (NextCodeList.Count <= 0)
{ {
NextCodeList = CodeManager.CameraScan(Config.GetCameraList(),Name); NextCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name);
} }
return NextCodeList; return NextCodeList;
}); });
...@@ -718,7 +724,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -718,7 +724,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_20_WaitTray))//TODO else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_22_WaitTray))//TODO
{ {
if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_11_CodeRember)) if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_11_CodeRember))
{ {
...@@ -727,7 +733,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -727,7 +733,7 @@ namespace OnlineStore.DeviceLibrary
//InLog("料盘移栽" + MoveInfo.SLog + ":移栽伺服下降到P2:" + targetPositon + ",托盘号【" + currTrayNum + "】,获取库位号,更新托盘信息"); //InLog("料盘移栽" + MoveInfo.SLog + ":移栽伺服下降到P2:" + targetPositon + ",托盘号【" + currTrayNum + "】,获取库位号,更新托盘信息");
//UpdownAxis.AbsMove(MoveInfo, targetPositon, Config.UpdownAxis_P2Speed); //UpdownAxis.AbsMove(MoveInfo, targetPositon, Config.UpdownAxis_P2Speed);
MoveInfo.NextMoveStep(LineMoveStep.FI_22_CylinderDown); MoveInfo.NextMoveStep(LineMoveStep.FI_24_CylinderDown);
InLog("料盘移栽" + MoveInfo.SLog + ":上料机构下降, 托盘号【" + currTrayNum + "】,获取库位号,更新托盘信息"); InLog("料盘移栽" + MoveInfo.SLog + ":上料机构下降, 托盘号【" + currTrayNum + "】,获取库位号,更新托盘信息");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down); CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
...@@ -769,22 +775,22 @@ namespace OnlineStore.DeviceLibrary ...@@ -769,22 +775,22 @@ namespace OnlineStore.DeviceLibrary
// InLog("料盘移栽" + MoveInfo.SLog + ":上料机构下降,"); // InLog("料盘移栽" + MoveInfo.SLog + ":上料机构下降,");
// CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down); // CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
//} //}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_22_CylinderDown)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_24_CylinderDown))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_23_CylinderRelax); MoveInfo.NextMoveStep(LineMoveStep.FI_25_CylinderRelax);
InLog("料盘移栽" + MoveInfo.SLog + ":上料气缸放松"); InLog("料盘移栽" + MoveInfo.SLog + ":上料气缸放松");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Tighten, IO_Type.SL_MoveCylinder_Slack); CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Tighten, IO_Type.SL_MoveCylinder_Slack);
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_23_CylinderRelax)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_25_CylinderRelax))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_24_CylinderUp); MoveInfo.NextMoveStep(LineMoveStep.FI_26_CylinderUp);
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移机构上升 "); InLog("料盘移栽" + MoveInfo.SLog + ":上料横移机构上升 ");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up); CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_24_CylinderUp)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_26_CylinderUp))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_25_UpDownAxisToP1); MoveInfo.NextMoveStep(LineMoveStep.FI_27_UpDownAxisToP1);
InLog("料盘移栽" + MoveInfo.SLog + ":升降伺服到P1点"); InLog("料盘移栽" + MoveInfo.SLog + ":升降伺服到P1点");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed); UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
if (Config.SidesWayNum > 0) if (Config.SidesWayNum > 0)
...@@ -799,7 +805,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -799,7 +805,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_25_UpDownAxisToP1)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_27_UpDownAxisToP1))
{ {
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移机构上升已到位,托盘开始放行 "); InLog("料盘移栽" + MoveInfo.SLog + ":上料横移机构上升已到位,托盘开始放行 ");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_MoveOk); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_MoveOk);
...@@ -1122,7 +1128,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1122,7 +1128,7 @@ namespace OnlineStore.DeviceLibrary
if (trayCanUse && runStatus.Equals(LineRunStatus.Busy) && MoveInfo.MoveType.Equals(LineMoveType.InStore)) if (trayCanUse && runStatus.Equals(LineRunStatus.Busy) && MoveInfo.MoveType.Equals(LineMoveType.InStore))
{ {
//入料执行中, 且需要空托盘 //入料执行中, 且需要空托盘
if (MoveInfo.MoveStep .Equals(LineMoveStep.FI_20_WaitTray)&&MoveInfo.IsInWait.Equals(false)) if (MoveInfo.MoveStep .Equals(LineMoveStep.FI_22_WaitTray)&&MoveInfo.IsInWait.Equals(false))
//if (MoveInfo.MoveStep >= LineMoveStep.FI_11_CylinderUp && MoveInfo.MoveStep <= LineMoveStep.FI_20_WaitTray) //if (MoveInfo.MoveStep >= LineMoveStep.FI_11_CylinderUp && MoveInfo.MoveStep <= LineMoveStep.FI_20_WaitTray)
{ {
if (NeedSaveParam) if (NeedSaveParam)
......
...@@ -20,25 +20,25 @@ namespace OnlineStore.DeviceLibrary ...@@ -20,25 +20,25 @@ namespace OnlineStore.DeviceLibrary
public partial class LineBean : KTK_Store public partial class LineBean : KTK_Store
{ {
public bool IsDebug = false; public bool IsDebug = false;
// public bool UseAgvClient = false; // public bool UseAgvClient = false;
/// <summary> /// <summary>
/// 灯闪烁定时器 /// 灯闪烁定时器
/// </summary> /// </summary>
private System.Timers.Timer ledProcessTimer = null; private System.Timers.Timer ledProcessTimer = null;
/// <summary> /// <summary>
/// 分出一个线程,专门处理急停,报警,气压检测,工单信号检测等处理 /// 分出一个线程,专门处理急停,报警,气压检测,工单信号检测等处理
/// </summary> /// </summary>
private System.Timers.Timer IoCheckTimer = null; private System.Timers.Timer IoCheckTimer = null;
/// <summary> /// <summary>
/// 流水线下所有的移载装置 /// 流水线下所有的移载装置
/// </summary> /// </summary>
public Dictionary<int, MoveEquip> MoveEquipMap { get; set; } public Dictionary<int, MoveEquip> MoveEquipMap { get; set; }
public Dictionary <int,FeedingEquip> FeedingEquipMap { get; set; } public Dictionary<int, FeedingEquip> FeedingEquipMap { get; set; }
public Dictionary<int, ProvidingEquip> ProvidingEquipMap { get; set; } public Dictionary<int, ProvidingEquip> ProvidingEquipMap { get; set; }
public Dictionary<int, DischargeLine> DisLineMap { get; set; } public Dictionary<int, DischargeLine> DisLineMap { get; set; }
public Dictionary<int ,EquipBase> AllEquipMap { get; set; } public Dictionary<int, EquipBase> AllEquipMap { get; set; }
/// <summary> /// <summary>
/// 流水线配置 /// 流水线配置
...@@ -46,8 +46,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -46,8 +46,8 @@ namespace OnlineStore.DeviceLibrary
public Line_Config Config { get; set; } public Line_Config Config { get; set; }
#region 初始化 #region 初始化
public List<string> cioList = new List<string>( ); public List<string> cioList = new List<string>();
// public List<string> rfidList = new List<string>(); // public List<string> rfidList = new List<string>();
private bool canStart = false; private bool canStart = false;
public LineBean(Line_Config lineConfig, Dictionary<int, MoveEquip_Config> configList, Dictionary<int, FeedingEquip_Config> feedMap, public LineBean(Line_Config lineConfig, Dictionary<int, MoveEquip_Config> configList, Dictionary<int, FeedingEquip_Config> feedMap,
...@@ -122,7 +122,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -122,7 +122,7 @@ namespace OnlineStore.DeviceLibrary
CodeManager.LoadConfig(); CodeManager.LoadConfig();
cioList = new List<string>(ioList); cioList = new List<string>(ioList);
string ids = ConfigAppSettings.GetValue(Setting_Init.DebugDeviceId); string ids = ConfigAppSettings.GetValue(Setting_Init.DebugDeviceId);
// rfidList = new List<string>(); // rfidList = new List<string>();
if (IsDebug) if (IsDebug)
{ {
...@@ -163,14 +163,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -163,14 +163,14 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(Name + "加载调试设备出错:",ex); LogUtil.error(Name + "加载调试设备出错:", ex);
} }
} }
RFIDManager.Init(); RFIDManager.Init();
Task.Factory.StartNew(delegate Task.Factory.StartNew(delegate
{ {
LogUtil.info(Name + "开始连接IO模块 "); LogUtil.info(Name + "开始连接IO模块 ");
IOManager.instance.ConnectionIOList(cioList); IOManager.instance.ConnectionIOList(cioList);
addLastDI(IO_Type.Airpressure_Check, IOValue(IO_Type.Airpressure_Check)); addLastDI(IO_Type.Airpressure_Check, IOValue(IO_Type.Airpressure_Check));
addLastDI(IO_Type.SuddenStop_BTN, IOValue(IO_Type.SuddenStop_BTN)); addLastDI(IO_Type.SuddenStop_BTN, IOValue(IO_Type.SuddenStop_BTN));
addLastDI(IO_Type.Reset_BTN, IOValue(IO_Type.Reset_BTN)); addLastDI(IO_Type.Reset_BTN, IOValue(IO_Type.Reset_BTN));
...@@ -184,7 +184,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -184,7 +184,7 @@ namespace OnlineStore.DeviceLibrary
}); });
} }
private void AddDeviceName(List<string> targetList, List<string> list) private void AddDeviceName(List<string> targetList, List<string> list)
{ {
foreach (string str in list) foreach (string str in list)
...@@ -196,7 +196,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -196,7 +196,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
public void InitTimer() public void InitTimer()
{ {
ledProcessTimer = new System.Timers.Timer(); ledProcessTimer = new System.Timers.Timer();
ledProcessTimer.Interval = 1000; ledProcessTimer.Interval = 1000;
ledProcessTimer.Elapsed += LedProcess; ledProcessTimer.Elapsed += LedProcess;
...@@ -212,11 +212,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -212,11 +212,11 @@ namespace OnlineStore.DeviceLibrary
#endregion #endregion
public string CanStart() public string CanStart()
{ {
if (!canStart) if (!canStart)
{ {
return "启动失败:设备未初始化完成"; return "启动失败:设备未初始化完成";
} }
if (MoveEquipMap == null) if (MoveEquipMap == null)
{ {
...@@ -225,16 +225,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -225,16 +225,16 @@ namespace OnlineStore.DeviceLibrary
if (IsDebug) if (IsDebug)
{ {
return ""; return "";
} }
if (IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{ {
return "启动失败:急停未开"; return "启动失败:急停未开";
} }
else if (IOValue(IO_Type.Airpressure_Check).Equals(IO_VALUE.LOW)) else if (IOValue(IO_Type.Airpressure_Check).Equals(IO_VALUE.LOW))
{ {
return "启动失败:没有气压信号"; return "启动失败:没有气压信号";
} }
return ""; return "";
} }
...@@ -253,17 +253,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -253,17 +253,18 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
ledProcessTimer.Enabled = false; // ledProcessTimer.Enabled = false;
IoCheckTimer.Enabled = false; IoCheckTimer.Enabled = false;
mainTimer.Enabled = false; mainTimer.Enabled = false;
ledProcessTimer.Enabled = true;
lineStatus = LineStatus.ResetMove; lineStatus = LineStatus.ResetMove;
runStatus = LineRunStatus.HomeMoving; runStatus = LineRunStatus.HomeMoving;
StartTime = DateTime.Now; StartTime = DateTime.Now;
LogUtil.info(Name + "开始启动,启动时间:" + StartTime.ToString()); LogUtil.info(Name + "开始启动,启动时间:" + StartTime.ToString());
RFIDManager.Open(); RFIDManager.Open();
Thread.Sleep(5); Thread.Sleep(5);
// AgvClient.SetCancelState(false); // AgvClient.SetCancelState(false);
LineServer.StartServer(ConfigAppSettings.GetIntValue(Setting_Init.TCPServerPort)); LineServer.StartServer(ConfigAppSettings.GetIntValue(Setting_Init.TCPServerPort));
RHomeOp(); RHomeOp();
...@@ -273,7 +274,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -273,7 +274,6 @@ namespace OnlineStore.DeviceLibrary
EquipStartRun(moveEquip); EquipStartRun(moveEquip);
} }
ledProcessTimer.Enabled = true;
IoCheckTimer.Enabled = true; IoCheckTimer.Enabled = true;
mainTimer.Enabled = true; mainTimer.Enabled = true;
return true; return true;
...@@ -293,15 +293,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -293,15 +293,15 @@ namespace OnlineStore.DeviceLibrary
} }
private void RHomeOp() private void RHomeOp()
{ {
// TrayManager.SidesWayStateMap = new System.Collections.Concurrent.ConcurrentDictionary<int, int>() ; // TrayManager.SidesWayStateMap = new System.Collections.Concurrent.ConcurrentDictionary<int, int>() ;
alarmType = LineAlarmType.None; alarmType = LineAlarmType.None;
mainTimer.Enabled = false; mainTimer.Enabled = false;
IoCheckTimer.Enabled = false; IoCheckTimer.Enabled = false;
isInSuddenDown = false; isInSuddenDown = false;
isNoAirCheck = false; isNoAirCheck = false;
TrayManager.TrayErrorMsg = ""; TrayManager.TrayErrorMsg = "";
SetWarnMsg(""); SetWarnMsg("");
MoveInfo.NewMove(LineMoveType.Reset); MoveInfo.NewMove(LineMoveType.Reset);
MoveInfo.NextMoveStep(LineMoveStep.Wait); MoveInfo.NextMoveStep(LineMoveStep.Wait);
if (TrayManager.ErrorDeviceId > 0) if (TrayManager.ErrorDeviceId > 0)
...@@ -313,7 +313,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -313,7 +313,7 @@ namespace OnlineStore.DeviceLibrary
} }
TrayManager.ErrorDeviceId = -1; TrayManager.ErrorDeviceId = -1;
WriteDrivetMotorRun( IO_VALUE.LOW); WriteDrivetMotorRun(IO_VALUE.LOW);
//横移轨道下降 //横移轨道下降
SideWayStop(); SideWayStop();
...@@ -328,13 +328,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -328,13 +328,13 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(MoveInfo, IO_Type.SW2_LocationCylinder_Up, IO_Type.SW2_LocationCylinder_Down); CylinderMove(MoveInfo, IO_Type.SW2_LocationCylinder_Up, IO_Type.SW2_LocationCylinder_Down);
CylinderMove(MoveInfo, IO_Type.SW3_LocationCylinder_Up, IO_Type.SW3_LocationCylinder_Down); CylinderMove(MoveInfo, IO_Type.SW3_LocationCylinder_Up, IO_Type.SW3_LocationCylinder_Down);
//顶升下降 //顶升下降
CylinderMove(MoveInfo, IO_Type.SW2_TopCylinder_Up, IO_Type.SW2_TopCylinder_Down); CylinderMove(MoveInfo, IO_Type.SW2_TopCylinder_Up, IO_Type.SW2_TopCylinder_Down);
CylinderMove(MoveInfo, IO_Type.SW3_TopCylinder_Up, IO_Type.SW3_TopCylinder_Down); CylinderMove(MoveInfo, IO_Type.SW3_TopCylinder_Up, IO_Type.SW3_TopCylinder_Down);
CylinderMove(MoveInfo, IO_Type.SW1_TopCylinder_Up, IO_Type.SW1_TopCylinder_Down); CylinderMove(MoveInfo, IO_Type.SW1_TopCylinder_Up, IO_Type.SW1_TopCylinder_Down);
CylinderMove(MoveInfo, IO_Type.SW4_TopCylinder_Up, IO_Type.SW4_TopCylinder_Down); CylinderMove(MoveInfo, IO_Type.SW4_TopCylinder_Up, IO_Type.SW4_TopCylinder_Down);
} }
public override bool Reset() public override bool Reset()
{ {
...@@ -345,11 +345,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -345,11 +345,11 @@ namespace OnlineStore.DeviceLibrary
{ {
//TrayManager.LineNeedEmptyTrayNum = 0; //TrayManager.LineNeedEmptyTrayNum = 0;
isNeedAllReset = true; isNeedAllReset = true;
LogUtil.error( Name + "收到复位信号,急停中或没有气压报警中,强制所有设备复位~"); LogUtil.error(Name + "收到复位信号,急停中或没有气压报警中,强制所有设备复位~");
} }
else if ((runStatus == LineRunStatus.HomeMoving || runStatus == LineRunStatus.Reset) && NoAlarm()) else if ((runStatus == LineRunStatus.HomeMoving || runStatus == LineRunStatus.Reset) && NoAlarm())
{ {
LogUtil.error( Name + "收到复位信号,已经在复位或原点返回中,且当前无报警,不处理复位"); LogUtil.error(Name + "收到复位信号,已经在复位或原点返回中,且当前无报警,不处理复位");
return false; return false;
} }
...@@ -366,7 +366,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -366,7 +366,7 @@ namespace OnlineStore.DeviceLibrary
{ {
EquipReset(equip, isNeedAllReset); EquipReset(equip, isNeedAllReset);
} }
IoCheckTimer.Enabled = true; IoCheckTimer.Enabled = true;
mainTimer.Enabled = true; mainTimer.Enabled = true;
return true; return true;
...@@ -378,8 +378,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -378,8 +378,8 @@ namespace OnlineStore.DeviceLibrary
{ {
if (isNeedAllReset || TrayManager.ErrorDeviceId.Equals(equip.DeviceID) || (!NoAlarm())) if (isNeedAllReset || TrayManager.ErrorDeviceId.Equals(equip.DeviceID) || (!NoAlarm()))
{ {
LogUtil.info(Name + "收到复位信号," + equip.Name + " 需要复位"); LogUtil.info(Name + "收到复位信号," + equip.Name + " 需要复位");
equip.Reset(); equip.Reset();
Thread.Sleep(60); Thread.Sleep(60);
} }
else else
...@@ -399,13 +399,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -399,13 +399,14 @@ namespace OnlineStore.DeviceLibrary
{ {
IoCheckTimer.Enabled = false; IoCheckTimer.Enabled = false;
mainTimer.Enabled = false; mainTimer.Enabled = false;
ledProcessTimer.Enabled = false;
AgvClient.SetCancelState(true); AgvClient.SetCancelState(true);
WriteDrivetMotorRun(IO_VALUE.LOW); WriteDrivetMotorRun(IO_VALUE.LOW);
//停止运行时,把阻挡气缸上升 //停止运行时,把阻挡气缸上升
StopMove(); StopMove();
runStatus = LineRunStatus.Wait; runStatus = LineRunStatus.Wait;
ledProcessTimer.Enabled = false;
CloseLed();
LineServer.StopServer(); LineServer.StopServer();
RFIDManager.Close(); RFIDManager.Close();
...@@ -413,13 +414,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -413,13 +414,13 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(Name + ",停止运行,总运行时间:" + span.ToString()); LogUtil.info(Name + ",停止运行,总运行时间:" + span.ToString());
} }
public override void Alarm(LineAlarmType alarmType ) public override void Alarm(LineAlarmType alarmType)
{ {
if (this.alarmType.Equals(alarmType)) if (this.alarmType.Equals(alarmType))
{ {
return; return;
} }
// SaveAlarmInfo(alarmType, alarmDetial, alarmMsg, storeMoveType); // SaveAlarmInfo(alarmType, alarmDetial, alarmMsg, storeMoveType);
this.alarmType = alarmType; this.alarmType = alarmType;
if (alarmType == LineAlarmType.SuddenStop) if (alarmType == LineAlarmType.SuddenStop)
{ {
...@@ -435,9 +436,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -435,9 +436,9 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(WarnMsg); LogUtil.error(WarnMsg);
StopMove(); StopMove();
} }
IOMove(IO_Type.Alarm_HddLed, IO_VALUE.HIGH); IOMove(IO_Type.Alarm_HddLed, IO_VALUE.HIGH);
} }
public void WriteDrivetMotorRun(IO_VALUE value) public void WriteDrivetMotorRun(IO_VALUE value)
{ {
...@@ -446,81 +447,97 @@ namespace OnlineStore.DeviceLibrary ...@@ -446,81 +447,97 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.DriveMotor_Run3, value); IOMove(IO_Type.DriveMotor_Run3, value);
IOMove(IO_Type.DriveMotor_Run4, value); IOMove(IO_Type.DriveMotor_Run4, value);
} }
#region 灯光处理 #region 灯光处理
private void CloseLed()
{
CheckAndMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
CheckAndMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
CheckAndMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
CheckAndMove(IO_Type.Alarm_Buzzer, IO_VALUE.LOW);
}
private void LedProcess(object sender, ElapsedEventArgs e) private void LedProcess(object sender, ElapsedEventArgs e)
{ {
try try
{ {
DateTime time = DateTime.Now; DateTime time = DateTime.Now;
if (runStatus <= LineRunStatus.Wait)
//黄灯
if ( runStatus.Equals(LineRunStatus.HomeMoving) || runStatus.Equals(LineRunStatus.Reset))
{ {
//开机执行中时黄灯闪烁 CloseLed();
if (IsDoValue(IO_Type.RunSign_HddLed, IO_VALUE.HIGH)) return;
{
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
}
else
{
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.HIGH);
}
} }
//休眠状态黄灯常亮
//else if (IsSleep)
//{
// if (IsDoValue(IO_Type.RunSign_HddLed, IO_VALUE.LOW))
// {
// IOMove(IO_Type.RunSign_HddLed, IO_VALUE.HIGH);
// }
//}
//else
//{
if (IsDoValue(IO_Type.RunSign_HddLed, IO_VALUE.HIGH))
{
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
}
//}
bool isNeedAlarmLed = false; bool isNeedAlarmLed = false;
bool isInOut = false; bool isInOut = false;
if (NoAlarm().Equals(false) || TrayManager.TrayErrorMsg != "") bool yellowShanShuo = false;
if (runStatus.Equals(LineRunStatus.HomeMoving) || runStatus.Equals(LineRunStatus.Reset))
{
yellowShanShuo = true;
}
if (isInSuddenDown||isNoAirCheck||alarmType>LineAlarmType.AxisAlarm )
{ {
isNeedAlarmLed = true; isNeedAlarmLed = true;
} }
else if(alarmType.Equals(LineAlarmType.None).Equals(false)||TrayManager.TrayErrorMsg!="")
{
yellowShanShuo = true;
}
foreach (MoveEquip moveEquip in MoveEquipMap.Values) foreach (MoveEquip moveEquip in MoveEquipMap.Values)
{ {
if (!moveEquip.NoAlarm()) if (moveEquip.isNoAirCheck || moveEquip.isInSuddenDown || moveEquip.alarmType > LineAlarmType.AxisAlarm)
{ {
isNeedAlarmLed = true; isNeedAlarmLed = true;
} }
else if (moveEquip.alarmType.Equals(LineAlarmType.None).Equals(false))
{
yellowShanShuo = true;
}
if (moveEquip.MoveInfo.MoveType.Equals(LineMoveType.InStore) || moveEquip.MoveInfo.MoveType.Equals(LineMoveType.OutStore)) if (moveEquip.MoveInfo.MoveType.Equals(LineMoveType.InStore) || moveEquip.MoveInfo.MoveType.Equals(LineMoveType.OutStore))
{ {
isInOut = true; isInOut = true;
} }
} }
//忙碌中,判断是否有移栽在出入库执行,绿灯闪烁
if (isInOut) //黄灯
if (yellowShanShuo)
{ {
if (IsDoValue(IO_Type.AutoRun_HddLed, IO_VALUE.LOW)) //开机执行中时黄灯闪烁
if (IsDoValue(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH))
{ {
IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH); IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
} }
else else
{ {
IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW); IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH);
} }
} }
else if (IsDoValue(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH)) else if (IsDoValue(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH))
{ {
IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW); IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
} }
//忙碌中,判断是否有移栽在出入库执行,绿灯闪烁
if (isInOut)
{
if (IsDoValue(IO_Type.RunSign_HddLed, IO_VALUE.LOW))
{
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.HIGH);
}
else
{
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
}
}
else if (IsDoValue(IO_Type.RunSign_HddLed, IO_VALUE.LOW))
{
//平常常亮绿灯
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.HIGH);
}
//报警中 ,红灯闪烁 //严重报警中 ,红灯闪烁
if (isNeedAlarmLed) if (isNeedAlarmLed)
{ {
if (IsDoValue(IO_Type.Alarm_HddLed, IO_VALUE.LOW)) if (IsDoValue(IO_Type.Alarm_HddLed, IO_VALUE.LOW))
...@@ -536,14 +553,22 @@ namespace OnlineStore.DeviceLibrary ...@@ -536,14 +553,22 @@ namespace OnlineStore.DeviceLibrary
{ {
IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW); IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
} }
if (isNeedAlarmLed && LineManager.UseBuzzer)
{
CheckAndMove(IO_Type.Alarm_Buzzer, IO_VALUE.HIGH);
}
else
{
CheckAndMove(IO_Type.Alarm_Buzzer, IO_VALUE.LOW);
}
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(Name + "灯处理定时器出错:",ex); LogUtil.error(Name + "灯处理定时器出错:", ex);
} }
Thread.Sleep(5); Thread.Sleep(5);
} }
#endregion #endregion
private void IoCheckTimerProcess(object sender, ElapsedEventArgs e) private void IoCheckTimerProcess(object sender, ElapsedEventArgs e)
......
...@@ -415,11 +415,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -415,11 +415,11 @@ namespace OnlineStore.DeviceLibrary
sdIsInprocess = false; sdIsInprocess = false;
return; return;
} }
if (SW23_MoveInfo.MoveType.Equals(LineMoveType.None) && SW23WaitTrayNum > 0) if (SW23_MoveInfo.MoveType.Equals(LineMoveType.None) && SW23WaitTrayNum >= 0)
{ {
Equip_TrayPEndEvent(2, SW23WaitTrayNum); Equip_TrayPEndEvent(2, SW23WaitTrayNum);
} }
if (SW41_MoveInfo.MoveType.Equals(LineMoveType.None) && SW41WaitTrayNum > 0) if (SW41_MoveInfo.MoveType.Equals(LineMoveType.None) && SW41WaitTrayNum >= 0)
{ {
Equip_TrayPEndEvent(4, SW41WaitTrayNum); Equip_TrayPEndEvent(4, SW41WaitTrayNum);
} }
......
...@@ -13,8 +13,8 @@ using System.Windows.Forms; ...@@ -13,8 +13,8 @@ using System.Windows.Forms;
namespace OnlineStore.DeviceLibrary namespace OnlineStore.DeviceLibrary
{ {
public class LineManager public class LineManager
{ {
public static bool UseBuzzer = ConfigAppSettings.GetIntValue(Setting_Init.UseBuzzer).Equals(1);
private static bool isInit = false; private static bool isInit = false;
public static bool IsConnectServer = !ConfigAppSettings.GetValue(Setting_Init.http_server).Equals(""); public static bool IsConnectServer = !ConfigAppSettings.GetValue(Setting_Init.http_server).Equals("");
......
...@@ -177,7 +177,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -177,7 +177,7 @@ namespace OnlineStore.DeviceLibrary
/// 没有严重的报警 /// 没有严重的报警
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
protected bool NoErrorAlarm() internal bool NoErrorAlarm()
{ {
if (isInSuddenDown || isNoAirCheck) if (isInSuddenDown || isNoAirCheck)
{ {
......
...@@ -645,26 +645,30 @@ namespace OnlineStore.DeviceLibrary ...@@ -645,26 +645,30 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
FI_16_CylinderTighten = 11016, FI_16_CylinderTighten = 11016,
/// <summary> /// <summary>
/// 料盘移栽:上料横移机构上升,同时伺服运动到P3 /// 料盘移栽:升降伺服到P1点
/// </summary>
FI_17_UpdownAxisToP1,
/// <summary>
/// 料盘移栽:等待没有伺服料盘检测信号
/// </summary> /// </summary>
FI_17_UpdownAxisToP1 , FI_18_WaitNoLocationCheck,
/// <summary> /// <summary>
/// 料盘移栽:批量轴到P3点,检测是否有料盘 /// 料盘移栽:批量轴到P3点,检测是否有料盘
/// </summary> /// </summary>
FI_17_BatchAxisToP3, FI_19_BatchAxisToP3,
/// <summary> /// <summary>
/// 料盘移栽:记录高度尺寸 /// 料盘移栽:记录高度尺寸
/// </summary> /// </summary>
FI_18_SaveSize , FI_20_SaveSize ,
/// <summary> /// <summary>
/// 料盘移栽: 上料横移气缸放料SOL /// 料盘移栽: 上料横移气缸放料SOL
/// </summary> /// </summary>
FI_19_CylinderGive , FI_21_CylinderGive ,
/// <summary> /// <summary>
/// 料盘移栽:等待空托盘到达,移栽伺服下降到P2,并预扫码 /// 料盘移栽:等待空托盘到达,移栽伺服下降到P2,并预扫码
/// </summary> /// </summary>
FI_20_WaitTray, FI_22_WaitTray,
///// <summary> ///// <summary>
///// 料盘移栽:移栽伺服下降到P2 ///// 料盘移栽:移栽伺服下降到P2
///// </summary> ///// </summary>
...@@ -672,20 +676,20 @@ namespace OnlineStore.DeviceLibrary ...@@ -672,20 +676,20 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 料盘移栽: 上料机构下降 /// 料盘移栽: 上料机构下降
/// </summary> /// </summary>
FI_22_CylinderDown, FI_24_CylinderDown,
/// <summary> /// <summary>
/// 料盘移栽: 上料气缸放松 /// 料盘移栽: 上料气缸放松
/// </summary> /// </summary>
FI_23_CylinderRelax , FI_25_CylinderRelax ,
/// <summary> /// <summary>
/// 料盘移栽:上料横移机构上升,定位或者顶升可以先下降 /// 料盘移栽:上料横移机构上升,定位或者顶升可以先下降
/// </summary> /// </summary>
FI_24_CylinderUp, FI_26_CylinderUp,
/// <summary> /// <summary>
/// 料盘移栽:升降伺服到P1点 /// 料盘移栽:升降伺服到P1点
/// </summary> /// </summary>
FI_25_UpDownAxisToP1, FI_27_UpDownAxisToP1,
///// <summary> ///// <summary>
///// 料盘移栽:上料横移机构到取料端 ///// 料盘移栽:上料横移机构到取料端
///// </summary> ///// </summary>
......
...@@ -51,18 +51,18 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -51,18 +51,18 @@ namespace OnlineStore.LoadCSVLibrary
/// DI 0 气压检测 Airpressure_Check 4 气压检测 X05 DI-05 /// DI 0 气压检测 Airpressure_Check 4 气压检测 X05 DI-05
/// </summary> /// </summary>
public static string Airpressure_Check = "Airpressure_Check"; public static string Airpressure_Check = "Airpressure_Check";
/// <summary> /// <summary>
/// DO 0 待机状态(指示灯) AutoRun_HddLed 24 待机状态(指示灯) Y01 DO-01 /// DO 0 黄灯 待机状态(指示灯) AutoRun_HddLed 24 待机状态(指示灯) Y01 DO-01
/// </summary> /// </summary>
public static string AutoRun_HddLed = "AutoRun_HddLed"; public static string AutoRun_HddLed = "AutoRun_HddLed";
/// <summary> /// <summary>
/// DO 0 运行状态(指示灯) RunSign_HddLed 25 运行状态(指示灯) Y02 DO-02 /// DO 0 绿灯 运行状态(指示灯) RunSign_HddLed 25 运行状态(指示灯) Y02 DO-02
/// </summary> /// </summary>
public static string RunSign_HddLed = "RunSign_HddLed"; public static string RunSign_HddLed = "RunSign_HddLed";
/// <summary> /// <summary>
/// DO 0 故障状态(指示灯) Alarm_HddLed 26 故障状态(指示灯) Y03 DO-03 /// DO 0 红灯 故障状态(指示灯) Alarm_HddLed 26 故障状态(指示灯) Y03 DO-03
/// </summary> /// </summary>
public static string Alarm_HddLed = "Alarm_HddLed"; public static string Alarm_HddLed = "Alarm_HddLed";
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!