| | |
| | | if (machineState == value) |
| | | return; |
| | | |
| | | //_machineStatePre = machineState; |
| | | |
| | | machineState = value; |
| | | |
| | | Task.Run(() => |
| | | { |
| | | switch (machineState) |
| | | { |
| | | case MachineState.Ready: |
| | |
| | | |
| | | Task.Run(() => |
| | | { |
| | | |
| | | while (MachineState == MachineState.Ready) |
| | | { |
| | | lock (machineStateLock) |
| | |
| | | { |
| | | lock (machineStateLock) |
| | | { |
| | | |
| | | SwitchLightYellow(true); |
| | | Thread.Sleep(1000); |
| | | SwitchLightYellow(false); |
| | |
| | | default: |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | OnMachineStateChanged?.Invoke(machineState); |
| | | |
| | | //if (_machineStatePre == MachineState.Running && machineState == MachineState.Pause) |
| | | //{ |
| | | // Pause(); |
| | | //} |
| | | //else if (_machineStatePre == MachineState.Pause && (machineState == MachineState.Running || machineState == MachineState.Ready)) |
| | | //{ |
| | | // Resume(); |
| | | //} |
| | | } |
| | | } |
| | | |