| | |
| | | // } |
| | | //} |
| | | |
| | | if (IsSafetyBeamTrigged || IsSafetyDoorTrigged) |
| | | if (!IsAllowedWork) |
| | | { |
| | | LogAsync(DateTime.Now, $"{(IsSafetyDoorTrigged ? "安全门" : "")}{(IsSafetyBeamTrigged ? " 安全光线" : "")}触发中,复位失败", ""); |
| | | LogAsync(DateTime.Now, $"{(IsSafetyDoorTrigged ? "安全门" : "")}{(IsSafetyBeamTrigged ? " 安全光线" : "")}{(isEmergencyStopped ? " 急停按钮" : "")}触发中,复位失败", ""); |
| | | return new ProcessResponse(false); |
| | | } |
| | | |
| | |
| | | |
| | | RaisedAlarm(""); |
| | | MachineState = MachineState.Ready; |
| | | |
| | | if (IsEmergencyStopped) |
| | | { |
| | | RaisedAlarm("急停按钮未恢复,请执行大复位"); |
| | | MachineState = MachineState.Alarm; |
| | | } |
| | | |
| | | if (ResetTimer == null) |
| | | { |
| | |
| | | //{ |
| | | // motionCard.Run(opConfig); |
| | | //} |
| | | |
| | | MachineState = MachineState.Resetting; |
| | | MotionCardDefaultRun("FullReset", ref opConfig, ref invokeDevice); |
| | | |
| | |
| | | |
| | | OnFullResetDone?.Invoke(); |
| | | |
| | | isFullResetCovered = true; |
| | | |
| | | LogAsync(DateTime.Now, "大复位动作完成", ""); |
| | | |
| | | RaisedAlarm(""); |
| | | MachineState = MachineState.Ready; |
| | | |
| | | return new ProcessResponse(true); |
| | |
| | | } |
| | | } |
| | | |
| | | bool IsAllowedWork |
| | | { |
| | | get => !(IsSafetyBeamTrigged || IsSafetyDoorTrigged || IsEmergencyStopped); |
| | | } |
| | | |
| | | #region 安全门 & 安全光线 |
| | | bool isSafetyDoorTrigged = false; |
| | | bool isSafetyBeamTrigged = false; |
| | |
| | | return new ProcessResponse(true); |
| | | } |
| | | #endregion |
| | | |
| | | #region 急停 |
| | | bool isEmergencyStopped = false; |
| | | bool isFullResetCovered = true; |
| | | public bool IsEmergencyStopped |
| | | { |
| | | get => isEmergencyStopped && isFullResetCovered; |
| | | set |
| | | { |
| | | if (value) |
| | | { |
| | | isFullResetCovered = false; |
| | | isEmergencyStopped = true; |
| | | } |
| | | else |
| | | { |
| | | isEmergencyStopped = false; |
| | | } |
| | | } |
| | | } |
| | | |
| | | [ProcessMethod("", "EmergencyStop", "急停按钮被拍下", InvokeType.TestInvoke)] |
| | | public ProcessResponse EmergencyStop(IOperationConfig opConfig, IDevice invokeDevice, IDevice sourceDevice) |
| | | { |
| | | if (opConfig.InputPara == null || opConfig.InputPara.Count == 0) |
| | | throw new ProcessException("急停按钮未配置输入信号"); |
| | | |
| | | IsEmergencyStopped = opConfig.InputPara[0] == 1; |
| | | |
| | | if (IsEmergencyStopped) |
| | | { |
| | | RaisedAlarm("急停按钮被拍下"); |
| | | MachineState = MachineState.Alarm; |
| | | } |
| | | |
| | | return new ProcessResponse(true); |
| | | } |
| | | #endregion |
| | | } |
| | | } |