From 73327143a2ac187695bed0ecded52c4d675165c4 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 18 Mar 2019 15:01:20 +0200 Subject: Fixed issue with brush stop duplication on developer module. --- .../Converters/LiquidVolumesToLubricantLiquidVolume.cs | 11 +++++++++-- .../Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs | 1 + .../Modules/Tango.MachineStudio.Developer/Views/JobView.xaml | 6 +++--- 3 files changed, 13 insertions(+), 5 deletions(-) (limited to 'Software/Visual_Studio') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/LiquidVolumesToLubricantLiquidVolume.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/LiquidVolumesToLubricantLiquidVolume.cs index e59141e7f..5939bfd53 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/LiquidVolumesToLubricantLiquidVolume.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/LiquidVolumesToLubricantLiquidVolume.cs @@ -14,8 +14,15 @@ namespace Tango.MachineStudio.Developer.Converters { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - IEnumerable liquid_volumes = value as IEnumerable; - return liquid_volumes.SingleOrDefault(x => x.IdsPack.IdsPackFormula.Code == IdsPackFormulas.Lubricant.ToInt32()); + if (value != null) + { + IEnumerable liquid_volumes = value as IEnumerable; + return liquid_volumes.SingleOrDefault(x => x.IdsPack.IdsPackFormula.Code == IdsPackFormulas.Lubricant.ToInt32()); + } + else + { + return null; + } } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index 41f57794a..02431fd98 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -2179,6 +2179,7 @@ namespace Tango.MachineStudio.Developer.ViewModels { var cloned = stop.Clone(); cloned.StopIndex = SelectedSegment.BrushStops.Max(x => x.StopIndex) + 1; + cloned.SetLiquidVolumes(ActiveJob.Machine.Configuration, SelectedRML, SelectedProcessParametersTable); SelectedSegment.BrushStops.Add(cloned); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml index 9504d5769..c4c831011 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml @@ -962,11 +962,11 @@ - + - + -- 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') 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 @@ - +