From b96d52dcf527339d4d1c43c06d49b375a5f42e0c Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Wed, 18 Mar 2020 18:30:55 +0200 Subject: Implemented machine counters on PPC maintenance. --- .../ViewModels/MaintenanceViewVM.cs | 40 ++++++++++++++++++++++ .../Views/MaintenanceView.xaml | 15 +++++++- 2 files changed, 54 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/PPC/Modules') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs index 8d221c3f3..759d43415 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs @@ -2,9 +2,11 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Data.Entity; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.BL; using Tango.Core.Commands; using Tango.Explorer; using Tango.Integration.Operation; @@ -39,6 +41,20 @@ namespace Tango.PPC.Maintenance.ViewModels set { _overallTemperature = value; RaisePropertyChangedAuto(); } } + private String _totalDyeTime; + public String TotalDyeTime + { + get { return _totalDyeTime; } + set { _totalDyeTime = value; RaisePropertyChangedAuto(); } + } + + private String _totalDyeMeters; + public String TotalDyeMeters + { + get { return _totalDyeMeters; } + set { _totalDyeMeters = value; RaisePropertyChangedAuto(); } + } + public RelayCommand ExportLogsCommand { get; set; } public OpenCloseDyeingHeadCommand OpenCloseDyeingHeadCommand { get; set; } @@ -167,5 +183,29 @@ namespace Tango.PPC.Maintenance.ViewModels } } } + + public async override void OnNavigatedTo() + { + base.OnNavigatedTo(); + + try + { + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + var jobRuns = await db.JobRuns.Select(x => new { x.StartDate, x.EndDate, x.EndPosition }).ToListAsync(); + + TotalDyeTime = TimeSpan.FromHours(jobRuns.Select(x => x.EndDate - x.StartDate).Sum(x => x.TotalHours)).ToString(@"hh\:mm\:ss"); + + int meters = (int)jobRuns.Select(x => x.EndPosition).Sum(); + TotalDyeMeters = $"{meters.ToString("N0")} meters"; + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error loading machine counters."); + TotalDyeTime = "error!"; + TotalDyeMeters = "error!"; + } + } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml index 538d4e96d..11e2dc663 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml @@ -11,7 +11,7 @@ xmlns:localControls="clr-namespace:Tango.PPC.Maintenance.Controls" xmlns:local="clr-namespace:Tango.PPC.Maintenance.Views" mc:Ignorable="d" - d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MaintenanceViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MaintenanceViewVM}"> + d:DesignHeight="1380" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MaintenanceViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MaintenanceViewVM}"> @@ -224,6 +224,19 @@ + + + + + Total Dye Time: + + + + + Total Dye Meters: + + + -- cgit v1.3.1 From 2ebbed964bdc4aa1c2889d6c4c0521b3ba1562aa Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sun, 22 Mar 2020 16:50:25 +0200 Subject: Dropped logging categories from settings on MS and PPC. Debug Logs Processing is done in real time from UI. --- .../ViewModels/ApplicationLogsViewVM.cs | 22 ++++++++++++++++------ .../Views/ApplicationLogsView.xaml | 2 +- .../MachineStudioSettings.cs | 6 ------ .../Tango.MachineStudio.UI/App.xaml.cs | 13 ------------- .../ViewModels/LoggingViewVM.cs | 19 +++++++++++++++++++ .../Tango.PPC.Technician/Views/LoggingView.xaml | 13 +++++++++++++ .../PPC/Tango.PPC.Common/PPCSettings.cs | 6 ------ .../Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs | 18 ------------------ 8 files changed, 49 insertions(+), 50 deletions(-) (limited to 'Software/Visual_Studio/PPC/Modules') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/ApplicationLogsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/ApplicationLogsViewVM.cs index 91cc677e0..a384c133d 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/ApplicationLogsViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/ApplicationLogsViewVM.cs @@ -59,14 +59,14 @@ namespace Tango.MachineStudio.Logging.ViewModels } } - private bool _displayDebug; + private bool _processDebugLogs; /// /// Gets or sets a value indicating whether display debug logs. /// - public bool DisplayDebug + public bool ProcessDebugLogs { - get { return _displayDebug; } - set { _displayDebug = value; RaisePropertyChangedAuto(); } + get { return _processDebugLogs; } + set { _processDebugLogs = value; RaisePropertyChangedAuto(); OnProcessDebugLogsChanged(); } } private LogItemBase _selectedLog; @@ -184,6 +184,18 @@ namespace Tango.MachineStudio.Logging.ViewModels _is_debug = LogManager.Categories.Contains(LogCategory.Debug); } + private void OnProcessDebugLogsChanged() + { + if (ProcessDebugLogs) + { + LogManager.Categories.Add(LogCategory.Debug); + } + else + { + LogManager.Categories.RemoveAll(x => x == LogCategory.Debug); + } + } + private void ApplyLogsFilter() { if ((_realTimePaused && _isRealTime) || !_isRealTime) @@ -204,8 +216,6 @@ namespace Tango.MachineStudio.Logging.ViewModels private void LogManager_NewLog(object sender, LogItemBase log) { - if (log.Category == LogCategory.Debug && !DisplayDebug) return; - if (!RealTimePaused) { InvokeUI(() => diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml index 4c291d0df..486c0751d 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml @@ -114,7 +114,7 @@ - Process Debug Logs + Enable Debug Logs diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs index 7a016b376..25dfc2dc8 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs @@ -56,11 +56,6 @@ namespace Tango.MachineStudio.Common /// public String LastVirtualMachineSerialNumber { get; set; } - /// - /// Gets or sets the logging categories. - /// - public List LoggingCategories { get; set; } - /// /// Gets or sets the last bounds. /// @@ -189,7 +184,6 @@ namespace Tango.MachineStudio.Common public MachineStudioSettings() { LastBounds = new Rect(); - LoggingCategories = new List(); DefaultIssueReportTags = new List(); StudioModulesBounds = new List(); Environment = WorkingEnvironment.Remote; diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs index cb17a5a83..2ea0ebd38 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs @@ -81,19 +81,6 @@ namespace Tango.MachineStudio.UI base.OnStartup(e); - LogManager.Categories.Clear(); - - - if (settings.LoggingCategories.Count == 0) - { - settings.LoggingCategories.Add(LogCategory.Critical); - settings.LoggingCategories.Add(LogCategory.Error); - settings.LoggingCategories.Add(LogCategory.Info); - settings.LoggingCategories.Add(LogCategory.Warning); - } - - LogManager.Categories.AddRange(settings.LoggingCategories); - exceptionTrapper = new WpfGlobalExceptionTrapper(); exceptionTrapper.Initialize(this); exceptionTrapper.ApplicationCrashed += ExceptionTrapper_ApplicationCrashed; diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/LoggingViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/LoggingViewVM.cs index 89ac7e87b..a0110b18a 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/LoggingViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/LoggingViewVM.cs @@ -68,6 +68,13 @@ namespace Tango.PPC.Technician.ViewModels set { _isPaused = value; RaisePropertyChangedAuto(); OnIsPausedChanged(); } } + private bool _processDebugLogs; + public bool ProcessDebugLogs + { + get { return _processDebugLogs; } + set { _processDebugLogs = value; RaisePropertyChangedAuto(); OnProcessDebugLogsChanged(); } + } + public RelayCommand ClearCommand { get; set; } public LoggingViewVM() @@ -112,6 +119,18 @@ namespace Tango.PPC.Technician.ViewModels }; } + private void OnProcessDebugLogsChanged() + { + if (ProcessDebugLogs) + { + LogManager.Categories.Add(LogCategory.Debug); + } + else + { + LogManager.Categories.RemoveAll(x => x == LogCategory.Debug); + } + } + private void OnIsPausedChanged() { foreach (var log in paused_logs) diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/LoggingView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/LoggingView.xaml index 07db49909..8393349ea 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/LoggingView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/LoggingView.xaml @@ -47,6 +47,19 @@ + + + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs index 71a417190..2c605ec36 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs @@ -20,11 +20,6 @@ namespace Tango.PPC.Common /// public class PPCSettings : SettingsBase { - /// - /// Gets or sets the logging categories. - /// - public List LoggingCategories { get; set; } - /// /// Gets or sets the state of the application. /// @@ -278,7 +273,6 @@ namespace Tango.PPC.Common EnableGradientGeneration = true; GradientGenerationResolution = 20; MachineScanningTimeoutSeconds = 20; - LoggingCategories = new List(); EmbeddedComPort = "COM10"; EmbeddedDeviceHint = "Tango USB Serial Port"; ExternalBridgePassword = "Aa123456"; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs index 8ee8f6a1a..ff0b1018b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs @@ -69,8 +69,6 @@ namespace Tango.PPC.UI exceptionTrapper.Initialize(this); exceptionTrapper.ApplicationCrashed += ExceptionTrapper_ApplicationCrashed; - LogManager.Categories.Clear(); - CoreSettings.DefaultDataSource = new DataSource() { Address = "localhost\\SQLEXPRESS", @@ -78,22 +76,6 @@ namespace Tango.PPC.UI IntegratedSecurity = true, }; - SettingsManager.Default.GetOrCreate(); - - var settings = SettingsManager.Default.GetOrCreate(); - - if (settings.LoggingCategories.Count == 0) - { - settings.LoggingCategories.Add(LogCategory.Critical); - settings.LoggingCategories.Add(LogCategory.Error); - settings.LoggingCategories.Add(LogCategory.Info); - settings.LoggingCategories.Add(LogCategory.Warning); - } - - settings.Save(); - - LogManager.Categories.AddRange(settings.LoggingCategories); - WebRequest.DefaultWebProxy = null; } -- cgit v1.3.1 From 37d47dd053e02118c5b314a3ec5e8f1f2b0fc8e6 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sun, 22 Mar 2020 18:34:00 +0200 Subject: Added new head cleaning parameters support. Added build up pressure to process parameters. --- Software/DB/PPC/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/PPC/Tango_log.ldf | Bin 53673984 -> 53673984 bytes Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 22675456 -> 22675456 bytes .../Messages/Printing/HeadCleaningParameters.proto | 9 ++ Software/PMR/Messages/Printing/JobTicket.proto | 2 + .../PMR/Messages/Printing/ProcessParameters.proto | 2 + .../Controls/JobOutlineControl.cs | 14 ++ .../Views/JobView.xaml | 2 +- .../Tango.MachineStudio.RML.csproj | 7 + .../Views/HeadCleaningParametersView.xaml | 56 ++++++++ .../Views/HeadCleaningParametersView.xaml.cs | 28 ++++ .../Tango.MachineStudio.RML/Views/RmlView.xaml | 19 ++- .../Views/ThreadParametersView.xaml | 31 +++- .../Tango.PPC.Jobs/Controls/JobOutlineControl.cs | 14 ++ .../Tango.BL/DTO/ProcessParametersTableDTOBase.cs | 8 ++ Software/Visual_Studio/Tango.BL/DTO/RmlDTOBase.cs | 8 ++ .../Entities/ProcessParametersTableBase.cs | 42 ++++++ .../Visual_Studio/Tango.BL/Entities/RmlBase.cs | 38 +++++ .../DB/PROCESS_PARAMETERS_TABLES.cs | 1 + Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs | 1 + .../Tango.DAL.Remote/DB/RemoteADO.Designer.cs | 2 +- .../Tango.DAL.Remote/DB/RemoteADO.edmx | 6 + .../Tango.DAL.Remote/DB/RemoteADO.edmx.diagram | 158 ++++++++++---------- .../Tango.Integration/Operation/MachineOperator.cs | 6 +- .../Tango.PMR/Printing/HeadCleaningParameters.cs | 160 +++++++++++++++++++++ .../Visual_Studio/Tango.PMR/Printing/JobTicket.cs | 70 ++++++--- .../Tango.PMR/Printing/ProcessParameters.cs | 36 ++++- Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj | 3 +- 29 files changed, 610 insertions(+), 113 deletions(-) create mode 100644 Software/PMR/Messages/Printing/HeadCleaningParameters.proto create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/HeadCleaningParametersView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/HeadCleaningParametersView.xaml.cs create mode 100644 Software/Visual_Studio/Tango.PMR/Printing/HeadCleaningParameters.cs (limited to 'Software/Visual_Studio/PPC/Modules') diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf index aebfaccbe..b785ddea1 100644 Binary files a/Software/DB/PPC/Tango.mdf and b/Software/DB/PPC/Tango.mdf differ diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf index 6eca6b42c..3f2b8561e 100644 Binary files a/Software/DB/PPC/Tango_log.ldf and b/Software/DB/PPC/Tango_log.ldf differ diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index e92ecfa41..e2f940f6a 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index 2e727d616..677ff5b5f 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/PMR/Messages/Printing/HeadCleaningParameters.proto b/Software/PMR/Messages/Printing/HeadCleaningParameters.proto new file mode 100644 index 000000000..ca5a20d74 --- /dev/null +++ b/Software/PMR/Messages/Printing/HeadCleaningParameters.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package Tango.PMR.Printing; +option java_package = "com.twine.tango.pmr.printing"; + +message HeadCleaningParameters +{ + double CleanerFlow = 1; +} diff --git a/Software/PMR/Messages/Printing/JobTicket.proto b/Software/PMR/Messages/Printing/JobTicket.proto index b442893cd..141adff01 100644 --- a/Software/PMR/Messages/Printing/JobTicket.proto +++ b/Software/PMR/Messages/Printing/JobTicket.proto @@ -6,6 +6,7 @@ import "JobWindingMethod.proto"; import "JobSpool.proto"; import "JobUploadStrategy.proto"; import "ThreadParameters.proto"; +import "HeadCleaningParameters.proto"; package Tango.PMR.Printing; option java_package = "com.twine.tango.pmr.printing"; @@ -38,4 +39,5 @@ message JobTicket bool SampleWinding = 14; ThreadParameters ThreadParameters = 15; + HeadCleaningParameters HeadCleaningParameters = 16; } \ No newline at end of file diff --git a/Software/PMR/Messages/Printing/ProcessParameters.proto b/Software/PMR/Messages/Printing/ProcessParameters.proto index 9dbc0e78b..0a483d9bb 100644 --- a/Software/PMR/Messages/Printing/ProcessParameters.proto +++ b/Software/PMR/Messages/Printing/ProcessParameters.proto @@ -76,4 +76,6 @@ message ProcessParameters double LBlowerTemp = 30; + double PressureBuildUp = 31; + } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Controls/JobOutlineControl.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Controls/JobOutlineControl.cs index 5a3f5d337..68dc7e3bf 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Controls/JobOutlineControl.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Controls/JobOutlineControl.cs @@ -150,6 +150,20 @@ namespace Tango.MachineStudio.Developer.Controls _sizeControl.Height += NORMAL_FONT_HEIGHT; } } + //JobTicket.HeadCleaningParameters + if (job.HeadCleaningParameters != null) + { + _sizeControl.Height += 20; + DrawHeaderText(drawingContext, "HEAD CLEANING PARAMETERS", 17, LevelOffset.level_0); + _sizeControl.Height += TITLE_FONT_HEIGHT; + _sizeControl.Height += 5.0; + basicProps = GetNameValueList(job.HeadCleaningParameters); + foreach (var prop in basicProps) + { + DrawNameValueText(drawingContext, prop, LevelOffset.level_1, PackIconKind.Settings); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + } + } //JobTicket.Segments if (job.Segments != null) { 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 ed8fc57fe..ed832f468 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 @@ -1553,7 +1553,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj index f448932a0..a413223c3 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj @@ -118,6 +118,9 @@ RmlView.xaml + + HeadCleaningParametersView.xaml + ThreadParametersView.xaml @@ -229,6 +232,10 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + MSBuild:Compile Designer diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/HeadCleaningParametersView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/HeadCleaningParametersView.xaml new file mode 100644 index 000000000..72e377c34 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/HeadCleaningParametersView.xaml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + HEAD CLEANING PARAMETERS + + + + + + + + + + CLEANER + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/HeadCleaningParametersView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/HeadCleaningParametersView.xaml.cs new file mode 100644 index 000000000..8d036efa5 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/HeadCleaningParametersView.xaml.cs @@ -0,0 +1,28 @@ +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; + +namespace Tango.MachineStudio.RML.Views +{ + /// + /// Interaction logic for SpoolsView.xaml + /// + public partial class HeadCleaningParametersView : UserControl + { + public HeadCleaningParametersView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml index e967c7d83..f425f2003 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml @@ -56,7 +56,13 @@ PROPERTIES - + + + + @@ -149,13 +155,16 @@ - + - + - + + + + @@ -214,7 +223,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ThreadParametersView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ThreadParametersView.xaml index 7f1ca2262..c083e9b02 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ThreadParametersView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ThreadParametersView.xaml @@ -35,7 +35,13 @@ FEEDER - + + + + @@ -49,7 +55,13 @@ PULLER - + + + + @@ -63,7 +75,13 @@ WINDER - + + + + @@ -83,7 +101,12 @@ ROCKERS - + + + + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobOutlineControl.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobOutlineControl.cs index 0d6a2f6be..78f8c90a1 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobOutlineControl.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobOutlineControl.cs @@ -157,6 +157,20 @@ namespace Tango.PPC.Jobs _sizeControl.Height += NORMAL_FONT_HEIGHT; } } + //JobTicket.HeadCleaningParameters + if (job.HeadCleaningParameters != null) + { + _sizeControl.Height += 20; + DrawHeaderText(drawingContext, "HEAD CLEANING PARAMETERS", 17, LevelOffset.level_0); + _sizeControl.Height += TITLE_FONT_HEIGHT; + _sizeControl.Height += 5.0; + basicProps = GetNameValueList(job.HeadCleaningParameters); + foreach (var prop in basicProps) + { + DrawNameValueText(drawingContext, prop, LevelOffset.level_1, TouchIconKind.Settings); + _sizeControl.Height += NORMAL_FONT_HEIGHT; + } + } //JobTicket.Segments if (job.Segments != null) { diff --git a/Software/Visual_Studio/Tango.BL/DTO/ProcessParametersTableDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/ProcessParametersTableDTOBase.cs index 2d431b9df..f0699bc72 100644 --- a/Software/Visual_Studio/Tango.BL/DTO/ProcessParametersTableDTOBase.cs +++ b/Software/Visual_Studio/Tango.BL/DTO/ProcessParametersTableDTOBase.cs @@ -277,5 +277,13 @@ namespace Tango.BL.DTO get; set; } + /// + /// pressure build up + /// + public Double PressureBuildUp + { + get; set; + } + } } diff --git a/Software/Visual_Studio/Tango.BL/DTO/RmlDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/RmlDTOBase.cs index c30f9c42b..dff2eec8b 100644 --- a/Software/Visual_Studio/Tango.BL/DTO/RmlDTOBase.cs +++ b/Software/Visual_Studio/Tango.BL/DTO/RmlDTOBase.cs @@ -349,5 +349,13 @@ namespace Tango.BL.DTO get; set; } + /// + /// cleaner flow + /// + public Int32 CleanerFlow + { + get; set; + } + } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTableBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTableBase.cs index 2d9f1e4fb..16acc7398 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTableBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTableBase.cs @@ -89,6 +89,8 @@ namespace Tango.BL.Entities public event EventHandler LBlowerTempChanged; + public event EventHandler PressureBuildUpChanged; + public event EventHandler ProcessParametersTablesGroupChanged; protected String _name; @@ -1074,6 +1076,37 @@ namespace Tango.BL.Entities } } + protected Double _pressurebuildup; + + /// + /// Gets or sets the processparameterstablebase pressure build up. + /// + + [Column("PRESSURE_BUILD_UP")] + + [StringFormat("0")] + + [PropertyIndex(29)] + + public Double PressureBuildUp + { + get + { + return _pressurebuildup; + } + + set + { + if (_pressurebuildup != value) + { + _pressurebuildup = value; + + OnPressureBuildUpChanged(value); + + } + } + } + protected ProcessParametersTablesGroup _processparameterstablesgroup; /// @@ -1385,6 +1418,15 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(LBlowerTemp)); } + /// + /// Called when the PressureBuildUp has changed. + /// + protected virtual void OnPressureBuildUpChanged(Double pressurebuildup) + { + PressureBuildUpChanged?.Invoke(this, pressurebuildup); + RaisePropertyChanged(nameof(PressureBuildUp)); + } + /// /// Called when the ProcessParametersTablesGroup has changed. /// diff --git a/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs b/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs index f56de3208..dc22ac33c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs @@ -95,6 +95,8 @@ namespace Tango.BL.Entities public event EventHandler BypassRockersChanged; + public event EventHandler CleanerFlowChanged; + public event EventHandler> CatsChanged; public event EventHandler CctChanged; @@ -1223,6 +1225,33 @@ namespace Tango.BL.Entities } } + protected Int32 _cleanerflow; + + /// + /// Gets or sets the rmlbase cleaner flow. + /// + + [Column("CLEANER_FLOW")] + + public Int32 CleanerFlow + { + get + { + return _cleanerflow; + } + + set + { + if (_cleanerflow != value) + { + _cleanerflow = value; + + OnCleanerFlowChanged(value); + + } + } + } + protected SynchronizedObservableCollection _cats; /// @@ -1928,6 +1957,15 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(BypassRockers)); } + /// + /// Called when the CleanerFlow has changed. + /// + protected virtual void OnCleanerFlowChanged(Int32 cleanerflow) + { + CleanerFlowChanged?.Invoke(this, cleanerflow); + RaisePropertyChanged(nameof(CleanerFlow)); + } + /// /// Called when the Cats has changed. /// diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/PROCESS_PARAMETERS_TABLES.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/PROCESS_PARAMETERS_TABLES.cs index 2a04633bf..5896f742e 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/PROCESS_PARAMETERS_TABLES.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/PROCESS_PARAMETERS_TABLES.cs @@ -49,6 +49,7 @@ namespace Tango.DAL.Remote.DB public double R_BLOWER_TEMP { get; set; } public double L_BLOWER_FLOW { get; set; } public double L_BLOWER_TEMP { get; set; } + public double PRESSURE_BUILD_UP { get; set; } public virtual PROCESS_PARAMETERS_TABLES_GROUPS PROCESS_PARAMETERS_TABLES_GROUPS { get; set; } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs index 17eb2ec66..fc7354e0e 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs @@ -70,6 +70,7 @@ namespace Tango.DAL.Remote.DB public int WINDER_I { get; set; } public int WINDER_D { get; set; } public bool BYPASS_ROCKERS { get; set; } + public int CLEANER_FLOW { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection CATS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Designer.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Designer.cs index 17bc2683d..d26e67908 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Designer.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Designer.cs @@ -1,4 +1,4 @@ -// T4 code generation is enabled for model 'D:\Development\Tango\Software\Visual_Studio\Tango.DAL.Remote\DB\RemoteADO.edmx'. +// T4 code generation is enabled for model 'C:\DATA\Development\Tango\Software\Visual_Studio\Tango.DAL.Remote\DB\RemoteADO.edmx'. // To enable legacy code generation, change the value of the 'Code Generation Strategy' designer // property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model // is open in the designer. diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx index 3cf2baaba..0a4a052a6 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -889,6 +889,7 @@ + @@ -950,6 +951,7 @@ + @@ -4227,6 +4229,7 @@ + @@ -4291,6 +4294,7 @@ + @@ -6657,6 +6661,7 @@ + @@ -6711,6 +6716,7 @@ + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram index a69b91e87..93f29852f 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,85 +5,85 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index b17321942..f432c2e69 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -2288,7 +2288,7 @@ namespace Tango.Integration.Operation ticket.Spool.LimitSwitchStartPointOffset = machineSpool.LimitSwitchStartPointOffset != null ? machineSpool.LimitSwitchStartPointOffset.Value : ticket.Spool.LimitSwitchStartPointOffset; } - //Thread parameters + //Thread Parameters ticket.ThreadParameters = new ThreadParameters(); job.Rml.MapPrimitivesTo(ticket.ThreadParameters); @@ -2296,6 +2296,10 @@ namespace Tango.Integration.Operation processParameters.MapPrimitivesTo(process); ticket.ProcessParameters = process; + //Head Cleaning Parameters + ticket.HeadCleaningParameters = new HeadCleaningParameters(); + ticket.HeadCleaningParameters.CleanerFlow = job.Rml.CleanerFlow; + JobHandler handler = null; StorageFileHandler fileUploadHandler = null; diff --git a/Software/Visual_Studio/Tango.PMR/Printing/HeadCleaningParameters.cs b/Software/Visual_Studio/Tango.PMR/Printing/HeadCleaningParameters.cs new file mode 100644 index 000000000..e086fdddf --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Printing/HeadCleaningParameters.cs @@ -0,0 +1,160 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: HeadCleaningParameters.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.Printing { + + /// Holder for reflection information generated from HeadCleaningParameters.proto + public static partial class HeadCleaningParametersReflection { + + #region Descriptor + /// File descriptor for HeadCleaningParameters.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static HeadCleaningParametersReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChxIZWFkQ2xlYW5pbmdQYXJhbWV0ZXJzLnByb3RvEhJUYW5nby5QTVIuUHJp", + "bnRpbmciLQoWSGVhZENsZWFuaW5nUGFyYW1ldGVycxITCgtDbGVhbmVyRmxv", + "dxgBIAEoAUIeChxjb20udHdpbmUudGFuZ28ucG1yLnByaW50aW5nYgZwcm90", + "bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Printing.HeadCleaningParameters), global::Tango.PMR.Printing.HeadCleaningParameters.Parser, new[]{ "CleanerFlow" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class HeadCleaningParameters : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HeadCleaningParameters()); + [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.Printing.HeadCleaningParametersReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HeadCleaningParameters() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HeadCleaningParameters(HeadCleaningParameters other) : this() { + cleanerFlow_ = other.cleanerFlow_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HeadCleaningParameters Clone() { + return new HeadCleaningParameters(this); + } + + /// Field number for the "CleanerFlow" field. + public const int CleanerFlowFieldNumber = 1; + private double cleanerFlow_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double CleanerFlow { + get { return cleanerFlow_; } + set { + cleanerFlow_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as HeadCleaningParameters); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(HeadCleaningParameters other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (CleanerFlow != other.CleanerFlow) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (CleanerFlow != 0D) hash ^= CleanerFlow.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 (CleanerFlow != 0D) { + output.WriteRawTag(9); + output.WriteDouble(CleanerFlow); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (CleanerFlow != 0D) { + size += 1 + 8; + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(HeadCleaningParameters other) { + if (other == null) { + return; + } + if (other.CleanerFlow != 0D) { + CleanerFlow = other.CleanerFlow; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 9: { + CleanerFlow = input.ReadDouble(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Printing/JobTicket.cs b/Software/Visual_Studio/Tango.PMR/Printing/JobTicket.cs index 0431913a4..8e314704d 100644 --- a/Software/Visual_Studio/Tango.PMR/Printing/JobTicket.cs +++ b/Software/Visual_Studio/Tango.PMR/Printing/JobTicket.cs @@ -25,25 +25,27 @@ namespace Tango.PMR.Printing { "Cg9Kb2JUaWNrZXQucHJvdG8SElRhbmdvLlBNUi5QcmludGluZxoQSm9iU2Vn", "bWVudC5wcm90bxoXUHJvY2Vzc1BhcmFtZXRlcnMucHJvdG8aFkpvYldpbmRp", "bmdNZXRob2QucHJvdG8aDkpvYlNwb29sLnByb3RvGhdKb2JVcGxvYWRTdHJh", - "dGVneS5wcm90bxoWVGhyZWFkUGFyYW1ldGVycy5wcm90byKxBAoJSm9iVGlj", - "a2V0EgwKBEd1aWQYASABKAkSDAoETmFtZRgCIAEoCRIaChJFbmFibGVJbnRl", - "clNlZ21lbnQYAyABKAgSGgoSSW50ZXJTZWdtZW50TGVuZ3RoGAQgASgBEg4K", - "Bkxlbmd0aBgFIAEoARJAChFQcm9jZXNzUGFyYW1ldGVycxgGIAEoCzIlLlRh", - "bmdvLlBNUi5QcmludGluZy5Qcm9jZXNzUGFyYW1ldGVycxI7Cg1XaW5kaW5n", - "TWV0aG9kGAcgASgOMiQuVGFuZ28uUE1SLlByaW50aW5nLkpvYldpbmRpbmdN", - "ZXRob2QSKwoFU3Bvb2wYCCABKAsyHC5UYW5nby5QTVIuUHJpbnRpbmcuSm9i", - "U3Bvb2wSMAoIU2VnbWVudHMYCSADKAsyHi5UYW5nby5QTVIuUHJpbnRpbmcu", - "Sm9iU2VnbWVudBI9Cg5VcGxvYWRTdHJhdGVneRgKIAEoDjIlLlRhbmdvLlBN", - "Ui5QcmludGluZy5Kb2JVcGxvYWRTdHJhdGVneRIaChJKb2JEZXNjcmlwdGlv", - "bkZpbGUYCyABKAkSGQoRRW5hYmxlTHVicmljYXRpb24YDCABKAgSFQoNTnVt", - "YmVyT2ZVbml0cxgNIAEoDRIVCg1TYW1wbGVXaW5kaW5nGA4gASgIEj4KEFRo", - "cmVhZFBhcmFtZXRlcnMYDyABKAsyJC5UYW5nby5QTVIuUHJpbnRpbmcuVGhy", - "ZWFkUGFyYW1ldGVyc0IeChxjb20udHdpbmUudGFuZ28ucG1yLnByaW50aW5n", - "YgZwcm90bzM=")); + "dGVneS5wcm90bxoWVGhyZWFkUGFyYW1ldGVycy5wcm90bxocSGVhZENsZWFu", + "aW5nUGFyYW1ldGVycy5wcm90byL9BAoJSm9iVGlja2V0EgwKBEd1aWQYASAB", + "KAkSDAoETmFtZRgCIAEoCRIaChJFbmFibGVJbnRlclNlZ21lbnQYAyABKAgS", + "GgoSSW50ZXJTZWdtZW50TGVuZ3RoGAQgASgBEg4KBkxlbmd0aBgFIAEoARJA", + "ChFQcm9jZXNzUGFyYW1ldGVycxgGIAEoCzIlLlRhbmdvLlBNUi5QcmludGlu", + "Zy5Qcm9jZXNzUGFyYW1ldGVycxI7Cg1XaW5kaW5nTWV0aG9kGAcgASgOMiQu", + "VGFuZ28uUE1SLlByaW50aW5nLkpvYldpbmRpbmdNZXRob2QSKwoFU3Bvb2wY", + "CCABKAsyHC5UYW5nby5QTVIuUHJpbnRpbmcuSm9iU3Bvb2wSMAoIU2VnbWVu", + "dHMYCSADKAsyHi5UYW5nby5QTVIuUHJpbnRpbmcuSm9iU2VnbWVudBI9Cg5V", + "cGxvYWRTdHJhdGVneRgKIAEoDjIlLlRhbmdvLlBNUi5QcmludGluZy5Kb2JV", + "cGxvYWRTdHJhdGVneRIaChJKb2JEZXNjcmlwdGlvbkZpbGUYCyABKAkSGQoR", + "RW5hYmxlTHVicmljYXRpb24YDCABKAgSFQoNTnVtYmVyT2ZVbml0cxgNIAEo", + "DRIVCg1TYW1wbGVXaW5kaW5nGA4gASgIEj4KEFRocmVhZFBhcmFtZXRlcnMY", + "DyABKAsyJC5UYW5nby5QTVIuUHJpbnRpbmcuVGhyZWFkUGFyYW1ldGVycxJK", + "ChZIZWFkQ2xlYW5pbmdQYXJhbWV0ZXJzGBAgASgLMiouVGFuZ28uUE1SLlBy", + "aW50aW5nLkhlYWRDbGVhbmluZ1BhcmFtZXRlcnNCHgocY29tLnR3aW5lLnRh", + "bmdvLnBtci5wcmludGluZ2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Tango.PMR.Printing.JobSegmentReflection.Descriptor, global::Tango.PMR.Printing.ProcessParametersReflection.Descriptor, global::Tango.PMR.Printing.JobWindingMethodReflection.Descriptor, global::Tango.PMR.Printing.JobSpoolReflection.Descriptor, global::Tango.PMR.Printing.JobUploadStrategyReflection.Descriptor, global::Tango.PMR.Printing.ThreadParametersReflection.Descriptor, }, + new pbr::FileDescriptor[] { global::Tango.PMR.Printing.JobSegmentReflection.Descriptor, global::Tango.PMR.Printing.ProcessParametersReflection.Descriptor, global::Tango.PMR.Printing.JobWindingMethodReflection.Descriptor, global::Tango.PMR.Printing.JobSpoolReflection.Descriptor, global::Tango.PMR.Printing.JobUploadStrategyReflection.Descriptor, global::Tango.PMR.Printing.ThreadParametersReflection.Descriptor, global::Tango.PMR.Printing.HeadCleaningParametersReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Printing.JobTicket), global::Tango.PMR.Printing.JobTicket.Parser, new[]{ "Guid", "Name", "EnableInterSegment", "InterSegmentLength", "Length", "ProcessParameters", "WindingMethod", "Spool", "Segments", "UploadStrategy", "JobDescriptionFile", "EnableLubrication", "NumberOfUnits", "SampleWinding", "ThreadParameters" }, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Printing.JobTicket), global::Tango.PMR.Printing.JobTicket.Parser, new[]{ "Guid", "Name", "EnableInterSegment", "InterSegmentLength", "Length", "ProcessParameters", "WindingMethod", "Spool", "Segments", "UploadStrategy", "JobDescriptionFile", "EnableLubrication", "NumberOfUnits", "SampleWinding", "ThreadParameters", "HeadCleaningParameters" }, null, null, null) })); } #endregion @@ -89,6 +91,7 @@ namespace Tango.PMR.Printing { numberOfUnits_ = other.numberOfUnits_; sampleWinding_ = other.sampleWinding_; ThreadParameters = other.threadParameters_ != null ? other.ThreadParameters.Clone() : null; + HeadCleaningParameters = other.headCleaningParameters_ != null ? other.HeadCleaningParameters.Clone() : null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -263,6 +266,17 @@ namespace Tango.PMR.Printing { } } + /// Field number for the "HeadCleaningParameters" field. + public const int HeadCleaningParametersFieldNumber = 16; + private global::Tango.PMR.Printing.HeadCleaningParameters headCleaningParameters_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tango.PMR.Printing.HeadCleaningParameters HeadCleaningParameters { + get { return headCleaningParameters_; } + set { + headCleaningParameters_ = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as JobTicket); @@ -291,6 +305,7 @@ namespace Tango.PMR.Printing { if (NumberOfUnits != other.NumberOfUnits) return false; if (SampleWinding != other.SampleWinding) return false; if (!object.Equals(ThreadParameters, other.ThreadParameters)) return false; + if (!object.Equals(HeadCleaningParameters, other.HeadCleaningParameters)) return false; return true; } @@ -312,6 +327,7 @@ namespace Tango.PMR.Printing { if (NumberOfUnits != 0) hash ^= NumberOfUnits.GetHashCode(); if (SampleWinding != false) hash ^= SampleWinding.GetHashCode(); if (threadParameters_ != null) hash ^= ThreadParameters.GetHashCode(); + if (headCleaningParameters_ != null) hash ^= HeadCleaningParameters.GetHashCode(); return hash; } @@ -379,6 +395,10 @@ namespace Tango.PMR.Printing { output.WriteRawTag(122); output.WriteMessage(ThreadParameters); } + if (headCleaningParameters_ != null) { + output.WriteRawTag(130, 1); + output.WriteMessage(HeadCleaningParameters); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -427,6 +447,9 @@ namespace Tango.PMR.Printing { if (threadParameters_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(ThreadParameters); } + if (headCleaningParameters_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(HeadCleaningParameters); + } return size; } @@ -487,6 +510,12 @@ namespace Tango.PMR.Printing { } ThreadParameters.MergeFrom(other.ThreadParameters); } + if (other.headCleaningParameters_ != null) { + if (headCleaningParameters_ == null) { + headCleaningParameters_ = new global::Tango.PMR.Printing.HeadCleaningParameters(); + } + HeadCleaningParameters.MergeFrom(other.HeadCleaningParameters); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -566,6 +595,13 @@ namespace Tango.PMR.Printing { input.ReadMessage(threadParameters_); break; } + case 130: { + if (headCleaningParameters_ == null) { + headCleaningParameters_ = new global::Tango.PMR.Printing.HeadCleaningParameters(); + } + input.ReadMessage(headCleaningParameters_); + break; + } } } } diff --git a/Software/Visual_Studio/Tango.PMR/Printing/ProcessParameters.cs b/Software/Visual_Studio/Tango.PMR/Printing/ProcessParameters.cs index ef290e431..b0c29288f 100644 --- a/Software/Visual_Studio/Tango.PMR/Printing/ProcessParameters.cs +++ b/Software/Visual_Studio/Tango.PMR/Printing/ProcessParameters.cs @@ -23,7 +23,7 @@ namespace Tango.PMR.Printing { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "ChdQcm9jZXNzUGFyYW1ldGVycy5wcm90bxISVGFuZ28uUE1SLlByaW50aW5n", - "IrkFChFQcm9jZXNzUGFyYW1ldGVycxITCgtEeWVpbmdTcGVlZBgBIAEoARIU", + "ItIFChFQcm9jZXNzUGFyYW1ldGVycxITCgtEeWVpbmdTcGVlZBgBIAEoARIU", "CgxNaW5JbmtVcHRha2UYAiABKAESFAoMTWF4SW5rVXB0YWtlGAMgASgBEhUK", "DUZlZWRlclRlbnNpb24YBCABKAESFQoNUHVsbGVyVGVuc2lvbhgFIAEoARIV", "Cg1XaW5kZXJUZW5zaW9uGAYgASgBEhEKCU1peGVyVGVtcBgHIAEoARIVCg1I", @@ -38,12 +38,12 @@ namespace Tango.PMR.Printing { "IAEoARIWCg5IZWFkWm9uZTEwVGVtcBgYIAEoARIWCg5IZWFkWm9uZTExVGVt", "cBgZIAEoARIWCg5IZWFkWm9uZTEyVGVtcBgaIAEoARITCgtSQmxvd2VyRmxv", "dxgbIAEoARITCgtSQmxvd2VyVGVtcBgcIAEoARITCgtMQmxvd2VyRmxvdxgd", - "IAEoARITCgtMQmxvd2VyVGVtcBgeIAEoAUIeChxjb20udHdpbmUudGFuZ28u", - "cG1yLnByaW50aW5nYgZwcm90bzM=")); + "IAEoARITCgtMQmxvd2VyVGVtcBgeIAEoARIXCg9QcmVzc3VyZUJ1aWxkVXAY", + "HyABKAFCHgocY29tLnR3aW5lLnRhbmdvLnBtci5wcmludGluZ2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Printing.ProcessParameters), global::Tango.PMR.Printing.ProcessParameters.Parser, new[]{ "DyeingSpeed", "MinInkUptake", "MaxInkUptake", "FeederTension", "PullerTension", "WinderTension", "MixerTemp", "HeadZone1Temp", "HeadZone2Temp", "HeadZone3Temp", "HeadZone4Temp", "HeadZone5Temp", "HeadZone6Temp", "DryerAirFlow", "DryerZone1Temp", "DryerZone2Temp", "DryerZone3Temp", "DryerBufferLength", "HeadAirFlow", "TableIndex", "HeadZone7Temp", "HeadZone8Temp", "HeadZone9Temp", "HeadZone10Temp", "HeadZone11Temp", "HeadZone12Temp", "RBlowerFlow", "RBlowerTemp", "LBlowerFlow", "LBlowerTemp" }, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Printing.ProcessParameters), global::Tango.PMR.Printing.ProcessParameters.Parser, new[]{ "DyeingSpeed", "MinInkUptake", "MaxInkUptake", "FeederTension", "PullerTension", "WinderTension", "MixerTemp", "HeadZone1Temp", "HeadZone2Temp", "HeadZone3Temp", "HeadZone4Temp", "HeadZone5Temp", "HeadZone6Temp", "DryerAirFlow", "DryerZone1Temp", "DryerZone2Temp", "DryerZone3Temp", "DryerBufferLength", "HeadAirFlow", "TableIndex", "HeadZone7Temp", "HeadZone8Temp", "HeadZone9Temp", "HeadZone10Temp", "HeadZone11Temp", "HeadZone12Temp", "RBlowerFlow", "RBlowerTemp", "LBlowerFlow", "LBlowerTemp", "PressureBuildUp" }, null, null, null) })); } #endregion @@ -104,6 +104,7 @@ namespace Tango.PMR.Printing { rBlowerTemp_ = other.rBlowerTemp_; lBlowerFlow_ = other.lBlowerFlow_; lBlowerTemp_ = other.lBlowerTemp_; + pressureBuildUp_ = other.pressureBuildUp_; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -441,6 +442,17 @@ namespace Tango.PMR.Printing { } } + /// Field number for the "PressureBuildUp" field. + public const int PressureBuildUpFieldNumber = 31; + private double pressureBuildUp_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double PressureBuildUp { + get { return pressureBuildUp_; } + set { + pressureBuildUp_ = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as ProcessParameters); @@ -484,6 +496,7 @@ namespace Tango.PMR.Printing { if (RBlowerTemp != other.RBlowerTemp) return false; if (LBlowerFlow != other.LBlowerFlow) return false; if (LBlowerTemp != other.LBlowerTemp) return false; + if (PressureBuildUp != other.PressureBuildUp) return false; return true; } @@ -520,6 +533,7 @@ namespace Tango.PMR.Printing { if (RBlowerTemp != 0D) hash ^= RBlowerTemp.GetHashCode(); if (LBlowerFlow != 0D) hash ^= LBlowerFlow.GetHashCode(); if (LBlowerTemp != 0D) hash ^= LBlowerTemp.GetHashCode(); + if (PressureBuildUp != 0D) hash ^= PressureBuildUp.GetHashCode(); return hash; } @@ -650,6 +664,10 @@ namespace Tango.PMR.Printing { output.WriteRawTag(241, 1); output.WriteDouble(LBlowerTemp); } + if (PressureBuildUp != 0D) { + output.WriteRawTag(249, 1); + output.WriteDouble(PressureBuildUp); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -745,6 +763,9 @@ namespace Tango.PMR.Printing { if (LBlowerTemp != 0D) { size += 2 + 8; } + if (PressureBuildUp != 0D) { + size += 2 + 8; + } return size; } @@ -843,6 +864,9 @@ namespace Tango.PMR.Printing { if (other.LBlowerTemp != 0D) { LBlowerTemp = other.LBlowerTemp; } + if (other.PressureBuildUp != 0D) { + PressureBuildUp = other.PressureBuildUp; + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -973,6 +997,10 @@ namespace Tango.PMR.Printing { LBlowerTemp = input.ReadDouble(); break; } + case 249: { + PressureBuildUp = input.ReadDouble(); + break; + } } } } diff --git a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj index d7b2203dd..277687384 100644 --- a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj +++ b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj @@ -269,6 +269,7 @@ + @@ -325,7 +326,7 @@ - + \ No newline at end of file -- cgit v1.3.1 From e3f44f81af2cc5a650041d06fe2106937af03560 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Wed, 25 Mar 2020 06:02:06 +0200 Subject: Several bug fixes. --- .../PMR/Messages/Integration/UpdateStatus.proto | 17 ++++---- .../Connection/DefaultMachineProvider.cs | 4 +- .../FileSystem/DefaultFileSystemProvider.cs | 45 ++++++++++++++++++---- .../Performance/DefaultPerformanceProvider.cs | 5 ++- .../Dialogs/CatalogSelectionView.xaml | 2 +- .../Tango.Integration/Operation/JobHandler.cs | 9 +++++ .../Tango.Integration/Operation/MachineOperator.cs | 2 +- .../Tango.Integration/Operation/MachineStatuses.cs | 20 +++++----- .../Tango.PMR/Integration/UpdateStatus.cs | 29 +++++++------- .../Visual_Studio/Tango.Transport/ITransporter.cs | 7 ++++ .../Tango.Transport/TransporterBase.cs | 16 ++++++++ .../Tango.WebRTC/WebRtcTransportAdapter.cs | 8 ++-- 12 files changed, 117 insertions(+), 47 deletions(-) (limited to 'Software/Visual_Studio/PPC/Modules') diff --git a/Software/PMR/Messages/Integration/UpdateStatus.proto b/Software/PMR/Messages/Integration/UpdateStatus.proto index 373705ed8..9cf98a9db 100644 --- a/Software/PMR/Messages/Integration/UpdateStatus.proto +++ b/Software/PMR/Messages/Integration/UpdateStatus.proto @@ -6,12 +6,13 @@ option java_package = "com.twine.tango.pmr.integration"; enum UpdateStatus { Disconnected = 0; - Standby = 1; - ReadyToDye = 2; - GettingReady = 3; - Printing = 4; - Service = 5; - Upgrading = 6; - ShuttingDown = 7; - Error = 8; + PowerUp = 1; + Standby = 2; + ReadyToDye = 3; + GettingReady = 4; + Printing = 5; + Service = 6; + Upgrading = 7; + ShuttingDown = 8; + Error = 9; } \ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs index d76acd60e..c97837fcf 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs @@ -337,7 +337,9 @@ namespace Tango.FSE.UI.Connection if (MachineOperator is ExternalBridgeTcpClient) { - (MachineOperator as ExternalBridgeTcpClient).EnableApplicationLogs = true; + ExternalBridgeTcpClient tcpClient = MachineOperator as ExternalBridgeTcpClient; + tcpClient.EnableApplicationLogs = true; + tcpClient.InjectApplicationLogsToDefaultLogManager = false; } } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/FileSystem/DefaultFileSystemProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/FileSystem/DefaultFileSystemProvider.cs index b13b797e9..6f25e1774 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/FileSystem/DefaultFileSystemProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/FileSystem/DefaultFileSystemProvider.cs @@ -25,7 +25,8 @@ namespace Tango.FSE.UI.FileSystem private BasicTransporter _webRtcTransporter; private const string WEB_RTC_CHANNEL_NAME = "FileSystemChannel"; private const long MAX_CHUNK_SIZE = 1024 * 10; - private const long MAX_CHUNK_SIZE_WEB_RTC = 1024 * 15; + private const long MAX_CHUNK_SIZE_WEB_RTC = 1024 * 50; + private const int WEB_RTC_MAX_RETRIES = 8; private List _activeHandlers; private bool _enableWebRTC; @@ -52,7 +53,7 @@ namespace Tango.FSE.UI.FileSystem _machineProvider.MachineDisconnected += _machineProvider_MachineDisconnected; } - private void _machineProvider_MachineDisconnected(object sender, MachineDisconnectedEventArgs e) + private async void _machineProvider_MachineDisconnected(object sender, MachineDisconnectedEventArgs e) { IsWebRtcAvailable = false; @@ -69,6 +70,19 @@ namespace Tango.FSE.UI.FileSystem } _activeHandlers.Clear(); + + if (_webRtcTransporter != null) + { + try + { + LogManager.Log("Machine disconnected. Disconnecting FileSystem WebRTC Transporter..."); + await _webRtcTransporter.Disconnect(); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error while disconnecting FileSystem WebRTC Transporter."); + } + } } private async void _machineProvider_MachineConnected(object sender, MachineConnectedEventArgs e) @@ -100,8 +114,6 @@ namespace Tango.FSE.UI.FileSystem catch (Exception ex) { IsWebRtcAvailable = false; - EnableWebRTC = false; - LogManager.Log(ex, "Error initializing FileSystem via WebRTC."); } } @@ -226,6 +238,7 @@ namespace Tango.FSE.UI.FileSystem long position = 0; bool webRtcFailed = false; + int webRtcRetries = WEB_RTC_MAX_RETRIES; var tempFile = TemporaryManager.CreateFile(); @@ -252,18 +265,34 @@ namespace Tango.FSE.UI.FileSystem try { request.MaxChunkSize = MAX_CHUNK_SIZE_WEB_RTC; - response = await _webRtcTransporter.SendGenericRequest(request, new TransportRequestConfig() { Timeout = TimeSpan.FromSeconds(30), Priority = QueuePriority.Low }); + response = await _webRtcTransporter.SendGenericRequest(request, new TransportRequestConfig() + { + Timeout = TimeSpan.FromSeconds(2), + Priority = QueuePriority.Low + }); + + webRtcRetries = WEB_RTC_MAX_RETRIES; } catch (Exception ex) { - webRtcFailed = true; - LogManager.Log(ex, "WebRTC chunk download failed. Falling back to standard download..."); + webRtcRetries--; + + if (webRtcRetries == 0) + { + webRtcFailed = true; + LogManager.Log(ex, "WebRTC chunk download failed. Falling back to standard download..."); + } + continue; } } else { - response = await _machineProvider.MachineOperator.SendGenericRequest(request, new TransportRequestConfig() { Timeout = TimeSpan.FromSeconds(30), Priority = QueuePriority.Low }); + response = await _machineProvider.MachineOperator.SendGenericRequest(request, new TransportRequestConfig() + { + Timeout = TimeSpan.FromSeconds(30), + Priority = QueuePriority.Low + }); } using (FileStream fs = new FileStream(tempFile, FileMode.Append)) diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Performance/DefaultPerformanceProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Performance/DefaultPerformanceProvider.cs index c9b5d8bbb..69184290a 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Performance/DefaultPerformanceProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Performance/DefaultPerformanceProvider.cs @@ -31,7 +31,10 @@ namespace Tango.FSE.UI.Performance OnPerformancePackageAvailable(response.Package); }, (ex) => { - LogManager.Log(ex, "Error starting performance updates."); + if (!(ex is Transport.TransporterDisconnectedException)) + { + LogManager.Log(ex, "Error starting performance updates."); + } }, () => { //Do nothing. diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/CatalogSelectionView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/CatalogSelectionView.xaml index ded395e08..128a93548 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/CatalogSelectionView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/CatalogSelectionView.xaml @@ -56,7 +56,7 @@ - + diff --git a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs index fa6d37377..96c2ea4c4 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs @@ -256,6 +256,7 @@ namespace Tango.Integration.Operation internal void RaiseCompleted() { //This will compensate on any missing progress from Shlomo, but also will tell the wrong progress if job is really completed with a large progress mistake. + // Might be worth to compensate only on small drifts like the below (ProgressMinusSettingsUp)... //InvalidateJobProgress(new JobStatus() //{ // Progress = Status.TotalProgress, @@ -263,6 +264,14 @@ namespace Tango.Integration.Operation //}); LogManager.Log($"Job completed at position {Status.Progress}/{Status.TotalProgress}..."); + + //If drift is smaller than 10cm auto correct it. + if (Math.Abs(Status.TotalProgressMinusSettingUp - Status.ProgressMinusSettingUp) < 0.1) + { + LogManager.Log($"Job completed with a small drift in the progress minus settings up calculation. ({Status.ProgressMinusSettingUp}/{Status.TotalProgressMinusSettingUp}). Compensating..."); + Status.ProgressMinusSettingUp = Status.TotalProgressMinusSettingUp; + } + Status.Segments.Last().Completed = true; Status.RemainingUnits = 0; Status.IsFinalizing = false; diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index b29ffd6e3..cad9f80c7 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -2329,6 +2329,7 @@ namespace Tango.Integration.Operation if (handler.CanCancel) { handler.CanCancel = false; + handler.IsCanceled = true; LogManager.Log("Aborting current job..."); LogManager.Log($"Aborting current gradient generation..."); GradientGenerationConfiguration.AbortCurrentGeneration(); @@ -2351,7 +2352,6 @@ namespace Tango.Integration.Operation if (requestSent) { var result = await SendRequest(new AbortJobRequest(), new TransportRequestConfig() { ShouldLog = true }); - handler.IsCanceled = true; } SaveLastJobLiquidQuantities(clonedJob, originalJob.Machine.Configuration, processParameters, handler); diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineStatuses.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineStatuses.cs index d9a5d9f3f..fb21b27fa 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineStatuses.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineStatuses.cs @@ -10,24 +10,24 @@ namespace Tango.Integration.Operation public enum MachineStatuses { [Description("Disconnected")] - Disconnected, + Disconnected = 0, [Description("Getting Ready")] - PowerUp, + PowerUp = 1, [Description("Standby")] - Standby, + Standby = 2, [Description("Ready To Dye")] - ReadyToDye, + ReadyToDye = 3, [Description("Getting Ready")] - GettingReady, + GettingReady = 4, [Description("Dyeing")] - Printing, + Printing = 5, [Description("Service")] - Service, + Service = 6, [Description("Upgrading")] - Upgrading, + Upgrading = 7, [Description("Shutting Down")] - ShuttingDown, + ShuttingDown = 8, [Description("Error")] - Error, + Error = 9, } } diff --git a/Software/Visual_Studio/Tango.PMR/Integration/UpdateStatus.cs b/Software/Visual_Studio/Tango.PMR/Integration/UpdateStatus.cs index b15f24799..bdf5fba08 100644 --- a/Software/Visual_Studio/Tango.PMR/Integration/UpdateStatus.cs +++ b/Software/Visual_Studio/Tango.PMR/Integration/UpdateStatus.cs @@ -22,12 +22,12 @@ namespace Tango.PMR.Integration { static UpdateStatusReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "ChJVcGRhdGVTdGF0dXMucHJvdG8SFVRhbmdvLlBNUi5JbnRlZ3JhdGlvbiqW", - "AQoMVXBkYXRlU3RhdHVzEhAKDERpc2Nvbm5lY3RlZBAAEgsKB1N0YW5kYnkQ", - "ARIOCgpSZWFkeVRvRHllEAISEAoMR2V0dGluZ1JlYWR5EAMSDAoIUHJpbnRp", - "bmcQBBILCgdTZXJ2aWNlEAUSDQoJVXBncmFkaW5nEAYSEAoMU2h1dHRpbmdE", - "b3duEAcSCQoFRXJyb3IQCEIhCh9jb20udHdpbmUudGFuZ28ucG1yLmludGVn", - "cmF0aW9uYgZwcm90bzM=")); + "ChJVcGRhdGVTdGF0dXMucHJvdG8SFVRhbmdvLlBNUi5JbnRlZ3JhdGlvbiqj", + "AQoMVXBkYXRlU3RhdHVzEhAKDERpc2Nvbm5lY3RlZBAAEgsKB1Bvd2VyVXAQ", + "ARILCgdTdGFuZGJ5EAISDgoKUmVhZHlUb0R5ZRADEhAKDEdldHRpbmdSZWFk", + "eRAEEgwKCFByaW50aW5nEAUSCwoHU2VydmljZRAGEg0KCVVwZ3JhZGluZxAH", + "EhAKDFNodXR0aW5nRG93bhAIEgkKBUVycm9yEAlCIQofY29tLnR3aW5lLnRh", + "bmdvLnBtci5pbnRlZ3JhdGlvbmIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tango.PMR.Integration.UpdateStatus), }, null)); @@ -38,14 +38,15 @@ namespace Tango.PMR.Integration { #region Enums public enum UpdateStatus { [pbr::OriginalName("Disconnected")] Disconnected = 0, - [pbr::OriginalName("Standby")] Standby = 1, - [pbr::OriginalName("ReadyToDye")] ReadyToDye = 2, - [pbr::OriginalName("GettingReady")] GettingReady = 3, - [pbr::OriginalName("Printing")] Printing = 4, - [pbr::OriginalName("Service")] Service = 5, - [pbr::OriginalName("Upgrading")] Upgrading = 6, - [pbr::OriginalName("ShuttingDown")] ShuttingDown = 7, - [pbr::OriginalName("Error")] Error = 8, + [pbr::OriginalName("PowerUp")] PowerUp = 1, + [pbr::OriginalName("Standby")] Standby = 2, + [pbr::OriginalName("ReadyToDye")] ReadyToDye = 3, + [pbr::OriginalName("GettingReady")] GettingReady = 4, + [pbr::OriginalName("Printing")] Printing = 5, + [pbr::OriginalName("Service")] Service = 6, + [pbr::OriginalName("Upgrading")] Upgrading = 7, + [pbr::OriginalName("ShuttingDown")] ShuttingDown = 8, + [pbr::OriginalName("Error")] Error = 9, } #endregion diff --git a/Software/Visual_Studio/Tango.Transport/ITransporter.cs b/Software/Visual_Studio/Tango.Transport/ITransporter.cs index 1187b2684..15a864a0a 100644 --- a/Software/Visual_Studio/Tango.Transport/ITransporter.cs +++ b/Software/Visual_Studio/Tango.Transport/ITransporter.cs @@ -43,6 +43,13 @@ namespace Tango.Transport /// The callback. void RegisterRequestHandler(RequestHandlerCallbackDelegate callback) where Request : class; + /// + /// Unregisters a custom request handler. + /// + /// The type of the request. + /// The callback. + void UnregisterRequestHandler(RequestHandlerCallbackDelegate callback) where Request : class; + /// /// Copies this instance request handlers to the specified instance. /// diff --git a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs index 11ce20b0a..916992bc3 100644 --- a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs +++ b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs @@ -38,6 +38,7 @@ namespace Tango.Transport { public Type RequestType { get; set; } public Action Callback { get; set; } + public object RegisteredCallback { get; set; } } private const int MESSAGE_TOKEN_LENGTH = 36; @@ -1216,6 +1217,7 @@ namespace Tango.Transport { RequestHandler handler = new RequestHandler(); handler.RequestType = typeof(Request); + handler.RegisteredCallback = callback; handler.Callback = (transporter, obj, token) => { callback?.Invoke(transporter, obj as Request, token); @@ -1224,6 +1226,20 @@ namespace Tango.Transport _requestHandlers.Add(handler); } + /// + /// Unregisters a custom request handler. + /// + /// The type of the request. + /// The callback. + public void UnregisterRequestHandler(RequestHandlerCallbackDelegate callback) where Request : class + { + var handler = _requestHandlers.FirstOrDefault(x => (x.RegisteredCallback as RequestHandlerCallbackDelegate) == callback); + if (handler != null) + { + _requestHandlers.Remove(handler); + } + } + /// /// Copies this instance request handlers to the specified instance. /// diff --git a/Software/Visual_Studio/Tango.WebRTC/WebRtcTransportAdapter.cs b/Software/Visual_Studio/Tango.WebRTC/WebRtcTransportAdapter.cs index 850ddb3de..d0bfc886d 100644 --- a/Software/Visual_Studio/Tango.WebRTC/WebRtcTransportAdapter.cs +++ b/Software/Visual_Studio/Tango.WebRTC/WebRtcTransportAdapter.cs @@ -246,16 +246,16 @@ namespace Tango.WebRTC { try { - LogManager.Log("Ice candidate request received from the remote peer."); + LogManager.Log($"{ComponentName}: Ice candidate request received from the remote peer."); await SignalingTransporter.SendGenericResponse(new IceCandidateResponse() { }, token); LogManager.Log("Adding ice candidate..."); _client.AddIceCandidate(request.IceCandidate); - LogManager.Log("Ice candidate added."); + LogManager.Log($"{ComponentName}: Ice candidate added."); } catch (Exception ex) { - LogManager.Log(ex, "Error occurred on ice candidate received handling."); + LogManager.Log(ex, $"{ComponentName}: Error occurred on ice candidate received handling."); } } @@ -284,6 +284,8 @@ namespace Tango.WebRTC { _client.Dispose(); _client = null; + SignalingTransporter.UnregisterRequestHandler(OnIceCandidateRequestReceived); + SignalingTransporter.UnregisterRequestHandler(OnOfferRequestReceived); LogManager.Log("WebRTC client disposed."); } catch (Exception ex) -- cgit v1.3.1