From d50797ddb8c3d886d38a56a09dfe34540512e331 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 18 Nov 2019 15:13:33 +0200 Subject: Working on PPC Maintenance screen. --- .../ViewModels/GeneralGuideViewVM.cs | 33 +++++++++++++++++++ .../Tango.PPC.Maintenance/ViewModels/MainViewVM.cs | 31 ++++++++++++++++++ .../ViewModels/MaintenanceViewVM.cs | 37 ++++++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/GeneralGuideViewVM.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MainViewVM.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/GeneralGuideViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/GeneralGuideViewVM.cs new file mode 100644 index 000000000..1149da103 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/GeneralGuideViewVM.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.PPC.Common; +using Tango.PPC.Common.Navigation; + +namespace Tango.PPC.Maintenance.ViewModels +{ + public class GeneralGuideViewVM : PPCViewModel, INavigationObjectReceiver + { + private GuideBase _guide; + public GuideBase Guide + { + get { return _guide; } + set { _guide = value; RaisePropertyChangedAuto(); } + } + + + public override void OnApplicationStarted() + { + + } + + public void OnNavigatedToWithObject(GuideBase guide) + { + guide.Steps.ForEach(x => x.IsChecked = false); + + Guide = guide; + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MainViewVM.cs new file mode 100644 index 000000000..a614f7be2 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MainViewVM.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.PPC.Common; +using Tango.PPC.Maintenance.Views; + +namespace Tango.PPC.Maintenance.ViewModels +{ + /// + /// Represents the main view VM and entry point for . + /// + /// + public class MainViewVM : PPCViewModel + { + /// + /// Called when the application has been started + /// + public override void OnApplicationStarted() + { + //Start initializing here rather then in the constructor. + } + + public override void OnNavigatedTo() + { + base.OnNavigatedTo(); + NavigationManager.NavigateTo(nameof(MaintenanceView), false); + } + } +} 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 new file mode 100644 index 000000000..ffd388093 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.PPC.Common; +using Tango.PPC.Maintenance.Helpers; +using Tango.PPC.Maintenance.Views; + +namespace Tango.PPC.Maintenance.ViewModels +{ + public class MaintenanceViewVM : PPCViewModel + { + public ObservableCollection Guides { get; set; } + + public RelayCommand OpenGuideCommand { get; set; } + + public MaintenanceViewVM() + { + Guides = new ObservableCollection(GuideHelper.CreateAllGuides()); + + OpenGuideCommand = new RelayCommand(OpenGuide); + } + + public override void OnApplicationStarted() + { + + } + + public async void OpenGuide(GuideBase guide) + { + await NavigationManager.NavigateWithObject(guide); + } + } +} -- cgit v1.3.1 From 926844ac021bf0e95aa087ec9bf0a4444b3dabc7 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 19 Nov 2019 10:20:19 +0200 Subject: Added related animations to guides on PPC. --- .../PPC/Modules/Tango.PPC.Maintenance/GuideBase.cs | 2 +- .../Guides/HandleWasteCartridgeGuide.cs | 30 ++++++++++++++++++--- .../Guides/LoadInkCartridgeGuide.cs | 30 ++++++++++++++++++--- .../Guides/LoadNewThreadGuide.cs | 30 ++++++++++++++++++--- .../Guides/ReplaceAirFilterGuide.cs | 30 ++++++++++++++++++--- .../Guides/ReplaceThreadGuide.cs | 30 ++++++++++++++++++--- .../Images/Guides/Loading-New-Thread.gif | Bin 0 -> 4467469 bytes .../Images/Guides/Loading-an-Ink-Cartridge.gif | Bin 0 -> 4197318 bytes .../Images/Guides/Replacing-the-Air-Filter.gif | Bin 0 -> 3500573 bytes .../Images/Guides/Replacing-the-Thread.gif | Bin 0 -> 13319358 bytes .../Images/Guides/Residue-Cartridges-A.gif | Bin 0 -> 3567850 bytes .../Tango.PPC.Maintenance.csproj | 11 ++++++++ .../ViewModels/GeneralGuideViewVM.cs | 11 ++++++-- .../Views/GeneralGuideView.xaml | 6 ++--- .../Tango.Touch/Controls/TouchGifAnimation.cs | 4 +-- 15 files changed, 161 insertions(+), 23 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Loading-New-Thread.gif create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Loading-an-Ink-Cartridge.gif create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Replacing-the-Air-Filter.gif create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Replacing-the-Thread.gif create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Residue-Cartridges-A.gif (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/GuideBase.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/GuideBase.cs index f016182d8..438375c72 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/GuideBase.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/GuideBase.cs @@ -12,7 +12,7 @@ namespace Tango.PPC.Maintenance { public abstract String Name { get; } public abstract BitmapSource Icon { get; } - public abstract BitmapSource Image { get; } + public abstract String Image { get; } public abstract List Steps { get; } protected virtual List GetStepsFromResource(String key) diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/HandleWasteCartridgeGuide.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/HandleWasteCartridgeGuide.cs index 0904728fb..a4820e349 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/HandleWasteCartridgeGuide.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/HandleWasteCartridgeGuide.cs @@ -12,8 +12,32 @@ namespace Tango.PPC.Maintenance.Guides public class HandleWasteCartridgeGuide : GuideBase { public override string Name => "Handling the Waste Cartridges"; - public override BitmapSource Icon => ResourceHelper.GetImageFromResources("Images/Guides/handling-the-waste-cartridges.png"); - public override BitmapSource Image => ResourceHelper.GetImageFromResources("Images/Guides/machine-image.png"); - public override List Steps => GetStepsFromResource("HandleWasteCartridge"); + public override String Image => "../Images/Guides/Residue-Cartridges-A.gif"; + + private BitmapSource _icon; + public override BitmapSource Icon + { + get + { + if (_icon == null) + { + _icon = ResourceHelper.GetImageFromResources("Images/Guides/handling-the-waste-cartridges.png"); + } + return _icon; + } + } + + private List _steps; + public override List Steps + { + get + { + if (_steps == null) + { + _steps = GetStepsFromResource("HandleWasteCartridge"); + } + return _steps; + } + } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/LoadInkCartridgeGuide.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/LoadInkCartridgeGuide.cs index d100b25a0..1a6ed8321 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/LoadInkCartridgeGuide.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/LoadInkCartridgeGuide.cs @@ -12,8 +12,32 @@ namespace Tango.PPC.Maintenance.Guides public class LoadInkCartridgeGuide : GuideBase { public override string Name => "Loading an Ink Cartridge"; - public override BitmapSource Icon => ResourceHelper.GetImageFromResources("Images/Guides/loading-an-ink-cartridge.png"); - public override BitmapSource Image => ResourceHelper.GetImageFromResources("Images/Guides/machine-image.png"); - public override List Steps => GetStepsFromResource("LoadInkCartridge"); + public override String Image => "../Images/Guides/Loading-an-Ink-Cartridge.gif"; + + private BitmapSource _icon; + public override BitmapSource Icon + { + get + { + if (_icon == null) + { + _icon = ResourceHelper.GetImageFromResources("Images/Guides/loading-an-ink-cartridge.png"); + } + return _icon; + } + } + + private List _steps; + public override List Steps + { + get + { + if (_steps == null) + { + _steps = GetStepsFromResource("LoadInkCartridge"); + } + return _steps; + } + } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/LoadNewThreadGuide.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/LoadNewThreadGuide.cs index b32be18cd..d5115a748 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/LoadNewThreadGuide.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/LoadNewThreadGuide.cs @@ -12,8 +12,32 @@ namespace Tango.PPC.Maintenance.Guides public class LoadNewThreadGuide : GuideBase { public override string Name => "Loading New Thread"; - public override BitmapSource Icon => ResourceHelper.GetImageFromResources("Images/Guides/loading-new-thread.png"); - public override BitmapSource Image => ResourceHelper.GetImageFromResources("Images/Guides/machine-image.png"); - public override List Steps => GetStepsFromResource("LoadNewThread"); + public override String Image => "../Images/Guides/Loading-New-Thread.gif"; + + private BitmapSource _icon; + public override BitmapSource Icon + { + get + { + if (_icon == null) + { + _icon = ResourceHelper.GetImageFromResources("Images/Guides/loading-new-thread.png"); + } + return _icon; + } + } + + private List _steps; + public override List Steps + { + get + { + if (_steps == null) + { + _steps = GetStepsFromResource("LoadNewThread"); + } + return _steps; + } + } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/ReplaceAirFilterGuide.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/ReplaceAirFilterGuide.cs index 57f60fd79..d335867ca 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/ReplaceAirFilterGuide.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/ReplaceAirFilterGuide.cs @@ -12,8 +12,32 @@ namespace Tango.PPC.Maintenance.Guides public class ReplaceAirFilterGuide : GuideBase { public override string Name => "Replacing the Air Filter"; - public override BitmapSource Icon => ResourceHelper.GetImageFromResources("Images/Guides/replacing-the-air-filter.png"); - public override BitmapSource Image => ResourceHelper.GetImageFromResources("Images/Guides/machine-image.png"); - public override List Steps => GetStepsFromResource("ReplaceAirFilter"); + public override String Image => "../Images/Guides/Replacing-the-Air-Filter.gif"; + + private BitmapSource _icon; + public override BitmapSource Icon + { + get + { + if (_icon == null) + { + _icon = ResourceHelper.GetImageFromResources("Images/Guides/replacing-the-air-filter.png"); + } + return _icon; + } + } + + private List _steps; + public override List Steps + { + get + { + if (_steps == null) + { + _steps = GetStepsFromResource("ReplaceAirFilter"); + } + return _steps; + } + } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/ReplaceThreadGuide.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/ReplaceThreadGuide.cs index 781f3351a..ecc3f6026 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/ReplaceThreadGuide.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/ReplaceThreadGuide.cs @@ -12,8 +12,32 @@ namespace Tango.PPC.Maintenance.Guides public class ReplaceThreadGuide : GuideBase { public override string Name => "Replacing the Thread"; - public override BitmapSource Icon => ResourceHelper.GetImageFromResources("Images/Guides/replacing-the-thread.png"); - public override BitmapSource Image => ResourceHelper.GetImageFromResources("Images/Guides/machine-image.png"); - public override List Steps => GetStepsFromResource("ReplaceThread"); + public override String Image => "../Images/Guides/Replacing-the-Thread.gif"; + + private BitmapSource _icon; + public override BitmapSource Icon + { + get + { + if (_icon == null) + { + _icon = ResourceHelper.GetImageFromResources("Images/Guides/replacing-the-thread.png"); + } + return _icon; + } + } + + private List _steps; + public override List Steps + { + get + { + if (_steps == null) + { + _steps = GetStepsFromResource("ReplaceThread"); + } + return _steps; + } + } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Loading-New-Thread.gif b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Loading-New-Thread.gif new file mode 100644 index 000000000..a89f37004 Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Loading-New-Thread.gif differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Loading-an-Ink-Cartridge.gif b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Loading-an-Ink-Cartridge.gif new file mode 100644 index 000000000..7087ebc64 Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Loading-an-Ink-Cartridge.gif differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Replacing-the-Air-Filter.gif b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Replacing-the-Air-Filter.gif new file mode 100644 index 000000000..023adb4a9 Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Replacing-the-Air-Filter.gif differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Replacing-the-Thread.gif b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Replacing-the-Thread.gif new file mode 100644 index 000000000..8ab544d8b Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Replacing-the-Thread.gif differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Residue-Cartridges-A.gif b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Residue-Cartridges-A.gif new file mode 100644 index 000000000..c310820b4 Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Residue-Cartridges-A.gif differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj index b342b5a87..e7131fe80 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj @@ -210,6 +210,17 @@ + + + + + + + + + + + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/GeneralGuideViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/GeneralGuideViewVM.cs index 1149da103..fd0475817 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/GeneralGuideViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/GeneralGuideViewVM.cs @@ -10,6 +10,8 @@ namespace Tango.PPC.Maintenance.ViewModels { public class GeneralGuideViewVM : PPCViewModel, INavigationObjectReceiver { + private DateTime _lastTime; + private GuideBase _guide; public GuideBase Guide { @@ -20,14 +22,19 @@ namespace Tango.PPC.Maintenance.ViewModels public override void OnApplicationStarted() { - + _lastTime = DateTime.Now; } public void OnNavigatedToWithObject(GuideBase guide) { - guide.Steps.ForEach(x => x.IsChecked = false); + if (Guide != guide || (DateTime.Now - _lastTime) > TimeSpan.FromHours(1)) + { + guide.Steps.ForEach(x => x.IsChecked = false); + } Guide = guide; + + _lastTime = DateTime.Now; } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/GeneralGuideView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/GeneralGuideView.xaml index 9d57952c5..ecff03b58 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/GeneralGuideView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/GeneralGuideView.xaml @@ -27,9 +27,9 @@ - + - + @@ -46,7 +46,7 @@ - + diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchGifAnimation.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchGifAnimation.cs index 38a2175d8..0f3eefb9b 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchGifAnimation.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchGifAnimation.cs @@ -51,12 +51,12 @@ namespace Tango.Touch.Controls public TouchGifAnimation() { - Loaded += TouchGifAnimation_Loaded; + //Loaded += TouchGifAnimation_Loaded; } private void TouchGifAnimation_Loaded(object sender, RoutedEventArgs e) { - EnableAnimation = EnableAnimation; + //EnableAnimation = EnableAnimation; } static TouchGifAnimation() -- cgit v1.3.1 From 839b52f073ae0da152d5942564d28889cc576fff Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 19 Nov 2019 13:33:59 +0200 Subject: Implemented midtank level status to maintenance screen. --- .../MidTankLevelToElementHeightConverter.cs | 34 +++++++++++ .../Converters/StringToFirstLetterConverter.cs | 30 ++++++++++ .../Models/MidTankLevelModel.cs | 35 +++++++++++ .../Tango.PPC.Maintenance.csproj | 7 +++ .../ViewModels/MaintenanceViewVM.cs | 44 ++++++++++++++ .../Views/MaintenanceView.xaml | 68 +++++++++++++++++++++- .../Views/MaintenanceView.xaml.cs | 2 + .../Tango.Integration/Operation/MachineOperator.cs | 5 ++ .../Tango.MachineEM.UI/Views/MainView.xaml | 2 +- 9 files changed, 225 insertions(+), 2 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/MidTankLevelToElementHeightConverter.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/StringToFirstLetterConverter.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/MidTankLevelToElementHeightConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/MidTankLevelToElementHeightConverter.cs new file mode 100644 index 000000000..5cf3f535c --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/MidTankLevelToElementHeightConverter.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using Tango.Integration.Operation; + +namespace Tango.PPC.Maintenance.Converters +{ + public class MidTankLevelToElementHeightConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + try + { + double parentActualHeight = (double)values[0]; + double midTankLevel = (double)values[1]; + + return (midTankLevel / MachineOperator.MAX_MIDTANK_LITERS) * parentActualHeight; + } + catch + { + return 0d; + } + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/StringToFirstLetterConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/StringToFirstLetterConverter.cs new file mode 100644 index 000000000..0922af78d --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/StringToFirstLetterConverter.cs @@ -0,0 +1,30 @@ +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.PPC.Maintenance.Converters +{ + public class StringToFirstLetterConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value != null && value.ToString().Length > 1) + { + return value.ToString().First().ToString(); + } + else + { + return value; + } + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs new file mode 100644 index 000000000..93af310ba --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.Core; +using Tango.Integration.Operation; + +namespace Tango.PPC.Maintenance.Models +{ + public class MidTankLevelModel : ExtendedObject + { + public double Max { get; set; } + + private double _level; + public double Level + { + get { return _level; } + set { _level = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(IsLow)); RaisePropertyChanged(nameof(IsEmpty)); } + } + + public bool IsLow + { + get { return Level <= MachineOperator.LOW_MIDTANK_LITERS; } + } + + public bool IsEmpty + { + get { return Level <= MachineOperator.EMPTY_MIDTANK_LITERS; } + } + + public IdsPack IDSPack { get; set; } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj index e7131fe80..d774649ea 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj @@ -90,6 +90,8 @@ GlobalVersionInfo.cs + + @@ -99,6 +101,7 @@ + Code @@ -149,6 +152,10 @@ {b112d89a-a106-41ae-a0c1-4abc84c477f5} Tango.DragAndDrop + + {4206ac58-3b57-4699-8835-90bf6db01a61} + Tango.Integration + {bc932dbd-7cdb-488c-99e4-f02cf441f55e} Tango.Logging 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 ffd388093..39932888e 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 @@ -5,8 +5,11 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.Core.Commands; +using Tango.Integration.Operation; +using Tango.PMR.MachineStatus; using Tango.PPC.Common; using Tango.PPC.Maintenance.Helpers; +using Tango.PPC.Maintenance.Models; using Tango.PPC.Maintenance.Views; namespace Tango.PPC.Maintenance.ViewModels @@ -17,6 +20,13 @@ namespace Tango.PPC.Maintenance.ViewModels public RelayCommand OpenGuideCommand { get; set; } + private List _midTankLevels; + public List MidTankLevels + { + get { return _midTankLevels; } + set { _midTankLevels = value; RaisePropertyChangedAuto(); } + } + public MaintenanceViewVM() { Guides = new ObservableCollection(GuideHelper.CreateAllGuides()); @@ -29,9 +39,43 @@ namespace Tango.PPC.Maintenance.ViewModels } + public override void OnApplicationReady() + { + base.OnApplicationReady(); + + MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.OrderBy(x => x.PackIndex).Select(x => new MidTankLevelModel() + { + Max = MachineOperator.MAX_MIDTANK_LITERS, + IDSPack = x, + }).ToList(); + + MachineProvider.MachineOperator.MachineStatusChanged += MachineOperator_MachineStatusChanged; + } + + private void MachineOperator_MachineStatusChanged(object sender, MachineStatus status) + { + UpdateMidTankLevels(status); + } + public async void OpenGuide(GuideBase guide) { await NavigationManager.NavigateWithObject(guide); } + + private void UpdateMidTankLevels(MachineStatus status) + { + if (IsVisible) + { + foreach (var item in status.IDSPacksLevels) + { + var model = MidTankLevels.SingleOrDefault(x => x.IDSPack.PackIndex == item.Index); + + if (model != null) + { + model.Level = item.MidTankLevel; + } + } + } + } } } 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 c26025d92..658d0502c 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 @@ -6,11 +6,16 @@ xmlns:vm="clr-namespace:Tango.PPC.Maintenance.ViewModels" xmlns:global="clr-namespace:Tango.PPC.Maintenance" xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:localConverters="clr-namespace:Tango.PPC.Maintenance.Converters" 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}"> + + + + @@ -65,7 +70,68 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Temperature Inks diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml.cs index bc9d5e6ae..8fb9bd7ca 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml.cs @@ -12,6 +12,8 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.Integration.Operation; +using Tango.PPC.Maintenance.Models; namespace Tango.PPC.Maintenance.Views { diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index 6b90ef393..98d3248c5 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -55,6 +55,9 @@ namespace Tango.Integration.Operation public const String FIRMWARE_UPGRADE_CONFIG_FILE_NAME = "package.cfg"; public const String JOB_DESCRIPTION_FILE_NAME = "job_segments.jdf"; public const int MAX_DISPENSER_NANOLITER = 130000000; + public const double MAX_MIDTANK_LITERS = 1.8; + public const double EMPTY_MIDTANK_LITERS = 0.2; + public const double LOW_MIDTANK_LITERS = 0.3; private bool _diagnosticsSent; private bool _eventsSent; @@ -1506,6 +1509,8 @@ namespace Tango.Integration.Operation if (shouldThrow) { + exception.IdsPackLevels = exception.IdsPackLevels.OrderBy(x => x.IdsPack.PackIndex).ToList(); + throw LogManager.Log(exception, JsonConvert.SerializeObject(exception.IdsPackLevels.Select(x => new { Liquid = x.IdsPack.LiquidType.Name, diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml index 036fec7dc..15cbf9dc4 100644 --- a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml @@ -220,7 +220,7 @@ - + -- cgit v1.3.1 From 0ac921db3d7d296bd216282f1fbffa6dd1ba5eba Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 19 Nov 2019 16:18:56 +0200 Subject: Added OverallTemperature to DB Monitors. Added OverallTemperature support to Machine Emulator. Implemented OverallTemperature in maintenance screen PPC. --- Software/Graphics/Mobile/temperature-green.png | Bin 959 -> 926 bytes Software/Graphics/Mobile/temperature-green@2x.png | Bin 1725 -> 1730 bytes Software/Graphics/Mobile/temperature-green@3x.png | Bin 2474 -> 2482 bytes Software/Graphics/Mobile/temperature-red.png | Bin 0 -> 928 bytes Software/Graphics/Mobile/temperature-red@2x.png | Bin 0 -> 1733 bytes Software/Graphics/Mobile/temperature-red@3x.png | Bin 0 -> 2464 bytes Software/Graphics/Mobile/temperature-yellow.png | Bin 0 -> 927 bytes Software/Graphics/Mobile/temperature-yellow@2x.png | Bin 0 -> 1722 bytes Software/Graphics/Mobile/temperature-yellow@3x.png | Bin 0 -> 2469 bytes .../Messages/Diagnostics/DiagnosticsMonitors.proto | 3 ++ .../Images/temperature-green.png | Bin 959 -> 926 bytes .../Images/temperature-red.png | Bin 0 -> 928 bytes .../Images/temperature-yellow.png | Bin 0 -> 927 bytes .../Models/OverallTemperatureModel.cs | 30 +++++++++++++++++++ .../Tango.PPC.Maintenance.csproj | 5 ++++ .../ViewModels/MaintenanceViewVM.cs | 10 +++++++ .../Views/MaintenanceView.xaml | 21 ++++++++++++-- .../Tango.BL/Enumerations/TechMonitors.cs | 6 ++++ .../Tango.Integration/Operation/MachineOperator.cs | 4 +++ .../Tango.PMR/Diagnostics/DiagnosticsMonitors.cs | 32 ++++++++++++++++++--- .../Tango.MachineEM.UI/Views/MainView.xaml | 8 +++++- 21 files changed, 112 insertions(+), 7 deletions(-) create mode 100644 Software/Graphics/Mobile/temperature-red.png create mode 100644 Software/Graphics/Mobile/temperature-red@2x.png create mode 100644 Software/Graphics/Mobile/temperature-red@3x.png create mode 100644 Software/Graphics/Mobile/temperature-yellow.png create mode 100644 Software/Graphics/Mobile/temperature-yellow@2x.png create mode 100644 Software/Graphics/Mobile/temperature-yellow@3x.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-red.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-yellow.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/OverallTemperatureModel.cs (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels') diff --git a/Software/Graphics/Mobile/temperature-green.png b/Software/Graphics/Mobile/temperature-green.png index cdea8ff8b..f67323dde 100644 Binary files a/Software/Graphics/Mobile/temperature-green.png and b/Software/Graphics/Mobile/temperature-green.png differ diff --git a/Software/Graphics/Mobile/temperature-green@2x.png b/Software/Graphics/Mobile/temperature-green@2x.png index f7e7143eb..3d0c1724a 100644 Binary files a/Software/Graphics/Mobile/temperature-green@2x.png and b/Software/Graphics/Mobile/temperature-green@2x.png differ diff --git a/Software/Graphics/Mobile/temperature-green@3x.png b/Software/Graphics/Mobile/temperature-green@3x.png index be95be97e..d91cabfc8 100644 Binary files a/Software/Graphics/Mobile/temperature-green@3x.png and b/Software/Graphics/Mobile/temperature-green@3x.png differ diff --git a/Software/Graphics/Mobile/temperature-red.png b/Software/Graphics/Mobile/temperature-red.png new file mode 100644 index 000000000..5e6b505a3 Binary files /dev/null and b/Software/Graphics/Mobile/temperature-red.png differ diff --git a/Software/Graphics/Mobile/temperature-red@2x.png b/Software/Graphics/Mobile/temperature-red@2x.png new file mode 100644 index 000000000..265f02527 Binary files /dev/null and b/Software/Graphics/Mobile/temperature-red@2x.png differ diff --git a/Software/Graphics/Mobile/temperature-red@3x.png b/Software/Graphics/Mobile/temperature-red@3x.png new file mode 100644 index 000000000..4c19dbc70 Binary files /dev/null and b/Software/Graphics/Mobile/temperature-red@3x.png differ diff --git a/Software/Graphics/Mobile/temperature-yellow.png b/Software/Graphics/Mobile/temperature-yellow.png new file mode 100644 index 000000000..359e93d6d Binary files /dev/null and b/Software/Graphics/Mobile/temperature-yellow.png differ diff --git a/Software/Graphics/Mobile/temperature-yellow@2x.png b/Software/Graphics/Mobile/temperature-yellow@2x.png new file mode 100644 index 000000000..eaabb1c81 Binary files /dev/null and b/Software/Graphics/Mobile/temperature-yellow@2x.png differ diff --git a/Software/Graphics/Mobile/temperature-yellow@3x.png b/Software/Graphics/Mobile/temperature-yellow@3x.png new file mode 100644 index 000000000..0f58a63d5 Binary files /dev/null and b/Software/Graphics/Mobile/temperature-yellow@3x.png differ diff --git a/Software/PMR/Messages/Diagnostics/DiagnosticsMonitors.proto b/Software/PMR/Messages/Diagnostics/DiagnosticsMonitors.proto index 82d8d3192..9a988beb8 100644 --- a/Software/PMR/Messages/Diagnostics/DiagnosticsMonitors.proto +++ b/Software/PMR/Messages/Diagnostics/DiagnosticsMonitors.proto @@ -213,4 +213,7 @@ message DiagnosticsMonitors //Mid Tanks Ink Level (Min = 0, Max = 2, PPF = 1) Channel Count = 8 repeated DoubleArray MidTanksInkLevel = 65; + //Overall Temperature (Min = 0, Max = 100, PPF = 1) + repeated double OverallTemperature = 66; + } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-green.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-green.png index cdea8ff8b..f67323dde 100644 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-green.png and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-green.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-red.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-red.png new file mode 100644 index 000000000..5e6b505a3 Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-red.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-yellow.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-yellow.png new file mode 100644 index 000000000..359e93d6d Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-yellow.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/OverallTemperatureModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/OverallTemperatureModel.cs new file mode 100644 index 000000000..694071d0d --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/OverallTemperatureModel.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; +using Tango.Integration.Operation; + +namespace Tango.PPC.Maintenance.Models +{ + public class OverallTemperatureModel : ExtendedObject + { + private double _temperature; + public double Temperature + { + get { return _temperature; } + set { _temperature = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(IsWarning)); RaisePropertyChanged(nameof(IsError)); } + } + + public bool IsWarning + { + get { return Temperature > MachineOperator.OVERALL_TEMPERATURE_WARNING; } + } + + public bool IsError + { + get { return Temperature >= MachineOperator.OVERALL_TEMPERATURE_ERROR; } + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj index d774649ea..4a6957722 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj @@ -102,6 +102,7 @@ + Code @@ -228,6 +229,10 @@ + + + + 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 39932888e..014443eeb 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 @@ -27,9 +27,18 @@ namespace Tango.PPC.Maintenance.ViewModels set { _midTankLevels = value; RaisePropertyChangedAuto(); } } + private OverallTemperatureModel _overallTemperature; + public OverallTemperatureModel OverallTemperature + { + get { return _overallTemperature; } + set { _overallTemperature = value; RaisePropertyChangedAuto(); } + } + + public MaintenanceViewVM() { Guides = new ObservableCollection(GuideHelper.CreateAllGuides()); + OverallTemperature = new OverallTemperatureModel(); OpenGuideCommand = new RelayCommand(OpenGuide); } @@ -55,6 +64,7 @@ namespace Tango.PPC.Maintenance.ViewModels private void MachineOperator_MachineStatusChanged(object sender, MachineStatus status) { UpdateMidTankLevels(status); + OverallTemperature.Temperature = status.OverallTemperature; } public async void OpenGuide(GuideBase guide) 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 658d0502c..43a74a1a7 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 @@ -66,8 +66,25 @@ - - + + + + + + + + º + diff --git a/Software/Visual_Studio/Tango.BL/Enumerations/TechMonitors.cs b/Software/Visual_Studio/Tango.BL/Enumerations/TechMonitors.cs index a017c18d1..ad77d945c 100644 --- a/Software/Visual_Studio/Tango.BL/Enumerations/TechMonitors.cs +++ b/Software/Visual_Studio/Tango.BL/Enumerations/TechMonitors.cs @@ -373,6 +373,12 @@ namespace Tango.BL.Enumerations [Description("Mixer")] MixerTemperature = 9, + /// + /// (Overall Temperature) + /// + [Description("Overall Temperature")] + OverallTemperature = 102, + /// /// (Poller Motor) /// diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index 98d3248c5..85ee66756 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -54,10 +54,14 @@ namespace Tango.Integration.Operation public const String FIRMWARE_UPGRADE_FOLDER_NAME = "UpgradePackage"; public const String FIRMWARE_UPGRADE_CONFIG_FILE_NAME = "package.cfg"; public const String JOB_DESCRIPTION_FILE_NAME = "job_segments.jdf"; + public const int MAX_DISPENSER_NANOLITER = 130000000; public const double MAX_MIDTANK_LITERS = 1.8; public const double EMPTY_MIDTANK_LITERS = 0.2; public const double LOW_MIDTANK_LITERS = 0.3; + public const double OVERALL_TEMPERATURE_OK = 30; + public const double OVERALL_TEMPERATURE_WARNING = 30; + public const double OVERALL_TEMPERATURE_ERROR = 40; private bool _diagnosticsSent; private bool _eventsSent; diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/DiagnosticsMonitors.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/DiagnosticsMonitors.cs index 2e7191370..ea6dfb0cb 100644 --- a/Software/Visual_Studio/Tango.PMR/Diagnostics/DiagnosticsMonitors.cs +++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/DiagnosticsMonitors.cs @@ -23,7 +23,7 @@ namespace Tango.PMR.Diagnostics { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "ChlEaWFnbm9zdGljc01vbml0b3JzLnByb3RvEhVUYW5nby5QTVIuRGlhZ25v", - "c3RpY3MaEURvdWJsZUFycmF5LnByb3RvIoMQChNEaWFnbm9zdGljc01vbml0", + "c3RpY3MaEURvdWJsZUFycmF5LnByb3RvIp8QChNEaWFnbm9zdGljc01vbml0", "b3JzEhQKDERhbmNlcjFBbmdsZRgBIAMoARIUCgxEYW5jZXIyQW5nbGUYAiAD", "KAESFAoMRGFuY2VyM0FuZ2xlGAMgAygBEhwKFEZlZWRlck1vdG9yRnJlcXVl", "bmN5GAQgAygBEhIKCkRyeWVyTW90b3IYBSADKAESEwoLUG9sbGVyTW90b3IY", @@ -69,12 +69,12 @@ namespace Tango.PMR.Diagnostics { "YXRlckN1cnJlbnQYPyADKAESPgoSRGlzcGVuc2Vyc0lua0xldmVsGEAgAygL", "MiIuVGFuZ28uUE1SLkRpYWdub3N0aWNzLkRvdWJsZUFycmF5EjwKEE1pZFRh", "bmtzSW5rTGV2ZWwYQSADKAsyIi5UYW5nby5QTVIuRGlhZ25vc3RpY3MuRG91", - "YmxlQXJyYXlCIQofY29tLnR3aW5lLnRhbmdvLnBtci5kaWFnbm9zdGljc2IG", - "cHJvdG8z")); + "YmxlQXJyYXkSGgoST3ZlcmFsbFRlbXBlcmF0dXJlGEIgAygBQiEKH2NvbS50", + "d2luZS50YW5nby5wbXIuZGlhZ25vc3RpY3NiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Tango.PMR.Diagnostics.DoubleArrayReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.DiagnosticsMonitors), global::Tango.PMR.Diagnostics.DiagnosticsMonitors.Parser, new[]{ "Dancer1Angle", "Dancer2Angle", "Dancer3Angle", "FeederMotorFrequency", "DryerMotor", "PollerMotor", "WinderMotor", "ScrewMotor", "ThreadSpeed", "MixerTemperature", "HeadZone1Temperature", "HeadZone2Temperature", "HeadZone3Temperature", "HeadAirFlow", "FeederTension", "PullerTension", "DryerZone1Temperature", "DryerZone2Temperature", "DryerZone3Temperature", "DryerAirFlow", "WinderTension", "DispensersMotorsFrequency", "DispensersAngularEncoders", "DispensersLinearPositions", "DispensersPressure", "FilterDeltaPressure", "ChillerTemperature", "Dispenser1MotorFrequency", "Dispenser2MotorFrequency", "Dispenser3MotorFrequency", "Dispenser4MotorFrequency", "Dispenser5MotorFrequency", "Dispenser6MotorFrequency", "Dispenser7MotorFrequency", "Dispenser8MotorFrequency", "HeadZone4Temperature", "HeadZone5Temperature", "HeadZone6Temperature", "BlowerVoltage", "Dispenser1Pressure", "Dispenser2Pressure", "Dispenser3Pressure", "Dispenser4Pressure", "Dispenser5Pressure", "Dispenser6Pressure", "Dispenser7Pressure", "Dispenser8Pressure", "MidTank1Level", "MidTank2Level", "MidTank3Level", "MidTank4Level", "MidTank5Level", "MidTank6Level", "MidTank7Level", "MidTank8Level", "DrierZone1HeaterCurrent", "DrierZone2HeaterCurrent", "HeadZone1HeaterCurrent", "HeadZone2HeaterCurrent", "HeadZone3HeaterCurrent", "HeadZone4HeaterCurrent", "HeadZone56HeaterCurrent", "Mixer1HeaterCurrent", "DispensersInkLevel", "MidTanksInkLevel" }, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Diagnostics.DiagnosticsMonitors), global::Tango.PMR.Diagnostics.DiagnosticsMonitors.Parser, new[]{ "Dancer1Angle", "Dancer2Angle", "Dancer3Angle", "FeederMotorFrequency", "DryerMotor", "PollerMotor", "WinderMotor", "ScrewMotor", "ThreadSpeed", "MixerTemperature", "HeadZone1Temperature", "HeadZone2Temperature", "HeadZone3Temperature", "HeadAirFlow", "FeederTension", "PullerTension", "DryerZone1Temperature", "DryerZone2Temperature", "DryerZone3Temperature", "DryerAirFlow", "WinderTension", "DispensersMotorsFrequency", "DispensersAngularEncoders", "DispensersLinearPositions", "DispensersPressure", "FilterDeltaPressure", "ChillerTemperature", "Dispenser1MotorFrequency", "Dispenser2MotorFrequency", "Dispenser3MotorFrequency", "Dispenser4MotorFrequency", "Dispenser5MotorFrequency", "Dispenser6MotorFrequency", "Dispenser7MotorFrequency", "Dispenser8MotorFrequency", "HeadZone4Temperature", "HeadZone5Temperature", "HeadZone6Temperature", "BlowerVoltage", "Dispenser1Pressure", "Dispenser2Pressure", "Dispenser3Pressure", "Dispenser4Pressure", "Dispenser5Pressure", "Dispenser6Pressure", "Dispenser7Pressure", "Dispenser8Pressure", "MidTank1Level", "MidTank2Level", "MidTank3Level", "MidTank4Level", "MidTank5Level", "MidTank6Level", "MidTank7Level", "MidTank8Level", "DrierZone1HeaterCurrent", "DrierZone2HeaterCurrent", "HeadZone1HeaterCurrent", "HeadZone2HeaterCurrent", "HeadZone3HeaterCurrent", "HeadZone4HeaterCurrent", "HeadZone56HeaterCurrent", "Mixer1HeaterCurrent", "DispensersInkLevel", "MidTanksInkLevel", "OverallTemperature" }, null, null, null) })); } #endregion @@ -170,6 +170,7 @@ namespace Tango.PMR.Diagnostics { mixer1HeaterCurrent_ = other.mixer1HeaterCurrent_.Clone(); dispensersInkLevel_ = other.dispensersInkLevel_.Clone(); midTanksInkLevel_ = other.midTanksInkLevel_.Clone(); + overallTemperature_ = other.overallTemperature_.Clone(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1022,6 +1023,19 @@ namespace Tango.PMR.Diagnostics { get { return midTanksInkLevel_; } } + /// Field number for the "OverallTemperature" field. + public const int OverallTemperatureFieldNumber = 66; + private static readonly pb::FieldCodec _repeated_overallTemperature_codec + = pb::FieldCodec.ForDouble(530); + private readonly pbc::RepeatedField overallTemperature_ = new pbc::RepeatedField(); + /// + ///Overall Temperature (Min = 0, Max = 100, PPF = 1) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField OverallTemperature { + get { return overallTemperature_; } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as DiagnosticsMonitors); @@ -1100,6 +1114,7 @@ namespace Tango.PMR.Diagnostics { if(!mixer1HeaterCurrent_.Equals(other.mixer1HeaterCurrent_)) return false; if(!dispensersInkLevel_.Equals(other.dispensersInkLevel_)) return false; if(!midTanksInkLevel_.Equals(other.midTanksInkLevel_)) return false; + if(!overallTemperature_.Equals(other.overallTemperature_)) return false; return true; } @@ -1171,6 +1186,7 @@ namespace Tango.PMR.Diagnostics { hash ^= mixer1HeaterCurrent_.GetHashCode(); hash ^= dispensersInkLevel_.GetHashCode(); hash ^= midTanksInkLevel_.GetHashCode(); + hash ^= overallTemperature_.GetHashCode(); return hash; } @@ -1246,6 +1262,7 @@ namespace Tango.PMR.Diagnostics { mixer1HeaterCurrent_.WriteTo(output, _repeated_mixer1HeaterCurrent_codec); dispensersInkLevel_.WriteTo(output, _repeated_dispensersInkLevel_codec); midTanksInkLevel_.WriteTo(output, _repeated_midTanksInkLevel_codec); + overallTemperature_.WriteTo(output, _repeated_overallTemperature_codec); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1316,6 +1333,7 @@ namespace Tango.PMR.Diagnostics { size += mixer1HeaterCurrent_.CalculateSize(_repeated_mixer1HeaterCurrent_codec); size += dispensersInkLevel_.CalculateSize(_repeated_dispensersInkLevel_codec); size += midTanksInkLevel_.CalculateSize(_repeated_midTanksInkLevel_codec); + size += overallTemperature_.CalculateSize(_repeated_overallTemperature_codec); return size; } @@ -1389,6 +1407,7 @@ namespace Tango.PMR.Diagnostics { mixer1HeaterCurrent_.Add(other.mixer1HeaterCurrent_); dispensersInkLevel_.Add(other.dispensersInkLevel_); midTanksInkLevel_.Add(other.midTanksInkLevel_); + overallTemperature_.Add(other.overallTemperature_); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1718,6 +1737,11 @@ namespace Tango.PMR.Diagnostics { midTanksInkLevel_.AddEntriesFrom(input, _repeated_midTanksInkLevel_codec); break; } + case 530: + case 529: { + overallTemperature_.AddEntriesFrom(input, _repeated_overallTemperature_codec); + break; + } } } } diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml index 15cbf9dc4..58fbfef4c 100644 --- a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml @@ -198,7 +198,7 @@ IDS Packs Levels - + @@ -230,6 +230,12 @@ MACHINE STATE + + + OVERALL TEMPERATURE + + + -- cgit v1.3.1 From 60e85e52171a4423db4b06a173ee8a39c30abb90 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 24 Nov 2019 12:40:41 +0200 Subject: Implemented open/close dyeing head lead to maintenance. --- .../Tango.PPC.Maintenance.csproj | 13 +++- .../ViewModels/MaintenanceViewVM.cs | 86 ++++++++++++++++++++++ .../Views/MaintenanceView.xaml | 6 +- .../Modules/Tango.PPC.Maintenance/packages.config | 3 + .../Tango.Touch/Controls/TouchPanel.xaml | 2 +- 5 files changed, 105 insertions(+), 5 deletions(-) (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj index 4a6957722..ca7e1d1dc 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj @@ -48,6 +48,15 @@ + + ..\..\..\packages\System.Reactive.Core.3.1.1\lib\net46\System.Reactive.Core.dll + + + ..\..\..\packages\System.Reactive.Interfaces.3.1.1\lib\net45\System.Reactive.Interfaces.dll + + + ..\..\..\packages\System.Reactive.Linq.3.1.1\lib\net46\System.Reactive.Linq.dll + ..\..\..\packages\Expression.Blend.Sdk.1.0.2\lib\net45\System.Windows.Interactivity.dll @@ -133,7 +142,9 @@ ResXFileCodeGenerator Resources.Designer.cs - + + Designer + SettingsSingleFileGenerator 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 014443eeb..6622bc2f4 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 @@ -34,6 +34,9 @@ namespace Tango.PPC.Maintenance.ViewModels set { _overallTemperature = value; RaisePropertyChangedAuto(); } } + public RelayCommand OpenDyeingHeadCommand { get; set; } + + public RelayCommand CloseDyeingHeadCommand { get; set; } public MaintenanceViewVM() { @@ -41,6 +44,9 @@ namespace Tango.PPC.Maintenance.ViewModels OverallTemperature = new OverallTemperatureModel(); OpenGuideCommand = new RelayCommand(OpenGuide); + + OpenDyeingHeadCommand = new RelayCommand(OpenDyeingHead); + CloseDyeingHeadCommand = new RelayCommand(CloseDyeingHead); } public override void OnApplicationStarted() @@ -87,5 +93,85 @@ namespace Tango.PPC.Maintenance.ViewModels } } } + + private void OpenDyeingHead() + { + IsFree = false; + + try + { + NotificationProvider.SetGlobalBusyMessage("Opening dyeing head lead..."); + + MachineProvider.MachineOperator.StartMotorHoming(new PMR.Diagnostics.MotorHomingRequest() + { + Direction = PMR.Diagnostics.MotorDirection.Backward, + MotorType = PMR.Hardware.HardwareMotorType.MotoDhLid, + Speed = 400, + }).Subscribe((response) => + { + //Next + }, (ex) => + { + //Error + IsFree = true; + NotificationProvider.ReleaseGlobalBusyMessage(); + LogManager.Log(ex, "Error opening dyeing head lead."); + NotificationProvider.ShowError(ex.FlattenMessage()); + }, () => + { + //Complete + IsFree = true; + NotificationProvider.ReleaseGlobalBusyMessage(); + NotificationProvider.ShowSuccess("The dyeing head lead is now opened."); + }); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error opening dyeing head lead."); + NotificationProvider.ReleaseGlobalBusyMessage(); + NotificationProvider.ShowError(ex.FlattenMessage()); + IsFree = true; + } + } + + private void CloseDyeingHead() + { + IsFree = false; + + try + { + NotificationProvider.SetGlobalBusyMessage("Closing dyeing head lead..."); + + MachineProvider.MachineOperator.StartMotorHoming(new PMR.Diagnostics.MotorHomingRequest() + { + Direction = PMR.Diagnostics.MotorDirection.Forward, + MotorType = PMR.Hardware.HardwareMotorType.MotoDhLid, + Speed = 400, + }).Subscribe((response) => + { + //Next + }, (ex) => + { + //Error + IsFree = true; + NotificationProvider.ReleaseGlobalBusyMessage(); + LogManager.Log(ex, "Error closing dyeing head lead."); + NotificationProvider.ShowError(ex.FlattenMessage()); + }, () => + { + //Complete + IsFree = true; + NotificationProvider.ReleaseGlobalBusyMessage(); + NotificationProvider.ShowSuccess("The dyeing head lead is now closed."); + }); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error closing dyeing head lead."); + NotificationProvider.ReleaseGlobalBusyMessage(); + NotificationProvider.ShowError(ex.FlattenMessage()); + IsFree = true; + } + } } } 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 43a74a1a7..03d059999 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 @@ -27,7 +27,7 @@ - + @@ -167,9 +167,9 @@ - RUN HEAD CLEANING + OPEN DYEING HEAD LEAD - RUN HEAD CLEANING + CLOSE DYEING HEAD LEAD RUN HEAD CLEANING diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/packages.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/packages.config index 80367fdd2..7dea9c43f 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/packages.config +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/packages.config @@ -4,4 +4,7 @@ + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml index 2b35a5ede..b5af0a754 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml @@ -263,7 +263,7 @@ - +