aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2018-12-16 08:22:45 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2018-12-16 08:22:45 +0200
commitecf55f4193c0a7ab273c7e8243e446a2f2c32d51 (patch)
treeaa965e23ba3d0dcd4fecf739b4ed95040553b628 /Software/Visual_Studio/PPC
parentb279560f0b4dfdd16dea6b70975dfc1961b8d61e (diff)
downloadTango-ecf55f4193c0a7ab273c7e8243e446a2f2c32d51.tar.gz
Tango-ecf55f4193c0a7ab273c7e8243e446a2f2c32d51.zip
Working on PPC tech mode & logging module.
Working on PPC date picker & calendar. Implemented no-permissions view.
Diffstat (limited to 'Software/Visual_Studio/PPC')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/App.xaml11
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Images/logging_module.pngbin0 -> 1345 bytes
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/LoggingModule.cs47
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/AssemblyInfo.cs20
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Resources.Designer.cs62
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Resources.resx117
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Settings.Designer.cs30
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Settings.settings7
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Tango.PPC.Logging.csproj117
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/ViewModelLocator.cs32
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/ViewModels/MainViewVM.cs17
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Views/MainView.xaml45
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Views/MainView.xaml.cs28
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs10
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/IPPCModule.cs15
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Navigation/NavigationView.cs1
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/PPCModuleBase.cs26
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/no-permissions.pngbin0 -> 5640 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs35
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs16
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs26
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj15
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs9
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs18
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/NoPermissionsViewVM.cs30
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml16
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml1
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/NoPermissionsView.xaml27
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/NoPermissionsView.xaml.cs28
30 files changed, 791 insertions, 17 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/App.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/App.xaml
new file mode 100644
index 000000000..66ea48976
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/App.xaml
@@ -0,0 +1,11 @@
+<Application x:Class="Tango.PPC.Logging.App"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+ <Application.Resources>
+ <ResourceDictionary>
+ <ResourceDictionary.MergedDictionaries>
+ <ResourceDictionary Source="pack://application:,,,/Tango.PPC.Common;component/Resources/Merged.xaml" />
+ </ResourceDictionary.MergedDictionaries>
+ </ResourceDictionary>
+ </Application.Resources>
+</Application> \ 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
new file mode 100644
index 000000000..3f8318f70
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Images/logging_module.png
Binary files 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
new file mode 100644
index 000000000..78c597e81
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/LoggingModule.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.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
new file mode 100644
index 000000000..612af80ce
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/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 Logging Module")]
+[assembly: AssemblyVersion("2.0.4.1119")]
+
+[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
new file mode 100644
index 000000000..6cbf8164a
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Resources.Designer.cs
@@ -0,0 +1,62 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// 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.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Tango.PPC.Logging.Properties {
+
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // 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() {
+ }
+
+ /// <summary>
+ /// Returns the cached ResourceManager instance used by this class.
+ /// </summary>
+ [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;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [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
new file mode 100644
index 000000000..af7dbebba
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Resources.resx
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root> \ 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
new file mode 100644
index 000000000..ab102e0eb
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// 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.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+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
new file mode 100644
index 000000000..033d7a5e9
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Properties/Settings.settings
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
+ <Profiles>
+ <Profile Name="(Default)" />
+ </Profiles>
+ <Settings />
+</SettingsFile> \ 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
new file mode 100644
index 000000000..cc6394c9f
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Tango.PPC.Logging.csproj
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{D2EE865B-B006-487A-9487-60A663636AC3}</ProjectGuid>
+ <OutputType>library</OutputType>
+ <RootNamespace>Tango.PPC.Logging</RootNamespace>
+ <AssemblyName>Tango.PPC.Logging</AssemblyName>
+ <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\..\..\Build\PPC\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>..\..\..\Build\PPC\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="System.Net.Http" />
+ <Reference Include="System.Xaml">
+ <RequiredTargetFramework>4.0</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="WindowsBase" />
+ <Reference Include="PresentationCore" />
+ <Reference Include="PresentationFramework" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\..\..\Versioning\GlobalVersionInfo.cs">
+ <Link>GlobalVersionInfo.cs</Link>
+ </Compile>
+ <Compile Include="LoggingModule.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Properties\Resources.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>Resources.resx</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\Settings.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Settings.settings</DependentUpon>
+ <DesignTimeSharedInput>True</DesignTimeSharedInput>
+ </Compile>
+ <Compile Include="ViewModelLocator.cs" />
+ <Compile Include="ViewModels\MainViewVM.cs" />
+ <Compile Include="Views\MainView.xaml.cs">
+ <DependentUpon>MainView.xaml</DependentUpon>
+ </Compile>
+ <EmbeddedResource Include="Properties\Resources.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+ </EmbeddedResource>
+ <None Include="Properties\Settings.settings">
+ <Generator>SettingsSingleFileGenerator</Generator>
+ <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\..\Tango.BL\Tango.BL.csproj">
+ <Project>{F441FEEE-322A-4943-B566-110E12FD3B72}</Project>
+ <Name>Tango.BL</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\Tango.Core\Tango.Core.csproj">
+ <Project>{A34EE0F0-649D-41C8-8489-B6F1CC6924EE}</Project>
+ <Name>Tango.Core</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\Tango.SharedUI\Tango.SharedUI.csproj">
+ <Project>{8491D07B-C1F6-4B62-A412-41B9FD2D6538}</Project>
+ <Name>Tango.SharedUI</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\Tango.Touch\Tango.Touch.csproj">
+ <Project>{fd86424c-6e84-491b-8df9-3d0f5c236a2a}</Project>
+ <Name>Tango.Touch</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\Tango.PPC.Common\Tango.PPC.Common.csproj">
+ <Project>{0BE74EEE-22CB-4DBA-B896-793B9E1A3AC0}</Project>
+ <Name>Tango.PPC.Common</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\logging_module.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <Page Include="App.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ <Page Include="Views\MainView.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project> \ 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
new file mode 100644
index 000000000..d86a0d2ab
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/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.Logging.ViewModels;
+
+namespace Tango.PPC.Logging
+{
+ public static class ViewModelLocator
+ {
+ /// <summary>
+ /// Initializes a new instance of the ViewModelLocator class.
+ /// </summary>
+ static ViewModelLocator()
+ {
+ TangoIOC.Default.Register<MainViewVM>();
+ }
+
+ /// <summary>
+ /// Gets the main view VM.
+ /// </summary>
+ public static MainViewVM MainViewVM
+ {
+ get
+ {
+ return TangoIOC.Default.GetInstance<MainViewVM>();
+ }
+ }
+ }
+}
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
new file mode 100644
index 000000000..736bff5a2
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/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.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
new file mode 100644
index 000000000..fb4dd5d04
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/Views/MainView.xaml
@@ -0,0 +1,45 @@
+<UserControl x:Class="Tango.PPC.Logging.Views.MainView"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:sys="clr-namespace:System;assembly=mscorlib"
+ xmlns:vm="clr-namespace:Tango.PPC.Logging.ViewModels"
+ xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
+ xmlns:global="clr-namespace:Tango.PPC.Logging"
+ xmlns:local="clr-namespace:Tango.PPC.Logging.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}">
+ <Grid Background="{StaticResource TangoMidBackgroundBrush}">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="1*"/>
+ </Grid.RowDefinitions>
+
+ <Border Padding="20" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}">
+ <Border.Effect>
+ <DropShadowEffect Color="Silver" ShadowDepth="0" BlurRadius="20" Opacity="1" />
+ </Border.Effect>
+ <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold">Logs</TextBlock>
+ </Border>
+
+ <Grid Grid.Row="1">
+
+ <DockPanel>
+ <DockPanel DockPanel.Dock="Top">
+ <touch:TouchNavigationLinks Margin="20" FontSize="{StaticResource TangoNavigationLinksFontSize}">
+ <sys:String>Application</sys:String>
+ <sys:String>Embedded</sys:String>
+ </touch:TouchNavigationLinks>
+
+ <touch:TouchDatePicker SelectedDate="12/15/2018" Height="40" />
+ </DockPanel>
+
+ <Grid>
+
+ </Grid>
+ </DockPanel>
+
+ </Grid>
+ </Grid>
+</UserControl>
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
new file mode 100644
index 000000000..eb448c67c
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Logging/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.Logging.Views
+{
+ /// <summary>
+ /// Interaction logic for MainView.xaml
+ /// </summary>
+ public partial class MainView : UserControl
+ {
+ public MainView()
+ {
+ InitializeComponent();
+ }
+ }
+}
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 003229e65..5f0b35ce2 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs
@@ -61,6 +61,16 @@ namespace Tango.PPC.Common.Application
void Restart();
/// <summary>
+ /// Enteres the application technician mode.
+ /// </summary>
+ void EnterTechnicianMode();
+
+ /// <summary>
+ /// Exits the application technician mode.
+ /// </summary>
+ void ExitTechnicianMode();
+
+ /// <summary>
/// Gets the application version.
/// </summary>
Version Version { get; }
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/IPPCModule.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/IPPCModule.cs
index 7bee755a2..51f361cfb 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/IPPCModule.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/IPPCModule.cs
@@ -40,5 +40,20 @@ namespace Tango.PPC.Common
/// Gets the permission required to see and load this module.
/// </summary>
Permissions Permission { get; }
+
+ /// <summary>
+ /// Gets a value indicating whether this module should be displayed in the application menu.
+ /// </summary>
+ bool IsVisibleInMenu { get; }
+
+ /// <summary>
+ /// Called when the application has entered the technician mode.
+ /// </summary>
+ void OnTechnicianEntered();
+
+ /// <summary>
+ /// Called when the application has exited the technician mode.
+ /// </summary>
+ void OnTechnicianExited();
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Navigation/NavigationView.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Navigation/NavigationView.cs
index 3c3a6e19b..2c6e8d4c1 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Navigation/NavigationView.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Navigation/NavigationView.cs
@@ -13,6 +13,7 @@ namespace Tango.PPC.Common.Navigation
{
LoadingView,
LoadingErrorView,
+ NoPermissionsView,
LayoutView,
LoginView,
MachineSetupView,
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCModuleBase.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCModuleBase.cs
index 316236626..5aa003c1e 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCModuleBase.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCModuleBase.cs
@@ -17,6 +17,16 @@ namespace Tango.PPC.Common
/// <seealso cref="Tango.MachineStudio.Common.IStudioModule" />
public abstract class PPCModuleBase : ExtendedObject, IPPCModule
{
+ private bool _isVisibleInMenu = true;
+ /// <summary>
+ /// Gets a value indicating whether this module should be displayed in the application menu.
+ /// </summary>
+ public bool IsVisibleInMenu
+ {
+ get { return _isVisibleInMenu; }
+ protected set { _isVisibleInMenu = value; RaisePropertyChangedAuto(); }
+ }
+
/// <summary>
/// Gets the module name.
/// </summary>
@@ -46,5 +56,21 @@ namespace Tango.PPC.Common
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
/// </summary>
public abstract void Dispose();
+
+ /// <summary>
+ /// Called when the application has entered the technician mode.
+ /// </summary>
+ public virtual void OnTechnicianEntered()
+ {
+
+ }
+
+ /// <summary>
+ /// Called when the application has exited the technician mode.
+ /// </summary>
+ public virtual void OnTechnicianExited()
+ {
+
+ }
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/no-permissions.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/no-permissions.png
new file mode 100644
index 000000000..405b94a26
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/no-permissions.png
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs
index 219c25f45..302e401fb 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs
@@ -15,6 +15,8 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
+using Tango.Core.DI;
+using Tango.PPC.Common.Application;
using Tango.Touch.Helpers;
namespace Tango.PPC.UI
@@ -24,6 +26,8 @@ namespace Tango.PPC.UI
/// </summary>
public partial class MainWindow : Window
{
+ private String _technician_mode_buffer;
+
public static MainWindow Instance { get; private set; }
public MainWindow()
@@ -32,6 +36,8 @@ namespace Tango.PPC.UI
InitializeComponent();
+ _technician_mode_buffer = String.Empty;
+
#if !DESKTOP
if (TouchHelper.IsTouchEnabled())
{
@@ -62,5 +68,34 @@ namespace Tango.PPC.UI
{
Environment.Exit(0);
}
+
+ protected override void OnPreviewKeyDown(System.Windows.Input.KeyEventArgs e)
+ {
+ base.OnPreviewKeyDown(e);
+
+ try
+ {
+ _technician_mode_buffer += Char.Parse(e.Key.ToString());
+ }
+ catch{}
+
+ if (e.Key == Key.Return || e.Key == Key.Tab)
+ {
+ if (_technician_mode_buffer.ToLower().Contains("ENTERTECHNICIAN".ToLower()))
+ {
+ _technician_mode_buffer = String.Empty;
+ TangoIOC.Default.GetInstance<IPPCApplicationManager>().EnterTechnicianMode();
+ e.Handled = true;
+ }
+ else if (_technician_mode_buffer.ToLower().Contains("EXITTECHNICIAN".ToLower()))
+ {
+ _technician_mode_buffer = String.Empty;
+ TangoIOC.Default.GetInstance<IPPCApplicationManager>().ExitTechnicianMode();
+ e.Handled = true;
+ }
+
+ _technician_mode_buffer = String.Empty;
+ }
+ }
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs
index efe8149f6..fe3cabcc1 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs
@@ -90,15 +90,23 @@ namespace Tango.PPC.UI.Navigation
_lastFullPath = null;
var firstModule = _moduleLoader.UserModules.FirstOrDefault();
- var moduleAtt = firstModule.GetType().GetCustomAttribute<PPCModuleAttribute>();
- if (moduleAtt != null)
+ if (firstModule != null)
{
- return NavigateTo(firstModule.GetType(), pushToHistory, moduleAtt.HomeViewName);
+ var moduleAtt = firstModule.GetType().GetCustomAttribute<PPCModuleAttribute>();
+
+ if (moduleAtt != null)
+ {
+ return NavigateTo(firstModule.GetType(), pushToHistory, moduleAtt.HomeViewName);
+ }
+ else
+ {
+ return NavigateTo(firstModule.GetType(), pushToHistory);
+ }
}
else
{
- return NavigateTo(firstModule.GetType(), pushToHistory);
+ return NavigateTo(NavigationView.NoPermissionsView);
}
}
else
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 f8a0fdc36..f9830940b 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
@@ -26,6 +26,7 @@ using Tango.PPC.Common.Threading;
using System.Diagnostics;
using Tango.PPC.Common.EventLogging;
using Tango.BL.Enumerations;
+using Tango.PPC.Common.Notifications;
namespace Tango.PPC.UI.PPCApplication
{
@@ -41,6 +42,8 @@ namespace Tango.PPC.UI.PPCApplication
private Machine _machine;
private IDispatcherProvider _dispatcher;
private IEventLogger _eventLogger;
+ private IPPCModuleLoader _moduleLoader;
+ private INotificationProvider _notificationProvider;
/// <summary>
/// Occurs when the application has started.
@@ -102,12 +105,13 @@ namespace Tango.PPC.UI.PPCApplication
/// <summary>
/// Initializes a new instance of the <see cref="DefaultPPCApplicationManager"/> class.
/// </summary>
- public DefaultPPCApplicationManager(IMachineProvider machineProvider, IDispatcherProvider dispatcherProvider, IEventLogger eventLogger)
+ public DefaultPPCApplicationManager(IMachineProvider machineProvider, IDispatcherProvider dispatcherProvider, IEventLogger eventLogger, IPPCModuleLoader moduleLoader, INotificationProvider notificationProvider)
{
+ _notificationProvider = notificationProvider;
_machineProvider = machineProvider;
_dispatcher = dispatcherProvider;
_eventLogger = eventLogger;
- ;
+ _moduleLoader = moduleLoader;
if (!DesignMode)
{
@@ -320,5 +324,23 @@ namespace Tango.PPC.UI.PPCApplication
Process.Start(Application.ResourceAssembly.Location);
Environment.Exit(0);
}
+
+ /// <summary>
+ /// Enteres the application technician mode.
+ /// </summary>
+ public void EnterTechnicianMode()
+ {
+ _moduleLoader.AllModules.ToList().ForEach(x => x.OnTechnicianEntered());
+ _notificationProvider.ShowInfo("Technician mode is now enabled.");
+ }
+
+ /// <summary>
+ /// Exits the application technician mode.
+ /// </summary>
+ public void ExitTechnicianMode()
+ {
+ _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 406568f71..836878152 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
@@ -143,6 +143,7 @@
<Compile Include="ViewModels\MachineSetupViewVM.cs" />
<Compile Include="ViewModels\MainViewVM.cs" />
<Compile Include="ViewModels\MachineUpdateViewVM.cs" />
+ <Compile Include="ViewModels\NoPermissionsViewVM.cs" />
<Compile Include="ViewsContracts\ILayoutView.cs" />
<Compile Include="ViewsContracts\IMachineSetupView.cs" />
<Compile Include="ViewsContracts\IMachineUpdateView.cs" />
@@ -170,6 +171,9 @@
<Compile Include="Views\MachineUpdateView.xaml.cs">
<DependentUpon>MachineUpdateView.xaml</DependentUpon>
</Compile>
+ <Compile Include="Views\NoPermissionsView.xaml.cs">
+ <DependentUpon>NoPermissionsView.xaml</DependentUpon>
+ </Compile>
<Page Include="Connectivity\WiFiAuthenticationView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -234,6 +238,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
+ <Page Include="Views\NoPermissionsView.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
@@ -339,6 +347,10 @@
<Project>{096f16c8-6d06-4b5f-9496-b9d2df2d94a3}</Project>
<Name>Tango.PPC.Jobs</Name>
</ProjectReference>
+ <ProjectReference Include="..\Modules\Tango.PPC.Logging\Tango.PPC.Logging.csproj">
+ <Project>{d2ee865b-b006-487a-9487-60a663636ac3}</Project>
+ <Name>Tango.PPC.Logging</Name>
+ </ProjectReference>
<ProjectReference Include="..\Modules\Tango.PPC.MachineSettings\Tango.PPC.MachineSettings.csproj">
<Project>{91b70e9b-66a7-4873-ae10-400e71cf404f}</Project>
<Name>Tango.PPC.MachineSettings</Name>
@@ -397,6 +409,7 @@
<Link>Tango.ColorLib.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Resource Include="Images\no-permissions.png" />
<Resource Include="Images\GlobalStatus\machine-off.png" />
<Resource Include="Images\machine-update-firmware.png" />
<Resource Include="Images\chip_128px.png" />
@@ -472,7 +485,7 @@ del "$(TargetDir)firmware_package.tfp"</PostBuildEvent>
</PropertyGroup>
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
+ <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs
index 645456216..9b4c17831 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs
@@ -95,6 +95,7 @@ namespace Tango.PPC.UI
TangoIOC.Default.Register<MachineSetupViewVM>();
TangoIOC.Default.Register<MachineUpdateViewVM>();
TangoIOC.Default.Register<LoadingErrorViewVM>();
+ TangoIOC.Default.Register<NoPermissionsViewVM>();
TangoIOC.Default.GetInstance<IPPCApplicationManager>().ContentRendered += (_, __) =>
@@ -176,5 +177,13 @@ namespace Tango.PPC.UI
return TangoIOC.Default.GetInstance<LoadingErrorViewVM>();
}
}
+
+ public static NoPermissionsViewVM NoPermissionsViewVM
+ {
+ get
+ {
+ return TangoIOC.Default.GetInstance<NoPermissionsViewVM>();
+ }
+ }
}
} \ No newline at end of file
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs
index 281e54958..516349a18 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs
@@ -20,6 +20,7 @@ using Tango.PPC.Common.Notifications.NotificationItems;
using Tango.PPC.Jobs;
using Tango.SharedUI;
using System.Data.Entity;
+using Tango.BL.Enumerations;
namespace Tango.PPC.UI.ViewModels
{
@@ -79,6 +80,7 @@ namespace Tango.PPC.UI.ViewModels
if (db.Users.Count() == 1 || machine.AutoLogin)
{
var user = await db.Users.FirstAsync();
+
LogManager.Log($"Application started. Single user/Auto login detected ({user.Email}). Skipping LoginView...");
await AuthenticationProvider.Login(user.Email, user.Password, false);
IsLoading = false;
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs
index 9d17a4a76..aa9689ef3 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs
@@ -11,6 +11,8 @@ using System.ComponentModel.DataAnnotations;
using Tango.SharedUI.Helpers;
using Tango.PPC.Common.Authentication;
using Tango.BL.Entities;
+using Tango.BL.Enumerations;
+using Tango.Logging;
namespace Tango.PPC.UI.ViewModels
{
@@ -89,9 +91,19 @@ namespace Tango.PPC.UI.ViewModels
base.OnApplicationReady();
await Task.Delay(500);
- LogManager.Log("Application is ready! Navigating to home module...");
- await NavigationManager.NavigateTo(NavigationView.HomeModule);
- IsLoading = false;
+
+ if (AuthenticationProvider.CurrentUser != null && AuthenticationProvider.CurrentUser.HasPermission(Permissions.RunPPC))
+ {
+ LogManager.Log("Application is ready! Navigating to home module...");
+ await NavigationManager.NavigateTo(NavigationView.HomeModule);
+ IsLoading = false;
+ }
+ else
+ {
+ LogManager.Log("Application is ready! The logged in user does not have permission to run the application!", LogCategory.Warning);
+ await NavigationManager.NavigateTo(NavigationView.NoPermissionsView);
+ IsLoading = false;
+ }
}
#endregion
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/NoPermissionsViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/NoPermissionsViewVM.cs
new file mode 100644
index 000000000..cea8a7d63
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/NoPermissionsViewVM.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Core.Commands;
+using Tango.PPC.Common;
+
+namespace Tango.PPC.UI.ViewModels
+{
+ public class NoPermissionsViewVM : PPCViewModel
+ {
+ public RelayCommand RestartCommand { get; set; }
+
+ public NoPermissionsViewVM()
+ {
+ RestartCommand = new RelayCommand(Restart);
+ }
+
+ private void Restart()
+ {
+ ApplicationManager.Restart();
+ }
+
+ public override void OnApplicationStarted()
+ {
+
+ }
+ }
+}
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 98451dacb..b89b2c9de 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
@@ -49,13 +49,15 @@
<ItemsControl ItemsSource="{Binding ModuleLoader.UserModules}">
<ItemsControl.ItemTemplate>
<DataTemplate>
- <Border BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="0 1 0 0">
- <touch:TouchButton Margin="0 0 0 0" Padding="30" Foreground="{StaticResource TangoDarkForegroundBrush}" Style="{StaticResource TangoFlatButton}" FontSize="{StaticResource TangoHeaderFontSize}" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ModuleNavigationCommand}" CommandParameter="{Binding Name}">
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
- <Image VerticalAlignment="Center" Source="{Binding Image}" Width="48" Height="48"></Image>
- <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" Text="{Binding Name}"></TextBlock>
- </StackPanel>
- </touch:TouchButton>
+ <Border>
+ <Border BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="0 1 0 0" Visibility="{Binding IsVisibleInMenu,Converter={StaticResource BooleanToVisibilityConverter}}">
+ <touch:TouchButton Margin="0 0 0 0" Padding="30" Foreground="{StaticResource TangoDarkForegroundBrush}" Style="{StaticResource TangoFlatButton}" FontSize="{StaticResource TangoHeaderFontSize}" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ModuleNavigationCommand}" CommandParameter="{Binding Name}">
+ <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
+ <Image VerticalAlignment="Center" Source="{Binding Image}" Width="48" Height="48"></Image>
+ <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" Text="{Binding Name}"></TextBlock>
+ </StackPanel>
+ </touch:TouchButton>
+ </Border>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml
index e684f4969..9df92bbcc 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml
@@ -83,6 +83,7 @@
<controls:NavigationControl TransitionAlwaysFades="True" KeepElementsAttached="True" TransitionType="Zoom" x:Name="NavigationControl" x:FieldModifier="public">
<local:LoadingView></local:LoadingView>
<local:LoadingErrorView></local:LoadingErrorView>
+ <local:NoPermissionsView></local:NoPermissionsView>
<local:LoginView></local:LoginView>
<local:LayoutView></local:LayoutView>
<local:ExternalBridgeView></local:ExternalBridgeView>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/NoPermissionsView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/NoPermissionsView.xaml
new file mode 100644
index 000000000..95839453a
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/NoPermissionsView.xaml
@@ -0,0 +1,27 @@
+<UserControl x:Class="Tango.PPC.UI.Views.NoPermissionsView"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels"
+ xmlns:global="clr-namespace:Tango.PPC.UI"
+ xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
+ xmlns:local="clr-namespace:Tango.PPC.UI.Views"
+ mc:Ignorable="d"
+ d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:NoPermissionsViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.NoPermissionsViewVM}">
+ <Grid>
+ <DockPanel Margin="20 60 20 20">
+ <StackPanel DockPanel.Dock="Top">
+ <Image Source="../Images/no-permissions.png" Width="256" RenderOptions.BitmapScalingMode="Fant" Stretch="Uniform" HorizontalAlignment="Center"></Image>
+ <TextBlock HorizontalAlignment="Center" Margin="0 40 0 0" FontSize="{StaticResource TangoHeaderFontSize}">No Application Modules Loaded</TextBlock>
+ <TextBlock TextWrapping="Wrap" TextAlignment="Center" HorizontalAlignment="Center" Margin="0 20 0 0" FontSize="{StaticResource TangoTitleFontSize}">The current user does not seems to have a permission to load any of the application modules. Please contact your administrator.</TextBlock>
+ </StackPanel>
+
+ <Grid>
+ <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="320">
+ <touch:TouchButton Command="{Binding RestartCommand}" Padding="0 30" CornerRadius="40">RESTART</touch:TouchButton>
+ </StackPanel>
+ </Grid>
+ </DockPanel>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/NoPermissionsView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/NoPermissionsView.xaml.cs
new file mode 100644
index 000000000..0bbaee554
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/NoPermissionsView.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.Views
+{
+ /// <summary>
+ /// Interaction logic for NoPermissionsView.xaml
+ /// </summary>
+ public partial class NoPermissionsView : UserControl
+ {
+ public NoPermissionsView()
+ {
+ InitializeComponent();
+ }
+ }
+}