| | |
| | | public partial class M071Process |
| | | { |
| | | public Timer ResetTimer = null; |
| | | const int FULLRESETTIME = 5; |
| | | |
| | | object machineStateLock = new object(); |
| | | //MachineState _machineStatePre = MachineState.Unknown; |
| | |
| | | if (machineState == value) |
| | | return; |
| | | |
| | | LogAsync(DateTime.Now, $"设备状态切换:{machineState.ToString()}->{value.ToString()}", ""); |
| | | machineState = value; |
| | | |
| | | Task.Run(() => |
| | |
| | | if (opConfig?.InputPara != null && opConfig.InputPara.Count > 0) |
| | | { |
| | | //大复位信号 |
| | | ResetTimer.Change(opConfig.InputPara[0] == 1 ? FULLRESETTIME * 1000 : -1, -1); |
| | | ResetTimer.Change(opConfig.InputPara[0] == 1 ? Config.FullResetRequiredDuration * 1000 : -1, -1); |
| | | |
| | | if (opConfig.InputPara[0] == 0) |
| | | return new ProcessResponse(true); |
| | |
| | | |
| | | RaisedAlarm(""); |
| | | |
| | | if (MachineState != MachineState.Pause) |
| | | { |
| | | MachineState = MachineState.Ready; |
| | | } |
| | | else |
| | | { |
| | | LogAsync(DateTime.Now, "设备暂停中,无法复位", ""); |
| | | return new ProcessResponse(true); |
| | | } |
| | | //if (MachineState != MachineState.Pause) |
| | | //{ |
| | | MachineState = MachineState.Ready; |
| | | //} |
| | | //else |
| | | //{ |
| | | // LogAsync(DateTime.Now, "设备暂停中,无法复位", ""); |
| | | // return new ProcessResponse(true); |
| | | //} |
| | | |
| | | if (IsEmergencyStopped) |
| | | { |
| | |
| | | MachineState = MachineState.Resetting; |
| | | MotionCardDefaultRun("FullReset", ref opConfig, ref invokeDevice); |
| | | |
| | | productionList.ForEach(u => u.Dispose()); |
| | | productionList.Clear(); |
| | | lock (productionLock) |
| | | { |
| | | productionList.ForEach(u => u.Dispose()); |
| | | productionList.Clear(); |
| | | } |
| | | |
| | | OnFullResetDone?.Invoke(); |
| | | |