Commit b41b4c29 authored by 姜春辉's avatar 姜春辉

新增首页菜单页面

parent dae8d99d
......@@ -4,6 +4,7 @@
<Activator Type="GS.Terminal.LogicShell.Activator" />
<Runtime>
<Assembly Path="GS.Terminal.LogicShell.dll" Share="true" />
<Assembly Path="ViewModels/ViewModels.dll" Share="true" />
</Runtime>
<Services>
<Service Caption="试图控制服务" TypeAndName="GS.Terminal.LogicShell.Interface.IViewHelperService"></Service>
......
Design @ fc4603c9
Subproject commit 4c4fa427de6914ecac4647bf1a3e4ce357f74b3b
Subproject commit fc4603c9b1b774478a444e75003738d697300193
......@@ -4,6 +4,10 @@ Microsoft Visual Studio Solution File, Format Version 12.00
VisualStudioVersion = 16.0.30104.148
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GS.Terminal.VisitorSelfService", "GS.Terminal.VisitorSelfService\GS.Terminal.VisitorSelfService.csproj", "{68264374-66DC-49E6-9514-565C02ACB072}"
ProjectSection(ProjectDependencies) = postProject
{72A63753-479C-4603-B152-1326A9ABF737} = {72A63753-479C-4603-B152-1326A9ABF737}
{D38C35DE-4988-4648-9FB6-73932AB2E178} = {D38C35DE-4988-4648-9FB6-73932AB2E178}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ViewModelView", "ViewModelView", "{F9D6302D-E62B-4824-9B1E-DADACEC0CB42}"
EndProject
......
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--整屏背景图片-->
<Style x:Key="MainShell_BodyBackground" TargetType="Grid">
<Setter Property="Background" Value="Transparent">
</Setter>
</Style>
<!-- 顶部背景颜色-->
<Style x:Key="MainShell_HeaderBackground" TargetType="Grid">
<Setter Property="Background" Value="#00006766"></Setter>
<Setter Property="Height" Value="180"></Setter>
</Style>
<!-- 底部背景颜色-->
<Style x:Key="MainShell_FootBackground" TargetType="Grid">
<Setter Property="Background" Value="#121212"></Setter>
<Setter Property="Height" Value="45"></Setter>
</Style>
<Style x:Key="MainShell_FullBackground" TargetType="Grid">
<Setter Property="Background" >
<Setter.Value>
<ImageBrush ImageSource="images/bg.png"/>
</Setter.Value>
</Setter>
</Style>
<!-- LOGO图片-->
<Style x:Key="MainShell_LogoImage" TargetType="Image">
<Setter Property="Margin" Value="80,60,0,0"></Setter>
<Setter Property="HorizontalAlignment" Value="Left"></Setter>
<Setter Property="VerticalAlignment" Value="Center"></Setter>
<Setter Property="Stretch" Value="None"></Setter>
</Style>
<!-- 系统名称-->
<Style x:Key="MainShell_LogoText" TargetType="TextBlock">
</Style>
</ResourceDictionary>
\ No newline at end of file
ThemeName=Common
ThemeDescribe=公共资源
MainShellWindowStyle.xaml
ScrollViewStyle.xaml
<Application x:Class="GS.Terminal.VisitorSelfService.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GS.Terminal.VisitorSelfService"
StartupUri="MainWindow.xaml">
xmlns:local="clr-namespace:GS.Terminal.VisitorSelfService">
<Application.Resources>
</Application.Resources>
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\build\OpenCvSharp3-AnyCPU.props" Condition="Exists('..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\build\OpenCvSharp3-AnyCPU.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
......@@ -14,6 +15,8 @@
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
......@@ -65,6 +68,22 @@
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="OpenCvSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
<HintPath>..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\lib\net40\OpenCvSharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="OpenCvSharp.Blob, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
<HintPath>..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\lib\net40\OpenCvSharp.Blob.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="OpenCvSharp.Extensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
<HintPath>..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\lib\net40\OpenCvSharp.Extensions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="OpenCvSharp.UserInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
<HintPath>..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\lib\net40\OpenCvSharp.UserInterface.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
......@@ -88,6 +107,22 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Content Include="Addons\GS.Terminal.MainShell\Images\logo.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Addons\GS.Terminal.Theme\CommonResourceDictionary\images\bg.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Addons\GS.Terminal.Theme\CommonResourceDictionary\MainShellWindowStyle.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Addons\GS.Terminal.Theme\CommonResourceDictionary\ScrollViewStyle.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
......@@ -247,6 +282,9 @@
<Link>Addons\GS.Terminal.LogicShell\Views\Views.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Addons\GS.Terminal.Theme\CommonResourceDictionary\manifest.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="log4net.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
......@@ -261,7 +299,6 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Addons\GS.Terminal.DeviceManager\Device\" />
<Folder Include="Addons\GS.Terminal.Theme\CommonResourceDictionary\" />
</ItemGroup>
<ItemGroup>
<Content Include="DataSpaceConfig.xml">
......@@ -319,4 +356,10 @@
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\build\OpenCvSharp3-AnyCPU.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\build\OpenCvSharp3-AnyCPU.props'))" />
</Target>
</Project>
\ No newline at end of file
......@@ -7,4 +7,5 @@
<package id="log4net" version="2.0.8" targetFramework="net452" />
<package id="MvvmLightLibs" version="5.4.1.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" />
<package id="OpenCvSharp3-AnyCPU" version="4.0.0.20181129" targetFramework="net452" />
</packages>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<Settings xmlns="urn:Chinags-Configuration" AddonName="GS.Terminal.DoorAccessControl.Logic">
<Settings xmlns="urn:Chinags-Configuration" AddonName="GS.Terminal.VisitorSelfService.Logic">
<Dictionaries>
<Dict Caption="基础配置" Name="defaultconfig">
<Key Caption="人脸识别阀值" Name="FaceMinValue" Value="0.85"/>
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\build\OpenCvSharp3-AnyCPU.props" Condition="Exists('..\..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\build\OpenCvSharp3-AnyCPU.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
......@@ -12,6 +13,8 @@
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......@@ -31,6 +34,21 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="CommonServiceLocator, Version=2.0.2.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
<HintPath>..\..\packages\CommonServiceLocator.2.0.2\lib\net45\CommonServiceLocator.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight, Version=5.4.1.0, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
<HintPath>..\..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Extras, Version=5.4.1.0, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
<HintPath>..\..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.4.1.0, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
<HintPath>..\..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
</Reference>
<Reference Include="GS.Terminal.LogicShell.Interface">
<HintPath>..\..\..\..\Addons\GS.Terminal.LogicShell\GS.Terminal.LogicShell.Interface.dll</HintPath>
</Reference>
<Reference Include="GS.Unitive.Framework, Version=1.4.0.2, Culture=neutral, PublicKeyToken=769358b197600ab3, processorArchitecture=MSIL">
<HintPath>..\..\packages\GS.Unitive.Framework.1.4.0.2\lib\net40\GS.Unitive.Framework.dll</HintPath>
<Private>False</Private>
......@@ -47,8 +65,25 @@
<HintPath>..\..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenCvSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
<HintPath>..\..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\lib\net40\OpenCvSharp.dll</HintPath>
</Reference>
<Reference Include="OpenCvSharp.Blob, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
<HintPath>..\..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\lib\net40\OpenCvSharp.Blob.dll</HintPath>
</Reference>
<Reference Include="OpenCvSharp.Extensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
<HintPath>..\..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\lib\net40\OpenCvSharp.Extensions.dll</HintPath>
</Reference>
<Reference Include="OpenCvSharp.UserInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
<HintPath>..\..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\lib\net40\OpenCvSharp.UserInterface.dll</HintPath>
</Reference>
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
......@@ -59,6 +94,13 @@
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ThirdAddon\DeviceManager.cs" />
<Compile Include="ThirdAddon\FaceRecognization.cs" />
<Compile Include="ThirdAddon\FastRecognization.cs" />
<Compile Include="ThirdAddon\GarnitureControl.cs" />
<Compile Include="ThirdAddon\LogicShell.cs" />
<Compile Include="ThirdAddon\MainShell.cs" />
<Compile Include="ThirdAddon\TerminalConsole.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
......@@ -71,5 +113,17 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\ViewModelView\ViewModels\ViewModels.csproj">
<Project>{B8146415-FD96-4F1A-8627-4E90C55D0A1B}</Project>
<Name>ViewModels</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\build\OpenCvSharp3-AnyCPU.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\build\OpenCvSharp3-AnyCPU.props'))" />
</Target>
</Project>
\ No newline at end of file
......@@ -11,6 +11,6 @@
<Channel ConnectionName="sqlite" ModelAssembly="GS.Terminal.DoorAccessControl.DB" Name="c1"/>
</ObjectSpaces>
<Services>
<Service TypeAndName="GS.Terminal.DoorAccessControl.Logic.AddonService"/>
<Service TypeAndName="GS.Terminal.VisitorSelfService.Logic.AddonService"/>
</Services>
</Extensibility>
\ No newline at end of file
using GS.Unitive.Framework.Core;
using GS.Terminal.VisitorSelfService.Logic.ThirdAddon;
using GS.Unitive.Framework.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ViewModels;
namespace GS.Terminal.VisitorSelfService.Logic
{
public class Program : IAddonActivator
{
internal static IAddonContext _Context;
internal static Locator _Locator;
public void Start(IAddonContext Context)
{
_Context = Context;
_Locator = new Locator();
AddonRuntime.Instance.onRuntimeCompleted += Instance_onRuntimeCompleted;
}
private void Instance_onRuntimeCompleted(object sender)
{
ThirdAddon.LogicShell.ShowView(_Locator.MenuPage);
}
public void Stop(IAddonContext Context)
{
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.VisitorSelfService.Logic.ThirdAddon
{
public class DeviceManager
{
private static dynamic _Service = null;
private static dynamic _DeviceTiggerService = null;
static DeviceManager()
{
_Service = Program._Context.GetFirstOrDefaultService("GS.Terminal.DeviceManager", "GS.Terminal.DeviceManager.Service.DeviceCallControl");
_DeviceTiggerService = Program._Context.GetFirstOrDefaultService("GS.Terminal.DeviceManager",
"GS.Terminal.DeviceManager.Service.DeviceTiggerService");
}
/// <summary>
/// 注册读卡器回调
/// </summary>
/// <param name="GetCallback"></param>
public static void RegistCardCallback(Action<dynamic> GetCallback)
{
_Service?.RegistCardCallback(GetCallback);
}
/// <summary>
/// 注销读卡器回调
/// </summary>
/// <param name="GetCallback"></param>
public static void RemoveCardCallback(Action<dynamic> GetCallback)
{
_Service?.RemoveCardCallback(GetCallback);
}
public static dynamic CallGPIO(string arg)
{
return _DeviceTiggerService?.CallGPIO(arg);
}
}
}
using OpenCvSharp;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.VisitorSelfService.Logic.ThirdAddon
{
public static class FaceRecognization
{
private static dynamic _Service = null;
static FaceRecognization()
{
_Service = Program._Context.GetFirstOrDefaultService("GS.Terminal.FaceRecognization", "GS.Terminal.FaceRecognization.Service");
}
/// <summary>
/// 注册摄像头输出事件
/// </summary>
/// <param name="action"></param>
public static void RegistOutPutMatEvent(Action<Mat> action)
{
_Service?.RegistOutPutMatEvent(action);
}
/// <summary>
/// 注销摄像头输出事件
/// </summary>
/// <param name="action"></param>
public static void UnRegistOutPutMatEvent(Action<Mat> action)
{
_Service?.UnRegistOutPutMatEvent(action);
}
/// <summary>
/// 提取人脸位置
/// </summary>
/// <param name="img"></param>
/// <returns></returns>
public static Rectangle Detect(Bitmap img)
{
return _Service?.Detect(img);
}
/// <summary>
/// 提取图片特征值
/// </summary>
/// <param name="img"></param>
/// <returns></returns>
public static byte[] ExtractFeatures(Bitmap img)
{
return _Service?.ExtractFeatures(img);
}
/// <summary>
/// 计算两个特征值相似度
/// </summary>
/// <param name="origin"></param>
/// <param name="toMatch"></param>
/// <returns></returns>
public static float MathFaceData(byte[] origin, byte[] toMatch)
{
return _Service?.MathFaceData(origin, toMatch);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.VisitorSelfService.Logic.ThirdAddon
{
public static class FastRecognization
{
private static dynamic _Service = null;
static FastRecognization()
{
_Service = Program._Context.GetFirstOrDefaultService("GS.Terminal.FaceRecognization", "GS.Terminal.FaceRecognization.ArcFace2FastServices");
}
/// <summary>
/// 创建人脸快速识别实例
/// </summary>
/// <param name="action"></param>
/// <param name="alivnessaction"></param>
/// <param name="facelib"></param>
/// <param name="minscore"></param>
/// <returns></returns>
public static string CreateFastFaceRecognized(Action<string, float, string> action,
Action<string, int> alivnessaction,
List<KeyValuePair<string, byte[]>> facelib,
float minscore)
{
if (_Service != null)
{
return _Service.CreateFastFaceRecognized(action, alivnessaction, facelib, minscore);
}
return null;
}
/// <summary>
/// 重新加载特征库
/// </summary>
/// <param name="fid"></param>
/// <param name="facelib"></param>
public static void ReloadFacelib(string fid, List<KeyValuePair<string, byte[]>> facelib)
{
if (_Service != null)
{
_Service.ReloadFacelib(fid, facelib);
}
}
public static void Pause(string fid)
{
if (_Service != null)
{
_Service.Pause(fid);
}
}
public static void Restart(string fid)
{
if (_Service != null)
{
_Service.Restart(fid);
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
namespace GS.Terminal.VisitorSelfService.Logic.ThirdAddon
{
public static class GarnitureControl
{
private static dynamic _Service;
static GarnitureControl()
{
_Service = Program._Context.GetFirstOrDefaultService("GS.Terminal.GarnitureControl", "GS.Terminal.GarnitureControl.Service");
}
public static UserControl FindControlByKey(string key, ref Action<object> controlHandle)
{
return _Service?.FindControlByKey(key, ref controlHandle);
}
}
}
using GS.Terminal.LogicShell.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.VisitorSelfService.Logic.ThirdAddon
{
public static class LogicShell
{
private static IViewHelperService _service;
static LogicShell()
{
_service = Program._Context.GetFirstOrDefaultService<IViewHelperService>("GS.Terminal.LogicShell");
if (_service == null)
{
Program._Context.Logger.Error($"GS.Terminal.LogicShell插件服务IViewHelperService未找到", null);
}
}
internal static void ShowView(IViewModel v)
{
_service.ShowView(v);
}
internal static IPopWindowHandler Open(IViewModel v)
{
return _service.Open(v);
}
internal static IPopWindowHandler Close(IViewModel v)
{
return _service.Close(v);
}
internal static IView GetViewByID(string id)
{
return _service.GetViewByID(id);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
namespace GS.Terminal.VisitorSelfService.Logic.ThirdAddon
{
public static class MainShell
{
private static dynamic _UIService;
static MainShell()
{
_UIService = Program._Context.GetFirstOrDefaultService("GS.Terminal.MainShell", "GS.Terminal.MainShell.Services.UIService");
if (_UIService == null)
{
Program._Context.Logger.Error($"GS.Terminal.LogicShell插件服务IViewHelperService未找到", null);
}
}
/// <summary>
/// 注册高级窗口命令
/// </summary>
/// <param name="command"></param>
/// <param name="cb"></param>
public static void RegistBackgroundCommand(string command, Action cb)
{
_UIService?.RegistBackgroundCommand(command, cb);
}
/// <summary>
/// 显示提示
/// </summary>
/// <param name="msg"></param>
public static void ShowPrompt(string msg)
{
_UIService?.ShowPrompt(msg);
}
public static string AddGarnitureControl(UserControl uc, double top, double left)
{
return _UIService.AddGarnitureControl(uc, top, left);
}
public static void RemoveGarnitureControl(string id)
{
_UIService.RemoveGarnitureControl(id);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.VisitorSelfService.Logic.ThirdAddon
{
public class TerminalConsole
{
private static dynamic _Service;
static TerminalConsole()
{
_Service = Program._Context.GetFirstOrDefaultService("GS.Terminal.Console", "GS.Terminal.Console.Services.RemoteService");
if (_Service == null)
{
Program._Context.Logger.Error($"GS.Terminal.Console插件服务RemoteService未找到", null);
}
}
/// <summary>
/// 开始发送心跳
/// </summary>
/// <param name="remoteIp"></param>
/// <param name="remotePort"></param>
/// <param name="interval"></param>
public static void StartHeart(string remoteIp, int remotePort, int interval)
{
_Service?.StartHeart(remoteIp, remotePort, interval);
}
public static void StopHeart(string remoteIp)
{
_Service?.StopHeart(remoteIp);
}
public static void StartPing(string serverIP, Action<IPStatus> StatusChangedCallback)
{
_Service?.StartPing(serverIP, StatusChangedCallback);
}
public static void StopPing(string serverIP, Action<IPStatus> StatusChangedCallback)
{
_Service?.StopPing(serverIP, StatusChangedCallback);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CommonServiceLocator" version="2.0.2" targetFramework="net452" />
<package id="GS.Unitive.Framework" version="1.4.0.2" targetFramework="net452" />
<package id="GS.Unitive.Framework.Persistent" version="1.4.0.2" targetFramework="net452" />
<package id="log4net" version="2.0.8" targetFramework="net452" />
<package id="MvvmLightLibs" version="5.4.1.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" />
<package id="OpenCvSharp3-AnyCPU" version="4.0.0.20181129" targetFramework="net452" />
</packages>
\ No newline at end of file
using GalaSoft.MvvmLight;
using GS.Terminal.LogicShell.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ViewModels
{
public class Foot : ViewModelBase, IViewModel
{
public string ViewID => "7ba312aa-b0a2-4136-badc-52e362ddedad";
public void Reset()
{
}
}
}
using CommonServiceLocator;
using GalaSoft.MvvmLight.Ioc;
using GS.Terminal.LogicShell.Interface;
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ViewModels
{
[Export(typeof(ILocator))]
public class Locator : ILocator
{
public Locator()
{
ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
CheckRegistVM<Foot>();
CheckRegistVM<Pages.MenuPage.ViewModel>();
}
private void CheckRegistVM<T>() where T : class
{
if (!SimpleIoc.Default.IsRegistered<T>())
SimpleIoc.Default.Register<T>();
}
public Foot Foot
{
get
{
return SimpleIoc.Default.GetInstance<Foot>();
}
}
public Pages.MenuPage.ViewModel MenuPage
{
get
{
return SimpleIoc.Default.GetInstance<Pages.MenuPage.ViewModel>();
}
}
}
}
using GalaSoft.MvvmLight;
using GS.Terminal.LogicShell.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ViewModels.Pages.MenuPage
{
public partial class ViewModel : ViewModelBase, IViewModel
{
public string ViewID => "31fa8506-2213-44a4-bd07-a68fba474038";
public void Reset()
{
}
}
}
......@@ -31,8 +31,30 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="CommonServiceLocator, Version=2.0.2.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
<HintPath>..\..\packages\CommonServiceLocator.2.0.2\lib\net45\CommonServiceLocator.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight, Version=5.4.1.0, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
<HintPath>..\..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Extras, Version=5.4.1.0, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
<HintPath>..\..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.4.1.0, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
<HintPath>..\..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
</Reference>
<Reference Include="GS.Terminal.LogicShell.Attributes">
<HintPath>..\..\..\..\Addons\GS.Terminal.LogicShell\GS.Terminal.LogicShell.Attributes.dll</HintPath>
</Reference>
<Reference Include="GS.Terminal.LogicShell.Interface">
<HintPath>..\..\..\..\Addons\GS.Terminal.LogicShell\GS.Terminal.LogicShell.Interface.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
......@@ -41,7 +63,16 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Foot.cs" />
<Compile Include="Locator.cs" />
<Compile Include="Pages\MenuPage\ViewModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Folder Include="PopWindows\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CommonServiceLocator" version="2.0.2" targetFramework="net452" />
<package id="MvvmLightLibs" version="5.4.1.1" targetFramework="net452" />
</packages>
\ No newline at end of file
<Page x:Class="Views.Foot"
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:local="clr-namespace:Views"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
Title="Foot">
<Grid>
</Grid>
</Page>
using GS.Terminal.LogicShell.Attributes;
using GS.Terminal.LogicShell.Interface;
using GS.Unitive.Framework.Security.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
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 Views
{
/// <summary>
/// Foot.xaml 的交互逻辑
/// </summary>
[MainShellPartView(PartType.FOOT)]
[Export(typeof(IView))]
[UnitiveView("底部", "", "7ba312aa-b0a2-4136-badc-52e362ddedad", null)]
public partial class Foot : Page, IView
{
public Foot()
{
InitializeComponent();
}
public void BindDataContext(IViewModel vm)
{
DataContext = vm;
}
public object Clone()
{
throw new NotImplementedException();
}
public void GoBack()
{
throw new NotImplementedException();
}
public void GoForward()
{
throw new NotImplementedException();
}
public void NavigateToContent(object content)
{
throw new NotImplementedException();
}
public void Reset()
{
throw new NotImplementedException();
}
}
}
<Page x:Class="Views.Pages.MenuPage.Index"
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:gs="clr-namespace:Develop.Extension.Wpf;assembly=Develop.Extension.Wpf"
xmlns:local="clr-namespace:Views.Pages.MenuPage"
mc:Ignorable="d"
d:DesignHeight="1695" d:DesignWidth="1080"
Title="Index">
<Page.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Style.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Page.Resources>
<Grid>
<Grid Style="{StaticResource MenuPage_Container}">
<Grid.RowDefinitions>
<RowDefinition Height="160"/>
<RowDefinition Height="500"/>
<RowDefinition Height="80"/>
<RowDefinition Height="500"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel>
<TextBlock HorizontalAlignment="Center">
<Run Text="290" FontSize="80"/>
<Run Text="人" FontSize="14"/>
</TextBlock>
<TextBlock Text="今日本机已到访" FontSize="40" HorizontalAlignment="Center"/>
</StackPanel>
<gs:ImageButton Width="500" Height="500" Grid.Row="1" ImgPath="/Views;component/Resources/menu_btn_has.png"/>
<Image Grid.Row="2" Source="/Views;component/Resources/menu_or.png" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<gs:ImageButton Width="500" Height="500" Grid.Row="3" ImgPath="/Views;component/Resources/menu_btn_no.png"/>
<Button Style="{StaticResource MenuPage_HistoryButton}"/>
</Grid>
</Grid>
</Page>
using GS.Terminal.LogicShell.Interface;
using GS.Unitive.Framework.Security.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
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 Views.Pages.MenuPage
{
/// <summary>
/// Index.xaml 的交互逻辑
/// </summary>
[Export(typeof(IView))]
[UnitiveView("目录页", "", "31fa8506-2213-44a4-bd07-a68fba474038", null)]
public partial class Index : Page, IView
{
public Index()
{
InitializeComponent();
}
public void BindDataContext(IViewModel vm)
{
DataContext = vm;
}
public object Clone()
{
throw new NotImplementedException();
}
public void GoBack()
{
throw new NotImplementedException();
}
public void GoForward()
{
throw new NotImplementedException();
}
public void NavigateToContent(object content)
{
throw new NotImplementedException();
}
public void Reset()
{
throw new NotImplementedException();
}
}
}
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:gs="clr-namespace:Develop.Extension.Wpf;assembly=Develop.Extension.Wpf"
xmlns:local="clr-namespace:Views.Pages.MenuPage">
<Style x:Key="MenuPage_Container" TargetType="Grid">
<Setter Property="Width" Value="500"></Setter>
<Setter Property="Height" Value="1510"></Setter>
<Setter Property="Margin" Value="0,0,0,40"></Setter>
<Setter Property="VerticalAlignment" Value="Bottom"></Setter>
</Style>
<Style x:Key="MenuPage_HistoryButton" TargetType="Button">
<Setter Property="Grid.Row" Value="4"></Setter>
<Setter Property="VerticalAlignment" Value="Bottom"></Setter>
<Setter Property="Width" Value="340"></Setter>
<Setter Property="Height" Value="60"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid Background="Transparent">
<Border x:Name="PART_bg" BorderThickness="1" BorderBrush="#e3e3e2" CornerRadius="30">
<Border.Effect>
<DropShadowEffect Direction="90" ShadowDepth="0" BlurRadius="30" Color="#FF9B9A9A"/>
</Border.Effect>
</Border>
<TextBlock Text="查询历史记录" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" TargetName="PART_bg" Value="#f8f6f5"/>
</Trigger>
<Trigger Property="IsPressed" Value="False">
<Setter Property="Background" TargetName="PART_bg" Value="#f7f6f5"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
\ No newline at end of file
......@@ -32,7 +32,23 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Develop.Extension.Wpf">
<HintPath>..\..\..\..\Tools\Develop.Extension.Wpf.dll</HintPath>
</Reference>
<Reference Include="GS.Terminal.LogicShell.Attributes">
<HintPath>..\..\..\..\Addons\GS.Terminal.LogicShell\GS.Terminal.LogicShell.Attributes.dll</HintPath>
</Reference>
<Reference Include="GS.Terminal.LogicShell.Interface">
<HintPath>..\..\..\..\Addons\GS.Terminal.LogicShell\GS.Terminal.LogicShell.Interface.dll</HintPath>
</Reference>
<Reference Include="GS.Unitive.Framework.Security, Version=1.4.0.2, Culture=neutral, PublicKeyToken=769358b197600ab3, processorArchitecture=MSIL">
<HintPath>..\..\packages\GS.Unitive.Framework.Security.1.4.0.2\lib\net40\GS.Unitive.Framework.Security.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
......@@ -48,6 +64,12 @@
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Compile Include="Foot.xaml.cs">
<DependentUpon>Foot.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\MenuPage\Index.xaml.cs">
<DependentUpon>Index.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
......@@ -65,10 +87,35 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<Page Include="Foot.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\MenuPage\Index.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\MenuPage\Style.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Folder Include="PopWindows\" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\menu_btn_has.png" />
<Resource Include="Resources\menu_btn_no.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\menu_or.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="GS.Unitive.Framework.Security" version="1.4.0.2" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" />
</packages>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment