From ffe61a7cf745230b1436dbedf1610af72a618a0c Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 15 Mar 2018 16:12:43 +0200 Subject: Working on machine events. --- .../Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels') 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 b2dded955..4a16be957 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 @@ -54,7 +54,6 @@ namespace Tango.MachineStudio.Developer.ViewModels private IAuthenticationProvider _authentication; private ObservablesContext _machineDbContext; private ObservablesContext _activeJobDbContext; - private LogManager LogManager = LogManager.Default; private SpeechSynthesizer _speech; private SoundPlayer _soundPlayer; -- cgit v1.3.1 From fd2641e5aa4e915cc133310bd87d21278b84e50b Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 18 Mar 2018 12:54:12 +0200 Subject: Working on machine events ! --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 1048576 -> 1048576 bytes Software/Graphics/warning.png | Bin 0 -> 2121 bytes .../Tango.MachineStudio.Developer.csproj | 3 + .../ViewModels/MainViewVM.cs | 93 ++++++++++++--- .../Tango.MachineStudio.Developer/error.wav | Bin 0 -> 146748 bytes .../Views/MainView.xaml | 2 +- .../EventLogging/DefaultEventLogger.cs | 1 + .../Tango.MachineStudio.UI/Images/warning.png | Bin 0 -> 2121 bytes .../Tango.MachineStudio.UI.csproj | 3 + .../Views/MachineSerialView.xaml | 10 +- .../Tango.MachineStudio.UI/Views/MainView.xaml | 42 ++++++- .../Tango.BL/EntitiesExtensions/MachineEvent.cs | 6 + .../ExtensionMethods/StringExtensions.cs | 18 +++ .../Operation/DefaultMachineEventsStateProvider.cs | 19 ++- .../Operation/IMachineEventsStateProvider.cs | 5 + .../Tango.PMR/Diagnostics/EventType.cs | 87 +++++++++----- .../Tango.PMR/Hardware/HardwareMotorType.cs | 130 +++++++++++++++++++-- .../Converters/StringToWordsConverter.cs | 23 ++++ .../Tango.SharedUI/Tango.SharedUI.csproj | 1 + 20 files changed, 377 insertions(+), 66 deletions(-) create mode 100644 Software/Graphics/warning.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/error.wav create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/warning.png create mode 100644 Software/Visual_Studio/Tango.SharedUI/Converters/StringToWordsConverter.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index f3bd407f1..3057683ff 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 833108156..659a1c96f 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Graphics/warning.png b/Software/Graphics/warning.png new file mode 100644 index 000000000..a845b1226 Binary files /dev/null and b/Software/Graphics/warning.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 920dfd922..c165552d1 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 @@ -356,5 +356,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 4a16be957..f455faa9e 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 @@ -56,6 +56,7 @@ namespace Tango.MachineStudio.Developer.ViewModels private ObservablesContext _activeJobDbContext; private SpeechSynthesizer _speech; private SoundPlayer _soundPlayer; + private SoundPlayer _soundPlayerErr; #region Properties @@ -629,6 +630,7 @@ namespace Tango.MachineStudio.Developer.ViewModels _speech = new SpeechSynthesizer(); _soundPlayer = new SoundPlayer(EmbeddedResourceHelper.GetEmbeddedResourceStream("Tango.MachineStudio.Developer.bip.wav")); + _soundPlayerErr = new SoundPlayer(EmbeddedResourceHelper.GetEmbeddedResourceStream("Tango.MachineStudio.Developer.error.wav")); _speech.SelectVoice(_speech.GetInstalledVoices().LastOrDefault(x => x.VoiceInfo.Gender == VoiceGender.Female).VoiceInfo.Name); //Initialize Commands... @@ -644,7 +646,7 @@ namespace Tango.MachineStudio.Developer.ViewModels RemoveBrushStopCommand = new RelayCommand(RemoveSelectedBrushStops, () => SelectedBrushStop != null); SaveJobCommand = new RelayCommand(SaveActiveJob, () => SelectedMachine != null); DiscardJobCommand = new RelayCommand(BackToJobs, () => SelectedMachine != null); - StartJobCommand = new RelayCommand(StartJob, () => ActiveJob != null && !IsJobRunning && MachineOperator != null); + StartJobCommand = new RelayCommand(StartJob, () => ActiveJob != null && !IsJobRunning && MachineOperator != null && !MachineOperator.MachineEventsStateProvider.Events.ToList().Exists(x => x.ActionTypes.Contains(BL.Enumerations.ActionTypes.PreventJobExecution))); StopJobCommand = new RelayCommand(StopJob, () => IsJobRunning); CloseJobCompletionStatusCommand = new RelayCommand(CloseJobCompletionStatusBar); LoadJobCommand = new RelayCommand(LoadSelectedJob, () => SelectedMachineJob != null); @@ -671,6 +673,25 @@ namespace Tango.MachineStudio.Developer.ViewModels private void ApplicationManager_ConnectedMachineChanged(object sender, IExternalBridgeClient machine) { MachineOperator = machine; + + if (MachineOperator != null) + { + MachineOperator.MachineEventsStateProvider.EventsChanged -= MachineEventsStateProvider_EventsChanged; + MachineOperator.MachineEventsStateProvider.EventsChanged += MachineEventsStateProvider_EventsChanged; + + MachineOperator.MachineEventsStateProvider.NewEvents -= MachineEventsStateProvider_NewEvents; + MachineOperator.MachineEventsStateProvider.NewEvents += MachineEventsStateProvider_NewEvents; + } + } + + private void MachineEventsStateProvider_NewEvents(object sender, IEnumerable events) + { + HandleNewHardwareEvents(events); + } + + private void MachineEventsStateProvider_EventsChanged(object sender, IEnumerable changedEvents) + { + InvokeUI(StartJobCommand.RaiseCanExecuteChanged); } /// @@ -714,6 +735,42 @@ namespace Tango.MachineStudio.Developer.ViewModels #endregion + #region Hardware Events + + private void HandleNewHardwareEvents(IEnumerable events) + { + if (IsJobRunning) + { + SpeakError(events.Last().EventType.Name); + + if (events.ToList().Exists(x => x.ActionTypes.Contains(BL.Enumerations.ActionTypes.AbortRunningJob))) + { + if (_jobHandler != null) + { + InvokeUI(StopJob); + } + } + } + } + + #endregion + + #region Sound + + private void SpeakInfo(String text) + { + _soundPlayer.Play(); + _speech.SpeakAsync(text); + } + + private void SpeakError(String text) + { + _soundPlayerErr.Play(); + _speech.SpeakAsync(text); + } + + #endregion + #region Properties Changes /// @@ -895,12 +952,14 @@ namespace Tango.MachineStudio.Developer.ViewModels /// private void SetJobFailed() { - LogManager.Log("Setting job failed state..."); - IsJobRunning = false; - IsJobFailed = true; + if (IsJobRunning) + { + LogManager.Log("Setting job failed state..."); + IsJobRunning = false; + IsJobFailed = true; - _soundPlayer.Play(); - _speech.SpeakAsync("Job Failed!"); + SpeakError("Job Failed!"); + } } /// @@ -911,8 +970,7 @@ namespace Tango.MachineStudio.Developer.ViewModels LogManager.Log("Setting job completed state..."); IsJobRunning = false; IsJobCompleted = true; - _soundPlayer.Play(); - _speech.SpeakAsync("Job Completed!"); + SpeakInfo("Job Completed!"); } /// @@ -955,11 +1013,20 @@ namespace Tango.MachineStudio.Developer.ViewModels _jobHandler.StatusReceived += (x, status) => { - RunningJobRemainingTime = _runningJobEstimatedDuration - TimeSpan.FromSeconds(RunningJobProgress / (SelectedProcessParametersTable.DyeingSpeed / 100d)); - RunningJobProgress = status.Progress; + if (IsJobRunning) + { + + RunningJobRemainingTime = _runningJobEstimatedDuration - TimeSpan.FromSeconds(RunningJobProgress / (SelectedProcessParametersTable.DyeingSpeed / 100d)); + RunningJobProgress = status.Progress; + } foreach (var segment in RunningJobSegments) { + if (!IsJobRunning) + { + break; + } + var previousSegmentsWithThis = RunningJobSegments.Where(s => RunningJobSegments.IndexOf(s) <= RunningJobSegments.IndexOf(segment)).ToList(); var segmentsDuration = TimeSpan.FromSeconds(previousSegmentsWithThis.Sum(s => s.Length) / (SelectedProcessParametersTable.DyeingSpeed / 100d)); var segmentDuration = TimeSpan.FromSeconds(segment.Length / (SelectedProcessParametersTable.DyeingSpeed / 100d)); @@ -973,15 +1040,14 @@ namespace Tango.MachineStudio.Developer.ViewModels if (!segment.Started) { segment.Started = true; - _soundPlayer.Play(); if (segment.ID != -1) { - _speech.SpeakAsync(String.Format("Segment {0} Started.", segment.SegmentIndex)); + SpeakInfo(String.Format("Segment {0} Started.", segment.SegmentIndex)); } else { - _speech.SpeakAsync(String.Format("Inter Segment Started.")); + SpeakInfo(String.Format("Inter Segment Started.")); } } } @@ -1052,6 +1118,7 @@ namespace Tango.MachineStudio.Developer.ViewModels { new BrushStop() { + ColorSpace = ColorSpaces.Single(x => x.Code == BL.Enumerations.ColorSpaces.RGB.ToInt32()), Color = Colors.White, } }, diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/error.wav b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/error.wav new file mode 100644 index 000000000..4dce7d623 Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/error.wav differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml index 6257fa2af..f704661cf 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml @@ -88,7 +88,7 @@ MACHINE DESIGNER - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs index 3763a06b4..b4015b297 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs @@ -71,6 +71,7 @@ namespace Tango.MachineStudio.Common.EventLogging _db.Configuration.LazyLoadingEnabled = false; _db.ActionTypes.ToList(); + _db.EventTypesActions.ToList(); _db.EventTypesCategories.ToList(); _db.EventTypesGroups.ToList(); _db.EventTypes.ToList(); diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/warning.png b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/warning.png new file mode 100644 index 000000000..a845b1226 Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/warning.png differ diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj index 95c2a9925..0a92f2c91 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj @@ -424,6 +424,9 @@ + + + if $(ConfigurationName) == Debug $(TargetDir)linkgen.exe -s "$(TargetPath)" -d "$(TargetDir)Utilities\Machine Studio.lnk" diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineSerialView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineSerialView.xaml index 83a6eece6..b988d0a76 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineSerialView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineSerialView.xaml @@ -8,7 +8,7 @@ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:vm="clr-namespace:Tango.MachineStudio.UI.ViewModels" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" - mc:Ignorable="d" Width="600" Height="400" Background="White" d:DataContext="{d:DesignInstance Type=vm:MachineSerialViewVM, IsDesignTimeCreatable=False}"> + mc:Ignorable="d" Width="559" Height="266" Background="White" d:DataContext="{d:DesignInstance Type=vm:MachineSerialViewVM, IsDesignTimeCreatable=False}"> @@ -36,15 +36,15 @@ - + Connecting directly to a machine's embedded firmware requires the selection of an existing machine from the database in order for machine studio to function properly. Please select a 'virtual machine' by entering the machine serial number - - + + @@ -65,7 +65,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml index beade3d88..b7a4cc93f 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml @@ -21,6 +21,7 @@ + @@ -234,7 +235,37 @@ hardware messages - + + + + + + public event EventHandler> EventsResolved; + /// + /// Occurs when the collection of current events has changed. + /// + public event EventHandler> EventsChanged; + /// /// Initializes a new instance of the class. /// @@ -85,14 +90,15 @@ namespace Tango.Integration.Operation OnEventsResolved(oldEvents); } - OnEventsReceived(_events); - RaisePropertyChanged(nameof(HasEvents)); if (newEvents.Count > 0 || oldEvents.Count > 0) { RaisePropertyChanged(nameof(Events)); + OnEventsChanged(newEvents.Concat(oldEvents)); } + + OnEventsReceived(_events); } /// @@ -121,5 +127,14 @@ namespace Tango.Integration.Operation { EventsResolved?.Invoke(this, events); } + + /// + /// Called when the events has been changed + /// + /// The events. + protected virtual void OnEventsChanged(IEnumerable events) + { + EventsChanged?.Invoke(this, events); + } } } diff --git a/Software/Visual_Studio/Tango.Integration/Operation/IMachineEventsStateProvider.cs b/Software/Visual_Studio/Tango.Integration/Operation/IMachineEventsStateProvider.cs index 6b3fc2e2c..0fc086fe3 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/IMachineEventsStateProvider.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/IMachineEventsStateProvider.cs @@ -39,6 +39,11 @@ namespace Tango.Integration.Operation /// event EventHandler> EventsReceived; + /// + /// Occurs when the collection of current events has changed. + /// + event EventHandler> EventsChanged; + /// /// Applies the collection of events received from the machine operator. /// diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/EventType.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/EventType.cs index e2ad1b539..7eebf2553 100644 --- a/Software/Visual_Studio/Tango.PMR/Diagnostics/EventType.cs +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/EventType.cs @@ -22,7 +22,7 @@ namespace Tango.PMR.Diagnostics { static EventTypeReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Cg9FdmVudFR5cGUucHJvdG8SFVRhbmdvLlBNUi5EaWFnbm9zdGljcyr4BQoJ", + "Cg9FdmVudFR5cGUucHJvdG8SFVRhbmdvLlBNUi5EaWFnbm9zdGljcyroBgoJ", "RXZlbnRUeXBlEg8KC1RocmVhZEJyZWFrEAASHwobVGhyZWFkVGVuc2lvbkNv", "bnRyb2xGYWlsdXJlEAESGgoWRmVlZGVyQ29uZUluc3VmZmljaWFudBACEhYK", "EldpbmRlckdlbmVyYWxFcnJvchADEhcKE1dpbmRlckNvbmVOb3RFeGlzdHMQ", @@ -39,8 +39,11 @@ namespace Tango.PMR.Diagnostics { "TWlkVGFua0xvd0xldmVsEBYSFQoRTWlkVGFua05vdEluUGxhY2UQFxIRCg1T", "eXN0ZW1CSVRGYWlsEBgSIgoeR2VuZXJhbEludGVybmFsT3ZlclRlbXBlcmF0", "dXJlEBkSFAoQTWFjaGluZUNvdmVyT3BlbhAaEh4KGkVtZXJnZW5jeVB1c2hC", - "dXR0b25QcmVzc2VkEBsSFgoSU3lzdGVtR2VuZXJhbEVycm9yEBxCIQofY29t", - "LnR3aW5lLnRhbmdvLnBtci5kaWFnbm9zdGljc2IGcHJvdG8z")); + "dXR0b25QcmVzc2VkEBsSFgoSU3lzdGVtR2VuZXJhbEVycm9yEBwSDwoLUmVx", + "dWVzdFNlbnQQHRIUChBSZXNwb25zZVJlY2VpdmVkEB4SEQoNUmVxdWVzdEZh", + "aWxlZBAfEhgKFEFwcGxpY2F0aW9uRXhjZXB0aW9uECASGgoWQXBwbGljYXRp", + "b25JbmZvcm1hdGlvbhAiQiEKH2NvbS50d2luZS50YW5nby5wbXIuZGlhZ25v", + "c3RpY3NiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tango.PMR.Diagnostics.EventType), }, null)); @@ -51,121 +54,141 @@ namespace Tango.PMR.Diagnostics { #region Enums public enum EventType { /// - ///Dancer overshot / Thread break sensor (Group = Thread Feeding System, Category = Error, Actions = Prevent Job Execution, Abort Running Job) + ///Dancer overshot / Thread break sensor (Group = Thread Feeding System, Category = Error, Actions = Soft Visual Notification, Abort Running Job, Prevent Job Execution) /// [pbr::OriginalName("ThreadBreak")] ThreadBreak = 0, /// - ///Dancer not stable or got down (Group = Thread Feeding System, Category = Error, Actions = Prevent Job Execution, Abort Running Job) + ///Dancer not stable or got down (Group = Thread Feeding System, Category = Error, Actions = Abort Running Job, Soft Visual Notification, Prevent Job Execution) /// [pbr::OriginalName("ThreadTensionControlFailure")] ThreadTensionControlFailure = 1, /// - ///Source thread counter (counter shall be reset upon loading a new cone) (Group = Thread Feeding System, Category = Error, Actions = Prevent Job Execution, Abort Running Job) + ///Source thread counter (counter shall be reset upon loading a new cone) (Group = Thread Feeding System, Category = Error, Actions = Abort Running Job, Prevent Job Execution, Soft Visual Notification) /// [pbr::OriginalName("FeederConeInsufficiant")] FeederConeInsufficiant = 2, /// - ///Winder Controller (Group = Thread Feeding System, Category = Error, Actions = Abort Running Job, Prevent Job Execution) + ///Winder Controller (Group = Thread Feeding System, Category = Error, Actions = Abort Running Job, Prevent Job Execution, Soft Visual Notification) /// [pbr::OriginalName("WinderGeneralError")] WinderGeneralError = 3, /// - ///SW_SPOOL_EXISTS='0' or Winder Controller (Group = Thread Feeding System, Category = Error, Actions = Prevent Job Execution, Abort Running Job) + ///SW_SPOOL_EXISTS='0' or Winder Controller (Group = Thread Feeding System, Category = Error, Actions = Abort Running Job, Prevent Job Execution, Soft Visual Notification) /// [pbr::OriginalName("WinderConeNotExists")] WinderConeNotExists = 4, /// - ///Motor Stall (Group = Thread Feeding System, Category = Error, Actions = Prevent Job Execution, Abort Running Job) + ///Motor Stall (Group = Thread Feeding System, Category = Error, Actions = Abort Running Job, Soft Visual Notification, Prevent Job Execution) /// [pbr::OriginalName("ThreadFeedingGeneralError")] ThreadFeedingGeneralError = 5, /// - ///Dyeing Head Thermometers (Group = DH Dryer, Category = Error, Actions = Prevent Job Execution, Abort Running Job) + ///Dyeing Head Thermometers (Group = DH Dryer, Category = Error, Actions = Abort Running Job, Soft Visual Notification, Prevent Job Execution) /// [pbr::OriginalName("DyeingHeadOverTemperature")] DyeingHeadOverTemperature = 6, /// - ///Current sense in all heaters is 0 (Group = DH Dryer, Category = Error, Actions = Abort Running Job, Prevent Job Execution) + ///Current sense in all heaters is 0 (Group = DH Dryer, Category = Error, Actions = Abort Running Job, Soft Visual Notification, Prevent Job Execution) /// [pbr::OriginalName("DHThermalCutoff")] DhthermalCutoff = 7, /// - ///Dryer Thermometers (Group = DH Dryer, Category = Error, Actions = Prevent Job Execution, Abort Running Job) + ///Dryer Thermometers (Group = DH Dryer, Category = Error, Actions = Prevent Job Execution, Abort Running Job, Soft Visual Notification) /// [pbr::OriginalName("DryerOverTemperature")] DryerOverTemperature = 8, /// - ///Current sense in all heaters is 0 (Group = DH Dryer, Category = Error, Actions = Prevent Job Execution) + ///Current sense in all heaters is 0 (Group = DH Dryer, Category = Error, Actions = Abort Running Job, Soft Visual Notification, Prevent Job Execution) /// [pbr::OriginalName("DryerThermalCutoff")] DryerThermalCutoff = 9, /// - ///Dyeing head Heaters failure (Under /Over current) (Group = DH Dryer, Category = Error, Actions = Abort Running Job, Prevent Job Execution) + ///Dyeing head Heaters failure (Under /Over current) (Group = DH Dryer, Category = Error, Actions = Soft Visual Notification, Prevent Job Execution, Abort Running Job) /// [pbr::OriginalName("DyeingHeadHeatersCurrentOutOfRange")] DyeingHeadHeatersCurrentOutOfRange = 10, /// - ///Dryer Heaters failure (Under /Over current) (Group = DH Dryer, Category = Error, Actions = Prevent Job Execution, Abort Running Job) + ///Dryer Heaters failure (Under /Over current) (Group = DH Dryer, Category = Error, Actions = Abort Running Job, Soft Visual Notification, Prevent Job Execution) /// [pbr::OriginalName("DryerHeatersCurrentOutOfRange")] DryerHeatersCurrentOutOfRange = 11, /// - ///Covers Tampers (Group = DH Dryer, Category = Error, Actions = Prevent Job Execution) + ///Covers Tampers (Group = DH Dryer, Category = Error, Actions = Prevent Job Execution, Soft Visual Notification) /// [pbr::OriginalName("DryerDHeadCoverOpen")] DryerDheadCoverOpen = 12, /// - ///Pressure sensor Purex or Air flow sensor (Flap) (Group = Waste Handling System, Category = Error, Actions = Abort Running Job, Prevent Job Execution) + ///Pressure sensor Purex or Air flow sensor (Flap) (Group = Waste Handling System, Category = Error, Actions = Abort Running Job, Prevent Job Execution, Soft Visual Notification) /// [pbr::OriginalName("AirFilterClogged")] AirFilterClogged = 13, /// - ///Micro-switch (Group = Waste Handling System, Category = Error, Actions = Abort Running Job, Prevent Job Execution) + ///Micro-switch (Group = Waste Handling System, Category = Error, Actions = Abort Running Job, Prevent Job Execution, Soft Visual Notification) /// [pbr::OriginalName("AirFilterNotInstalled")] AirFilterNotInstalled = 14, /// - ///blower techo. Feedback, air flap (Group = Waste Handling System, Category = Error, Actions = Abort Running Job, Prevent Job Execution) + ///blower techo. Feedback, air flap (Group = Waste Handling System, Category = Error, Actions = Prevent Job Execution, Soft Visual Notification, Abort Running Job) /// [pbr::OriginalName("WHSFailure")] Whsfailure = 15, /// - ///Check container float sensor (Group = Waste Handling System, Category = Warning, Actions = ) + ///Check container float sensor (Group = Waste Handling System, Category = Warning, Actions = Soft Visual Notification) /// [pbr::OriginalName("WasteContainerIsAlmostFull")] WasteContainerIsAlmostFull = 16, /// - ///Check container float sensor (Group = Waste Handling System, Category = Error, Actions = ) + ///Check container float sensor (Group = Waste Handling System, Category = Error, Actions = Soft Visual Notification) /// [pbr::OriginalName("WasteContainerIsFull")] WasteContainerIsFull = 17, /// - ///Dispenser position sensor/s (Group = Ink Delivery System, Category = Error, Actions = Prevent Job Execution, Abort Running Job) + ///Dispenser position sensor/s (Group = Ink Delivery System, Category = Error, Actions = Prevent Job Execution, Abort Running Job, Soft Visual Notification) /// [pbr::OriginalName("DispenserEmpty")] DispenserEmpty = 18, /// - ///Check if job can be executor refill needed (Group = Ink Delivery System, Category = Warning, Actions = ) + ///Check if job can be executor refill needed (Group = Ink Delivery System, Category = Warning, Actions = Soft Visual Notification) /// [pbr::OriginalName("DispenserLowLevel")] DispenserLowLevel = 19, /// - ///Cartridge float displacement (Group = Ink Delivery System, Category = Error, Actions = Prevent Job Execution) + ///Cartridge float displacement (Group = Ink Delivery System, Category = Error, Actions = Prevent Job Execution, Soft Visual Notification) /// [pbr::OriginalName("DispenserRefillFailure")] DispenserRefillFailure = 20, /// - ///Mid-Tank (Group = Ink Delivery System, Category = Warning, Actions = ) + ///Mid-Tank (Group = Ink Delivery System, Category = Warning, Actions = Soft Visual Notification) /// [pbr::OriginalName("MidTankEmpty")] MidTankEmpty = 21, /// - ///Cartridge float sensor (Group = Ink Delivery System, Category = Warning, Actions = ) + ///Cartridge float sensor (Group = Ink Delivery System, Category = Warning, Actions = Soft Visual Notification) /// [pbr::OriginalName("MidTankLowLevel")] MidTankLowLevel = 22, /// - ///Cartridge float sensor or Additional micro-switch (Group = Ink Delivery System, Category = Warning, Actions = ) + ///Cartridge float sensor or Additional micro-switch (Group = Ink Delivery System, Category = Warning, Actions = Soft Visual Notification) /// [pbr::OriginalName("MidTankNotInPlace")] MidTankNotInPlace = 23, /// - ///System BIT Failure (Group = General Hardware, Category = Error, Actions = ) + ///System BIT Failure (Group = General Hardware, Category = Error, Actions = Soft Visual Notification) /// [pbr::OriginalName("SystemBITFail")] SystemBitfail = 24, /// - ///Internal Thermostat (Group = General Hardware, Category = Error, Actions = Prevent Job Execution, Stop Heaters, Abort Running Job) + ///Internal Thermostat (Group = General Hardware, Category = Error, Actions = Prevent Job Execution, Soft Visual Notification, Abort Running Job, Stop Heaters) /// [pbr::OriginalName("GeneralInternalOverTemperature")] GeneralInternalOverTemperature = 25, /// - ///Covers Tampers (Group = General Hardware, Category = Warning, Actions = ) + ///Covers Tampers (Group = General Hardware, Category = Warning, Actions = Soft Visual Notification) /// [pbr::OriginalName("MachineCoverOpen")] MachineCoverOpen = 26, /// - ///EPB (Group = General Hardware, Category = Critical, Actions = Overall Power Down) + ///EPB (Group = General Hardware, Category = Critical, Actions = Overall Power Down, Soft Visual Notification) /// [pbr::OriginalName("EmergencyPushButtonPressed")] EmergencyPushButtonPressed = 27, /// - ///System General Error (Group = General Hardware, Category = Warning, Actions = ) + ///System General Error (Group = General Hardware, Category = Warning, Actions = Soft Visual Notification) /// [pbr::OriginalName("SystemGeneralError")] SystemGeneralError = 28, + /// + ///Occurs a request has been sent to the machine or external bridge service (Group = Transport, Category = Info, Actions = ) + /// + [pbr::OriginalName("RequestSent")] RequestSent = 29, + /// + ///Occures when a response has been received (Group = Transport, Category = Info, Actions = ) + /// + [pbr::OriginalName("ResponseReceived")] ResponseReceived = 30, + /// + ///Occures when a request to the machine has failed (Group = Transport, Category = Error, Actions = ) + /// + [pbr::OriginalName("RequestFailed")] RequestFailed = 31, + /// + ///Occures when the application has encountered some error (Group = Application, Category = Error, Actions = ) + /// + [pbr::OriginalName("ApplicationException")] ApplicationException = 32, + /// + ///General application event logs (Group = Application, Category = Info, Actions = ) + /// + [pbr::OriginalName("ApplicationInformation")] ApplicationInformation = 34, } #endregion diff --git a/Software/Visual_Studio/Tango.PMR/Hardware/HardwareMotorType.cs b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareMotorType.cs index c19e8b58c..3ba39df3a 100644 --- a/Software/Visual_Studio/Tango.PMR/Hardware/HardwareMotorType.cs +++ b/Software/Visual_Studio/Tango.PMR/Hardware/HardwareMotorType.cs @@ -23,9 +23,21 @@ namespace Tango.PMR.Hardware { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "ChdIYXJkd2FyZU1vdG9yVHlwZS5wcm90bxISVGFuZ28uUE1SLkhhcmR3YXJl", - "KlYKEUhhcmR3YXJlTW90b3JUeXBlEg8KC1dpbmRlck1vdG9yEAASDwoLRmVl", - "ZGVyTW90b3IQARIOCgpEcnllck1vdG9yEAISDwoLUG9vbGVyTW90b3IQA0Ie", - "Chxjb20udHdpbmUudGFuZ28ucG1yLmhhcmR3YXJlYgZwcm90bzM=")); + "KtwEChFIYXJkd2FyZU1vdG9yVHlwZRIVChFNT1RPX0RIX0NMRUFOSEVBRBAA", + "EhUKEU1PVE9fREhfQ0xFQU5NRUNIEAESDwoLTU9UT19ESF9MSUQQAhIWChJN", + "T1RPX0RSWUVSX0RSSVZJTkcQAxISCg5NT1RPX0RSWUVSX0xJRBAEEhYKEk1P", + "VE9fRFJZRVJfTE9BREFSTRAFEhQKEE1PVE9fRElTUEVOU0VSXzEQBhIUChBN", + "T1RPX0RJU1BFTlNFUl8yEAcSFAoQTU9UT19ESVNQRU5TRVJfMxAIEhQKEE1P", + "VE9fRElTUEVOU0VSXzQQCRIUChBNT1RPX0RJU1BFTlNFUl81EAoSFAoQTU9U", + "T19ESVNQRU5TRVJfNhALEhQKEE1PVE9fRElTUEVOU0VSXzcQDBIUChBNT1RP", + "X0RJU1BFTlNFUl84EA0SDgoKTU9UT19TQ1JFVxAOEg8KC01PVE9fV0lOREVS", + "EA8SEQoNTU9UT19MREFOQ0VSMRAQEhEKDU1PVE9fTERBTkNFUjIQERIRCg1N", + "T1RPX0xEUklWSU5HEBISEQoNTU9UT19MTE9BRElORxATEhAKDE1PVE9fTFBJ", + "Vk9UMRAUEhAKDE1PVE9fUkRBTkNFUhAVEhEKDU1PVE9fUkRSSVZJTkcQFhIR", + "Cg1NT1RPX1JMT0FEQVJNEBcSEQoNTU9UT19STE9BRElORxAYEhEKDU1PVE9f", + "U1BBUkUxXzEQGRIRCg1NT1RPX1NQQVJFMV8yEBoSEQoNTU9UT19TUEFSRTJf", + "MRAbEhEKDU1PVE9fU1BBUkUyXzIQHEIeChxjb20udHdpbmUudGFuZ28ucG1y", + "LmhhcmR3YXJlYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tango.PMR.Hardware.HardwareMotorType), }, null)); @@ -35,22 +47,122 @@ namespace Tango.PMR.Hardware { } #region Enums public enum HardwareMotorType { + /// + ///Cleaning Head Motor + /// + [pbr::OriginalName("MOTO_DH_CLEANHEAD")] MotoDhCleanhead = 0, + /// + ///Cleaning Mechanism Motor + /// + [pbr::OriginalName("MOTO_DH_CLEANMECH")] MotoDhCleanmech = 1, + /// + ///Dyeing Head Lid Motor + /// + [pbr::OriginalName("MOTO_DH_LID")] MotoDhLid = 2, + /// + ///Dryer Main Motor + /// + [pbr::OriginalName("MOTO_DRYER_DRIVING")] MotoDryerDriving = 3, + /// + ///Drier Lid Motor + /// + [pbr::OriginalName("MOTO_DRYER_LID")] MotoDryerLid = 4, + /// + ///Drier Thread Loading Arm Motor + /// + [pbr::OriginalName("MOTO_DRYER_LOADARM")] MotoDryerLoadarm = 5, + /// + ///Dispenser 1 Motor + /// + [pbr::OriginalName("MOTO_DISPENSER_1")] MotoDispenser1 = 6, + /// + ///Dispenser 2 Motor + /// + [pbr::OriginalName("MOTO_DISPENSER_2")] MotoDispenser2 = 7, + /// + ///Dispenser 3 Motor + /// + [pbr::OriginalName("MOTO_DISPENSER_3")] MotoDispenser3 = 8, + /// + ///Dispenser 4 Motor + /// + [pbr::OriginalName("MOTO_DISPENSER_4")] MotoDispenser4 = 9, + /// + ///Dispenser 5 Motor + /// + [pbr::OriginalName("MOTO_DISPENSER_5")] MotoDispenser5 = 10, + /// + ///Dispenser 6 Motor + /// + [pbr::OriginalName("MOTO_DISPENSER_6")] MotoDispenser6 = 11, + /// + ///Dispenser 7 Motor + /// + [pbr::OriginalName("MOTO_DISPENSER_7")] MotoDispenser7 = 12, + /// + ///Dispenser 8 Motor + /// + [pbr::OriginalName("MOTO_DISPENSER_8")] MotoDispenser8 = 13, + /// + ///Winder Screw Motor + /// + [pbr::OriginalName("MOTO_SCREW")] MotoScrew = 14, /// ///Winder Motor /// - [pbr::OriginalName("WinderMotor")] WinderMotor = 0, + [pbr::OriginalName("MOTO_WINDER")] MotoWinder = 15, /// - ///Feeder Motor + ///Pooler Dancer Adjustment /// - [pbr::OriginalName("FeederMotor")] FeederMotor = 1, + [pbr::OriginalName("MOTO_LDANCER1")] MotoLdancer1 = 16, /// - ///Dryer Motor + ///Winder Dancer Adjustment #1 /// - [pbr::OriginalName("DryerMotor")] DryerMotor = 2, + [pbr::OriginalName("MOTO_LDANCER2")] MotoLdancer2 = 17, /// ///Pooler Motor /// - [pbr::OriginalName("PoolerMotor")] PoolerMotor = 3, + [pbr::OriginalName("MOTO_LDRIVING")] MotoLdriving = 18, + /// + ///Pooler Loading Motor + /// + [pbr::OriginalName("MOTO_LLOADING")] MotoLloading = 19, + /// + ///Pooler Loading Pivot Arm Motor + /// + [pbr::OriginalName("MOTO_LPIVOT1")] MotoLpivot1 = 20, + /// + ///Feeder Dancer Adjustment Motor + /// + [pbr::OriginalName("MOTO_RDANCER")] MotoRdancer = 21, + /// + ///Feeder Motor + /// + [pbr::OriginalName("MOTO_RDRIVING")] MotoRdriving = 22, + /// + ///Right Loading Arm Motor + /// + [pbr::OriginalName("MOTO_RLOADARM")] MotoRloadarm = 23, + /// + ///Right Loading Motor + /// + [pbr::OriginalName("MOTO_RLOADING")] MotoRloading = 24, + /// + ///Spare 1 Motor + /// + [pbr::OriginalName("MOTO_SPARE1_1")] MotoSpare11 = 25, + /// + ///Spare 2 Motor + /// + [pbr::OriginalName("MOTO_SPARE1_2")] MotoSpare12 = 26, + /// + ///Spare 3 Motor + /// + [pbr::OriginalName("MOTO_SPARE2_1")] MotoSpare21 = 27, + /// + ///Spare 4 Motor + /// + [pbr::OriginalName("MOTO_SPARE2_2")] MotoSpare22 = 28, } #endregion diff --git a/Software/Visual_Studio/Tango.SharedUI/Converters/StringToWordsConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Converters/StringToWordsConverter.cs new file mode 100644 index 000000000..2fcdac18b --- /dev/null +++ b/Software/Visual_Studio/Tango.SharedUI/Converters/StringToWordsConverter.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.SharedUI.Converters +{ + public class StringToWordsConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return value.ToString().ToWords(); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj index 49590dcf5..0fdc5950e 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj +++ b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj @@ -112,6 +112,7 @@ + -- cgit v1.3.1