Commit 60a0a316 LN

bug修改

1 个父辈 d0b3f6b5
...@@ -112,6 +112,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -112,6 +112,7 @@ namespace OnlineStore.DeviceLibrary
//急停按钮和气压检测需要一起判断 //急停按钮和气压检测需要一起判断
IO_VALUE suddenBtn = IOValue(IO_Type.SuddenStop_BTN); IO_VALUE suddenBtn = IOValue(IO_Type.SuddenStop_BTN);
IO_VALUE airCheck = IOValue(IO_Type.Airpressure_Check); IO_VALUE airCheck = IOValue(IO_Type.Airpressure_Check);
airCheck = IO_VALUE.HIGH;
if (suddenBtn.Equals(IO_VALUE.HIGH) && (airCheck.Equals(IO_VALUE.HIGH))) if (suddenBtn.Equals(IO_VALUE.HIGH) && (airCheck.Equals(IO_VALUE.HIGH)))
{ {
...@@ -142,10 +143,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -142,10 +143,12 @@ namespace OnlineStore.DeviceLibrary
{ {
if (suddenBtn.Equals(IO_VALUE.LOW)) if (suddenBtn.Equals(IO_VALUE.LOW))
{ {
SetWarnMsg("启动失败:急停未开");
LogUtil.error(" (" + Name + ")启动出现错误:急停没开 !启动失败!"); LogUtil.error(" (" + Name + ")启动出现错误:急停没开 !启动失败!");
} }
else else
{ {
SetWarnMsg("启动失败:没有气压信号");
LogUtil.error(" (" + Name + ")启动出现错误:没有气压信号 !启动失败!"); LogUtil.error(" (" + Name + ")启动出现错误:没有气压信号 !启动失败!");
} }
return false; return false;
...@@ -511,6 +514,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -511,6 +514,7 @@ namespace OnlineStore.DeviceLibrary
private void IoCheckTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) private void IoCheckTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{ {
//return;
//判断急停 //判断急停
if (storeRunStatus >= StoreRunStatus.HomeMoving) if (storeRunStatus >= StoreRunStatus.HomeMoving)
{ {
...@@ -524,9 +528,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -524,9 +528,9 @@ namespace OnlineStore.DeviceLibrary
if (IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{ {
isInSuddenDown = true; isInSuddenDown = true;
LogUtil.error(Name + "收到急停信号,报警急停"); LogUtil.error(Name + "收到急停信号报警急停");
WarnMsg = Name + "收到急停信号,报警急停"; //WarnMsg = Name + "收到急停信号,报警急停";
SetWarnMsg( "收到急停信号,报警急停");
//报警时会关闭所有轴 //报警时会关闭所有轴
Alarm(StoreAlarmType.SuddenStop, "1", WarnMsg, StoreMoveType.None); Alarm(StoreAlarmType.SuddenStop, "1", WarnMsg, StoreMoveType.None);
} }
...@@ -583,7 +587,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -583,7 +587,7 @@ namespace OnlineStore.DeviceLibrary
TimeSpan span = DateTime.Now - lastAirCloseTime; TimeSpan span = DateTime.Now - lastAirCloseTime;
if (span.TotalSeconds > StoreManager.Config.AirCheckSeconds) if (span.TotalSeconds > StoreManager.Config.AirCheckSeconds)
{ {
WarnMsg = "未检测到气压信号"; SetWarnMsg( "未检测到气压信号");
preAirValue = IO_VALUE.LOW; preAirValue = IO_VALUE.LOW;
LogUtil.info("已持续【" + FormUtil.GetSpanStr(span) + "】未检测到气压信号,报警"); LogUtil.info("已持续【" + FormUtil.GetSpanStr(span) + "】未检测到气压信号,报警");
Alarm(StoreAlarmType.NoAirCheck, "2", WarnMsg, StoreMoveType.None); Alarm(StoreAlarmType.NoAirCheck, "2", WarnMsg, StoreMoveType.None);
...@@ -860,7 +864,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -860,7 +864,7 @@ namespace OnlineStore.DeviceLibrary
AxisManager.instance.SuddenStop(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue()); AxisManager.instance.SuddenStop(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue());
AxisManager.instance.SuddenStop(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue()); AxisManager.instance.SuddenStop(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue());
AxisManager.instance.SuddenStop(Config.Comp_Axis.DeviceName, Config.Comp_Axis.GetAxisValue()); AxisManager.instance.SuddenStop(Config.Comp_Axis.DeviceName, Config.Comp_Axis.GetAxisValue());
Thread.Sleep(300);
CloseAllAxis(); CloseAllAxis();
LogUtil.info(Name + "StopMove"); LogUtil.info(Name + "StopMove");
......
...@@ -384,36 +384,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -384,36 +384,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
private void SetWarnMsg(string msg)
{
if (String.IsNullOrEmpty(WarnMsg).Equals(false))
{
if (WarnMsg.Equals(msg))
{
if (msg.StartsWith(Name))
{
LogUtil.error(msg, 105);
}
else
{
LogUtil.error(Name + msg, 105);
}
}
else
{
if (msg.StartsWith(Name))
{
LogUtil.error(msg);
}
else
{
LogUtil.error(Name + msg);
}
}
}
WarnMsg = msg;
}
public override void Alarm(StoreAlarmType alarmType, string alarmDetial, string alarmMsg, StoreMoveType storeMoveType) public override void Alarm(StoreAlarmType alarmType, string alarmDetial, string alarmMsg, StoreMoveType storeMoveType)
......
...@@ -428,7 +428,37 @@ namespace OnlineStore.DeviceLibrary ...@@ -428,7 +428,37 @@ namespace OnlineStore.DeviceLibrary
{ {
return IOManager.IOValue(IoType, baseConfig.DeviceID); return IOManager.IOValue(IoType, baseConfig.DeviceID);
} }
protected void SetWarnMsg(string msg)
{
if (String.IsNullOrEmpty(WarnMsg).Equals(false))
{
if (WarnMsg.Equals(msg))
{
if (msg.StartsWith(Name))
{
LogUtil.error(msg, 105);
}
else
{
LogUtil.error(Name + msg, 105);
}
}
else
{
if (msg.StartsWith(Name))
{
LogUtil.error(msg);
}
else
{
msg = Name + msg;
LogUtil.error( msg);
}
}
}
WarnMsg = msg;
}
public bool IsDoValue(string ioType, IO_VALUE ioValue) public bool IsDoValue(string ioType, IO_VALUE ioValue)
{ {
return IOValue(ioType).Equals(ioValue); return IOValue(ioType).Equals(ioValue);
......
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
this.groupBox4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.groupBox4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox4.Location = new System.Drawing.Point(532, 264); this.groupBox4.Location = new System.Drawing.Point(532, 264);
this.groupBox4.Name = "groupBox4"; this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(472, 129); this.groupBox4.Size = new System.Drawing.Size(472, 126);
this.groupBox4.TabIndex = 108; this.groupBox4.TabIndex = 108;
this.groupBox4.TabStop = false; this.groupBox4.TabStop = false;
this.groupBox4.Text = "DO写入"; this.groupBox4.Text = "DO写入";
...@@ -336,7 +336,7 @@ ...@@ -336,7 +336,7 @@
// //
this.btnOpenDoor.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnOpenDoor.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOpenDoor.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnOpenDoor.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOpenDoor.Location = new System.Drawing.Point(348, 52); this.btnOpenDoor.Location = new System.Drawing.Point(346, 29);
this.btnOpenDoor.Name = "btnOpenDoor"; this.btnOpenDoor.Name = "btnOpenDoor";
this.btnOpenDoor.Size = new System.Drawing.Size(105, 35); this.btnOpenDoor.Size = new System.Drawing.Size(105, 35);
this.btnOpenDoor.TabIndex = 248; this.btnOpenDoor.TabIndex = 248;
...@@ -360,7 +360,7 @@ ...@@ -360,7 +360,7 @@
// //
this.btnCloseDoor.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnCloseDoor.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCloseDoor.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnCloseDoor.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCloseDoor.Location = new System.Drawing.Point(348, 92); this.btnCloseDoor.Location = new System.Drawing.Point(346, 69);
this.btnCloseDoor.Name = "btnCloseDoor"; this.btnCloseDoor.Name = "btnCloseDoor";
this.btnCloseDoor.Size = new System.Drawing.Size(105, 35); this.btnCloseDoor.Size = new System.Drawing.Size(105, 35);
this.btnCloseDoor.TabIndex = 249; this.btnCloseDoor.TabIndex = 249;
...@@ -423,7 +423,7 @@ ...@@ -423,7 +423,7 @@
this.groupBox5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.groupBox5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox5.Location = new System.Drawing.Point(775, 3); this.groupBox5.Location = new System.Drawing.Point(775, 3);
this.groupBox5.Name = "groupBox5"; this.groupBox5.Name = "groupBox5";
this.groupBox5.Size = new System.Drawing.Size(229, 252); this.groupBox5.Size = new System.Drawing.Size(229, 249);
this.groupBox5.TabIndex = 107; this.groupBox5.TabIndex = 107;
this.groupBox5.TabStop = false; this.groupBox5.TabStop = false;
this.groupBox5.Text = "DO列表"; this.groupBox5.Text = "DO列表";
...@@ -440,7 +440,7 @@ ...@@ -440,7 +440,7 @@
this.tableLayoutPanel2.RowCount = 2; this.tableLayoutPanel2.RowCount = 2;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F)); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F)); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(218, 232); this.tableLayoutPanel2.Size = new System.Drawing.Size(218, 229);
this.tableLayoutPanel2.TabIndex = 103; this.tableLayoutPanel2.TabIndex = 103;
// //
// lblTemp // lblTemp
...@@ -462,7 +462,7 @@ ...@@ -462,7 +462,7 @@
this.groupBox6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.groupBox6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox6.Location = new System.Drawing.Point(532, 3); this.groupBox6.Location = new System.Drawing.Point(532, 3);
this.groupBox6.Name = "groupBox6"; this.groupBox6.Name = "groupBox6";
this.groupBox6.Size = new System.Drawing.Size(229, 252); this.groupBox6.Size = new System.Drawing.Size(229, 249);
this.groupBox6.TabIndex = 106; this.groupBox6.TabIndex = 106;
this.groupBox6.TabStop = false; this.groupBox6.TabStop = false;
this.groupBox6.Text = "DI列表"; this.groupBox6.Text = "DI列表";
...@@ -479,7 +479,7 @@ ...@@ -479,7 +479,7 @@
this.tableLayoutPanel1.RowCount = 2; this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(218, 232); this.tableLayoutPanel1.Size = new System.Drawing.Size(218, 229);
this.tableLayoutPanel1.TabIndex = 102; this.tableLayoutPanel1.TabIndex = 102;
// //
// groupInout // groupInout
...@@ -530,7 +530,7 @@ ...@@ -530,7 +530,7 @@
this.groupInout.Enabled = false; this.groupInout.Enabled = false;
this.groupInout.Location = new System.Drawing.Point(3, 3); this.groupInout.Location = new System.Drawing.Point(3, 3);
this.groupInout.Name = "groupInout"; this.groupInout.Name = "groupInout";
this.groupInout.Size = new System.Drawing.Size(514, 456); this.groupInout.Size = new System.Drawing.Size(514, 453);
this.groupInout.TabIndex = 100; this.groupInout.TabIndex = 100;
this.groupInout.TabStop = false; this.groupInout.TabStop = false;
this.groupInout.Text = "料仓操作"; this.groupInout.Text = "料仓操作";
...@@ -1185,10 +1185,10 @@ ...@@ -1185,10 +1185,10 @@
this.tabPage1.Controls.Add(this.btnAxisOn); this.tabPage1.Controls.Add(this.btnAxisOn);
this.tabPage1.Controls.Add(this.btnAxisOff); this.tabPage1.Controls.Add(this.btnAxisOff);
this.tabPage1.Controls.Add(this.btnAxisP); this.tabPage1.Controls.Add(this.btnAxisP);
this.tabPage1.Location = new System.Drawing.Point(4, 29); this.tabPage1.Location = new System.Drawing.Point(4, 26);
this.tabPage1.Name = "tabPage1"; this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3); this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(1075, 485); this.tabPage1.Size = new System.Drawing.Size(1075, 488);
this.tabPage1.TabIndex = 0; this.tabPage1.TabIndex = 0;
this.tabPage1.Text = " 伺服调试 "; this.tabPage1.Text = " 伺服调试 ";
this.tabPage1.UseVisualStyleBackColor = true; this.tabPage1.UseVisualStyleBackColor = true;
......
...@@ -369,7 +369,7 @@ namespace OnlineStore.ACSingleStore ...@@ -369,7 +369,7 @@ namespace OnlineStore.ACSingleStore
var prevCpuTime = TimeSpan.Zero; var prevCpuTime = TimeSpan.Zero;
foreach (Process process in processes) foreach (Process process in processes)
{ {
if (process.ProcessName.EndsWith("ACPackingStore")) if (process.ProcessName.EndsWith("HCSingleStore"))
{ {
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;
...@@ -398,7 +398,7 @@ namespace OnlineStore.ACSingleStore ...@@ -398,7 +398,7 @@ namespace OnlineStore.ACSingleStore
string msg = ""; string msg = "";
if (store.WarnMsg != "") if (store.WarnMsg != "")
{ {
msg = store.Name+ store.WarnMsg; msg = store.WarnMsg;
} }
foreach(BoxBean box in store.BoxMap.Values) foreach(BoxBean box in store.BoxMap.Values)
{ {
......
...@@ -105,6 +105,10 @@ namespace HuichuanLibrary ...@@ -105,6 +105,10 @@ namespace HuichuanLibrary
{ {
cmbAxisIndex.SelectedIndex = 0; cmbAxisIndex.SelectedIndex = 0;
} }
else
{
tabControl1.TabPages.RemoveAt(0);
}
} }
} }
private short GetAxisNo() private short GetAxisNo()
...@@ -292,7 +296,7 @@ namespace HuichuanLibrary ...@@ -292,7 +296,7 @@ namespace HuichuanLibrary
} }
private void axStsMonitor_timer_Tick(object sender, EventArgs e) private void axStsMonitor_timer_Tick(object sender, EventArgs e)
{ {
if (btnStartTimer.Visible && HCBoardManager.CardInitOk()) if (btnStartTimer.Visible && HCBoardManager.CardInitOk() && HCBoardManager.AxisList.Count > 0)
{ {
btnStartTimer.Enabled = false; btnStartTimer.Enabled = false;
ReadAxisStatus(); ReadAxisStatus();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!