diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-06-23 09:05:29 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-06-23 09:05:29 +0300 |
| commit | 230f73f478a6428a975a51789b6f43ca7a8a5ef8 (patch) | |
| tree | 7d245111db13b87bae873e990d05ced7572df413 | |
| parent | 67af9764fef96f05f61e20942b865a22645ca836 (diff) | |
| download | Tango-230f73f478a6428a975a51789b6f43ca7a8a5ef8.tar.gz Tango-230f73f478a6428a975a51789b6f43ca7a8a5ef8.zip | |
Implemented FSE "Application Restart" on remote desktop.
Fixed issue with insufficient liquid quantities dialog on MS.
Added "Display Name" to MS RMLs list.
Implemented sorting to all rmls lists on PPC.
Implemented "Display Name" on all PPC rmls lists.
24 files changed, 154 insertions, 15 deletions
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/Project/DiagnosticsUserSettingsManager.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/Project/DiagnosticsUserSettingsManager.cs index 1e3684733..5323c0415 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/Project/DiagnosticsUserSettingsManager.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/Project/DiagnosticsUserSettingsManager.cs @@ -47,6 +47,11 @@ namespace Tango.FSE.Diagnostics.Project { LogManager.Log(ex, "Error loading diagnostics user settings."); } + + if (Settings == null) + { + Settings = new DiagnosticsUserSettingsCollection(); + } } public void ClearGhostRecords(List<DiagnosticsConfigurableWidget> widgets) diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/ViewModels/DiagnosticsViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/ViewModels/DiagnosticsViewVM.cs index 8a89fbc8f..add589c62 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/ViewModels/DiagnosticsViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/ViewModels/DiagnosticsViewVM.cs @@ -532,6 +532,7 @@ namespace Tango.FSE.Diagnostics.ViewModels } catch (Exception ex) { + LogManager.Log(ex, $"Error initializing diagnostics widget with ID '{widget.ID}'."); NotificationProvider.PushErrorReportingSnackbar(ex, "Diagnostics Module Error", "Error initializing diagnostics widget."); } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/RemoteDesktopViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/RemoteDesktopViewVM.cs index e671bcfe5..b4031783c 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/RemoteDesktopViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/RemoteDesktopViewVM.cs @@ -11,9 +11,11 @@ using System.Windows; using System.Windows.Input; using System.Windows.Media.Imaging; using Tango.Core.Commands; +using Tango.Core.DI; using Tango.Core.Threading; using Tango.FSE.Common; using Tango.FSE.Common.Notifications; +using Tango.FSE.Common.RemoteActions; using Tango.FSE.Common.RemoteDesktop; using Tango.RemoteDesktop.Frames; using Tango.RemoteDesktop.Network; @@ -72,6 +74,9 @@ namespace Tango.FSE.PPCConsole.ViewModels set { _touchMode = value; RaisePropertyChangedAuto(); } } + [TangoInject] + public IRemoteActionsProvider RemoteActionsProvider { get; set; } + #endregion #region Commands @@ -111,6 +116,11 @@ namespace Tango.FSE.PPCConsole.ViewModels /// </summary> public RelayCommand StopRecordingCommand { get; set; } + /// <summary> + /// Gets or sets the restart application command. + /// </summary> + public RelayCommand RestartApplicationCommand { get; set; } + #endregion #region Constructors @@ -131,6 +141,7 @@ namespace Tango.FSE.PPCConsole.ViewModels TakeSnapshotCommand = new RelayCommand(TakeSnapshot); StartRecordingCommand = new RelayCommand(StartRecording); StopRecordingCommand = new RelayCommand(StopRecording, () => IsRecording); + RestartApplicationCommand = new RelayCommand(RestartApplication); } #endregion @@ -323,6 +334,44 @@ namespace Tango.FSE.PPCConsole.ViewModels RemoteDesktopProvider.SendCommand(RemoteDesktopCommand.HideAndOpenShell); } + private async void RestartApplication() + { + if (await NotificationProvider.ShowWarningQuestion("Are you sure you want to restart the remote application?", "RESTART")) + { + bool restarted = false; + + try + { + try + { + await RemoteDesktopProvider.EndSession(); + } + catch { } + + await Task.Factory.StartNew(RemoteActionsProvider.RestartApplication); + restarted = true; + } + catch (Exception ex) + { + LogManager.Log(ex, "Error restarting the remote application."); + } + + if (restarted) + { + try + { + await MachineProvider.DisconnectAndWaitForReconnection(TimeSpan.FromSeconds(20), TimeSpan.FromMinutes(1), "The remote PPC is now restarting..."); + + if (MachineProvider.IsConnected) + { + StartRemoteDesktop(); + } + } + catch { } + } + } + } + #endregion #region Video Recording diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Views/RemoteDesktopView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Views/RemoteDesktopView.xaml index 012c16c64..4bba76c2a 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Views/RemoteDesktopView.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Views/RemoteDesktopView.xaml @@ -156,7 +156,7 @@ </UniformGrid.Style> <Button auth:AuthorizationHelper.Mode="Collapsed" auth:AuthorizationHelper.Permission="FSE_RemoteDesktopControl" IsEnabled="{Binding RemoteDesktopProvider.InSession}" Width="250" Margin="5" Style="{StaticResource FSE_Button_Polygon}" Content="Hide PPC and Open Shell" Command="{Binding HideAndOpenShellCommand}" /> - <Button auth:AuthorizationHelper.Mode="Collapsed" auth:AuthorizationHelper.Permission="FSE_RemoteDesktopControl" IsEnabled="{Binding RemoteDesktopProvider.InSession}" Width="250" Margin="5" Style="{StaticResource FSE_Button_Polygon}" Content="Restart application"/> + <Button auth:AuthorizationHelper.Mode="Collapsed" auth:AuthorizationHelper.Permission="FSE_RemoteDesktopControl" IsEnabled="{Binding RemoteDesktopProvider.InSession}" Width="250" Margin="5" Style="{StaticResource FSE_Button_Polygon}" Content="Restart application" Command="{Binding RestartApplicationCommand}" /> <Button auth:AuthorizationHelper.Mode="Collapsed" auth:AuthorizationHelper.Permission="FSE_RemoteDesktopControl" IsEnabled="{Binding RemoteDesktopProvider.InSession}" Width="250" Margin="5" Style="{StaticResource FSE_Button_Polygon}" Content="Open Task Manager" Command="{Binding OpenTaskManagerCommand}" /> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/RemoteActions/IRemoteActionsProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/RemoteActions/IRemoteActionsProvider.cs index 024a8ac39..4e02c4516 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/RemoteActions/IRemoteActionsProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/RemoteActions/IRemoteActionsProvider.cs @@ -9,5 +9,6 @@ namespace Tango.FSE.Common.RemoteActions public interface IRemoteActionsProvider { void SimulateApplicationException(bool causeCrash); + void RestartApplication(); } } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/RemoteActions/DefaultRemoteActionsProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/RemoteActions/DefaultRemoteActionsProvider.cs index 98256fa3c..41c41979b 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/RemoteActions/DefaultRemoteActionsProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/RemoteActions/DefaultRemoteActionsProvider.cs @@ -15,6 +15,14 @@ namespace Tango.FSE.UI.RemoteActions [TangoInject] private IMachineProvider MachineProvider { get; set; } + public void RestartApplication() + { + var response = MachineProvider.MachineOperator.SendGenericRequest<RestartApplicationRequest, RestartApplicationResponse>(new RestartApplicationRequest() + { + + }).Result; + } + public void SimulateApplicationException(bool causeCrash) { var response = MachineProvider.MachineOperator.SendGenericRequest<SimulateApplicationExceptionRequest, SimulateApplicationExceptionResponse>(new SimulateApplicationExceptionRequest() diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml.cs index 51cfb1e73..96d285995 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml.cs @@ -33,7 +33,7 @@ namespace Tango.MachineStudio.Developer.Views Grid parent = border.Parent as Grid; IDSPackLevel packLevel = border.DataContext as IDSPackLevel; - border.Width = ((double)packLevel.Current / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualWidth; + border.Width = Math.Max(((double)packLevel.Current / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualWidth, 0); } private void Limit_Loaded(object sender, RoutedEventArgs e) diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs index 2a1bc1bbb..13cac9c88 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs @@ -285,7 +285,7 @@ namespace Tango.MachineStudio.RML.ViewModels using (ObservablesContext db = ObservablesContext.CreateDefault()) { - var rmls = await db.Rmls.Where(x => x.Name.ToLower().Contains(filter)) + var rmls = await db.Rmls.Where(x => x.Name.ToLower().Contains(filter) || x.DisplayName.ToLower().Contains(filter)) .Include(x => x.Cct.FileName) .Include(x => x.LiquidTypesRmls.Select(y => y.LiquidType)) .Include(x => x.BtsrApplicationType.Name) @@ -319,7 +319,7 @@ namespace Tango.MachineStudio.RML.ViewModels model.UseGradients = rml.UseColorLibGradients; model.UseLightInks = rml.UseLightInks; model.HeadType = (HeadTypes)rml.HeadType; - model.Btsr = rml.BtsrApplicationType + ", " + rml.BtsrYarnType; + model.Btsr = (String.IsNullOrEmpty(rml.BtsrApplicationType) ? "N/A" : rml.BtsrApplicationType) + ", " + (String.IsNullOrEmpty(rml.BtsrYarnType) ? "N/A" : rml.BtsrYarnType); model.LiquidTypes = rml.LiquidTypes.OrderBy(x => x.Code).Select(x => x.Color).ToList(); models.Add(model); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlsView.xaml index 3dfcc687d..d5f4165c9 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlsView.xaml @@ -18,6 +18,7 @@ <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> <converters:BooleanToYesNoConverter x:Key="BooleanToYesNoConverter" /> <converters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter" /> + <converters:IsNullToVisibilityConverter x:Key="IsNullToVisibilityConverter" /> </UserControl.Resources> <Grid IsEnabled="{Binding IsFree}"> @@ -89,7 +90,18 @@ </Style> </DataGrid.CellStyle> <DataGrid.Columns> - <DataGridTextColumn Header="NAME" Binding="{Binding Name}" Width="200"/> + <DataGridTemplateColumn Header="NAME" Width="200"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <StackPanel> + <TextBlock Text="{Binding Name}"></TextBlock> + <TextBlock Visibility="{Binding DisplayName,Converter={StaticResource IsNullToVisibilityConverter}}" FontSize="11" Foreground="{StaticResource GrayBrush}" Margin="2 2 0 0"> + <Run>(</Run><Run Text="{Binding DisplayName,Mode=OneWay}"></Run><Run>)</Run> + </TextBlock> + </StackPanel> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> <DataGridTextColumn Header="HEAD" Binding="{Binding HeadType}" Width="Auto" /> <DataGridTextColumn Header="BTSR" Binding="{Binding Btsr}" Width="Auto" /> <DataGridTextColumn Header="CCT" Binding="{Binding CCT}" Width="Auto" /> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs index f458bab65..25136e5b9 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs @@ -497,7 +497,7 @@ namespace Tango.PPC.Jobs.ViewModels //await SetSpoolTension(Job.Rml); LogManager.Log("Loading RMLS..."); - Rmls = (await new RmlsCollectionBuilder(_db).SetAll().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildAsync()).OrderBy(x => x.Name).ToList(); + Rmls = (await new RmlsCollectionBuilder(_db).SetAll().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildAsync()).OrderBy(x => x.FinalName).ToList(); LogManager.Log("Loading Color Spaces..."); ColorSpaces = await _db.ColorSpaces.Where(x => x.Code != (int)BL.Enumerations.ColorSpaces.CMYK).ToListAsync(); LogManager.Log("Loading Spool Types..."); diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs index 5d58ff2e2..d46113b50 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs @@ -264,7 +264,7 @@ namespace Tango.PPC.Jobs.ViewModels } else { - return (job.Name.ToLower().StartsWith(Filter) || (job.Customer != null && job.Customer.Name.ToLower().StartsWith(Filter))); + return (job.Name.ToLower().Contains(Filter.ToLower()) || (job.Customer != null && job.Customer.Name.ToLower().StartsWith(Filter.ToLower()))); } } else diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml index 582e29c35..af14f7522 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml @@ -505,7 +505,7 @@ <DockPanel Margin="0 15 0 0"> <TextBlock Width="100" VerticalAlignment="Bottom" Margin="0 0 0 3">Thread type:</TextBlock> - <touch:TouchComboBox Margin="10 0 0 0" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRML}" DisplayMemberPath="Name" Title="Select Thread" /> + <touch:TouchComboBox Margin="10 0 0 0" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRML}" DisplayMemberPath="FinalName" Title="Select Thread" /> </DockPanel> <DockPanel Margin="110 5 0 0" TextElement.Foreground="{StaticResource TangoGrayTextBrush}" Visibility="{Binding LubricationLevel,Converter={StaticResource IsNullToVisibilityConverter}}"> 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 1565cda5a..374269522 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 @@ -395,7 +395,7 @@ namespace Tango.PPC.MachineSettings.ViewModels using (ObservablesContext db = ObservablesContext.CreateDefault()) { - Rmls = await new RmlsCollectionBuilder(db).SetAll().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildAsync(); + Rmls = (await new RmlsCollectionBuilder(db).SetAll().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildAsync()).OrderBy(x => x.FinalName).ToObservableCollection(); } } 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 b3056c36e..a13a1a470 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 @@ -152,7 +152,7 @@ </ItemsControl> <TextBlock VerticalAlignment="Bottom">Default Thread</TextBlock> - <touch:TouchComboBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" ItemsSource="{Binding Rmls}" SelectedItem="{Binding DefaultRML}" DisplayMemberPath="Name"></touch:TouchComboBox> + <touch:TouchComboBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" ItemsSource="{Binding Rmls}" SelectedItem="{Binding DefaultRML}" DisplayMemberPath="FinalName"></touch:TouchComboBox> <TextBlock VerticalAlignment="Bottom">Default Spool</TextBlock> <touch:TouchComboBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" ItemsSource="{Binding Adapter.SpoolTypes}" SelectedItem="{Binding DefaultSpoolType}" DisplayMemberPath="Name"></touch:TouchComboBox> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Performance/DefaultPerformanceService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Performance/DefaultPerformanceService.cs index 59236f667..e27989167 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Performance/DefaultPerformanceService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Performance/DefaultPerformanceService.cs @@ -148,7 +148,7 @@ namespace Tango.PPC.Common.Performance _package.AvailableDiskSpace = (int)BytesToMegaBytes(info.AvailableFreeSpace); _package.DateTime = DateTime.Now; - foreach (var client in _clients.ToList()) + foreach (var client in _clients.ToList().Where(x => x.Receiver.State == Transport.TransportComponentState.Connected)) { try { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/RemoteActions/RestartApplicationRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/RemoteActions/RestartApplicationRequest.cs new file mode 100644 index 000000000..e5c51792f --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/RemoteActions/RestartApplicationRequest.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Shared.RemoteActions +{ + public class RestartApplicationRequest + { + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/RemoteActions/RestartApplicationResponse.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/RemoteActions/RestartApplicationResponse.cs new file mode 100644 index 000000000..2dd1a3929 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/RemoteActions/RestartApplicationResponse.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Shared.RemoteActions +{ + public class RestartApplicationResponse + { + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj index 8c3908bba..a6eb2de89 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj @@ -97,6 +97,8 @@ <DependentUpon>Settings.settings</DependentUpon> <DesignTimeSharedInput>True</DesignTimeSharedInput> </Compile> + <Compile Include="RemoteActions\RestartApplicationRequest.cs" /> + <Compile Include="RemoteActions\RestartApplicationResponse.cs" /> <Compile Include="RemoteActions\SimulateApplicationExceptionRequest.cs" /> <Compile Include="RemoteActions\SimulateApplicationExceptionResponse.cs" /> <Compile Include="RemoteUpgrade\StartRemoteFirmwareUpgradeRequest.cs" /> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml index 081778434..1d5ef0ff4 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerUpView.xaml @@ -13,7 +13,7 @@ <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" Margin="0 30 0 0">Continue getting ready for:</TextBlock> <DockPanel HorizontalAlignment="Center" Margin="0 40 0 0"> <touch:TouchRadioButton IsChecked="{Binding IsSelectedRml}" /> - <touch:TouchComboBox Margin="20 0 0 0" Width="300" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRml}" DisplayMemberPath="Name" Title="Select thread type"></touch:TouchComboBox> + <touch:TouchComboBox Margin="20 0 0 0" Width="300" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRml}" DisplayMemberPath="FinalName" Title="Select thread type"></touch:TouchComboBox> </DockPanel> <DockPanel HorizontalAlignment="Left" Margin="0 40 0 0"> <touch:TouchRadioButton IsChecked="{Binding IsMinimalTemperature}" /> 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 55493e286..aaacd8b66 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingView.xaml @@ -104,7 +104,7 @@ <Run>Select the thread type you are loading and press</Run> <Run FontWeight="Bold">continue</Run> </TextBlock> - <touch:TouchComboBox Margin="0 40 0 0" Width="500" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRml}" DisplayMemberPath="Name" Title="Select thread type"></touch:TouchComboBox> + <touch:TouchComboBox Margin="0 40 0 0" Width="500" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRml}" DisplayMemberPath="FinalName" Title="Select thread type"></touch:TouchComboBox> <StackPanel Margin="100 10 0 10" HorizontalAlignment="Left" Visibility="{Binding BtsrInstalled,Converter={StaticResource BooleanToVisibilityConverter}}"> <DockPanel> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/RemoteActions/DefaultRemoteActionsService.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/RemoteActions/DefaultRemoteActionsService.cs index 1b8780f91..4bd632a2f 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/RemoteActions/DefaultRemoteActionsService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/RemoteActions/DefaultRemoteActionsService.cs @@ -7,6 +7,7 @@ using System.Threading.Tasks; using Tango.Core.DI; using Tango.Core.Threading; using Tango.Integration.ExternalBridge; +using Tango.PPC.Common.Application; using Tango.PPC.Common.ExternalBridge; using Tango.PPC.Common.RemoteActions; using Tango.PPC.Common.Threading; @@ -20,6 +21,9 @@ namespace Tango.PPC.UI.RemoteActions [TangoInject] private IDispatcherProvider DispatcherProvider { get; set; } + [TangoInject] + private IPPCApplicationManager ApplicationManager { get; set; } + public DefaultRemoteActionsService(IPPCExternalBridgeService externalBridge) { externalBridge.RegisterRequestHandler(this); @@ -50,5 +54,16 @@ namespace Tango.PPC.UI.RemoteActions } }); } + + [ExternalBridgeRequestHandlerMethod(typeof(RestartApplicationRequest), RequestHandlerLoggingMode.LogRequestName)] + public async Task OnRestartApplicationRequest(RestartApplicationRequest request, String token, ExternalBridgeReceiver receiver) + { + await receiver.SendGenericResponse(new RestartApplicationResponse(), token); + + DispatcherProvider.Invoke(() => + { + ApplicationManager.Restart(); + }); + } } } 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 05fb610c8..c22d690aa 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs @@ -172,7 +172,7 @@ namespace Tango.PPC.UI.ViewModels using (ObservablesContext db = ObservablesContext.CreateDefault()) { - rmls = await new RmlsCollectionBuilder(db).SetAll().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildListAsync(); + rmls = (await new RmlsCollectionBuilder(db).SetAll().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildListAsync()).OrderBy(x => x.FinalName).ToList(); } var selectedRml = rmls.SingleOrDefault(x => x.Guid == Settings.LoadedRmlGuid); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest index d72e75011..efc5f8179 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> diff --git a/Software/Visual_Studio/Tango.BL/Entities/Rml.cs b/Software/Visual_Studio/Tango.BL/Entities/Rml.cs index 58b6749cf..600887248 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Rml.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Rml.cs @@ -95,6 +95,28 @@ namespace Tango.BL.Entities } } + [NotMapped] + [JsonIgnore] + public String FinalName + { + get + { + return String.IsNullOrWhiteSpace(DisplayName) ? Name : DisplayName; + } + } + + protected override void OnNameChanged(string name) + { + base.OnNameChanged(name); + RaisePropertyChanged(nameof(FinalName)); + } + + protected override void OnDisplayNameChanged(string displayname) + { + base.OnDisplayNameChanged(displayname); + RaisePropertyChanged(nameof(FinalName)); + } + public ProcessParametersTablesGroup GetActiveProcessGroup() { return ProcessParametersTablesGroups.FirstOrDefault(x => x.Active); |
