diff options
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs index 84987d705..7b8d4dbe6 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs @@ -17,6 +17,7 @@ using Tango.PPC.Common.Application; using Tango.PPC.Common.Connection; using Tango.PPC.Common.MachineSetup; using Tango.PPC.Common.Navigation; +using Tango.PPC.Common.OS; using Tango.PPC.UI.ViewsContracts; using Tango.Settings; using Tango.SharedUI.Helpers; @@ -47,6 +48,7 @@ namespace Tango.PPC.UI.ViewModels WelcomeView, WiFiSelectionView, WiFiTestView, + TimeZoneView, SetupWelcomeView, SetupProgressView, SetupCompletedView, @@ -54,6 +56,7 @@ namespace Tango.PPC.UI.ViewModels } private MachineSetupResult _setup_result; + private IOperationSystemManager _operationSystemManager; #region Properties @@ -112,6 +115,21 @@ namespace Tango.PPC.UI.ViewModels set { _failedError = value; RaisePropertyChangedAuto(); } } + /// <summary> + /// Gets or sets the available time zones. + /// </summary> + public List<TimeZoneInfo> TimeZones { get; set; } + + private TimeZoneInfo _selectedTimeZone; + /// <summary> + /// Gets or sets the selected time zone. + /// </summary> + public TimeZoneInfo SelectedTimeZone + { + get { return _selectedTimeZone; } + set { _selectedTimeZone = value; RaisePropertyChangedAuto(); } + } + #endregion @@ -137,6 +155,10 @@ namespace Tango.PPC.UI.ViewModels /// </summary> public RelayCommand RestartCommand { get; set; } + /// <summary> + /// Gets or sets the time zone selected command. + /// </summary> + public RelayCommand TimeZoneSelectedCommand { get; set; } #endregion #region Constructors @@ -146,7 +168,7 @@ namespace Tango.PPC.UI.ViewModels /// </summary> /// <param name="applicationManager">The application manager.</param> /// <param name="machineSetupManager">The machine setup manager.</param> - public MachineSetupViewVM(IPPCApplicationManager applicationManager, IMachineSetupManager machineSetupManager) + public MachineSetupViewVM(IPPCApplicationManager applicationManager, IMachineSetupManager machineSetupManager, IOperationSystemManager operationSystemManager) { MachineSetupManager = machineSetupManager; @@ -161,6 +183,12 @@ namespace Tango.PPC.UI.ViewModels InstallCommand = new RelayCommand(Install); RestartCommand = new RelayCommand(() => { NavigateTo(MachineSetupView.WelcomeView); }); + TimeZoneSelectedCommand = new RelayCommand(() => { NavigateTo(MachineSetupView.SetupWelcomeView); }); + + _operationSystemManager = operationSystemManager; + + TimeZones = _operationSystemManager.GetAvailableTimeZones().ToList(); + SelectedTimeZone = TimeZones.SingleOrDefault(x => x.ToString() == "(UTC+02:00) Jerusalem"); } #endregion @@ -250,7 +278,7 @@ namespace Tango.PPC.UI.ViewModels if (connected) { - await NavigateTo(MachineSetupView.SetupWelcomeView); + await NavigateTo(MachineSetupView.TimeZoneView); } else { @@ -284,6 +312,7 @@ namespace Tango.PPC.UI.ViewModels try { + await _operationSystemManager.ChangeTimeZone(SelectedTimeZone); _setup_result = await MachineSetupManager.Setup(SerialNumber, HostAddress); State = MachineSetupStates.Completed; LogManager.Log("Machine setup completed."); |
