aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-12-24 19:01:11 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-12-24 19:01:11 +0200
commit2f85568170b4c11c6c5876b7fac9e662a004d47f (patch)
tree587b0a30e8de36322583a10b136c7d43b25edd34 /Software/Visual_Studio/PPC/Tango.PPC.UI
parent7a9e8e8721e895b30a2652e2aaaeb6401b72250e (diff)
downloadTango-2f85568170b4c11c6c5876b7fac9e662a004d47f.tar.gz
Tango-2f85568170b4c11c6c5876b7fac9e662a004d47f.zip
Implemented PPC time zone modification !
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/time-zone.pngbin0 -> 8892 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj3
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs4
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs33
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml13
5 files changed, 48 insertions, 5 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/time-zone.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/time-zone.png
new file mode 100644
index 000000000..10b5d996c
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/time-zone.png
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
index 836878152..5fe3ae2bb 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
@@ -409,6 +409,7 @@
<Link>Tango.ColorLib.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Resource Include="Images\time-zone.png" />
<Resource Include="Images\no-permissions.png" />
<Resource Include="Images\GlobalStatus\machine-off.png" />
<Resource Include="Images\machine-update-firmware.png" />
@@ -485,7 +486,7 @@ del "$(TargetDir)firmware_package.tfp"</PostBuildEvent>
</PropertyGroup>
<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/Tango.PPC.UI/ViewModelLocator.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs
index 80154bc3f..444fd70b9 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs
@@ -68,7 +68,7 @@ namespace Tango.PPC.UI
TangoIOC.Default.Unregister<IRemoteAssistanceProvider>();
TangoIOC.Default.Unregister<IStorageProvider>();
TangoIOC.Default.Unregister<IUnifiedWriteFilterManager>();
- TangoIOC.Default.Unregister<IWindowsActivationManager>();
+ TangoIOC.Default.Unregister<IOperationSystemManager>();
TangoIOC.Default.Register<IDispatcherProvider, DefaultDispatcherProvider>(new DefaultDispatcherProvider(Application.Current.Dispatcher));
TangoIOC.Default.Register<INotificationProvider, DefaultNotificationProvider>();
@@ -89,7 +89,7 @@ namespace Tango.PPC.UI
TangoIOC.Default.Register<IHotSpotProvider, DefaultHotSpotProvider>();
TangoIOC.Default.Register<IStorageProvider, DefaultStorageProvider>();
TangoIOC.Default.Register<IUnifiedWriteFilterManager, DefaultUnifiedWriteFilterManager>();
- TangoIOC.Default.Register<IWindowsActivationManager, DefaultWindowsActivationManager>();
+ TangoIOC.Default.Register<IOperationSystemManager, DefaultOperationSystemManager>();
//TangoIOC.Default.Register<TeamFoundationServiceExtendedClient>(new TeamFoundationServiceExtendedClient("https://twinetfs.visualstudio.com", String.Empty, "szzfokrceo4rhd4eqi5qpmxn3pa5iwl3q7tlqd36l2m7smz2ynoa"));
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.");
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml
index dc30cfa93..4832eea01 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml
@@ -67,6 +67,19 @@
</StackPanel>
</Grid>
+ <Grid controls:NavigationControl.NavigationName="TimeZoneView">
+ <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="500">
+
+ <Image Source="/Images/time-zone.png" Width="128" />
+ <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Please select the machine time zone</TextBlock>
+ <touch:TouchComboBox Margin="0 80 0 0" ItemsSource="{Binding TimeZones}" SelectedItem="{Binding SelectedTimeZone,Mode=TwoWay}">
+
+ </touch:TouchComboBox>
+
+ <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding TimeZoneSelectedCommand}">CONTINUE</touch:TouchButton>
+ </StackPanel>
+ </Grid>
+
<Grid controls:NavigationControl.NavigationName="SetupWelcomeView">
<StackPanel>
<TextBlock TextAlignment="Center" LineHeight="40" FontSize="{StaticResource TangoTitleFontSize}" Margin="40 0" TextWrapping="Wrap">