Commit f38a5be1 刘韬

1

1 个父辈 9d5f1ef3
...@@ -341,7 +341,7 @@ namespace DeviceLibrary ...@@ -341,7 +341,7 @@ namespace DeviceLibrary
#region 匀速上升处理 #region 匀速上升处理
private System.Timers.Timer axisCheckTimer = null; private System.Timers.Timer axisCheckTimer = null;
internal string[] TargetIoType = new string[] { }; internal string[] TargetIoType = new string[] { };
internal IO_VALUE TargetIoValue = IO_VALUE.HIGH; internal volatile IO_VALUE TargetIoValue = IO_VALUE.HIGH;
public bool BatchAxisStartCheck(string[] targetIo, IO_VALUE value = IO_VALUE.HIGH) public bool BatchAxisStartCheck(string[] targetIo, IO_VALUE value = IO_VALUE.HIGH)
{ {
if (axisCheckTimer == null) if (axisCheckTimer == null)
...@@ -365,6 +365,7 @@ namespace DeviceLibrary ...@@ -365,6 +365,7 @@ namespace DeviceLibrary
{ {
axisCheckTimer.Stop(); axisCheckTimer.Stop();
} }
TargetIoValue = IO_VALUE.None;
return true; return true;
} }
private bool IsInProcess = false; private bool IsInProcess = false;
...@@ -379,8 +380,8 @@ namespace DeviceLibrary ...@@ -379,8 +380,8 @@ namespace DeviceLibrary
if (IOManager.IOValue(io).Equals(TargetIoValue)) if (IOManager.IOValue(io).Equals(TargetIoValue))
{ {
SuddenStop(); SuddenStop();
StopAxisCheckMove();
LogUtil.info(AxisName + "上料轴,检测到 " + io + "=" + TargetIoValue + ",停止运动"); LogUtil.info(AxisName + "上料轴,检测到 " + io + "=" + TargetIoValue + ",停止运动");
StopAxisCheckMove();
break; break;
} }
} }
......
...@@ -61,6 +61,7 @@ namespace DeviceLibrary ...@@ -61,6 +61,7 @@ namespace DeviceLibrary
print.LoadLabel(labelname); print.LoadLabel(labelname);
var bmp = print.PrintPreview(data); var bmp = print.PrintPreview(data);
//print.Print(data);
if (!zebraManger.PrintImage(bmp, out msg)) if (!zebraManger.PrintImage(bmp, out msg))
{ {
LogUtil.error(msg); LogUtil.error(msg);
......
...@@ -122,11 +122,19 @@ namespace DeviceLibrary ...@@ -122,11 +122,19 @@ namespace DeviceLibrary
else if (wait.WaitType.Equals(WaitEnum.W008_BatchAxis)) else if (wait.WaitType.Equals(WaitEnum.W008_BatchAxis))
{ {
AxisBean axisBean = AxisBean.List.Find(a => a.Config.GetAxisValue() == wait.AxisInfo.GetAxisValue()); AxisBean axisBean = AxisBean.List.Find(a => a.Config.GetAxisValue() == wait.AxisInfo.GetAxisValue());
if (axisBean.TargetIoValue == IO_VALUE.None)
{
wait.IsEnd = true;
axisBean.SuddenStop();
LogUtil.info(Name + "axisCheckTimer 已经结束,停止运行");
}
else
{
//等待信号亮或者走到绝对位置才停止 //等待信号亮或者走到绝对位置才停止
var tio = axisBean.TargetIoType.Where(io => { return IOValue(io).Equals(axisBean.TargetIoValue); }); var tio = axisBean.TargetIoType.Where(io => { return IOValue(io).Equals(axisBean.TargetIoValue); });
if (tio.Count()>0) if (tio.Count() > 0)
{ {
LogUtil.info(Name + "CheckWaitResult 检测到" + string.Join(",",tio.ToArray()) + "=" + axisBean.TargetIoValue + ",停止运行"); LogUtil.info(Name + "CheckWaitResult 检测到" + string.Join(",", tio.ToArray()) + "=" + axisBean.TargetIoValue + ",停止运行");
axisBean.StopAxisCheckMove(); axisBean.StopAxisCheckMove();
if (AxisManager.GetBusyStatus(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()).Equals(1)) if (AxisManager.GetBusyStatus(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()).Equals(1))
{ {
...@@ -137,7 +145,7 @@ namespace DeviceLibrary ...@@ -137,7 +145,7 @@ namespace DeviceLibrary
else else
{ {
bool isbusy = AxisManager.GetBusyStatus(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()).Equals(1); bool isbusy = AxisManager.GetBusyStatus(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()).Equals(1);
if (!isbusy) if (!isbusy && axisBean.TargetIoValue != IO_VALUE.None)
{ {
int outCount = AxisManager.GetActualtPosition(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()); int outCount = AxisManager.GetActualtPosition(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue());
LogUtil.info($"{wait.AxisInfo.Explain},当前位置:{outCount}"); LogUtil.info($"{wait.AxisInfo.Explain},当前位置:{outCount}");
...@@ -157,6 +165,7 @@ namespace DeviceLibrary ...@@ -157,6 +165,7 @@ namespace DeviceLibrary
} }
} }
} }
}
if (wait.IsEnd) if (wait.IsEnd)
{ {
......
...@@ -358,7 +358,7 @@ namespace DeviceLibrary ...@@ -358,7 +358,7 @@ namespace DeviceLibrary
ResetMoveInfo.log("小车批量轴, 贴标z轴回原"); ResetMoveInfo.log("小车批量轴, 贴标z轴回原");
Loading_Batch_Axis.HomeMove(null, forceHome); Loading_Batch_Axis.HomeMove(null, forceHome);
Unloading_Batch_Axis.HomeMove(null, forceHome); Unloading_Batch_Axis.HomeMove(null, forceHome);
Label_Z_Axis.HomeMove(ResetMoveInfo, forceHome); Label_Z_Axis.HomeMove(null, forceHome);
GrabImageEX(); GrabImageEX();
break; break;
case MoveStep.H02_HomeReset_02: case MoveStep.H02_HomeReset_02:
...@@ -366,6 +366,7 @@ namespace DeviceLibrary ...@@ -366,6 +366,7 @@ namespace DeviceLibrary
ResetMoveInfo.log("2侧升降轴回原"); ResetMoveInfo.log("2侧升降轴回原");
Loading_UpDown_Axis.HomeMove(ResetMoveInfo, forceHome); Loading_UpDown_Axis.HomeMove(ResetMoveInfo, forceHome);
Unloading_UpDown_Axis.HomeMove(ResetMoveInfo, forceHome); Unloading_UpDown_Axis.HomeMove(ResetMoveInfo, forceHome);
Label_Z_Axis.HomeMove(ResetMoveInfo, forceHome);
break; break;
case MoveStep.H02_HomeReset: case MoveStep.H02_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H02_HomeReset_1); ResetMoveInfo.NextMoveStep(MoveStep.H02_HomeReset_1);
...@@ -387,13 +388,15 @@ namespace DeviceLibrary ...@@ -387,13 +388,15 @@ namespace DeviceLibrary
case MoveStep.H03_HomeReset: case MoveStep.H03_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H04_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H04_HomeReset);
ResetMoveInfo.log("2侧旋转轴回原"); ResetMoveInfo.log("2侧旋转轴回原");
Loading_Middle_Axis.HomeMove(ResetMoveInfo, forceHome); Loading_Middle_Axis.HomeMove(null, forceHome);
Unloading_Middle_Axis.HomeMove(ResetMoveInfo, forceHome); Unloading_Middle_Axis.HomeMove(null, forceHome);
break; break;
case MoveStep.H04_HomeReset: case MoveStep.H04_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H05_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H05_HomeReset);
Loading_Batch_Axis.HomeMove(ResetMoveInfo, forceHome); Loading_Batch_Axis.HomeMove(ResetMoveInfo, forceHome);
Unloading_Batch_Axis.HomeMove(ResetMoveInfo, forceHome); Unloading_Batch_Axis.HomeMove(ResetMoveInfo, forceHome);
Loading_Middle_Axis.HomeMove(ResetMoveInfo, forceHome);
Unloading_Middle_Axis.HomeMove(ResetMoveInfo, forceHome);
break; break;
case MoveStep.H05_HomeReset: case MoveStep.H05_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H06_HomeReset); ResetMoveInfo.NextMoveStep(MoveStep.H06_HomeReset);
......
...@@ -271,13 +271,13 @@ namespace DeviceLibrary ...@@ -271,13 +271,13 @@ namespace DeviceLibrary
CountMoveInfo.log("料盘已取走"); CountMoveInfo.log("料盘已取走");
break; break;
case MoveStep.Count_20: case MoveStep.Count_20:
if (IOValue(IO_Type.Counting_ExitDoor_Close).Equals(IO_VALUE.HIGH) || OutMoveInfo.MoveStep>= MoveStep.Out_03) if (OutMoveInfo.MoveStep>= MoveStep.Out_09)
{ {
CountMoveInfo.NextMoveStep(MoveStep.Count_21); CountMoveInfo.NextMoveStep(MoveStep.Count_21);
CountMoveInfo.log("出口门已关闭"); CountMoveInfo.log("料盘已取走");
} }
else if (CountMoveInfo.IsTimeOut(60)) { else if (CountMoveInfo.IsTimeOut(60)) {
CountMoveInfo.log("等待出口门关闭"); CountMoveInfo.log("等待料盘取走超时");
} }
break; break;
case MoveStep.Count_21: case MoveStep.Count_21:
......
...@@ -130,7 +130,7 @@ namespace DeviceLibrary ...@@ -130,7 +130,7 @@ namespace DeviceLibrary
InMoveInfo.log($"旋转轴到达p1点,升降轴到放料P2"); InMoveInfo.log($"旋转轴到达p1点,升降轴到放料P2");
break; break;
case MoveStep.In_11: case MoveStep.In_11:
if (CountMoveInfo.MoveStep == MoveStep.Wait) if (CountMoveInfo.MoveStep == MoveStep.Wait || IOValue(IO_Type.Counting_EnterDoor_Open).Equals(IO_VALUE.HIGH))
{ {
InMoveInfo.NextMoveStep(MoveStep.In_12); InMoveInfo.NextMoveStep(MoveStep.In_12);
InMoveInfo.log($"点料机已空闲"); InMoveInfo.log($"点料机已空闲");
...@@ -151,9 +151,16 @@ namespace DeviceLibrary ...@@ -151,9 +151,16 @@ namespace DeviceLibrary
InMoveInfo.log($"旋转轴,升降轴到达放料p2点"); InMoveInfo.log($"旋转轴,升降轴到达放料p2点");
break; break;
case MoveStep.In_14: case MoveStep.In_14:
if (CountMoveInfo.MoveStep == MoveStep.Wait)
{
InMoveInfo.NextMoveStep(MoveStep.In_15); InMoveInfo.NextMoveStep(MoveStep.In_15);
Loading_InOut_Axis.AbsMove(InMoveInfo, InToPos.InOut_P2, Config.Loading_InOut_Axis_P1_speed); Loading_InOut_Axis.AbsMove(InMoveInfo, InToPos.InOut_P2, Config.Loading_InOut_Axis_P1_speed);
InMoveInfo.log($"进出轴达放料p2点"); InMoveInfo.log($"进出轴达放料p2点");
}
else
{
Msg.add("等待点料机空闲", MsgLevel.info);
}
break; break;
case MoveStep.In_15: case MoveStep.In_15:
if (IOValue(IO_Type.Counting_Reel_Check).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.Counting_Reel_Check).Equals(IO_VALUE.LOW))
...@@ -174,7 +181,7 @@ namespace DeviceLibrary ...@@ -174,7 +181,7 @@ namespace DeviceLibrary
case MoveStep.In_16: case MoveStep.In_16:
InMoveInfo.NextMoveStep(MoveStep.In_17); InMoveInfo.NextMoveStep(MoveStep.In_17);
IOMove(IO_Type.Loading_ReelVacuum_On, IO_VALUE.LOW); IOMove(IO_Type.Loading_ReelVacuum_On, IO_VALUE.LOW);
InMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500)); InMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
InMoveInfo.log($"关闭吸盘"); InMoveInfo.log($"关闭吸盘");
break; break;
case MoveStep.In_17: case MoveStep.In_17:
......
...@@ -64,10 +64,19 @@ namespace DeviceLibrary ...@@ -64,10 +64,19 @@ namespace DeviceLibrary
else else
OutCarType = CarTypeE.Car13; OutCarType = CarTypeE.Car13;
OutCarMoveInfo.log($"检测到料车尺寸:{InCarType}");
if (InCarType != CarTypeE.None && InCarType != OutCarType)
{
OutCarMoveInfo.NextMoveStep(MoveStep.OutCarOut_01);
OutCarMoveInfo.log("检测到出料车与入料车尺寸不符");
}
else
{
OutCarMoveInfo.log($"检测到料车尺寸:{OutCarType}");
OutCarMoveInfo.NextMoveStep(MoveStep.OutCar_03); OutCarMoveInfo.NextMoveStep(MoveStep.OutCar_03);
Unloading_NOCar_Led.LedState = LedState.on; Unloading_NOCar_Led.LedState = LedState.on;
} }
}
else { else {
OutCarMoveInfo.log($"小车丢失,重新检测"); OutCarMoveInfo.log($"小车丢失,重新检测");
CylinderMove(OutCarMoveInfo, IO_Type.Unloading_Car_Location_Down, IO_Type.Unloading_Car_Location_Up, IO_VALUE.LOW); CylinderMove(OutCarMoveInfo, IO_Type.Unloading_Car_Location_Down, IO_Type.Unloading_Car_Location_Up, IO_VALUE.LOW);
...@@ -86,7 +95,7 @@ namespace DeviceLibrary ...@@ -86,7 +95,7 @@ namespace DeviceLibrary
if (lowlist.Length > 0) if (lowlist.Length > 0)
{ {
OutCarMoveInfo.log($"批量轴高速上升到顶部检测点"); OutCarMoveInfo.log($"批量轴高速上升到顶部检测点");
BatchAxisToP2(OutCarMoveInfo, Unloading_Batch_Axis, OutGetLowReelCheckIOList(), IO_VALUE.HIGH, Config.Unloading_Batch_Axis_P2, Config.Unloading_Batch_Axis_P1_speed); BatchAxisToP2(OutCarMoveInfo, Unloading_Batch_Axis, lowlist, IO_VALUE.HIGH, Config.Unloading_Batch_Axis_P2, Config.Unloading_Batch_Axis_P1_speed);
} }
else { else {
OutCarMoveInfo.log($"批量轴所有监测点都已Low"); OutCarMoveInfo.log($"批量轴所有监测点都已Low");
......
...@@ -51,9 +51,13 @@ namespace DeviceLibrary ...@@ -51,9 +51,13 @@ namespace DeviceLibrary
} }
break; break;
case MoveStep.Out_01: case MoveStep.Out_01:
OutMoveInfo.NextMoveStep(MoveStep.Out_02); OutMoveInfo.NextMoveStep(MoveStep.Out_03);
Unloading_InOut_Axis.AbsMove(OutMoveInfo, Config.Unloading_InOut_Axis_P1, Config.Unloading_InOut_Axis_P1_speed); Unloading_InOut_Axis.AbsMove(OutMoveInfo, Config.Unloading_InOut_Axis_P1, Config.Unloading_InOut_Axis_P1_speed);
OutMoveInfo.log($"进出轴回到p1"); OutMoveInfo.log($"进出轴回到p1");
CylinderMove(OutMoveInfo, IO_Type.Counting_ExitDoor_Close, IO_Type.Counting_ExitDoor_Open, IO_VALUE.HIGH);
if (InMoveInfo.MoveStep>=MoveStep.In_10 && InMoveInfo.MoveStep <= MoveStep.In_13)
CylinderMove(null, IO_Type.Counting_EnterDoor_Close, IO_Type.Counting_EnterDoor_Open, IO_VALUE.HIGH);
OutMoveInfo.log($"打开点料机出口大门");
break; break;
case MoveStep.Out_02: case MoveStep.Out_02:
OutMoveInfo.NextMoveStep(MoveStep.Out_03); OutMoveInfo.NextMoveStep(MoveStep.Out_03);
...@@ -120,6 +124,8 @@ namespace DeviceLibrary ...@@ -120,6 +124,8 @@ namespace DeviceLibrary
break; break;
case MoveStep.Out_09: case MoveStep.Out_09:
OutMoveInfo.NextMoveStep(MoveStep.Out_10); OutMoveInfo.NextMoveStep(MoveStep.Out_10);
if (CountMoveInfo.MoveStep == MoveStep.Count_ReadyOut)
CountMoveInfo.NextMoveStep(MoveStep.Count_Outted);
Unloading_Middle_Axis.AbsMove(OutMoveInfo, Config.Unloading_Middle_Axis_P1, Config.Unloading_Middle_Axis_P1_speed); Unloading_Middle_Axis.AbsMove(OutMoveInfo, Config.Unloading_Middle_Axis_P1, Config.Unloading_Middle_Axis_P1_speed);
Unloading_UpDown_Axis.AbsMove(OutMoveInfo, Config.Unloading_UpDown_Axis_P1, Config.Unloading_UpDown_Axis_P1_speed); Unloading_UpDown_Axis.AbsMove(OutMoveInfo, Config.Unloading_UpDown_Axis_P1, Config.Unloading_UpDown_Axis_P1_speed);
OutMoveInfo.log($"旋转轴, 升降轴到p1"); OutMoveInfo.log($"旋转轴, 升降轴到p1");
...@@ -131,8 +137,7 @@ namespace DeviceLibrary ...@@ -131,8 +137,7 @@ namespace DeviceLibrary
if (OutMoveInfo.MoveParam.IsNg) if (OutMoveInfo.MoveParam.IsNg)
OutMoveInfo.NextMoveStep(MoveStep.Out_20); OutMoveInfo.NextMoveStep(MoveStep.Out_20);
if (CountMoveInfo.MoveStep == MoveStep.Count_ReadyOut)
CountMoveInfo.NextMoveStep(MoveStep.Count_Outted);
break; break;
case MoveStep.Out_11: case MoveStep.Out_11:
if (string.IsNullOrEmpty(OutMoveInfo.MoveParam.ReeID)) { if (string.IsNullOrEmpty(OutMoveInfo.MoveParam.ReeID)) {
...@@ -197,7 +202,7 @@ namespace DeviceLibrary ...@@ -197,7 +202,7 @@ namespace DeviceLibrary
} }
} }
else if (OutCarMoveInfo.MoveStep == MoveStep.OutCarReadyPut) else if (OutCarMoveInfo.MoveStep == MoveStep.OutCarReadyPut && (InCarType == OutCarType || InCarType== CarTypeE.None))
{ {
OutMoveInfo.MoveParam.CurrentStringNum = OutCurrentStringNum; OutMoveInfo.MoveParam.CurrentStringNum = OutCurrentStringNum;
var topos = "Unloading_T" + OutCurrentStringNum; var topos = "Unloading_T" + OutCurrentStringNum;
...@@ -207,7 +212,12 @@ namespace DeviceLibrary ...@@ -207,7 +212,12 @@ namespace DeviceLibrary
Unloading_UpDown_Axis.AbsMove(OutMoveInfo, OutToPos.UpDown_P2, Config.Unloading_UpDown_Axis_P1_speed); Unloading_UpDown_Axis.AbsMove(OutMoveInfo, OutToPos.UpDown_P2, Config.Unloading_UpDown_Axis_P1_speed);
OutMoveInfo.log($"旋转轴,升降轴到达p2点"); OutMoveInfo.log($"旋转轴,升降轴到达p2点");
} }
else { else if (InCarType != OutCarType) {
Msg.add("出料车尺寸与入料车不符", MsgLevel.alarm);
LogUtil.info("出料车尺寸与入料车不符");
}
else
{
Msg.add("等待出口料车可以放料", MsgLevel.info); Msg.add("等待出口料车可以放料", MsgLevel.info);
LogUtil.info("等待出口料车可以放料"); LogUtil.info("等待出口料车可以放料");
} }
...@@ -277,8 +287,10 @@ namespace DeviceLibrary ...@@ -277,8 +287,10 @@ namespace DeviceLibrary
break; break;
case MoveStep.Out_30: case MoveStep.Out_30:
OutMoveInfo.NextMoveStep(MoveStep.Out_31); OutMoveInfo.NextMoveStep(MoveStep.Out_31);
BatchAxisToP2(OutMoveInfo, Unloading_Batch_Axis, OutGetReelCheckIOList(OutCurrentStringNum), IO_VALUE.HIGH, Config.Unloading_Batch_Axis_P2, Config.Unloading_Batch_Axis_P2_speed); var target = Unloading_Batch_Axis.GetAclPosition();
OutMoveInfo.log($"批量轴慢速上升到检测点亮"); target = target + (OutMoveInfo.MoveParam.PlateH +20) * 1000;
BatchAxisToP2(OutMoveInfo, Unloading_Batch_Axis, OutGetReelCheckIOList(OutCurrentStringNum), IO_VALUE.HIGH, target, Config.Unloading_Batch_Axis_P2_speed);
OutMoveInfo.log($"批量轴慢速上升到检测点亮,当前位置:{Unloading_Batch_Axis.GetAclPosition()},控制上升:{OutMoveInfo.MoveParam.PlateH},{target}");
break; break;
case MoveStep.Out_31: case MoveStep.Out_31:
OutMoveInfo.NextMoveStep(MoveStep.Out_WaitForLabel); OutMoveInfo.NextMoveStep(MoveStep.Out_WaitForLabel);
......
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16 # Visual Studio Version 17
VisualStudioVersion = 16.0.30907.101 VisualStudioVersion = 17.9.34701.34
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoadCSVLibrary", "LoadCVSLibrary\LoadCSVLibrary.csproj", "{064BEBF5-8FAA-4EA2-A5F3-A06E6E7D9251}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoadCSVLibrary", "LoadCVSLibrary\LoadCSVLibrary.csproj", "{064BEBF5-8FAA-4EA2-A5F3-A06E6E7D9251}"
EndProject EndProject
......
...@@ -344,6 +344,14 @@ namespace TheMachine ...@@ -344,6 +344,14 @@ namespace TheMachine
lm.Add(m); lm.Add(m);
} }
SetMsg(lm); SetMsg(lm);
foreach (var cn in pnl.Controls)
{
if (cn is CylinderButton)
{
(cn as CylinderButton).DataUpdate();
}
}
} }
private void MainMachine_ButtenEvent(object sender, ErrInfo e) private void MainMachine_ButtenEvent(object sender, ErrInfo e)
......
...@@ -84,7 +84,7 @@ namespace TheMachine ...@@ -84,7 +84,7 @@ namespace TheMachine
Environment.CurrentDirectory = Application.StartupPath; Environment.CurrentDirectory = Application.StartupPath;
XmlConfigurator.Configure(); XmlConfigurator.Configure();
var pn = ServerCommunication.GetPnByReelid("123");
//var pn= ServerCommunication.GetPnByReelid("S202306181351530002"); //var pn= ServerCommunication.GetPnByReelid("S202306181351530002");
//LogUtil.info(pn); //LogUtil.info(pn);
//return; //return;
......
...@@ -82,7 +82,9 @@ namespace TheMachine ...@@ -82,7 +82,9 @@ namespace TheMachine
} }
} }
void DataUpdate() { [Category("数据"), Description("需要确认"), Browsable(true)]
public bool Confirm{get;set;}=false;
public void DataUpdate() {
if (string.IsNullOrEmpty(io_high) || !DeviceConfig.AllDOlist.ContainsKey(io_high)) if (string.IsNullOrEmpty(io_high) || !DeviceConfig.AllDOlist.ContainsKey(io_high))
this.Text = $"IO {io_high} Not Find"; this.Text = $"IO {io_high} Not Find";
else else
...@@ -111,6 +113,9 @@ namespace TheMachine ...@@ -111,6 +113,9 @@ namespace TheMachine
} }
void StateUpdate() void StateUpdate()
{ {
if (configio_high == null)
return;
io_state = IOManager.GetDOValue(configio_high.DeviceName, configio_high.SlaveID, configio_high.GetIOAddr()); io_state = IOManager.GetDOValue(configio_high.DeviceName, configio_high.SlaveID, configio_high.GetIOAddr());
if (configio_low != null) if (configio_low != null)
{ {
...@@ -142,6 +147,18 @@ namespace TheMachine ...@@ -142,6 +147,18 @@ namespace TheMachine
} }
private void CylinderButton_Click(object sender, EventArgs e) private void CylinderButton_Click(object sender, EventArgs e)
{ {
if (Confirm) {
if (RobotManage.isRunning) {
MessageBox.Show($"设备正在运行,不能操作IO");
return;
}
var r = MessageBox.Show($"您正在点击:{Text}", "请注意", MessageBoxButtons.OKCancel);
if (r != DialogResult.OK) {
return;
}
}
if (io_state.Equals(IO_VALUE.LOW)) if (io_state.Equals(IO_VALUE.LOW))
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!