private void Machine_StatusUpdated(LaserMachine sender, LaserMachine.MachineState state, bool invalidateCanDo) { ViewService.InvokeAsync(() => { MachinePosition = new Point(state.X, state.Y); }); }
private void updateStatus(LaserMachine.MachineState state) { PositionX = toDisplayString(state.X); PositionY = toDisplayString(state.Y); Status = state.Status; Alarm = "None"; Message = "None"; if (state.LineCount != 0) { ProgramStatus = state.LineAt + "/" + state.LineCount; ProgramProgress = (double)state.LineAt / (double)state.LineCount; } }
private void Machine_StatusUpdated(LaserMachine sender, LaserMachine.MachineState state, bool invalidateCanDo) { ViewService.InvokeAsync(() => { updateStatus(state); if (invalidateCanDo) { _resetCommand.NotifyCanExecuteChanged(); _homeCommand.NotifyCanExecuteChanged(); _unlockCommand.NotifyCanExecuteChanged(); _startCommand.NotifyCanExecuteChanged(); _pauseCommand.NotifyCanExecuteChanged(); _resumeCommand.NotifyCanExecuteChanged(); _stopCommand.NotifyCanExecuteChanged(); } }); }