diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-02-16 17:15:16 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-02-16 17:15:16 +0200 |
| commit | f73b3b8043e4f9183a5450afdbb99bcde1b63ff1 (patch) | |
| tree | 97a83df9ae9f248388769b00e63ec495d3bd2123 /Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance | |
| parent | 8a4a7818428d7b203cb28082c720c74831b2165f (diff) | |
| download | Tango-f73b3b8043e4f9183a5450afdbb99bcde1b63ff1.tar.gz Tango-f73b3b8043e4f9183a5450afdbb99bcde1b63ff1.zip | |
Short cycle mode done.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance')
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs | 57 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml | 2 |
2 files changed, 59 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs index 1279a0ba4..ae08f7f19 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs @@ -92,6 +92,13 @@ namespace Tango.PPC.Maintenance.ViewModels set { _wasteStates = value; RaisePropertyChangedAuto(); } } + private bool _isInkAutoFillingDisabled; + public bool IsInkAutoFillingDisabled + { + get { return _isInkAutoFillingDisabled; } + set { _isInkAutoFillingDisabled = value; RaisePropertyChangedAuto(); OnInkAutoFillingChanged(); } + } + public RelayCommand ExportLogsCommand { get; set; } public OpenCloseDyeingHeadCommand OpenCloseDyeingHeadCommand { get; set; } @@ -180,6 +187,8 @@ namespace Tango.PPC.Maintenance.ViewModels UpdateMidTankLevels(status); OverallTemperature.Temperature = status.OverallTemperature; SpoolState = status.SpoolState; + _isInkAutoFillingDisabled = status.AutoInkFillingDisabled; + RaisePropertyChanged(nameof(IsInkAutoFillingDisabled)); InvalidateRelayCommands(); } @@ -320,5 +329,53 @@ namespace Tango.PPC.Maintenance.ViewModels { await NotificationProvider.ShowDialog<CleanerDispensingViewVM>(); } + + private async void OnInkAutoFillingChanged() + { + if (IsInkAutoFillingDisabled) + { + try + { + NotificationProvider.SetGlobalBusyMessage("Disabling auto ink filling..."); + await MachineProvider.MachineOperator.SendRequest<SetInkAutoFillingModeRequest, SetInkAutoFillingModeResponse>(new SetInkAutoFillingModeRequest() + { + Disabled = true + }); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error disabling ink filling."); + _isInkAutoFillingDisabled = false; + RaisePropertyChanged(nameof(IsInkAutoFillingDisabled)); + await NotificationProvider.ShowError($"Error disabling auto ink filling.\n{ex.Message}"); + } + finally + { + NotificationProvider.ReleaseGlobalBusyMessage(); + } + } + else + { + try + { + NotificationProvider.SetGlobalBusyMessage("Enabling auto ink filling..."); + await MachineProvider.MachineOperator.SendRequest<SetInkAutoFillingModeRequest, SetInkAutoFillingModeResponse>(new SetInkAutoFillingModeRequest() + { + Disabled = false + }); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error enabling ink filling."); + _isInkAutoFillingDisabled = true; + RaisePropertyChanged(nameof(IsInkAutoFillingDisabled)); + await NotificationProvider.ShowError($"Error enabling auto ink filling.\n{ex.Message}"); + } + finally + { + NotificationProvider.ReleaseGlobalBusyMessage(); + } + } + } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml index 9d88f59ca..5534b1315 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml @@ -258,6 +258,8 @@ <touch:TouchButton Margin="20" CornerRadius="25" Height="50" FontSize="18" Style="{StaticResource TangoHollowButton}" Command="{Binding DispenseCleanerLiquidCommand}">DISPENSE CLEANING LIQUID</touch:TouchButton> <touch:TouchButton Margin="20" CornerRadius="25" Height="50" FontSize="18" Style="{StaticResource TangoHollowButton}" Command="{Binding ExportLogsCommand}" Visibility="{Binding ApplicationManager.IsInTechnicianMode,Converter={StaticResource BooleanToVisibilityConverter}}">EXPORT SYSTEM LOGS</touch:TouchButton> + + <touch:TouchToggleButton EnableDropShadow="False" Background="Transparent" BorderThickness="2" BorderBrush="{StaticResource TangoPrimaryAccentBrush}" Margin="20" CornerRadius="25" Height="50" FontSize="18" IsChecked="{Binding IsInkAutoFillingDisabled}" IsEnabled="{Binding MachineProvider.IsConnected}" Content="DISABLE AUTO INK FILLING" CheckedContent="ENABLE AUTO INK FILLING" Foreground="{StaticResource TangoPrimaryAccentBrush}"></touch:TouchToggleButton> </UniformGrid> </StackPanel> </StackPanel> |
