Commit 2fefbbdf LN

1

2 个父辈 542bbf90 da5c0d70
using ConfigHelper; using ConfigHelper;
using OnlineStore.Common; using OnlineStore.Common;
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ChangeConfigKey namespace ChangeConfigKey
{ {
......
...@@ -65,6 +65,12 @@ namespace DeviceLibrary ...@@ -65,6 +65,12 @@ namespace DeviceLibrary
public void DefaultLedCfg() public void DefaultLedCfg()
{ {
MachineLedState.Clear(); MachineLedState.Clear();
//安全光栅触发报警,红亮
MachineLedStateName[MachineLedStateE.SafetyLightCurtains] = crc.GetString("ledstate_SafetyLightCurtains", "安全光栅触发");
MachineLedState.Add(MachineLedStateE.SafetyLightCurtains, nls(LedState.on, LedState.off, LedState.off));
//系统停止,红亮
MachineLedStateName[MachineLedStateE.Stop] = crc.GetString("ledstate_Stop", "停机");
MachineLedState.Add(MachineLedStateE.Stop, nls(LedState.on, LedState.off, LedState.off));
//系统报警并停止,红亮 //系统报警并停止,红亮
MachineLedStateName[MachineLedStateE.AlarmStop] = crc.GetString("ledstate_AlarmStop", "停机报警"); MachineLedStateName[MachineLedStateE.AlarmStop] = crc.GetString("ledstate_AlarmStop", "停机报警");
MachineLedState.Add(MachineLedStateE.AlarmStop, nls(LedState.on, LedState.off, LedState.off)); MachineLedState.Add(MachineLedStateE.AlarmStop, nls(LedState.on, LedState.off, LedState.off));
...@@ -77,6 +83,9 @@ namespace DeviceLibrary ...@@ -77,6 +83,9 @@ namespace DeviceLibrary
//系统正常运行 //系统正常运行
MachineLedStateName[MachineLedStateE.Running] = crc.GetString("ledstate_Running", "运行"); MachineLedStateName[MachineLedStateE.Running] = crc.GetString("ledstate_Running", "运行");
MachineLedState.Add(MachineLedStateE.Running, nls(LedState.none, LedState.none, LedState.on)); MachineLedState.Add(MachineLedStateE.Running, nls(LedState.none, LedState.none, LedState.on));
//调试,红亮
MachineLedStateName[MachineLedStateE.Debug] = crc.GetString("ledstate_Debug", "调试");
MachineLedState.Add(MachineLedStateE.Debug, nls(LedState.on, LedState.off, LedState.off));
//系统暂停, 绿闪,红闪 //系统暂停, 绿闪,红闪
MachineLedStateName[MachineLedStateE.SystemPause] = crc.GetString("ledstate_SystemPause", "暂停"); MachineLedStateName[MachineLedStateE.SystemPause] = crc.GetString("ledstate_SystemPause", "暂停");
MachineLedState.Add(MachineLedStateE.SystemPause, nls(LedState.blink, LedState.off, LedState.blink)); MachineLedState.Add(MachineLedStateE.SystemPause, nls(LedState.blink, LedState.off, LedState.blink));
...@@ -123,66 +132,78 @@ namespace DeviceLibrary ...@@ -123,66 +132,78 @@ namespace DeviceLibrary
StandbyLed.LedState = LedState.off; StandbyLed.LedState = LedState.off;
AlarmLed.LedState = LedState.off; AlarmLed.LedState = LedState.off;
RunningLed.LedState = LedState.off; RunningLed.LedState = LedState.off;
//回原 绿闪 if (SafetyLightStop)
if (runStatus == RunStatus.HomeReset)
{ {
ProcessLefCfg(MachineLedStateE.HomeReset); ProcessLefCfg(MachineLedStateE.SafetyLightCurtains);
} }
//正常 绿亮 else
else if (runStatus == RunStatus.Running)
{ {
ProcessLefCfg(MachineLedStateE.Running); //回原 绿闪
if (runStatus == RunStatus.HomeReset)
//出入库 绿闪 黄闪
if (ClampMoveInfo.MoveStep > MoveStep.Wait
|| StoreMoveInfo.MoveStep > MoveStep.Wait
|| (StringMoveInfo.MoveStep > MoveStep.Wait && StringMoveInfo.MoveStep != MoveStep.StringReadyPut && StringMoveInfo.MoveStep <= MoveStep.StringOut_01))
{
ProcessLefCfg(MachineLedStateE.InOut);
}
//温度超限 绿亮 黄闪
if (IsTHoutRange())
{ {
ProcessLefCfg(MachineLedStateE.THoutRange); ProcessLefCfg(MachineLedStateE.HomeReset);
} }
//温度超限30分钟 绿亮 黄闪 红闪 //正常 绿亮
if (IsTHoutRangeOver30m()) else if (runStatus == RunStatus.Running)
{ {
ProcessLefCfg(MachineLedStateE.THoutRangeOver30m); ProcessLefCfg(MachineLedStateE.Running);
//出入库 绿闪 黄闪
if (ClampMoveInfo.MoveStep > MoveStep.Wait
|| StoreMoveInfo.MoveStep > MoveStep.Wait
|| (StringMoveInfo.MoveStep > MoveStep.Wait && StringMoveInfo.MoveStep != MoveStep.StringReadyPut && StringMoveInfo.MoveStep <= MoveStep.StringOut_01))
{
ProcessLefCfg(MachineLedStateE.InOut);
}
//温度超限 绿亮 黄闪
if (IsTHoutRange())
{
ProcessLefCfg(MachineLedStateE.THoutRange);
}
//温度超限30分钟 绿亮 黄闪 红闪
if (IsTHoutRangeOver30m())
{
ProcessLefCfg(MachineLedStateE.THoutRangeOver30m);
}
if (AutoInOutTest)
{
ProcessLefCfg(MachineLedStateE.Debug);
}
//系统暂停,说明书未定义, 绿闪, 红闪
if (!canRunning || UserPause)
{
ProcessLefCfg(MachineLedStateE.SystemPause);
}
} }
//系统暂停,说明书未定义, 绿闪, 红闪 else if (runStatus == RunStatus.Stop)
if (!canRunning || UserPause)
{ {
ProcessLefCfg(MachineLedStateE.SystemPause); //系统停止时有报警, 红亮
if (hasAlarm)
{
ProcessLefCfg(MachineLedStateE.AlarmStop);
}
} }
} //系统运行时报警, 绿亮,红闪
else if (runStatus == RunStatus.Stop) if (runStatus != RunStatus.Stop && hasAlarm)
{
//系统停止时有报警, 红亮
if (hasAlarm)
{ {
ProcessLefCfg(MachineLedStateE.AlarmStop); ProcessLefCfg(MachineLedStateE.Alarm);
}
}
//系统运行时报警, 绿亮,红闪
if (runStatus != RunStatus.Stop && hasAlarm)
{
ProcessLefCfg(MachineLedStateE.Alarm);
//if (UserPause) { //if (UserPause) {
// RunningLed.LedState = LedState.blink; // RunningLed.LedState = LedState.blink;
// StandbyLed.LedState = LedState.blink; // StandbyLed.LedState = LedState.blink;
//} //}
//if (ResetMoveInfo.MoveStep >= MoveStep.H13_HomeReset && ResetMoveInfo.MoveStep <= MoveStep.H14_HomeReset) //if (ResetMoveInfo.MoveStep >= MoveStep.H13_HomeReset && ResetMoveInfo.MoveStep <= MoveStep.H14_HomeReset)
//{ //{
// StandbyLed.LedState = LedState.blink; // StandbyLed.LedState = LedState.blink;
//} //}
//if (ClampMoveInfo.MoveStep >= MoveStep.NGOUT_02 && ClampMoveInfo.MoveStep <= MoveStep.NGOUT_03) //if (ClampMoveInfo.MoveStep >= MoveStep.NGOUT_02 && ClampMoveInfo.MoveStep <= MoveStep.NGOUT_03)
//{ //{
// StandbyLed.LedState = LedState.blink; // StandbyLed.LedState = LedState.blink;
//} //}
}
} }
Led.LedGroup.ForEach((x) => { x.run(); }); Led.LedGroup.ForEach((x) => { x.run(); });
} }
} }
...@@ -245,6 +266,7 @@ namespace DeviceLibrary ...@@ -245,6 +266,7 @@ namespace DeviceLibrary
} }
public enum MachineLedStateE public enum MachineLedStateE
{ {
Stop,
AlarmStop, AlarmStop,
Alarm, Alarm,
HomeReset, HomeReset,
...@@ -253,5 +275,7 @@ namespace DeviceLibrary ...@@ -253,5 +275,7 @@ namespace DeviceLibrary
THoutRangeOver30m, THoutRangeOver30m,
THoutRange, THoutRange,
InOut, InOut,
SafetyLightCurtains,
Debug
} }
} }
...@@ -28,13 +28,16 @@ namespace TheMachine ...@@ -28,13 +28,16 @@ namespace TheMachine
//chbAutoRun.Enabled = false; //chbAutoRun.Enabled = false;
chbAutoRun.Checked = Convert.ToBoolean(Setting_Init.App_AutoRun == 1); chbAutoRun.Checked = Convert.ToBoolean(Setting_Init.App_AutoRun == 1);
this.chbAutoRun.CheckedChanged += new System.EventHandler(this.chbAutoRun_CheckedChanged); this.chbAutoRun.CheckedChanged += new System.EventHandler(this.chbAutoRun_CheckedChanged);
} }
private void RobotManage_LoadFinishEvent(bool state, string msg) private void RobotManage_LoadFinishEvent(bool state, string msg)
{ {
if (RobotManage.Config != null)
{
uC_LedConfig1.Config = RobotManage.Config;
}
if (!state) if (!state)
return; return;
uC_LedConfig1.Config = RobotManage.Config;
if (!RobotManage.haveFixpos) if (!RobotManage.haveFixpos)
cb_usefixpos.Visible = false; cb_usefixpos.Visible = false;
} }
...@@ -126,8 +129,8 @@ namespace TheMachine ...@@ -126,8 +129,8 @@ namespace TheMachine
{ {
Task.Run(() => CodeManager.TestHasReel(CodeManager.hikNameList[0], out _, out _)); Task.Run(() => CodeManager.TestHasReel(CodeManager.hikNameList[0], out _, out _));
} }
//private void button2_Click(object sender, EventArgs e) //private void button2_Click(object sender, EventArgs e)
//{ //{
// DeviceLibrary.IPCameraHelper.StartRecord("manual"); // DeviceLibrary.IPCameraHelper.StartRecord("manual");
......
...@@ -482,4 +482,7 @@ UC_LedConfig_tableLayoutPanel1_THoutRangeOver30m_Text 温湿度超限30分钟 Te ...@@ -482,4 +482,7 @@ UC_LedConfig_tableLayoutPanel1_THoutRangeOver30m_Text 温湿度超限30分钟 Te
UC_LedConfig_tableLayoutPanel1_THoutRange_Text 温湿度超限 Temperature and humidity exceeded limits UC_LedConfig_tableLayoutPanel1_THoutRange_Text 温湿度超限 Temperature and humidity exceeded limits
UC_LedConfig_tableLayoutPanel1_InOut_Text 出入库中 In storage/retrieval process UC_LedConfig_tableLayoutPanel1_InOut_Text 出入库中 In storage/retrieval process
PEnterPwd 请输入密码 Please enter the password PEnterPwd 请输入密码 Please enter the password
ledstate_Debug 调试 Debug
ledstate_SafetyLightCurtains 安全光栅 Safety light curtain
ledstate_AlarmStop 停机 Shut Down
...@@ -482,5 +482,8 @@ UC_LedConfig_tableLayoutPanel1_THoutRangeOver30m_Text 貂ゥ貉ソ蠎ヲ雜剞30蛻帖 貂 ...@@ -482,5 +482,8 @@ UC_LedConfig_tableLayoutPanel1_THoutRangeOver30m_Text 貂ゥ貉ソ蠎ヲ雜剞30蛻帖 貂
UC_LedConfig_tableLayoutPanel1_THoutRange_Text 温湿度超限 温湿度超過 UC_LedConfig_tableLayoutPanel1_THoutRange_Text 温湿度超限 温湿度超過
UC_LedConfig_tableLayoutPanel1_InOut_Text 出入库中 入出庫中 UC_LedConfig_tableLayoutPanel1_InOut_Text 出入库中 入出庫中
PEnterPwd 请输入密码 パスワードを入力してください PEnterPwd 请输入密码 パスワードを入力してください
ledstate_Debug 调试 デバック
ledstate_SafetyLightCurtains 安全光栅 ライトカーテン
ledstate_AlarmStop 停机 ていし
...@@ -482,3 +482,6 @@ UC_LedConfig_tableLayoutPanel1_THoutRangeOver30m_Text 温湿度超限30分钟 ...@@ -482,3 +482,6 @@ UC_LedConfig_tableLayoutPanel1_THoutRangeOver30m_Text 温湿度超限30分钟
UC_LedConfig_tableLayoutPanel1_THoutRange_Text 温湿度超限 UC_LedConfig_tableLayoutPanel1_THoutRange_Text 温湿度超限
UC_LedConfig_tableLayoutPanel1_InOut_Text 出入库中 UC_LedConfig_tableLayoutPanel1_InOut_Text 出入库中
PEnterPwd 请输入密码 PEnterPwd 请输入密码
ledstate_Debug 调试
ledstate_SafetyLightCurtains 安全光栅
ledstate_AlarmStop 停机
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!