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. --- .../PPC/Modules/Tango.PPC.Maintenance/App.xaml | 11 ++ .../PPC/Modules/Tango.PPC.Maintenance/GuideBase.cs | 35 ++++ .../PPC/Modules/Tango.PPC.Maintenance/GuideStep.cs | 21 ++ .../Guides/HandleWasteCartridgeGuide.cs | 19 ++ .../Guides/LoadInkCartridgeGuide.cs | 19 ++ .../Guides/LoadNewThreadGuide.cs | 19 ++ .../Guides/ReplaceAirFilterGuide.cs | 19 ++ .../Guides/ReplaceThreadGuide.cs | 19 ++ .../Tango.PPC.Maintenance/Helpers/GuideHelper.cs | 33 ++++ .../Guides/handling-the-waste-cartridges.png | Bin 0 -> 2174 bytes .../Images/Guides/loading-an-ink-cartridge.png | Bin 0 -> 2266 bytes .../Images/Guides/loading-new-thread.png | Bin 0 -> 2228 bytes .../Images/Guides/machine-image.png | Bin 0 -> 138220 bytes .../Images/Guides/replacing-the-air-filter.png | Bin 0 -> 2269 bytes .../Images/Guides/replacing-the-thread.png | Bin 0 -> 2175 bytes .../Tango.PPC.Maintenance/Images/action.png | Bin 0 -> 1152 bytes .../Tango.PPC.Maintenance/Images/guides.png | Bin 0 -> 2099 bytes .../Modules/Tango.PPC.Maintenance/Images/inks.png | Bin 0 -> 2075 bytes .../Tango.PPC.Maintenance/Images/maintenance.png | Bin 0 -> 686 bytes .../Tango.PPC.Maintenance/Images/status.png | Bin 0 -> 1663 bytes .../Images/temperature-green.png | Bin 0 -> 959 bytes .../Tango.PPC.Maintenance/MaintenanceModule.cs | 84 ++++++++ .../Properties/AssemblyInfo.cs | 20 ++ .../Properties/Resources.Designer.cs | 63 ++++++ .../Properties/Resources.resx | 117 +++++++++++ .../Properties/Settings.Designer.cs | 26 +++ .../Properties/Settings.settings | 7 + .../Tango.PPC.Maintenance/Resources/Guides.xaml | 60 ++++++ .../Tango.PPC.Maintenance.csproj | 219 +++++++++++++++++++++ .../Tango.PPC.Maintenance/ViewModelLocator.cs | 56 ++++++ .../ViewModels/GeneralGuideViewVM.cs | 33 ++++ .../Tango.PPC.Maintenance/ViewModels/MainViewVM.cs | 31 +++ .../ViewModels/MaintenanceViewVM.cs | 37 ++++ .../Views/GeneralGuideView.xaml | 55 ++++++ .../Views/GeneralGuideView.xaml.cs | 33 ++++ .../Tango.PPC.Maintenance/Views/MainView.xaml | 22 +++ .../Tango.PPC.Maintenance/Views/MainView.xaml.cs | 28 +++ .../Views/MaintenanceView.xaml | 127 ++++++++++++ .../Views/MaintenanceView.xaml.cs | 28 +++ .../PPC/Modules/Tango.PPC.Maintenance/app.config | 61 ++++++ .../Modules/Tango.PPC.Maintenance/packages.config | 7 + 41 files changed, 1309 insertions(+) create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/App.xaml create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/GuideBase.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/GuideStep.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/HandleWasteCartridgeGuide.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/LoadInkCartridgeGuide.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/LoadNewThreadGuide.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/ReplaceAirFilterGuide.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/ReplaceThreadGuide.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Helpers/GuideHelper.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/handling-the-waste-cartridges.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/loading-an-ink-cartridge.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/loading-new-thread.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/machine-image.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/replacing-the-air-filter.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/replacing-the-thread.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/action.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/guides.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/inks.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/maintenance.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/status.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-green.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/MaintenanceModule.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/AssemblyInfo.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Resources.Designer.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Resources.resx create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Settings.Designer.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Settings.settings create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Resources/Guides.xaml create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModelLocator.cs 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 create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/GeneralGuideView.xaml create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/GeneralGuideView.xaml.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MainView.xaml create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MainView.xaml.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/app.config create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/packages.config (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/App.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/App.xaml new file mode 100644 index 000000000..cb7592abd --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/App.xaml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/GuideBase.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/GuideBase.cs new file mode 100644 index 000000000..f016182d8 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/GuideBase.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; + +namespace Tango.PPC.Maintenance +{ + public abstract class GuideBase + { + public abstract String Name { get; } + public abstract BitmapSource Icon { get; } + public abstract BitmapSource Image { get; } + public abstract List Steps { get; } + + protected virtual List GetStepsFromResource(String key) + { + List list = new List(); + + var arr = (Application.Current.Resources[key] as Array); + + foreach (var item in arr) + { + list.Add(new GuideStep() + { + Text = item + }); + } + + return list; + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/GuideStep.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/GuideStep.cs new file mode 100644 index 000000000..71a70d9db --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/GuideStep.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; + +namespace Tango.PPC.Maintenance +{ + public class GuideStep : ExtendedObject + { + public Object Text { get; set; } + + private bool _isChecked; + public bool IsChecked + { + get { return _isChecked; } + set { _isChecked = value; RaisePropertyChangedAuto(); } + } + } +} 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 new file mode 100644 index 000000000..0904728fb --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/HandleWasteCartridgeGuide.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; +using Tango.SharedUI.Helpers; + +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"); + } +} 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 new file mode 100644 index 000000000..d100b25a0 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/LoadInkCartridgeGuide.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; +using Tango.SharedUI.Helpers; + +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"); + } +} 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 new file mode 100644 index 000000000..b32be18cd --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/LoadNewThreadGuide.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; +using Tango.SharedUI.Helpers; + +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"); + } +} 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 new file mode 100644 index 000000000..57f60fd79 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/ReplaceAirFilterGuide.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; +using Tango.SharedUI.Helpers; + +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"); + } +} 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 new file mode 100644 index 000000000..781f3351a --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/ReplaceThreadGuide.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; +using Tango.SharedUI.Helpers; + +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"); + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Helpers/GuideHelper.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Helpers/GuideHelper.cs new file mode 100644 index 000000000..32518974d --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Helpers/GuideHelper.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; + +namespace Tango.PPC.Maintenance.Helpers +{ + public static class GuideHelper + { + public static List CreateAllGuides() + { + var resource = new ResourceDictionary + { + Source = new Uri("/Tango.PPC.Maintenance;component/Resources/Guides.xaml", UriKind.RelativeOrAbsolute) + }; + + Application.Current.Resources.MergedDictionaries.Add(resource); + + List guides = new List(); + + var callingAssembly = typeof(GuideHelper).Assembly; + + foreach (var guideType in callingAssembly.DefinedTypes.Where(x => x.Namespace == "Tango.PPC.Maintenance.Guides")) + { + guides.Add(Activator.CreateInstance(guideType) as GuideBase); + } + + return guides; + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/handling-the-waste-cartridges.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/handling-the-waste-cartridges.png new file mode 100644 index 000000000..188e881bb Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/handling-the-waste-cartridges.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/loading-an-ink-cartridge.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/loading-an-ink-cartridge.png new file mode 100644 index 000000000..4f4dfc375 Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/loading-an-ink-cartridge.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/loading-new-thread.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/loading-new-thread.png new file mode 100644 index 000000000..1f508261b Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/loading-new-thread.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/machine-image.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/machine-image.png new file mode 100644 index 000000000..277599070 Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/machine-image.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/replacing-the-air-filter.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/replacing-the-air-filter.png new file mode 100644 index 000000000..eb8f518a3 Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/replacing-the-air-filter.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/replacing-the-thread.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/replacing-the-thread.png new file mode 100644 index 000000000..e858c3075 Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/replacing-the-thread.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/action.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/action.png new file mode 100644 index 000000000..6d14ec5dc Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/action.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/guides.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/guides.png new file mode 100644 index 000000000..13b9013d7 Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/guides.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/inks.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/inks.png new file mode 100644 index 000000000..3872a77e4 Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/inks.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/maintenance.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/maintenance.png new file mode 100644 index 000000000..526284750 Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/maintenance.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/status.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/status.png new file mode 100644 index 000000000..0cc205a6c Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/status.png differ 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 new file mode 100644 index 000000000..cdea8ff8b Binary files /dev/null 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/MaintenanceModule.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/MaintenanceModule.cs new file mode 100644 index 000000000..18871ac78 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/MaintenanceModule.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; +using Tango.BL.Enumerations; +using Tango.PPC.Common; +using Tango.PPC.Maintenance.Views; +using Tango.SharedUI.Helpers; + +namespace Tango.PPC.Maintenance +{ + /// + /// Represents a PPC . + /// + /// + [PPCModule(3)] + public class MaintenanceModule : PPCModuleBase + { + /// + /// Gets the module name. + /// + public override string Name + { + get + { + return "Maintenance"; + } + } + + /// + /// Gets the module description. + /// + public override string Description + { + get + { + return "PPC maintenance module."; + } + } + + /// + /// Gets the module cover image. + /// + public override BitmapSource Image + { + get + { + return ResourceHelper.GetImageFromResources("Images/maintenance.png"); + } + } + + /// + /// Gets the module entry point view type. + /// + public override Type MainViewType + { + get + { + return typeof(MainView); + } + } + + /// + /// Gets the permission required to see and load this module. + /// + public override Permissions Permission + { + get + { + return Permissions.RunPPC; + } + } + + /// + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// + public override void Dispose() + { + //Dispose module here... + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..52774bee8 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Tango Module")] +[assembly: AssemblyVersion("2.0.1.1407")] + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Resources.Designer.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Resources.Designer.cs new file mode 100644 index 000000000..003dc17e5 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.PPC.Maintenance.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.PPC.Maintenance.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Resources.resx b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Settings.Designer.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Settings.Designer.cs new file mode 100644 index 000000000..7b549e7b7 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.PPC.Maintenance.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Settings.settings b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Resources/Guides.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Resources/Guides.xaml new file mode 100644 index 000000000..24e1e0d71 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Resources/Guides.xaml @@ -0,0 +1,60 @@ + + + + 1. Loading New Thread + 2. Wait for a message indicating the system is ready to load the thread + 3. Place a cone with un-dyed thread into the thread feeding unit + 4. Feed the thread along the thread groove to the winder + 5. Place an empty collecting cone into the thread winder + 6. Insert the end of the thread into the empty collecting cone + 7. On the TS-1800 panel, press LOAD again + + + + 1. On the TS-1800 panel, press LOAD + 2. Wait for a message indicating the system is ready to load the thread + 3. Place a cone with un-dyed thread into the thread feeding unit + 4. Feed the tread along the feeding path up to the top cover + 5. Feed the thread along the thread groove to the winder + 6. Place an empty collecting cone into the thread winder + 7. Insert the end of the thread into the empty collecting cone + 8. On the TS-1800 panel, press LOAD again + + + + 1. Cut the current thread just after the feeding cone + 2. Remove the current feeding cone + 3. Place the new feeding cone into the thread feeding unit + 4. Tie the new thread to the current thread + 5. Cut off the ends of the thread leaving a small knot + 6. On the TS-1800 panel, press and hold the JOG button + 7. Hold the JOG button until the knot appears at the collecting cone + 8. Cut the thread at the collecting cone after the knot + 9. Remove the collecting cone + 10. Place an empty collecting cone into the winder + 11. Insert the end of the new thread into the empty collecting cone + + + + 1. Open the air filter cover + 2. Remove the old air filter + 3. Insert a new air filter + 4. Close the air filter cover + + + + 1. Open the cartridge cover + 2. Insert a full ink cartridge into the ink-loading slot + 3. Close the cartridge cover + 4. When ink loading is complete, open the cartridge cover + 5. Remove the empty ink cartridge + 6. Remove the stopper from the residue-filling opening + 7. Place the stopper into its allocated position on the top side of the empty ink cartridge + 8. Put the empty ink cartridge into storage. Optional: if an empty recycling slot is available + 9. Insert the empty ink cartridge into the slot for ink recycling + + + \ No newline at end of file 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 new file mode 100644 index 000000000..b342b5a87 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj @@ -0,0 +1,219 @@ + + + + + Debug + AnyCPU + {011470AC-6BD6-4366-B5F2-C82C065D4A84} + library + Tango.PPC.Maintenance + Tango.PPC.Maintenance + v4.6.1 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + + true + full + false + ..\..\..\Build\PPC\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\..\Build\PPC\Release\ + TRACE + prompt + 4 + + + + ..\..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll + True + + + ..\..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll + + + ..\..\..\packages\FontAwesome.WPF.4.7.0.9\lib\net40\FontAwesome.WPF.dll + + + ..\..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll + + + + + + ..\..\..\packages\Expression.Blend.Sdk.1.0.2\lib\net45\System.Windows.Interactivity.dll + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + + + GlobalVersionInfo.cs + + + + + + + + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + + + GeneralGuideView.xaml + + + MaintenanceView.xaml + + + MainView.xaml + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + {f441feee-322a-4943-b566-110e12fd3b72} + Tango.BL + + + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} + Tango.Core + + + {b112d89a-a106-41ae-a0c1-4abc84c477f5} + Tango.DragAndDrop + + + {bc932dbd-7cdb-488c-99e4-f02cf441f55e} + Tango.Logging + + + {e4927038-348d-4295-aaf4-861c58cb3943} + Tango.PMR + + + {d8f1ad85-526a-4f50-b6dc-d437af63d8d8} + Tango.Settings + + + {8491d07b-c1f6-4b62-a412-41b9fd2d6538} + Tango.SharedUI + + + {fd86424c-6e84-491b-8df9-3d0f5c236a2a} + Tango.Touch + + + {74e700b0-1156-4126-be40-ee450d3c3026} + Tango.Transport + + + {0be74eee-22cb-4dba-b896-793b9e1a3ac0} + Tango.PPC.Common + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModelLocator.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModelLocator.cs new file mode 100644 index 000000000..1db63a9e4 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModelLocator.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.DI; +using Tango.PPC.Maintenance.ViewModels; + +namespace Tango.PPC.Maintenance +{ + public static class ViewModelLocator + { + /// + /// Initializes a new instance of the ViewModelLocator class. + /// + static ViewModelLocator() + { + TangoIOC.Default.Register(); + TangoIOC.Default.Register(); + TangoIOC.Default.Register(); + } + + /// + /// Gets the main view VM. + /// + public static MainViewVM MainViewVM + { + get + { + return TangoIOC.Default.GetInstance(); + } + } + + /// + /// Gets the maintenance view VM. + /// + public static MaintenanceViewVM MaintenanceViewVM + { + get + { + return TangoIOC.Default.GetInstance(); + } + } + + /// + /// Gets the general guide view VM. + /// + public static GeneralGuideViewVM GeneralGuideViewVM + { + get + { + return TangoIOC.Default.GetInstance(); + } + } + } +} 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); + } + } +} 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 new file mode 100644 index 000000000..9d57952c5 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/GeneralGuideView.xaml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/GeneralGuideView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/GeneralGuideView.xaml.cs new file mode 100644 index 000000000..10b5337ce --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/GeneralGuideView.xaml.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.PPC.Maintenance.Views +{ + /// + /// Interaction logic for GeneralGuideView.xaml + /// + public partial class GeneralGuideView : UserControl + { + public GeneralGuideView() + { + InitializeComponent(); + } + + private void TouchCheckBox_Loaded(object sender, RoutedEventArgs e) + { + + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MainView.xaml new file mode 100644 index 000000000..be6161952 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MainView.xaml @@ -0,0 +1,22 @@ + + + + + + + + + + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MainView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MainView.xaml.cs new file mode 100644 index 000000000..f859c9524 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MainView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.PPC.Maintenance.Views +{ + /// + /// Interaction logic for MainView.xaml + /// + public partial class MainView : UserControl + { + public MainView() + { + InitializeComponent(); + } + } +} 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 new file mode 100644 index 000000000..c26025d92 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + Maintenance + + + + + + + + + + + + Current Status + + + + + + + + + + + + + + + + + + + + + + + Temperature + Inks + + + + + + + + + + + Actions + + + + + RUN HEAD CLEANING + + RUN HEAD CLEANING + + RUN HEAD CLEANING + + + + + + + + + + + Guides + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 000000000..bc9d5e6ae --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.PPC.Maintenance.Views +{ + /// + /// Interaction logic for MainView.xaml + /// + public partial class MaintenanceView : UserControl + { + public MaintenanceView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/app.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/app.config new file mode 100644 index 000000000..1e22e6a88 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/app.config @@ -0,0 +1,61 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/packages.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/packages.config new file mode 100644 index 000000000..80367fdd2 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file -- 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') 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') 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') 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') 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 @@ - + + + + + + + + + + + + + + + + + + + + + + + + @@ -88,67 +144,16 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + Temperature Inks diff --git a/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs b/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs index 60fdc6707..ce09d72ac 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media; +using Tango.BL.Enumerations; namespace Tango.BL.Entities { @@ -24,6 +25,13 @@ namespace Tango.BL.Entities get { return Core.Helpers.ColorHelper.IntegerToColor(Color); } } + [NotMapped] + [JsonIgnore] + public LiquidTypes Type + { + get { return (LiquidTypes)Code; } + } + /// /// Initializes a new instance of the class. /// diff --git a/Software/Visual_Studio/Tango.Logging/SessionFileLogger.cs b/Software/Visual_Studio/Tango.Logging/SessionFileLogger.cs new file mode 100644 index 000000000..f3c23ca25 --- /dev/null +++ b/Software/Visual_Studio/Tango.Logging/SessionFileLogger.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Logging +{ + public class SessionFileLogger : ILogger + { + private bool _inInSession; + + public const string FILE_SESSION_EXTENSION = "_session"; + + public static String DefaultLogsFolder { get; private set; } + + public bool Enabled { get; set; } + + public String Folder { get; private set; } + + public String LogFile { get; private set; } + + public String Tag { get; private set; } + + static SessionFileLogger() + { + DefaultLogsFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Twine", "Tango", "Logs", Path.GetFileNameWithoutExtension(AppDomain.CurrentDomain.FriendlyName), "session"); + } + + public SessionFileLogger(String folder, String tag) + { + Folder = folder; + Tag = tag; + Directory.CreateDirectory(Folder); + Enabled = true; + } + + public SessionFileLogger() : this(DefaultLogsFolder, Path.GetFileNameWithoutExtension(AppDomain.CurrentDomain.FriendlyName)) + { + + } + + public void CreateSession() + { + RemoveOldLogFile(); + LogFile = CreateLogFileName(); + _inInSession = true; + } + + public void EndSession() + { + _inInSession = false; + } + + private String CreateLogFileName() + { + return Path.Combine(Folder, string.Format("{1}-{0:dd-MM-yyyy_HH-mm-ss}{2}.log", DateTime.Now, Tag, FILE_SESSION_EXTENSION)); + } + + private void RemoveOldLogFile() + { + try + { + if (Directory.Exists(Folder)) + { + string[] fileEntries = Directory.GetFiles(Folder, "*.log"); + foreach (string fileName in fileEntries) + { + try + { + File.Delete(fileName); + } + catch (Exception ex) + { + Debug.WriteLine(ex); + } + } + } + } + catch (Exception ex) + { + Debug.WriteLine(ex); + } + } + + public void OnLog(LogItemBase output) + { + if (_inInSession) + { + try + { + File.AppendAllText(LogFile, output.ToString() + Environment.NewLine); + } + catch + { + Debug.WriteLine("Error Writing To Session Log File!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); + } + } + } + } +} diff --git a/Software/Visual_Studio/Tango.Logging/Tango.Logging.csproj b/Software/Visual_Studio/Tango.Logging/Tango.Logging.csproj index 311579625..e2e2b1edd 100644 --- a/Software/Visual_Studio/Tango.Logging/Tango.Logging.csproj +++ b/Software/Visual_Studio/Tango.Logging/Tango.Logging.csproj @@ -69,6 +69,7 @@ + diff --git a/Software/Visual_Studio/Tango.UnitTesting/Logging/SessionLoging_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/Logging/SessionLoging_TST.cs new file mode 100644 index 000000000..873fcca57 --- /dev/null +++ b/Software/Visual_Studio/Tango.UnitTesting/Logging/SessionLoging_TST.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Tango.Logging; + +namespace Tango.UnitTesting.Logging +{ + [TestClass] + [TestCategory("Logging")] + public class SessionLoging_TST + { + [TestMethod] + public void Create_Session_File_Logger() + { + SessionFileLogger sessionlogger = new SessionFileLogger(); + LogManager.Default.RegisterLogger(sessionlogger); + sessionlogger.CreateSession(); + var manager = LogManager.Default; + + manager.Log($"This is a test 1"); + Thread.Sleep(300); + SessionFileLogger slogger = LogManager.Default.RegisteredLoggers.FirstOrDefault(x => x.GetType() == typeof(SessionFileLogger)) as SessionFileLogger; + string[] fileEntries = Directory.GetFiles(slogger.Folder, "*.log"); + Assert.AreEqual(1, fileEntries.Count()); + + sessionlogger.CreateSession(); + manager.Log($"This is a test 2"); + Thread.Sleep(300); + fileEntries = Directory.GetFiles(slogger.Folder, "*.log"); + Assert.AreEqual(1, fileEntries.Count()); + } + } +} diff --git a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj index 05daac6c7..01e639a75 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj +++ b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj @@ -140,6 +140,7 @@ + @@ -309,7 +310,7 @@ - + \ No newline at end of file -- cgit v1.3.1 From 13cb1dc09c21769eee5db838830ea9c48806b174 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Thu, 23 Jan 2020 17:15:39 +0200 Subject: Redundant. --- .../PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance') 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 e71a1827e..2f7f91a80 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 @@ -152,7 +152,7 @@ - + Temperature @@ -163,7 +163,7 @@ - + @@ -176,7 +176,7 @@ CLOSE DYEING HEAD LEAD - EXPORT SYSTEM LOGS + EXPORT SYSTEM LOGS -- cgit v1.3.1