aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2020-02-19 10:32:48 +0200
committerAvi Levkovich <avi@twine-s.com>2020-02-19 10:32:48 +0200
commit685b1da155bda741a3378a1c19a04ffd110a0a33 (patch)
treee38a3740bf4727dfa9368c6010c6cd55d6910ffb /Software/Visual_Studio/PPC/Tango.PPC.UI
parent94fccc66fd2b8b6aed1371546dfd8cef68d5e60d (diff)
parentbb51ac752b58b3d64e86a8150e7a9b1f5749e379 (diff)
downloadTango-685b1da155bda741a3378a1c19a04ffd110a0a33.tar.gz
Tango-685b1da155bda741a3378a1c19a04ffd110a0a33.zip
merge conflict
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml22
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs27
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs38
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest2
6 files changed, 77 insertions, 16 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml
index f6fc7704a..d6db3d124 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml
@@ -14,16 +14,24 @@
<TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" Margin="0 30 0 0">Thread Loading</TextBlock>
<Grid Height="283">
- <StackPanel Visibility="{Binding IsFinalizing,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
- <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoDefaultFontSize}" Margin="40 10 40 0" Foreground="{StaticResource TangoGrayTextBrush}" TextWrapping="Wrap" TextAlignment="Center">
+ <StackPanel Visibility="{Binding IsPreparing,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
+ <StackPanel Visibility="{Binding IsFinalizing,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
+ <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoDefaultFontSize}" Margin="40 10 40 0" Foreground="{StaticResource TangoGrayTextBrush}" TextWrapping="Wrap" TextAlignment="Center">
The machine is ready for thread loading. Please load the thread as instructed and press 'continue'.
- </TextBlock>
- <touch:TouchComboBox Margin="0 40 0 0" Width="300" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRml}" DisplayMemberPath="Name" Title="Select thread type"></touch:TouchComboBox>
- <touch:TouchButton Command="{Binding ContinueCommand}" Margin="0 50 0 50" Style="{StaticResource TangoHollowButton}" HorizontalAlignment="Center" Padding="60 15" CornerRadius="25">CONTINUE</touch:TouchButton>
+ </TextBlock>
+ <touch:TouchComboBox Margin="0 40 0 0" Width="300" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRml}" DisplayMemberPath="Name" Title="Select thread type"></touch:TouchComboBox>
+ <touch:TouchButton Command="{Binding ContinueCommand}" Margin="0 50 0 50" Style="{StaticResource TangoHollowButton}" HorizontalAlignment="Center" Padding="60 15" CornerRadius="25">CONTINUE</touch:TouchButton>
+ </StackPanel>
+ <StackPanel Visibility="{Binding IsFinalizing,Converter={StaticResource BooleanToVisibilityConverter}}">
+ <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoDefaultFontSize}" Margin="40 10 40 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" TextWrapping="Wrap" TextAlignment="Center">
+ The machine is now loading the thread. please wait...
+ </TextBlock>
+ <touch:TouchBusyIndicator Margin="0 100 0 0" Width="100" Height="100" IsIndeterminate="True" />
+ </StackPanel>
</StackPanel>
- <StackPanel Visibility="{Binding IsFinalizing,Converter={StaticResource BooleanToVisibilityConverter}}">
+ <StackPanel Visibility="{Binding IsPreparing,Converter={StaticResource BooleanToVisibilityConverter}}">
<TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoDefaultFontSize}" Margin="40 10 40 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" TextWrapping="Wrap" TextAlignment="Center">
- The machine is now loading the thread. please wait...
+ The machine is now preparing for thread loading. please wait...
</TextBlock>
<touch:TouchBusyIndicator Margin="0 100 0 0" Width="100" Height="100" IsIndeterminate="True" />
</StackPanel>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs
index 5e5370416..5c4d003a1 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs
@@ -40,6 +40,13 @@ namespace Tango.PPC.UI.Dialogs
set { _isFinalizing = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
}
+ private bool _isPreparing;
+ public bool IsPreparing
+ {
+ get { return _isPreparing; }
+ set { _isPreparing = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
+ }
+
public List<Rml> Rmls { get; set; }
private Rml _selectedRml;
@@ -51,15 +58,28 @@ namespace Tango.PPC.UI.Dialogs
public RelayCommand ContinueCommand { get; set; }
- public ThreadLoadingViewVM(IMachineProvider machineProvider, ThreadLoadingConfirmationRequiredEventArgs confirmationArgs)
+ public ThreadLoadingViewVM(IMachineProvider machineProvider)
{
CanClose = true;
- _confirmationArgs = confirmationArgs;
+ IsPreparing = true;
ContinueCommand = new RelayCommand(ContinueThreadLoading, () => !IsFinalizing && SelectedRml != null);
MachineProvider = machineProvider;
MachineProvider.MachineOperator.ThreadLoadingStatusChanged += MachineOperator_ThreadLoadingStatusChanged;
MachineProvider.MachineOperator.ThreadLoadingCompleted += MachineOperator_ThreadLoadingCompleted;
MachineProvider.MachineOperator.ThreadLoadingFailed += MachineOperator_ThreadLoadingFailed;
+ MachineProvider.MachineOperator.ThreadLoadingConfirmationRequired += MachineOperator_ThreadLoadingConfirmationRequired;
+ }
+
+ public ThreadLoadingViewVM(IMachineProvider machineProvider, ThreadLoadingConfirmationRequiredEventArgs confirmationArgs) : this(machineProvider)
+ {
+ _confirmationArgs = confirmationArgs;
+ IsPreparing = false;
+ }
+
+ private void MachineOperator_ThreadLoadingConfirmationRequired(object sender, ThreadLoadingConfirmationRequiredEventArgs e)
+ {
+ _confirmationArgs = e;
+ IsPreparing = false;
}
private async void ContinueThreadLoading()
@@ -125,7 +145,7 @@ namespace Tango.PPC.UI.Dialogs
{
Status = e;
- if(Status.State == ThreadLoadingState.Finalizing)
+ if (Status.State == ThreadLoadingState.Finalizing)
{
IsFinalizing = true;
}
@@ -150,6 +170,7 @@ namespace Tango.PPC.UI.Dialogs
MachineProvider.MachineOperator.ThreadLoadingStatusChanged -= MachineOperator_ThreadLoadingStatusChanged;
MachineProvider.MachineOperator.ThreadLoadingCompleted -= MachineOperator_ThreadLoadingCompleted;
MachineProvider.MachineOperator.ThreadLoadingFailed -= MachineOperator_ThreadLoadingFailed;
+ MachineProvider.MachineOperator.ThreadLoadingConfirmationRequired -= MachineOperator_ThreadLoadingConfirmationRequired;
}
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs
index cfe0a03a0..f5b3d427f 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs
@@ -8,4 +8,4 @@ using System.Windows;
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Tango PPC Application")]
-[assembly: AssemblyVersion("1.1.0.0")]
+[assembly: AssemblyVersion("1.1.1.0")]
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs
index f926a0f4c..e280d5f9d 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs
@@ -96,12 +96,14 @@ namespace Tango.PPC.UI.ViewModels
LogManager.Log($"Application started. Single user/Auto login detected ({user.Email}). Skipping LoginView...");
await AuthenticationProvider.Login(user.Email, user.Password, false);
+ await Task.Delay(1000);
IsLoading = false;
}
else
{
LogManager.Log("Application started. Navigating to LoginView...");
await NavigationManager.NavigateTo(NavigationView.LoginView);
+ await Task.Delay(1000);
IsLoading = false;
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
index 5c518f60d..048234949 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
@@ -32,6 +32,7 @@ namespace Tango.PPC.UI.ViewModels
{
private DispatcherTimer _date_timer;
private bool _isPowerUpDialogShown;
+ private bool _isThreadLoadingShown;
private DateTime _currentDateTime;
/// <summary>
@@ -64,6 +65,7 @@ namespace Tango.PPC.UI.ViewModels
base.OnApplicationReady();
MachineProvider.MachineOperator.CartridgeValidationRequestReceived += MachineOperator_CartridgeValidationRequestReceived;
MachineProvider.MachineOperator.PowerUpStarted += MachineOperator_PowerUpStarted;
+ MachineProvider.MachineOperator.ThreadLoadingStatusChanged += MachineOperator_ThreadLoadingStatusChanged;
MachineProvider.MachineOperator.ThreadLoadingConfirmationRequired += MachineOperator_ThreadLoadingConfirmationRequired;
}
@@ -187,12 +189,30 @@ namespace Tango.PPC.UI.ViewModels
});
}
- private async void MachineOperator_ThreadLoadingConfirmationRequired(object sender, ThreadLoadingConfirmationRequiredEventArgs e)
+ private void MachineOperator_ThreadLoadingStatusChanged(object sender, PMR.ThreadLoading.StartThreadLoadingResponse e)
{
- LogManager.Log("Thread loading confirmation detected, showing thread loading screen...");
+ if (e.State == PMR.ThreadLoading.ThreadLoadingState.Preparing)
+ {
+ DisplayThreadLoading();
+ }
+ }
+
+ private void MachineOperator_ThreadLoadingConfirmationRequired(object sender, ThreadLoadingConfirmationRequiredEventArgs e)
+ {
+ DisplayThreadLoading(e);
+ }
+
+ private async void DisplayThreadLoading(ThreadLoadingConfirmationRequiredEventArgs confirmationArgs = null)
+ {
+ if (_isThreadLoadingShown) return;
+
+ _isThreadLoadingShown = true;
+
+ LogManager.Log("Thread loading preparation/finalization detected, showing thread loading screen...");
if (!Settings.DisplayAutomaticThreadLoadingScreen)
{
+ _isThreadLoadingShown = false;
LogManager.Log("Thread loading screen disabled. skipping...");
return;
}
@@ -212,12 +232,21 @@ namespace Tango.PPC.UI.ViewModels
var selectedRml = rmls.SingleOrDefault(x => x.Guid == Settings.LoadedRmlGuid);
- vm = new ThreadLoadingViewVM(MachineProvider, e);
+ if (confirmationArgs == null)
+ {
+ vm = new ThreadLoadingViewVM(MachineProvider);
+ }
+ else
+ {
+ vm = new ThreadLoadingViewVM(MachineProvider, confirmationArgs);
+ }
+
vm.Rmls = rmls;
vm.SelectedRml = selectedRml != null ? selectedRml : rmls.FirstOrDefault();
}
catch (Exception ex)
{
+ _isThreadLoadingShown = false;
LogManager.Log(ex, "Error initializing thread loading screen.");
return;
}
@@ -226,6 +255,8 @@ namespace Tango.PPC.UI.ViewModels
{
await NotificationProvider.ShowDialog<ThreadLoadingViewVM>(vm);
+ _isThreadLoadingShown = false;
+
LogManager.Log("Thread loading screen closed.");
if (!vm.DialogResult)
@@ -257,7 +288,6 @@ namespace Tango.PPC.UI.ViewModels
}
});
}
-
#endregion
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
index efc5f8179..d72e75011 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
@@ -16,7 +16,7 @@
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
- <!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />-->
+ <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>