From 9d5cbb678c593f2150ea28d23cdc505cab21f004 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 12 Jul 2018 16:40:03 +0300 Subject: Machine Studio v1.0.0.13 --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 1572864 -> 1572864 bytes Software/Graphics/repeat.png | Bin 0 -> 1084 bytes .../Images/repeat.png | Bin 0 -> 1084 bytes .../Tango.MachineStudio.Developer.csproj | 3 + .../ViewModels/MainViewVM.cs | 6 ++ .../Views/JobView.xaml | 14 ++++- .../Views/MainView.xaml | 2 + .../ViewModels/MainViewVM.cs | 2 + .../Resources/MaterialDesign.xaml | 16 +++-- .../Tango.MachineStudio.Publisher/MainWindowVM.cs | 10 ++++ .../Tango.MachineStudio.UI/Resources/BuildDate.txt | 2 +- .../Tango.Integration/Operation/JobHandler.cs | 33 +++++++++-- .../Tango.Integration/Operation/MachineOperator.cs | 66 ++++++++++----------- .../Operation/RunningJobStatus.cs | 5 ++ Software/Visual_Studio/Versioning/MachineStudio.cs | 4 +- 16 files changed, 117 insertions(+), 46 deletions(-) create mode 100644 Software/Graphics/repeat.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/repeat.png (limited to 'Software') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 4b4f9a441..21120ec4c 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 39cd69c13..3da391e2c 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Graphics/repeat.png b/Software/Graphics/repeat.png new file mode 100644 index 000000000..b7b8dea1d Binary files /dev/null and b/Software/Graphics/repeat.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/repeat.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/repeat.png new file mode 100644 index 000000000..b7b8dea1d Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/repeat.png differ 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 52a18a168..f8f121dff 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 @@ -346,5 +346,8 @@ + + + \ 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 0e414fddc..dacbc89b1 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 @@ -1045,6 +1045,12 @@ namespace Tango.MachineStudio.Developer.ViewModels } }; + _jobHandler.UnitCompleted += (x, unit) => + { + _speech.SpeakInfo(String.Format("{0} Units Completed.", unit + 1)); + _eventLogger.Log(String.Format("{0} Units Completed.", unit + 1)); + }; + _jobHandler.Failed += (x, ex) => { LogManager.Log(ex, String.Format("Job {0} has failed.", RunningJob.Name)); 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 fde7ff275..fc62c0128 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 @@ -346,7 +346,7 @@ - + @@ -419,7 +419,17 @@ - + + + + + Units + + + + + + 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 3e76ccbd0..2ece5c76b 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 @@ -199,6 +199,8 @@ + + x diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs index a1da10db9..3a0191be4 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs @@ -506,6 +506,8 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels { errors.Add(String.Format("Formula type is required on IDS pack '{0}'.", pack.Name)); } + + pack.IsEmpty = false; } else { diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml index ca0685f3c..07818269b 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml @@ -3,6 +3,7 @@ xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters;assembly=MaterialDesignThemes.Wpf" xmlns:editors="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" + xmlns:mahApps="http://metro.mahapps.com/winfx/xaml/controls" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:local="clr-namespace:Tango.MachineStudio.Common.Resources"> @@ -65,7 +66,7 @@ - + ../Fonts/#digital-7 @@ -181,7 +182,7 @@ - + Segoe UI @@ -391,8 +392,8 @@ - - + + + + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher/MainWindowVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher/MainWindowVM.cs index a45353555..00bd895f3 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher/MainWindowVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher/MainWindowVM.cs @@ -130,6 +130,11 @@ namespace Tango.MachineStudio.Publisher private void Publish() { + if (!ShowQuestion("Did you remember to synchronize production database ?")) + { + return; + } + MaxProgress = 100; Progress = 0; @@ -222,6 +227,11 @@ namespace Tango.MachineStudio.Publisher MessageBox.Show(message, "Machine Studio Publisher", MessageBoxButton.OK, MessageBoxImage.Information); } + private bool ShowQuestion(String message) + { + return MessageBox.Show(message, "Machine Studio Publisher", MessageBoxButton.YesNo, MessageBoxImage.Information) == MessageBoxResult.Yes; + } + protected override void RaisePropertyChangedAuto([CallerMemberName] string caller = null) { base.RaisePropertyChangedAuto(caller); 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 66ca876c6..40f8c54f4 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 @@ -Thu 07/12/2018 14:40:14.74 +Thu 07/12/2018 16:28:40.38 diff --git a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs index 02579b20a..5502f52cc 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs @@ -18,6 +18,7 @@ namespace Tango.Integration.Operation private Action _cancelAction; private List _effectiveSegments; private String _lastStatusMessage; + private int _last_unit; #region Events @@ -51,6 +52,11 @@ namespace Tango.Integration.Operation /// public event EventHandler SegmentCompleted; + /// + /// Occurs when a unit completes. + /// + public event EventHandler UnitCompleted; + #endregion #region Properties @@ -179,7 +185,8 @@ namespace Tango.Integration.Operation Status.Progress = s.Progress; Status.RemainingTime = Status.TotalTime - Job.TranslateProgressToTime(Status.Progress, ProcessParameters); Status.RemainingProgress = Status.TotalProgress - Status.Progress; - Status.RemainingUnits = Job.NumberOfUnits - (int)((Job.LengthIncludingNumberOfUnits / Status.CurrentUnitTotalProgress) * Status.Progress / Status.TotalProgress); + Status.CurrentUnit = (int)((Job.LengthIncludingNumberOfUnits / Status.CurrentUnitTotalProgress) * Status.Progress / Status.TotalProgress); + Status.RemainingUnits = Job.NumberOfUnits - Status.CurrentUnit; Status.CurrentUnitProgress = s.Progress - (Status.CurrentUnitTotalProgress * (Job.NumberOfUnits - Status.RemainingUnits)); if (s.Message != _lastStatusMessage && s.Message != String.Empty) @@ -196,14 +203,32 @@ namespace Tango.Integration.Operation StatusChanged?.Invoke(this, Status); //Segments Completion + + if (Status.CurrentUnit > _last_unit) + { + foreach (var segment in _effectiveSegments) + { + segment.Started = false; + segment.Completed = false; + } + + if (Job.NumberOfUnits > 1) + { + UnitCompleted?.Invoke(this, _last_unit); + } + } + + _last_unit = Status.CurrentUnit; + + for (int i = 0; i < _effectiveSegments.Count; i++) { Segment segment = _effectiveSegments[i]; double previousSegmentsLengthWithThis = _effectiveSegments.Take(i + 1).Sum(x => x.Length); TimeSpan segmentsDuration = Job.TranslateProgressToTime(previousSegmentsLengthWithThis, ProcessParameters); - TimeSpan segmentRemainingTime = segmentsDuration - Job.TranslateProgressToTime(Status.Progress, ProcessParameters); + TimeSpan segmentRemainingTime = segmentsDuration - Job.TranslateProgressToTime(Status.CurrentUnitProgress, ProcessParameters); - if (i == 0 && Status.Progress > 0) + if (i == 0 && Status.CurrentUnitProgress > 0) { if (!segment.Started) { @@ -212,7 +237,7 @@ namespace Tango.Integration.Operation } } - if (Status.Progress >= previousSegmentsLengthWithThis) + if (Status.CurrentUnitProgress >= previousSegmentsLengthWithThis) { if (!segment.Completed) { diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index 18a5cf268..3a02006fd 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -690,39 +690,39 @@ namespace Tango.Integration.Operation LogRequestSent(request); bool responseLogged = false; - SendContinuousRequest(request,null,TimeSpan.FromSeconds(2)).Subscribe((response) => - { - handler.RaiseStatusReceived(response.Message.Status); - - if (!responseLogged) - { - Status = MachineStatuses.Printing; - PrintingStarted?.Invoke(this, handler); - responseLogged = true; - LogResponseReceived(response.Message); - } - }, (ex) => - { - if (!(ex is ContinuousResponseAbortedException)) - { - if (!handler.IsCanceled) - { - Status = MachineStatuses.Error; - PrintingFailed?.Invoke(this, ex); - handler.RaiseFailed(ex); - LogRequestFailed(request, ex); - } - } - else - { - Status = MachineStatuses.ReadyToDye; - } - }, () => - { - Status = MachineStatuses.ReadyToDye; - PrintingCompleted?.Invoke(this, new EventArgs()); - handler.RaiseCompleted(); - }); + SendContinuousRequest(request, null, TimeSpan.FromSeconds(2)).Subscribe((response) => + { + handler.RaiseStatusReceived(response.Message.Status); + + if (!responseLogged) + { + Status = MachineStatuses.Printing; + PrintingStarted?.Invoke(this, handler); + responseLogged = true; + LogResponseReceived(response.Message); + } + }, (ex) => + { + if (!(ex is ContinuousResponseAbortedException)) + { + if (!handler.IsCanceled) + { + Status = MachineStatuses.Error; + PrintingFailed?.Invoke(this, ex); + handler.RaiseFailed(ex); + LogRequestFailed(request, ex); + } + } + else + { + Status = MachineStatuses.ReadyToDye; + } + }, () => + { + Status = MachineStatuses.ReadyToDye; + PrintingCompleted?.Invoke(this, new EventArgs()); + handler.RaiseCompleted(); + }); return handler; } diff --git a/Software/Visual_Studio/Tango.Integration/Operation/RunningJobStatus.cs b/Software/Visual_Studio/Tango.Integration/Operation/RunningJobStatus.cs index 17e5f3a40..f9ce1d4ae 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/RunningJobStatus.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/RunningJobStatus.cs @@ -36,6 +36,11 @@ namespace Tango.Integration.Operation /// public double RemainingProgress { get; set; } + /// + /// Gets or sets the current unit number. + /// + public int CurrentUnit { get; set; } + /// /// Gets or sets the remaining units if it is an embroidery job. /// diff --git a/Software/Visual_Studio/Versioning/MachineStudio.cs b/Software/Visual_Studio/Versioning/MachineStudio.cs index df70e81bb..d5a870a5d 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.12")] -[assembly: AssemblyFileVersion("1.0.0.12")] +[assembly: AssemblyVersion("1.0.0.13")] +[assembly: AssemblyFileVersion("1.0.0.13")] -- cgit v1.3.1