From 4c3be889e920102408b0927c5f595ada5a6a544f Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Tue, 21 May 2024 20:31:36 +0300 Subject: Fixed spool count on job from CSV. Added auto power off selection settings. Fixed issue with power off on firmware reset. --- .../Tango.PPC.MachineSettings.csproj | 2 +- .../ViewModels/MainViewVM.cs | 39 ++++++++++++++++++++++ .../Tango.PPC.MachineSettings/Views/MainView.xaml | 33 ++++++++++++++++++ 3 files changed, 73 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Tango.PPC.MachineSettings.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Tango.PPC.MachineSettings.csproj index 30e2bf8c2..d6bacb50c 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Tango.PPC.MachineSettings.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Tango.PPC.MachineSettings.csproj @@ -170,7 +170,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs index 6787136be..594d3f5c9 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs @@ -44,6 +44,16 @@ namespace Tango.PPC.MachineSettings.ViewModels #region Classes + public class PowerDownTime + { + public PowerDownMinutes Minutes { get; set; } + + public String Name + { + get { return Minutes.ToDescription(); } + } + } + public class RmlLubricationLevelSettings : RmlLubricationLevel { public String Name { get; set; } @@ -282,6 +292,15 @@ namespace Tango.PPC.MachineSettings.ViewModels set { _manualFineTuningLength = value; RaisePropertyChangedAuto(); } } + public List PowerDownTimes { get; set; } + + private PowerDownTime _selectedPowerDownTime; + public PowerDownTime SelectedPowerDownTime + { + get { return _selectedPowerDownTime; } + set { _selectedPowerDownTime = value; RaisePropertyChangedAuto(); } + } + #endregion @@ -310,6 +329,14 @@ namespace Tango.PPC.MachineSettings.ViewModels SaveCommand = new RelayCommand(Save); DiscardCommand = new RelayCommand(Discard); SynchronizeCommand = new RelayCommand(Synchronize, () => !MachineDataSynchronizer.IsSynchronizing && IsFree); + + PowerDownTimes = new List() + { + new PowerDownTime() { Minutes = PowerDownMinutes.Minimum }, + new PowerDownTime() { Minutes = PowerDownMinutes.Default }, + new PowerDownTime() { Minutes = PowerDownMinutes.Maximum }, + new PowerDownTime() { Minutes = PowerDownMinutes.Never }, + }; } private void Discard() @@ -342,6 +369,7 @@ namespace Tango.PPC.MachineSettings.ViewModels Settings.LubricationLevels = LubricationLevels.Where(x => x.LubricationLevel != LubricationLevel.Standard).Select(x => x.ToRmlLubricationLevel()).ToList(); Settings.DefaultTabColorSpace = DefaultTabColorSpace; Settings.FineTuningTrialLengthMeters = FineTuningLength; + Settings.PowerSavingMode = SelectedPowerDownTime.Minutes; MachineDataSynchronizer.IsEnabled = SynchronizeJobs || SynchronizeDiagnostics; @@ -359,6 +387,15 @@ namespace Tango.PPC.MachineSettings.ViewModels await MachineProvider.MachineOperator.SetSpoolType((PMR.Printing.JobSpoolType)SelectedSpoolType.Code); } + if (MachineProvider.IsConnected) + { + try + { + await MachineProvider.MachineOperator.SetPowerDownTime((int)Settings.PowerSavingMode); + } + catch { } + } + if (_previousTimeZone.ToStringSafe() != SelectedTimeZone.ToStringSafe()) { if (await NotificationProvider.ShowQuestion("Changing the time zone requires the application to restart. Do you wish to restart the application?")) @@ -524,6 +561,8 @@ namespace Tango.PPC.MachineSettings.ViewModels ExternalBridgePassword = Settings.ExternalBridgePassword; + SelectedPowerDownTime = PowerDownTimes.FirstOrDefault(x => x.Minutes == Settings.PowerSavingMode); + _enableRemoteAssistance = RemoteAssistanceProvider.IsEnabled; RaisePropertyChanged(nameof(EnableRemoteAssistance)); diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml index 7de2818f8..a1414f60c 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml @@ -14,6 +14,7 @@ xmlns:global="clr-namespace:Tango.PPC.MachineSettings" xmlns:integrationPMR="clr-namespace:Tango.PMR.Integration;assembly=Tango.PMR" xmlns:lubrication="clr-namespace:Tango.PPC.Common.Lubrication;assembly=Tango.PPC.Common" + xmlns:common="clr-namespace:Tango.PPC.Common;assembly=Tango.PPC.Common" xmlns:local="clr-namespace:Tango.PPC.MachineSettings.Views" mc:Ignorable="d" d:DesignHeight="4500" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> @@ -25,6 +26,13 @@ + + + + + + @@ -355,6 +363,31 @@ + + + + + + + Automatically turn off the machine on idle time after + + + + + + + + + + + + + -- cgit v1.3.1