From 499f4facfe296d984a44e9ce0b6e1eb23ba8d644 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 5 Mar 2019 14:53:49 +0200 Subject: Improvements and bug fixes on PPC. --- .../PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | 33 ++++++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs index 52f0fb403..1c1eeca5e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -38,7 +38,15 @@ namespace Tango.PPC.UI.ViewModels public bool IsMenuOpened { get { return _isMenuOpened; } - set { _isMenuOpened = value; RaisePropertyChangedAuto(); } + set + { + _isMenuOpened = value; RaisePropertyChangedAuto(); + + if (!_isMenuOpened) + { + IsPowerOpened = false; + } + } } private bool _isNotificationsOpened; @@ -48,7 +56,20 @@ namespace Tango.PPC.UI.ViewModels public bool IsNotificationsOpened { get { return _isNotificationsOpened; } - set { _isNotificationsOpened = value; RaisePropertyChangedAuto(); } + set + { + _isNotificationsOpened = value; RaisePropertyChangedAuto(); + } + } + + private bool _isPowerOpened; + /// + /// Gets or sets a value indicating whether the power area is opened. + /// + public bool IsPowerOpened + { + get { return _isPowerOpened; } + set { _isPowerOpened = value; RaisePropertyChangedAuto(); } } #endregion @@ -90,6 +111,10 @@ namespace Tango.PPC.UI.ViewModels /// public RelayCommand UpdateCommand { get; set; } + /// + /// Gets or sets the power command. + /// + public RelayCommand PowerCommand { get; set; } #endregion #region Constructors @@ -106,12 +131,14 @@ namespace Tango.PPC.UI.ViewModels StopPrintingCommand = new RelayCommand(StopPrinting); SignOutCommand = new RelayCommand(SignOut); - UpdateCommand = new RelayCommand(() => + UpdateCommand = new RelayCommand(() => { NavigationManager.NavigateTo(NavigationView.MachineUpdateView); TangoIOC.Default.GetInstance().CheckForUpdates(); IsMenuOpened = false; }); + + PowerCommand = new RelayCommand(() => IsPowerOpened = true); } #endregion -- cgit v1.3.1 From 24d0a8782f8324f80222251a4ff4977d1258e3a8 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 19 Mar 2019 15:50:02 +0200 Subject: PPC Working on Tech Module. TCC using arocus + barcode scanning using ZBar! --- .../Android_Studio/ColorCapture/app/build.gradle | 1 + .../main/cpp/ColorCaptureLib/ColorCaptureLib.cpp | 1 + .../ColorCapture/app/src/main/cpp/native-lib.cpp | 2 +- .../views/capture/CaptureFragment.java | 33 +++++- Software/DB/PPC/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/PPC/Tango_log.ldf | Bin 53673984 -> 53673984 bytes .../PPC/Modules/Tango.PPC.Logging/App.xaml | 11 -- .../Tango.PPC.Logging/Images/logging_module.png | Bin 1345 -> 0 bytes .../PPC/Modules/Tango.PPC.Logging/LoggingModule.cs | 47 -------- .../Tango.PPC.Logging/Properties/AssemblyInfo.cs | 20 ---- .../Properties/Resources.Designer.cs | 62 ---------- .../Tango.PPC.Logging/Properties/Resources.resx | 117 ------------------- .../Properties/Settings.Designer.cs | 30 ----- .../Tango.PPC.Logging/Properties/Settings.settings | 7 -- .../Tango.PPC.Logging/Tango.PPC.Logging.csproj | 126 --------------------- .../Modules/Tango.PPC.Logging/ViewModelLocator.cs | 32 ------ .../Tango.PPC.Logging/ViewModels/MainViewVM.cs | 17 --- .../Modules/Tango.PPC.Logging/Views/MainView.xaml | 45 -------- .../Tango.PPC.Logging/Views/MainView.xaml.cs | 28 ----- .../PPC/Modules/Tango.PPC.Logging/app.config | 85 -------------- .../PPC/Modules/Tango.PPC.Logging/packages.config | 4 - .../PPC/Modules/Tango.PPC.Technician/App.xaml | 11 ++ .../Images/technician_module.png | Bin 0 -> 2518 bytes .../Properties/AssemblyInfo.cs | 20 ++++ .../Properties/Resources.Designer.cs | 63 +++++++++++ .../Tango.PPC.Technician/Properties/Resources.resx | 117 +++++++++++++++++++ .../Properties/Settings.Designer.cs | 26 +++++ .../Properties/Settings.settings | 7 ++ .../Tango.PPC.Technician.csproj | 126 +++++++++++++++++++++ .../Tango.PPC.Technician/TechnicianModule.cs | 47 ++++++++ .../Tango.PPC.Technician/ViewModelLocator.cs | 32 ++++++ .../Tango.PPC.Technician/ViewModels/MainViewVM.cs | 17 +++ .../Tango.PPC.Technician/Views/MainView.xaml | 45 ++++++++ .../Tango.PPC.Technician/Views/MainView.xaml.cs | 28 +++++ .../PPC/Modules/Tango.PPC.Technician/app.config | 85 ++++++++++++++ .../Modules/Tango.PPC.Technician/packages.config | 4 + .../Application/IPPCApplicationManager.cs | 5 + .../Dialogs/TechnicianModeLoginView.xaml | 26 +++++ .../Dialogs/TechnicianModeLoginView.xaml.cs | 28 +++++ .../Dialogs/TechnicianModeLoginViewVM.cs | 19 ++++ .../PPC/Tango.PPC.UI/Images/technician-mode.png | Bin 0 -> 3818 bytes .../PPCApplication/DefaultPPCApplicationManager.cs | 27 ++++- .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 19 +++- .../PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | 19 ++++ .../PPC/Tango.PPC.UI/Views/LayoutView.xaml | 2 +- .../PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs | 40 +++++++ .../Tango.Touch/Controls/TouchPanel.xaml | 15 +-- Software/Visual_Studio/Tango.sln | 98 ++++++++-------- 48 files changed, 896 insertions(+), 698 deletions(-) delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/App.xaml delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Images/logging_module.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/LoggingModule.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/AssemblyInfo.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Resources.Designer.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Resources.resx delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Settings.Designer.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Settings.settings delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Tango.PPC.Logging.csproj delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/ViewModelLocator.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/ViewModels/MainViewVM.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Views/MainView.xaml delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Views/MainView.xaml.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/app.config delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/packages.config create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/App.xaml create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/technician_module.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Properties/AssemblyInfo.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Properties/Resources.Designer.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Properties/Resources.resx create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Properties/Settings.Designer.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Properties/Settings.settings create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Tango.PPC.Technician.csproj create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/TechnicianModule.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModelLocator.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/MainViewVM.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/MainView.xaml create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/MainView.xaml.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/app.config create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/packages.config create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginViewVM.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Images/technician-mode.png (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs') diff --git a/Software/Android_Studio/ColorCapture/app/build.gradle b/Software/Android_Studio/ColorCapture/app/build.gradle index 57a59ea11..9a9df5b1a 100644 --- a/Software/Android_Studio/ColorCapture/app/build.gradle +++ b/Software/Android_Studio/ColorCapture/app/build.gradle @@ -66,5 +66,6 @@ dependencies { annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0' annotationProcessor 'com.google.dagger:dagger-android-processor:2.11' annotationProcessor 'com.google.dagger:dagger-compiler:2.11' + compile 'com.yanzhenjie.zbar:zbar:1.0.0' implementation project(':onboarding') } diff --git a/Software/Android_Studio/ColorCapture/app/src/main/cpp/ColorCaptureLib/ColorCaptureLib.cpp b/Software/Android_Studio/ColorCapture/app/src/main/cpp/ColorCaptureLib/ColorCaptureLib.cpp index 0b91e7b08..3a97b4911 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/cpp/ColorCaptureLib/ColorCaptureLib.cpp +++ b/Software/Android_Studio/ColorCapture/app/src/main/cpp/ColorCaptureLib/ColorCaptureLib.cpp @@ -732,6 +732,7 @@ vector ColorCaptureLib::GetArcusVertices(Mat image) aruco::DetectorParameters* params = new aruco::DetectorParameters(); params->cornerRefinementMethod = aruco::CORNER_REFINE_SUBPIX; + params->perspectiveRemovePixelPerCell = 50; Ptr dictionary = aruco::getPredefinedDictionary(aruco::DICT_4X4_50); diff --git a/Software/Android_Studio/ColorCapture/app/src/main/cpp/native-lib.cpp b/Software/Android_Studio/ColorCapture/app/src/main/cpp/native-lib.cpp index 3afccbec0..343203368 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/cpp/native-lib.cpp +++ b/Software/Android_Studio/ColorCapture/app/src/main/cpp/native-lib.cpp @@ -77,7 +77,7 @@ Java_com_twine_colorcapture_opencv_ImageProcessor_ProcessImage( Mat rot_mat = getRotationMatrix2D(src_center, -90, 1.0); warpAffine(rgb, rgb, rot_mat, rgb.size());*/ - vector vertices = capture.GetQRVertices4(rgb); + vector vertices = capture.GetArcusVertices(rgb); for (size_t i = 0; i < vertices.size(); i++) { circle(rgb, vertices[i], 2, CV_RGB(0, 0, 255), -1); diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/capture/CaptureFragment.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/capture/CaptureFragment.java index 4da196dda..491a05564 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/capture/CaptureFragment.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/capture/CaptureFragment.java @@ -10,6 +10,7 @@ import android.hardware.Camera.Size; import android.os.Build; import android.os.Handler; import android.os.Looper; +import android.util.Log; import android.view.Surface; import android.view.SurfaceHolder; import android.view.SurfaceView; @@ -23,10 +24,16 @@ import android.widget.ImageView; import com.twine.colorcapture.App; import com.twine.colorcapture.R; import com.twine.colorcapture.core.Task; +import com.twine.colorcapture.core.Task.TaskBuilder; import com.twine.colorcapture.databinding.FragmentCaptureBinding; import com.twine.colorcapture.mvvm.FragmentBase; import com.twine.colorcapture.opencv.ImageProcessor; +import com.yanzhenjie.zbar.Image; +import com.yanzhenjie.zbar.ImageScanner; +import com.yanzhenjie.zbar.Symbol; +import com.yanzhenjie.zbar.SymbolSet; +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.List; @@ -275,13 +282,37 @@ public class CaptureFragment extends FragmentBase { bProcessing = true; processor.ProcessImage(previewWidth, previewHeight, frameData, pixels, wrappedPixels); bitmap.setPixels(pixels, 0, previewHeight, 0, 0, previewHeight, previewWidth); wrappedBitmap.setPixels(wrappedPixels, 0, 300, 0, 0, 300, 330); + + + Log.d("BARCODE", "scanning barcode..."); + ImageScanner scanner = new ImageScanner(); + Image img = new Image(bitmap.getWidth(),bitmap.getHeight(),"RGB4"); + img.setData(pixels); + int result = scanner.scanImage(img.convert("Y800")); + + if (result != 0) + { + Log.d("BARCODE", "Got positive result..."); + + String text = null; + + SymbolSet symSet = scanner.getResults(); + for (Symbol sym : symSet) + text = sym.getData(); + + + String f = text; + + Log.d("BARCODE", "Barcode text is: " + text); + } + }) .setContinueWith(() -> { diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf index c8adf1df5..36b58c4d0 100644 Binary files a/Software/DB/PPC/Tango.mdf and b/Software/DB/PPC/Tango.mdf differ diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf index 0fde9e3de..ab7c33171 100644 Binary files a/Software/DB/PPC/Tango_log.ldf and b/Software/DB/PPC/Tango_log.ldf differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/App.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/App.xaml deleted file mode 100644 index 66ea48976..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/App.xaml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Images/logging_module.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Images/logging_module.png deleted file mode 100644 index 3f8318f70..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Images/logging_module.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/LoggingModule.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/LoggingModule.cs deleted file mode 100644 index 78c597e81..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/LoggingModule.cs +++ /dev/null @@ -1,47 +0,0 @@ -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.Logging.Views; -using Tango.SharedUI.Helpers; - -namespace Tango.PPC.Logging -{ - [PPCModule(5)] - public class LoggingModule : PPCModuleBase - { - public override string Name => "Logging"; - public override string Description => "PPC logging module."; - public override BitmapSource Image => ResourceHelper.GetImageFromResources("Images/logging_module.png"); - public override Type MainViewType => typeof(MainView); - public override Permissions Permission => Permissions.RunPPC; - - public LoggingModule() - { - IsVisibleInMenu = false; - } - - public override void OnTechnicianEntered() - { - base.OnTechnicianEntered(); - - IsVisibleInMenu = true; - } - - public override void OnTechnicianExited() - { - base.OnTechnicianExited(); - - IsVisibleInMenu = false; - } - - public override void Dispose() - { - - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/AssemblyInfo.cs deleted file mode 100644 index a834fd095..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,20 +0,0 @@ -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 PPC Logging Module")] -[assembly: AssemblyVersion("1.0.0.0")] - -[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.Logging/Properties/Resources.Designer.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Resources.Designer.cs deleted file mode 100644 index 6cbf8164a..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Resources.Designer.cs +++ /dev/null @@ -1,62 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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.Logging.Properties { - - - /// - /// 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", "4.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 ((resourceMan == null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.PPC.Logging.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.Logging/Properties/Resources.resx b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Resources.resx deleted file mode 100644 index af7dbebba..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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.Logging/Properties/Settings.Designer.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Settings.Designer.cs deleted file mode 100644 index ab102e0eb..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Settings.Designer.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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.Logging.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.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.Logging/Properties/Settings.settings b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Settings.settings deleted file mode 100644 index 033d7a5e9..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Tango.PPC.Logging.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Tango.PPC.Logging.csproj deleted file mode 100644 index 51e41dba8..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Tango.PPC.Logging.csproj +++ /dev/null @@ -1,126 +0,0 @@ - - - - - Debug - AnyCPU - {D2EE865B-B006-487A-9487-60A663636AC3} - library - Tango.PPC.Logging - Tango.PPC.Logging - 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.2.0\lib\net45\EntityFramework.dll - - - ..\..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll - - - - - - - - - - - - 4.0 - - - - - - - - GlobalVersionInfo.cs - - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - MainView.xaml - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - {F441FEEE-322A-4943-B566-110E12FD3B72} - Tango.BL - - - {A34EE0F0-649D-41C8-8489-B6F1CC6924EE} - Tango.Core - - - {8491D07B-C1F6-4B62-A412-41B9FD2D6538} - Tango.SharedUI - - - {fd86424c-6e84-491b-8df9-3d0f5c236a2a} - Tango.Touch - - - {0BE74EEE-22CB-4DBA-B896-793B9E1A3AC0} - Tango.PPC.Common - - - - - - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/ViewModelLocator.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/ViewModelLocator.cs deleted file mode 100644 index d86a0d2ab..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/ViewModelLocator.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.Core.DI; -using Tango.PPC.Logging.ViewModels; - -namespace Tango.PPC.Logging -{ - public static class ViewModelLocator - { - /// - /// Initializes a new instance of the ViewModelLocator class. - /// - static ViewModelLocator() - { - TangoIOC.Default.Register(); - } - - /// - /// Gets the main view VM. - /// - public static MainViewVM MainViewVM - { - get - { - return TangoIOC.Default.GetInstance(); - } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/ViewModels/MainViewVM.cs deleted file mode 100644 index 736bff5a2..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/ViewModels/MainViewVM.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.PPC.Common; - -namespace Tango.PPC.Logging.ViewModels -{ - public class MainViewVM : PPCViewModel - { - public override void OnApplicationStarted() - { - - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Views/MainView.xaml deleted file mode 100644 index fb4dd5d04..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Views/MainView.xaml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - Logs - - - - - - - - Application - Embedded - - - - - - - - - - - - - diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Views/MainView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Views/MainView.xaml.cs deleted file mode 100644 index eb448c67c..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Views/MainView.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -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.Logging.Views -{ - /// - /// Interaction logic for MainView.xaml - /// - public partial class MainView : UserControl - { - public MainView() - { - InitializeComponent(); - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/app.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/app.config deleted file mode 100644 index f47375ba5..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/app.config +++ /dev/null @@ -1,85 +0,0 @@ - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/packages.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/packages.config deleted file mode 100644 index b3daf0d6c..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/App.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/App.xaml new file mode 100644 index 000000000..a696ceef9 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/App.xaml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/technician_module.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/technician_module.png new file mode 100644 index 000000000..2c5cc1fbc Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/technician_module.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..97a615572 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/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 PPC Technician Module")] +[assembly: AssemblyVersion("1.0.0.0")] + +[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.Technician/Properties/Resources.Designer.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Properties/Resources.Designer.cs new file mode 100644 index 000000000..26e366738 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/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.Technician.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.Technician.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.Technician/Properties/Resources.resx b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/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.Technician/Properties/Settings.Designer.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Properties/Settings.Designer.cs new file mode 100644 index 000000000..dfc1a086b --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/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.Technician.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.Technician/Properties/Settings.settings b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Tango.PPC.Technician.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Tango.PPC.Technician.csproj new file mode 100644 index 000000000..2a4c1d39c --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Tango.PPC.Technician.csproj @@ -0,0 +1,126 @@ + + + + + Debug + AnyCPU + {D2EE865B-B006-487A-9487-60A663636AC3} + library + Tango.PPC.Technician + Tango.PPC.Technician + 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.2.0\lib\net45\EntityFramework.dll + + + ..\..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + + + + + + + + + + + + 4.0 + + + + + + + + GlobalVersionInfo.cs + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + MainView.xaml + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + {F441FEEE-322A-4943-B566-110E12FD3B72} + Tango.BL + + + {A34EE0F0-649D-41C8-8489-B6F1CC6924EE} + Tango.Core + + + {8491D07B-C1F6-4B62-A412-41B9FD2D6538} + Tango.SharedUI + + + {fd86424c-6e84-491b-8df9-3d0f5c236a2a} + Tango.Touch + + + {0BE74EEE-22CB-4DBA-B896-793B9E1A3AC0} + Tango.PPC.Common + + + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/TechnicianModule.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/TechnicianModule.cs new file mode 100644 index 000000000..07ef8cabf --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/TechnicianModule.cs @@ -0,0 +1,47 @@ +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.Technician.Views; +using Tango.SharedUI.Helpers; + +namespace Tango.PPC.Technician +{ + [PPCModule(5)] + public class TechnicianModule : PPCModuleBase + { + public override string Name => "Technician"; + public override string Description => "PPC technician module."; + public override BitmapSource Image => ResourceHelper.GetImageFromResources("Images/technician_module.png"); + public override Type MainViewType => typeof(MainView); + public override Permissions Permission => Permissions.RunPPC; + + public TechnicianModule() + { + IsVisibleInMenu = false; + } + + public override void OnTechnicianEntered() + { + base.OnTechnicianEntered(); + + IsVisibleInMenu = true; + } + + public override void OnTechnicianExited() + { + base.OnTechnicianExited(); + + IsVisibleInMenu = false; + } + + public override void Dispose() + { + + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModelLocator.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModelLocator.cs new file mode 100644 index 000000000..3a4c8d829 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModelLocator.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.DI; +using Tango.PPC.Technician.ViewModels; + +namespace Tango.PPC.Technician +{ + public static class ViewModelLocator + { + /// + /// Initializes a new instance of the ViewModelLocator class. + /// + static ViewModelLocator() + { + TangoIOC.Default.Register(); + } + + /// + /// Gets the main view VM. + /// + public static MainViewVM MainViewVM + { + get + { + return TangoIOC.Default.GetInstance(); + } + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/MainViewVM.cs new file mode 100644 index 000000000..893d495fc --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/MainViewVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.PPC.Common; + +namespace Tango.PPC.Technician.ViewModels +{ + public class MainViewVM : PPCViewModel + { + public override void OnApplicationStarted() + { + + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/MainView.xaml new file mode 100644 index 000000000..5e9401742 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/MainView.xaml @@ -0,0 +1,45 @@ + + + + + + + + + + + + Logs + + + + + + + + Application + Embedded + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/MainView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/MainView.xaml.cs new file mode 100644 index 000000000..41eb08c0f --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/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.Technician.Views +{ + /// + /// Interaction logic for MainView.xaml + /// + public partial class MainView : UserControl + { + public MainView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/app.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/app.config new file mode 100644 index 000000000..f47375ba5 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/app.config @@ -0,0 +1,85 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/packages.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/packages.config new file mode 100644 index 000000000..b3daf0d6c --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs index 7769c74f6..ff3f65221 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs @@ -55,6 +55,11 @@ namespace Tango.PPC.Common.Application /// bool IsShuttingDown { get; } + /// + /// Gets a value indicating whether the application is in technician mode. + /// + bool IsInTechnicianMode { get; } + /// /// Shutdown the application. /// diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml new file mode 100644 index 000000000..ca53d6027 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml @@ -0,0 +1,26 @@ + + + + + CANCEL + OK + + + + + Technician Mode + Please enter the technician mode password. + + + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml.cs new file mode 100644 index 000000000..02dfed896 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.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.UI.Dialogs +{ + /// + /// Interaction logic for TechnicianModeLoginView.xaml + /// + public partial class TechnicianModeLoginView : UserControl + { + public TechnicianModeLoginView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginViewVM.cs new file mode 100644 index 000000000..2a46bcd96 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginViewVM.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.SharedUI; + +namespace Tango.PPC.UI.Dialogs +{ + public class TechnicianModeLoginViewVM : DialogViewVM + { + private String _password; + public String Password + { + get { return _password; } + set { _password = value; RaisePropertyChangedAuto(); } + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/technician-mode.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/technician-mode.png new file mode 100644 index 000000000..7d98c6734 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/technician-mode.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs index 788d2b178..261dbe6d4 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs @@ -28,6 +28,7 @@ using Tango.PPC.Common.EventLogging; using Tango.BL.Enumerations; using Tango.PPC.Common.Notifications; using Tango.PPC.Common.WatchDog; +using Tango.PPC.UI.Dialogs; namespace Tango.PPC.UI.PPCApplication { @@ -88,6 +89,11 @@ namespace Tango.PPC.UI.PPCApplication /// public bool IsShuttingDown { get; private set; } + /// + /// Gets a value indicating whether the application is in technician mode. + /// + public bool IsInTechnicianMode { get; private set; } + /// /// Gets the application version. /// @@ -412,10 +418,24 @@ namespace Tango.PPC.UI.PPCApplication /// /// Enteres the application technician mode. /// - public void EnterTechnicianMode() + public async void EnterTechnicianMode() { - _moduleLoader.AllModules.ToList().ForEach(x => x.OnTechnicianEntered()); - _notificationProvider.ShowInfo("Technician mode is now enabled."); + var vm = await _notificationProvider.ShowDialog(); + + if (vm.DialogResult) + { + if (vm.Password == "Aa123456") + { + IsInTechnicianMode = true; + _moduleLoader.AllModules.ToList().ForEach(x => x.OnTechnicianEntered()); + await _notificationProvider.ShowInfo("Technician mode is now enabled."); + } + else + { + await _notificationProvider.ShowError("Invalid technician mode password."); + EnterTechnicianMode(); + } + } } /// @@ -423,6 +443,7 @@ namespace Tango.PPC.UI.PPCApplication /// public void ExitTechnicianMode() { + IsInTechnicianMode = false; _moduleLoader.AllModules.ToList().ForEach(x => x.OnTechnicianExited()); _notificationProvider.ShowInfo("Technician mode is now disabled."); } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj index 1201c4ab0..8c4cc4992 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj @@ -122,6 +122,10 @@ + + TechnicianModeLoginView.xaml + + UpdateFromFileView.xaml @@ -182,6 +186,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -278,6 +286,7 @@ + @@ -366,10 +375,6 @@ {096f16c8-6d06-4b5f-9496-b9d2df2d94a3} Tango.PPC.Jobs - - {d2ee865b-b006-487a-9487-60a663636ac3} - Tango.PPC.Logging - {91b70e9b-66a7-4873-ae10-400e71cf404f} Tango.PPC.MachineSettings @@ -378,6 +383,10 @@ {04febb02-f782-4b96-b47d-f6902afa43be} Tango.PPC.Storage + + {d2ee865b-b006-487a-9487-60a663636ac3} + Tango.PPC.Technician + {0be74eee-22cb-4dba-b896-793b9e1a3ac0} Tango.PPC.Common @@ -509,7 +518,7 @@ del "$(TargetDir)firmware_package.tfp" - + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs index 1c1eeca5e..3cb790e65 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -244,6 +244,25 @@ namespace Tango.PPC.UI.ViewModels #endregion + #region Public Methods + + /// + /// Toggles the application technician mode. + /// + public void ToggleTechnicianMode() + { + if (!ApplicationManager.IsInTechnicianMode) + { + ApplicationManager.EnterTechnicianMode(); + } + else + { + ApplicationManager.ExitTechnicianMode(); + } + } + + #endregion + #region Event Handlers /// diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml index 5d4428989..2a2f3e8b5 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml @@ -213,7 +213,7 @@ - + + + + + + + + + + + Time: + + + + File: + + + + Method: + + + + Line: + + + + Message: + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/LoggingView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/LoggingView.xaml.cs new file mode 100644 index 000000000..9c12f7f13 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/LoggingView.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.Technician.Views +{ + /// + /// Interaction logic for LoggingView.xaml + /// + public partial class LoggingView : UserControl + { + public LoggingView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/MainView.xaml index 5e9401742..66e16588b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/MainView.xaml @@ -7,39 +7,14 @@ xmlns:vm="clr-namespace:Tango.PPC.Technician.ViewModels" xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" xmlns:global="clr-namespace:Tango.PPC.Technician" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:local="clr-namespace:Tango.PPC.Technician.Views" mc:Ignorable="d" d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> - - - - - - - - - - Logs - - - - - - - - Application - Embedded - - - - - - - - - - - + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs index ff3f65221..2d76b202f 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs @@ -78,7 +78,7 @@ namespace Tango.PPC.Common.Application /// /// Enteres the application technician mode. /// - void EnterTechnicianMode(); + void EnterTechnicianMode(bool displayNotification = true); /// /// Exits the application technician mode. diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs index 409dd1cfc..32181a753 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs @@ -76,6 +76,11 @@ namespace Tango.PPC.Common /// public bool EnableWatchDog { get; set; } + /// + /// Gets or sets a value indicating whether to enable the technician mode when the application starts. + /// + public bool EnableTechnicianModeByDefault { get; set; } + /// /// Gets the machine service address. /// diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml index 05cd998e6..62f248a8c 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml @@ -14,6 +14,7 @@ + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs index 261dbe6d4..ba1b44c8a 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs @@ -335,6 +335,11 @@ namespace Tango.PPC.UI.PPCApplication LogManager.Log($"Invoking {vm.GetType().Name}.OnApplicationReady..."); vm.OnApplicationReady(); } + + if (SettingsManager.Default.GetOrCreate().EnableTechnicianModeByDefault) + { + EnterTechnicianMode(false); + } }); } @@ -418,24 +423,32 @@ namespace Tango.PPC.UI.PPCApplication /// /// Enteres the application technician mode. /// - public async void EnterTechnicianMode() + public async void EnterTechnicianMode(bool displayNotification = true) { - var vm = await _notificationProvider.ShowDialog(); - - if (vm.DialogResult) + if (displayNotification) { - if (vm.Password == "Aa123456") - { - IsInTechnicianMode = true; - _moduleLoader.AllModules.ToList().ForEach(x => x.OnTechnicianEntered()); - await _notificationProvider.ShowInfo("Technician mode is now enabled."); - } - else + var vm = await _notificationProvider.ShowDialog(); + + if (vm.DialogResult) { - await _notificationProvider.ShowError("Invalid technician mode password."); - EnterTechnicianMode(); + if (vm.Password == "Aa123456") + { + IsInTechnicianMode = true; + _moduleLoader.AllModules.ToList().ForEach(x => x.OnTechnicianEntered()); + await _notificationProvider.ShowInfo("Technician mode is now enabled."); + } + else + { + await _notificationProvider.ShowError("Invalid technician mode password."); + EnterTechnicianMode(); + } } } + else + { + IsInTechnicianMode = true; + _moduleLoader.AllModules.ToList().ForEach(x => x.OnTechnicianEntered()); + } } /// diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs index 3cb790e65..9e8a9fe34 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -115,6 +115,12 @@ namespace Tango.PPC.UI.ViewModels /// Gets or sets the power command. /// public RelayCommand PowerCommand { get; set; } + + /// + /// Gets or sets the restart application command. + /// + public RelayCommand RestartApplicationCommand { get; set; } + #endregion #region Constructors @@ -139,6 +145,7 @@ namespace Tango.PPC.UI.ViewModels }); PowerCommand = new RelayCommand(() => IsPowerOpened = true); + RestartApplicationCommand = new RelayCommand(RestartApplication); } #endregion @@ -221,6 +228,17 @@ namespace Tango.PPC.UI.ViewModels } } + /// + /// Restarts the application. + /// + private async void RestartApplication() + { + if (await NotificationProvider.ShowQuestion("Are you sure you want to restart the application?")) + { + ApplicationManager.Restart(); + } + } + #endregion #region Override Methods diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml index 2a2f3e8b5..4079777f7 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml @@ -158,7 +158,7 @@ - Restart + Restart diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs index 2156e45ca..777083b67 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs @@ -52,24 +52,28 @@ namespace Tango.PPC.UI.Views private void OnMouseOrTouchDown(object sender, MouseOrTouchEventArgs e) { - techPressElement.CaptureMouse(); - - if (e.TouchDevice != null) - { - techPressElement.CaptureTouch(e.TouchDevice); - } + //if (e.TouchDevice != null) + //{ + // techPressElement.CaptureTouch(e.TouchDevice); + //} + //else + //{ + // techPressElement.CaptureMouse(); + //} _timer.Start(); } private void OnMouseOrTouchUp(object sender, MouseOrTouchEventArgs e) { - this.ReleaseMouseCapture(); - - if (e.TouchDevice != null) - { - techPressElement.ReleaseTouchCapture(e.TouchDevice); - } + //if (e.TouchDevice != null) + //{ + // techPressElement.ReleaseTouchCapture(e.TouchDevice); + //} + //else + //{ + // techPressElement.ReleaseMouseCapture(); + //} _timer.Stop(); } diff --git a/Software/Visual_Studio/Tango.AnimatedGif/ImageBehavior.cs b/Software/Visual_Studio/Tango.AnimatedGif/ImageBehavior.cs index a159106e6..cc13688ff 100644 --- a/Software/Visual_Studio/Tango.AnimatedGif/ImageBehavior.cs +++ b/Software/Visual_Studio/Tango.AnimatedGif/ImageBehavior.cs @@ -573,10 +573,8 @@ namespace Tango.AnimatedGif animation.RepeatBehavior = GetActualRepeatBehavior(imageControl, decoder, gifMetadata); - //Removed animation cache for PPC AsyncAdornerControl! - - //AnimationCache.AddAnimation(source, GetRepeatBehavior(imageControl), animation); - //AnimationCache.IncrementReferenceCount(source, GetRepeatBehavior(imageControl)); + AnimationCache.AddAnimation(source, GetRepeatBehavior(imageControl), animation); + AnimationCache.IncrementReferenceCount(source, GetRepeatBehavior(imageControl)); return animation; } return null; diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/FrameworkElementExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/FrameworkElementExtensions.cs index 08f3bb101..909366ffd 100644 --- a/Software/Visual_Studio/Tango.Core/ExtensionMethods/FrameworkElementExtensions.cs +++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/FrameworkElementExtensions.cs @@ -77,6 +77,7 @@ public static class FrameworkElementExtensions OriginalSource = e.OriginalSource, Handled = e.Handled, GetPositionAction = (s) => { return e.GetTouchPoint(s).Position; }, + TouchDevice = e.TouchDevice, }; handler(element, args); @@ -176,6 +177,7 @@ public static class FrameworkElementExtensions OriginalSource = e.OriginalSource, Handled = e.Handled, GetPositionAction = (s) => { return e.GetTouchPoint(s).Position; }, + TouchDevice = e.TouchDevice, }; handler(element, args); @@ -270,6 +272,7 @@ public static class FrameworkElementExtensions OriginalSource = e.OriginalSource, Handled = e.Handled, GetPositionAction = (s) => { return e.GetTouchPoint(s).Position; }, + TouchDevice = e.TouchDevice, }; handler(element, args); @@ -369,6 +372,7 @@ public static class FrameworkElementExtensions OriginalSource = e.OriginalSource, Handled = e.Handled, GetPositionAction = (s) => { return e.GetTouchPoint(s).Position; }, + TouchDevice = e.TouchDevice, }; handler(element, args); diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNativeListBox.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchNativeListBox.xaml index 7d04c902a..456e82750 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNativeListBox.xaml +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNativeListBox.xaml @@ -7,37 +7,35 @@ - - - - - - - - - - + + + + + + + + + + + + +