#0060: 增加扫描模式模块功能;
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<appSettings>
|
||||||
|
<add key="Language" value="ZhCN" />
|
||||||
|
</appSettings>
|
||||||
|
</configuration>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<prism:PrismApplication x:Class="XP.Scan.App"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:local="clr-namespace:XP.Scan"
|
||||||
|
xmlns:prism="http://prismlibrary.com/" >
|
||||||
|
<Application.Resources>
|
||||||
|
|
||||||
|
</Application.Resources>
|
||||||
|
</prism:PrismApplication>
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
using System;
|
||||||
|
using System.Windows;
|
||||||
|
using Prism.Container.DryIoc;
|
||||||
|
using Prism.Ioc;
|
||||||
|
using XP.Common.Configs;
|
||||||
|
using XP.Common.Dump.Configs;
|
||||||
|
using XP.Common.Dump.Implementations;
|
||||||
|
using XP.Common.Dump.Interfaces;
|
||||||
|
using XP.Common.Helpers;
|
||||||
|
using XP.Common.Localization.Configs;
|
||||||
|
using XP.Common.Localization.Extensions;
|
||||||
|
using XP.Common.Localization;
|
||||||
|
using XP.Common.Localization.Implementations;
|
||||||
|
using XP.Common.Localization.Interfaces;
|
||||||
|
using XP.Common.Logging;
|
||||||
|
using XP.Common.Logging.Implementations;
|
||||||
|
using XP.Common.Logging.Interfaces;
|
||||||
|
using System.Resources;
|
||||||
|
using XP.Scan.Views;
|
||||||
|
using Prism.Navigation.Regions;
|
||||||
|
|
||||||
|
namespace XP.Scan
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for App.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class App
|
||||||
|
{
|
||||||
|
protected override Window CreateShell()
|
||||||
|
{
|
||||||
|
// 在创建窗口前初始化 LocalizationExtension,确保 XAML 标记扩展能获取到翻译
|
||||||
|
var localizationService = Container.Resolve<ILocalizationService>();
|
||||||
|
|
||||||
|
// 强制设置 UI 语言为中文(确保 ResourceManager 返回中文资源)
|
||||||
|
var zhCN = new System.Globalization.CultureInfo("zh-CN");
|
||||||
|
System.Globalization.CultureInfo.CurrentUICulture = zhCN;
|
||||||
|
System.Globalization.CultureInfo.CurrentCulture = zhCN;
|
||||||
|
|
||||||
|
LocalizationExtension.Initialize(localizationService);
|
||||||
|
LocalizationHelper.Initialize(localizationService);
|
||||||
|
|
||||||
|
// 注册 XP.Scan 模块的资源源 | Register XP.Scan module resource source
|
||||||
|
var scanResourceManager = new ResourceManager("XP.Scan.Resources.Resources", typeof(App).Assembly);
|
||||||
|
localizationService.RegisterResourceSource("XP.Scan", scanResourceManager);
|
||||||
|
|
||||||
|
return Container.Resolve<MainWindow>();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnInitialized()
|
||||||
|
{
|
||||||
|
base.OnInitialized();
|
||||||
|
|
||||||
|
// 启动时导航到 XPScanView
|
||||||
|
var regionManager = Container.Resolve<IRegionManager>();
|
||||||
|
regionManager.RequestNavigate("ContentRegion", nameof(XPScanView));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void RegisterTypes(IContainerRegistry containerRegistry)
|
||||||
|
{
|
||||||
|
// 初始化 Serilog
|
||||||
|
SerilogInitializer.Initialize(new SerilogConfig
|
||||||
|
{
|
||||||
|
LogPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Files", "Logs")
|
||||||
|
});
|
||||||
|
|
||||||
|
// 日志服务
|
||||||
|
containerRegistry.RegisterSingleton<ILoggerService, SerilogLoggerService>();
|
||||||
|
|
||||||
|
// 本地化服务
|
||||||
|
containerRegistry.RegisterSingleton<ILocalizationConfig, LocalizationConfig>();
|
||||||
|
containerRegistry.RegisterSingleton<ILocalizationService, ResxLocalizationService>();
|
||||||
|
|
||||||
|
// Dump 服务
|
||||||
|
containerRegistry.RegisterSingleton<DumpConfig>(() => ConfigLoader.LoadDumpConfig());
|
||||||
|
containerRegistry.RegisterSingleton<IDumpService, DumpService>();
|
||||||
|
|
||||||
|
// 注册 XPScanView 用于区域导航
|
||||||
|
containerRegistry.RegisterForNavigation<XPScanView>();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IContainerExtension CreateContainerExtension()
|
||||||
|
{
|
||||||
|
return new DryIocContainerExtension();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Telerik.Windows.Controls.RadNumericUpDown, Telerik.Windows.Controls.Input, Version=2024.1.408.310, Culture=neutral, PublicKeyToken=5803cfa389c90ce7
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<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" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</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" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<data name="Scan_Text_ScanMode" xml:space="preserve">
|
||||||
|
<value>Scan Mode:</value>
|
||||||
|
<comment>Scan - Scan mode label</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Text_FrameMerge" xml:space="preserve">
|
||||||
|
<value>Frame Merge:</value>
|
||||||
|
<comment>Scan - Frame merge label</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Text_Nums" xml:space="preserve">
|
||||||
|
<value>Acquisition Count:</value>
|
||||||
|
<comment>Scan - Acquisition count label</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Text_Angles" xml:space="preserve">
|
||||||
|
<value>Rotation Angle:</value>
|
||||||
|
<comment>Scan - Rotation angle label</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Text_Progress" xml:space="preserve">
|
||||||
|
<value>Progress:</value>
|
||||||
|
<comment>Scan - Acquisition progress label</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Button_Start" xml:space="preserve">
|
||||||
|
<value>Start</value>
|
||||||
|
<comment>Scan - Start acquisition button</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Button_Stop" xml:space="preserve">
|
||||||
|
<value>Stop</value>
|
||||||
|
<comment>Scan - Stop acquisition button</comment>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<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" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</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" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<data name="Scan_Text_ScanMode" xml:space="preserve">
|
||||||
|
<value>采集模式:</value>
|
||||||
|
<comment>Scan - 采集模式标签 | Scan mode label</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Text_FrameMerge" xml:space="preserve">
|
||||||
|
<value>帧合并:</value>
|
||||||
|
<comment>Scan - 帧合并标签 | Frame merge label</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Text_Nums" xml:space="preserve">
|
||||||
|
<value>采集张数:</value>
|
||||||
|
<comment>Scan - 采集张数标签 | Acquisition count label</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Text_Angles" xml:space="preserve">
|
||||||
|
<value>旋转角度:</value>
|
||||||
|
<comment>Scan - 旋转角度标签 | Rotation angle label</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Text_Progress" xml:space="preserve">
|
||||||
|
<value>采集进度:</value>
|
||||||
|
<comment>Scan - 采集进度标签 | Acquisition progress label</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Button_Start" xml:space="preserve">
|
||||||
|
<value>开始采集</value>
|
||||||
|
<comment>Scan - 开始采集按钮 | Start acquisition button</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Button_Stop" xml:space="preserve">
|
||||||
|
<value>停止采集</value>
|
||||||
|
<comment>Scan - 停止采集按钮 | Stop acquisition button</comment>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<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" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</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" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<data name="Scan_Text_ScanMode" xml:space="preserve">
|
||||||
|
<value>采集模式:</value>
|
||||||
|
<comment>Scan - 采集模式标签 | Scan mode label</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Text_FrameMerge" xml:space="preserve">
|
||||||
|
<value>帧合并:</value>
|
||||||
|
<comment>Scan - 帧合并标签 | Frame merge label</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Text_Nums" xml:space="preserve">
|
||||||
|
<value>采集张数:</value>
|
||||||
|
<comment>Scan - 采集张数标签 | Acquisition count label</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Text_Angles" xml:space="preserve">
|
||||||
|
<value>旋转角度:</value>
|
||||||
|
<comment>Scan - 旋转角度标签 | Rotation angle label</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Text_Progress" xml:space="preserve">
|
||||||
|
<value>采集进度:</value>
|
||||||
|
<comment>Scan - 采集进度标签 | Acquisition progress label</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Button_Start" xml:space="preserve">
|
||||||
|
<value>开始采集</value>
|
||||||
|
<comment>Scan - 开始采集按钮 | Start acquisition button</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Button_Stop" xml:space="preserve">
|
||||||
|
<value>停止采集</value>
|
||||||
|
<comment>Scan - 停止采集按钮 | Stop acquisition button</comment>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<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" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</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" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<data name="Scan_Text_ScanMode" xml:space="preserve">
|
||||||
|
<value>採集模式:</value>
|
||||||
|
<comment>Scan - 採集模式標籤 | Scan mode label</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Text_FrameMerge" xml:space="preserve">
|
||||||
|
<value>幀合併:</value>
|
||||||
|
<comment>Scan - 幀合併標籤 | Frame merge label</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Text_Nums" xml:space="preserve">
|
||||||
|
<value>採集張數:</value>
|
||||||
|
<comment>Scan - 採集張數標籤 | Acquisition count label</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Text_Angles" xml:space="preserve">
|
||||||
|
<value>旋轉角度:</value>
|
||||||
|
<comment>Scan - 旋轉角度標籤 | Rotation angle label</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Text_Progress" xml:space="preserve">
|
||||||
|
<value>採集進度:</value>
|
||||||
|
<comment>Scan - 採集進度標籤 | Acquisition progress label</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Button_Start" xml:space="preserve">
|
||||||
|
<value>開始採集</value>
|
||||||
|
<comment>Scan - 開始採集按鈕 | Start acquisition button</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Scan_Button_Stop" xml:space="preserve">
|
||||||
|
<value>停止採集</value>
|
||||||
|
<comment>Scan - 停止採集按鈕 | Stop acquisition button</comment>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using Prism.Mvvm;
|
||||||
|
|
||||||
|
namespace XP.Scan.ViewModels
|
||||||
|
{
|
||||||
|
public class MainWindowViewModel : BindableBase
|
||||||
|
{
|
||||||
|
private string _title = "XplorePlane";
|
||||||
|
|
||||||
|
public string Title
|
||||||
|
{
|
||||||
|
get => _title;
|
||||||
|
set => SetProperty(ref _title, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AcquisitionMode
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public override string ToString() => Name;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
using Prism.Commands;
|
||||||
|
using Prism.Mvvm;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using XP.Common.Localization.Interfaces;
|
||||||
|
using XP.Common.Logging.Interfaces;
|
||||||
|
|
||||||
|
namespace XP.Scan.ViewModels
|
||||||
|
{
|
||||||
|
public class XPScanViewModel : BindableBase
|
||||||
|
{
|
||||||
|
private readonly ILoggerService _logger;
|
||||||
|
private readonly ILocalizationService _localizationService;
|
||||||
|
private AcquisitionMode _selectedAcquisitionMode;
|
||||||
|
private int _mergeLevel = 1;
|
||||||
|
private int _acquisitionCount = 10;
|
||||||
|
private double _rotationAngle = 0;
|
||||||
|
private double _acquisitionProgress = 0;
|
||||||
|
private bool _canStartAcquisition = true;
|
||||||
|
private bool _canStopAcquisition = false;
|
||||||
|
|
||||||
|
// 本地化文本属性
|
||||||
|
public string LabelScanMode => _localizationService.GetString("Scan_Text_ScanMode");
|
||||||
|
public string LabelFrameMerge => _localizationService.GetString("Scan_Text_FrameMerge");
|
||||||
|
public string LabelNums => _localizationService.GetString("Scan_Text_Nums");
|
||||||
|
public string LabelAngles => _localizationService.GetString("Scan_Text_Angles");
|
||||||
|
public string LabelProgress => _localizationService.GetString("Scan_Text_Progress");
|
||||||
|
public string LabelStart => _localizationService.GetString("Scan_Button_Start");
|
||||||
|
public string LabelStop => _localizationService.GetString("Scan_Button_Stop");
|
||||||
|
|
||||||
|
public ObservableCollection<AcquisitionMode> AcquisitionModes { get; set; }
|
||||||
|
|
||||||
|
public AcquisitionMode SelectedAcquisitionMode
|
||||||
|
{
|
||||||
|
get => _selectedAcquisitionMode;
|
||||||
|
set => SetProperty(ref _selectedAcquisitionMode, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int MergeLevel
|
||||||
|
{
|
||||||
|
get => _mergeLevel;
|
||||||
|
set => SetProperty(ref _mergeLevel, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int AcquisitionCount
|
||||||
|
{
|
||||||
|
get => _acquisitionCount;
|
||||||
|
set => SetProperty(ref _acquisitionCount, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public double RotationAngle
|
||||||
|
{
|
||||||
|
get => _rotationAngle;
|
||||||
|
set => SetProperty(ref _rotationAngle, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public double AcquisitionProgress
|
||||||
|
{
|
||||||
|
get => _acquisitionProgress;
|
||||||
|
set => SetProperty(ref _acquisitionProgress, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool CanStartAcquisition
|
||||||
|
{
|
||||||
|
get => _canStartAcquisition;
|
||||||
|
set => SetProperty(ref _canStartAcquisition, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool CanStopAcquisition
|
||||||
|
{
|
||||||
|
get => _canStopAcquisition;
|
||||||
|
set => SetProperty(ref _canStopAcquisition, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICommand StartAcquisitionCommand { get; }
|
||||||
|
public ICommand StopAcquisitionCommand { get; }
|
||||||
|
|
||||||
|
private void StartAcquisition()
|
||||||
|
{
|
||||||
|
_logger.Info("开始采集 | Start acquisition");
|
||||||
|
CanStartAcquisition = false;
|
||||||
|
CanStopAcquisition = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void StopAcquisition()
|
||||||
|
{
|
||||||
|
_logger.Info("停止采集 | Stop acquisition");
|
||||||
|
CanStartAcquisition = true;
|
||||||
|
CanStopAcquisition = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public XPScanViewModel(ILoggerService loggerService, ILocalizationService localizationService)
|
||||||
|
{
|
||||||
|
_logger = loggerService.ForModule<XPScanViewModel>();
|
||||||
|
_localizationService = localizationService;
|
||||||
|
|
||||||
|
AcquisitionModes = new ObservableCollection<AcquisitionMode>
|
||||||
|
{
|
||||||
|
new AcquisitionMode { Id = 1, Name = "QucikScan" },
|
||||||
|
new AcquisitionMode { Id = 2, Name = "QualityScan" }
|
||||||
|
};
|
||||||
|
|
||||||
|
SelectedAcquisitionMode = AcquisitionModes[0];
|
||||||
|
|
||||||
|
StartAcquisitionCommand = new DelegateCommand(StartAcquisition);
|
||||||
|
StopAcquisitionCommand = new DelegateCommand(StopAcquisition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<Window x:Class="XP.Scan.Views.MainWindow"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:prism="http://prismlibrary.com/"
|
||||||
|
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||||
|
Title="{Binding Title}" Height="450" Width="650"
|
||||||
|
WindowStartupLocation="CenterScreen">
|
||||||
|
|
||||||
|
<ContentControl prism:RegionManager.RegionName="ContentRegion" />
|
||||||
|
</Window>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace XP.Scan.Views
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for MainWindow.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class MainWindow : Window
|
||||||
|
{
|
||||||
|
public MainWindow()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
<UserControl x:Class="XP.Scan.Views.XPScanView"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:prism="http://prismlibrary.com/"
|
||||||
|
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
|
||||||
|
prism:ViewModelLocator.AutoWireViewModel="True">
|
||||||
|
|
||||||
|
<UserControl.Resources>
|
||||||
|
<Style TargetType="Button" x:Key="ActionButtonStyle">
|
||||||
|
<Setter Property="Width" Value="100"/>
|
||||||
|
<Setter Property="Height" Value="32"/>
|
||||||
|
<Setter Property="Margin" Value="5"/>
|
||||||
|
<Setter Property="Padding" Value="10,5"/>
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
|
<Setter Property="Cursor" Value="Hand"/>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="Button">
|
||||||
|
<Border x:Name="border"
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
|
CornerRadius="8">
|
||||||
|
<ContentPresenter HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsEnabled" Value="False">
|
||||||
|
<Setter TargetName="border" Property="Background" Value="LightGray"/>
|
||||||
|
<Setter TargetName="border" Property="Opacity" Value="0.5"/>
|
||||||
|
<Setter Property="Foreground" Value="Gray"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter TargetName="border" Property="Opacity" Value="0.8"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsPressed" Value="True">
|
||||||
|
<Setter TargetName="border" Property="Opacity" Value="0.6"/>
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
</UserControl.Resources>
|
||||||
|
|
||||||
|
<Grid Margin="10">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<!-- 第一行 - 采集模式 -->
|
||||||
|
<TextBlock Grid.Row="0" Grid.Column="0"
|
||||||
|
Text="{Binding LabelScanMode}"
|
||||||
|
VerticalAlignment="Center" Margin="5" FontWeight="Bold"/>
|
||||||
|
<telerik:RadComboBox Grid.Row="0" Grid.Column="1" Margin="5"
|
||||||
|
ItemsSource="{Binding AcquisitionModes}"
|
||||||
|
SelectedItem="{Binding SelectedAcquisitionMode}"
|
||||||
|
DisplayMemberPath="Name"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
|
||||||
|
<!-- 第一行 - 帧合并 -->
|
||||||
|
<TextBlock Grid.Row="0" Grid.Column="2"
|
||||||
|
Text="{Binding LabelFrameMerge}"
|
||||||
|
VerticalAlignment="Center" Margin="5" FontWeight="Bold"/>
|
||||||
|
<telerik:RadNumericUpDown Grid.Row="0" Grid.Column="3" Margin="5"
|
||||||
|
Value="{Binding MergeLevel}"
|
||||||
|
Minimum="1" Maximum="100" SmallChange="1"
|
||||||
|
IsInteger="True" VerticalAlignment="Center"/>
|
||||||
|
|
||||||
|
<!-- 第二行 - 采集张数 -->
|
||||||
|
<TextBlock Grid.Row="1" Grid.Column="0"
|
||||||
|
Text="{Binding LabelNums}"
|
||||||
|
VerticalAlignment="Center" Margin="5" FontWeight="Bold"/>
|
||||||
|
<telerik:RadNumericUpDown Grid.Row="1" Grid.Column="1" Margin="5"
|
||||||
|
Value="{Binding AcquisitionCount}"
|
||||||
|
Minimum="360" Maximum="3600" SmallChange="1"
|
||||||
|
IsInteger="True" VerticalAlignment="Center"/>
|
||||||
|
|
||||||
|
<!-- 第二行 - 旋转角度 -->
|
||||||
|
<TextBlock Grid.Row="1" Grid.Column="2"
|
||||||
|
Text="{Binding LabelAngles}"
|
||||||
|
VerticalAlignment="Center" Margin="5" FontWeight="Bold"/>
|
||||||
|
<telerik:RadNumericUpDown Grid.Row="1" Grid.Column="3" Margin="5"
|
||||||
|
Value="{Binding RotationAngle}"
|
||||||
|
Minimum="180" Maximum="360" SmallChange="1"
|
||||||
|
IsInteger="True" VerticalAlignment="Center"/>
|
||||||
|
|
||||||
|
<!-- 第三行 - 采集进度 -->
|
||||||
|
<TextBlock Grid.Row="2" Grid.Column="0"
|
||||||
|
Text="{Binding LabelProgress}"
|
||||||
|
VerticalAlignment="Center" Margin="5" FontWeight="Bold"/>
|
||||||
|
<ProgressBar Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3"
|
||||||
|
Margin="5" Minimum="0" Maximum="100"
|
||||||
|
Value="{Binding AcquisitionProgress}"
|
||||||
|
Height="25" VerticalAlignment="Center"/>
|
||||||
|
|
||||||
|
<!-- 第四行 - 按钮 -->
|
||||||
|
<StackPanel Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="4"
|
||||||
|
Orientation="Horizontal" HorizontalAlignment="Center"
|
||||||
|
Margin="0,10,0,0">
|
||||||
|
<Button Content="{Binding LabelStart}"
|
||||||
|
Style="{StaticResource ActionButtonStyle}"
|
||||||
|
Command="{Binding StartAcquisitionCommand}"
|
||||||
|
IsEnabled="{Binding CanStartAcquisition}"
|
||||||
|
Background="LightGreen"/>
|
||||||
|
<Button Content="{Binding LabelStop}"
|
||||||
|
Style="{StaticResource ActionButtonStyle}"
|
||||||
|
Command="{Binding StopAcquisitionCommand}"
|
||||||
|
IsEnabled="{Binding CanStopAcquisition}"
|
||||||
|
Background="LightCoral"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using System.Windows.Controls;
|
||||||
|
|
||||||
|
namespace XP.Scan.Views
|
||||||
|
{
|
||||||
|
public partial class XPScanView : UserControl
|
||||||
|
{
|
||||||
|
public XPScanView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<TargetFramework>net8.0-windows10.0.26100.0</TargetFramework>
|
||||||
|
<UseWPF>true</UseWPF>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Prism.DryIoc" Version="9.0.537" />
|
||||||
|
<PackageReference Include="telerik.ui.for.wpf.netcore.xaml" Version="2024.1.408" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\XP.Common\XP.Common.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Update="Resources\Resources.resx">
|
||||||
|
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Update="Resources\Resources.zh-CN.resx">
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Update="Resources\Resources.zh-TW.resx">
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Update="Resources\Resources.en-US.resx">
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Update="Resources\Resources.Designer.cs">
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
@@ -60,6 +60,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "XP.Hardware", "XP.Hardware"
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "XP.ImageProcessing", "XP.ImageProcessing", "{C24535A4-6717-4149-AB81-1EF09A15F90F}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "XP.ImageProcessing", "XP.ImageProcessing", "{C24535A4-6717-4149-AB81-1EF09A15F90F}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XP.Scan", "XP.Scan\XP.Scan.csproj", "{F40C71DC-7639-CD57-6183-2EAA78980EC5}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "XP.ScanMode", "XP.ScanMode", "{E208A5EA-7E3B-46B4-B045-A703F6274218}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -250,6 +254,18 @@ Global
|
|||||||
{6170AF9F-A792-6BDC-4E25-072EA87FAA15}.Release|x64.Build.0 = Release|Any CPU
|
{6170AF9F-A792-6BDC-4E25-072EA87FAA15}.Release|x64.Build.0 = Release|Any CPU
|
||||||
{6170AF9F-A792-6BDC-4E25-072EA87FAA15}.Release|x86.ActiveCfg = Release|Any CPU
|
{6170AF9F-A792-6BDC-4E25-072EA87FAA15}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
{6170AF9F-A792-6BDC-4E25-072EA87FAA15}.Release|x86.Build.0 = Release|Any CPU
|
{6170AF9F-A792-6BDC-4E25-072EA87FAA15}.Release|x86.Build.0 = Release|Any CPU
|
||||||
|
{F40C71DC-7639-CD57-6183-2EAA78980EC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{F40C71DC-7639-CD57-6183-2EAA78980EC5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{F40C71DC-7639-CD57-6183-2EAA78980EC5}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{F40C71DC-7639-CD57-6183-2EAA78980EC5}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{F40C71DC-7639-CD57-6183-2EAA78980EC5}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{F40C71DC-7639-CD57-6183-2EAA78980EC5}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
|
{F40C71DC-7639-CD57-6183-2EAA78980EC5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{F40C71DC-7639-CD57-6183-2EAA78980EC5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{F40C71DC-7639-CD57-6183-2EAA78980EC5}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{F40C71DC-7639-CD57-6183-2EAA78980EC5}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{F40C71DC-7639-CD57-6183-2EAA78980EC5}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{F40C71DC-7639-CD57-6183-2EAA78980EC5}.Release|x86.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@@ -267,6 +283,7 @@ Global
|
|||||||
{67D180E8-AB8F-FF62-ED46-270803B8F713} = {29E2D405-341A-4445-B788-3E77A677C2BA}
|
{67D180E8-AB8F-FF62-ED46-270803B8F713} = {29E2D405-341A-4445-B788-3E77A677C2BA}
|
||||||
{B8F5E3A1-7C2D-4E9F-A1B3-6D8E4F2C9A01} = {29E2D405-341A-4445-B788-3E77A677C2BA}
|
{B8F5E3A1-7C2D-4E9F-A1B3-6D8E4F2C9A01} = {29E2D405-341A-4445-B788-3E77A677C2BA}
|
||||||
{6170AF9F-A792-6BDC-4E25-072EA87FAA15} = {29E2D405-341A-4445-B788-3E77A677C2BA}
|
{6170AF9F-A792-6BDC-4E25-072EA87FAA15} = {29E2D405-341A-4445-B788-3E77A677C2BA}
|
||||||
|
{F40C71DC-7639-CD57-6183-2EAA78980EC5} = {E208A5EA-7E3B-46B4-B045-A703F6274218}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {DB6D69BA-49FD-432F-8069-2A8F64933CDE}
|
SolutionGuid = {DB6D69BA-49FD-432F-8069-2A8F64933CDE}
|
||||||
|
|||||||
Reference in New Issue
Block a user