From 120a4ac8f9d33b3b0eeaba545402ab55484edadc Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 18 Jul 2018 11:14:03 +0300 Subject: Added out of gamut & volumes check. --- .../Views/MainView.xaml | 294 +++++++++++---------- 1 file changed, 149 insertions(+), 145 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml index d8da5a804..4830b67ed 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml @@ -131,163 +131,165 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -301,10 +303,12 @@ - - - + + + + + -- cgit v1.3.1 From 02bc7f8e417b1c24eb35764167ad068452a36e2a Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 18 Jul 2018 13:22:21 +0300 Subject: Added finalization stage to job progress. Fixed issue with process parameters indices. --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 1572864 -> 1572864 bytes .../ViewModels/MainViewVM.cs | 11 + .../Views/MainView.xaml | 556 +++++++++++---------- .../Tango.MachineStudio.UI/Resources/BuildDate.txt | 2 +- .../Tango.BL/EntitiesExtensions/Job.cs | 2 +- .../Tango.Emulations/Emulators/MachineEmulator.cs | 4 +- .../Tango.Integration/Operation/JobHandler.cs | 156 +++--- .../Operation/RunningJobStatus.cs | 10 + Software/Visual_Studio/Versioning/Core.cs | 4 +- Software/Visual_Studio/Versioning/MachineStudio.cs | 4 +- 11 files changed, 399 insertions(+), 350 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index ed88b32bc..3273ebdd4 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 82cce7362..447bf18d1 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ 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 d904c2e90..749a09023 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 @@ -1185,6 +1185,13 @@ namespace Tango.MachineStudio.Developer.ViewModels }); }; + _jobHandler.Finalizing += (_, __) => + { + _speech.SpeakInfo("Finalizing job..."); + LogManager.Log(String.Format("Finalizing job {0}.", RunningJob.Name)); + _eventLogger.Log(String.Format("Finalizing job {0}.", RunningJob.Name)); + }; + _jobHandler.Completed += (x, e) => { LogManager.Log(String.Format("Job {0} has completed.", RunningJob.Name)); @@ -1328,9 +1335,13 @@ namespace Tango.MachineStudio.Developer.ViewModels ProcessParametersTablesGroup group = new ProcessParametersTablesGroup(); List tables = new List(); + + int index = 0; + foreach (var table in RmlProcessParametersTableGroup.ProcessParametersTables) { var newTable = table.CloneEntity(); + newTable.TableIndex = index++; newTable.ProcessParametersTablesGroup = group; tables.Add(newTable); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml index 4830b67ed..a7348d869 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml @@ -93,316 +93,320 @@ - - - - - + + + + + + - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - + + - - + + - - + + x - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + Finalizing... + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt index 186b9e372..c1f1cc77d 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt @@ -1 +1 @@ -Wed 07/18/2018 11:16:31.88 +Wed 07/18/2018 13:18:32.22 diff --git a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Job.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Job.cs index 4f0dd3689..8bca1218f 100644 --- a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Job.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Job.cs @@ -371,7 +371,7 @@ namespace Tango.BL.Entities /// public TimeSpan GetEstimatedDuration(ProcessParametersTable processParameters) { - return TimeSpan.FromSeconds(LengthIncludingNumberOfUnits / (processParameters.DyeingSpeed / 100d)); + return TimeSpan.FromSeconds(LengthIncludingNumberOfUnits + processParameters.DryerBufferLength / (processParameters.DyeingSpeed / 100d)); } /// diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index 1bfc566aa..ab32831a2 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -400,7 +400,7 @@ namespace Tango.Emulations.Emulators Task.Factory.StartNew(() => { - while (progress < job.Length && !_cancelJob) + while (progress < job.Length + job.ProcessParameters.DryerBufferLength && !_cancelJob) { var status = new PMR.Printing.JobStatus(); status.Progress = progress; @@ -417,7 +417,7 @@ namespace Tango.Emulations.Emulators }, request.Container.Token); - progress += Math.Min((centimeter_per_second / 1000d), job.Length - progress); + progress += Math.Min((centimeter_per_second / 1000d), (job.Length + job.ProcessParameters.DryerBufferLength) - progress); Thread.Sleep(100); } diff --git a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs index 9ae6f7f32..2fc2ce5c0 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs @@ -20,8 +20,7 @@ namespace Tango.Integration.Operation private List _effectiveSegments; private String _lastStatusMessage; private int _last_unit; - - + private bool _finalizing; #region Events @@ -50,6 +49,11 @@ namespace Tango.Integration.Operation /// public event EventHandler Stopped; + /// + /// Occurs when rolling the dryer buffer. + /// + public event EventHandler Finalizing; + /// /// Occurs when a segment has started. /// @@ -130,7 +134,7 @@ namespace Tango.Integration.Operation Status.TotalTime = job.GetEstimatedDuration(processParameters); Status.RemainingUnits = job.NumberOfUnits; - Status.TotalProgress = Job.LengthIncludingNumberOfUnits; + Status.TotalProgress = Job.LengthIncludingNumberOfUnits + processParameters.DryerBufferLength; Status.CurrentUnitTotalProgress = Job.Length; Status.Progress = 0; Status.RemainingTime = Status.TotalTime; @@ -175,6 +179,7 @@ namespace Tango.Integration.Operation internal void RaiseCompleted() { Status.RemainingUnits = 0; + Status.IsFinalizing = false; Status.IsCompleted = true; StatusChanged?.Invoke(this, Status); RaisePropertyChanged(nameof(Status)); @@ -209,106 +214,125 @@ namespace Tango.Integration.Operation } List unit_segments = new List(); - - unit_segments = _effectiveSegments.ToList(); - - if (Job.EnableInterSegment && Job.NumberOfUnits > 1 && Status.RemainingUnits > 1) - { - unit_segments.Add(Job.CreateInterSegment(Job.InterSegmentLength)); - } - - if (unit_segments.Count != Status.CurrentUnitSegments.Count) - { - Status.CurrentUnitSegments = unit_segments; - } - double delta = s.Progress - Status.Progress; Status.Progress = s.Progress; Status.RemainingTime = Status.TotalTime - Job.TranslateProgressToTime(Status.Progress, ProcessParameters); Status.RemainingProgress = Status.TotalProgress - Status.Progress; - Status.CurrentUnitTotalProgress = Status.RemainingUnits > 1 && Job.EnableInterSegment ? Job.Length + (Job.InterSegmentLength) : Job.Length; - Status.CurrentUnitProgress += delta; - - if (Status.CurrentUnitProgress >= Status.CurrentUnitTotalProgress) + if (s.Progress < Job.LengthIncludingNumberOfUnits) { - Status.CurrentUnitProgress = 0; - Status.CurrentUnit++; - } + unit_segments = _effectiveSegments.ToList(); - Status.RemainingUnits = Job.NumberOfUnits - Status.CurrentUnit; + if (Job.EnableInterSegment && Job.NumberOfUnits > 1 && Status.RemainingUnits > 1) + { + unit_segments.Add(Job.CreateInterSegment(Job.InterSegmentLength)); + } - if (s.Message != _lastStatusMessage && s.Message != String.Empty) - { - Status.Message = s.Message; - } - else - { - Status.Message = null; - } + if (unit_segments.Count != Status.CurrentUnitSegments.Count) + { + Status.CurrentUnitSegments = unit_segments; + } - _lastStatusMessage = s.Message; + Status.CurrentUnitTotalProgress = Status.RemainingUnits > 1 && Job.EnableInterSegment ? Job.Length + (Job.InterSegmentLength) : Job.Length; + Status.CurrentUnitProgress += delta; - StatusChanged?.Invoke(this, Status); + if (Status.CurrentUnitProgress >= Status.CurrentUnitTotalProgress) + { + Status.CurrentUnitProgress = 0; + Status.CurrentUnit++; + } - //Segments Completion + Status.RemainingUnits = Job.NumberOfUnits - Status.CurrentUnit; - if (Status.CurrentUnit > _last_unit) - { - foreach (var segment in Status.CurrentUnitSegments) + if (s.Message != _lastStatusMessage && s.Message != String.Empty) { - segment.Started = false; - segment.Completed = false; + Status.Message = s.Message; } - - if (Job.NumberOfUnits > 1) + else { - UnitCompleted?.Invoke(this, _last_unit); + Status.Message = null; } - } - _last_unit = Status.CurrentUnit; + _lastStatusMessage = s.Message; + StatusChanged?.Invoke(this, Status); - for (int i = 0; i < Status.CurrentUnitSegments.Count; i++) - { - Segment segment = Status.CurrentUnitSegments[i]; - double previousSegmentsLengthWithThis = Status.CurrentUnitSegments.Take(i + 1).Sum(x => x.Length); - TimeSpan segmentsDuration = Job.TranslateProgressToTime(previousSegmentsLengthWithThis, ProcessParameters); - TimeSpan segmentRemainingTime = segmentsDuration - Job.TranslateProgressToTime(Status.CurrentUnitProgress, ProcessParameters); + //Segments Completion - if (i == 0 && Status.CurrentUnitProgress > 0) + if (Status.CurrentUnit > _last_unit) { - if (!segment.Started) + foreach (var segment in Status.CurrentUnitSegments) { - segment.Started = true; - SegmentStarted?.Invoke(this, segment); + segment.Started = false; + segment.Completed = false; + } + + if (Job.NumberOfUnits > 1) + { + UnitCompleted?.Invoke(this, _last_unit); } } - if (Status.CurrentUnitProgress >= previousSegmentsLengthWithThis) + _last_unit = Status.CurrentUnit; + + + for (int i = 0; i < Status.CurrentUnitSegments.Count; i++) { - if (!segment.Completed) + Segment segment = Status.CurrentUnitSegments[i]; + double previousSegmentsLengthWithThis = Status.CurrentUnitSegments.Take(i + 1).Sum(x => x.Length); + TimeSpan segmentsDuration = Job.TranslateProgressToTime(previousSegmentsLengthWithThis, ProcessParameters); + TimeSpan segmentRemainingTime = segmentsDuration - Job.TranslateProgressToTime(Status.CurrentUnitProgress, ProcessParameters); + + if (i == 0 && Status.CurrentUnitProgress > 0) { - segment.Completed = true; - SegmentCompleted?.Invoke(this, segment); + if (!segment.Started) + { + segment.Started = true; + SegmentStarted?.Invoke(this, segment); + } } - if (i < Status.CurrentUnitSegments.Count - 1) + if (Status.CurrentUnitProgress >= previousSegmentsLengthWithThis) { - if (!Status.CurrentUnitSegments[i + 1].Started) + if (!segment.Completed) + { + segment.Completed = true; + SegmentCompleted?.Invoke(this, segment); + } + + if (i < Status.CurrentUnitSegments.Count - 1) { - Status.CurrentUnitSegments[i + 1].Started = true; - SegmentStarted?.Invoke(this, Status.CurrentUnitSegments[i + 1]); + if (!Status.CurrentUnitSegments[i + 1].Started) + { + Status.CurrentUnitSegments[i + 1].Started = true; + SegmentStarted?.Invoke(this, Status.CurrentUnitSegments[i + 1]); + } } } - } - if (segment.Started && !segment.Completed) + if (segment.Started && !segment.Completed) + { + segment.RemainingTime = segmentRemainingTime; + } + } + } + else + { + //Finalizing + if (!_finalizing) { - segment.RemainingTime = segmentRemainingTime; + _finalizing = true; + Status.IsFinalizing = true; + var last_Segment = _effectiveSegments.Last().Clone(); + last_Segment.Length = ProcessParameters.DryerBufferLength; + Status.CurrentUnitSegments = new List { last_Segment }; + Status.CurrentUnitTotalProgress = last_Segment.Length; + Status.CurrentUnitProgress = 0; + Finalizing?.Invoke(this, new EventArgs()); } + + Status.CurrentUnitProgress += delta; } } diff --git a/Software/Visual_Studio/Tango.Integration/Operation/RunningJobStatus.cs b/Software/Visual_Studio/Tango.Integration/Operation/RunningJobStatus.cs index ac6568c4b..a5f712a70 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/RunningJobStatus.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/RunningJobStatus.cs @@ -133,6 +133,16 @@ namespace Tango.Integration.Operation set { _isFailed = value; RaisePropertyChangedAuto(); } } + private bool _isFinalizing; + /// + /// Gets or sets a value indicating whether the machine is rolling the dryer buffer length at the end of the job. + /// + public bool IsFinalizing + { + get { return _isFinalizing; } + set { _isFinalizing = value; RaisePropertyChangedAuto(); } + } + private String _message; /// /// Gets or sets the message. diff --git a/Software/Visual_Studio/Versioning/Core.cs b/Software/Visual_Studio/Versioning/Core.cs index fb820fb04..4ee20543b 100644 --- a/Software/Visual_Studio/Versioning/Core.cs +++ b/Software/Visual_Studio/Versioning/Core.cs @@ -9,5 +9,5 @@ using System.Runtime.InteropServices; [assembly: AssemblyCopyright("Copyright © Twine LTD 2017")] [assembly: AssemblyTrademark("Twine LTD")] -[assembly: AssemblyVersion("1.0.0.7")] -[assembly: AssemblyFileVersion("1.0.0.7")] +[assembly: AssemblyVersion("1.0.0.8")] +[assembly: AssemblyFileVersion("1.0.0.8")] diff --git a/Software/Visual_Studio/Versioning/MachineStudio.cs b/Software/Visual_Studio/Versioning/MachineStudio.cs index 5568cfa72..ac6cd2e91 100644 --- a/Software/Visual_Studio/Versioning/MachineStudio.cs +++ b/Software/Visual_Studio/Versioning/MachineStudio.cs @@ -9,5 +9,5 @@ using System.Runtime.InteropServices; [assembly: AssemblyCopyright("Copyright © Twine LTD 2017")] [assembly: AssemblyTrademark("Twine LTD")] -[assembly: AssemblyVersion("1.0.0.16")] -[assembly: AssemblyFileVersion("1.0.0.16")] +[assembly: AssemblyVersion("1.0.0.17")] +[assembly: AssemblyFileVersion("1.0.0.17")] -- cgit v1.3.1