From 8e49a8041391c9aa946060aed2c538b1ce958a68 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 19 Sep 2019 18:29:10 +0300 Subject: Added support for multiple ColorLib versions ! Added version control and display in RML & Research Module. Implemented GenerateHive optimizations. --- .../Modules/Tango.MachineStudio.Developer/App.xaml | 12 ++++++++++++ .../Tango.MachineStudio.Developer.csproj | 6 +++++- .../ViewModels/MainViewVM.cs | 11 ++++++----- .../Tango.MachineStudio.Developer/Views/JobView.xaml | 16 +++++++++++----- 4 files changed, 34 insertions(+), 11 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/App.xaml (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/App.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/App.xaml new file mode 100644 index 000000000..dff08b5e8 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/App.xaml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj index 6e55b6d14..10fce1b20 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj @@ -141,6 +141,10 @@ RunningJobView.xaml + + MSBuild:Compile + Designer + Designer MSBuild:Compile @@ -361,7 +365,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index ac5354a74..3f551c866 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -827,7 +827,7 @@ namespace Tango.MachineStudio.Developer.ViewModels { while (true) { - if (!_rml_has_no_cct && EnableColorConversion && !_disable_gamut_check && IsJobVisible && IsVisible && ActiveJob != null && ActiveJob.Segments != null) + if (!_rml_has_no_cct && EnableColorConversion && !_disable_gamut_check && IsJobVisible && IsVisible && ActiveJob != null && ActiveJob.Segments != null && SelectedProcessParametersTable != null) { try { @@ -839,7 +839,7 @@ namespace Tango.MachineStudio.Developer.ViewModels { try { - var output = _converter.Convert(stop); + var output = _converter.Convert(stop, false); stop.Red = output.SingleCoordinates.Red; stop.Green = output.SingleCoordinates.Green; @@ -853,7 +853,8 @@ namespace Tango.MachineStudio.Developer.ViewModels { try { - stop.IsOutOfGamut = _converter.IsOutOfGamut(stop); + var output = _converter.Convert(stop, false); + output.ApplyOnBrushStopLiquidVolumes(stop, SelectedProcessParametersTable); stop.OutOfGamutChecked = true; } catch { } @@ -874,7 +875,7 @@ namespace Tango.MachineStudio.Developer.ViewModels _hiveOpened = true; try { - HiveSuggestions = _converter.Convert(SelectedBrushStop).CreateHiveSuggestions(); + HiveSuggestions = _converter.Convert(SelectedBrushStop, true).CreateHiveSuggestions(); } catch (Exception ex) { @@ -915,7 +916,7 @@ namespace Tango.MachineStudio.Developer.ViewModels if (!_color_changed_from_hive && _hiveOpened) { SelectedBrushStop.Corrected = false; - HiveSuggestions = _converter.Convert(SelectedBrushStop).CreateHiveSuggestions(); + HiveSuggestions = _converter.Convert(SelectedBrushStop, true).CreateHiveSuggestions(); } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml index 861a639d3..742798ce4 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml @@ -753,13 +753,19 @@ MEDIA - + - - - - + + + + + + + v: + + + -- cgit v1.3.1 From b5c5758e431077d84fb53a3ff62f8e751fca2731 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 23 Sep 2019 18:22:32 +0300 Subject: Implemented Insufficient liquid levels !!! --- .../Tango.MachineStudio.Developer.csproj | 10 ++- .../ViewModels/InsufficientLiquidQuantityViewVM.cs | 20 +++++ .../ViewModels/MainViewVM.cs | 10 +++ .../Views/EmbroideryDisplayView.xaml | 2 +- .../Views/EmbroideryImportView.xaml | 2 +- .../Views/InsufficientLiquidQuantityView.xaml | 81 ++++++++++++++++++++ .../Views/InsufficientLiquidQuantityView.xaml.cs | 54 +++++++++++++ .../Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs | 5 ++ .../Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs | 5 ++ .../Connection/DefaultMachineProvider.cs | 11 ++- .../PPC/Tango.PPC.Common/PPCSettings.cs | 8 +- .../Dialogs/InsufficientLiquidQuantityView.xaml | 78 +++++++++++++++++++ .../Dialogs/InsufficientLiquidQuantityView.xaml.cs | 54 +++++++++++++ .../Dialogs/InsufficientLiquidQuantityViewVM.cs | 20 +++++ .../Printing/DefaultPrintingManager.cs | 17 ++++- .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 10 ++- .../Visual_Studio/Tango.BL/Entities/LiquidType.cs | 11 +++ .../Operation/IMachineOperator.cs | 6 ++ .../InsufficientLiquidQuantityException.cs | 31 ++++++++ .../Tango.Integration/Operation/MachineOperator.cs | 89 +++++++++++++++++++--- .../Tango.Integration/Tango.Integration.csproj | 3 +- .../Tango.MachineEM.UI/Views/MainView.xaml | 8 +- 22 files changed, 505 insertions(+), 30 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/InsufficientLiquidQuantityViewVM.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityViewVM.cs create mode 100644 Software/Visual_Studio/Tango.Integration/Operation/InsufficientLiquidQuantityException.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj index 10fce1b20..f57f83d7e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj @@ -121,6 +121,7 @@ + EmbroideryDisplayView.xaml @@ -128,6 +129,9 @@ EmbroideryImportView.xaml + + InsufficientLiquidQuantityView.xaml + MainView.xaml @@ -153,6 +157,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -365,7 +373,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/InsufficientLiquidQuantityViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/InsufficientLiquidQuantityViewVM.cs new file mode 100644 index 000000000..e18fc842f --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/InsufficientLiquidQuantityViewVM.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Integration.Operation; +using Tango.SharedUI; + +namespace Tango.MachineStudio.Developer.ViewModels +{ + public class InsufficientLiquidQuantityViewVM : DialogViewVM + { + public InsufficientLiquidQuantityException Exception { get; set; } + + public InsufficientLiquidQuantityViewVM(InsufficientLiquidQuantityException ex) + { + Exception = ex; + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index 3f551c866..c2fad9d87 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -1446,6 +1446,16 @@ namespace Tango.MachineStudio.Developer.ViewModels //Finally Canceled.. }; } + catch (InsufficientLiquidQuantityException ex) + { + _notification.ShowModalDialog(new InsufficientLiquidQuantityViewVM(ex), (x) => + { + + MachineOperator.EnableJobLiquidQuantityValidation = false; + StartJob(); + + }, () => { }); + } catch (Exception ex) { LogManager.Log(ex); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryDisplayView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryDisplayView.xaml index 22414b4b2..2e1eaf6a1 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryDisplayView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryDisplayView.xaml @@ -9,7 +9,7 @@ xmlns:converters="clr-namespace:Tango.MachineStudio.Developer.Converters" xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views" mc:Ignorable="d" - Width="1280" Height="720" Background="White" d:DataContext="{d:DesignInstance Type=vm:EmbroideryDisplayViewVM, IsDesignTimeCreatable=False}"> + Width="1280" Height="720" Background="{StaticResource WhiteBackgroundBrush}" d:DataContext="{d:DesignInstance Type=vm:EmbroideryDisplayViewVM, IsDesignTimeCreatable=False}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryImportView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryImportView.xaml index 8d25719e8..d9ff176d9 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryImportView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/EmbroideryImportView.xaml @@ -10,7 +10,7 @@ xmlns:brushPicker="clr-namespace:Tango.BrushPicker;assembly=Tango.BrushPicker" xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views" mc:Ignorable="d" - Height="720" Width="1280" Background="White" d:DataContext="{d:DesignInstance Type=vm:EmbroideryImportViewVM, IsDesignTimeCreatable=False}"> + Height="720" Width="1280" Background="{StaticResource WhiteBackgroundBrush}" d:DataContext="{d:DesignInstance Type=vm:EmbroideryImportViewVM, IsDesignTimeCreatable=False}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml new file mode 100644 index 000000000..f0e9dc29c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml @@ -0,0 +1,81 @@ + + + + + Insufficient Liquid Level + + There seems to be an insufficient ink levels in one or more of the following dispensers. + + The job cannot be completed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 000000000..171cb754e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.Integration.Operation; +using static Tango.Integration.Operation.InsufficientLiquidQuantityException; + +namespace Tango.MachineStudio.Developer.Views +{ + /// + /// Interaction logic for InsufficientLiquidQuantityView.xaml + /// + public partial class InsufficientLiquidQuantityView : UserControl + { + public InsufficientLiquidQuantityView() + { + InitializeComponent(); + } + + private void IdsPackLoaded(object sender, RoutedEventArgs e) + { + Border border = sender as Border; + Grid parent = border.Parent as Grid; + IDSPackLevel packLevel = border.DataContext as IDSPackLevel; + + border.Height = ((double)packLevel.Current / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualHeight; + } + + private void Limit_Loaded(object sender, RoutedEventArgs e) + { + Rectangle rect = sender as Rectangle; + Grid parent = rect.Parent as Grid; + IDSPackLevel packLevel = rect.DataContext as IDSPackLevel; + + var top = ((double)packLevel.Required / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualHeight; + rect.Margin = new Thickness(0, 0, 0, top); + + if (packLevel.IsValid) + { + rect.Visibility = Visibility.Hidden; + } + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs index 14065ccba..49d11a8fd 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs @@ -8,6 +8,7 @@ using Tango.BL.Builders; using Tango.BL.Entities; using Tango.ColorConversion; using Tango.Core.Commands; +using Tango.Integration.Operation; using Tango.PPC.Common; using Tango.PPC.Common.Messages; using Tango.PPC.Common.Navigation; @@ -91,6 +92,10 @@ namespace Tango.PPC.Jobs.ViewModels await PrintingManager.Print(Job, _context); await NavigationManager.NavigateTo(false, nameof(JobProgressView)); } + catch (InsufficientLiquidQuantityException) + { + //Ignore.. + } catch (Exception ex) { LogManager.Log(ex, "Could not start the current job."); 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 85eb87824..a99e45eb3 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 @@ -36,6 +36,7 @@ using Tango.Explorer; using Tango.PPC.Storage; using System.IO; using Tango.ColorConversion; +using Tango.Integration.Operation; namespace Tango.PPC.Jobs.ViewModels { @@ -644,6 +645,10 @@ namespace Tango.PPC.Jobs.ViewModels await PrintingManager.Print(Job, _db); await NavigationManager.NavigateTo(nameof(JobProgressView)); } + catch (InsufficientLiquidQuantityException) + { + //Ignore.. + } catch (Exception ex) { LogManager.Log(ex, "Could not start the current job."); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs index cd432538c..a16e2f649 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs @@ -89,6 +89,11 @@ namespace Tango.PPC.Common.Connection MachineOperator.GradientGenerationConfiguration.IsEnabled = settings.EnableGradientGeneration; MachineOperator.GradientGenerationConfiguration.ResolutionCM = settings.GradientGenerationResolution; + + MachineOperator.EmergencyNotificationProvider.Address = settings.EmergencyComPort; + MachineOperator.EmergencyNotificationProvider.IsEnabled = settings.EnableEmergencyNotifications; + + MachineOperator.EnableJobLiquidQuantityValidation = settings.EnableJobLiquidQuantityValidation; } private async void ConnectionThreadMethod() @@ -159,9 +164,6 @@ namespace Tango.PPC.Common.Connection await Task.Delay(1000); await MachineOperator.UploadHardwareConfiguration(Machine.Configuration.HardwareVersion, Machine.Configuration); MachineOperator.UseKeepAlive = true; - - MachineOperator.EmergencyNotificationProvider.Address = settings.EmergencyComPort; - MachineOperator.EmergencyNotificationProvider.IsEnabled = settings.EnableEmergencyNotifications; } } else @@ -184,9 +186,6 @@ namespace Tango.PPC.Common.Connection await Task.Delay(1000); await MachineOperator.UploadHardwareConfiguration(Machine.Configuration.HardwareVersion, Machine.Configuration); - - MachineOperator.EmergencyNotificationProvider.Address = settings.EmergencyComPort; - MachineOperator.EmergencyNotificationProvider.IsEnabled = settings.EnableEmergencyNotifications; } } catch (Exception ex) diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs index b495ec54d..b1bc3faad 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs @@ -132,6 +132,11 @@ namespace Tango.PPC.Common /// public String EmergencyComPort { get; set; } + /// + /// Gets or sets a value indicating whether to enable the job liquid quantity validation. + /// + public bool EnableJobLiquidQuantityValidation { get; set; } + /// /// Gets the machine service address. /// @@ -160,7 +165,8 @@ namespace Tango.PPC.Common DeploymentSlot = DeploymentSlot.TEST; EnableWatchDog = true; EnableEmergencyNotifications = true; - EmergencyComPort = "COM1"; + EmergencyComPort = "COM2"; + EnableJobLiquidQuantityValidation = true; } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml new file mode 100644 index 000000000..f3c471954 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml @@ -0,0 +1,78 @@ + + + + + CLOSE + + + + Insufficient Ink Level + + There seems to be an insufficient ink levels in one or more of the following dispensers. + The job cannot be completed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs new file mode 100644 index 000000000..9ec1eec0e --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.Integration.Operation; +using static Tango.Integration.Operation.InsufficientLiquidQuantityException; + +namespace Tango.PPC.UI.Dialogs +{ + /// + /// Interaction logic for InsufficientLiquidQuantityView.xaml + /// + public partial class InsufficientLiquidQuantityView : UserControl + { + public InsufficientLiquidQuantityView() + { + InitializeComponent(); + } + + private void IdsPackLoaded(object sender, RoutedEventArgs e) + { + Border border = sender as Border; + Grid parent = border.Parent as Grid; + IDSPackLevel packLevel = border.DataContext as IDSPackLevel; + + border.Height = ((double)packLevel.Current / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualHeight; + } + + private void Limit_Loaded(object sender, RoutedEventArgs e) + { + Rectangle rect = sender as Rectangle; + Grid parent = rect.Parent as Grid; + IDSPackLevel packLevel = rect.DataContext as IDSPackLevel; + + var top = ((double)packLevel.Required / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualHeight; + rect.Margin = new Thickness(0, 0, 0, top); + + if (packLevel.IsValid) + { + rect.Visibility = Visibility.Hidden; + } + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityViewVM.cs new file mode 100644 index 000000000..8b15d2e00 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityViewVM.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Integration.Operation; +using Tango.SharedUI; + +namespace Tango.PPC.UI.Dialogs +{ + public class InsufficientLiquidQuantityViewVM : DialogViewVM + { + public InsufficientLiquidQuantityException Exception { get; set; } + + public InsufficientLiquidQuantityViewVM(InsufficientLiquidQuantityException ex) + { + Exception = ex; + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs index 41a231932..56ec2fa7e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs @@ -13,8 +13,10 @@ using Tango.PPC.Common.Connection; using Tango.PPC.Common.Messages; using Tango.PPC.Common.Models; using Tango.PPC.Common.Navigation; +using Tango.PPC.Common.Notifications; using Tango.PPC.Common.Printing; using Tango.PPC.Jobs.Messages; +using Tango.PPC.UI.Dialogs; namespace Tango.PPC.UI.Printing { @@ -26,14 +28,16 @@ namespace Tango.PPC.UI.Printing public class DefaultPrintingManager : ExtendedObject, IPrintingManager { private IMachineProvider _machineProvider; + private INotificationProvider _notificationProvider; /// /// Initializes a new instance of the class. /// /// The machine provider. - public DefaultPrintingManager(IMachineProvider machineProvider) + public DefaultPrintingManager(IMachineProvider machineProvider, INotificationProvider notificationProvider) { _machineProvider = machineProvider; + _notificationProvider = notificationProvider; } /// @@ -52,7 +56,16 @@ namespace Tango.PPC.UI.Printing #if STUBPRINT handler = await _machineProvider.MachineOperator.PrintStub(job); #else - handler = await _machineProvider.MachineOperator.Print(job); + try + { + handler = await _machineProvider.MachineOperator.Print(job); + } + catch (InsufficientLiquidQuantityException ex) + { + LogManager.Log(ex); + await _notificationProvider.ShowDialog(new InsufficientLiquidQuantityViewVM(ex)); + throw ex; + } #endif handler.Completed += async (x, e) => 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 b32ee0339..40afab3de 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 @@ -125,6 +125,10 @@ CartridgeValidationView.xaml + + InsufficientLiquidQuantityView.xaml + + ScreenLockView.xaml @@ -202,6 +206,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -569,7 +577,7 @@ if $(ConfigurationName) == Release del *.xml - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs b/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs index 2dcb98a24..60fdc6707 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs @@ -1,8 +1,11 @@ +using Newtonsoft.Json; using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Media; namespace Tango.BL.Entities { @@ -13,6 +16,14 @@ namespace Tango.BL.Entities return (PMR.ColorLab.LiquidType)Code; } + + [NotMapped] + [JsonIgnore] + public Color LiquidTypeColor + { + get { return Core.Helpers.ColorHelper.IntegerToColor(Color); } + } + /// /// Initializes a new instance of the class. /// diff --git a/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs index c1d204bae..733f7a981 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs @@ -52,6 +52,12 @@ namespace Tango.Integration.Operation /// MachineStatuses Status { get; } + /// + /// Gets or sets a value indicating whether to enable liquid quantity validation before starting the job. + /// The validation is done using the reported . + /// + bool EnableJobLiquidQuantityValidation { get; set; } + /// /// Gets the machine embedded device status. /// diff --git a/Software/Visual_Studio/Tango.Integration/Operation/InsufficientLiquidQuantityException.cs b/Software/Visual_Studio/Tango.Integration/Operation/InsufficientLiquidQuantityException.cs new file mode 100644 index 000000000..a1c18370b --- /dev/null +++ b/Software/Visual_Studio/Tango.Integration/Operation/InsufficientLiquidQuantityException.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; + +namespace Tango.Integration.Operation +{ + public class InsufficientLiquidQuantityException : Exception + { + public class IDSPackLevel + { + public IdsPack IdsPack { get; set; } + public int Current { get; set; } + public int Required { get; set; } + + public bool IsValid + { + get { return Current >= Required; } + } + } + + public InsufficientLiquidQuantityException(String message) : base(message) + { + IdsPackLevels = new List(); + } + + public List IdsPackLevels { get; internal set; } + } +} diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index 943afa21a..867ac7ec1 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -38,6 +38,7 @@ using Tango.Core.ExtensionMethods; using Tango.ColorConversion; using Tango.Integration.Emergency; using Tango.PMR.MachineStatus; +using Newtonsoft.Json; namespace Tango.Integration.Operation { @@ -51,6 +52,7 @@ namespace Tango.Integration.Operation public const String FIRMWARE_UPGRADE_FOLDER_NAME = "UpgradePackage"; public const String FIRMWARE_UPGRADE_CONFIG_FILE_NAME = "package.cfg"; public const String JOB_DESCRIPTION_FILE_NAME = "job_segments.jdf"; + public const int MAX_DISPENSER_NANOLITER = 130000000; private bool _diagnosticsSent; private bool _eventsSent; @@ -97,6 +99,7 @@ namespace Tango.Integration.Operation FirmwareUpgradeMode = FirmwareUpgradeModes.DFU | FirmwareUpgradeModes.TFP_PACKAGE; GradientGenerationConfiguration = new DefaultGradientGenerationConfiguration(); EmergencyNotificationProvider = new UsbEmergencyNotificationProvider("COM1"); + EnableJobLiquidQuantityValidation = true; } /// @@ -247,6 +250,12 @@ namespace Tango.Integration.Operation set { _machineStatus = value; RaisePropertyChangedAuto(); } } + /// + /// Gets or sets a value indicating whether to enable liquid quantity validation before starting the job. + /// The validation is done using the reported . + /// + public bool EnableJobLiquidQuantityValidation { get; set; } + /// /// Gets or sets the firmware upgrade mode. /// @@ -1323,7 +1332,7 @@ namespace Tango.Integration.Operation }); } - private void ValidateJobLiquidQuantity(JobTicket ticket, ProcessParametersTable processParameters, Configuration configuration) + private void ValidateJobLiquidQuantity(Job job, ProcessParametersTable processParameters, Configuration configuration) { Dictionary liquidQuantities = new Dictionary(); @@ -1332,23 +1341,76 @@ namespace Tango.Integration.Operation liquidQuantities.Add(pack.PackIndex, 0); } - for (int segmentIndex = 0; segmentIndex < ticket.Segments.Count; segmentIndex++) + for (int i = 0; i < Math.Max(job.NumberOfUnits, 1); i++) + { + for (int segmentIndex = 0; segmentIndex < job.Segments.Count; segmentIndex++) + { + var segment = job.Segments[segmentIndex]; + var segment_length_cm = segment.Length * 100d; + + var stop_count = segment.BrushStops.Count - (segment.BrushStops.Count == 1 ? 0 : 1); + var stop_length_centimeters = segment_length_cm / stop_count; + + for (int stopIndex = 0; stopIndex < stop_count; stopIndex++) + { + var stop = segment.BrushStops[stopIndex]; + + foreach (var liquidVolumes in stop.LiquidVolumes) + { + liquidQuantities[liquidVolumes.IdsPack.PackIndex] += liquidVolumes.NanoliterPerCentimeter * stop_length_centimeters; + } + } + } + } + + if (MachineStatus != null) { - var segment = ticket.Segments[segmentIndex]; - var segment_length_cm = segment.Length * 100d; + var exception = new InsufficientLiquidQuantityException($"Insufficient liquids level."); - var stop_count = segment.BrushStops.Count - (segment.BrushStops.Count == 1 ? 0 : 1); - var stop_length_centimeters = segment_length_cm / stop_count; + bool shouldThrow = false; - for (int stopIndex = 0; stopIndex < stop_count; stopIndex++) + foreach (var liquidQuantity in liquidQuantities) { - var stop = segment.BrushStops[stopIndex]; + int index = liquidQuantity.Key; + var packLevel = MachineStatus.IDSPacksLevels.SingleOrDefault(x => x.Index == index); + var idsPack = configuration.NoneEmptyIdsPacks.SingleOrDefault(x => x.PackIndex == index); + + if (packLevel != null) + { + var idsLevel = new InsufficientLiquidQuantityException.IDSPackLevel() + { + IdsPack = idsPack, + Current = packLevel.DispenserLevel, + Required = (int)liquidQuantities[index] + }; - foreach (var dispenser in stop.Dispensers) + if (liquidQuantities[index] > packLevel.DispenserLevel) + { + shouldThrow = true; + } + + exception.IdsPackLevels.Add(idsLevel); + } + else { - liquidQuantities[dispenser.Index] += dispenser.NanoliterPerCentimeter * stop_length_centimeters; + LogManager.Log($"Could not validate required liquid quantity for job. Missing IDS Pack level at index {index}.", LogCategory.Warning); } } + + + if (shouldThrow) + { + throw LogManager.Log(exception, JsonConvert.SerializeObject(exception.IdsPackLevels.Select(x => new + { + Liquid = x.IdsPack.LiquidType.Name, + x.Required, + x.Current + }).ToList())); + } + } + else + { + LogManager.Log("Could not validate required liquid quantity for job. No machine status received", LogCategory.Warning); } } @@ -1525,6 +1587,11 @@ namespace Tango.Integration.Operation job.NumberOfUnits = 1; } + if (EnableJobLiquidQuantityValidation) + { + ValidateJobLiquidQuantity(job, processParameters, job.Machine.Configuration); + } + var originalJob = job; var clonedJob = job.Clone(); clonedJob.Guid = job.Guid; @@ -1697,8 +1764,6 @@ namespace Tango.Integration.Operation ticket.Segments.AddRange(segs); } - ValidateJobLiquidQuantity(ticket, processParameters, job.Machine.Configuration); - request.JobTicket = ticket.Clone(); request.JobTicket.UploadStrategy = JobUploadStrategy; diff --git a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj index 6bd13ae6d..6b8d4ee8d 100644 --- a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj +++ b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj @@ -104,6 +104,7 @@ + @@ -194,7 +195,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml index 51cc1d3ec..02c1b4eba 100644 --- a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml @@ -205,10 +205,10 @@ - - - - + + + + -- cgit v1.3.1 From cb769a96ca8841ced9cff6ed4a6c99939e139610 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 24 Sep 2019 12:07:14 +0300 Subject: Implemented auto process selection on Research module. --- ...Foundation.ProcessTools.TemplateEditor__2_.vsix | Bin 0 -> 3347595 bytes .../DeveloperModuleSettings.cs | 2 + .../ViewModels/MainViewVM.cs | 60 ++++++++++++++++++++- .../Views/JobView.xaml | 60 ++++++++++++--------- .../Views/JobView.xaml.cs | 32 ++++++----- .../Tango.ColorConversion/DefaultColorConverter.cs | 11 ++-- .../Tango.ColorConversion/IColorConverter.cs | 1 + 7 files changed, 123 insertions(+), 43 deletions(-) create mode 100644 Software/Visual_Studio/Installers/VS Extensions/Microsoft.TeamFoundation.ProcessTools.TemplateEditor__2_.vsix (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer') diff --git a/Software/Visual_Studio/Installers/VS Extensions/Microsoft.TeamFoundation.ProcessTools.TemplateEditor__2_.vsix b/Software/Visual_Studio/Installers/VS Extensions/Microsoft.TeamFoundation.ProcessTools.TemplateEditor__2_.vsix new file mode 100644 index 000000000..6e752a2ae Binary files /dev/null and b/Software/Visual_Studio/Installers/VS Extensions/Microsoft.TeamFoundation.ProcessTools.TemplateEditor__2_.vsix differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs index 3d0ee2461..ce2c02fe7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs @@ -44,6 +44,8 @@ namespace Tango.MachineStudio.Developer set { _usePreferredLiquidVolumeIndex = value; RaisePropertyChangedAuto(); } } + public bool AutoProcessSelection { get; set; } + public DeveloperModuleSettings() { ProcessParametersIndices = new List(); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index c2fad9d87..f5313d4cd 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -552,14 +552,35 @@ namespace Tango.MachineStudio.Developer.ViewModels set { _enableColorConversion = value; RaisePropertyChangedAuto(); } } + /// + /// Gets or sets the authentication provider. + /// public IAuthenticationProvider AuthenticationProvider { get; set; } + /// + /// Gets or sets the module settings. + /// public DeveloperModuleSettings Settings { get { return _settings; } set { _settings = value; RaisePropertyChangedAuto(); } } + private bool _autoProcessSelection; + /// + /// Gets or sets a value indicating whether [automatic process selection]. + /// + public bool AutoProcessSelection + { + get { return _autoProcessSelection; } + set + { + _autoProcessSelection = value; + RaisePropertyChangedAuto(); + Settings.AutoProcessSelection = _autoProcessSelection; + } + } + #endregion #region Commands @@ -864,6 +885,23 @@ namespace Tango.MachineStudio.Developer.ViewModels catch { } } + if (AutoProcessSelection) + { + try + { + var recommendedProcess = _converter.GetRecommendedProcessParameters(ActiveJob, RmlProcessParametersTableGroup); + + if (recommendedProcess != null && recommendedProcess != SelectedProcessParametersTable) + { + SelectedProcessParametersTable = recommendedProcess; + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error resolving recommended process parameters."); + } + } + Thread.Sleep(500); } } @@ -1338,6 +1376,26 @@ namespace Tango.MachineStudio.Developer.ViewModels stop.SetLiquidVolumes(SelectedMachine.Configuration, SelectedRML, SelectedProcessParametersTable); } + if (AutoProcessSelection) + { + LogManager.Log("Auto process parameters selection enabled. Trying to resolve the recommended process parameters..."); + try + { + var recommendedProcess = _converter.GetRecommendedProcessParameters(ActiveJob, RmlProcessParametersTableGroup); + + if (recommendedProcess != null && recommendedProcess != SelectedProcessParametersTable) + { + SelectedProcessParametersTable = recommendedProcess; + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error resolving recommended process parameters."); + _notification.ShowError("An error occurred while trying to resolve the recommended process parameters.Please try to disable the auto selection."); + return; + } + } + JobEvents.Clear(); IsJobFailed = false; IsJobCanceled = false; @@ -1448,7 +1506,7 @@ namespace Tango.MachineStudio.Developer.ViewModels } catch (InsufficientLiquidQuantityException ex) { - _notification.ShowModalDialog(new InsufficientLiquidQuantityViewVM(ex), (x) => + _notification.ShowModalDialog(new InsufficientLiquidQuantityViewVM(ex), (x) => { MachineOperator.EnableJobLiquidQuantityValidation = false; diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml index 742798ce4..3bda86036 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml @@ -1431,20 +1431,15 @@ - + - - + @@ -1526,7 +1526,8 @@ - + + @@ -1559,6 +1560,7 @@ + @@ -1566,24 +1568,32 @@ - - - - + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs index 18dc795bd..28e488aae 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs @@ -251,7 +251,7 @@ namespace Tango.MachineStudio.Developer.Views private void BrushPicker_ColorChanged(object sender, BrushPicker.ColorChangedEventArgs e) { - + } private void ColorCanvas_SelectedColorChanged(object sender, RoutedPropertyChangedEventArgs e) @@ -284,7 +284,7 @@ namespace Tango.MachineStudio.Developer.Views private void listBoxSegments_PreviewMouseDown(object sender, MouseButtonEventArgs e) { - + } private void listBoxSegments_MouseEnter(object sender, MouseEventArgs e) @@ -295,22 +295,26 @@ namespace Tango.MachineStudio.Developer.Views private void OnBrushStopFieldValueChanged(object sender, RoutedPropertyChangedEventArgs e) { - BrushStop stop = null; - var dataContext = (sender as FrameworkElement).DataContext; - - if (dataContext != null) + try { - if (dataContext is BrushStop) - { - stop = dataContext as BrushStop; - } - else + BrushStop stop = null; + var dataContext = (sender as FrameworkElement).DataContext; + + if (dataContext != null) { - stop = (dataContext as LiquidVolume).BrushStop; - } + if (dataContext is BrushStop) + { + stop = dataContext as BrushStop; + } + else + { + stop = (dataContext as LiquidVolume).BrushStop; + } - _vm.OnBrushStopFieldValueChanged(stop); + _vm.OnBrushStopFieldValueChanged(stop); + } } + catch { } } private void OnBrushStopMouseDown(object sender, MouseButtonEventArgs e) diff --git a/Software/Visual_Studio/Tango.ColorConversion/DefaultColorConverter.cs b/Software/Visual_Studio/Tango.ColorConversion/DefaultColorConverter.cs index 9adbd59c3..46792f311 100644 --- a/Software/Visual_Studio/Tango.ColorConversion/DefaultColorConverter.cs +++ b/Software/Visual_Studio/Tango.ColorConversion/DefaultColorConverter.cs @@ -127,7 +127,7 @@ namespace Tango.ColorConversion conversionInput.ForwardData = ByteString.CopyFrom(rml.Cct.Data); - foreach (var processTable in rml.ProcessParametersTablesGroups.First(x => x.Active).ProcessParametersTables) + foreach (var processTable in rml.GetActiveProcessGroup().ProcessParametersTables) { conversionInput.ProcessRanges.Add(new ProcessRange() { @@ -223,6 +223,11 @@ namespace Tango.ColorConversion } public ProcessParametersTable GetRecommendedProcessParameters(Job job) + { + return GetRecommendedProcessParameters(job, job.Rml.GetActiveProcessGroup()); + } + + public ProcessParametersTable GetRecommendedProcessParameters(Job job, ProcessParametersTablesGroup group) { var stops = job.Segments.SelectMany(x => x.BrushStops).ToList(); @@ -257,11 +262,11 @@ namespace Tango.ColorConversion index = Math.Max(max_standard, max_catalog); } - var processParameters = job.Rml.GetActiveProcessGroup().ProcessParametersTables.FirstOrDefault(x => x.TableIndex == index); + var processParameters = group.ProcessParametersTables.FirstOrDefault(x => x.TableIndex == index); if (processParameters == null) { - processParameters = job.Rml.GetActiveProcessGroup().ProcessParametersTables.FirstOrDefault(); + processParameters = group.ProcessParametersTables.FirstOrDefault(); } return processParameters; diff --git a/Software/Visual_Studio/Tango.ColorConversion/IColorConverter.cs b/Software/Visual_Studio/Tango.ColorConversion/IColorConverter.cs index b6b569034..64615f4ae 100644 --- a/Software/Visual_Studio/Tango.ColorConversion/IColorConverter.cs +++ b/Software/Visual_Studio/Tango.ColorConversion/IColorConverter.cs @@ -20,5 +20,6 @@ namespace Tango.ColorConversion ConversionOutput Convert(Job job, Color color, bool generateHive); bool IsOutOfGamut(BrushStop stop); ProcessParametersTable GetRecommendedProcessParameters(Job job); + ProcessParametersTable GetRecommendedProcessParameters(Job job, ProcessParametersTablesGroup group); } } -- cgit v1.3.1 From f3d5875915904417ac5dddc2e16add4d81b9e393 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 24 Sep 2019 18:25:07 +0300 Subject: Added version to machine studio window title. Fixed LAB support in PPC. --- .../ViewModels/MainViewVM.cs | 2 ++ .../Tango.MachineStudio.UI/MainWindow.xaml.cs | 2 ++ .../Dialogs/BasicColorCorrectionView.xaml | 37 ++++++++++++++++++---- .../Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs | 15 ++++++++- 4 files changed, 49 insertions(+), 7 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index f5313d4cd..c8f0b4681 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -816,6 +816,8 @@ namespace Tango.MachineStudio.Developer.ViewModels { Settings = SettingsManager.Default.GetOrCreate(); + AutoProcessSelection = Settings.AutoProcessSelection; + SelectedJobs = new ObservableCollection(); JobEvents = new ObservableCollection(); diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs index 4c5e2b9a6..d0eec65e2 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs @@ -86,6 +86,8 @@ namespace Tango.MachineStudio.UI private void MainWindow_ContentRendered(object sender, EventArgs e) { WindowState = WindowState.Maximized; + + Title = "MACHINE STUDIO " + TangoIOC.Default.GetInstance().Version.ToString(3); } private void MainWindow_SizeChanged(object sender, SizeChangedEventArgs e) diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml index 4fcccc9e5..4c100c2fc 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml @@ -52,9 +52,9 @@ - , - , - + , + , + @@ -110,9 +110,34 @@ - , - , - + + + + , + , + + + + + + + , + , + 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 a99e45eb3..b5fbbe2ea 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 @@ -897,7 +897,20 @@ namespace Tango.PPC.Jobs.ViewModels if (vm.Result == BasicColorCorrectionViewVM.ColorCorrectionDialogResult.Confirmed) { LogManager.Log($"Color suggestion selected: {vm.SelectedSuggestion.Color.ToString()}."); - brushStop.Color = vm.SelectedSuggestion.Color; + + if (brushStop.BrushColorSpace == BL.Enumerations.ColorSpaces.RGB) + { + brushStop.Red = vm.SelectedSuggestion.Coordinates.Red; + brushStop.Green = vm.SelectedSuggestion.Coordinates.Green; + brushStop.Blue = vm.SelectedSuggestion.Coordinates.Blue; + } + else if (brushStop.BrushColorSpace == BL.Enumerations.ColorSpaces.LAB) + { + brushStop.L = vm.SelectedSuggestion.Coordinates.L; + brushStop.A = vm.SelectedSuggestion.Coordinates.A; + brushStop.B = vm.SelectedSuggestion.Coordinates.B; + } + brushStop.Corrected = true; brushStop.IsOutOfGamut = false; brushStop.OutOfGamutChecked = true; -- cgit v1.3.1 From e6febb2cda232a2c89467690d9e1fbb82423618a Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 25 Sep 2019 15:20:42 +0300 Subject: Implemented MultiGraph data series colors from configuration. Added dispensers & mid-tanks diagnostics monitors. --- .../Messages/Diagnostics/DiagnosticsMonitors.proto | 6 + .../PMR/Messages/Hardware/HardwareBlower.proto | 1 + .../ViewModels/MainViewVM.cs | 2 +- .../Editors/MultiGraphElementEditor.xaml | 27 ++ .../ViewModels/MachineTechViewVM.cs | 70 +++- .../DefaultStudioApplicationManager.cs | 3 +- .../Tango.BL/Enumerations/TechMonitors.cs | 12 + .../Tango.Emulations/Emulators/MachineEmulator.cs | 10 + .../Tango.PMR/Diagnostics/CartridgeTagContent.cs | 382 +++++++++++++++------ .../Tango.PMR/Diagnostics/DiagnosticsMonitors.cs | 57 ++- .../Tango.PMR/Hardware/HardwareBlower.cs | 3 + .../Utilities/Tango.PMRGenerator.CLI/App.config | 4 + .../Utilities/Tango.PMRGenerator.CLI/Program.cs | 18 +- .../Tango.PMRGenerator.CLI.csproj | 5 +- .../Tango.PMRGenerator.CLI/packages.config | 1 + 15 files changed, 485 insertions(+), 116 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer') diff --git a/Software/PMR/Messages/Diagnostics/DiagnosticsMonitors.proto b/Software/PMR/Messages/Diagnostics/DiagnosticsMonitors.proto index 781cbb650..82d8d3192 100644 --- a/Software/PMR/Messages/Diagnostics/DiagnosticsMonitors.proto +++ b/Software/PMR/Messages/Diagnostics/DiagnosticsMonitors.proto @@ -207,4 +207,10 @@ message DiagnosticsMonitors //Mixer 1 Heater Current (Min = 0, Max = 100, PPF = 1) repeated double Mixer1HeaterCurrent = 63; + //Dispensers Ink Level (Min = 0, Max = 130000000, PPF = 1) Channel Count = 8 + repeated DoubleArray DispensersInkLevel = 64; + + //Mid Tanks Ink Level (Min = 0, Max = 2, PPF = 1) Channel Count = 8 + repeated DoubleArray MidTanksInkLevel = 65; + } diff --git a/Software/PMR/Messages/Hardware/HardwareBlower.proto b/Software/PMR/Messages/Hardware/HardwareBlower.proto index f628fea36..0d5aadac1 100644 --- a/Software/PMR/Messages/Hardware/HardwareBlower.proto +++ b/Software/PMR/Messages/Hardware/HardwareBlower.proto @@ -22,6 +22,7 @@ message HardwareBlower bool Enabled = 2; + //Voltage Description double Voltage = 3; double HeatingVoltage = 4; diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index c8f0b4681..2d04866d8 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -887,7 +887,7 @@ namespace Tango.MachineStudio.Developer.ViewModels catch { } } - if (AutoProcessSelection) + if (AutoProcessSelection && IsJobVisible && IsVisible && ActiveJob != null && ActiveJob.Segments != null && !_rml_has_no_cct && !_disable_gamut_check) { try { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MultiGraphElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MultiGraphElementEditor.xaml index 9b9334355..6011102a2 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MultiGraphElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MultiGraphElementEditor.xaml @@ -34,6 +34,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs index 8eb792f0d..f6b8a35df 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs @@ -39,6 +39,8 @@ using RealTimeGraphX.DataPoints; using Tango.MachineStudio.Technician.Views; using RealTimeGraphX.WPF; using Tango.Core.ExtensionMethods; +using System.Diagnostics; +using Tango.BL.Builders; namespace Tango.MachineStudio.Technician.ViewModels { @@ -49,6 +51,13 @@ namespace Tango.MachineStudio.Technician.ViewModels /// public class MachineTechViewVM : StudioViewModel { + private class PackColor + { + public int Index { get; set; } + public Color Color { get; set; } + public String Name { get; set; } + } + private List _diagnoticsMonitorsDataProperties; private IDiagnosticsFrameProvider _diagnosticsFrameProvider; private Dictionary _singleControllers; @@ -68,6 +77,8 @@ namespace Tango.MachineStudio.Technician.ViewModels private DateTime _start_time = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0); private DateTime _last_time = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0); + private Machine _machine; + private List _packsColors; #region Properties @@ -374,7 +385,7 @@ namespace Tango.MachineStudio.Technician.ViewModels /// /// The sender. /// The machine. - private void ApplicationManager_ConnectedMachineChanged(object sender, IExternalBridgeClient machine) + private async void ApplicationManager_ConnectedMachineChanged(object sender, IExternalBridgeClient machine) { MachineOperator = machine; @@ -384,6 +395,45 @@ namespace Tango.MachineStudio.Technician.ViewModels } ClearAllGraphs(); + + if (machine != null) + { + try + { + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + _machine = await new MachineBuilder(db).Set(machine.Machine.Guid).WithConfiguration().BuildAsync(); + + _packsColors = new List(); + + foreach (var pack in _machine.Configuration.NoneEmptyIdsPacks.OrderBy(x => x.PackIndex).ToList()) + { + PackColor pc = new PackColor(); + pc.Index = pack.PackIndex; + pc.Name = pack.LiquidType.Name; + + if (pack.LiquidType.LiquidTypeColor == Colors.Black) + { + pc.Color = Colors.Gray; + } + else if (pack.LiquidType.LiquidTypeColor == Colors.Transparent) + { + pc.Color = Colors.White; + } + else + { + pc.Color = pack.LiquidType.LiquidTypeColor; + } + + _packsColors.Add(pc); + } + } + } + catch (Exception ex) + { + LogManager.Log(ex, LogCategory.Warning, "Error loading the connected machine details from db."); + } + } } /// @@ -543,6 +593,22 @@ namespace Tango.MachineStudio.Technician.ViewModels timesMat.Add(times); } + try + { + if (_packsColors != null) + { + foreach (var pack in _packsColors) + { + controller.DataSeriesCollection[pack.Index].Stroke = pack.Color; + controller.DataSeriesCollection[pack.Index].Name = pack.Name; + } + } + } + catch (Exception ex) + { + Debug.WriteLine($"Error assigning multi graph colors.\n{ex.ToString()}"); + } + controller.PushData(timesMat, dPoints); } @@ -2490,4 +2556,4 @@ namespace Tango.MachineStudio.Technician.ViewModels #endregion } -} +} \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs index 1be62565b..0235f8cca 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs @@ -26,6 +26,7 @@ using Tango.MachineStudio.Common.Notifications; using Tango.MachineStudio.UI.Views; using Tango.Integration.Operation; using Tango.MachineStudio.UI.Windows; +using Tango.BL.Builders; namespace Tango.MachineStudio.UI.StudioApplication { @@ -375,8 +376,8 @@ namespace Tango.MachineStudio.UI.StudioApplication throw new NullReferenceException($"The specified machine '{connectedMachine.SerialNumber}' could not be found on the database."); } + connectedMachine.SetMachine(Machine); ConnectedMachine = connectedMachine; - ConnectedMachine.SetMachine(Machine); var settings = SettingsManager.Default.GetOrCreate(); ConnectedMachine.JobUploadStrategy = settings.JobUploadStrategy; } diff --git a/Software/Visual_Studio/Tango.BL/Enumerations/TechMonitors.cs b/Software/Visual_Studio/Tango.BL/Enumerations/TechMonitors.cs index 1f3aa6a97..a017c18d1 100644 --- a/Software/Visual_Studio/Tango.BL/Enumerations/TechMonitors.cs +++ b/Software/Visual_Studio/Tango.BL/Enumerations/TechMonitors.cs @@ -151,6 +151,12 @@ namespace Tango.BL.Enumerations [Description("Dispensers Angular Encoders")] DispensersAngularEncoders = 22, + /// + /// (Dispensers Ink Level) + /// + [Description("Dispensers Ink Level")] + DispensersInkLevel = 100, + /// /// (Dispensers Linear Positions) /// @@ -349,6 +355,12 @@ namespace Tango.BL.Enumerations [Description("Mid Tank 8 Level")] MidTank8Level = 55, + /// + /// (Mid Tanks Ink Level) + /// + [Description("Mid Tanks Ink Level")] + MidTanksInkLevel = 101, + /// /// (Mixer 1 Heater Current) /// diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index cfd9a59f5..64071a554 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -466,6 +466,16 @@ namespace Tango.Emulations.Emulators monitors.Dancer3Angle.Add(y); } + for (int i = 0; i < MachineStatus.IDSPacksLevels.Count; i++) + { + var dispensers = new DoubleArray(); + dispensers.Data.Add(MachineStatus.IDSPacksLevels[i].DispenserLevel); + monitors.DispensersInkLevel.Add(dispensers); + + var midTanks = new DoubleArray(); + midTanks.Data.Add(MachineStatus.IDSPacksLevels[i].MidTankLevel); + monitors.MidTanksInkLevel.Add(midTanks); + } var dispenserFrequencies = new RepeatedField(); diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/CartridgeTagContent.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/CartridgeTagContent.cs index e2327b3a2..4880e278e 100644 --- a/Software/Visual_Studio/Tango.PMR/Diagnostics/CartridgeTagContent.cs +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/CartridgeTagContent.cs @@ -23,25 +23,27 @@ namespace Tango.PMR.Diagnostics { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "ChlDYXJ0cmlkZ2VUYWdDb250ZW50LnByb3RvEhVUYW5nby5QTVIuRGlhZ25v", - "c3RpY3MixQQKE0NhcnRyaWRnZVRhZ0NvbnRlbnQSEAoIVW5pcXVlSWQYASAB", - "KA0SFAoMU2VyaWFsTnVtYmVyGAIgASgJEhEKCUZhY3RvcnlJZBgDIAEoCRIX", - "Cg9GaWxsaW5nU3lzdGVtSWQYBCABKAUSEQoJQ29sb3JOYW1lGAUgASgJEhUK", - "DUNvbG9yQ2F0ZWdvcnkYBiABKAUSGQoRQ29sb3JUeXBlUmV2aXNpb24YByAB", - "KAUSFQoNQ2FydHJpZGdlU2l6ZRgIIAEoBRIXCg9GaWxsZWRJbmtWb2x1bWUY", - "CSABKAUSEwoLSW5rQmF0Y2hOdW0YCiABKAkSEgoKSW5rTUZHRGF0ZRgLIAEo", - "CRISCgpJbmtFT0xEYXRlGAwgASgJEhwKFENhcnRyaWRnZUZpbGxpbmdEYXRl", - "GA0gASgJEhcKD1dhc3RlRmlsbGVkRGF0ZRgOIAEoCRIVCg1QbHVnSW5Db3Vu", - "dGVyGA8gASgFEg8KB0lua2ZpbGwYECABKAgSDwoHSW5rVXNlZBgRIAEoCBIQ", - "CghJbmtFbXB0eRgSIAEoCBISCgpXYXN0ZUVtcHR5GBMgASgIEhQKDFdhc3Rl", - "RmlsbGluZxgUIAEoCBIRCglXYXN0ZUZ1bGwYFSABKAgSDwoHQmxvY2tlZBgW", - "IAEoCBIMCgRGYWlsGBcgASgIEhQKDFdhc3RlQ291bnRlchgYIAEoBRIYChBN", - "YWNoaW5lSWRJbmtVc2VkGBkgASgJEhoKEk1hY2hpbmVJZFdhc3RlVXNlZBga", - "IAEoCUIhCh9jb20udHdpbmUudGFuZ28ucG1yLmRpYWdub3N0aWNzYgZwcm90", - "bzM=")); + "c3RpY3MitAUKE0NhcnRyaWRnZVRhZ0NvbnRlbnQSEAoIVW5pcXVlSWQYASAB", + "KAkSFAoMU2VyaWFsTnVtYmVyGAIgASgJEhEKCUZhY3RvcnlJZBgDIAEoBRIX", + "Cg9GaWxsaW5nU3lzdGVtSWQYBCABKAUSEQoJV29ya09yZGVyGAUgASgJEhEK", + "CUNvbG9yTmFtZRgGIAEoCRIVCg1Db2xvckNhdGVnb3J5GAcgASgFEhkKEUNv", + "bG9yVHlwZVJldmlzaW9uGAggASgFEhUKDUNhcnRyaWRnZVNpemUYCSABKAUS", + "FwoPRmlsbGVkSW5rVm9sdW1lGAogASgFEhMKC0lua0JhdGNoTnVtGAsgASgJ", + "EhIKCklua01GR0RhdGUYDCABKAkSEgoKSW5rRU9MRGF0ZRgNIAEoCRIcChRD", + "YXJ0cmlkZ2VGaWxsaW5nRGF0ZRgOIAEoCRIXCg9XYXN0ZUZpbGxlZERhdGUY", + "DyABKAkSFQoNUGx1Z0luQ291bnRlchgQIAEoBRIMCgRNaXNjGBEgASgNEg8K", + "B0lua2ZpbGwYEiABKAgSDwoHSW5rVXNlZBgTIAEoCBIQCghJbmtFbXB0eRgU", + "IAEoCBISCgpXYXN0ZUVtcHR5GBUgASgIEhQKDFdhc3RlRmlsbGluZxgWIAEo", + "CBIRCglXYXN0ZUZ1bGwYFyABKAgSDwoHQmxvY2tlZBgYIAEoCBIMCgRGYWls", + "GBkgASgIEhQKDFdhc3RlQ291bnRlchgaIAEoBRIYChBNYWNoaW5lSWRJbmtV", + "c2VkGBsgASgJEhoKEk1hY2hpbmVJZFdhc3RlVXNlZBgcIAEoCRIPCgdDb3Vu", + "dGVyGB0gASgNEhAKCFRhZ1ZhbGlkGB4gASgIEhEKCUhhc2hWYWx1ZRgfIAEo", + "CRIWCg5DaGVja3N1bV9DUkMxNhggIAEoDUIhCh9jb20udHdpbmUudGFuZ28u", + "cG1yLmRpYWdub3N0aWNzYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.CartridgeTagContent), global::Tango.PMR.Diagnostics.CartridgeTagContent.Parser, new[]{ "UniqueId", "SerialNumber", "FactoryId", "FillingSystemId", "ColorName", "ColorCategory", "ColorTypeRevision", "CartridgeSize", "FilledInkVolume", "InkBatchNum", "InkMFGDate", "InkEOLDate", "CartridgeFillingDate", "WasteFilledDate", "PlugInCounter", "Inkfill", "InkUsed", "InkEmpty", "WasteEmpty", "WasteFilling", "WasteFull", "Blocked", "Fail", "WasteCounter", "MachineIdInkUsed", "MachineIdWasteUsed" }, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.CartridgeTagContent), global::Tango.PMR.Diagnostics.CartridgeTagContent.Parser, new[]{ "UniqueId", "SerialNumber", "FactoryId", "FillingSystemId", "WorkOrder", "ColorName", "ColorCategory", "ColorTypeRevision", "CartridgeSize", "FilledInkVolume", "InkBatchNum", "InkMFGDate", "InkEOLDate", "CartridgeFillingDate", "WasteFilledDate", "PlugInCounter", "Misc", "Inkfill", "InkUsed", "InkEmpty", "WasteEmpty", "WasteFilling", "WasteFull", "Blocked", "Fail", "WasteCounter", "MachineIdInkUsed", "MachineIdWasteUsed", "Counter", "TagValid", "HashValue", "ChecksumCRC16" }, null, null, null) })); } #endregion @@ -76,6 +78,7 @@ namespace Tango.PMR.Diagnostics { serialNumber_ = other.serialNumber_; factoryId_ = other.factoryId_; fillingSystemId_ = other.fillingSystemId_; + workOrder_ = other.workOrder_; colorName_ = other.colorName_; colorCategory_ = other.colorCategory_; colorTypeRevision_ = other.colorTypeRevision_; @@ -87,6 +90,7 @@ namespace Tango.PMR.Diagnostics { cartridgeFillingDate_ = other.cartridgeFillingDate_; wasteFilledDate_ = other.wasteFilledDate_; plugInCounter_ = other.plugInCounter_; + misc_ = other.misc_; inkfill_ = other.inkfill_; inkUsed_ = other.inkUsed_; inkEmpty_ = other.inkEmpty_; @@ -98,6 +102,10 @@ namespace Tango.PMR.Diagnostics { wasteCounter_ = other.wasteCounter_; machineIdInkUsed_ = other.machineIdInkUsed_; machineIdWasteUsed_ = other.machineIdWasteUsed_; + counter_ = other.counter_; + tagValid_ = other.tagValid_; + hashValue_ = other.hashValue_; + checksumCRC16_ = other.checksumCRC16_; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -107,12 +115,12 @@ namespace Tango.PMR.Diagnostics { /// Field number for the "UniqueId" field. public const int UniqueIdFieldNumber = 1; - private uint uniqueId_; + private string uniqueId_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint UniqueId { + public string UniqueId { get { return uniqueId_; } set { - uniqueId_ = value; + uniqueId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } @@ -129,12 +137,12 @@ namespace Tango.PMR.Diagnostics { /// Field number for the "FactoryId" field. public const int FactoryIdFieldNumber = 3; - private string factoryId_ = ""; + private int factoryId_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string FactoryId { + public int FactoryId { get { return factoryId_; } set { - factoryId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + factoryId_ = value; } } @@ -149,8 +157,19 @@ namespace Tango.PMR.Diagnostics { } } + /// Field number for the "WorkOrder" field. + public const int WorkOrderFieldNumber = 5; + private string workOrder_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string WorkOrder { + get { return workOrder_; } + set { + workOrder_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Field number for the "ColorName" field. - public const int ColorNameFieldNumber = 5; + public const int ColorNameFieldNumber = 6; private string colorName_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string ColorName { @@ -161,7 +180,7 @@ namespace Tango.PMR.Diagnostics { } /// Field number for the "ColorCategory" field. - public const int ColorCategoryFieldNumber = 6; + public const int ColorCategoryFieldNumber = 7; private int colorCategory_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int ColorCategory { @@ -172,7 +191,7 @@ namespace Tango.PMR.Diagnostics { } /// Field number for the "ColorTypeRevision" field. - public const int ColorTypeRevisionFieldNumber = 7; + public const int ColorTypeRevisionFieldNumber = 8; private int colorTypeRevision_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int ColorTypeRevision { @@ -183,7 +202,7 @@ namespace Tango.PMR.Diagnostics { } /// Field number for the "CartridgeSize" field. - public const int CartridgeSizeFieldNumber = 8; + public const int CartridgeSizeFieldNumber = 9; private int cartridgeSize_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CartridgeSize { @@ -194,7 +213,7 @@ namespace Tango.PMR.Diagnostics { } /// Field number for the "FilledInkVolume" field. - public const int FilledInkVolumeFieldNumber = 9; + public const int FilledInkVolumeFieldNumber = 10; private int filledInkVolume_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int FilledInkVolume { @@ -205,7 +224,7 @@ namespace Tango.PMR.Diagnostics { } /// Field number for the "InkBatchNum" field. - public const int InkBatchNumFieldNumber = 10; + public const int InkBatchNumFieldNumber = 11; private string inkBatchNum_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string InkBatchNum { @@ -216,7 +235,7 @@ namespace Tango.PMR.Diagnostics { } /// Field number for the "InkMFGDate" field. - public const int InkMFGDateFieldNumber = 11; + public const int InkMFGDateFieldNumber = 12; private string inkMFGDate_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string InkMFGDate { @@ -227,7 +246,7 @@ namespace Tango.PMR.Diagnostics { } /// Field number for the "InkEOLDate" field. - public const int InkEOLDateFieldNumber = 12; + public const int InkEOLDateFieldNumber = 13; private string inkEOLDate_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string InkEOLDate { @@ -238,7 +257,7 @@ namespace Tango.PMR.Diagnostics { } /// Field number for the "CartridgeFillingDate" field. - public const int CartridgeFillingDateFieldNumber = 13; + public const int CartridgeFillingDateFieldNumber = 14; private string cartridgeFillingDate_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string CartridgeFillingDate { @@ -249,7 +268,7 @@ namespace Tango.PMR.Diagnostics { } /// Field number for the "WasteFilledDate" field. - public const int WasteFilledDateFieldNumber = 14; + public const int WasteFilledDateFieldNumber = 15; private string wasteFilledDate_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string WasteFilledDate { @@ -260,7 +279,7 @@ namespace Tango.PMR.Diagnostics { } /// Field number for the "PlugInCounter" field. - public const int PlugInCounterFieldNumber = 15; + public const int PlugInCounterFieldNumber = 16; private int plugInCounter_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int PlugInCounter { @@ -270,8 +289,19 @@ namespace Tango.PMR.Diagnostics { } } + /// Field number for the "Misc" field. + public const int MiscFieldNumber = 17; + private uint misc_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public uint Misc { + get { return misc_; } + set { + misc_ = value; + } + } + /// Field number for the "Inkfill" field. - public const int InkfillFieldNumber = 16; + public const int InkfillFieldNumber = 18; private bool inkfill_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Inkfill { @@ -282,7 +312,7 @@ namespace Tango.PMR.Diagnostics { } /// Field number for the "InkUsed" field. - public const int InkUsedFieldNumber = 17; + public const int InkUsedFieldNumber = 19; private bool inkUsed_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool InkUsed { @@ -293,7 +323,7 @@ namespace Tango.PMR.Diagnostics { } /// Field number for the "InkEmpty" field. - public const int InkEmptyFieldNumber = 18; + public const int InkEmptyFieldNumber = 20; private bool inkEmpty_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool InkEmpty { @@ -304,7 +334,7 @@ namespace Tango.PMR.Diagnostics { } /// Field number for the "WasteEmpty" field. - public const int WasteEmptyFieldNumber = 19; + public const int WasteEmptyFieldNumber = 21; private bool wasteEmpty_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool WasteEmpty { @@ -315,7 +345,7 @@ namespace Tango.PMR.Diagnostics { } /// Field number for the "WasteFilling" field. - public const int WasteFillingFieldNumber = 20; + public const int WasteFillingFieldNumber = 22; private bool wasteFilling_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool WasteFilling { @@ -326,7 +356,7 @@ namespace Tango.PMR.Diagnostics { } /// Field number for the "WasteFull" field. - public const int WasteFullFieldNumber = 21; + public const int WasteFullFieldNumber = 23; private bool wasteFull_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool WasteFull { @@ -337,7 +367,7 @@ namespace Tango.PMR.Diagnostics { } /// Field number for the "Blocked" field. - public const int BlockedFieldNumber = 22; + public const int BlockedFieldNumber = 24; private bool blocked_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Blocked { @@ -348,7 +378,7 @@ namespace Tango.PMR.Diagnostics { } /// Field number for the "Fail" field. - public const int FailFieldNumber = 23; + public const int FailFieldNumber = 25; private bool fail_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Fail { @@ -359,7 +389,7 @@ namespace Tango.PMR.Diagnostics { } /// Field number for the "WasteCounter" field. - public const int WasteCounterFieldNumber = 24; + public const int WasteCounterFieldNumber = 26; private int wasteCounter_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int WasteCounter { @@ -370,7 +400,7 @@ namespace Tango.PMR.Diagnostics { } /// Field number for the "MachineIdInkUsed" field. - public const int MachineIdInkUsedFieldNumber = 25; + public const int MachineIdInkUsedFieldNumber = 27; private string machineIdInkUsed_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string MachineIdInkUsed { @@ -381,7 +411,7 @@ namespace Tango.PMR.Diagnostics { } /// Field number for the "MachineIdWasteUsed" field. - public const int MachineIdWasteUsedFieldNumber = 26; + public const int MachineIdWasteUsedFieldNumber = 28; private string machineIdWasteUsed_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string MachineIdWasteUsed { @@ -391,6 +421,50 @@ namespace Tango.PMR.Diagnostics { } } + /// Field number for the "Counter" field. + public const int CounterFieldNumber = 29; + private uint counter_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public uint Counter { + get { return counter_; } + set { + counter_ = value; + } + } + + /// Field number for the "TagValid" field. + public const int TagValidFieldNumber = 30; + private bool tagValid_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool TagValid { + get { return tagValid_; } + set { + tagValid_ = value; + } + } + + /// Field number for the "HashValue" field. + public const int HashValueFieldNumber = 31; + private string hashValue_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string HashValue { + get { return hashValue_; } + set { + hashValue_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "Checksum_CRC16" field. + public const int ChecksumCRC16FieldNumber = 32; + private uint checksumCRC16_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public uint ChecksumCRC16 { + get { return checksumCRC16_; } + set { + checksumCRC16_ = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as CartridgeTagContent); @@ -408,6 +482,7 @@ namespace Tango.PMR.Diagnostics { if (SerialNumber != other.SerialNumber) return false; if (FactoryId != other.FactoryId) return false; if (FillingSystemId != other.FillingSystemId) return false; + if (WorkOrder != other.WorkOrder) return false; if (ColorName != other.ColorName) return false; if (ColorCategory != other.ColorCategory) return false; if (ColorTypeRevision != other.ColorTypeRevision) return false; @@ -419,6 +494,7 @@ namespace Tango.PMR.Diagnostics { if (CartridgeFillingDate != other.CartridgeFillingDate) return false; if (WasteFilledDate != other.WasteFilledDate) return false; if (PlugInCounter != other.PlugInCounter) return false; + if (Misc != other.Misc) return false; if (Inkfill != other.Inkfill) return false; if (InkUsed != other.InkUsed) return false; if (InkEmpty != other.InkEmpty) return false; @@ -430,16 +506,21 @@ namespace Tango.PMR.Diagnostics { if (WasteCounter != other.WasteCounter) return false; if (MachineIdInkUsed != other.MachineIdInkUsed) return false; if (MachineIdWasteUsed != other.MachineIdWasteUsed) return false; + if (Counter != other.Counter) return false; + if (TagValid != other.TagValid) return false; + if (HashValue != other.HashValue) return false; + if (ChecksumCRC16 != other.ChecksumCRC16) return false; return true; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (UniqueId != 0) hash ^= UniqueId.GetHashCode(); + if (UniqueId.Length != 0) hash ^= UniqueId.GetHashCode(); if (SerialNumber.Length != 0) hash ^= SerialNumber.GetHashCode(); - if (FactoryId.Length != 0) hash ^= FactoryId.GetHashCode(); + if (FactoryId != 0) hash ^= FactoryId.GetHashCode(); if (FillingSystemId != 0) hash ^= FillingSystemId.GetHashCode(); + if (WorkOrder.Length != 0) hash ^= WorkOrder.GetHashCode(); if (ColorName.Length != 0) hash ^= ColorName.GetHashCode(); if (ColorCategory != 0) hash ^= ColorCategory.GetHashCode(); if (ColorTypeRevision != 0) hash ^= ColorTypeRevision.GetHashCode(); @@ -451,6 +532,7 @@ namespace Tango.PMR.Diagnostics { if (CartridgeFillingDate.Length != 0) hash ^= CartridgeFillingDate.GetHashCode(); if (WasteFilledDate.Length != 0) hash ^= WasteFilledDate.GetHashCode(); if (PlugInCounter != 0) hash ^= PlugInCounter.GetHashCode(); + if (Misc != 0) hash ^= Misc.GetHashCode(); if (Inkfill != false) hash ^= Inkfill.GetHashCode(); if (InkUsed != false) hash ^= InkUsed.GetHashCode(); if (InkEmpty != false) hash ^= InkEmpty.GetHashCode(); @@ -462,6 +544,10 @@ namespace Tango.PMR.Diagnostics { if (WasteCounter != 0) hash ^= WasteCounter.GetHashCode(); if (MachineIdInkUsed.Length != 0) hash ^= MachineIdInkUsed.GetHashCode(); if (MachineIdWasteUsed.Length != 0) hash ^= MachineIdWasteUsed.GetHashCode(); + if (Counter != 0) hash ^= Counter.GetHashCode(); + if (TagValid != false) hash ^= TagValid.GetHashCode(); + if (HashValue.Length != 0) hash ^= HashValue.GetHashCode(); + if (ChecksumCRC16 != 0) hash ^= ChecksumCRC16.GetHashCode(); return hash; } @@ -472,127 +558,154 @@ namespace Tango.PMR.Diagnostics { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { - if (UniqueId != 0) { - output.WriteRawTag(8); - output.WriteUInt32(UniqueId); + if (UniqueId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(UniqueId); } if (SerialNumber.Length != 0) { output.WriteRawTag(18); output.WriteString(SerialNumber); } - if (FactoryId.Length != 0) { - output.WriteRawTag(26); - output.WriteString(FactoryId); + if (FactoryId != 0) { + output.WriteRawTag(24); + output.WriteInt32(FactoryId); } if (FillingSystemId != 0) { output.WriteRawTag(32); output.WriteInt32(FillingSystemId); } - if (ColorName.Length != 0) { + if (WorkOrder.Length != 0) { output.WriteRawTag(42); + output.WriteString(WorkOrder); + } + if (ColorName.Length != 0) { + output.WriteRawTag(50); output.WriteString(ColorName); } if (ColorCategory != 0) { - output.WriteRawTag(48); + output.WriteRawTag(56); output.WriteInt32(ColorCategory); } if (ColorTypeRevision != 0) { - output.WriteRawTag(56); + output.WriteRawTag(64); output.WriteInt32(ColorTypeRevision); } if (CartridgeSize != 0) { - output.WriteRawTag(64); + output.WriteRawTag(72); output.WriteInt32(CartridgeSize); } if (FilledInkVolume != 0) { - output.WriteRawTag(72); + output.WriteRawTag(80); output.WriteInt32(FilledInkVolume); } if (InkBatchNum.Length != 0) { - output.WriteRawTag(82); + output.WriteRawTag(90); output.WriteString(InkBatchNum); } if (InkMFGDate.Length != 0) { - output.WriteRawTag(90); + output.WriteRawTag(98); output.WriteString(InkMFGDate); } if (InkEOLDate.Length != 0) { - output.WriteRawTag(98); + output.WriteRawTag(106); output.WriteString(InkEOLDate); } if (CartridgeFillingDate.Length != 0) { - output.WriteRawTag(106); + output.WriteRawTag(114); output.WriteString(CartridgeFillingDate); } if (WasteFilledDate.Length != 0) { - output.WriteRawTag(114); + output.WriteRawTag(122); output.WriteString(WasteFilledDate); } if (PlugInCounter != 0) { - output.WriteRawTag(120); + output.WriteRawTag(128, 1); output.WriteInt32(PlugInCounter); } + if (Misc != 0) { + output.WriteRawTag(136, 1); + output.WriteUInt32(Misc); + } if (Inkfill != false) { - output.WriteRawTag(128, 1); + output.WriteRawTag(144, 1); output.WriteBool(Inkfill); } if (InkUsed != false) { - output.WriteRawTag(136, 1); + output.WriteRawTag(152, 1); output.WriteBool(InkUsed); } if (InkEmpty != false) { - output.WriteRawTag(144, 1); + output.WriteRawTag(160, 1); output.WriteBool(InkEmpty); } if (WasteEmpty != false) { - output.WriteRawTag(152, 1); + output.WriteRawTag(168, 1); output.WriteBool(WasteEmpty); } if (WasteFilling != false) { - output.WriteRawTag(160, 1); + output.WriteRawTag(176, 1); output.WriteBool(WasteFilling); } if (WasteFull != false) { - output.WriteRawTag(168, 1); + output.WriteRawTag(184, 1); output.WriteBool(WasteFull); } if (Blocked != false) { - output.WriteRawTag(176, 1); + output.WriteRawTag(192, 1); output.WriteBool(Blocked); } if (Fail != false) { - output.WriteRawTag(184, 1); + output.WriteRawTag(200, 1); output.WriteBool(Fail); } if (WasteCounter != 0) { - output.WriteRawTag(192, 1); + output.WriteRawTag(208, 1); output.WriteInt32(WasteCounter); } if (MachineIdInkUsed.Length != 0) { - output.WriteRawTag(202, 1); + output.WriteRawTag(218, 1); output.WriteString(MachineIdInkUsed); } if (MachineIdWasteUsed.Length != 0) { - output.WriteRawTag(210, 1); + output.WriteRawTag(226, 1); output.WriteString(MachineIdWasteUsed); } + if (Counter != 0) { + output.WriteRawTag(232, 1); + output.WriteUInt32(Counter); + } + if (TagValid != false) { + output.WriteRawTag(240, 1); + output.WriteBool(TagValid); + } + if (HashValue.Length != 0) { + output.WriteRawTag(250, 1); + output.WriteString(HashValue); + } + if (ChecksumCRC16 != 0) { + output.WriteRawTag(128, 2); + output.WriteUInt32(ChecksumCRC16); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (UniqueId != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(UniqueId); + if (UniqueId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(UniqueId); } if (SerialNumber.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(SerialNumber); } - if (FactoryId.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(FactoryId); + if (FactoryId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(FactoryId); } if (FillingSystemId != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(FillingSystemId); } + if (WorkOrder.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(WorkOrder); + } if (ColorName.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(ColorName); } @@ -624,7 +737,10 @@ namespace Tango.PMR.Diagnostics { size += 1 + pb::CodedOutputStream.ComputeStringSize(WasteFilledDate); } if (PlugInCounter != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(PlugInCounter); + size += 2 + pb::CodedOutputStream.ComputeInt32Size(PlugInCounter); + } + if (Misc != 0) { + size += 2 + pb::CodedOutputStream.ComputeUInt32Size(Misc); } if (Inkfill != false) { size += 2 + 1; @@ -659,6 +775,18 @@ namespace Tango.PMR.Diagnostics { if (MachineIdWasteUsed.Length != 0) { size += 2 + pb::CodedOutputStream.ComputeStringSize(MachineIdWasteUsed); } + if (Counter != 0) { + size += 2 + pb::CodedOutputStream.ComputeUInt32Size(Counter); + } + if (TagValid != false) { + size += 2 + 1; + } + if (HashValue.Length != 0) { + size += 2 + pb::CodedOutputStream.ComputeStringSize(HashValue); + } + if (ChecksumCRC16 != 0) { + size += 2 + pb::CodedOutputStream.ComputeUInt32Size(ChecksumCRC16); + } return size; } @@ -667,18 +795,21 @@ namespace Tango.PMR.Diagnostics { if (other == null) { return; } - if (other.UniqueId != 0) { + if (other.UniqueId.Length != 0) { UniqueId = other.UniqueId; } if (other.SerialNumber.Length != 0) { SerialNumber = other.SerialNumber; } - if (other.FactoryId.Length != 0) { + if (other.FactoryId != 0) { FactoryId = other.FactoryId; } if (other.FillingSystemId != 0) { FillingSystemId = other.FillingSystemId; } + if (other.WorkOrder.Length != 0) { + WorkOrder = other.WorkOrder; + } if (other.ColorName.Length != 0) { ColorName = other.ColorName; } @@ -712,6 +843,9 @@ namespace Tango.PMR.Diagnostics { if (other.PlugInCounter != 0) { PlugInCounter = other.PlugInCounter; } + if (other.Misc != 0) { + Misc = other.Misc; + } if (other.Inkfill != false) { Inkfill = other.Inkfill; } @@ -745,6 +879,18 @@ namespace Tango.PMR.Diagnostics { if (other.MachineIdWasteUsed.Length != 0) { MachineIdWasteUsed = other.MachineIdWasteUsed; } + if (other.Counter != 0) { + Counter = other.Counter; + } + if (other.TagValid != false) { + TagValid = other.TagValid; + } + if (other.HashValue.Length != 0) { + HashValue = other.HashValue; + } + if (other.ChecksumCRC16 != 0) { + ChecksumCRC16 = other.ChecksumCRC16; + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -755,16 +901,16 @@ namespace Tango.PMR.Diagnostics { default: input.SkipLastField(); break; - case 8: { - UniqueId = input.ReadUInt32(); + case 10: { + UniqueId = input.ReadString(); break; } case 18: { SerialNumber = input.ReadString(); break; } - case 26: { - FactoryId = input.ReadString(); + case 24: { + FactoryId = input.ReadInt32(); break; } case 32: { @@ -772,93 +918,117 @@ namespace Tango.PMR.Diagnostics { break; } case 42: { + WorkOrder = input.ReadString(); + break; + } + case 50: { ColorName = input.ReadString(); break; } - case 48: { + case 56: { ColorCategory = input.ReadInt32(); break; } - case 56: { + case 64: { ColorTypeRevision = input.ReadInt32(); break; } - case 64: { + case 72: { CartridgeSize = input.ReadInt32(); break; } - case 72: { + case 80: { FilledInkVolume = input.ReadInt32(); break; } - case 82: { + case 90: { InkBatchNum = input.ReadString(); break; } - case 90: { + case 98: { InkMFGDate = input.ReadString(); break; } - case 98: { + case 106: { InkEOLDate = input.ReadString(); break; } - case 106: { + case 114: { CartridgeFillingDate = input.ReadString(); break; } - case 114: { + case 122: { WasteFilledDate = input.ReadString(); break; } - case 120: { + case 128: { PlugInCounter = input.ReadInt32(); break; } - case 128: { + case 136: { + Misc = input.ReadUInt32(); + break; + } + case 144: { Inkfill = input.ReadBool(); break; } - case 136: { + case 152: { InkUsed = input.ReadBool(); break; } - case 144: { + case 160: { InkEmpty = input.ReadBool(); break; } - case 152: { + case 168: { WasteEmpty = input.ReadBool(); break; } - case 160: { + case 176: { WasteFilling = input.ReadBool(); break; } - case 168: { + case 184: { WasteFull = input.ReadBool(); break; } - case 176: { + case 192: { Blocked = input.ReadBool(); break; } - case 184: { + case 200: { Fail = input.ReadBool(); break; } - case 192: { + case 208: { WasteCounter = input.ReadInt32(); break; } - case 202: { + case 218: { MachineIdInkUsed = input.ReadString(); break; } - case 210: { + case 226: { MachineIdWasteUsed = input.ReadString(); break; } + case 232: { + Counter = input.ReadUInt32(); + break; + } + case 240: { + TagValid = input.ReadBool(); + break; + } + case 250: { + HashValue = input.ReadString(); + break; + } + case 256: { + ChecksumCRC16 = input.ReadUInt32(); + break; + } } } } diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/DiagnosticsMonitors.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/DiagnosticsMonitors.cs index a5c2d4c07..2e7191370 100644 --- a/Software/Visual_Studio/Tango.PMR/Diagnostics/DiagnosticsMonitors.cs +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/DiagnosticsMonitors.cs @@ -23,7 +23,7 @@ namespace Tango.PMR.Diagnostics { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "ChlEaWFnbm9zdGljc01vbml0b3JzLnByb3RvEhVUYW5nby5QTVIuRGlhZ25v", - "c3RpY3MaEURvdWJsZUFycmF5LnByb3RvIoUPChNEaWFnbm9zdGljc01vbml0", + "c3RpY3MaEURvdWJsZUFycmF5LnByb3RvIoMQChNEaWFnbm9zdGljc01vbml0", "b3JzEhQKDERhbmNlcjFBbmdsZRgBIAMoARIUCgxEYW5jZXIyQW5nbGUYAiAD", "KAESFAoMRGFuY2VyM0FuZ2xlGAMgAygBEhwKFEZlZWRlck1vdG9yRnJlcXVl", "bmN5GAQgAygBEhIKCkRyeWVyTW90b3IYBSADKAESEwoLUG9sbGVyTW90b3IY", @@ -66,12 +66,15 @@ namespace Tango.PMR.Diagnostics { "ZFpvbmUySGVhdGVyQ3VycmVudBg7IAMoARIeChZIZWFkWm9uZTNIZWF0ZXJD", "dXJyZW50GDwgAygBEh4KFkhlYWRab25lNEhlYXRlckN1cnJlbnQYPSADKAES", "IAoYSGVhZFpvbmU1XzZIZWF0ZXJDdXJyZW50GD4gAygBEhsKE01peGVyMUhl", - "YXRlckN1cnJlbnQYPyADKAFCIQofY29tLnR3aW5lLnRhbmdvLnBtci5kaWFn", - "bm9zdGljc2IGcHJvdG8z")); + "YXRlckN1cnJlbnQYPyADKAESPgoSRGlzcGVuc2Vyc0lua0xldmVsGEAgAygL", + "MiIuVGFuZ28uUE1SLkRpYWdub3N0aWNzLkRvdWJsZUFycmF5EjwKEE1pZFRh", + "bmtzSW5rTGV2ZWwYQSADKAsyIi5UYW5nby5QTVIuRGlhZ25vc3RpY3MuRG91", + "YmxlQXJyYXlCIQofY29tLnR3aW5lLnRhbmdvLnBtci5kaWFnbm9zdGljc2IG", + "cHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Tango.PMR.Diagnostics.DoubleArrayReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.DiagnosticsMonitors), global::Tango.PMR.Diagnostics.DiagnosticsMonitors.Parser, new[]{ "Dancer1Angle", "Dancer2Angle", "Dancer3Angle", "FeederMotorFrequency", "DryerMotor", "PollerMotor", "WinderMotor", "ScrewMotor", "ThreadSpeed", "MixerTemperature", "HeadZone1Temperature", "HeadZone2Temperature", "HeadZone3Temperature", "HeadAirFlow", "FeederTension", "PullerTension", "DryerZone1Temperature", "DryerZone2Temperature", "DryerZone3Temperature", "DryerAirFlow", "WinderTension", "DispensersMotorsFrequency", "DispensersAngularEncoders", "DispensersLinearPositions", "DispensersPressure", "FilterDeltaPressure", "ChillerTemperature", "Dispenser1MotorFrequency", "Dispenser2MotorFrequency", "Dispenser3MotorFrequency", "Dispenser4MotorFrequency", "Dispenser5MotorFrequency", "Dispenser6MotorFrequency", "Dispenser7MotorFrequency", "Dispenser8MotorFrequency", "HeadZone4Temperature", "HeadZone5Temperature", "HeadZone6Temperature", "BlowerVoltage", "Dispenser1Pressure", "Dispenser2Pressure", "Dispenser3Pressure", "Dispenser4Pressure", "Dispenser5Pressure", "Dispenser6Pressure", "Dispenser7Pressure", "Dispenser8Pressure", "MidTank1Level", "MidTank2Level", "MidTank3Level", "MidTank4Level", "MidTank5Level", "MidTank6Level", "MidTank7Level", "MidTank8Level", "DrierZone1HeaterCurrent", "DrierZone2HeaterCurrent", "HeadZone1HeaterCurrent", "HeadZone2HeaterCurrent", "HeadZone3HeaterCurrent", "HeadZone4HeaterCurrent", "HeadZone56HeaterCurrent", "Mixer1HeaterCurrent" }, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.DiagnosticsMonitors), global::Tango.PMR.Diagnostics.DiagnosticsMonitors.Parser, new[]{ "Dancer1Angle", "Dancer2Angle", "Dancer3Angle", "FeederMotorFrequency", "DryerMotor", "PollerMotor", "WinderMotor", "ScrewMotor", "ThreadSpeed", "MixerTemperature", "HeadZone1Temperature", "HeadZone2Temperature", "HeadZone3Temperature", "HeadAirFlow", "FeederTension", "PullerTension", "DryerZone1Temperature", "DryerZone2Temperature", "DryerZone3Temperature", "DryerAirFlow", "WinderTension", "DispensersMotorsFrequency", "DispensersAngularEncoders", "DispensersLinearPositions", "DispensersPressure", "FilterDeltaPressure", "ChillerTemperature", "Dispenser1MotorFrequency", "Dispenser2MotorFrequency", "Dispenser3MotorFrequency", "Dispenser4MotorFrequency", "Dispenser5MotorFrequency", "Dispenser6MotorFrequency", "Dispenser7MotorFrequency", "Dispenser8MotorFrequency", "HeadZone4Temperature", "HeadZone5Temperature", "HeadZone6Temperature", "BlowerVoltage", "Dispenser1Pressure", "Dispenser2Pressure", "Dispenser3Pressure", "Dispenser4Pressure", "Dispenser5Pressure", "Dispenser6Pressure", "Dispenser7Pressure", "Dispenser8Pressure", "MidTank1Level", "MidTank2Level", "MidTank3Level", "MidTank4Level", "MidTank5Level", "MidTank6Level", "MidTank7Level", "MidTank8Level", "DrierZone1HeaterCurrent", "DrierZone2HeaterCurrent", "HeadZone1HeaterCurrent", "HeadZone2HeaterCurrent", "HeadZone3HeaterCurrent", "HeadZone4HeaterCurrent", "HeadZone56HeaterCurrent", "Mixer1HeaterCurrent", "DispensersInkLevel", "MidTanksInkLevel" }, null, null, null) })); } #endregion @@ -165,6 +168,8 @@ namespace Tango.PMR.Diagnostics { headZone4HeaterCurrent_ = other.headZone4HeaterCurrent_.Clone(); headZone56HeaterCurrent_ = other.headZone56HeaterCurrent_.Clone(); mixer1HeaterCurrent_ = other.mixer1HeaterCurrent_.Clone(); + dispensersInkLevel_ = other.dispensersInkLevel_.Clone(); + midTanksInkLevel_ = other.midTanksInkLevel_.Clone(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -991,6 +996,32 @@ namespace Tango.PMR.Diagnostics { get { return mixer1HeaterCurrent_; } } + /// Field number for the "DispensersInkLevel" field. + public const int DispensersInkLevelFieldNumber = 64; + private static readonly pb::FieldCodec _repeated_dispensersInkLevel_codec + = pb::FieldCodec.ForMessage(514, global::Tango.PMR.Diagnostics.DoubleArray.Parser); + private readonly pbc::RepeatedField dispensersInkLevel_ = new pbc::RepeatedField(); + /// + ///Dispensers Ink Level (Min = 0, Max = 130000000, PPF = 1) Channel Count = 8 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField DispensersInkLevel { + get { return dispensersInkLevel_; } + } + + /// Field number for the "MidTanksInkLevel" field. + public const int MidTanksInkLevelFieldNumber = 65; + private static readonly pb::FieldCodec _repeated_midTanksInkLevel_codec + = pb::FieldCodec.ForMessage(522, global::Tango.PMR.Diagnostics.DoubleArray.Parser); + private readonly pbc::RepeatedField midTanksInkLevel_ = new pbc::RepeatedField(); + /// + ///Mid Tanks Ink Level (Min = 0, Max = 2, PPF = 1) Channel Count = 8 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField MidTanksInkLevel { + get { return midTanksInkLevel_; } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as DiagnosticsMonitors); @@ -1067,6 +1098,8 @@ namespace Tango.PMR.Diagnostics { if(!headZone4HeaterCurrent_.Equals(other.headZone4HeaterCurrent_)) return false; if(!headZone56HeaterCurrent_.Equals(other.headZone56HeaterCurrent_)) return false; if(!mixer1HeaterCurrent_.Equals(other.mixer1HeaterCurrent_)) return false; + if(!dispensersInkLevel_.Equals(other.dispensersInkLevel_)) return false; + if(!midTanksInkLevel_.Equals(other.midTanksInkLevel_)) return false; return true; } @@ -1136,6 +1169,8 @@ namespace Tango.PMR.Diagnostics { hash ^= headZone4HeaterCurrent_.GetHashCode(); hash ^= headZone56HeaterCurrent_.GetHashCode(); hash ^= mixer1HeaterCurrent_.GetHashCode(); + hash ^= dispensersInkLevel_.GetHashCode(); + hash ^= midTanksInkLevel_.GetHashCode(); return hash; } @@ -1209,6 +1244,8 @@ namespace Tango.PMR.Diagnostics { headZone4HeaterCurrent_.WriteTo(output, _repeated_headZone4HeaterCurrent_codec); headZone56HeaterCurrent_.WriteTo(output, _repeated_headZone56HeaterCurrent_codec); mixer1HeaterCurrent_.WriteTo(output, _repeated_mixer1HeaterCurrent_codec); + dispensersInkLevel_.WriteTo(output, _repeated_dispensersInkLevel_codec); + midTanksInkLevel_.WriteTo(output, _repeated_midTanksInkLevel_codec); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1277,6 +1314,8 @@ namespace Tango.PMR.Diagnostics { size += headZone4HeaterCurrent_.CalculateSize(_repeated_headZone4HeaterCurrent_codec); size += headZone56HeaterCurrent_.CalculateSize(_repeated_headZone56HeaterCurrent_codec); size += mixer1HeaterCurrent_.CalculateSize(_repeated_mixer1HeaterCurrent_codec); + size += dispensersInkLevel_.CalculateSize(_repeated_dispensersInkLevel_codec); + size += midTanksInkLevel_.CalculateSize(_repeated_midTanksInkLevel_codec); return size; } @@ -1348,6 +1387,8 @@ namespace Tango.PMR.Diagnostics { headZone4HeaterCurrent_.Add(other.headZone4HeaterCurrent_); headZone56HeaterCurrent_.Add(other.headZone56HeaterCurrent_); mixer1HeaterCurrent_.Add(other.mixer1HeaterCurrent_); + dispensersInkLevel_.Add(other.dispensersInkLevel_); + midTanksInkLevel_.Add(other.midTanksInkLevel_); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1669,6 +1710,14 @@ namespace Tango.PMR.Diagnostics { mixer1HeaterCurrent_.AddEntriesFrom(input, _repeated_mixer1HeaterCurrent_codec); break; } + case 514: { + dispensersInkLevel_.AddEntriesFrom(input, _repeated_dispensersInkLevel_codec); + break; + } + case 522: { + midTanksInkLevel_.AddEntriesFrom(input, _repeated_midTanksInkLevel_codec); + break; + } } } } diff --git a/Software/Visual_Studio/Tango.PMR/Hardware/HardwareBlower.cs b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareBlower.cs index 8138b2d70..4685c17fa 100644 --- a/Software/Visual_Studio/Tango.PMR/Hardware/HardwareBlower.cs +++ b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareBlower.cs @@ -98,6 +98,9 @@ namespace Tango.PMR.Hardware { /// Field number for the "Voltage" field. public const int VoltageFieldNumber = 3; private double voltage_; + /// + ///Voltage Description + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double Voltage { get { return voltage_; } diff --git a/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/App.config b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/App.config index 5e14aa35c..feee84b8b 100644 --- a/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/App.config +++ b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/App.config @@ -19,6 +19,10 @@ + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs index b5442e72b..78a9d0380 100644 --- a/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs +++ b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Program.cs @@ -11,6 +11,7 @@ using Tango.BL; using static Tango.Core.Components.DataBaseDescriptionsHelper; using Tango.Core.Components; using System.ComponentModel.DataAnnotations.Schema; +using Newtonsoft.Json; namespace Tango.PMRGenerator.CLI { @@ -747,7 +748,22 @@ namespace Tango.PMRGenerator.CLI if (db_des != null) { - return db_des.ColumnDescription.ToLines().Take(1).Concat(db_des.ColumnDescription.ToLines().Skip(1).Select(x => "//" + x)).Join(Environment.NewLine); + RangeDescriptionModel rangeDescription = null; + + try + { + rangeDescription = JsonConvert.DeserializeObject(db_des.ColumnDescription); + } + catch { } + + if (rangeDescription != null && rangeDescription.Description != null) + { + return rangeDescription.Description.ToLines().Take(1).Concat(rangeDescription.Description.ToLines().Skip(1).Select(x => "//" + x)).Join(Environment.NewLine); + } + else + { + return db_des.ColumnDescription.ToLines().Take(1).Concat(db_des.ColumnDescription.ToLines().Skip(1).Select(x => "//" + x)).Join(Environment.NewLine); + } } return null; diff --git a/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Tango.PMRGenerator.CLI.csproj b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Tango.PMRGenerator.CLI.csproj index 21e77f3d4..a02aca302 100644 --- a/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Tango.PMRGenerator.CLI.csproj +++ b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/Tango.PMRGenerator.CLI.csproj @@ -38,6 +38,9 @@ ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + + ..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll + @@ -80,7 +83,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/packages.config b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/packages.config index b3daf0d6c..1127d4e32 100644 --- a/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/packages.config +++ b/Software/Visual_Studio/Utilities/Tango.PMRGenerator.CLI/packages.config @@ -1,4 +1,5 @@  + \ No newline at end of file -- cgit v1.3.1 From ebd971a77a5fdabdf4040f07ac0e63e687abb8aa Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 2 Oct 2019 16:59:05 +0300 Subject: Another fix for SetLiquidVolumes. Changed JobFile PMR. Implemented new JobFile with Liquid Volume awareness. Implemented Import/Export jobs on research module. --- .../PMR/Messages/Exports/JobFileBrushStop.proto | 11 +- .../PMR/Messages/Exports/JobFileLiquidVolume.proto | 10 + .../Tango.MachineStudio.Developer.csproj | 19 +- .../ViewModels/MainViewVM.cs | 120 ++++++++++ .../Views/MachineJobSelectionView.xaml | 27 ++- .../Tango.MachineStudio.Developer/app.config | 16 +- .../Tango.MachineStudio.Developer/packages.config | 2 + .../Tango.MachineStudio.RML/Views/RmlsView.xaml | 2 +- .../Tango.MachineStudio.UI/App.config | 2 +- .../Visual_Studio/Tango.BL/Entities/BrushStop.cs | 11 +- Software/Visual_Studio/Tango.BL/Entities/Job.cs | 45 +++- .../Tango.PMR/Exports/JobFileBrushStop.cs | 264 +++------------------ .../Tango.PMR/Exports/JobFileLiquidVolume.cs | 188 +++++++++++++++ Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj | 3 +- 14 files changed, 450 insertions(+), 270 deletions(-) create mode 100644 Software/PMR/Messages/Exports/JobFileLiquidVolume.proto create mode 100644 Software/Visual_Studio/Tango.PMR/Exports/JobFileLiquidVolume.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer') diff --git a/Software/PMR/Messages/Exports/JobFileBrushStop.proto b/Software/PMR/Messages/Exports/JobFileBrushStop.proto index 98b7e56ff..fae9f77c0 100644 --- a/Software/PMR/Messages/Exports/JobFileBrushStop.proto +++ b/Software/PMR/Messages/Exports/JobFileBrushStop.proto @@ -1,5 +1,7 @@ syntax = "proto3"; +import "JobFileLiquidVolume.proto"; + package Tango.PMR.Exports; option java_package = "com.twine.tango.pmr.exports"; @@ -21,14 +23,7 @@ message JobFileBrushStop double A = 11; double B = 12; - double V0 = 13; - double V1 = 14; - double V2 = 15; - double V3 = 16; - double V4 = 17; - double V5 = 18; - double V6 = 19; - double V7 = 20; + repeated JobFileLiquidVolume LiquidVolumes = 24; bool Corrected = 21; string ColorCatalogGuid = 22; diff --git a/Software/PMR/Messages/Exports/JobFileLiquidVolume.proto b/Software/PMR/Messages/Exports/JobFileLiquidVolume.proto new file mode 100644 index 000000000..1c68f9064 --- /dev/null +++ b/Software/PMR/Messages/Exports/JobFileLiquidVolume.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + +package Tango.PMR.Exports; +option java_package = "com.twine.tango.pmr.exports"; + +message JobFileLiquidVolume +{ + string LiquidTypeName = 1; + double Volume = 2; +} \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj index f57f83d7e..012ed8d0d 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj @@ -52,6 +52,15 @@ ..\..\..\packages\MaterialDesignThemes.2.3.1.953\lib\net45\MaterialDesignThemes.Wpf.dll + + ..\..\..\packages\Microsoft.WindowsAPICodePack-Core.1.1.0.0\lib\Microsoft.WindowsAPICodePack.dll + + + ..\..\..\packages\Microsoft.WindowsAPICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.Shell.dll + + + ..\..\..\packages\Microsoft.WindowsAPICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.ShellExtensions.dll + @@ -196,8 +205,12 @@ ResXFileCodeGenerator Resources.Designer.cs - - + + Designer + + + Designer + SettingsSingleFileGenerator Settings.Designer.cs @@ -373,7 +386,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index 2d04866d8..27d43bd20 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -48,6 +48,8 @@ using Tango.MachineStudio.Common.Navigation; using System.Diagnostics; using Tango.Core.ExtensionMethods; using Tango.ColorConversion; +using Tango.PMR.Exports; +using Microsoft.WindowsAPICodePack.Dialogs; namespace Tango.MachineStudio.Developer.ViewModels { @@ -725,6 +727,16 @@ namespace Tango.MachineStudio.Developer.ViewModels /// public RelayCommand ResetProcessParametersCommand { get; set; } + /// + /// Gets or sets the import job file command. + /// + public RelayCommand ImportJobFileCommand { get; set; } + + /// + /// Gets or sets the export job file command. + /// + public RelayCommand ExportJobFileCommand { get; set; } + #endregion #region Constructors @@ -786,6 +798,8 @@ namespace Tango.MachineStudio.Developer.ViewModels DisplayJobEmbroideryFileCommand = new RelayCommand(DisplayJobEmbroideryFile, () => CanWork); ReloadMachinesCommand = new RelayCommand(() => LoadMachine(), () => CanWork && SelectedMachine != null); ResetProcessParametersCommand = new RelayCommand(ResetProcessParameters, () => CanWork && MachineOperator != null); + ImportJobFileCommand = new RelayCommand(ImportJobFile, () => SelectedMachine != null && CanWork); + ExportJobFileCommand = new RelayCommand(ExportJobFile, () => SelectedMachine != null && SelectedMachineJob != null && CanWork); ApplicationManager.ConnectedMachineChanged += ApplicationManager_ConnectedMachineChanged; @@ -2488,6 +2502,112 @@ namespace Tango.MachineStudio.Developer.ViewModels #endregion + #region Job Import/Export + + private async void ExportJobFile() + { + if (SelectedJobs != null && SelectedJobs.Count > 1) + { + CommonOpenFileDialog dlg = new CommonOpenFileDialog(); + dlg.Title = "Select a folder to place all job files."; + dlg.IsFolderPicker = true; + + if (dlg.ShowDialog() == CommonFileDialogResult.Ok) + { + foreach (var job in SelectedJobs) + { + using (_notification.PushTaskItem($"Exporting job '{job.Name}'...")) + { + try + { + LogManager.Log($"Exporting job file {job.Name}"); + + var jobFile = await job.ToJobFile(); + File.WriteAllBytes(Path.Combine(dlg.FileName, job.Name + ".job"), jobFile.ToBytes()); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error exporting job file."); + _notification.ShowError($"An error occurred while trying to export job '{job.Name}'.\n{ex.FlattenMessage()}"); + } + } + } + } + } + else + { + SaveFileDialog dlg = new SaveFileDialog(); + dlg.Title = "Export Job File"; + dlg.Filter = "Twine Job Files|*.job"; + dlg.DefaultExt = ".job"; + dlg.FileName = SelectedMachineJob.Name; + if (dlg.ShowDialog().Value) + { + using (_notification.PushTaskItem($"Exporting job '{SelectedMachineJob.Name}'...")) + { + try + { + LogManager.Log($"Exporting job file {SelectedMachineJob.Name}"); + + var jobFile = await SelectedMachineJob.ToJobFile(); + File.WriteAllBytes(dlg.FileName, jobFile.ToBytes()); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error exporting job file."); + _notification.ShowError($"An error occurred while trying to export job '{SelectedMachineJob.Name}'.\n{ex.FlattenMessage()}"); + } + } + } + } + } + + private async void ImportJobFile() + { + OpenFileDialog dlg = new OpenFileDialog(); + dlg.Title = "Import Job File"; + dlg.Filter = "Twine Job Files|*.job"; + dlg.Multiselect = true; + if (dlg.ShowDialog().Value) + { + using (_notification.PushTaskItem($"Importing job files...")) + { + try + { + IsFree = false; + + LogManager.Log($"Importing job files..."); + + foreach (var file in dlg.FileNames) + { + var bytes = File.ReadAllBytes(file); + var jobFile = JobFile.Parser.ParseFrom(bytes); + var job = await Job.FromJobFile(jobFile, SelectedMachine.Guid, AuthenticationProvider.CurrentUser.Guid); + + _machineDbContext.Jobs.Add(job); + } + + await _machineDbContext.SaveChangesAsync(); + + IsFree = true; + + _notification.ShowInfo($"Jobs imported successfully."); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error importing job file."); + _notification.ShowError($"An error occurred while trying to import the selected job file.\n{ex.FlattenMessage()}"); + } + finally + { + IsFree = true; + } + } + } + } + + #endregion + #region Override Methods protected override void RaisePropertyChangedAuto([CallerMemberName] string caller = null) diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml index 70d5b6180..f8a10e7c4 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml @@ -260,12 +260,27 @@ - + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/app.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/app.config index ff251eb7d..1fafd5ffd 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/app.config +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/app.config @@ -20,7 +20,7 @@ - + @@ -28,27 +28,27 @@ - + - + - + - + - + - + @@ -72,7 +72,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/packages.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/packages.config index 999461d6a..85174f848 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/packages.config +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/packages.config @@ -8,6 +8,8 @@ + + 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 719167679..fdfc00ba6 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 @@ -40,7 +40,7 @@ diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config index b8ad73b04..59f92d6b9 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config @@ -78,7 +78,7 @@ - + diff --git a/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs b/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs index ad44ee56d..d23e9b1f2 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs @@ -393,24 +393,21 @@ namespace Tango.BL.Entities /// The process parameters table. public void SetLiquidVolumes(Configuration configuration, Rml rml, ProcessParametersTable processParametersTable) { - _liquidVolumes = null; + LiquidVolumes = new ObservableCollection(); - ObservableCollection liquidVolumes = new ObservableCollection(); - foreach (var idsPack in configuration.GetSupportedIdsPacks(rml)) { var liquidVolume = new LiquidVolume(configuration, idsPack, rml, processParametersTable, this); liquidVolume.VolumeChanged += LiquidVolume_VolumeChanged; - liquidVolumes.Add(liquidVolume); + LiquidVolumes.Add(liquidVolume); } - foreach (var volume in liquidVolumes.ToList()) + foreach (var volume in LiquidVolumes.ToList()) { volume.Invalidate(); } - LiquidVolumes = liquidVolumes; - + RaisePropertyChanged(nameof(LiquidVolumes)); RaisePropertyChanged(nameof(LiquidVolumesOrdered)); RaisePropertyChanged(nameof(LiquidVolumesOrderedPigmented)); } diff --git a/Software/Visual_Studio/Tango.BL/Entities/Job.cs b/Software/Visual_Studio/Tango.BL/Entities/Job.cs index 2d536c268..de1107077 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Job.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Job.cs @@ -568,6 +568,7 @@ namespace Tango.BL.Entities using (ObservablesContext db = ObservablesContext.CreateDefault()) { var job = new JobBuilder(db).Set(Guid).WithUser().WithRML().WithSegments().WithBrushStops().Build(); + var machine = new MachineBuilder(db).Set(job.MachineGuid).WithConfiguration().Build(); var jobFile = new JobFile(); @@ -609,6 +610,24 @@ namespace Tango.BL.Entities JobFileBrushStop st = new JobFileBrushStop(); stop.MapPrimitivesWithStringsNoNullsTo(st); st.ColorCatalogItemGuid = stop.ColorCatalogsItemGuid.ToStringOrEmpty(); + + foreach (var idsPack in machine.Configuration.NoneEmptyIdsPacks) + { + try + { + var volume = stop.GetVolume(idsPack.PackIndex); + st.LiquidVolumes.Add(new JobFileLiquidVolume() + { + LiquidTypeName = idsPack.LiquidType.Name, + Volume = volume, + }); + } + catch (Exception ex) + { + throw new InvalidOperationException($"Error extracting liquid volume from ids pack {idsPack.PackIndex}", ex); + } + } + s.BrushStops.Add(st); } } @@ -624,10 +643,21 @@ namespace Tango.BL.Entities { using (ObservablesContext db = ObservablesContext.CreateDefault()) { + Machine machine; + var job = new Job(); job.MachineGuid = machineGuid; job.UserGuid = userGuid; + try + { + machine = new MachineBuilder(db).Set(machineGuid).WithConfiguration().Build(); + } + catch + { + throw new ArgumentException("Error loading the machine details."); + } + if (!String.IsNullOrEmpty(jobFile.ColorSpaceGuid)) { var job_color_space = db.ColorSpaces.SingleOrDefault(x => x.Guid == jobFile.ColorSpaceGuid); @@ -708,6 +738,19 @@ namespace Tango.BL.Entities st.SegmentGuid = s.Guid; stop.MapPrimitivesWithStringsNoNullsTo(st); + foreach (var volume in stop.LiquidVolumes) + { + var idsPack = machine.Configuration.NoneEmptyIdsPacks.SingleOrDefault(x => x.LiquidType.Name == volume.LiquidTypeName); + + if (idsPack == null) + { + throw new InvalidOperationException($"Liquid type '{volume.LiquidTypeName}' is not configured on the target machine."); + } + + st.SetVolume(idsPack.PackIndex, volume.Volume); + } + + if (!String.IsNullOrWhiteSpace(stop.ColorCatalogGuid)) { var stop_color_catalog = db.ColorCatalogs.SingleOrDefault(x => x.Guid == stop.ColorCatalogGuid); @@ -724,7 +767,7 @@ namespace Tango.BL.Entities st.ColorCatalogsItemGuid = stop.ColorCatalogItemGuid; } - + s.BrushStops.Add(st); } } diff --git a/Software/Visual_Studio/Tango.PMR/Exports/JobFileBrushStop.cs b/Software/Visual_Studio/Tango.PMR/Exports/JobFileBrushStop.cs index 26dec4be0..36da58b4e 100644 --- a/Software/Visual_Studio/Tango.PMR/Exports/JobFileBrushStop.cs +++ b/Software/Visual_Studio/Tango.PMR/Exports/JobFileBrushStop.cs @@ -22,21 +22,21 @@ namespace Tango.PMR.Exports { static JobFileBrushStopReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "ChZKb2JGaWxlQnJ1c2hTdG9wLnByb3RvEhFUYW5nby5QTVIuRXhwb3J0cyL1", - "AgoQSm9iRmlsZUJydXNoU3RvcBIWCg5Db2xvclNwYWNlR3VpZBgBIAEoCRIV", - "Cg1PZmZzZXRQZXJjZW50GAIgASgBEgwKBEN5YW4YAyABKAESDwoHTWFnZW50", - "YRgEIAEoARIOCgZZZWxsb3cYBSABKAESDQoFQmxhY2sYBiABKAESCwoDUmVk", - "GAcgASgFEg0KBUdyZWVuGAggASgFEgwKBEJsdWUYCSABKAUSCQoBTBgKIAEo", - "ARIJCgFBGAsgASgBEgkKAUIYDCABKAESCgoCVjAYDSABKAESCgoCVjEYDiAB", - "KAESCgoCVjIYDyABKAESCgoCVjMYECABKAESCgoCVjQYESABKAESCgoCVjUY", - "EiABKAESCgoCVjYYEyABKAESCgoCVjcYFCABKAESEQoJQ29ycmVjdGVkGBUg", - "ASgIEhgKEENvbG9yQ2F0YWxvZ0d1aWQYFiABKAkSHAoUQ29sb3JDYXRhbG9n", - "SXRlbUd1aWQYFyABKAlCHQobY29tLnR3aW5lLnRhbmdvLnBtci5leHBvcnRz", - "YgZwcm90bzM=")); + "ChZKb2JGaWxlQnJ1c2hTdG9wLnByb3RvEhFUYW5nby5QTVIuRXhwb3J0cxoZ", + "Sm9iRmlsZUxpcXVpZFZvbHVtZS5wcm90byLUAgoQSm9iRmlsZUJydXNoU3Rv", + "cBIWCg5Db2xvclNwYWNlR3VpZBgBIAEoCRIVCg1PZmZzZXRQZXJjZW50GAIg", + "ASgBEgwKBEN5YW4YAyABKAESDwoHTWFnZW50YRgEIAEoARIOCgZZZWxsb3cY", + "BSABKAESDQoFQmxhY2sYBiABKAESCwoDUmVkGAcgASgFEg0KBUdyZWVuGAgg", + "ASgFEgwKBEJsdWUYCSABKAUSCQoBTBgKIAEoARIJCgFBGAsgASgBEgkKAUIY", + "DCABKAESPQoNTGlxdWlkVm9sdW1lcxgYIAMoCzImLlRhbmdvLlBNUi5FeHBv", + "cnRzLkpvYkZpbGVMaXF1aWRWb2x1bWUSEQoJQ29ycmVjdGVkGBUgASgIEhgK", + "EENvbG9yQ2F0YWxvZ0d1aWQYFiABKAkSHAoUQ29sb3JDYXRhbG9nSXRlbUd1", + "aWQYFyABKAlCHQobY29tLnR3aW5lLnRhbmdvLnBtci5leHBvcnRzYgZwcm90", + "bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, + new pbr::FileDescriptor[] { global::Tango.PMR.Exports.JobFileLiquidVolumeReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Exports.JobFileBrushStop), global::Tango.PMR.Exports.JobFileBrushStop.Parser, new[]{ "ColorSpaceGuid", "OffsetPercent", "Cyan", "Magenta", "Yellow", "Black", "Red", "Green", "Blue", "L", "A", "B", "V0", "V1", "V2", "V3", "V4", "V5", "V6", "V7", "Corrected", "ColorCatalogGuid", "ColorCatalogItemGuid" }, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Exports.JobFileBrushStop), global::Tango.PMR.Exports.JobFileBrushStop.Parser, new[]{ "ColorSpaceGuid", "OffsetPercent", "Cyan", "Magenta", "Yellow", "Black", "Red", "Green", "Blue", "L", "A", "B", "LiquidVolumes", "Corrected", "ColorCatalogGuid", "ColorCatalogItemGuid" }, null, null, null) })); } #endregion @@ -79,14 +79,7 @@ namespace Tango.PMR.Exports { l_ = other.l_; a_ = other.a_; b_ = other.b_; - v0_ = other.v0_; - v1_ = other.v1_; - v2_ = other.v2_; - v3_ = other.v3_; - v4_ = other.v4_; - v5_ = other.v5_; - v6_ = other.v6_; - v7_ = other.v7_; + liquidVolumes_ = other.liquidVolumes_.Clone(); corrected_ = other.corrected_; colorCatalogGuid_ = other.colorCatalogGuid_; colorCatalogItemGuid_ = other.colorCatalogItemGuid_; @@ -229,92 +222,14 @@ namespace Tango.PMR.Exports { } } - /// Field number for the "V0" field. - public const int V0FieldNumber = 13; - private double v0_; + /// Field number for the "LiquidVolumes" field. + public const int LiquidVolumesFieldNumber = 24; + private static readonly pb::FieldCodec _repeated_liquidVolumes_codec + = pb::FieldCodec.ForMessage(194, global::Tango.PMR.Exports.JobFileLiquidVolume.Parser); + private readonly pbc::RepeatedField liquidVolumes_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double V0 { - get { return v0_; } - set { - v0_ = value; - } - } - - /// Field number for the "V1" field. - public const int V1FieldNumber = 14; - private double v1_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double V1 { - get { return v1_; } - set { - v1_ = value; - } - } - - /// Field number for the "V2" field. - public const int V2FieldNumber = 15; - private double v2_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double V2 { - get { return v2_; } - set { - v2_ = value; - } - } - - /// Field number for the "V3" field. - public const int V3FieldNumber = 16; - private double v3_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double V3 { - get { return v3_; } - set { - v3_ = value; - } - } - - /// Field number for the "V4" field. - public const int V4FieldNumber = 17; - private double v4_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double V4 { - get { return v4_; } - set { - v4_ = value; - } - } - - /// Field number for the "V5" field. - public const int V5FieldNumber = 18; - private double v5_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double V5 { - get { return v5_; } - set { - v5_ = value; - } - } - - /// Field number for the "V6" field. - public const int V6FieldNumber = 19; - private double v6_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double V6 { - get { return v6_; } - set { - v6_ = value; - } - } - - /// Field number for the "V7" field. - public const int V7FieldNumber = 20; - private double v7_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double V7 { - get { return v7_; } - set { - v7_ = value; - } + public pbc::RepeatedField LiquidVolumes { + get { return liquidVolumes_; } } /// Field number for the "Corrected" field. @@ -375,14 +290,7 @@ namespace Tango.PMR.Exports { if (L != other.L) return false; if (A != other.A) return false; if (B != other.B) return false; - if (V0 != other.V0) return false; - if (V1 != other.V1) return false; - if (V2 != other.V2) return false; - if (V3 != other.V3) return false; - if (V4 != other.V4) return false; - if (V5 != other.V5) return false; - if (V6 != other.V6) return false; - if (V7 != other.V7) return false; + if(!liquidVolumes_.Equals(other.liquidVolumes_)) return false; if (Corrected != other.Corrected) return false; if (ColorCatalogGuid != other.ColorCatalogGuid) return false; if (ColorCatalogItemGuid != other.ColorCatalogItemGuid) return false; @@ -404,14 +312,7 @@ namespace Tango.PMR.Exports { if (L != 0D) hash ^= L.GetHashCode(); if (A != 0D) hash ^= A.GetHashCode(); if (B != 0D) hash ^= B.GetHashCode(); - if (V0 != 0D) hash ^= V0.GetHashCode(); - if (V1 != 0D) hash ^= V1.GetHashCode(); - if (V2 != 0D) hash ^= V2.GetHashCode(); - if (V3 != 0D) hash ^= V3.GetHashCode(); - if (V4 != 0D) hash ^= V4.GetHashCode(); - if (V5 != 0D) hash ^= V5.GetHashCode(); - if (V6 != 0D) hash ^= V6.GetHashCode(); - if (V7 != 0D) hash ^= V7.GetHashCode(); + hash ^= liquidVolumes_.GetHashCode(); if (Corrected != false) hash ^= Corrected.GetHashCode(); if (ColorCatalogGuid.Length != 0) hash ^= ColorCatalogGuid.GetHashCode(); if (ColorCatalogItemGuid.Length != 0) hash ^= ColorCatalogItemGuid.GetHashCode(); @@ -473,38 +374,6 @@ namespace Tango.PMR.Exports { output.WriteRawTag(97); output.WriteDouble(B); } - if (V0 != 0D) { - output.WriteRawTag(105); - output.WriteDouble(V0); - } - if (V1 != 0D) { - output.WriteRawTag(113); - output.WriteDouble(V1); - } - if (V2 != 0D) { - output.WriteRawTag(121); - output.WriteDouble(V2); - } - if (V3 != 0D) { - output.WriteRawTag(129, 1); - output.WriteDouble(V3); - } - if (V4 != 0D) { - output.WriteRawTag(137, 1); - output.WriteDouble(V4); - } - if (V5 != 0D) { - output.WriteRawTag(145, 1); - output.WriteDouble(V5); - } - if (V6 != 0D) { - output.WriteRawTag(153, 1); - output.WriteDouble(V6); - } - if (V7 != 0D) { - output.WriteRawTag(161, 1); - output.WriteDouble(V7); - } if (Corrected != false) { output.WriteRawTag(168, 1); output.WriteBool(Corrected); @@ -517,6 +386,7 @@ namespace Tango.PMR.Exports { output.WriteRawTag(186, 1); output.WriteString(ColorCatalogItemGuid); } + liquidVolumes_.WriteTo(output, _repeated_liquidVolumes_codec); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -558,30 +428,7 @@ namespace Tango.PMR.Exports { if (B != 0D) { size += 1 + 8; } - if (V0 != 0D) { - size += 1 + 8; - } - if (V1 != 0D) { - size += 1 + 8; - } - if (V2 != 0D) { - size += 1 + 8; - } - if (V3 != 0D) { - size += 2 + 8; - } - if (V4 != 0D) { - size += 2 + 8; - } - if (V5 != 0D) { - size += 2 + 8; - } - if (V6 != 0D) { - size += 2 + 8; - } - if (V7 != 0D) { - size += 2 + 8; - } + size += liquidVolumes_.CalculateSize(_repeated_liquidVolumes_codec); if (Corrected != false) { size += 2 + 1; } @@ -635,30 +482,7 @@ namespace Tango.PMR.Exports { if (other.B != 0D) { B = other.B; } - if (other.V0 != 0D) { - V0 = other.V0; - } - if (other.V1 != 0D) { - V1 = other.V1; - } - if (other.V2 != 0D) { - V2 = other.V2; - } - if (other.V3 != 0D) { - V3 = other.V3; - } - if (other.V4 != 0D) { - V4 = other.V4; - } - if (other.V5 != 0D) { - V5 = other.V5; - } - if (other.V6 != 0D) { - V6 = other.V6; - } - if (other.V7 != 0D) { - V7 = other.V7; - } + liquidVolumes_.Add(other.liquidVolumes_); if (other.Corrected != false) { Corrected = other.Corrected; } @@ -726,38 +550,6 @@ namespace Tango.PMR.Exports { B = input.ReadDouble(); break; } - case 105: { - V0 = input.ReadDouble(); - break; - } - case 113: { - V1 = input.ReadDouble(); - break; - } - case 121: { - V2 = input.ReadDouble(); - break; - } - case 129: { - V3 = input.ReadDouble(); - break; - } - case 137: { - V4 = input.ReadDouble(); - break; - } - case 145: { - V5 = input.ReadDouble(); - break; - } - case 153: { - V6 = input.ReadDouble(); - break; - } - case 161: { - V7 = input.ReadDouble(); - break; - } case 168: { Corrected = input.ReadBool(); break; @@ -770,6 +562,10 @@ namespace Tango.PMR.Exports { ColorCatalogItemGuid = input.ReadString(); break; } + case 194: { + liquidVolumes_.AddEntriesFrom(input, _repeated_liquidVolumes_codec); + break; + } } } } diff --git a/Software/Visual_Studio/Tango.PMR/Exports/JobFileLiquidVolume.cs b/Software/Visual_Studio/Tango.PMR/Exports/JobFileLiquidVolume.cs new file mode 100644 index 000000000..ddd3f42ed --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Exports/JobFileLiquidVolume.cs @@ -0,0 +1,188 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: JobFileLiquidVolume.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.Exports { + + /// Holder for reflection information generated from JobFileLiquidVolume.proto + public static partial class JobFileLiquidVolumeReflection { + + #region Descriptor + /// File descriptor for JobFileLiquidVolume.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static JobFileLiquidVolumeReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChlKb2JGaWxlTGlxdWlkVm9sdW1lLnByb3RvEhFUYW5nby5QTVIuRXhwb3J0", + "cyI9ChNKb2JGaWxlTGlxdWlkVm9sdW1lEhYKDkxpcXVpZFR5cGVOYW1lGAEg", + "ASgJEg4KBlZvbHVtZRgCIAEoAUIdChtjb20udHdpbmUudGFuZ28ucG1yLmV4", + "cG9ydHNiBnByb3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Exports.JobFileLiquidVolume), global::Tango.PMR.Exports.JobFileLiquidVolume.Parser, new[]{ "LiquidTypeName", "Volume" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class JobFileLiquidVolume : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new JobFileLiquidVolume()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Exports.JobFileLiquidVolumeReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobFileLiquidVolume() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobFileLiquidVolume(JobFileLiquidVolume other) : this() { + liquidTypeName_ = other.liquidTypeName_; + volume_ = other.volume_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobFileLiquidVolume Clone() { + return new JobFileLiquidVolume(this); + } + + /// Field number for the "LiquidTypeName" field. + public const int LiquidTypeNameFieldNumber = 1; + private string liquidTypeName_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string LiquidTypeName { + get { return liquidTypeName_; } + set { + liquidTypeName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "Volume" field. + public const int VolumeFieldNumber = 2; + private double volume_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double Volume { + get { return volume_; } + set { + volume_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as JobFileLiquidVolume); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(JobFileLiquidVolume other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (LiquidTypeName != other.LiquidTypeName) return false; + if (Volume != other.Volume) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (LiquidTypeName.Length != 0) hash ^= LiquidTypeName.GetHashCode(); + if (Volume != 0D) hash ^= Volume.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (LiquidTypeName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(LiquidTypeName); + } + if (Volume != 0D) { + output.WriteRawTag(17); + output.WriteDouble(Volume); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (LiquidTypeName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(LiquidTypeName); + } + if (Volume != 0D) { + size += 1 + 8; + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(JobFileLiquidVolume other) { + if (other == null) { + return; + } + if (other.LiquidTypeName.Length != 0) { + LiquidTypeName = other.LiquidTypeName; + } + if (other.Volume != 0D) { + Volume = other.Volume; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 10: { + LiquidTypeName = input.ReadString(); + break; + } + case 17: { + Volume = input.ReadDouble(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj index b83f98fd6..2ede3ac5e 100644 --- a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj +++ b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj @@ -172,6 +172,7 @@ + @@ -305,7 +306,7 @@ - + \ No newline at end of file -- cgit v1.3.1