diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2020-02-18 16:26:46 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2020-02-18 16:26:46 +0200 |
| commit | 00b7de2653058bd9657217075eae834f6a1a4ec5 (patch) | |
| tree | 91fdcc6cb1ac25e17967cb0c74cc842b405026bc /Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs | |
| parent | b7f4088f257c3c9c816f680c97a652f6f73de940 (diff) | |
| download | Tango-00b7de2653058bd9657217075eae834f6a1a4ec5.tar.gz Tango-00b7de2653058bd9657217075eae834f6a1a4ec5.zip | |
Implemented PPC thread loading from preparation..
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs index 5e5370416..5c4d003a1 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs @@ -40,6 +40,13 @@ namespace Tango.PPC.UI.Dialogs set { _isFinalizing = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } } + private bool _isPreparing; + public bool IsPreparing + { + get { return _isPreparing; } + set { _isPreparing = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + public List<Rml> Rmls { get; set; } private Rml _selectedRml; @@ -51,15 +58,28 @@ namespace Tango.PPC.UI.Dialogs public RelayCommand ContinueCommand { get; set; } - public ThreadLoadingViewVM(IMachineProvider machineProvider, ThreadLoadingConfirmationRequiredEventArgs confirmationArgs) + public ThreadLoadingViewVM(IMachineProvider machineProvider) { CanClose = true; - _confirmationArgs = confirmationArgs; + IsPreparing = true; ContinueCommand = new RelayCommand(ContinueThreadLoading, () => !IsFinalizing && SelectedRml != null); MachineProvider = machineProvider; MachineProvider.MachineOperator.ThreadLoadingStatusChanged += MachineOperator_ThreadLoadingStatusChanged; MachineProvider.MachineOperator.ThreadLoadingCompleted += MachineOperator_ThreadLoadingCompleted; MachineProvider.MachineOperator.ThreadLoadingFailed += MachineOperator_ThreadLoadingFailed; + MachineProvider.MachineOperator.ThreadLoadingConfirmationRequired += MachineOperator_ThreadLoadingConfirmationRequired; + } + + public ThreadLoadingViewVM(IMachineProvider machineProvider, ThreadLoadingConfirmationRequiredEventArgs confirmationArgs) : this(machineProvider) + { + _confirmationArgs = confirmationArgs; + IsPreparing = false; + } + + private void MachineOperator_ThreadLoadingConfirmationRequired(object sender, ThreadLoadingConfirmationRequiredEventArgs e) + { + _confirmationArgs = e; + IsPreparing = false; } private async void ContinueThreadLoading() @@ -125,7 +145,7 @@ namespace Tango.PPC.UI.Dialogs { Status = e; - if(Status.State == ThreadLoadingState.Finalizing) + if (Status.State == ThreadLoadingState.Finalizing) { IsFinalizing = true; } @@ -150,6 +170,7 @@ namespace Tango.PPC.UI.Dialogs MachineProvider.MachineOperator.ThreadLoadingStatusChanged -= MachineOperator_ThreadLoadingStatusChanged; MachineProvider.MachineOperator.ThreadLoadingCompleted -= MachineOperator_ThreadLoadingCompleted; MachineProvider.MachineOperator.ThreadLoadingFailed -= MachineOperator_ThreadLoadingFailed; + MachineProvider.MachineOperator.ThreadLoadingConfirmationRequired -= MachineOperator_ThreadLoadingConfirmationRequired; } } } |
