diff options
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings')
3 files changed, 73 insertions, 1 deletions
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 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> </Project>
\ 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<PowerDownTime> 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<PowerDownTime>() + { + 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 @@ <x:Type TypeName="lubrication:LubricationLevel"/> </ObjectDataProvider.MethodParameters> </ObjectDataProvider> + + <ObjectDataProvider x:Key="PowerDownTimes" MethodName="GetValues" + ObjectType="{x:Type sys:Enum}"> + <ObjectDataProvider.MethodParameters> + <x:Type TypeName="common:PowerDownMinutes"/> + </ObjectDataProvider.MethodParameters> + </ObjectDataProvider> </UserControl.Resources> @@ -355,6 +363,31 @@ </StackPanel> </touch:TouchExpander> + <!--POWER SAVER--> + <touch:TouchExpander Margin="0 20 0 0" Header="Power Saving" IsExpanded="True" FontSize="{StaticResource TangoExpanderHeaderFontSize}" Visibility="{Binding BuildProvider.IsEureka,Converter={StaticResource BooleanToVisibilityConverter}}"> + <StackPanel> + <controls:TableGrid Margin="10" RowHeight="60" MakeFirstColumnVerticalAlignmentBottom="False" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> + <TextBlock VerticalAlignment="Center"> + <Run> + Automatically turn off the machine on idle time after + </Run> + </TextBlock> + + <touch:TouchComboBox VerticalAlignment="Top" HorizontalAlignment="Right" Width="250" ItemsSource="{Binding PowerDownTimes}" SelectedItem="{Binding SelectedPowerDownTime}" ValuePath="Minutes" DisplayMemberPath="Name"> + + </touch:TouchComboBox> + + </controls:TableGrid> + + <!--<DockPanel Margin="10 -50 0 0"> + <touch:TouchIcon VerticalAlignment="Top" Icon="InformationOutline" Foreground="{StaticResource TangoGrayTextBrush}"></touch:TouchIcon> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Top" TextWrapping="Wrap" FontSize="{StaticResource TangoSmallFontSize}" Foreground="{StaticResource TangoGrayTextBrush}"> + You can activate the screen anytime by pressing + </TextBlock> + </DockPanel>--> + </StackPanel> + </touch:TouchExpander> + <!--TECHNICIAN--> <touch:TouchExpander Visibility="{Binding ApplicationManager.IsInTechnicianMode,Converter={StaticResource BooleanToVisibilityConverter}}" Margin="0 20 0 0" Header="Advanced" IsExpanded="True" FontSize="{StaticResource TangoExpanderHeaderFontSize}"> |
