From 3a471ae651b228231bebb3a2d438baa1d4ac0261 Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期五, 21 十一月 2025 08:57:52 +0800
Subject: [PATCH] 优化
---
Plugin.CurrentSensorControl/AssemblyInfo.cs | 2
HMI.AlermInfoManage/app.config | 11
Libs/lmes.dll | 0
Plugin.TestResult/Resource/abort.png | 0
Plugin.CurrentSensorControl/DataModal.xaml | 59
Plugin.TestResult/SingleCell.xaml | 64
Plugin.TestResult/DataTable.xaml | 26
ConnectionUtil/PipeClient2.cs | 130 +
Plugin.CurrentSensorControl/Entity/BaseConfig.cs | 187 +
Plugin.TestResult/TestResultView.xaml.cs | 140
SimpleUtil/HMI.Simple.Util/ProductUtil.cs | 2
ConnectionUtil/SCADAApi.cs | 161 +
ConnectionUtil/ConnectionUtil.csproj | 21
ConnectionUtil/TcpClient.cs | 254 ++
HMI.Core/Setting/SystemSetting.cs | 10
ConnectionUtil/PipeServer2.cs | 192 +
HMI.StdControl/StdEnableMes.xaml.cs | 102
WPFProject/PanuonWindow.xaml.cs | 9
Plugin.TestResult/ViewControl.xaml.cs | 169
Plugin.TestResult/TestResultView.xaml | 2
Plugin.TestResult/Model/Info.cs | 25
Plugin.CurrentSensorControl/Entity/OPCContext.cs | 40
OPCClient/OPCClient.csproj | 14
SimpleUtil/DIOController/DIOController.csproj | 6
WPFProject/App.config | 4
Plugin.TsExecution/TsExecution.xaml.cs | 139
SimpleUtil/HMI.Util.Base/AlarmUtil.cs | 66
Plugin.TestResult/Scanner.xaml | 12
Plugin.CurrentSensorControl/ControlPage.xaml | 284 ++
HMI.StdControl/StdUIEventArg.cs | 14
Plugin.CurrentSensorControl/DataModal.xaml.cs | 128 +
Plugin.DataBoard/DataBoard.xaml.cs | 116
ConnectionUtil/PipeClient.cs | 100
Libs/HslCommunication.dll | 0
Plugin.DataBoard/Properties/AssemblyInfo.cs | 2
Plugin.CurrentSensorControl/BurnInOvenCollection.xaml | 19
Plugin.TsExecution/SingleControl.xaml | 3
WPFProject/WPFProject.sln | 188 -
Plugin.DODriverControl/Plugin.DODriverControl.csproj | 7
Plugin.CurrentSensorControl/Entity/SensorData.cs | 20
HMI.StdControl/HMI.StdControl.csproj | 43
Plugin.TestResult/Properties/AssemblyInfo.cs | 1
Plugin.DODriverControl/Api/ModBusTcpController.cs | 8
Plugin.CurrentSensorControl/BurnInCell.xaml.cs | 179 +
Plugin.TsExecution/Properties/AssemblyInfo.cs | 4
ConnectionUtil/Properties/AssemblyInfo.cs | 13
ConsoleTest/Properties/app.manifest | 73
Plugin.TestResult/InfoWindow.xaml.cs | 16
Plugin.TestResult/SingleCell.xaml.cs | 252 ++
Plugin.TestResult/ViewControl.xaml | 107
Plugin.TestResult/DataTable.xaml.cs | 232 +
HMI.UI/HMI.UI.csproj | 1
HMI.StdControl/Properties/AssemblyInfo.cs | 13
WPFProject/Config/log4net.config | 2
HMI.UI/ScrollLabel.cs | 143 +
Plugin.DODriverControl/Api/PCIController.cs | 5
HMI.MenuManage/MenuManage.xaml.cs | 2
ConnectionUtil/PipeServer.cs | 347 +++
Plugin.CurrentSensorControl/ControlPage.xaml.cs | 410 +++
OPCClient/app.config | 11
Plugin.CurrentSensorControl/Plugin.CurrentSensorControl.csproj | 44
OPCClient/packages.config | 2
Plugin.CurrentSensorControl/BurnInOven.xaml | 78
Plugin.CurrentSensorControl/Entity/PLCTagData.cs | 25
Plugin.TestResult/Util/CommonCodeParser.cs | 9
HMI.DataViewer/DataViewer.xaml.cs | 2
Plugin.DOControl/app.config | 11
HMI.UnitTest/MainWindow.xaml.cs | 81
HMI.AlermInfoManage/Entity/AlarmText.cs | 3
HMI.UI/Controls/LightBall.cs | 6
HMI.UI/Style/MsgBoxStyle.xaml | 6
Plugin.DataBoard/DataBoard.xaml | 45
Plugin.TestResult/Scanner.xaml.cs | 121
HMI.AlermInfoManage/AlarmSettingList.xaml | 35
ModBusTcpController/ModBusTcpController.csproj | 34
Plugin.CurrentSensorControl/BurnInCell.xaml | 65
WPFProject/LoadingWindow.xaml | 2
Plugin.CurrentSensorControl/Entity/S7Context.cs | 114 +
ConsoleTest/ConsoleTest.csproj | 29
Plugin.CurrentSensorControl/SingleSensor.xaml.cs | 180 +
Plugin.TestResult/Util/ICodeParser.cs | 9
ModBusTcpController/Properties/AssemblyInfo.cs | 13
Plugin.TestResult/Model/BaseConfig.cs | 10
HMI.UI/Themes/Generic.xaml | 44
HMI.ParameterManage/SettingModal.xaml.cs | 5
HMI.StdControl/StdEnableMes.xaml | 12
Plugin.TestResult/InfoTable.xaml | 4
WPFProject/WPFProject.csproj | 24
ModBusTcpController/ModBusTcpController.cs | 85
HMI.AlermInfoManage/HMI.AlarmInfoManage.csproj | 5
ConsoleTest/Program.cs | 45
Plugin.DOControl/Plugin.DOControl.csproj | 5
HMI.AlermInfoManage/AlarmInfoManage.xaml.cs | 118
Plugin.JarUI/JarUI.xaml.cs | 6
Plugin.TestResult/Plugin.TestResult.csproj | 9
Plugin.TsExecution/SingleControl.xaml.cs | 11
HMI.ParameterManage/ParameterModal.xaml.cs | 10
Plugin.CurrentSensorControl/BurnInSettingModal.xaml | 159 +
Plugin.CurrentSensorControl/BurnInSettingModal.xaml.cs | 143 +
Plugin.TestResult/InfoWindow.xaml | 19
SimpleUtil/HMI.Util.Base/HMI.Util.Base.csproj | 4
Plugin.CurrentSensorControl/SingleSensor.xaml | 74
Plugin.TestResult/Util/JKCodeParser.cs | 26
Plugin.DODriverControl/Api/IDIOController.cs | 1
WPFProject/Login.xaml | 2
/dev/null | 19
Plugin.TestResult/Constant/CommonConstant.cs | 2
Plugin.CurrentSensorControl/BurnInOven.xaml.cs | 233 ++
HMI.AlermInfoManage/Entity/AlarmSetting.cs | 3
HMI.SettingControl/SystemConfig.xaml | 8
HMI.UnitTest/HMI.UnitTest.csproj | 4
HMI.UI/Style/Colors.xaml | 25
Plugin.DODriverControl/SingleControl.xaml.cs | 30
Plugin.CurrentSensorControl/BurnInOvenCollection.xaml.cs | 91
114 files changed, 5,938 insertions(+), 802 deletions(-)
diff --git a/VisionBuilder.Engine/VisionBuilder.Engine.csproj b/ConnectionUtil/ConnectionUtil.csproj
similarity index 84%
rename from VisionBuilder.Engine/VisionBuilder.Engine.csproj
rename to ConnectionUtil/ConnectionUtil.csproj
index 553239e..2e5ad82 100644
--- a/VisionBuilder.Engine/VisionBuilder.Engine.csproj
+++ b/ConnectionUtil/ConnectionUtil.csproj
@@ -1,14 +1,14 @@
-锘�<?xml version="1.0" encoding="utf-8"?>
+<?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>{8E5E8A68-0B9D-4A6A-B325-730C64603FDF}</ProjectGuid>
+ <ProjectGuid>{D0806FA6-3F6D-4304-81B8-EAD9DA7CB5B2}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>VisionBuilder.Engine</RootNamespace>
- <AssemblyName>VisionBuilder.Engine</AssemblyName>
+ <RootNamespace>ConnectionUtil</RootNamespace>
+ <AssemblyName>ConnectionUtil</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
@@ -59,14 +59,13 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
- <Compile Include="Runner.cs" />
+ <Compile Include="PipeClient.cs" />
+ <Compile Include="PipeClient2.cs" />
+ <Compile Include="PipeServer.cs" />
+ <Compile Include="PipeServer2.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\HMI.Core\HMI.Core.csproj">
- <Project>{3e3bf44a-0b69-45c5-9512-528cb48a7106}</Project>
- <Name>HMI.Core</Name>
- </ProjectReference>
+ <Compile Include="SCADAApi.cs" />
+ <Compile Include="TcpClient.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
diff --git a/ConnectionUtil/PipeClient.cs b/ConnectionUtil/PipeClient.cs
new file mode 100644
index 0000000..68474fd
--- /dev/null
+++ b/ConnectionUtil/PipeClient.cs
@@ -0,0 +1,100 @@
+锘縰sing System;
+using System.IO;
+using System.IO.Pipes;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace ConnectionUtil
+{
+ public class PipeClient : IDisposable
+ {
+ private readonly string _pipeName;
+ private readonly string _serverName;
+ private readonly CancellationTokenSource _cancellationTokenSource;
+ private NamedPipeClientStream _pipeClient;
+ private bool _isDisposed;
+ private bool _isConnected;
+ private readonly object _sendLock = new object();
+
+ // 浜嬩欢瀹氫箟
+ public event EventHandler<PipeDataEventArgs> OnData;
+ public event EventHandler OnConnected;
+ public event EventHandler OnDisconnected;
+
+ public PipeClient(string pipeName, string serverName = ".")
+ {
+ _pipeName = pipeName;
+ _serverName = serverName;
+ _cancellationTokenSource = new CancellationTokenSource();
+ }
+
+ public void Connect(int timeoutMs = 5000)
+ {
+ if (_isConnected)
+ return;
+ _pipeClient = new NamedPipeClientStream(_pipeName);
+
+ _pipeClient.Connect(timeoutMs);
+ _pipeClient.ReadMode = PipeTransmissionMode.Message;
+ _isConnected = true;
+ Console.WriteLine("杩炴帴鎴愬姛锛�");
+
+ // 瑙﹀彂杩炴帴鎴愬姛浜嬩欢
+ OnConnected?.Invoke(this, EventArgs.Empty);
+ }
+
+ public bool SendMessage(string message, out string response, int timeoutMs = 5000)
+ {
+ if (!_isConnected)
+ {
+ response = "瀹㈡埛绔湭杩炴帴鍒版湇鍔″櫒";
+ return false;
+ }
+ response = null;
+ lock (_sendLock)
+ {
+ try
+ {
+ // 鍙戦�佹秷鎭�
+ _pipeClient.WriteMessage(message);
+ return true;
+ while (_isConnected && !_cancellationTokenSource.Token.IsCancellationRequested)
+ {
+ try
+ {
+ response = _pipeClient.ReadMessage();
+ break;
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine($"鎺ユ敹鏁版嵁鏃跺彂鐢熼敊璇�: {ex.Message}");
+ break;
+ }
+ }
+ return true;
+ }
+ catch (Exception ex)
+ {
+ return false;
+ }
+ }
+ }
+
+ public void Disconnect()
+ {
+ _isConnected = false;
+ _cancellationTokenSource.Cancel();
+ }
+
+ public void Dispose()
+ {
+ if (!_isDisposed)
+ {
+ Disconnect();
+ _pipeClient?.Dispose();
+ _cancellationTokenSource.Dispose();
+ _isDisposed = true;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/ConnectionUtil/PipeClient2.cs b/ConnectionUtil/PipeClient2.cs
new file mode 100644
index 0000000..348cea8
--- /dev/null
+++ b/ConnectionUtil/PipeClient2.cs
@@ -0,0 +1,130 @@
+锘縰sing System;
+using System.IO;
+using System.IO.Pipes;
+using System.Threading;
+
+namespace ConnectionUtil
+{
+ public class PipeClient2 : IDisposable
+ {
+ private readonly string _pipeName;
+ private readonly string _serverName;
+ private readonly CancellationTokenSource _cancellationTokenSource;
+ private readonly ReaderWriterLockSlim _lock;
+ private NamedPipeClientStream _pipeClient;
+ private bool _isDisposed;
+ private bool _isConnected;
+ private Thread _receiveThread;
+
+ // 浜嬩欢瀹氫箟
+ public event EventHandler<PipeDataEventArgs> OnData;
+ public event EventHandler OnConnected;
+ public event EventHandler OnDisconnected;
+
+ public PipeClient2(string pipeName, string serverName = ".")
+ {
+ _pipeName = pipeName;
+ _serverName = serverName;
+ _cancellationTokenSource = new CancellationTokenSource();
+ _lock = new ReaderWriterLockSlim();
+ }
+
+ public void Connect(int timeoutMs = 5000)
+ {
+ if (_isConnected)
+ return;
+
+ try
+ {
+ // 鍔犱笂 PipeOptions.Asynchronous 鍙互寮傛鎺ュ彈鏈嶅姟鍣ㄥ彂閫佺殑鏁版嵁锛屼絾鏄緢褰卞搷鎬ц兘
+ _pipeClient = new NamedPipeClientStream(_serverName, _pipeName, PipeDirection.InOut);
+
+ // 鍒涘缓瓒呮椂鍙栨秷浠ょ墝
+ using (var timeoutCts = new CancellationTokenSource(timeoutMs))
+ {
+ _pipeClient.Connect(timeoutMs);
+ _pipeClient.ReadMode = PipeTransmissionMode.Message;
+ _isConnected = true;
+
+ // 瑙﹀彂杩炴帴鎴愬姛浜嬩欢
+ OnConnected?.Invoke(this, EventArgs.Empty);
+
+ // 寮�濮嬫帴鏀舵暟鎹�
+ //_receiveThread = new Thread(ReceiveData);
+ //_receiveThread.Start();
+ }
+ }
+ catch (Exception ex)
+ {
+ throw;
+ }
+ }
+
+ private void ReceiveData()
+ {
+ try
+ {
+ while (_isConnected && !_cancellationTokenSource.Token.IsCancellationRequested)
+ {
+ string message = _pipeClient.ReadMessage();
+ if (string.IsNullOrEmpty(message))
+ break;
+ // 瑙﹀彂鏁版嵁鎺ユ敹浜嬩欢
+ OnData?.Invoke(this, new PipeDataEventArgs("", message));
+ }
+ }
+ finally
+ {
+ _isConnected = false;
+ // 瑙﹀彂鏂紑杩炴帴浜嬩欢
+ OnDisconnected?.Invoke(this, EventArgs.Empty);
+ }
+ }
+
+ public bool SendMessage(string message, out string response, int timeoutMs = 5000)
+ {
+ response = null;
+ if (!_isConnected)
+ return false;
+ try
+ {
+
+ _lock.EnterWriteLock();
+ try
+ {
+ _pipeClient.WriteMessage(message);
+ }
+ finally
+ {
+ _lock.ExitWriteLock();
+ }
+ response = _pipeClient.ReadMessage();
+ return true;
+ }
+ catch (Exception ex)
+ {
+ response = ex.Message;
+ return false;
+ }
+ }
+
+ public void Disconnect()
+ {
+ _isConnected = false;
+ _cancellationTokenSource.Cancel();
+ _receiveThread?.Join(1000); // 绛夊緟鎺ユ敹绾跨▼缁撴潫
+ }
+
+ public void Dispose()
+ {
+ if (!_isDisposed)
+ {
+ Disconnect();
+ _pipeClient?.Dispose();
+ _cancellationTokenSource.Dispose();
+ _lock.Dispose();
+ _isDisposed = true;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/ConnectionUtil/PipeServer.cs b/ConnectionUtil/PipeServer.cs
new file mode 100644
index 0000000..90425df
--- /dev/null
+++ b/ConnectionUtil/PipeServer.cs
@@ -0,0 +1,347 @@
+锘縰sing System;
+using System.Collections.Concurrent;
+using System.IO;
+using System.IO.Pipes;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace ConnectionUtil
+{
+ public class PipeServer : IDisposable
+ {
+ private readonly string _pipeName;
+ private readonly int _maxNumberOfServerInstances;
+ private readonly CancellationTokenSource _cancellationTokenSource;
+ private readonly ConcurrentDictionary<string, NamedPipeServerStream> _activeConnections;
+ private bool _isDisposed;
+
+ // 浜嬩欢瀹氫箟
+ public event EventHandler<PipeDataEventArgs> OnData;
+ public event EventHandler<PipeConnectionEventArgs> OnNewConnection;
+ public event EventHandler<PipeConnectionEventArgs> OnClientDisconnected;
+ public event EventHandler<PipeErrorEventArgs> OnError;
+
+ public PipeServer(string pipeName, int maxNumberOfServerInstances = NamedPipeServerStream.MaxAllowedServerInstances)
+ {
+ _pipeName = pipeName;
+ _maxNumberOfServerInstances = maxNumberOfServerInstances;
+ _cancellationTokenSource = new CancellationTokenSource();
+ _activeConnections = new ConcurrentDictionary<string, NamedPipeServerStream>();
+ }
+
+ public void Start()
+ {
+ Task.Run(() =>
+ {
+ try
+ {
+ while (!_cancellationTokenSource.Token.IsCancellationRequested)
+ {
+ var pipeServer = new NamedPipeServerStream(_pipeName, PipeDirection.InOut,
+ _maxNumberOfServerInstances, PipeTransmissionMode.Message);
+ try
+ {
+ pipeServer.WaitForConnection();
+
+ // 鐢熸垚鍞竴鐨勮繛鎺D
+ string connectionId = Guid.NewGuid().ToString();
+ _activeConnections.TryAdd(connectionId, pipeServer);
+
+ // 瑙﹀彂鏂拌繛鎺ヤ簨浠�
+ OnNewConnection?.Invoke(this, new PipeConnectionEventArgs(connectionId));
+
+ // 寮�濮嬪鐞嗚杩炴帴鐨勬暟鎹�
+ HandleClient(connectionId, pipeServer);
+ }
+ catch (OperationCanceledException)
+ {
+ pipeServer.Dispose();
+ break;
+ }
+ catch (Exception ex)
+ {
+ pipeServer.Dispose();
+ OnError?.Invoke(this, new PipeErrorEventArgs("绛夊緟杩炴帴鏃跺彂鐢熼敊璇�", ex));
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ OnError?.Invoke(this, new PipeErrorEventArgs("鏈嶅姟鍣ㄨ繍琛屾椂鍙戠敓閿欒", ex));
+ }
+
+ });
+ }
+
+ static string ReadMessage(PipeStream s)
+ {
+ MemoryStream ms = new MemoryStream();
+ byte[] buffer = new byte[0x1000]; // Read in 4 KB blocks
+ do
+ {
+ ms.Write(buffer, 0, s.Read(buffer, 0, buffer.Length));
+ }
+ while (!s.IsMessageComplete);
+ return Encoding.UTF8.GetString(ms.ToArray());
+ }
+
+ private void HandleClient(string connectionId, NamedPipeServerStream pipeServer)
+ {
+ Task.Run(() =>
+ {
+ try
+ {
+ while (pipeServer.IsConnected && !_cancellationTokenSource.Token.IsCancellationRequested)
+ {
+ try
+ {
+ string message = ReadMessage(pipeServer);
+ if (string.IsNullOrEmpty(message))
+ continue;
+ Console.WriteLine(message);
+ if (message == "ping")
+ {
+ message = "pong";
+ }
+ else
+ {
+ message += "Response";
+ }
+ SendMessage(connectionId, message);
+ }
+ catch (Exception ex)
+ {
+ OnError?.Invoke(this, new PipeErrorEventArgs($"澶勭悊瀹㈡埛绔� {connectionId} 鏁版嵁鏃跺彂鐢熼敊璇�", ex));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // 娓呯悊杩炴帴
+ _activeConnections.TryRemove(connectionId, out _);
+ pipeServer.Dispose();
+
+ // 瑙﹀彂鏂紑杩炴帴浜嬩欢
+ OnClientDisconnected?.Invoke(this, new PipeConnectionEventArgs(connectionId));
+ }
+ });
+ }
+
+ public void SendMessage(string connectionId, string message)
+ {
+ if (_activeConnections.TryGetValue(connectionId, out var pipeServer))
+ {
+ try
+ {
+ var msg = Encoding.UTF8.GetBytes(message);
+ pipeServer.Write(msg, 0, msg.Length);
+ }
+ catch (Exception ex)
+ {
+ OnError?.Invoke(this, new PipeErrorEventArgs($"鍚戝鎴风 {connectionId} 鍙戦�佹秷鎭椂鍙戠敓閿欒", ex));
+ }
+ }
+ }
+
+
+ public async Task StartAsync()
+ {
+ try
+ {
+ while (!_cancellationTokenSource.Token.IsCancellationRequested)
+ {
+ var pipeServer = new NamedPipeServerStream(_pipeName, PipeDirection.InOut,
+ _maxNumberOfServerInstances, PipeTransmissionMode.Message);
+
+ try
+ {
+ await pipeServer.WaitForConnectionAsync(_cancellationTokenSource.Token);
+
+ // 鐢熸垚鍞竴鐨勮繛鎺D
+ string connectionId = Guid.NewGuid().ToString();
+ _activeConnections.TryAdd(connectionId, pipeServer);
+
+ // 瑙﹀彂鏂拌繛鎺ヤ簨浠�
+ OnNewConnection?.Invoke(this, new PipeConnectionEventArgs(connectionId));
+
+ // 寮�濮嬪鐞嗚杩炴帴鐨勬暟鎹�
+ _ = HandleClientAsync(connectionId, pipeServer);
+ }
+ catch (OperationCanceledException)
+ {
+ pipeServer.Dispose();
+ break;
+ }
+ catch (Exception ex)
+ {
+ pipeServer.Dispose();
+ OnError?.Invoke(this, new PipeErrorEventArgs("绛夊緟杩炴帴鏃跺彂鐢熼敊璇�", ex));
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ OnError?.Invoke(this, new PipeErrorEventArgs("鏈嶅姟鍣ㄨ繍琛屾椂鍙戠敓閿欒", ex));
+ }
+ }
+
+ private async Task HandleClientAsync(string connectionId, NamedPipeServerStream pipeServer)
+ {
+ try
+ {
+ using (var reader = new StreamReader(pipeServer))
+ using (var writer = new StreamWriter(pipeServer))
+ {
+ writer.AutoFlush = true;
+
+ while (pipeServer.IsConnected && !_cancellationTokenSource.Token.IsCancellationRequested)
+ {
+ try
+ {
+ string message = await reader.ReadLineAsync();
+ if (string.IsNullOrEmpty(message))
+ continue;
+
+ // 瑙﹀彂鏁版嵁鎺ユ敹浜嬩欢
+ OnData?.Invoke(this, new PipeDataEventArgs(connectionId, message));
+
+ // 鍙戦�佸搷搴�
+ await writer.WriteLineAsync($"鏈嶅姟鍣ㄥ凡鏀跺埌娑堟伅: {message}");
+ }
+ catch (Exception ex)
+ {
+ OnError?.Invoke(this, new PipeErrorEventArgs($"澶勭悊瀹㈡埛绔� {connectionId} 鏁版嵁鏃跺彂鐢熼敊璇�", ex));
+ break;
+ }
+ }
+ }
+ }
+ finally
+ {
+ // 娓呯悊杩炴帴
+ _activeConnections.TryRemove(connectionId, out _);
+ pipeServer.Dispose();
+
+ // 瑙﹀彂鏂紑杩炴帴浜嬩欢
+ OnClientDisconnected?.Invoke(this, new PipeConnectionEventArgs(connectionId));
+ }
+ }
+
+ public async Task SendMessageAsync(string connectionId, string message)
+ {
+ if (_activeConnections.TryGetValue(connectionId, out var pipeServer))
+ {
+ try
+ {
+ using (var writer = new StreamWriter(pipeServer))
+ {
+ writer.AutoFlush = true;
+ await writer.WriteLineAsync(message);
+ }
+ }
+ catch (Exception ex)
+ {
+ OnError?.Invoke(this, new PipeErrorEventArgs($"鍚戝鎴风 {connectionId} 鍙戦�佹秷鎭椂鍙戠敓閿欒", ex));
+ }
+ }
+ }
+
+ public void Stop()
+ {
+ _cancellationTokenSource.Cancel();
+ }
+
+ public void Dispose()
+ {
+ if (!_isDisposed)
+ {
+ Stop();
+ foreach (var connection in _activeConnections.Values)
+ {
+ connection.Dispose();
+ }
+ _activeConnections.Clear();
+ _cancellationTokenSource.Dispose();
+ _isDisposed = true;
+ }
+ }
+ }
+
+ public class PipeDataEventArgs : EventArgs
+ {
+ public string ConnectionId { get; }
+ public string Data { get; }
+
+ public PipeDataEventArgs(string connectionId, string data)
+ {
+ ConnectionId = connectionId;
+ Data = data;
+ }
+ }
+
+ public class PipeConnectionEventArgs : EventArgs
+ {
+ public string ConnectionId { get; }
+
+ public PipeConnectionEventArgs(string connectionId)
+ {
+ ConnectionId = connectionId;
+ }
+ }
+
+ public class PipeErrorEventArgs : EventArgs
+ {
+ public string Message { get; }
+ public Exception Exception { get; }
+
+ public PipeErrorEventArgs(string message, Exception exception)
+ {
+ Message = message;
+ Exception = exception;
+ }
+ }
+
+ public class StreamString
+ {
+ private Stream ioStream;
+ private UnicodeEncoding streamEncoding;
+
+ public StreamString(Stream ioStream)
+ {
+ this.ioStream = ioStream;
+ streamEncoding = new UnicodeEncoding();
+ }
+
+ public string ReadString()
+ {
+ int len = 0;
+
+
+ len = ioStream.ReadByte() * 256;
+ len += ioStream.ReadByte();
+ byte[] inBuffer = new byte[len];
+ ioStream.Read(inBuffer, 0, len);
+
+ return streamEncoding.GetString(inBuffer);
+ }
+
+ public int WriteString(string outString)
+ {
+ byte[] outBuffer = streamEncoding.GetBytes(outString);
+ int len = outBuffer.Length;
+ if (len > UInt16.MaxValue)
+ {
+ len = (int)UInt16.MaxValue;
+ }
+ ioStream.WriteByte((byte)(len / 256));
+ ioStream.WriteByte((byte)(len & 255));
+ ioStream.Write(outBuffer, 0, len);
+ ioStream.Flush();
+
+ return outBuffer.Length + 2;
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/ConnectionUtil/PipeServer2.cs b/ConnectionUtil/PipeServer2.cs
new file mode 100644
index 0000000..cefbd5f
--- /dev/null
+++ b/ConnectionUtil/PipeServer2.cs
@@ -0,0 +1,192 @@
+锘縰sing System;
+using System.Collections.Concurrent;
+using System.IO;
+using System.IO.Pipes;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace ConnectionUtil
+{
+ public static class PipeStreamUtil
+ {
+ public static string ReadMessage(this PipeStream ps)
+ {
+
+ MemoryStream ms = new MemoryStream();
+ byte[] buffer = new byte[0x1000];
+ do
+ {
+ ms.Write(buffer, 0, ps.Read(buffer, 0, buffer.Length));
+ }
+ while (!ps.IsMessageComplete);
+ return Encoding.UTF8.GetString(ms.ToArray());
+ }
+
+ public static void WriteMessage(this PipeStream ps, string message)
+ {
+ var msg = Encoding.UTF8.GetBytes(message);
+ ps.Write(msg, 0, msg.Length);
+ ps.Flush();
+ }
+ }
+
+ public class PipeServer2 : IDisposable
+ {
+ private readonly string _pipeName;
+ private readonly int _maxNumberOfServerInstances;
+ private readonly CancellationTokenSource _cancellationTokenSource;
+ private readonly ConcurrentDictionary<string, NamedPipeServerStream> _activeConnections;
+ private readonly ReaderWriterLockSlim _lock;
+ private bool _isDisposed;
+ private bool _isRunning;
+
+ // 浜嬩欢瀹氫箟
+ public event EventHandler<PipeDataEventArgs> OnData;
+ public event EventHandler<PipeConnectionEventArgs> OnClientConnected;
+ public event EventHandler<PipeConnectionEventArgs> OnClientDisconnected;
+ public event EventHandler<PipeErrorEventArgs> OnError;
+
+ public PipeServer2(string pipeName, int maxNumberOfServerInstances = 254)
+ {
+ _pipeName = pipeName;
+ _maxNumberOfServerInstances = maxNumberOfServerInstances;
+ _cancellationTokenSource = new CancellationTokenSource();
+ _activeConnections = new ConcurrentDictionary<string, NamedPipeServerStream>();
+ _lock = new ReaderWriterLockSlim();
+ }
+
+ public void Start()
+ {
+ if (_isRunning)
+ return;
+
+ _isRunning = true;
+
+ Task.Run(() =>
+ {
+ while (_isRunning && !_cancellationTokenSource.Token.IsCancellationRequested)
+ {
+ try
+ {
+ var pipeServer = new NamedPipeServerStream(_pipeName, PipeDirection.InOut, _maxNumberOfServerInstances
+ , PipeTransmissionMode.Message);
+ pipeServer.WaitForConnection();
+
+ string clientId = Guid.NewGuid().ToString();
+ if (_activeConnections.TryAdd(clientId, pipeServer))
+ {
+ // 鍚姩澶勭悊瀹㈡埛绔秷鎭殑绾跨▼
+ Thread clientThread = new Thread(() => HandleClient(clientId, pipeServer));
+ clientThread.Start();
+
+ OnClientConnected?.Invoke(this, new PipeConnectionEventArgs(clientId));
+ }
+ }
+ catch (Exception ex)
+ {
+ OnError?.Invoke(this, new PipeErrorEventArgs("Connect", ex));
+ Thread.Sleep(1000); // 鍙戠敓閿欒鏃剁瓑寰呬竴绉掑啀閲嶈瘯
+ }
+ }
+ });
+ }
+
+
+
+ private void HandleClient(string clientId, NamedPipeServerStream pipeServer)
+ {
+ try
+ {
+ while (!_cancellationTokenSource.Token.IsCancellationRequested)
+ {
+ try
+ {
+ // 绛夊緟瀹㈡埛绔彂閫佹秷鎭�
+ string message = pipeServer.ReadMessage();
+ if (string.IsNullOrEmpty(message))
+ break;
+
+ OnData?.Invoke(this, new PipeDataEventArgs(clientId, message));
+ }
+ catch (Exception ex)
+ {
+ OnError?.Invoke(this, new PipeErrorEventArgs("HandleClientMessageError", ex));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ if (_activeConnections.TryRemove(clientId, out var pipe))
+ {
+ pipe.Dispose();
+ }
+ OnClientDisconnected?.Invoke(this, new PipeConnectionEventArgs(clientId));
+ }
+ }
+
+ public void SendMessage(string clientId, string message)
+ {
+ if (!_activeConnections.TryGetValue(clientId, out var pipeServer))
+ {
+ throw new InvalidOperationException($"鎵句笉鍒板鎴风 {clientId}");
+ }
+
+ _lock.EnterWriteLock();
+ try
+ {
+ try
+ {
+ pipeServer.WriteMessage(message);
+ }
+ catch (Exception ex)
+ {
+ OnError?.Invoke(this, new PipeErrorEventArgs($"鍚戝鎴风 {clientId} 鍙戦�佹秷鎭椂鍙戠敓閿欒", ex));
+ }
+ }
+ finally
+ {
+ _lock.ExitWriteLock();
+ }
+ }
+
+ public void BroadcastMessage(string message)
+ {
+ _lock.EnterWriteLock();
+ try
+ {
+ foreach (var pipeServer in _activeConnections.Values)
+ {
+ pipeServer.WriteMessage(message);
+ }
+ }
+ finally
+ {
+ _lock.ExitWriteLock();
+ }
+ }
+
+ public void Stop()
+ {
+ _isRunning = false;
+ _cancellationTokenSource.Cancel();
+ }
+
+ public void Dispose()
+ {
+ if (!_isDisposed)
+ {
+ Stop();
+ foreach (var pipeServer in _activeConnections.Values)
+ {
+ pipeServer.Dispose();
+ }
+ _activeConnections.Clear();
+ _cancellationTokenSource.Dispose();
+ _lock.Dispose();
+ _isDisposed = true;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/VisionBuilder.Engine/Properties/AssemblyInfo.cs b/ConnectionUtil/Properties/AssemblyInfo.cs
similarity index 67%
copy from VisionBuilder.Engine/Properties/AssemblyInfo.cs
copy to ConnectionUtil/Properties/AssemblyInfo.cs
index e98d254..48007e9 100644
--- a/VisionBuilder.Engine/Properties/AssemblyInfo.cs
+++ b/ConnectionUtil/Properties/AssemblyInfo.cs
@@ -5,12 +5,12 @@
// 鏈夊叧绋嬪簭闆嗙殑涓�鑸俊鎭敱浠ヤ笅
// 鎺у埗銆傛洿鏀硅繖浜涚壒鎬у�煎彲淇敼
// 涓庣▼搴忛泦鍏宠仈鐨勪俊鎭��
-[assembly: AssemblyTitle("VisionBuilder.Engine")]
+[assembly: AssemblyTitle("ConnectionUtil")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("HP Inc.")]
-[assembly: AssemblyProduct("VisionBuilder.Engine")]
-[assembly: AssemblyCopyright("Copyright 漏 HP Inc. 2024")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("ConnectionUtil")]
+[assembly: AssemblyCopyright("Copyright 漏 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -20,7 +20,7 @@
[assembly: ComVisible(false)]
// 濡傛灉姝ら」鐩悜 COM 鍏紑锛屽垯涓嬪垪 GUID 鐢ㄤ簬绫诲瀷搴撶殑 ID
-[assembly: Guid("8e5e8a68-0b9d-4a6a-b325-730c64603fdf")]
+[assembly: Guid("d0806fa6-3f6d-4304-81b8-ead9da7cb5b2")]
// 绋嬪簭闆嗙殑鐗堟湰淇℃伅鐢变笅鍒楀洓涓�肩粍鎴�:
//
@@ -29,8 +29,5 @@
// 鐢熸垚鍙�
// 淇鍙�
//
-//鍙互鎸囧畾鎵�鏈夎繖浜涘�硷紝涔熷彲浠ヤ娇鐢ㄢ�滅敓鎴愬彿鈥濆拰鈥滀慨璁㈠彿鈥濈殑榛樿鍊�
-//閫氳繃浣跨敤 "*"锛屽涓嬫墍绀�:
-// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/ConnectionUtil/SCADAApi.cs b/ConnectionUtil/SCADAApi.cs
new file mode 100644
index 0000000..4252c73
--- /dev/null
+++ b/ConnectionUtil/SCADAApi.cs
@@ -0,0 +1,161 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Net.Sockets;
+
+namespace ConnectionUtil
+{
+ public interface SCADAApi : IDisposable
+ {
+ /// <summary>
+ /// 杩炴帴鏂规硶
+ /// </summary>
+ /// <param name="config"></param>
+ /// <param name="errMsg"></param>
+ /// <returns></returns>
+ bool Connect(object config, out string errMsg);
+ /// <summary>
+ /// IP杩炴帴Scada鏈嶅姟鍣�
+ /// </summary>
+ /// <param name="IP">MES鏈嶅姟鍣↖P</param>
+ /// <param name="Port"> MES鏈嶅姟鍣≒ort鍙�</param>
+ /// <param name="LocalIP">鏈湴杩炴帴IP</param>
+ /// <param name="LocalPort">鏈湴杩炴帴绔彛</param>
+ /// <returns></returns>
+ bool Connect(string IP, int Port, string LocalIP, int LocalPort);
+
+ /// <summary>
+ /// 杩炴帴Scada绠$悊鏈嶅姟鍣�
+ /// </summary>
+ /// <param name="IP"> Scada鏈嶅姟鍣↖P</param>
+ /// <param name="Port">ScadPort鍙�</param>
+ /// <param name="LocalPort">鏈湴杩炴帴绔彛</param>
+ /// <param name="errMsg"></param>
+ /// <param name="socket"></param>
+ /// <returns></returns>
+ bool Connect2(string IP, int Port, int LocalPort, out string errMsg, Socket socket = null);
+
+ /// <summary>
+ /// 杩炴帴Scada绠$悊鏈嶅姟鍣�
+ /// </summary>
+ /// <param name="IP">ScadaManagerIP</param>
+ /// <param name="Port">ScadaManagerPort鍙�</param>
+ /// <param name="LocalPort">鏈湴杩炴帴绔彛</param>
+ /// <param name="errMsg"></param>
+ /// <returns></returns>
+ bool ConnectManager(string IP, int Port, int LocalPort, out string errMsg);
+
+ /// <summary>
+ /// 鏂紑鏈嶅姟鍣ㄨ繛鎺�
+ /// </summary>
+ void DisConnect();
+
+ /// <summary>
+ /// 鎵归噺鍐欏鍔犲弬鏁�
+ /// </summary>
+ /// <param name="id"></param>
+ /// <param name="par"></param>
+ /// <returns></returns>
+ bool DoAddParWriteMultiple(int id, string par);
+
+ /// <summary>
+ /// 鎹㈠瀷
+ /// </summary>
+ /// <param name="_ProductLineName"></param>
+ /// <param name="_ProductName"></param>
+ /// <param name="errMsg"></param>
+ /// <param name="_WorkStationName"></param>
+ /// <returns></returns>
+ bool DoDoChangeModel(string _ProductLineName, string _ProductName, out string errMsg, string _WorkStationName = null);
+
+ /// <summary>
+ /// 鎵归噺璇诲��
+ /// </summary>
+ /// <param name="_Id"></param>
+ /// <returns></returns>
+ string[,] DoFctReadMultiple(int[] _Id);
+
+ /// <summary>
+ /// 鍗曚竴璇诲��
+ /// </summary>
+ /// <param name="_name"></param>
+ /// <param name="result"></param>
+ /// <param name="errMsg"></param>
+ /// <returns></returns>
+ bool DoFctReadSingle(string _name, out string result, out string errMsg);
+
+ /// <summary>
+ /// 鍗曚竴鍐欏��
+ /// </summary>
+ /// <param name="errMsg"></param>
+ /// <returns></returns>
+ bool DoFctWriteMultiple(out string errMsg);
+
+ /// <summary>
+ /// 鍐欏崟涓�鍊�
+ /// </summary>
+ /// <param name="_name"></param>
+ /// <param name="_value"></param>
+ /// <param name="errMsg"></param>
+ /// <returns></returns>
+ bool DoFctWriteSingle(string _name, string _value, out string errMsg);
+
+ /// <summary>
+ /// mqtt鍙戝竷娑堟伅
+ /// </summary>
+ /// <param name="topic">涓婚</param>
+ /// <param name="_value">鍊�</param>
+ /// <param name="errMsg">閿欒淇℃伅></param>
+ /// <returns></returns>
+ bool DoMqttPublish(string topic, string _value, out string errMsg);
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="_user"></param>
+ /// <param name="_password"></param>
+ /// <param name="errMsg"></param>
+ /// <returns></returns>
+ bool DoLogin(string _user, string _password, out string errMsg);
+
+ /// <summary>
+ /// 閲嶅惎DataServer鏈嶅姟鍣�
+ /// </summary>
+ /// <param name="errMsg"></param>
+ /// <returns></returns>
+ bool DoReSETDataServer(out string errMsg);
+
+ /// <summary>
+ /// 鑾峰彇鍔ㄦ�両P
+ /// </summary>
+ /// <returns></returns>
+ string getLocalIP();
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="_paraMPairs"></param>
+ /// <param name="errMsg"></param>
+ /// <returns></returns>
+ short[,] GetLowerComputerStatus(short[] _paraMPairs, out string errMsg);
+
+ /// <summary>
+ /// 鍒濆鍖栨壒閲忓啓鍙傛暟
+ /// </summary>
+ void InitParWriteMultiple();
+
+ /// <summary>
+ /// 妫�鏌ヤ笌LTSCADA鏄惁鏂紑杩炴帴浜�
+ /// </summary>
+ /// <param name="errMsg"></param>
+ /// <returns></returns>
+ bool IsConnected(out string errMsg);
+
+ /// <summary>
+ /// 鎵归噺鍐�
+ /// </summary>
+ /// <param name="_paraMPairs">鍙傛暟鍒楄〃</param>
+ /// <param name="errMsg">閿欒淇℃伅</param>
+ /// <returns>澶勭悊缁撴灉</returns>
+ bool ToFctWriteMultiple(Dictionary<int, string> _paraMPairs, out string errMsg);
+ }
+}
diff --git a/ConnectionUtil/TcpClient.cs b/ConnectionUtil/TcpClient.cs
new file mode 100644
index 0000000..33d6f72
--- /dev/null
+++ b/ConnectionUtil/TcpClient.cs
@@ -0,0 +1,254 @@
+锘縰sing System;
+using System.Net.Sockets;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace ConnectionUtil
+{
+ /// <summary>
+ /// TCP瀹㈡埛绔寘瑁呯被
+ /// </summary>
+ /// <summary>
+ /// TCP瀹㈡埛绔寘瑁呯被
+ /// </summary>
+ public class TcpClientWrapper : IDisposable
+ {
+ private System.Net.Sockets.TcpClient _client;
+ private NetworkStream _stream;
+ private readonly string _host;
+ private readonly int _port;
+ private bool _isConnected;
+ private readonly CancellationTokenSource _cts;
+ private Task _heartbeatTask;
+ private readonly SemaphoreSlim _sendReceiveLock;
+
+ /// <summary>
+ /// 鍒濆鍖朤CP瀹㈡埛绔�
+ /// </summary>
+ /// <param name="host">鏈嶅姟鍣ㄥ湴鍧�</param>
+ /// <param name="port">鏈嶅姟鍣ㄧ鍙�</param>
+ public TcpClientWrapper(string host = "127.0.0.1", int port = 6543)
+ {
+ _host = host;
+ _port = port;
+ _cts = new CancellationTokenSource();
+ _sendReceiveLock = new SemaphoreSlim(1, 1);
+ }
+
+ /// <summary>
+ /// 寮傛杩炴帴鍒版湇鍔″櫒
+ /// </summary>
+ /// <returns>杩炴帴鏄惁鎴愬姛</returns>
+ public async Task<bool> ConnectAsync()
+ {
+ try
+ {
+ _client = new System.Net.Sockets.TcpClient();
+ await _client.ConnectAsync(_host, _port);
+ _stream = _client.GetStream();
+ _isConnected = true;
+
+ // 鍚姩蹇冭烦浠诲姟
+ _heartbeatTask = StartHeartbeatAsync(_cts.Token);
+
+ Console.WriteLine($"鎴愬姛杩炴帴鍒版湇鍔″櫒 {_host}:{_port}");
+ return true;
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine($"杩炴帴鏈嶅姟鍣ㄥけ璐ワ細{ex.Message}");
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// 鍚屾杩炴帴鍒版湇鍔″櫒
+ /// </summary>
+ /// <returns>杩炴帴鏄惁鎴愬姛</returns>
+ public bool Connect()
+ {
+ try
+ {
+ _client = new System.Net.Sockets.TcpClient();
+ _client.Connect(_host, _port);
+ _stream = _client.GetStream();
+ _isConnected = true;
+
+ // 鍚姩蹇冭烦浠诲姟
+ _heartbeatTask = StartHeartbeatAsync(_cts.Token);
+ return true;
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine($"杩炴帴鏈嶅姟鍣ㄥけ璐ワ細{ex.Message}");
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// 鍚姩蹇冭烦妫�娴�
+ /// </summary>
+ private async Task StartHeartbeatAsync(CancellationToken token)
+ {
+ while (!token.IsCancellationRequested && _isConnected)
+ {
+ try
+ {
+ await Task.Delay(20000, token); // 20绉掑彂閫佷竴娆″績璺�
+ if (_isConnected)
+ {
+ await SendMessageAsync("ping");
+ }
+ }
+ catch (OperationCanceledException)
+ {
+ break;
+ }
+ catch (Exception)
+ {
+ _isConnected = false;
+ break;
+ }
+ }
+ }
+
+ /// <summary>
+ /// 鍙戦�佹秷鎭苟鎺ユ敹鍝嶅簲
+ /// </summary>
+ /// <typeparam name="T">鍝嶅簲鏁版嵁绫诲瀷</typeparam>
+ /// <param name="data">瑕佸彂閫佺殑鏁版嵁瀵硅薄</param>
+ /// <param name="timeout">瓒呮椂鏃堕棿</param>
+ /// <returns>鏈嶅姟鍣ㄥ搷搴旀暟鎹�</returns>
+ public async Task<string> SendMessageAsync(string message, TimeSpan? timeout = null)
+ {
+ if (!_isConnected)
+ {
+ throw new InvalidOperationException("鏈繛鎺ュ埌鏈嶅姟鍣�");
+ }
+
+ TimeSpan actualTimeout = timeout ?? TimeSpan.FromSeconds(30);
+
+ if (!await _sendReceiveLock.WaitAsync(actualTimeout))
+ {
+ throw new TimeoutException("绛夊緟鍙戦�佽秴鏃�");
+ }
+
+ try
+ {
+ byte[] messageBytes = Encoding.UTF8.GetBytes(message + "\r\n");
+
+ // 鍙戦�佹秷鎭�
+ await _stream.WriteAsync(messageBytes, 0, messageBytes.Length);
+
+ // 鎺ユ敹鍝嶅簲
+ byte[] buffer = new byte[1024];
+ StringBuilder response = new StringBuilder();
+ int bytesRead;
+
+ CancellationTokenSource cts = new CancellationTokenSource(actualTimeout);
+
+ try
+ {
+ // 璇诲彇鐩村埌閬囧埌鎹㈣绗�
+ while ((bytesRead = await _stream.ReadAsync(buffer, 0, buffer.Length)) > 0)
+ {
+ string received = Encoding.UTF8.GetString(buffer, 0, bytesRead);
+ response.Append(received);
+
+ if (received.EndsWith("\r\n"))
+ {
+ break;
+ }
+
+ if (cts.Token.IsCancellationRequested)
+ {
+ throw new TimeoutException("鎺ユ敹鍝嶅簲瓒呮椂");
+ }
+ }
+ }
+ finally
+ {
+ cts.Dispose();
+ }
+
+ string jsonResponse = response.ToString().TrimEnd('\r', '\n');
+ Console.WriteLine($"鏀跺埌鏈嶅姟鍣ㄥ搷搴旓細{jsonResponse}");
+
+ // 鍙嶅簭鍒楀寲鍝嶅簲
+ return jsonResponse;
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine($"鍙戦�佹秷鎭け璐ワ細{ex.Message}");
+ _isConnected = false;
+ throw;
+ }
+ finally
+ {
+ _sendReceiveLock.Release();
+ }
+ }
+
+ /// <summary>
+ /// 鍚屾鍙戦�佹秷鎭苟鎺ユ敹鍝嶅簲
+ /// </summary>
+ /// <typeparam name="T">鍝嶅簲鏁版嵁绫诲瀷</typeparam>
+ /// <param name="data">瑕佸彂閫佺殑鏁版嵁瀵硅薄</param>
+ /// <param name="timeout">瓒呮椂鏃堕棿</param>
+ /// <returns>鏈嶅姟鍣ㄥ搷搴旀暟鎹�</returns>
+ public string SendMessage(string message, TimeSpan? timeout = null)
+ {
+ timeout = timeout ?? TimeSpan.FromSeconds(30);
+
+ try
+ {
+ // 浣跨敤 Task.Run 鏉ユ墽琛屽紓姝ユ搷浣滐紝骞剁瓑寰呯粨鏋�
+ return Task.Run(() => SendMessageAsync(message, timeout)).Result;
+ }
+ catch (AggregateException ae)
+ {
+ // 瑙e寘寮傚父
+ throw ae.InnerException;
+ }
+ }
+
+ /// <summary>
+ /// 妫�鏌ユ槸鍚﹀凡杩炴帴
+ /// </summary>
+ public bool IsConnected
+ {
+ get { return _isConnected; }
+ }
+
+ /// <summary>
+ /// 閲婃斁璧勬簮
+ /// </summary>
+ public void Dispose()
+ {
+ _cts.Cancel();
+ _isConnected = false;
+ if (_stream != null)
+ {
+ _stream.Dispose();
+ }
+ if (_client != null)
+ {
+ _client.Dispose();
+ }
+ _cts.Dispose();
+ if (_sendReceiveLock != null)
+ {
+ _sendReceiveLock.Dispose();
+ }
+ }
+
+ /// <summary>
+ /// 鍏抽棴杩炴帴
+ /// </summary>
+ public void Close()
+ {
+ Dispose();
+ }
+ }
+}
diff --git a/ConsoleTest/ConsoleTest.csproj b/ConsoleTest/ConsoleTest.csproj
index fbd16a4..3f9abd7 100644
--- a/ConsoleTest/ConsoleTest.csproj
+++ b/ConsoleTest/ConsoleTest.csproj
@@ -32,6 +32,26 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>bin\x64\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DebugType>full</DebugType>
+ <PlatformTarget>x64</PlatformTarget>
+ <LangVersion>7.3</LangVersion>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+ <OutputPath>bin\x64\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <Optimize>true</Optimize>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>x64</PlatformTarget>
+ <LangVersion>7.3</LangVersion>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -48,12 +68,21 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
+ <None Include="Properties\app.manifest" />
</ItemGroup>
<ItemGroup>
+ <ProjectReference Include="..\..\ModBusTcpController\ModBusTcpController\ModBusTcpController.csproj">
+ <Project>{49db0c9b-b239-4608-a91e-f5ed43afaf96}</Project>
+ <Name>ModBusTcpController</Name>
+ </ProjectReference>
<ProjectReference Include="..\SimpleUtil\DIOController\DIOController.csproj">
<Project>{34ffbafe-478f-4b6e-95e7-92a949011a9b}</Project>
<Name>DIOController</Name>
</ProjectReference>
+ <ProjectReference Include="..\SimpleUtil\HMI.Util.Base\HMI.Util.Base.csproj">
+ <Project>{d59e25d1-9b27-46a1-8438-92661dd23fae}</Project>
+ <Name>HMI.Util.Base</Name>
+ </ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
diff --git a/ConsoleTest/Program.cs b/ConsoleTest/Program.cs
index 17776f2..24dac3b 100644
--- a/ConsoleTest/Program.cs
+++ b/ConsoleTest/Program.cs
@@ -1,4 +1,5 @@
-锘縰sing DIOController;
+锘縰sing HMI.Util.Base;
+using ModBusTcp;
using System;
using System.Text;
@@ -8,6 +9,26 @@
{
static void Main(string[] args)
{
+ string msg;
+ ModBusTcpController controller = new ModBusTcpController("127.0.0.1", 502);
+ if (controller.Start(out msg))
+ {
+ bool res;
+ int? target;
+
+ controller.WriteBool("1", true, out msg);
+ controller.ReadDOBool("1", out res, out msg);
+ Console.WriteLine(res);
+ controller.ReadDOInt("1", out target, out msg);
+ Console.WriteLine(target);
+ controller.WriteInt("1", 1, out msg);
+ controller.ReadDOInt("1", out target, out msg);
+ Console.WriteLine(target);
+ }
+ controller.Close();
+
+ //AlarmUtil.GetProcessIdByName("TestPlatform");
+
/// ModbusTcp
//IDIOController controller = DIOControllerCreator
// .CreateController("C:\\Workspace\\VisualStudio\\WPFProject\\SimpleUtil\\DIOController\\bin\\Release\\modbus.ini");
@@ -30,17 +51,17 @@
//controller.ReadDOBool("0", out res, out msg);
//controller.WriteBool("0", true, out msg);
//controller.Dispose();
- string recvstr = "62 FD 82 39 39 39 37 32 32 36 36 30 38 34 33 39 35 33 38 53 38 44 41 30 30 32 32";
- string recvData;
- if (recvstr.Contains("FF"))
- {
- recvData = recvstr.Replace(" ", "").Substring(6);
- }
- else
- {
- byte[] bus = HexToByteArray(recvstr.Replace(" ", "").Substring(6));
- recvData = Encoding.Default.GetString(bus);
- }
+ //string recvstr = "62 FD 82 39 39 39 37 32 32 36 36 30 38 34 33 39 35 33 38 53 38 44 41 30 30 32 32";
+ //string recvData;
+ //if (recvstr.Contains("FF"))
+ //{
+ // recvData = recvstr.Replace(" ", "").Substring(6);
+ //}
+ //else
+ //{
+ // byte[] bus = HexToByteArray(recvstr.Replace(" ", "").Substring(6));
+ // recvData = Encoding.Default.GetString(bus);
+ //}
}
public static byte[] HexToByteArray(string hexString)
diff --git a/ConsoleTest/Properties/app.manifest b/ConsoleTest/Properties/app.manifest
new file mode 100644
index 0000000..e1175ad
--- /dev/null
+++ b/ConsoleTest/Properties/app.manifest
@@ -0,0 +1,73 @@
+锘�<?xml version="1.0" encoding="utf-8"?>
+<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
+ <assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+ <security>
+ <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
+ <!-- UAC 娓呭崟閫夐」
+ 濡傛灉鎯宠鏇存敼 Windows 鐢ㄦ埛甯愭埛鎺у埗绾у埆锛岃浣跨敤
+ 浠ヤ笅鑺傜偣涔嬩竴鏇挎崲 requestedExecutionLevel 鑺傜偣銆�
+
+ <requestedExecutionLevel level="asInvoker" uiAccess="false" />
+ <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
+ <requestedExecutionLevel level="highestAvailable" uiAccess="false" />
+
+ 鎸囧畾 requestedExecutionLevel 鍏冪礌灏嗙鐢ㄦ枃浠跺拰娉ㄥ唽琛ㄨ櫄鎷熷寲銆�
+ 濡傛灉浣犵殑搴旂敤绋嬪簭闇�瑕佹铏氭嫙鍖栨潵瀹炵幇鍚戝悗鍏煎鎬э紝鍒欑Щ闄ゆ
+ 鍏冪礌銆�
+ -->
+ <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
+ </requestedPrivileges>
+ <applicationRequestMinimum>
+ <defaultAssemblyRequest permissionSetReference="Custom" />
+ <PermissionSet class="System.Security.PermissionSet" version="1" ID="Custom" SameSite="site" Unrestricted="true" />
+ </applicationRequestMinimum>
+ </security>
+ </trustInfo>
+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <application>
+ <!-- 璁捐姝ゅ簲鐢ㄧ▼搴忎笌鍏朵竴璧峰伐浣滀笖宸查拡瀵规搴旂敤绋嬪簭杩涜娴嬭瘯鐨�
+ Windows 鐗堟湰鐨勫垪琛ㄣ�傚彇娑堣瘎璁洪�傚綋鐨勫厓绱狅紝
+ Windows 灏嗚嚜鍔ㄩ�夋嫨鏈�鍏煎鐨勭幆澧冦�� -->
+ <!-- Windows Vista -->
+ <!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
+ <!-- Windows 7 -->
+ <!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
+ <!-- Windows 8 -->
+ <!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
+ <!-- Windows 8.1 -->
+ <!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
+ <!-- Windows 10 -->
+ <!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
+ </application>
+ </compatibility>
+ <!-- 鎸囩ず璇ュ簲鐢ㄧ▼搴忓彲鎰熺煡 DPI 涓� Windows 鍦� DPI 杈冮珮鏃跺皢涓嶄細瀵瑰叾杩涜
+ 鑷姩缂╂斁銆俉indows Presentation Foundation (WPF)搴旂敤绋嬪簭鑷姩鎰熺煡 DPI锛屾棤闇�
+ 閫夋嫨鍔犲叆銆傞�夋嫨鍔犲叆姝よ缃殑 Windows 绐椾綋搴旂敤绋嬪簭(闈㈠悜 .NET Framework 4.6)杩樺簲
+ 鍦ㄥ叾 app.config 涓皢 "EnableWindowsFormsHighDpiAutoResizing" 璁剧疆璁剧疆涓� "true"銆�
+
+ 灏嗗簲鐢ㄧ▼搴忚涓烘劅鐭ラ暱璺緞銆傝鍙傞槄 https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
+ <!--
+ <application xmlns="urn:schemas-microsoft-com:asm.v3">
+ <windowsSettings>
+ <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
+ <longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
+ </windowsSettings>
+ </application>
+ -->
+ <!-- 鍚敤 Windows 鍏叡鎺т欢鍜屽璇濇鐨勪富棰�(Windows XP 鍜屾洿楂樼増鏈�) -->
+ <!--
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity
+ type="win32"
+ name="Microsoft.Windows.Common-Controls"
+ version="6.0.0.0"
+ processorArchitecture="*"
+ publicKeyToken="6595b64144ccf1df"
+ language="*"
+ />
+ </dependentAssembly>
+ </dependency>
+ -->
+</assembly>
\ No newline at end of file
diff --git a/HMI.AlermInfoManage/AlarmInfoManage.xaml.cs b/HMI.AlermInfoManage/AlarmInfoManage.xaml.cs
index b43bacd..1cf4db1 100644
--- a/HMI.AlermInfoManage/AlarmInfoManage.xaml.cs
+++ b/HMI.AlermInfoManage/AlarmInfoManage.xaml.cs
@@ -93,7 +93,40 @@
/// <summary>
/// 浠g爜绠$悊
/// </summary>
- private ObservableCollection<AlarmSetting> alarmSettings = new ObservableCollection<AlarmSetting>();
+ private ObservableCollection<AlarmSetting> blockAlarmSettings = new ObservableCollection<AlarmSetting>();
+
+ public ObservableCollection<AlarmSetting> BlockAlarmSettings
+ {
+ get => blockAlarmSettings;
+ set
+ {
+ blockAlarmSettings = value;
+ RefreshBlockCache();
+ }
+ }
+ private Dictionary<string, Dictionary<string, string>> BlockMap = new Dictionary<string, Dictionary<string, string>>();
+ private Dictionary<string, string> BlockReadCache = new Dictionary<string, string>();
+
+ private void RefreshBlockCache()
+ {
+ BlockMap.Clear();
+ BlockReadCache.Clear();
+ if (BlockAlarmSettings == null || BlockAlarmSettings.Count <= 0)
+ {
+ return;
+ }
+ foreach (var setting in BlockAlarmSettings)
+ {
+ string key = $"{setting.DBAddress}.{setting.StartAddress}";
+ if (!BlockMap.ContainsKey(key))
+ {
+ BlockMap[key] = new Dictionary<string, string>();
+ }
+ var codes = BlockMap[key];
+ codes[setting.AlarmCode] = setting.Description;
+ }
+ }
+
// <summary>
/// 鏍囧織浣嶆姤璀︾鐞�
/// </summary>
@@ -104,7 +137,7 @@
/// </summary>
private List<AlarmText> currentAlarmCachePlcToMain = new List<AlarmText>();
- private AlarmText alarm;
+ //private AlarmText alarm;
private SystemSetting systemSetting;
private ObservableCollection<AlarmText> datasource = new ObservableCollection<AlarmText>();
@@ -186,7 +219,7 @@
MonitorTimer = new Timer
{
- Interval = 100,
+ Interval = 1000,
};
MonitorTimer.Elapsed += MonitorTimer_Elapsed;
if (!lTSCADAApi.Connect2(opcIP, opcPort, localPort, out string errMsg))
@@ -200,7 +233,7 @@
PcTimer = new Timer
{
- Interval = 100,
+ Interval = 1000,
AutoReset = false
};
PcTimer.Elapsed += PcTimer_Elapsed;
@@ -239,12 +272,12 @@
private void OpenSettingWindow()
{
- AlarmSettingList listModal = new AlarmSettingList(blockPath, markPath,alarmSettings,markAlarmSetting, log)
+ AlarmSettingList listModal = new AlarmSettingList(blockPath, markPath, BlockAlarmSettings, markAlarmSetting, log)
{
Owner = Window.GetWindow(this)
};
listModal.ShowDialog();
- alarmSettings = listModal.Datasource;
+ BlockAlarmSettings = listModal.Datasource;
markAlarmSetting = listModal.MarkDatasource;
}
@@ -420,12 +453,12 @@
{
try
{
- alarmSettings = XmlHelper.DeserializeFromXml<ObservableCollection<AlarmSetting>>(blockPath);
+ BlockAlarmSettings = XmlHelper.DeserializeFromXml<ObservableCollection<AlarmSetting>>(blockPath);
}
catch (Exception ex)
{
log.Error("LoadAlarmSetting Error.", ex);
- alarmSettings = new ObservableCollection<AlarmSetting>();
+ BlockAlarmSettings = new ObservableCollection<AlarmSetting>();
}
try
@@ -469,7 +502,8 @@
case "AlarmCode":
AlarmText aalarm = AlarmTexts.FirstOrDefault(alarm => alarm.AlarmCode == MsgStr);
if (aalarm == null) break;
- var data = new AlarmText {
+ var data = new AlarmText
+ {
Source = "PC",
AlarmCode = aalarm.AlarmCode,
AlarmInfo = aalarm.MAlarmText_CN,
@@ -596,6 +630,11 @@
// }
//}
+ /// <summary>
+ /// PLC鎶ヨ璇诲彇
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
private void MonitorTimer_Elapsed(object sender, ElapsedEventArgs e)
{
try
@@ -614,26 +653,51 @@
isHaveAlarm = false;
List<AlarmText> cache = new List<AlarmText>();
- foreach (var item in alarmSettings)
+ //foreach (var item in BlockAlarmSettings)
+ //{
+ // var name = $"{item.DBAddress}.{item.StartAddress}";
+ // if (lTSCADAApi.DoFctReadSingle(name, out string alarmCode, out errMsg) && alarmCode != "0")
+ // {
+ // isHaveAlarm = true;
+ // if (!textMap.TryGetValue(alarmCode, out alarm)) {
+ // continue;
+ // }
+ // var newAlarm = new AlarmText
+ // {
+ // Source = "PLC",
+ // AlarmCode = alarm.AlarmCode,
+ // ModuleName_CN = alarm.ModuleName_CN,
+ // MAlarmText_CN = alarm.MAlarmText_CN,
+ // Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
+ // AlarmInfo = $"{alarm.ModuleName_CN} {alarm.MAlarmText_CN}"
+ // };
+ // if (this.currentAlarmCachePlc
+ // .Find(alarm => alarm.AlarmCode == newAlarm.AlarmCode) == null)
+ // {
+ // this.currentAlarmCachePlc.Add(newAlarm);
+ // }
+ // }
+ //}
+
+ foreach (var key in BlockMap.Keys)
{
- var name = $"{item.DBAddress}.{item.StartAddress}";
- if (lTSCADAApi.DoFctReadSingle(name, out string alarmCode, out errMsg) && alarmCode != "0")
+ if (lTSCADAApi.DoFctReadSingle(key, out string alarmCode, out errMsg) && BlockMap[key].ContainsKey(alarmCode))
{
+ //if(BlockReadCache.ContainsKey(key) && alarmCode)
isHaveAlarm = true;
- if (!textMap.TryGetValue(alarmCode, out alarm)) {
- continue;
- }
+ var text = BlockMap[key][alarmCode];
var newAlarm = new AlarmText
{
+ PLC_DB_BLOCK = key,
Source = "PLC",
- AlarmCode = alarm.AlarmCode,
- ModuleName_CN = alarm.ModuleName_CN,
- MAlarmText_CN = alarm.MAlarmText_CN,
+ AlarmCode = alarmCode,
+ ModuleName_CN = text,
+ MAlarmText_CN = text,
Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
- AlarmInfo = $"{alarm.ModuleName_CN} {alarm.MAlarmText_CN}"
+ AlarmInfo = $"{alarmCode} {text}"
};
if (this.currentAlarmCachePlc
- .Find(alarm => alarm.AlarmCode == newAlarm.AlarmCode) == null)
+ .Find(alarm => alarm.AlarmCode == newAlarm.AlarmCode && alarm.PLC_DB_BLOCK == newAlarm.PLC_DB_BLOCK) == null)
{
this.currentAlarmCachePlc.Add(newAlarm);
}
@@ -671,7 +735,7 @@
}
finally
{
- if(!isClosing) this.MonitorTimer.Enabled = true;
+ if (!isClosing) this.MonitorTimer.Enabled = true;
}
}
@@ -681,7 +745,7 @@
private void RefreshDBSetting()
{
List<byte> bytes = new List<byte>();
- foreach (var item in alarmSettings)
+ foreach (var item in BlockAlarmSettings)
{
//byte[] itemalarmCodeBytes = this.plc.Simens_S7_ReadBytes_DB("DB", item.DBAddress, item.StartAddress, item.Length);
//bytes.AddRange(itemalarmCodeBytes.ToList());
@@ -719,16 +783,6 @@
}
}
this.currentAlarmCachePc.Clear();
- }
-
- /// <summary>
- /// 鍙戦�佹棩蹇楁秷鎭�
- /// </summary>
- /// <param name="Msg">鏃ュ織娑堟伅</param>
- private void SendLogMsg(string Msg)
- {
- string LogMsg = "{\"Type\":\"Alarm\",\"Source\":\"" + alarm.Source + "\",\"Msg\":\"" + Msg + "\",\"Time\":\"" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "\"}";
- this.loggeralarm.Send("Log", LogMsg);
}
}
}
diff --git a/HMI.AlermInfoManage/AlarmSettingList.xaml b/HMI.AlermInfoManage/AlarmSettingList.xaml
index 573554d..bb28e0f 100644
--- a/HMI.AlermInfoManage/AlarmSettingList.xaml
+++ b/HMI.AlermInfoManage/AlarmSettingList.xaml
@@ -85,7 +85,7 @@
</GridViewColumn.CellTemplate>
</GridViewColumn>
- <GridViewColumn Width="300">
+ <GridViewColumn Width="100">
<GridViewColumn.Header>
<TextBlock Text="{DynamicResource Alm.DbAddress}"/>
</GridViewColumn.Header>
@@ -98,7 +98,7 @@
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
- <GridViewColumn Width="200">
+ <GridViewColumn Width="150">
<GridViewColumn.Header>
<TextBlock Text="{DynamicResource Alm.StartAddress}"/>
</GridViewColumn.Header>
@@ -111,7 +111,7 @@
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
- <GridViewColumn Width="200">
+ <GridViewColumn Width="100">
<GridViewColumn.Header>
<TextBlock Text="{DynamicResource Alm.DbLength}"/>
</GridViewColumn.Header>
@@ -124,6 +124,35 @@
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
+
+ <GridViewColumn Width="150">
+ <GridViewColumn.Header>
+ <TextBlock Text="鎶ヨ浠g爜"/>
+ </GridViewColumn.Header>
+ <GridViewColumn.CellTemplate>
+ <DataTemplate>
+ <Border Style="{StaticResource CellBorder}">
+ <TextBlock Style="{StaticResource ListTableTextBlock}"
+ Text="{Binding AlarmCode}"/>
+ </Border>
+ </DataTemplate>
+ </GridViewColumn.CellTemplate>
+ </GridViewColumn>
+
+ <GridViewColumn Width="250">
+ <GridViewColumn.Header>
+ <TextBlock Text="鎶ヨ鏂囨湰"/>
+ </GridViewColumn.Header>
+ <GridViewColumn.CellTemplate>
+ <DataTemplate>
+ <Border Style="{StaticResource CellBorder}">
+ <TextBlock Style="{StaticResource ListTableTextBlock}"
+Text="{Binding Description}"/>
+ </Border>
+ </DataTemplate>
+ </GridViewColumn.CellTemplate>
+ </GridViewColumn>
+
<GridViewColumn Width="120">
<GridViewColumn.Header>
<TextBlock Text="{DynamicResource App.Opt}"/>
diff --git a/HMI.AlermInfoManage/Entity/AlarmSetting.cs b/HMI.AlermInfoManage/Entity/AlarmSetting.cs
index 1ca7090..1978e74 100644
--- a/HMI.AlermInfoManage/Entity/AlarmSetting.cs
+++ b/HMI.AlermInfoManage/Entity/AlarmSetting.cs
@@ -25,6 +25,9 @@
[ExcelColumn("闀垮害")]
public int Length { get; set; }
+ [ExcelColumn("鎶ヨ浠g爜")]
+ public string AlarmCode { get; set; }
+
[ExcelColumn("鎶ヨ鎻忚堪")]
public string Description { get; set; }
}
diff --git a/HMI.AlermInfoManage/Entity/AlarmText.cs b/HMI.AlermInfoManage/Entity/AlarmText.cs
index ea746d4..7f54c98 100644
--- a/HMI.AlermInfoManage/Entity/AlarmText.cs
+++ b/HMI.AlermInfoManage/Entity/AlarmText.cs
@@ -67,5 +67,8 @@
/// </summary>
[XmlIgnore]
public string Source { get; set; }
+
+ [XmlIgnore]
+ public string PLC_DB_BLOCK { get; set; }
}
}
diff --git a/HMI.AlermInfoManage/HMI.AlarmInfoManage.csproj b/HMI.AlermInfoManage/HMI.AlarmInfoManage.csproj
index c888b53..5d76130 100644
--- a/HMI.AlermInfoManage/HMI.AlarmInfoManage.csproj
+++ b/HMI.AlermInfoManage/HMI.AlarmInfoManage.csproj
@@ -155,6 +155,7 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
+ <None Include="app.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
@@ -162,8 +163,8 @@
</None>
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\..\ConnectionUtil\ConnectionUtil\ConnectionUtil.csproj">
- <Project>{D0806FA6-3F6D-4304-81B8-EAD9DA7CB5B2}</Project>
+ <ProjectReference Include="..\ConnectionUtil\ConnectionUtil.csproj">
+ <Project>{d0806fa6-3f6d-4304-81b8-ead9da7cb5b2}</Project>
<Name>ConnectionUtil</Name>
</ProjectReference>
<ProjectReference Include="..\HMI.Base\HMI.Base.csproj">
diff --git a/HMI.AlermInfoManage/app.config b/HMI.AlermInfoManage/app.config
new file mode 100644
index 0000000..a0cefc2
--- /dev/null
+++ b/HMI.AlermInfoManage/app.config
@@ -0,0 +1,11 @@
+锘�<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
+</configuration>
\ No newline at end of file
diff --git a/HMI.Core/Setting/SystemSetting.cs b/HMI.Core/Setting/SystemSetting.cs
index b7d76cf..319af95 100644
--- a/HMI.Core/Setting/SystemSetting.cs
+++ b/HMI.Core/Setting/SystemSetting.cs
@@ -27,7 +27,8 @@
public string LogoPath { get; private set; } = ".\\JingCeLogo.png";
public string WindowTitle { get; private set; } = "浜у搧娴嬭瘯骞冲彴";
- public string PlcIp { get; private set; }
+ public string PlcIp { get; private set; } = "127.0.0.1";
+ public int PlcPort { get; private set; } = 102;
public bool PlcEnabled { get; private set; }
public string CurrentLanguage { get; private set; } = "zh-CN";
public int LogExpiredDays { get; private set; } = 7;
@@ -94,6 +95,13 @@
set { Set(ref plcIp, value); }
}
+ private int plcPort;
+ public int PlcPort
+ {
+ get => plcPort;
+ set { Set(ref plcPort, value); }
+ }
+
private bool plcEnabled;
public bool PlcEnabled
{
diff --git a/HMI.DataViewer/DataViewer.xaml.cs b/HMI.DataViewer/DataViewer.xaml.cs
index bad13fc..cd1a970 100644
--- a/HMI.DataViewer/DataViewer.xaml.cs
+++ b/HMI.DataViewer/DataViewer.xaml.cs
@@ -176,7 +176,7 @@
Map.Clear();
foreach (var data in settings)
{
- Map.Add(data.Program, data);
+ Map[data.Program] = data;
names.Add(data.Program);
}
programInput.ItemsSource = names;
diff --git a/HMI.IOMonitor/Entity/DIO.cs b/HMI.IOMonitor/Entity/DIO.cs
deleted file mode 100644
index a0ef04c..0000000
--- a/HMI.IOMonitor/Entity/DIO.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-锘縰sing HMI.Core.Entity;
-using System;
-
-namespace HMI.IOMonitor.Entity
-{
- /// <summary>
- /// DIO灞炴�х被
- /// </summary>
- [Serializable]
- public class DIO :NotifyBase
- {
- public DIO()
- {
- }
- /// <summary>
- /// 鏋勯�犲嚱鏁�
- /// </summary>
- /// <param name="diotype">DIO绫诲瀷</param>
- /// <param name="name">DIO鍚嶇О</param>
- /// <param name="no">DIO缂栧彿</param>
- /// <param name="value">DIO鐨勫��</param>
- public DIO(string diotype, string name, string no, bool value)
- {
- this.DIOType = diotype;
- this.Name = name;
- this.No = no;
- this.Value = value;
- }
-
-
- /// <summary>
- /// DIO绫诲瀷
- /// </summary>
- private string dIOType;
- public string DIOType { get => dIOType; set { Set(ref dIOType, value); } }
-
- /// <summary>
- /// 绾紪鍙�
- /// </summary>
- private decimal dioNo;
- public decimal DIO_No { get => dioNo; set { Set(ref dioNo, value); } }
-
- /// <summary>
- /// 鍚嶇О
- /// </summary>
- private string name;
- public string Name { get => name; set { Set(ref name, value); } }
-
- /// <summary>
- /// DIO缂栧彿
- /// </summary>
- public string No { get; set; }
-
- ////[XmlIgnore]
-
- /// <summary>
- /// DIO鐨勫��
- /// </summary>
- public bool Value { get; set; }
- }
-}
diff --git a/HMI.IOMonitor/Entity/IPManage.cs b/HMI.IOMonitor/Entity/IPManage.cs
deleted file mode 100644
index cffec4c..0000000
--- a/HMI.IOMonitor/Entity/IPManage.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-锘縩amespace HMI.IOMonitor.Entity
-{
- /// <summary>
- /// IP绠$悊绫�
- /// </summary>
- public class IPManage
- {
- /// <summary>
- /// itag
- /// </summary>
- public string DItag { get; set; }
-
- /// <summary>
- /// qtag
- /// </summary>
- public string DQtag { get; set; }
- }
-}
diff --git a/HMI.IOMonitor/HMI.IOMonitor.csproj b/HMI.IOMonitor/HMI.IOMonitor.csproj
deleted file mode 100644
index 9600002..0000000
--- a/HMI.IOMonitor/HMI.IOMonitor.csproj
+++ /dev/null
@@ -1,167 +0,0 @@
-<?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>{F7663C79-7047-42F3-B129-73A2575EE7C6}</ProjectGuid>
- <OutputType>library</OutputType>
- <RootNamespace>HMI.IOMonitor</RootNamespace>
- <AssemblyName>HMI.IOMonitor</AssemblyName>
- <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <WarningLevel>4</WarningLevel>
- <Deterministic>true</Deterministic>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\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>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
- <DebugSymbols>true</DebugSymbols>
- <OutputPath>bin\x64\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <DebugType>full</DebugType>
- <PlatformTarget>x64</PlatformTarget>
- <LangVersion>7.3</LangVersion>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
- <OutputPath>bin\x64\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <Optimize>true</Optimize>
- <DebugType>pdbonly</DebugType>
- <PlatformTarget>x64</PlatformTarget>
- <LangVersion>7.3</LangVersion>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="ICSharpCode.SharpZipLib, Version=1.0.0.999, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\SharpZipLib.1.0.0\lib\net45\ICSharpCode.SharpZipLib.dll</HintPath>
- </Reference>
- <Reference Include="log4net, Version=3.0.4.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\log4net.3.0.4\lib\net462\log4net.dll</HintPath>
- </Reference>
- <Reference Include="NPOI, Version=2.4.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\NPOI.2.4.1\lib\net45\NPOI.dll</HintPath>
- </Reference>
- <Reference Include="NPOI.OOXML, Version=2.4.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\NPOI.2.4.1\lib\net45\NPOI.OOXML.dll</HintPath>
- </Reference>
- <Reference Include="NPOI.OpenXml4Net, Version=2.4.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\NPOI.2.4.1\lib\net45\NPOI.OpenXml4Net.dll</HintPath>
- </Reference>
- <Reference Include="NPOI.OpenXmlFormats, Version=2.4.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\NPOI.2.4.1\lib\net45\NPOI.OpenXmlFormats.dll</HintPath>
- </Reference>
- <Reference Include="Panuon.WPF, Version=1.1.2.2, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\Panuon.WPF.1.1.3\lib\net472\Panuon.WPF.dll</HintPath>
- </Reference>
- <Reference Include="Panuon.WPF.UI, Version=1.3.0.2, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\Panuon.WPF.UI.1.3.0.2\lib\net472\Panuon.WPF.UI.dll</HintPath>
- </Reference>
- <Reference Include="SimensDriver">
- <HintPath>..\Libs\SimensDriver.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Configuration" />
- <Reference Include="System.Data" />
- <Reference Include="System.Web" />
- <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>
- <Page Include="IPManageModal.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="IOMonitor.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Compile Include="IPManageModal.xaml.cs">
- <DependentUpon>IPManageModal.xaml</DependentUpon>
- </Compile>
- <Compile Include="Entity\DIO.cs" />
- <Compile Include="Entity\IPManage.cs" />
- <Compile Include="IOMonitor.xaml.cs">
- <DependentUpon>IOMonitor.xaml</DependentUpon>
- <SubType>Code</SubType>
- </Compile>
- </ItemGroup>
- <ItemGroup>
- <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>
- <EmbeddedResource Include="Properties\Resources.resx">
- <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>
- <ProjectReference Include="..\..\ConnectionUtil\ConnectionUtil\ConnectionUtil.csproj">
- <Project>{D0806FA6-3F6D-4304-81B8-EAD9DA7CB5B2}</Project>
- <Name>ConnectionUtil</Name>
- </ProjectReference>
- <ProjectReference Include="..\HMI.Base\HMI.Base.csproj">
- <Project>{2a6f9720-a890-4036-9d73-41a0dae28341}</Project>
- <Name>HMI.Base</Name>
- </ProjectReference>
- <ProjectReference Include="..\HMI.Core\HMI.Core.csproj">
- <Project>{3e3bf44a-0b69-45c5-9512-528cb48a7106}</Project>
- <Name>HMI.Core</Name>
- </ProjectReference>
- <ProjectReference Include="..\HMI.UI\HMI.UI.csproj">
- <Project>{f17de6b5-af1d-48c6-94a0-6b763a6546a6}</Project>
- <Name>HMI.UI</Name>
- </ProjectReference>
- <ProjectReference Include="..\OPCClient\OPCClient.csproj">
- <Project>{e5740bb5-9fc6-4a20-b7c2-cc90c281ed05}</Project>
- <Name>OPCClient</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <PropertyGroup>
- <PostBuildEvent>
- </PostBuildEvent>
- </PropertyGroup>
-</Project>
\ No newline at end of file
diff --git a/HMI.IOMonitor/IOMonitor.xaml b/HMI.IOMonitor/IOMonitor.xaml
deleted file mode 100644
index 5980e34..0000000
--- a/HMI.IOMonitor/IOMonitor.xaml
+++ /dev/null
@@ -1,216 +0,0 @@
-锘�<hb:PluginControl x:Class="HMI.IOMonitor.IOMonitor"
- 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:hb="clr-namespace:HMI.Base;assembly=HMI.Base"
- xmlns:local="clr-namespace:HMI.IOMonitor"
- xmlns:uic="clr-namespace:HMI.UI.Converter;assembly=HMI.UI"
- xmlns:ui="clr-namespace:HMI.UI;assembly=HMI.UI"
- xmlns:pw="https://opensource.panuon.com/wpf"
- xmlns:pu="https://opensource.panuon.com/wpf-ui"
- xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
- mc:Ignorable="d"
- Loaded="UserControl_Loaded"
- Background="{StaticResource WorkspaceBackground}"
- d:DesignHeight="450" d:DesignWidth="800">
-
- <UserControl.Resources>
- <Style TargetType="Label">
- <Setter Property="VerticalContentAlignment" Value="Center"/>
- <Setter Property="VerticalAlignment" Value="Center"/>
- </Style>
- <CollectionViewSource x:Key="disFilter" Source="{Binding Dis}" Filter="CollectionViewSource_Filter"/>
- <CollectionViewSource x:Key="dosFilter" Source="{Binding Dos}" Filter="CollectionViewSource_Filter"/>
- </UserControl.Resources>
-
- <Border Grid.Row="1" Style="{StaticResource CardBoarder}">
- <Grid dp:GridHelper.Space="10">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="5*"/>
- <ColumnDefinition Width="5*"/>
- </Grid.ColumnDefinitions>
-
- <DockPanel Grid.Row="0" Grid.ColumnSpan="2">
- <StackPanel DockPanel.Dock="Right" Style="{StaticResource ButtonGroup}">
- <Button Style="{StaticResource AddBtn}" x:Name="addBtn" Click="Button_Click"/>
- <Button Style="{StaticResource ImportBtn}" x:Name="importBtn" Click="Button_Click"/>
- </StackPanel>
-
- <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center"
- FontSize="{StaticResource TitleFontSize}" Text="{DynamicResource DIO.Title}"/>
- </DockPanel>
-
- <Border Grid.Row="1" Style="{StaticResource CardBoarder}" Padding="0">
- <Grid dp:GridHelper.Space="10">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition />
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition Width="Auto"/>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
-
- <Label Grid.Row="0" Grid.Column="0" Content="{DynamicResource DIO.di.Name}"
- FontSize="{StaticResource ContentFontSize}"/>
- <ComboBox Grid.Row="0" Grid.Column="1" x:Name="diName"
- IsEditable="True" Style="{StaticResource FormComboxStyle}"/>
-
- <Button Style="{StaticResource PrimaryButton}" Grid.Row="0" Grid.Column="2"
- x:Name="diSelect" Click="Button_Click"
- Content="{DynamicResource DIO.di.Query}"/>
- <Button Style="{StaticResource PrimaryButton}" Grid.Row="0" Grid.Column="3"
- x:Name="diReset" Click="Button_Click"
- Content="{DynamicResource DIO.di.Reset}"/>
-
- <Label Grid.Row="1" Grid.Column="0" Content="{DynamicResource DIO.di.Code}"
- FontSize="{StaticResource ContentFontSize}"/>
- <ComboBox Grid.Row="1" Grid.Column="1" x:Name="diCode"
- IsEditable="True"
- Style="{StaticResource FormComboxStyle}"/>
-
- <Label Grid.Row="2" Grid.Column="0" Content="{DynamicResource DIO.di.Group}"
- FontSize="{StaticResource ContentFontSize}"/>
- <ComboBox Grid.Row="2" Grid.Column="1" x:Name="diGroup"
- IsEditable="True" Style="{StaticResource FormComboxStyle}"/>
-
- <DataGrid Grid.Row="3" Grid.ColumnSpan="4" x:Name="diTable" Style="{StaticResource DefaultDataGrid}"
- ItemsSource="{Binding Source={StaticResource disFilter}}">
-
- <DataGrid.RowStyle>
- <Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Static pu:StyleKeys.DataGridRowStyle}}">
- <Style.Triggers>
- <DataTrigger Binding="{Binding Value}" Value="True">
- <Setter Property="Background" Value="{StaticResource DangerColor}"/>
- <Setter Property="Foreground" Value="{StaticResource DangerColorContrast}"/>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </DataGrid.RowStyle>
- <DataGrid.Columns>
- <DataGridTemplateColumn Header="#" CanUserResize="False">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Converter={StaticResource rowNumber},
- RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow},AncestorLevel=1}}"/>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- <DataGridTextColumn Width="*" Binding="{Binding Code}">
- <DataGridTextColumn.Header>
- <TextBlock Text="{DynamicResource DIO.Code}"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- <DataGridTextColumn Width="*" Binding="{Binding Name}">
- <DataGridTextColumn.Header>
- <TextBlock Text="{DynamicResource DIO.Name}"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- <DataGridTextColumn Width="*" Binding="{Binding Type}">
- <DataGridTextColumn.Header>
- <TextBlock Text="{DynamicResource DIO.Type}"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- <DataGridTextColumn Width="*" Binding="{Binding Value}">
- <DataGridTextColumn.Header>
- <TextBlock Text="{DynamicResource DIO.di.Value}"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- </DataGrid.Columns>
- </DataGrid>
- </Grid>
- </Border>
-
- <Border Grid.Row="1" Grid.Column="1" Style="{StaticResource CardBoarder}" Padding="0">
- <Grid dp:GridHelper.Space="10">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition />
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition Width="Auto"/>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
-
- <Label Grid.Row="0" Grid.Column="0" Content="{DynamicResource DIO.do.Name}"
- FontSize="{StaticResource ContentFontSize}"/>
- <ComboBox Grid.Row="0" Grid.Column="1" x:Name="doName"
- IsEditable="True" Style="{StaticResource FormComboxStyle}"/>
-
- <Button Style="{StaticResource PrimaryButton}" Grid.Row="0" Grid.Column="2"
- x:Name="doSelect" Click="Button_Click" Content="{DynamicResource DIO.do.Query}"/>
- <Button Style="{StaticResource PrimaryButton}" Grid.Row="0" Grid.Column="3"
- x:Name="doReset" Click="Button_Click" Content="{DynamicResource DIO.do.Reset}"/>
-
- <Label Grid.Row="1" Grid.Column="0" Content="{DynamicResource DIO.do.Code}"
- FontSize="{StaticResource ContentFontSize}"/>
- <ComboBox Grid.Row="1" Grid.Column="1" x:Name="doCode"
- IsEditable="True" Style="{StaticResource FormComboxStyle}"/>
-
- <Label Grid.Row="2" Grid.Column="0" Content="{DynamicResource DIO.do.Group}"
- FontSize="{StaticResource ContentFontSize}"/>
- <ComboBox Grid.Row="2" Grid.Column="1" x:Name="doGroup"
- IsEditable="True" Style="{StaticResource FormComboxStyle}"/>
-
- <DataGrid Grid.Row="3" Grid.ColumnSpan="4" x:Name="doTable" Style="{StaticResource DefaultDataGrid}"
- ItemsSource="{Binding Source={StaticResource dosFilter}}">
- <DataGrid.RowStyle>
- <Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Static pu:StyleKeys.DataGridRowStyle}}">
- <Style.Triggers>
- <DataTrigger Binding="{Binding Value}" Value="True">
- <Setter Property="Background" Value="{StaticResource DangerColor}"/>
- <Setter Property="Foreground" Value="{StaticResource DangerColorContrast}"/>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </DataGrid.RowStyle>
- <DataGrid.Columns>
- <DataGridTemplateColumn Header="#" CanUserResize="False">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Converter={StaticResource rowNumber},
-RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow},AncestorLevel=1}}"/>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- <DataGridTextColumn Width="*" Binding="{Binding Code}">
- <DataGridTextColumn.Header>
- <TextBlock Text="{DynamicResource DIO.Code}"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- <DataGridTextColumn Width="*" Binding="{Binding Name}">
- <DataGridTextColumn.Header>
- <TextBlock Text="{DynamicResource DIO.Name}"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- <DataGridTextColumn Width="*" Binding="{Binding Type}">
- <DataGridTextColumn.Header>
- <TextBlock Text="{DynamicResource DIO.Type}"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- <DataGridTextColumn Width="*" Binding="{Binding Value}">
- <DataGridTextColumn.Header>
- <TextBlock Text="{DynamicResource DIO.do.Value}"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- </DataGrid.Columns>
- </DataGrid>
- </Grid>
- </Border>
- </Grid>
- </Border>
-</hb:PluginControl>
\ No newline at end of file
diff --git a/HMI.IOMonitor/IOMonitor.xaml.cs b/HMI.IOMonitor/IOMonitor.xaml.cs
deleted file mode 100644
index 5778b04..0000000
--- a/HMI.IOMonitor/IOMonitor.xaml.cs
+++ /dev/null
@@ -1,493 +0,0 @@
-锘縰sing ConnectionUtil;
-using HMI.Base;
-using HMI.Core.Setting;
-using HMI.Core.Util;
-using HMI.IOMonitor.Entity;
-using HMI.UI.Util;
-using Microsoft.Win32;
-using NPOI.HSSF.UserModel;
-using NPOI.SS.UserModel;
-using NPOI.XSSF.UserModel;
-using OPCConnection;
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.IO;
-using System.Linq;
-using System.Net.Sockets;
-using System.Timers;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-
-namespace HMI.IOMonitor
-{
- /// <summary>
- /// UserControl1.xaml 鐨勪氦浜掗�昏緫
- /// </summary>
- public partial class IOMonitor : PluginControl
- {
- public string SettingFilePath { get; private set; }
- public string DataFilePath { get; private set; }
- /// <summary>
- /// DIO鍦板潃
- /// </summary>
- private string DITag = string.Empty;
- private string DQTag = string.Empty;
- private SystemSetting systemSetting;
- private Timer MonitorTimer;
- private SCADAApi lTSCADAApi = new OPCClient();
-
-
- /// <summary>
- /// The diosde 鍙嶅簭鍒楀寲鐨凞IO瀵硅薄
- /// </summary>
- private List<DIO> diosde = new List<DIO>();
- /// <summary>The dis
- /// DI鍙e璞�
- /// </summary>
- private ObservableCollection<DIO> _dis = new ObservableCollection<DIO>();
- public ObservableCollection<DIO> Dis
- {
- get => _dis;
- set { Set(ref _dis, value); }
- }
-
- private ObservableCollection<DIO> _dos = new ObservableCollection<DIO>();
- public ObservableCollection<DIO> Dos
- {
- get => _dos;
- set { Set(ref _dos, value); }
- }
-
- private ObservableCollection<IPManage> iPManages = new ObservableCollection<IPManage>();
-
- public ObservableCollection<IPManage> IPManages
- {
- get { return iPManages; }
- set { Set(ref iPManages, value); }
- }
-
-
- public IOMonitor()
- {
- systemSetting = SystemSetting.Instance;
- MonitorTimer = new Timer()
- {
- Interval = 100
- };
- MonitorTimer.Elapsed += MonitorTimer_Elapsed;
- DataContext = this;
- InitializeComponent();
- }
-
- private void MonitorTimer_Elapsed(object sender, ElapsedEventArgs e)
- {
- MonitorTimer.Enabled = false;
- try
- {
- // stopwatch.Start();
- if (lTSCADAApi.DoFctReadSingle(DITag, out string resulti, out string errMsgi))
- {
- byte[] stri = HexUtil.ToBytesFromHexString(resulti);
- Array.Reverse(stri);
- if (stri != null)
- {
- for (int i = 0; i < Dis.Count; i++)
- {
- Dis[i].Value = Convert.ToBoolean(GetValue(stri, "bool", Dis[i].DIO_No.ToString()));
- }
- }
- }
-
- if (lTSCADAApi.DoFctReadSingle(DQTag, out string resulto, out string errMsgo))
- {
- byte[] stro = HexUtil.ToBytesFromHexString(resulto);
- if (stro != null)
- {
- for (int i = 0; i < Dos.Count; i++)
- {
- Dos[i].Value = Convert.ToBoolean(GetValue(stro, "bool", Dos[i].DIO_No.ToString()));
- }
- }
- }
-
- //stopwatch.Stop();
- }
- catch (Exception ex)
- {
- log.Warn("MonitorTimer_Elapsed Execute Failed.", ex);
- MonitorTimer.Enabled = true;
- return;
- }
- finally
- {
- this.MonitorTimer.Enabled = true;
- }
- }
-
- /// <summary>
- /// 鍒濆鍖栨柟娉�
- /// </summary>
- private void LoadData()
- {
- diosde.Clear();
- //Dis.Clear();
- //Dos.Clear();
-
- diName.Items.Clear();
- doName.Items.Clear();
- diGroup.Items.Clear();
- doGroup.Items.Clear();
- try
- {
- this.diosde = XmlHelper.DeserializeFromXml<List<DIO>>(DataFilePath);
- }
- catch (Exception ex)
- {
- MsgBoxHelper.Error(this, ex.Message);
- }
-
- if (diosde.Count != 0)
- {
- for (int i = 0; i < diosde.Count; i++)
- {
- switch (diosde[i].DIOType)
- {
- case "I":
- Dis.Add(diosde[i]);
- break;
- case "Q":
- Dos.Add(diosde[i]);
- break;
- case "X":
- Dis.Add(diosde[i]);
- break;
- case "Y":
- Dos.Add(diosde[i]);
- break;
- default:
- break;
- }
- }
-
- Dis = new ObservableCollection<DIO>(Dis.OrderByDescending(t => t.DIO_No).ToList());
- Dos = new ObservableCollection<DIO>(Dos.OrderByDescending(t => t.DIO_No).ToList());
- List<string> listnew1 = new List<string>();
- foreach (var item in Dis)
- {
- listnew1.Add(item.Name);
- }
-
- diName.ItemsSource = listnew1;
- List<string> listnew2 = new List<string>();
- foreach (var item in Dos)
- {
- listnew2.Add(item.Name);
- }
-
- doName.ItemsSource = listnew2;
- List<string> listDis = new List<string>();
- int digroupmax = int.Parse(Dis[0].DIO_No.ToString().Split('.')[0]);
- switch (digroupmax % 2)
- {
- case 1:
- for (int i = 0; i < digroupmax; i++)
- {
- listDis.Add(i.ToString() + @".&" + (i + 1).ToString() + ".");
- }
-
- break;
- case 0:
- if (digroupmax >= 0)
- {
- for (int i = 0; i < (digroupmax - 1); i++)
- {
- listDis.Add(i.ToString() + @".&" + (i + 1).ToString() + ".");
- }
-
- listDis.Add(digroupmax.ToString() + ".");
- }
-
- break;
- default:
- break;
- }
-
- int dogroupmax = int.Parse(Dos[0].DIO_No.ToString().Split('.')[0]);
-
- diGroup.ItemsSource = listDis;
- List<string> listDos = new List<string>();
- switch (dogroupmax % 2)
- {
- case 1:
- for (int i = 0; i < dogroupmax; i++)
- {
- listDos.Add(i.ToString() + @".&" + (i + 1).ToString() + ".");
- }
-
- break;
- case 0:
- if (dogroupmax >= 0)
- {
- for (int i = 0; i < (dogroupmax - 1); i++)
- {
- listDos.Add(i.ToString() + @".&" + (i + 1).ToString() + ".");
- }
-
- listDos.Add(dogroupmax.ToString() + ".");
- }
-
- break;
- default:
- break;
- }
-
- doGroup.ItemsSource = listDos;
- diCode.ItemsSource = Dis;
- doCode.ItemsSource = Dos;
- }
- else
- {
- //
- }
- }
-
- private void UserControl_Loaded(object sender, RoutedEventArgs e)
- {
- LoadData();
- Loaded -= UserControl_Loaded;
- }
-
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- Button btn = sender as Button;
- switch (btn.Name)
- {
- case "addBtn":
- OpenAddModal();
- break;
- case "importBtn":
- ImportFromExcel();
- break;
- case "diSelect":
- CollectionViewSource disFilter = this.Resources["disFilter"] as CollectionViewSource;
- disFilter?.View.Refresh();
- break;
- case "diReset":
- ResetInput("di");
- break;
- case "doSelect":
- CollectionViewSource dosFilter = this.Resources["dosFilter"] as CollectionViewSource;
- dosFilter?.View.Refresh();
- break;
- case "doReset":
- ResetInput("do");
- break;
- default:
- break;
- }
- }
-
- private void OpenAddModal()
- {
- IPManageModal modal = new IPManageModal(log)
- {
- Title = this.lang("App.Add"),
- Owner = Window.GetWindow(this),
- };
- if (modal.Open(-1, new IPManage(), IPManages, SettingFilePath) == true)
- {
- this.Success(this.lang("App.AddSuccess"));
- }
- }
-
- private void ImportFromExcel()
- {
- IWorkbook workbook = null;
- OpenFileDialog dialog = new OpenFileDialog();
- ////璇ュ�肩‘瀹氭槸鍚﹀彲浠ラ�夋嫨澶氫釜鏂囦欢
- dialog.Multiselect = false;
- dialog.Title = this.lang("App.SelectFile");
- dialog.Filter = "execl(*.xlsx;*.xls)|*.xlsx;*.xls";
- if (dialog.ShowDialog() == true)
- {
- MonitorTimer.Enabled = false;
- string file = dialog.FileName;
- try
- {
- FileStream fileStream1 = new FileStream(@file, FileMode.Open, FileAccess.Read);
- if (file.IndexOf(".xlsx") >= 0)
- {
- workbook = new XSSFWorkbook(fileStream1);
- }
- else if (file.IndexOf(".xls") >= 0)
- {
- workbook = new HSSFWorkbook(fileStream1);
- }
-
- ISheet sheet = workbook.GetSheetAt(0);
- List<DIO> dios1 = new List<DIO>();
- IRow row;
- for (int i = 1; i < (sheet.LastRowNum + 1); i++)
- {
- DIO[] dIO = new DIO[sheet.LastRowNum];
- row = sheet.GetRow(i);
- DIO diotest = new DIO();
- if (row != null)
- {
- dIO[i - 1] = new DIO();
- dIO[i - 1].Name = row.GetCell(4).ToString();
- dIO[i - 1].No = row.GetCell(3).ToString();
- dIO[i - 1].Value = false;
- dIO[i - 1].DIO_No = Convert.ToDecimal(dIO[i - 1].No.Substring(2));
- if (row.GetCell(3).ToString().IndexOf("I") >= 0)
- {
- dIO[i - 1].DIOType = "I";
- }
- else if (row.GetCell(3).ToString().IndexOf("Q") >= 0)
- {
- dIO[i - 1].DIOType = "Q";
- }
- else if (row.GetCell(3).ToString().IndexOf("X") >= 0)
- {
- dIO[i - 1].DIOType = "X";
- }
- else if (row.GetCell(3).ToString().IndexOf("Y") >= 0)
- {
- dIO[i - 1].DIOType = "Y";
- }
-
- dios1.Add(dIO[i - 1]);
- }
- }
-
- fileStream1.Close();
- workbook.Close();
- XmlHelper.SerializeToXml(SettingFilePath, dios1);
- lock (this)
- {
- MonitorTimer.Stop();
- LoadData();
- }
- }
- catch (Exception ex)
- {
- log.Error("Import Failed.", ex);
- MsgBoxHelper.Error(this, $"{this.lang("App.ImportFailed")}: {ex.Message}");
- }
- }
- }
-
- private void ResetInput(string flag)
- {
- if (flag == "di")
- {
- diName.Text = "";
- diCode.Text = "";
- diGroup.Text = "";
- CollectionViewSource source = this.Resources["disFilter"] as CollectionViewSource;
- source?.View.Refresh();
- }
- else
- {
- doName.Text = "";
- doCode.Text = "";
- doGroup.Text = "";
- CollectionViewSource source = this.Resources["dosFilter"] as CollectionViewSource;
- source?.View.Refresh();
- }
- }
-
- private string GetValue(byte[] bt, string valueType, string address)
- {
- string[] str = address.Split('.');
- switch (valueType.ToLower())
- {
- case "bool":
- return Snap7.S7.GetBitAt(bt, int.Parse(str[0]), int.Parse(str[1])).ToString();
- default:
- return "false";
- }
- }
-
-
- public override void SetBaseFolder(string folder)
- {
- base.SetBaseFolder(folder);
- this.SettingFilePath = Path.Combine(BaseFolder, "Setting.xml");
- this.DataFilePath = Path.Combine(BaseFolder, "Data.xml");
- }
-
- public override void Active()
- {
- try
- {
- if (File.Exists(SettingFilePath))
- {
- ObservableCollection<IPManage> datas =
- XmlHelper.DeserializeFromXml<ObservableCollection<IPManage>>(SettingFilePath);
- IPManages = datas;
-
- DITag = IPManages[0].DItag;
- DQTag = IPManages[0].DQtag;
- }
- else
- {
- IPManage tag = new IPManage();
- tag.DItag = "";
- tag.DQtag = "";
- IPManages.Add(tag);
- XmlHelper.SerializeToXml(SettingFilePath, IPManages);
- }
- if (systemSetting.PlcEnabled)
- {
- if (!lTSCADAApi.Connect2("127.0.0.1", 6543, 18888, out string errMsg))
- {
- MsgBoxHelper.Error(this, errMsg);
- }
- else
- {
- this.MonitorTimer.Start();
- }
- }
- }
- catch (Exception ex)
- {
- log.Error("Active Execute Failed.", ex);
- MsgBoxHelper.ErrorMessage(this, $"{this.lang("DIO.ActivateFailed")}: {ex.Message}");
- }
- }
-
- private void CollectionViewSource_Filter(object sender, System.Windows.Data.FilterEventArgs e)
- {
- DIO data = e.Item as DIO;
- if (data == null) return;
-
- CollectionViewSource source = sender as CollectionViewSource;
- DIO param = new DIO();
- if (source.Source == Dis)
- {
- param.Name = diName.Text;
- param.No = diCode.Text;
- }
- else
- {
- param.Name = doName.Text;
- param.No = doCode.Text;
- }
-
- if (!string.IsNullOrEmpty(param.Name) && data.Name != param.Name)
- {
- e.Accepted = false;
- return;
- }
- if (!string.IsNullOrEmpty(param.No) && data.No != param.No)
- {
- e.Accepted = false;
- return;
- }
- e.Accepted = true;
- }
- }
-}
diff --git a/HMI.IOMonitor/IPManageModal.xaml b/HMI.IOMonitor/IPManageModal.xaml
deleted file mode 100644
index 756759f..0000000
--- a/HMI.IOMonitor/IPManageModal.xaml
+++ /dev/null
@@ -1,34 +0,0 @@
-锘�<pu:WindowX x:Class="HMI.IOMonitor.IPManageModal"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:local="clr-namespace:HMI.IOMonitor"
- xmlns:pw="https://opensource.panuon.com/wpf"
- xmlns:pu="https://opensource.panuon.com/wpf-ui"
- xmlns:uic="clr-namespace:HMI.UI.Converter;assembly=HMI.UI"
- xmlns:ui="clr-namespace:HMI.UI;assembly=HMI.UI"
- xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
- mc:Ignorable="d"
- Title="Form"
- SizeToContent="Height"
- Width="600"
- WindowStartupLocation="CenterOwner"
- BorderBrush="#3E3E45"
- BorderThickness="1"
- Foreground="Black"
- Style="{StaticResource ModalWindow}">
- <Grid Margin="10">
- <StackPanel x:Name="formPanel">
- <pu:FormGroup Header="{DynamicResource DIO.ITag}"
- dp:FormGroupHelper.IsRequired="True" GroupName="MyFormGroup">
- <TextBox Style="{StaticResource EditorTextBoxStyle}" x:Name="iTag"/>
- </pu:FormGroup>
-
- <pu:FormGroup Header="{DynamicResource DIO.OTag}"
- dp:FormGroupHelper.IsRequired="True" GroupName="MyFormGroup">
- <TextBox Style="{StaticResource EditorTextBoxStyle}" x:Name="qTag"/>
- </pu:FormGroup>
- </StackPanel>
- </Grid>
-</pu:WindowX>
diff --git a/HMI.IOMonitor/IPManageModal.xaml.cs b/HMI.IOMonitor/IPManageModal.xaml.cs
deleted file mode 100644
index 9006cf3..0000000
--- a/HMI.IOMonitor/IPManageModal.xaml.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-锘縰sing HMI.Core.Util;
-using HMI.IOMonitor.Entity;
-using HMI.UI;
-using HMI.UI.DpUtil;
-using HMI.UI.Util;
-using log4net;
-using Panuon.WPF.UI;
-using System;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-
-namespace HMI.IOMonitor
-{
- /// <summary>
- /// ModalWindow.xaml 鐨勪氦浜掗�昏緫
- /// </summary>
- public partial class IPManageModal : WindowX
- {
- public IPManageModal(ILog log)
- {
- this.log = log;
- this.DataContext = this;
- InitializeComponent();
- }
- private ILog log;
- public string FilePath { get; private set; }
- public int DataIndex { get; private set; }
- public IPManage Data { get; private set; }
- public ObservableCollection<IPManage> Datasource { get; private set; }
-
- private bool _isProcessing;
-
- protected override void OnClosing(CancelEventArgs e)
- {
- //Press Continue Button
- if (DialogResult == true)
- {
- if (_isProcessing)
- {
- e.Cancel = true;
- return;
- }
- var okButton = WindowXModalDialog.GetOKButton(this);
- try
- {
- _isProcessing = true;
- ButtonHelper.SetIsPending(okButton, true);
- if (!ValidateForm())
- {
- e.Cancel = true;
- return;
- }
-
- SaveOrUpdateData();
- }
- catch (Exception ex)
- {
- log.Error("IPManage Form Submit Failed.", ex);
- ToastHelper.Error(this, $"Error: {ex.Message}");
- e.Cancel = true;
- return;
- }
- finally
- {
- _isProcessing = false;
- ButtonHelper.SetIsPending(okButton, false);
- }
- }
- base.OnClosing(e);
- }
-
- public bool ValidateDBAddress(object value, out string err)
- {
- err = null;
-
- return true;
- }
-
- private bool ValidateForm()
- {
- bool flag = FormGroupHelper.ValidateForm(formPanel);
- if (flag)
- {
- Data.DItag =iTag.Text;
- Data.DQtag = qTag.Text;
- }
- return flag;
- }
-
- public bool? Open(int index, IPManage data,
- ObservableCollection<IPManage> dataSource,
- string filePath)
- {
- FilePath = filePath;
- DataIndex = index;
- Data = data;
- Datasource = dataSource;
- iTag.Text = Data.DItag;
- qTag.Text = Data.DQtag;
- return this.ShowDialog();
- }
-
- private void SaveOrUpdateData()
- {
- if (DataIndex == -1)
- {
- InsertData(Data);
- }
- else
- {
- UpdateData(DataIndex, Data);
- }
- }
-
- public void InsertData(IPManage data)
- {
- Datasource.Add(data);
- XmlHelper.SerializeToXml(FilePath, Datasource);
- }
-
- public void UpdateData(int index, IPManage data)
- {
- Datasource[index] = data;
- XmlHelper.SerializeToXml(FilePath, Datasource);
- }
- }
-}
diff --git a/HMI.IOMonitor/Properties/AssemblyInfo.cs b/HMI.IOMonitor/Properties/AssemblyInfo.cs
deleted file mode 100644
index 881d24a..0000000
--- a/HMI.IOMonitor/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-锘縰sing System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Windows;
-
-// 鏈夊叧绋嬪簭闆嗙殑涓�鑸俊鎭敱浠ヤ笅
-// 鎺у埗銆傛洿鏀硅繖浜涚壒鎬у�煎彲淇敼
-// 涓庣▼搴忛泦鍏宠仈鐨勪俊鎭��
-[assembly: AssemblyTitle("HMI.IOMonitor")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Organization")]
-[assembly: AssemblyProduct("HMI.IOMonitor")]
-[assembly: AssemblyCopyright("Copyright 漏 Organization 2025")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// 灏� ComVisible 璁剧疆涓� false 浼氫娇姝ょ▼搴忛泦涓殑绫诲瀷
-//瀵� COM 缁勪欢涓嶅彲瑙併�傚鏋滈渶瑕佷粠 COM 璁块棶姝ょ▼搴忛泦涓殑绫诲瀷
-//璇峰皢姝ょ被鍨嬬殑 ComVisible 鐗规�ц缃负 true銆�
-[assembly: ComVisible(false)]
-
-//鑻ヨ寮�濮嬬敓鎴愬彲鏈湴鍖栫殑搴旂敤绋嬪簭锛岃璁剧疆
-//.csproj 鏂囦欢涓殑 <UICulture>CultureYouAreCodingWith</UICulture>
-//鍦� <PropertyGroup> 涓�備緥濡傦紝濡傛灉浣犱娇鐢ㄧ殑鏄編鍥借嫳璇��
-//浣跨敤鐨勬槸缇庡浗鑻辫锛岃灏� <UICulture> 璁剧疆涓� en-US銆� 鐒跺悗鍙栨秷
-//瀵逛互涓� NeutralResourceLanguage 鐗规�х殑娉ㄩ噴銆� 鏇存柊
-//浠ヤ笅琛屼腑鐨勨�渆n-US鈥濅互鍖归厤椤圭洰鏂囦欢涓殑 UICulture 璁剧疆銆�
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
-[assembly:ThemeInfo(
- ResourceDictionaryLocation.None, //涓婚鐗瑰畾璧勬簮璇嶅吀鎵�澶勪綅缃�
- //(鏈湪椤甸潰涓壘鍒拌祫婧愭椂浣跨敤锛�
- //鎴栧簲鐢ㄧ▼搴忚祫婧愬瓧鍏镐腑鎵惧埌鏃朵娇鐢�)
- ResourceDictionaryLocation.SourceAssembly //甯歌璧勬簮璇嶅吀鎵�澶勪綅缃�
- //(鏈湪椤甸潰涓壘鍒拌祫婧愭椂浣跨敤锛�
- //銆佸簲鐢ㄧ▼搴忔垨浠讳綍涓婚涓撶敤璧勬簮瀛楀吀涓壘鍒版椂浣跨敤)
-)]
-
-
-// 绋嬪簭闆嗙殑鐗堟湰淇℃伅鐢变笅鍒楀洓涓�肩粍鎴�:
-//
-// 涓荤増鏈�
-// 娆$増鏈�
-// 鐢熸垚鍙�
-// 淇鍙�
-//
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/HMI.IOMonitor/Properties/Resources.Designer.cs b/HMI.IOMonitor/Properties/Resources.Designer.cs
deleted file mode 100644
index faca3a5..0000000
--- a/HMI.IOMonitor/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-锘�//------------------------------------------------------------------------------
-// <auto-generated>
-// 姝や唬鐮佺敱宸ュ叿鐢熸垚銆�
-// 杩愯鏃剁増鏈�: 4.0.30319.42000
-//
-// 瀵规鏂囦欢鐨勬洿鏀瑰彲鑳藉鑷翠笉姝g‘鐨勮涓猴紝濡傛灉
-// 閲嶆柊鐢熸垚浠g爜锛屽垯鎵�鍋氭洿鏀瑰皢涓㈠け銆�
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace HMI.IOMonitor.Properties {
-
-
- /// <summary>
- /// 寮虹被鍨嬭祫婧愮被锛岀敤浜庢煡鎵炬湰鍦板寲瀛楃涓茬瓑銆�
- /// </summary>
- // 姝ょ被鏄敱 StronglyTypedResourceBuilder
- // 绫婚�氳繃绫讳技浜� ResGen 鎴� Visual Studio 鐨勫伐鍏疯嚜鍔ㄧ敓鎴愮殑銆�
- // 鑻ヨ娣诲姞鎴栫Щ闄ゆ垚鍛橈紝璇风紪杈� .ResX 鏂囦欢锛岀劧鍚庨噸鏂拌繍琛� ResGen
- // (浠� /str 浣滀负鍛戒护閫夐」)锛屾垨閲嶆柊鐢熸垚 VS 椤圭洰銆�
- [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>
- /// 杩斿洖姝ょ被浣跨敤鐨勭紦瀛� ResourceManager 瀹炰緥銆�
- /// </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("HMI.IOMonitor.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// 閲嶅啓褰撳墠绾跨▼鐨� CurrentUICulture 灞炴�э紝瀵�
- /// 浣跨敤姝ゅ己绫诲瀷璧勬簮绫荤殑鎵�鏈夎祫婧愭煡鎵炬墽琛岄噸鍐欍��
- /// </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/HMI.IOMonitor/Properties/Resources.resx b/HMI.IOMonitor/Properties/Resources.resx
deleted file mode 100644
index af7dbeb..0000000
--- a/HMI.IOMonitor/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-锘�<?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/HMI.IOMonitor/Properties/Settings.Designer.cs b/HMI.IOMonitor/Properties/Settings.Designer.cs
deleted file mode 100644
index d5b5de5..0000000
--- a/HMI.IOMonitor/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-锘�//------------------------------------------------------------------------------
-// <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 HMI.IOMonitor.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/HMI.IOMonitor/Properties/Settings.settings b/HMI.IOMonitor/Properties/Settings.settings
deleted file mode 100644
index 033d7a5..0000000
--- a/HMI.IOMonitor/Properties/Settings.settings
+++ /dev/null
@@ -1,7 +0,0 @@
-锘�<?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/HMI.IOMonitor/packages.config b/HMI.IOMonitor/packages.config
deleted file mode 100644
index 467c193..0000000
--- a/HMI.IOMonitor/packages.config
+++ /dev/null
@@ -1,8 +0,0 @@
-锘�<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="log4net" version="3.0.4" targetFramework="net472" />
- <package id="NPOI" version="2.4.1" targetFramework="net472" />
- <package id="Panuon.WPF" version="1.1.3" targetFramework="net472" />
- <package id="Panuon.WPF.UI" version="1.3.0.2" targetFramework="net472" />
- <package id="SharpZipLib" version="1.0.0" targetFramework="net472" />
-</packages>
\ No newline at end of file
diff --git a/HMI.MenuManage/MenuManage.xaml.cs b/HMI.MenuManage/MenuManage.xaml.cs
index b812ce4..3ab7a4c 100644
--- a/HMI.MenuManage/MenuManage.xaml.cs
+++ b/HMI.MenuManage/MenuManage.xaml.cs
@@ -84,7 +84,7 @@
{
ObservableCollection<MenuData> data = new ObservableCollection<MenuData>();
ObservableCollection<MenuData> treeData = new ObservableCollection<MenuData>();
- DataTable dt = sqliteHelper.GetDataTable("SELECT m1.*,m2.name AS parentName FROM menu AS m1 LEFT JOIN menu AS m2 ON m1.parentCode = m2.code Order By m1.sort,m1.id;");
+ DataTable dt = sqliteHelper.GetDataTable("SELECT m1.*,m2.name AS parentName FROM menu AS m1 LEFT JOIN menu AS m2 ON m1.parentCode = m2.code Order By IIF(m1.level=1,m1.sort,m2.sort),IIF(m1.level=1,0,m1.sort),m1.id;");
Dictionary<string, MenuData> cache = new Dictionary<string, MenuData>();
if (dt != null)
{
diff --git a/HMI.ParameterManage/ParameterModal.xaml.cs b/HMI.ParameterManage/ParameterModal.xaml.cs
index ab9f77a..d7553d4 100644
--- a/HMI.ParameterManage/ParameterModal.xaml.cs
+++ b/HMI.ParameterManage/ParameterModal.xaml.cs
@@ -73,9 +73,10 @@
private bool ValidateForm()
{
- bool flag = FormGroupHelper.ValidateForm(formPanel, new Dictionary<string, object> {
+ var cache = new Dictionary<string, object> {
{ "FgValue",GetTargetValue()}
- });
+ };
+ bool flag = FormGroupHelper.ValidateForm(formPanel, cache);
if (flag)
{
Data.Name = TbName.Text;
@@ -106,11 +107,12 @@
private string GetTargetValue()
{
- if (CbType.Text == "Int" || Data.Type == "Double")
+ var type = CbType.Text;
+ if (type == "Int" || type == "Double")
{
return NiNumberValue.Text;
}
- else if (CbType.Text == "Bool")
+ else if (type == "Bool")
{
return CbBoolValue.Text;
}
diff --git a/HMI.ParameterManage/SettingModal.xaml.cs b/HMI.ParameterManage/SettingModal.xaml.cs
index 98f2993..308485e 100644
--- a/HMI.ParameterManage/SettingModal.xaml.cs
+++ b/HMI.ParameterManage/SettingModal.xaml.cs
@@ -122,11 +122,12 @@
private string GetTargetValue()
{
- if (CbType.Text == "Int" || Data.Type == "Double")
+ var type = CbType.Text;
+ if (type == "Int" || type == "Double")
{
return NiNumberValue.Text;
}
- else if (CbType.Text == "Bool")
+ else if (type == "Bool")
{
return CbBoolValue.Text;
}
diff --git a/HMI.SettingControl/SystemConfig.xaml b/HMI.SettingControl/SystemConfig.xaml
index 9027c4d..bae8ff7 100644
--- a/HMI.SettingControl/SystemConfig.xaml
+++ b/HMI.SettingControl/SystemConfig.xaml
@@ -22,7 +22,7 @@
<uic:DataGridRowNumberConverter x:Key="rowNumber"/>
</ResourceDictionary>
</UserControl.Resources>
-
+
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
@@ -67,9 +67,11 @@
<GroupBox Grid.Row="1" Header="{DynamicResource Setting.PlcSetting}" Padding="10">
<StackPanel>
<pu:FormGroup Header="{DynamicResource Setting.PlcIp}" HeaderWidth="Auto" GroupName="MyFormGroup">
- <TextBox Text="{Binding PlcIp}"/>
+ <TextBox Text="{Binding PlcIp,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</pu:FormGroup>
-
+ <pu:FormGroup Header="PLC Port" HeaderWidth="Auto" GroupName="MyFormGroup">
+ <pu:NumberInput Value="{Binding PlcPort,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
+ </pu:FormGroup>
<pu:FormGroup Header="{DynamicResource Setting.PlcEnabled}" HeaderWidth="Auto" GroupName="MyFormGroup">
<CheckBox IsChecked="{Binding PlcEnabled,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</pu:FormGroup>
diff --git a/VisionBuilder.Engine/VisionBuilder.Engine.csproj b/HMI.StdControl/HMI.StdControl.csproj
similarity index 65%
copy from VisionBuilder.Engine/VisionBuilder.Engine.csproj
copy to HMI.StdControl/HMI.StdControl.csproj
index 553239e..a9e7344 100644
--- a/VisionBuilder.Engine/VisionBuilder.Engine.csproj
+++ b/HMI.StdControl/HMI.StdControl.csproj
@@ -1,14 +1,14 @@
-锘�<?xml version="1.0" encoding="utf-8"?>
+<?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>{8E5E8A68-0B9D-4A6A-B325-730C64603FDF}</ProjectGuid>
+ <ProjectGuid>{7A066856-182F-4435-B648-E9FB91AFF657}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>VisionBuilder.Engine</RootNamespace>
- <AssemblyName>VisionBuilder.Engine</AssemblyName>
+ <RootNamespace>HMI.StdControl</RootNamespace>
+ <AssemblyName>HMI.StdControl</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
@@ -30,41 +30,36 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
- <DebugSymbols>true</DebugSymbols>
- <OutputPath>bin\x64\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <DebugType>full</DebugType>
- <PlatformTarget>x64</PlatformTarget>
- <LangVersion>7.3</LangVersion>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
- <OutputPath>bin\x64\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <Optimize>true</Optimize>
- <DebugType>pdbonly</DebugType>
- <PlatformTarget>x64</PlatformTarget>
- <LangVersion>7.3</LangVersion>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
<ItemGroup>
+ <Reference Include="PresentationCore" />
+ <Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
+ <Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
+ <Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
- <Compile Include="Runner.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="StdEnableMes.xaml.cs">
+ <DependentUpon>StdEnableMes.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="StdUIEventArg.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Page Include="StdEnableMes.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\HMI.Core\HMI.Core.csproj">
- <Project>{3e3bf44a-0b69-45c5-9512-528cb48a7106}</Project>
+ <Project>{3E3BF44A-0B69-45C5-9512-528CB48A7106}</Project>
<Name>HMI.Core</Name>
</ProjectReference>
</ItemGroup>
diff --git a/VisionBuilder.Engine/Properties/AssemblyInfo.cs b/HMI.StdControl/Properties/AssemblyInfo.cs
similarity index 67%
copy from VisionBuilder.Engine/Properties/AssemblyInfo.cs
copy to HMI.StdControl/Properties/AssemblyInfo.cs
index e98d254..c037c4a 100644
--- a/VisionBuilder.Engine/Properties/AssemblyInfo.cs
+++ b/HMI.StdControl/Properties/AssemblyInfo.cs
@@ -5,12 +5,12 @@
// 鏈夊叧绋嬪簭闆嗙殑涓�鑸俊鎭敱浠ヤ笅
// 鎺у埗銆傛洿鏀硅繖浜涚壒鎬у�煎彲淇敼
// 涓庣▼搴忛泦鍏宠仈鐨勪俊鎭��
-[assembly: AssemblyTitle("VisionBuilder.Engine")]
+[assembly: AssemblyTitle("HMI.StdControl")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("HP Inc.")]
-[assembly: AssemblyProduct("VisionBuilder.Engine")]
-[assembly: AssemblyCopyright("Copyright 漏 HP Inc. 2024")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HMI.StdControl")]
+[assembly: AssemblyCopyright("Copyright 漏 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -20,7 +20,7 @@
[assembly: ComVisible(false)]
// 濡傛灉姝ら」鐩悜 COM 鍏紑锛屽垯涓嬪垪 GUID 鐢ㄤ簬绫诲瀷搴撶殑 ID
-[assembly: Guid("8e5e8a68-0b9d-4a6a-b325-730c64603fdf")]
+[assembly: Guid("7a066856-182f-4435-b648-e9fb91aff657")]
// 绋嬪簭闆嗙殑鐗堟湰淇℃伅鐢变笅鍒楀洓涓�肩粍鎴�:
//
@@ -29,8 +29,5 @@
// 鐢熸垚鍙�
// 淇鍙�
//
-//鍙互鎸囧畾鎵�鏈夎繖浜涘�硷紝涔熷彲浠ヤ娇鐢ㄢ�滅敓鎴愬彿鈥濆拰鈥滀慨璁㈠彿鈥濈殑榛樿鍊�
-//閫氳繃浣跨敤 "*"锛屽涓嬫墍绀�:
-// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/HMI.StdControl/StdEnableMes.xaml b/HMI.StdControl/StdEnableMes.xaml
new file mode 100644
index 0000000..cf54472
--- /dev/null
+++ b/HMI.StdControl/StdEnableMes.xaml
@@ -0,0 +1,12 @@
+锘�<UserControl x:Class="HMI.StdControl.StdEnableMes"
+ 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:HMI.StdControl"
+ mc:Ignorable="d"
+ d:DesignHeight="450" d:DesignWidth="800">
+ <CheckBox x:Name="CbEnableMes" IsChecked="{Binding EnableMes,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
+ VerticalContentAlignment="Center"
+ Content="{DynamicResource Ts.EnableMes}" />
+</UserControl>
diff --git a/HMI.StdControl/StdEnableMes.xaml.cs b/HMI.StdControl/StdEnableMes.xaml.cs
new file mode 100644
index 0000000..46a8cb2
--- /dev/null
+++ b/HMI.StdControl/StdEnableMes.xaml.cs
@@ -0,0 +1,102 @@
+锘縰sing HMI.Core.Manager;
+using System;
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
+using System.Windows.Controls;
+
+namespace HMI.StdControl
+{
+ /// <summary>
+ /// StdEnableMes.xaml 鐨勪氦浜掗�昏緫
+ /// </summary>
+ public partial class StdEnableMes : UserControl, INotifyPropertyChanged
+ {
+
+ #region ...
+ public virtual event PropertyChangedEventHandler PropertyChanged;
+
+ protected virtual void Set([CallerMemberName] string name = null)
+ {
+
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
+ }
+
+ protected void Set<T>(ref T old, T @new, [CallerMemberName] string propertyName = null)
+ {
+ old = @new;
+ if (propertyName != null)
+ {
+ Set(propertyName);
+ }
+ }
+ #endregion
+
+ private event EventHandler<StdUIEventArg> valueChanged;
+ public event EventHandler<StdUIEventArg> ValueChanged
+ {
+ add
+ {
+ valueChanged += value;
+ }
+ remove
+ {
+ valueChanged -= value;
+ }
+ }
+
+ private bool enableMes;
+ public bool EnableMes
+ {
+ get => enableMes;
+ set
+ {
+ if (WriteConfig("EnableMes", value))
+ {
+ Set(ref enableMes, value);
+ }
+ Set(ref enableMes, value);
+ }
+ }
+
+ public StdEnableMes()
+ {
+ DataContext = this;
+ InitializeComponent();
+ try
+ {
+ var value = ParameterManager.GetCommonParameterByName("EnableMes");
+ if (value == null)
+ {
+ this.Visibility = System.Windows.Visibility.Collapsed;
+ }
+ else
+ {
+ enableMes = bool.Parse(value.Value);
+ Set("EnableMes");
+ }
+ }
+ catch
+ {
+ enableMes = false;
+ Set("EnableMes");
+ }
+ }
+
+ private bool WriteConfig(string name, bool value)
+ {
+ try
+ {
+ valueChanged?.Invoke(this, new StdUIEventArg()
+ {
+ StringValue = name,
+ BoolValue = value
+ });
+ return ParameterManager.UpdateCommonParameter(name, value, out string errMsg);
+ }
+ catch (Exception ex)
+ {
+ return false;
+ }
+ }
+ }
+}
diff --git a/HMI.StdControl/StdUIEventArg.cs b/HMI.StdControl/StdUIEventArg.cs
new file mode 100644
index 0000000..624782e
--- /dev/null
+++ b/HMI.StdControl/StdUIEventArg.cs
@@ -0,0 +1,14 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HMI.StdControl
+{
+ public class StdUIEventArg
+ {
+ public string StringValue { get; set; }
+ public bool BoolValue { get; set; }
+ }
+}
diff --git a/HMI.UI/Controls/LightBall.cs b/HMI.UI/Controls/LightBall.cs
index d9ffd5c..3cb1c08 100644
--- a/HMI.UI/Controls/LightBall.cs
+++ b/HMI.UI/Controls/LightBall.cs
@@ -12,7 +12,7 @@
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(
"Value",
- typeof(bool),
+ typeof(bool?),
typeof(LightBall),
new FrameworkPropertyMetadata(false));
@@ -31,9 +31,9 @@
}
}
- public bool Value
+ public bool? Value
{
- get => (bool)GetValue(ValueProperty);
+ get => (bool?)GetValue(ValueProperty);
set
{
SetValue(ValueProperty, value);
diff --git a/HMI.UI/HMI.UI.csproj b/HMI.UI/HMI.UI.csproj
index 8415c58..5d63a42 100644
--- a/HMI.UI/HMI.UI.csproj
+++ b/HMI.UI/HMI.UI.csproj
@@ -140,6 +140,7 @@
<Compile Include="ScannerSetting.xaml.cs">
<DependentUpon>ScannerSetting.xaml</DependentUpon>
</Compile>
+ <Compile Include="ScrollLabel.cs" />
<Compile Include="Style\BaseWindow.xaml.cs">
<DependentUpon>BaseWindow.xaml</DependentUpon>
</Compile>
diff --git a/HMI.UI/ScrollLabel.cs b/HMI.UI/ScrollLabel.cs
new file mode 100644
index 0000000..c8bb293
--- /dev/null
+++ b/HMI.UI/ScrollLabel.cs
@@ -0,0 +1,143 @@
+锘縰sing System;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media.Animation;
+
+namespace HMI.UI
+{
+ public class ScrollLabel : Control
+ {
+ static ScrollLabel()
+ {
+ DefaultStyleKeyProperty.OverrideMetadata(typeof(ScrollLabel), new FrameworkPropertyMetadata(typeof(ScrollLabel)));
+ }
+
+ private DoubleAnimation animation;
+
+ public override void OnApplyTemplate()
+ {
+ base.OnApplyTemplate();
+
+ // 鍦ㄦā鏉垮簲鐢ㄥ悗鍚姩鍒濆鍔ㄧ敾
+ var scrollViewer = GetTemplateChild("slv") as ScrollViewer;
+ var label = GetTemplateChild("label") as Label;
+ if (scrollViewer != null)
+ {
+ // 绛夊緟甯冨眬瀹屾垚鍚庡啀鍚姩鍔ㄧ敾
+ scrollViewer.Loaded += (s, e) =>
+ {
+ var storyboard = new Storyboard();
+ animation = new DoubleAnimation
+ {
+ From = 0,
+ To = scrollViewer.ScrollableWidth,
+ Duration = new Duration(TimeSpan.FromSeconds(3)),
+ AutoReverse = true,
+ RepeatBehavior = RepeatBehavior.Forever,
+ BeginTime = TimeSpan.FromSeconds(0.2)
+ };
+
+ Storyboard.SetTarget(animation, scrollViewer);
+ Storyboard.SetTargetProperty(animation, new PropertyPath(ScrollViewerBehavior.HorizontalOffsetProperty));
+
+ storyboard.Children.Add(animation);
+ scrollViewer.Resources["ScrollAnimation"] = storyboard;
+ storyboard.Begin();
+ };
+ }
+ }
+
+ private void ScrollViewer_ScrollChanged(object sender, ScrollChangedEventArgs e)
+ {
+ //RefreshAnimation();
+ }
+
+ private void RefreshAnimation()
+ {
+ // 鏌ユ壘ScrollViewer骞堕噸鏂板惎鍔ㄥ姩鐢�
+ var scrollViewer = GetTemplateChild("slv") as ScrollViewer;
+
+ if (scrollViewer != null)
+ {
+ scrollViewer.Dispatcher.BeginInvoke(new Action(() =>
+ {
+ // 鍋滄褰撳墠鍔ㄧ敾
+ var storyboard = scrollViewer.Resources["ScrollAnimation"] as Storyboard;
+ if (storyboard != null)
+ {
+ storyboard.Stop();
+ if (animation != null)
+ {
+ animation.To = scrollViewer.ScrollableWidth;
+ }
+ storyboard.Begin();
+ }
+
+ }), System.Windows.Threading.DispatcherPriority.Background);
+ }
+ }
+
+ public static readonly DependencyProperty ValueProperty =
+ DependencyProperty.RegisterAttached("Value", typeof(string), typeof(ScrollLabel),
+ new FrameworkPropertyMetadata(null, new PropertyChangedCallback(OnValueChanged)));
+
+ private static void OnValueChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
+ {
+ var scrollLabel = obj as ScrollLabel;
+ scrollLabel?.RefreshAnimation();
+ }
+
+ public event EventHandler<string> ValueChanged;
+
+ public string Value
+ {
+ get { return (string)GetValue(ValueProperty); }
+ set
+ {
+ SetValue(ValueProperty, value);
+ }
+ }
+ }
+
+ public static class ScrollViewerBehavior
+ {
+ public static readonly DependencyProperty HorizontalOffsetProperty =
+ DependencyProperty.RegisterAttached("HorizontalOffset", typeof(double), typeof(ScrollViewerBehavior),
+ new UIPropertyMetadata(0.0, OnHorizontalOffsetChanged));
+ public static void SetHorizontalOffset(FrameworkElement target, double value)
+ {
+ target.SetValue(HorizontalOffsetProperty, value);
+ }
+ public static double GetHorizontalOffset(FrameworkElement target)
+ {
+ return (double)target.GetValue(HorizontalOffsetProperty);
+ }
+ private static void OnHorizontalOffsetChanged(DependencyObject target, DependencyPropertyChangedEventArgs e)
+ {
+ var view = target as ScrollViewer;
+ if (view != null)
+ {
+ view.ScrollToHorizontalOffset((double)e.NewValue);
+ }
+ }
+
+ public static readonly DependencyProperty VerticalOffsetProperty = DependencyProperty.RegisterAttached("VerticalOffset", typeof(double), typeof(ScrollViewerBehavior), new UIPropertyMetadata(0.0, OnVerticalOffsetChanged));
+ public static void SetVerticalOffset(FrameworkElement target, double value)
+ {
+ target.SetValue(VerticalOffsetProperty, value);
+ }
+ public static double GetVerticalOffset(FrameworkElement target)
+ {
+ return (double)target.GetValue(VerticalOffsetProperty);
+ }
+ private static void OnVerticalOffsetChanged(DependencyObject target, DependencyPropertyChangedEventArgs e)
+ {
+ var view = target as ScrollViewer;
+ if (view != null)
+ {
+ view.ScrollToVerticalOffset((double)e.NewValue);
+ }
+ }
+ }
+
+}
diff --git a/HMI.UI/Style/Colors.xaml b/HMI.UI/Style/Colors.xaml
index bcb173f..8b35a3f 100644
--- a/HMI.UI/Style/Colors.xaml
+++ b/HMI.UI/Style/Colors.xaml
@@ -28,14 +28,19 @@
<Brush x:Key="CellValue">#f6f7d7</Brush>
- <LinearGradientBrush x:Key="PrimaryColor1" StartPoint="0.5,0" EndPoint="0.5,1">
- <!--<GradientStop Color="#369bdb" Offset="0.027"/>
- <GradientStop Color="#2b577f" Offset="0.994"/>-->
+ <!--<LinearGradientBrush x:Key="PrimaryColor1" StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Color="#557ec8" Offset="0.027"/>
<GradientStop Color="#375aa3" Offset="0.994"/>
- </LinearGradientBrush>
+ </LinearGradientBrush>-->
- <LinearGradientBrush x:Key="HoriBar" StartPoint="0,0.5" EndPoint="1,0.5">
+ <Brush x:Key="PrimaryColor1">#22448b</Brush>
+ <Brush x:Key="HoriBar">#22448b</Brush>
+ <Brush x:Key="ReHoriBar">#22448b</Brush>
+ <Brush x:Key="TableHeader">#22448b</Brush>
+ <Brush x:Key="VerBar">#22448b</Brush>
+ <Brush x:Key="ReVerBar">#22448b</Brush>
+
+ <!--<LinearGradientBrush x:Key="HoriBar" StartPoint="0,0.5" EndPoint="1,0.5">
<GradientStop Color="#5d87d2" Offset="0"/>
<GradientStop Color="#22448b" Offset="1"/>
</LinearGradientBrush>
@@ -61,9 +66,13 @@
<GradientStop Color="#23458c" Offset="0"/>
<GradientStop Color="#4268b1" Offset="0.5"/>
<GradientStop Color="#5d87d2" Offset="1"/>
- </LinearGradientBrush>
+ </LinearGradientBrush>-->
- <LinearGradientBrush x:Key="GreenVerBar" StartPoint="0.5,0" EndPoint="0.5,1">
+ <Brush x:Key="GreenVerBar">#21c418</Brush>
+ <Brush x:Key="DangerVerBar">#d64343</Brush>
+
+
+ <!--<LinearGradientBrush x:Key="GreenVerBar" StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Color="#28ea1d" Offset="0"/>
<GradientStop Color="#21c418" Offset="0.5"/>
<GradientStop Color="#1b9e14" Offset="1"/>
@@ -73,7 +82,7 @@
<GradientStop Color="#fd583e" Offset="0"/>
<GradientStop Color="#d5341f" Offset="0.5"/>
<GradientStop Color="#aa0e00" Offset="1"/>
- </LinearGradientBrush>
+ </LinearGradientBrush>-->
<RadialGradientBrush x:Key="Normal" GradientOrigin="0.5,0.5"
RadiusX="0.75"
diff --git a/HMI.UI/Style/MsgBoxStyle.xaml b/HMI.UI/Style/MsgBoxStyle.xaml
index 984e2cc..9bc748d 100644
--- a/HMI.UI/Style/MsgBoxStyle.xaml
+++ b/HMI.UI/Style/MsgBoxStyle.xaml
@@ -5,7 +5,7 @@
xmlns:puconfig="clr-namespace:Panuon.WPF.UI.Configurations;assembly=Panuon.WPF.UI">
<pu:MessageBoxXSettings x:Key="MsgBoxWarn"
- InteropOwnersMask="True"
+ InteropOwnersMask="False"
InverseButtonsSequence="False">
<pu:MessageBoxXSettings.WindowXStyle>
<Style TargetType="pu:WindowX" BasedOn="{StaticResource {x:Static pu:MessageBoxX.WindowXStyleKey}}">
@@ -44,7 +44,7 @@
</pu:MessageBoxXSettings>
<pu:MessageBoxXSettings x:Key="MsgBoxError"
- InteropOwnersMask="True"
+ InteropOwnersMask="False"
InverseButtonsSequence="False">
<pu:MessageBoxXSettings.WindowXStyle>
<Style TargetType="pu:WindowX" BasedOn="{StaticResource {x:Static pu:MessageBoxX.WindowXStyleKey}}">
@@ -83,7 +83,7 @@
</pu:MessageBoxXSettings>
<pu:MessageBoxXSettings x:Key="MsgBoxInfo"
- InteropOwnersMask="True"
+ InteropOwnersMask="False"
InverseButtonsSequence="False">
<pu:MessageBoxXSettings.WindowXStyle>
<Style TargetType="pu:WindowX" BasedOn="{StaticResource {x:Static pu:MessageBoxX.WindowXStyleKey}}">
diff --git a/HMI.UI/Themes/Generic.xaml b/HMI.UI/Themes/Generic.xaml
index e77a351..ae3f3f0 100644
--- a/HMI.UI/Themes/Generic.xaml
+++ b/HMI.UI/Themes/Generic.xaml
@@ -29,10 +29,13 @@
<Ellipse Height="{TemplateBinding Size}" Width="{TemplateBinding Size}" VerticalAlignment="Center">
<Ellipse.Style>
<Style TargetType="Ellipse">
- <Setter Property="Fill" Value="{StaticResource RedLight}"/>
+ <Setter Property="Fill" Value="Gray"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Value,RelativeSource={RelativeSource Mode=TemplatedParent}}" Value="True">
<Setter Property="Fill" Value="{StaticResource GreenLight}"/>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Value,RelativeSource={RelativeSource Mode=TemplatedParent}}" Value="False">
+ <Setter Property="Fill" Value="{StaticResource RedLight}"/>
</DataTrigger>
</Style.Triggers>
</Style>
@@ -142,4 +145,43 @@
</Setter.Value>
</Setter>
</Style>
+
+ <Style TargetType="{x:Type local:ScrollLabel}">
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="{x:Type local:ScrollLabel}">
+ <ScrollViewer Name="slv" IsHitTestVisible="False" Width="{TemplateBinding Width}"
+ VerticalScrollBarVisibility="Hidden"
+ BorderThickness="0"
+ HorizontalScrollBarVisibility="Hidden">
+ <Label x:Name="label" Content="{Binding Path=Value, RelativeSource={RelativeSource TemplatedParent}}"
+ VerticalContentAlignment="Center"
+ BorderThickness="0"
+ Foreground="{TemplateBinding Foreground}"
+ Padding="{TemplateBinding Padding}"
+ Margin="{TemplateBinding Margin}"
+ HorizontalContentAlignment="Left" FontSize="{TemplateBinding FontSize}">
+ <!--<Label.Triggers>
+ <EventTrigger RoutedEvent="Label.Loaded">
+ <BeginStoryboard HandoffBehavior="Compose">
+ <Storyboard>
+ <DoubleAnimation From="0"
+ To="{Binding ElementName=slv,Path=ScrollableWidth}"
+ Duration="0:0:3"
+ Storyboard.TargetName="slv"
+ AutoReverse="True"
+ RepeatBehavior="Forever"
+ BeginTime="0:0:0.2"
+ Storyboard.TargetProperty="(local:ScrollViewerBehavior.HorizontalOffset)">
+ </DoubleAnimation>
+ </Storyboard>
+ </BeginStoryboard>
+ </EventTrigger>
+ </Label.Triggers>-->
+ </Label>
+ </ScrollViewer>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
</ResourceDictionary>
\ No newline at end of file
diff --git a/HMI.UnitTest/HMI.UnitTest.csproj b/HMI.UnitTest/HMI.UnitTest.csproj
index 73dc3ae..b5f1158 100644
--- a/HMI.UnitTest/HMI.UnitTest.csproj
+++ b/HMI.UnitTest/HMI.UnitTest.csproj
@@ -135,6 +135,10 @@
<Project>{d0806fa6-3f6d-4304-81b8-ead9da7cb5b2}</Project>
<Name>ConnectionUtil</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\ModBusTcpController\ModBusTcpController\ModBusTcpController.csproj">
+ <Project>{49db0c9b-b239-4608-a91e-f5ed43afaf96}</Project>
+ <Name>ModBusTcpController</Name>
+ </ProjectReference>
<ProjectReference Include="..\HMI.Base\HMI.Base.csproj">
<Project>{2A6F9720-A890-4036-9D73-41A0DAE28341}</Project>
<Name>HMI.Base</Name>
diff --git a/HMI.UnitTest/MainWindow.xaml.cs b/HMI.UnitTest/MainWindow.xaml.cs
index 6378bc8..2c18c54 100644
--- a/HMI.UnitTest/MainWindow.xaml.cs
+++ b/HMI.UnitTest/MainWindow.xaml.cs
@@ -3,6 +3,7 @@
using HMI.Core.Util;
using HMI.Simple.Util;
using log4net;
+using ModBusTcp;
using Panuon.WPF.UI;
using Plugin.DataBoard;
using Plugin.TestResult_WPF;
@@ -25,7 +26,25 @@
ProductModelHelper.GetModelBySNR("cc123", out string model, out string msg);
LangUtil.Load();
InitializeComponent();
- RebuildDb();
+ //RebuildDb();
+
+ ModBusTcpController controller = new ModBusTcpController("127.0.0.1", 502);
+ if (controller.Start(out msg)) {
+ bool res;
+ int? target;
+
+ controller.WriteBool("1", true, out msg);
+ controller.ReadDOBool("1", out res, out msg);
+ Console.WriteLine(res);
+ controller.ReadDOInt("1", out target, out msg);
+ Console.WriteLine(target);
+ controller.WriteInt("1", 1, out msg);
+ controller.ReadDOInt("1", out target, out msg);
+ Console.WriteLine(target);
+ Console.WriteLine(target);
+ }
+
+
//page.Children.Add(new UserControl1());
}
@@ -123,38 +142,38 @@
private void Button_Click(object sender, RoutedEventArgs e)
{
- Task.Run(() =>
- {
- for (int j = 0; j < 1000; j++)
- {
- string status = (j % 2 == 0) ? "Passed" : "Failed";
- string d = (j % 2 == 0) ? "9" : "9999999999999999999999999999999999999999999999999999999999999999995";
- tsExecution.AddTestData(0, $"ConnectivityCANRec,2,3,4,{d},6,{status}");
- Thread.Sleep(5);
- }
- });
+ //Task.Run(() =>
+ //{
+ // for (int j = 0; j < 1000; j++)
+ // {
+ // string status = (j % 2 == 0) ? "Passed" : "Failed";
+ // string d = (j % 2 == 0) ? "9" : "9999999999999999999999999999999999999999999999999999999999999999995";
+ // tsExecution.AddTestData(0, $"ConnectivityCANRec,2,3,4,{d},6,{status}");
+ // Thread.Sleep(5);
+ // }
+ //});
- Task.Run(() =>
- {
- for (int j = 0; j < 1000; j++)
- {
- string status = (j % 2 == 0) ? "Passed" : "Failed";
- string d = (j % 2 == 0) ? "9" : "9999999999999999999999999999999999999999999999999999999999999999995";
- tsExecution.AddTestData(1, $"ConnectivityCANRec,2,3,4,{d},6,{status}");
- Thread.Sleep(5);
- }
- });
+ //Task.Run(() =>
+ //{
+ // for (int j = 0; j < 1000; j++)
+ // {
+ // string status = (j % 2 == 0) ? "Passed" : "Failed";
+ // string d = (j % 2 == 0) ? "9" : "9999999999999999999999999999999999999999999999999999999999999999995";
+ // tsExecution.AddTestData(1, $"ConnectivityCANRec,2,3,4,{d},6,{status}");
+ // Thread.Sleep(5);
+ // }
+ //});
- Task.Run(() =>
- {
- for (int j = 0; j < 1000; j++)
- {
- string status = (j % 2 == 0) ? "Passed" : "Failed";
- string d = (j % 2 == 0) ? "9" : "9999999999999999999999999999999999999999999999999999999999999999995";
- tsExecution.AddTestData(2, $"ConnectivityCANRec,2,3,4,{d},6,{status}");
- Thread.Sleep(5);
- }
- });
+ //Task.Run(() =>
+ //{
+ // for (int j = 0; j < 1000; j++)
+ // {
+ // string status = (j % 2 == 0) ? "Passed" : "Failed";
+ // string d = (j % 2 == 0) ? "9" : "9999999999999999999999999999999999999999999999999999999999999999995";
+ // tsExecution.AddTestData(2, $"ConnectivityCANRec,2,3,4,{d},6,{status}");
+ // Thread.Sleep(5);
+ // }
+ //});
//Task.Run(() =>
//{
diff --git a/Libs/HslCommunication.dll b/Libs/HslCommunication.dll
new file mode 100644
index 0000000..62aa0d7
--- /dev/null
+++ b/Libs/HslCommunication.dll
Binary files differ
diff --git a/Libs/lmes.dll b/Libs/lmes.dll
new file mode 100644
index 0000000..768bb37
--- /dev/null
+++ b/Libs/lmes.dll
Binary files differ
diff --git a/ModBusTcpController/ModBusTcpController.cs b/ModBusTcpController/ModBusTcpController.cs
new file mode 100644
index 0000000..9597de8
--- /dev/null
+++ b/ModBusTcpController/ModBusTcpController.cs
@@ -0,0 +1,85 @@
+锘縰sing HslCommunication.ModBus;
+
+namespace ModBusTcp
+{
+ public class ModBusTcpController
+ {
+ public string Ip { get; set; }
+ public int Port { get; set; }
+
+ private ModbusTcpNet client;
+
+ public ModBusTcpController(string ip, int port)
+ {
+ Ip = ip;
+ Port = port;
+ }
+
+ public bool Start(out string errMsg)
+ {
+ errMsg = string.Empty;
+ client = new ModbusTcpNet(Ip, Port);
+ var res = client.ConnectServer();
+ errMsg = res.Message;
+ return res.IsSuccess;
+ }
+
+ public bool ReadDIBool(string address, out bool res, out string msg)
+ {
+ var result = client?.ReadBool($"x=2;{address}");
+ msg = result?.Message;
+ res = result?.Content == true;
+ return result?.IsSuccess == true;
+ }
+
+ public bool ReadDOBool(string address, out bool res, out string msg)
+ {
+ var result = client?.ReadBool(address);
+ msg = result?.Message;
+ res = result?.Content == true;
+ return result?.IsSuccess == true;
+ }
+
+ public bool WriteBool(string address, bool value, out string msg)
+ {
+ msg = string.Empty;
+ var res = client?.Write(address, value);
+ msg = res.Message;
+ return res?.IsSuccess == true;
+ }
+
+ public bool ReadDIInt(string address, out int? res, out string msg)
+ {
+ var result = client?.ReadInt32($"x=2;{address}");
+ msg = result?.Message;
+ res = result?.Content;
+ return result?.IsSuccess == true;
+ }
+
+ public bool ReadDOInt(string address, out int? res, out string msg)
+ {
+ var result = client?.ReadInt32(address);
+ msg = result?.Message;
+ res = result?.Content;
+ return result?.IsSuccess == true;
+ }
+
+ public bool WriteInt(string address, int value, out string msg)
+ {
+ msg = string.Empty;
+ var res = client?.Write(address, value);
+ msg = res.Message;
+ return res?.IsSuccess == true;
+ }
+
+ public bool Close()
+ {
+ return client?.ConnectClose()?.IsSuccess == true;
+
+ }
+ public void Dispose()
+ {
+ client?.Dispose();
+ }
+ }
+}
diff --git a/VisionBuilder.Engine/VisionBuilder.Engine.csproj b/ModBusTcpController/ModBusTcpController.csproj
similarity index 61%
copy from VisionBuilder.Engine/VisionBuilder.Engine.csproj
copy to ModBusTcpController/ModBusTcpController.csproj
index 553239e..1693e3e 100644
--- a/VisionBuilder.Engine/VisionBuilder.Engine.csproj
+++ b/ModBusTcpController/ModBusTcpController.csproj
@@ -1,14 +1,14 @@
-锘�<?xml version="1.0" encoding="utf-8"?>
+<?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>{8E5E8A68-0B9D-4A6A-B325-730C64603FDF}</ProjectGuid>
+ <ProjectGuid>{49DB0C9B-B239-4608-A91E-F5ED43AFAF96}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>VisionBuilder.Engine</RootNamespace>
- <AssemblyName>VisionBuilder.Engine</AssemblyName>
+ <RootNamespace>ModBusTcpController</RootNamespace>
+ <AssemblyName>ModBusTcpController</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
@@ -30,24 +30,6 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
- <DebugSymbols>true</DebugSymbols>
- <OutputPath>bin\x64\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <DebugType>full</DebugType>
- <PlatformTarget>x64</PlatformTarget>
- <LangVersion>7.3</LangVersion>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
- <OutputPath>bin\x64\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <Optimize>true</Optimize>
- <DebugType>pdbonly</DebugType>
- <PlatformTarget>x64</PlatformTarget>
- <LangVersion>7.3</LangVersion>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -59,14 +41,8 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
- <Compile Include="Runner.cs" />
+ <Compile Include="ModBusTcpController.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\HMI.Core\HMI.Core.csproj">
- <Project>{3e3bf44a-0b69-45c5-9512-528cb48a7106}</Project>
- <Name>HMI.Core</Name>
- </ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
diff --git a/VisionBuilder.Engine/Properties/AssemblyInfo.cs b/ModBusTcpController/Properties/AssemblyInfo.cs
similarity index 67%
rename from VisionBuilder.Engine/Properties/AssemblyInfo.cs
rename to ModBusTcpController/Properties/AssemblyInfo.cs
index e98d254..ccc4c44 100644
--- a/VisionBuilder.Engine/Properties/AssemblyInfo.cs
+++ b/ModBusTcpController/Properties/AssemblyInfo.cs
@@ -5,12 +5,12 @@
// 鏈夊叧绋嬪簭闆嗙殑涓�鑸俊鎭敱浠ヤ笅
// 鎺у埗銆傛洿鏀硅繖浜涚壒鎬у�煎彲淇敼
// 涓庣▼搴忛泦鍏宠仈鐨勪俊鎭��
-[assembly: AssemblyTitle("VisionBuilder.Engine")]
+[assembly: AssemblyTitle("ModBusTcpController")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("HP Inc.")]
-[assembly: AssemblyProduct("VisionBuilder.Engine")]
-[assembly: AssemblyCopyright("Copyright 漏 HP Inc. 2024")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("ModBusTcpController")]
+[assembly: AssemblyCopyright("Copyright 漏 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -20,7 +20,7 @@
[assembly: ComVisible(false)]
// 濡傛灉姝ら」鐩悜 COM 鍏紑锛屽垯涓嬪垪 GUID 鐢ㄤ簬绫诲瀷搴撶殑 ID
-[assembly: Guid("8e5e8a68-0b9d-4a6a-b325-730c64603fdf")]
+[assembly: Guid("49db0c9b-b239-4608-a91e-f5ed43afaf96")]
// 绋嬪簭闆嗙殑鐗堟湰淇℃伅鐢变笅鍒楀洓涓�肩粍鎴�:
//
@@ -29,8 +29,5 @@
// 鐢熸垚鍙�
// 淇鍙�
//
-//鍙互鎸囧畾鎵�鏈夎繖浜涘�硷紝涔熷彲浠ヤ娇鐢ㄢ�滅敓鎴愬彿鈥濆拰鈥滀慨璁㈠彿鈥濈殑榛樿鍊�
-//閫氳繃浣跨敤 "*"锛屽涓嬫墍绀�:
-// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OPCClient/OPCClient.csproj b/OPCClient/OPCClient.csproj
index 02bf99f..13f20fc 100644
--- a/OPCClient/OPCClient.csproj
+++ b/OPCClient/OPCClient.csproj
@@ -12,6 +12,8 @@
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
+ <NuGetPackageImportStamp>
+ </NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -50,13 +52,14 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
+ <HintPath>..\WPFProject\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="SupersocketCommon">
<HintPath>..\Libs\SupersocketCommon.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
+ <Reference Include="System.Numerics" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
@@ -70,13 +73,14 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\..\ConnectionUtil\ConnectionUtil\ConnectionUtil.csproj">
+ <None Include="app.config" />
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\ConnectionUtil\ConnectionUtil.csproj">
<Project>{d0806fa6-3f6d-4304-81b8-ead9da7cb5b2}</Project>
<Name>ConnectionUtil</Name>
</ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
diff --git a/OPCClient/app.config b/OPCClient/app.config
new file mode 100644
index 0000000..a0cefc2
--- /dev/null
+++ b/OPCClient/app.config
@@ -0,0 +1,11 @@
+锘�<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
+</configuration>
\ No newline at end of file
diff --git a/OPCClient/packages.config b/OPCClient/packages.config
index 5eaa239..e46d5a8 100644
--- a/OPCClient/packages.config
+++ b/OPCClient/packages.config
@@ -1,4 +1,4 @@
锘�<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" />
+ <package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
</packages>
\ No newline at end of file
diff --git a/Plugin.ChangeModel/ChangeModel.xaml b/Plugin.ChangeModel/ChangeModel.xaml
deleted file mode 100644
index db63d92..0000000
--- a/Plugin.ChangeModel/ChangeModel.xaml
+++ /dev/null
@@ -1,144 +0,0 @@
-锘�<hb:SimpleMaskControl x:Class="Plugin.ChangeModel.ChangeModel"
- 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:Plugin.ChangeModel"
- mc:Ignorable="d"
- xmlns:hb="clr-namespace:HMI.Base;assembly=HMI.Base"
- xmlns:uic="clr-namespace:HMI.UI.Converter;assembly=HMI.UI"
- xmlns:pw="https://opensource.panuon.com/wpf"
- xmlns:pu="https://opensource.panuon.com/wpf-ui"
- xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
- Loaded="SimpleControl_Loaded"
- Style="{StaticResource simpleMaskControl}"
- d:DesignHeight="450" d:DesignWidth="800">
- <hb:SimpleMaskControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="/HMI.UI;component/Style/PanuonDataGrid.xaml"/>
- </ResourceDictionary.MergedDictionaries>
- </ResourceDictionary>
- </hb:SimpleMaskControl.Resources>
- <Border Style="{StaticResource CardBoarder}">
- <Grid dp:GridHelper.Space="10" Cursor="">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
-
- <TextBlock FontSize="{StaticResource TitleFontSize}"
-VerticalAlignment="Center" HorizontalAlignment="Left" Text="{DynamicResource cm.title}"/>
-
- <DockPanel Grid.Row="1" Cursor="">
- <StackPanel DockPanel.Dock="Right" Style="{StaticResource ButtonGroup}">
-
- <Button Style="{StaticResource RfhBtn}"
- Content="{DynamicResource cm.rfhLog}"
- x:Name="refreshLogBtn" Click="Button_Click"/>
-
- <Button Style="{StaticResource DelBtn}" Content="{DynamicResource cm.clrLog}"
- x:Name="deleteLogBtn" Click="Button_Click"/>
-
- </StackPanel>
-
- <StackPanel Style="{StaticResource ButtonGroup}" HorizontalAlignment="Left" dp:StackPanelHelper.ChildSpace="10">
- <TextBlock Style="{StaticResource TitleBox}" FontSize="14" Text="{DynamicResource cm.lineName}"/>
- <ComboBox Style="{StaticResource FormComboxStyle}" Width="180"
- ItemsSource="{Binding LineNameSource}"
- SelectedItem="{Binding CurrentLineName}"
- SelectedValuePath="Content">
- </ComboBox>
-
- <TextBlock Style="{StaticResource TitleBox}" FontSize="14" Visibility="{Binding WorkOrderVisiable}"
- Text="{DynamicResource cm.workorder}"/>
- <ComboBox Style="{StaticResource FormComboxStyle}" Width="180"
- Visibility="{Binding WorkOrderVisiable}"
- ItemsSource="{Binding WorkorderSource}"
- SelectedItem="{Binding CurrentWorkorder}" SelectedValuePath="Content">
- </ComboBox>
-
- <TextBlock Style="{StaticResource TitleBox}" FontSize="14" Text="{DynamicResource cm.productModel}"/>
- <ComboBox Style="{StaticResource FormComboxStyle}" Width="180"
- ItemsSource="{Binding ProductModelSource}"
- SelectedItem="{Binding CurrentProductModel}" SelectedValuePath="Content">
- </ComboBox>
-
- <Button Style="{StaticResource EditBtn}" x:Name="changeModelBtn" Content="{DynamicResource cm.cm}"
- Click="Button_Click"/>
- <Button Style="{StaticResource RfhBtn}" Content="{DynamicResource cm.rfhInfo}" x:Name="refreshInfoBtn"
- Click="Button_Click"/>
- </StackPanel>
- </DockPanel>
-
- <DataGrid Grid.Row="2" x:Name="table" Style="{StaticResource DefaultDataGrid}">
- <DataGrid.RowStyle>
- <Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Static pu:StyleKeys.DataGridRowStyle}}">
- <Style.Triggers>
- <DataTrigger Binding="{Binding level}" Value="Warn">
- <Setter Property="Background" Value="{StaticResource WarningColor}"/>
- <Setter Property="Foreground" Value="Black"/>
- </DataTrigger>
- <DataTrigger Binding="{Binding level}" Value="Error">
- <Setter Property="Background" Value="{StaticResource DangerColor}"/>
- <Setter Property="Foreground" Value="Black"/>
- </DataTrigger>
- <Trigger Property="IsSelected" Value="True">
- <Setter Property="Background" Value="Transparent"/>
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="Transparent"/>
- </Trigger>
- </Style.Triggers>
- </Style>
- </DataGrid.RowStyle>
- <DataGrid.Columns>
- <DataGridTemplateColumn Header="#" CanUserResize="False">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Converter={StaticResource rowNumber},
- RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow},AncestorLevel=1}}"/>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- <DataGridTextColumn Width="*" Binding="{Binding LineName}">
- <DataGridTextColumn.Header>
- <TextBlock Text="{DynamicResource cm.lineName}"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- <DataGridTextColumn Width="*" Binding="{Binding ProductModel}">
- <DataGridTextColumn.Header>
- <TextBlock Text="{DynamicResource cm.productModel}"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- <DataGridTextColumn Width="*" Binding="{Binding CustomProperty}">
- <DataGridTextColumn.Header>
- <TextBlock Text="{DynamicResource cm.customProperty}"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- <!--<DataGridTextColumn Width="*" Binding="{Binding Workstation}">
- <DataGridTextColumn.Header>
- <TextBlock Text="{DynamicResource cm.workstation}"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>-->
- <DataGridTextColumn Width="*" Binding="{Binding ChangeTime}">
- <DataGridTextColumn.Header>
- <TextBlock Text="{DynamicResource cm.changeTime}"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- <DataGridTextColumn Width="*" Binding="{Binding ChangeResult}">
- <DataGridTextColumn.Header>
- <TextBlock Text="{DynamicResource cm.changeResult}"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- <DataGridTextColumn Width="*" Binding="{Binding Info}">
- <DataGridTextColumn.Header>
- <TextBlock Text="{DynamicResource cm.info}"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- </DataGrid.Columns>
- </DataGrid>
- </Grid>
- </Border>
-</hb:SimpleMaskControl>
diff --git a/Plugin.ChangeModel/ChangeModel.xaml.cs b/Plugin.ChangeModel/ChangeModel.xaml.cs
deleted file mode 100644
index 9bab845..0000000
--- a/Plugin.ChangeModel/ChangeModel.xaml.cs
+++ /dev/null
@@ -1,430 +0,0 @@
-锘縰sing CommunityToolkit.Mvvm.ComponentModel;
-using HMI.Base;
-using HMI.Core.Entity;
-using HMI.Core.Manager;
-using HMI.Core.Util;
-using HMI.UI.Util;
-using LSMSInterface;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using Plugin.ChangeModel.Entity;
-using System.Collections.ObjectModel;
-using System.Data;
-using System.IO;
-using System.Windows;
-using System.Windows.Controls;
-
-namespace Plugin.ChangeModel
-{
- /// <summary>
- /// ChangeModel.xaml 鐨勪氦浜掗�昏緫
- /// </summary>
- [ObservableObject]
- public partial class ChangeModel : SimpleMaskControl
- {
- public ChangeModel()
- {
- api = new LSMSApi();
- DataContext = this;
- InitializeComponent();
- }
-
- [ObservableProperty]
- private ObservableCollection<CmLogData> datasource;
-
- [ObservableProperty]
- private ObservableCollection<string> lineNameSource;
-
- [ObservableProperty]
- private ObservableCollection<string> workorderSource;
-
- [ObservableProperty]
- private ObservableCollection<string> productModelSource;
-
- [ObservableProperty]
- private string currentLineName;
- [ObservableProperty]
- private string currentWorkorder;
- [ObservableProperty]
- private string currentProductModel;
- [ObservableProperty]
- private Visibility workOrderVisiable = Visibility.Collapsed;
-
- private string configLineName;
- private string mesIp;
- private int mesPort;
- private LSMSApi api;
- private bool isMesConnected = false;
- private SqliteHelper sqliteHelper;
-
- public void ConnectMes()
- {
- string msg = string.Empty;
- try
- {
- if (api.Connect(this.mesIp, this.mesPort, ref msg))
- {
- isMesConnected = true;
- }
- else
- {
- throw new Exception(msg);
- }
- }
- catch (Exception ex)
- {
- isMesConnected = false;
- log.Error("ConnectMes Failed.", ex);
- MsgBoxHelper.Error(Window.GetWindow(this), this.lang("cm.mesConnectFail", ex.Message));
- }
- }
-
- public override void InitFinish()
- {
- base.InitFinish();
- ParameterData parameter;
- try
- {
- parameter = ParameterManager.GetCommonParameterByName("MesIp");
- mesIp = parameter.Value;
- }
- catch
- {
- mesIp = "127.0.0.1";
- }
- try
- {
- parameter = ParameterManager.GetCommonParameterByName("MesPort");
- mesPort = int.Parse(parameter.Value);
- }
- catch
- {
- mesPort = 9909;
- }
-
- try
- {
- parameter = ParameterManager.GetCommonParameterByName("ChangeModelByWorkOrder");
- var res = bool.Parse(parameter.Value);
- if (res) WorkOrderVisiable = Visibility.Visible;
- }
- catch
- {
- WorkOrderVisiable = Visibility.Collapsed;
- }
-
- try
- {
- var dbPath = Path.Combine(BaseFolder, "ChangeModel.db");
- if (!File.Exists(dbPath))
- {
- SqliteHelper.CreateDatabase(dbPath);
- }
- sqliteHelper = new SqliteHelper(dbPath);
- sqliteHelper.ExecuteSql(@"CREATE TABLE IF NOT EXISTS change_model_record (
- id INTEGER PRIMARY KEY AUTOINCREMENT,
- lineName TEXT NOT NULL,
- workOrder TEXT,
- productModel TEXT NOT NULL,
- customProperty TEXT,
- changeTime TIME,
- changeResult TEXT,
- info TEXT);");
- }
- catch (Exception ex)
- {
- log.Error("Init ChangeModel DB Failed.", ex);
- }
- }
-
- public override void Active()
- {
- base.Active();
- if (!isMesConnected)
- {
- ConnectMes();
- RefreshLineNameSource();
- }
- }
-
- public override void DoClose(object sender, EventArgs e)
- {
- try
- {
- sqliteHelper?.Dispose();
- string errMsg = string.Empty;
- api?.DisConnect(ref errMsg);
- base.DoClose(sender, e);
- }
- catch {
- }
- }
-
- private void RefreshLineNameSource()
- {
- try
- {
- if (PingMes(out string errMsg))
- {
- string lineStr = api.GetAllLine();
- JObject job = (JObject)JsonConvert.DeserializeObject(lineStr);
- LineNameSource = new ObservableCollection<string>(job["ProductLines"].ToString().Split(','));
- try
- {
- var parameter = ParameterManager.GetCommonParameterByName("LineName");
- configLineName = parameter.Value;
- CurrentLineName = parameter.Value;
- }
- catch
- {
-
- }
- }
- else
- {
- throw new Exception(errMsg);
- }
- }
- catch (Exception ex)
- {
- log.Error("RefreshLineNameSource Failed.", ex);
- MsgBoxHelper.ErrorMessage(Window.GetWindow(this), this.lang("cm.rfhLineNameFail", ex.Message));
- }
- }
-
- private void RefreshWorkOrderByLineName(string lineName)
- {
- try
- {
- if (PingMes(out string errMsg))
- {
- string workOrderStr = api.GetWorkOrderByLineName(lineName, out errMsg);
- if (string.IsNullOrEmpty(errMsg))
- {
- JObject res = (JObject)JsonConvert.DeserializeObject(workOrderStr);
- JArray workOrders = (JArray)res["Data"];
- WorkorderSource = new ObservableCollection<string>(workOrders.Select(j => j["Code"].ToString()).ToArray());
- }
-
- string infoStr = api.GetProductInfoByLineName(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.FFF"), lineName, out errMsg);
- if (string.IsNullOrEmpty(errMsg))
- {
- JObject job = JsonConvert.DeserializeObject(infoStr) as JObject;
- CurrentWorkorder = job["Order"]?.ToString();
- }
- }
- else
- {
- throw new Exception(errMsg);
- }
- }
- catch (Exception ex)
- {
- log.Error("RefreshWorkOrderByLineName Failed.", ex);
- MsgBoxHelper.ErrorMessage(Window.GetWindow(this), this.lang("cm.rfhWorkOrderFail", ex.Message));
- }
- }
-
- private void RefreshProductByLineName(string lineName)
- {
- try
- {
- if (PingMes(out string errMsg))
- {
- string workOrderStr = api.GetProductsByLineName(lineName, out string ErrMsg);
- if (string.IsNullOrEmpty(errMsg))
- {
- JObject res = (JObject)JsonConvert.DeserializeObject(workOrderStr);
- JArray arr = res["Products"] as JArray;
- ProductModelSource = new ObservableCollection<string>(arr.Select(j => j["model"].ToString()).ToArray());
- }
-
- string lineStr = api.GetProductInfoByLineName(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.FFF"), lineName, out errMsg);
- if (string.IsNullOrEmpty(errMsg))
- {
- JObject job = (JObject)JsonConvert.DeserializeObject(lineStr);
- CurrentProductModel = job["Model"]?.ToString();
- }
- }
- else
- {
- throw new Exception(errMsg);
- }
- }
- catch (Exception ex)
- {
- log.Error("RefreshProductByLineName Failed.", ex);
- MsgBoxHelper.ErrorMessage(Window.GetWindow(this), this.lang("cm.rfhModelFail", ex.Message));
- }
- }
-
- private void MesChangeModel()
- {
- ShowMask(() =>
- {
- if (PingMes(out string errMsg))
- {
- var info = new Dictionary<string, object>() {
- { "Model",CurrentProductModel}
- };
- if (WorkOrderVisiable == Visibility.Visible)
- {
- info["Order"] = CurrentWorkorder;
- }
- if (!api.ChangeModel2(CurrentLineName, info, out errMsg))
- {
- throw new Exception(errMsg);
- }
- sqliteHelper.ExecuteSql($@"INSERT INTO change_model_record (lineName, workOrder,productModel, customProperty,
-changeTime,changeResult,info) Values
-('{CurrentLineName}','{CurrentWorkorder}','{CurrentProductModel}',NULL,'{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.FFF")}', 'OK', NULL)");
- RefreshLog();
- if (!api.RefreshCache(out errMsg))
- {
- throw new Exception($"Refresh MES Cache Failed.: {errMsg}");
- }
- ToastHelper.Success("鎹㈠瀷鎴愬姛");
- }
- else
- {
- throw new Exception(errMsg);
- }
- },
- (ex) =>
- {
- log.Error("MesChangeModel Failed.", ex);
- MsgBoxHelper.ErrorMessage(Window.GetWindow(this), this.lang("cm.changeFail", ex.Message));
- }, "璇风◢鍚�", "鎹㈠瀷涓�...");
- }
-
-
-
- private bool PingMes(out string errMsg)
- {
- errMsg = string.Empty;
- if (!isMesConnected)
- {
- errMsg = "MES鏈繛鎺ワ紝璇峰厛杩炴帴MES";
- return false;
- }
- try
- {
- if (!api.IsConnect(ref errMsg))
- {
- isMesConnected = false;
- return false;
- }
- return true;
- }
- catch (Exception ex)
- {
- errMsg = ex.Message;
- isMesConnected = false;
- return false;
- }
- }
-
- private void RefreshLog()
- {
- try
- {
- DataTable dt = sqliteHelper.GetDataTable(@"SELECT lineName AS LineName
-,productModel AS ProductModel
-,customProperty AS CustomProperty
-,changeTime AS ChangeTime
-,changeResult AS ChangeResult
-,info AS Info
-FROM change_model_record order by changeTime desc limit 100;");
- this.Dispatcher.BeginInvoke((Action)delegate ()
- {
- table.ItemsSource = dt.DefaultView;
- });
- }
- catch (Exception ex)
- {
- log.Error("Refresh ChangeModel Log Failed.", ex);
- ToastHelper.Error(this.lang("cm.rfhLogFail", ex.Message));
- }
- }
-
- partial void OnCurrentLineNameChanged(string lineName)
- {
- RefreshWorkOrderByLineName(lineName);
- RefreshProductByLineName(lineName);
- }
-
-
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- switch ((sender as Button).Name)
- {
- case "changeModelBtn":
- DoChangeModel();
- break;
- case "refreshLogBtn":
- ShowMask(RefreshLog, null, "璇风◢鍚�", "姝e湪鍒锋柊...");
- break;
- case "refreshInfoBtn":
- RefreshInfo();
- break;
- case "deleteLogBtn":
- DeleteLog();
- break;
- default:
- break;
- }
- }
-
- private void DeleteLog()
- {
- if (MsgBoxHelper.WarnMessage(this, this.lang("cm.makeSureDelLog")) != MessageBoxResult.OK)
- {
- return;
- }
- ShowMask(() =>
- {
- try
- {
- sqliteHelper.ExecuteSql($@"DELETE FROM change_model_record WHERE ID NOT IN
-(SELECT id FROM change_model_record Order by changeTime DESC limit 10);");
- RefreshLog();
- }
- catch (Exception ex)
- {
- log.Error("DeleteLog Failed.", ex);
- ToastHelper.Error(this.lang("cm.delLogFail", ex.Message));
- }
- }, null, "璇风◢鍚�", "姝e湪娓呯悊...");
- }
-
- private void RefreshInfo()
- {
- try
- {
- RefreshLineNameSource();
- RefreshWorkOrderByLineName(CurrentLineName);
- RefreshProductByLineName(CurrentLineName);
- }
- catch (Exception ex)
- {
- log.Error("Refresh Info Failed.", ex);
- ToastHelper.Error(this.lang("cm.rfhInfoErr", ex.Message));
- }
- }
-
- private void DoChangeModel()
- {
- if (string.IsNullOrEmpty(CurrentLineName) || string.IsNullOrEmpty(CurrentProductModel)) return;
- if (MsgBoxHelper.WarnMessage(this, this.lang("cm.makeSureChangeModel")) != MessageBoxResult.OK)
- {
- return;
- }
- MesChangeModel();
- }
-
- private void SimpleControl_Loaded(object sender, RoutedEventArgs e)
- {
- RefreshLog();
- }
- }
-}
diff --git a/Plugin.ChangeModel/Entity/CmLogData.cs b/Plugin.ChangeModel/Entity/CmLogData.cs
deleted file mode 100644
index 2e03437..0000000
--- a/Plugin.ChangeModel/Entity/CmLogData.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-锘縩amespace Plugin.ChangeModel.Entity
-{
- public class CmLogData
- {
- public string LineName { get; set; }
- public string ProductModel { get; set; }
- public string CustomProperty { get; set; }
- public string Workstation { get; set; }
- public DateTime ChangeTime { get; set; }
- public string ChangeResult { get; set; }
- public string Info { get; set; }
- }
-}
diff --git a/Plugin.ChangeModel/Entity/ModelData.cs b/Plugin.ChangeModel/Entity/ModelData.cs
deleted file mode 100644
index 2bfe432..0000000
--- a/Plugin.ChangeModel/Entity/ModelData.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Plugin.ChangeModel.Entity
-{
- public class ModelData
- {
- public string Model { get; set; }
- }
-}
diff --git a/Plugin.ChangeModel/Entity/WorkOrderData.cs b/Plugin.ChangeModel/Entity/WorkOrderData.cs
deleted file mode 100644
index 3384765..0000000
--- a/Plugin.ChangeModel/Entity/WorkOrderData.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-锘縩amespace Plugin.ChangeModel.Entity
-{
- public class WorkOrderData
- {
- public string Code { get; set; }
- }
-}
diff --git a/Plugin.ChangeModel/Plugin.ChangeModel.csproj b/Plugin.ChangeModel/Plugin.ChangeModel.csproj
deleted file mode 100644
index c85ac8f..0000000
--- a/Plugin.ChangeModel/Plugin.ChangeModel.csproj
+++ /dev/null
@@ -1,27 +0,0 @@
-锘�<Project Sdk="Microsoft.NET.Sdk">
-
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <TargetFramework>net472</TargetFramework>
- <Nullable>enable</Nullable>
- <LangVersion>10.0</LangVersion>
- <ImplicitUsings>enable</ImplicitUsings>
- <UseWPF>true</UseWPF>
- <Platforms>AnyCPU;x64</Platforms>
- </PropertyGroup>
-
- <ItemGroup>
- <PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
- <PackageReference Include="log4net" Version="3.0.4" />
- <PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.135" />
- <PackageReference Include="Panuon.WPF.UI" Version="1.3.0.2" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="..\..\MesApi\lmes.csproj" />
- <ProjectReference Include="..\HMI.Base\HMI.Base.csproj" />
- <ProjectReference Include="..\HMI.Core\HMI.Core.csproj" />
- <ProjectReference Include="..\HMI.UI\HMI.UI.csproj" />
- </ItemGroup>
-
-</Project>
diff --git a/Plugin.ChangeModel/AssemblyInfo.cs b/Plugin.CurrentSensorControl/AssemblyInfo.cs
similarity index 86%
rename from Plugin.ChangeModel/AssemblyInfo.cs
rename to Plugin.CurrentSensorControl/AssemblyInfo.cs
index cc29e7f..d33879c 100644
--- a/Plugin.ChangeModel/AssemblyInfo.cs
+++ b/Plugin.CurrentSensorControl/AssemblyInfo.cs
@@ -1,3 +1,4 @@
+using HMI.Core.Annotation;
using System.Windows;
[assembly:ThemeInfo(
@@ -8,3 +9,4 @@
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
+[assembly: PluginClassName("Plugin.CurrentSensorControl.ControlPage")]
diff --git a/Plugin.CurrentSensorControl/BurnInCell.xaml b/Plugin.CurrentSensorControl/BurnInCell.xaml
new file mode 100644
index 0000000..cd24846
--- /dev/null
+++ b/Plugin.CurrentSensorControl/BurnInCell.xaml
@@ -0,0 +1,65 @@
+锘�<UserControl x:Class="Plugin.CurrentSensorControl.BurnInCell"
+ 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:Plugin.CurrentSensorControl"
+ mc:Ignorable="d"
+
+ xmlns:hb="clr-namespace:HMI.Base;assembly=HMI.Base"
+xmlns:uic="clr-namespace:HMI.UI.Converter;assembly=HMI.UI"
+xmlns:ui="clr-namespace:HMI.UI;assembly=HMI.UI"
+xmlns:mdi="clr-namespace:HMI.UI.MDI;assembly=HMI.UI"
+xmlns:pw="https://opensource.panuon.com/wpf"
+xmlns:pu="https://opensource.panuon.com/wpf-ui"
+xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
+ d:DesignHeight="450" d:DesignWidth="800">
+ <UserControl.Resources>
+ <Style TargetType="pu:Switch">
+ <Setter Property="ContentPlacement" Value="Left" />
+ <Setter Property="BoxHeight" Value="16" />
+ <Setter Property="CheckedBackground" Value="{StaticResource GreenVerBar}" />
+ <Setter Property="Background" Value="{StaticResource DangerColor}" />
+ <Setter Property="ToggleSize" Value="10" />
+ <Setter Property="ToggleShadowColor" Value="{x:Null}" />
+ </Style>
+ </UserControl.Resources>
+
+ <GroupBox Header="{Binding Header}">
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition />
+ <RowDefinition />
+ </Grid.RowDefinitions>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition/>
+ <ColumnDefinition/>
+ </Grid.ColumnDefinitions>
+
+ <pu:Switch Grid.Row="0" Grid.Column="0" CheckedContent="鐢垫簮寮�" x:Name="powerSw"
+ IsChecked="{Binding PowerStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
+ Content="鐢垫簮鍏�"/>
+
+ <pu:Switch Grid.Row="0" Grid.Column="1" CheckedContent="婵�娲�" x:Name="activationSw"
+IsChecked="{Binding ActivationStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
+Content="鏈縺娲�"/>
+
+ <pu:Switch Grid.Row="1" Grid.Column="0" CheckedContent="OK浜�" x:Name="okLightSw"
+ IsChecked="{Binding OkLightOn,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
+Content="OK鐏�"/>
+
+
+ <pu:Switch Grid.Row="1" Grid.Column="1" CheckedContent="NG浜�" x:Name="ngLightSw"
+ IsChecked="{Binding NgLightOn,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
+Content="NG鐏�"/>
+
+ <!--<ui:LightBall Grid.Row="1" Grid.Column="0" Value="{Binding CellStatus}" Content="OK/NG鐘舵��"/>-->
+
+ <!--<TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding PowerStatus}"/>
+
+ <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding ActivationStatus}"/>-->
+
+
+ </Grid>
+ </GroupBox>
+</UserControl>
diff --git a/Plugin.CurrentSensorControl/BurnInCell.xaml.cs b/Plugin.CurrentSensorControl/BurnInCell.xaml.cs
new file mode 100644
index 0000000..4d54296
--- /dev/null
+++ b/Plugin.CurrentSensorControl/BurnInCell.xaml.cs
@@ -0,0 +1,179 @@
+锘縰sing CommunityToolkit.Mvvm.ComponentModel;
+using HslCommunication.Profinet.Siemens;
+using Plugin.CurrentSensorControl.Entity;
+using System.Windows.Controls;
+
+namespace Plugin.CurrentSensorControl
+{
+ /// <summary>
+ /// BurnInOven.xaml 鐨勪氦浜掗�昏緫
+ /// </summary>
+ [ObservableObject]
+ public partial class BurnInCell : UserControl
+ {
+ private BaseConfig config;
+
+ [ObservableProperty]
+ private string header;
+
+ [ObservableProperty]
+ private string req;
+
+ [ObservableProperty]
+ private bool lightOK;
+
+ [ObservableProperty]
+ private bool lightNG;
+
+ private bool powerStatus;
+
+ public bool PowerStatus
+ {
+ get => powerStatus;
+ set
+ {
+ try
+ {
+ string name = $"Oven{ovenIndex + 1}_Cell{cellIndex + 1}_Power";
+ if (S7Context.WriteData(api, name, value))
+ {
+ powerStatus = value;
+ OnPropertyChanged(nameof(PowerStatus));
+ }
+ }
+ catch (Exception ex)
+ {
+
+ }
+ }
+ }
+
+ private bool activationStatus;
+ public bool ActivationStatus
+ {
+ get => activationStatus;
+ set
+ {
+
+ try
+ {
+ string name = $"Oven{ovenIndex + 1}_Cell{cellIndex + 1}_Activation";
+ if (S7Context.WriteData(api, name, value))
+ {
+ activationStatus = value;
+ OnPropertyChanged(nameof(ActivationStatus));
+ }
+ }
+ catch (Exception ex)
+ {
+
+ }
+ }
+ }
+
+ private bool okLightOn;
+ public bool OkLightOn
+ {
+ get => okLightOn;
+ set
+ {
+
+ try
+ {
+ string name = $"Oven{ovenIndex + 1}_Cell{cellIndex + 1}_Light_OK";
+ if (S7Context.WriteData(api, name, value))
+ {
+ okLightOn = value;
+ OnPropertyChanged(nameof(OkLightOn));
+ }
+ }
+ catch (Exception ex)
+ {
+
+ }
+ }
+ }
+
+ private bool ngLightOn;
+ public bool NgLightOn
+ {
+ get => ngLightOn;
+ set
+ {
+
+ try
+ {
+ string name = $"Oven{ovenIndex + 1}_Cell{cellIndex + 1}_Light_NG";
+ if (S7Context.WriteData(api, name, value))
+ {
+ ngLightOn = value;
+ OnPropertyChanged(nameof(NgLightOn));
+ }
+ }
+ catch (Exception ex)
+ {
+
+ }
+ }
+ }
+
+
+
+ [ObservableProperty]
+ private bool? cellStatus;
+
+ private int ovenIndex;
+ private int cellIndex;
+ private SiemensS7Net api;
+
+ public BurnInCell(int ovenIndex, int cellIndex)
+ {
+ this.ovenIndex = ovenIndex;
+ this.cellIndex = cellIndex;
+ this.Header = $"Cell {cellIndex + 1}";
+ DataContext = this;
+ api = S7Context.Get($"1");
+ config = BaseConfig.Instance;
+ InitializeComponent();
+ }
+
+ public void Refresh()
+ {
+ try
+ {
+ string name = $"Oven{ovenIndex + 1}_Cell{cellIndex + 1}_Power";
+ object val; string errMsg;
+ if (S7Context.GetData(api, name, out val))
+ {
+ powerStatus = (bool)val;
+ OnPropertyChanged("PowerStatus");
+ }
+
+ name = $"Oven{ovenIndex + 1}_Cell{cellIndex + 1}_Activation";
+ if (S7Context.GetData(api, name, out val))
+ {
+ activationStatus = (bool)val;
+ OnPropertyChanged("ActivationStatus");
+ }
+
+ name = $"Oven{ovenIndex + 1}_Cell{cellIndex + 1}_Light_OK";
+ if (S7Context.GetData(api, name, out val))
+ {
+ okLightOn = (bool)val;
+ OnPropertyChanged("OkLightOn");
+ }
+
+ name = $"Oven{ovenIndex + 1}_Cell{cellIndex + 1}_Light_NG";
+ if (S7Context.GetData(api, name, out val))
+ {
+ ngLightOn = (bool)val;
+ OnPropertyChanged("NgLightOn");
+ }
+ }
+ catch (Exception ex)
+ {
+
+ }
+ }
+ }
+}
diff --git a/Plugin.CurrentSensorControl/BurnInOven.xaml b/Plugin.CurrentSensorControl/BurnInOven.xaml
new file mode 100644
index 0000000..dfbdb6f
--- /dev/null
+++ b/Plugin.CurrentSensorControl/BurnInOven.xaml
@@ -0,0 +1,78 @@
+锘�<UserControl x:Class="Plugin.CurrentSensorControl.BurnInOven"
+ 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:Plugin.CurrentSensorControl"
+ mc:Ignorable="d"
+
+ xmlns:hb="clr-namespace:HMI.Base;assembly=HMI.Base"
+ xmlns:uic="clr-namespace:HMI.UI.Converter;assembly=HMI.UI"
+ xmlns:ui="clr-namespace:HMI.UI;assembly=HMI.UI"
+ xmlns:mdi="clr-namespace:HMI.UI.MDI;assembly=HMI.UI"
+ xmlns:pw="https://opensource.panuon.com/wpf"
+ xmlns:pu="https://opensource.panuon.com/wpf-ui"
+ xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
+ d:DesignHeight="450" d:DesignWidth="800">
+ <UserControl.Resources>
+ <Style x:Key="ovenTb" TargetType="TextBox" BasedOn="{StaticResource EditorTextBoxStyle}">
+ <Setter Property="Height" Value="20"/>
+ <Setter Property="MinWidth" Value="60"/>
+ <Setter Property="FontSize" Value="14"/>
+ </Style>
+ </UserControl.Resources>
+
+ <GroupBox Header="{Binding Header}">
+ <Grid dp:GridHelper.Space="5" dp:GridHelper.SpaceIgnore="ALL">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition />
+ </Grid.RowDefinitions>
+ <StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal" dp:StackPanelHelper.ChildSpace="5">
+ <pu:FormGroup Header="鐘舵��">
+ <TextBox Style="{StaticResource ovenTb}" IsReadOnly="True" Text="{Binding ReqStatus}"/>
+ </pu:FormGroup>
+
+ <pu:Switch CheckedContent="鐓ф槑寮�" x:Name="lightSw"
+ CheckedBackground="Green"
+ Background="{StaticResource DangerColor}"
+ IsChecked="{Binding LightStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
+ Content="鐓ф槑鍏�"/>
+
+ <Button Background="{StaticResource PrimaryColor}" Foreground="{StaticResource PrimaryColorContract}"
+ Click="Button_Click"
+ Tag="0"
+ Content="鍋滄绛夊緟"/>
+ <Button Background="{StaticResource DangerColor}" Foreground="{StaticResource DangerColorContrast}"
+ Click="Button_Click"
+ Tag="1"
+ Content="鍔犵儹鍚姩"/>
+ <Button Background="{StaticResource SuccessColor}" Foreground="{StaticResource SuccessColorContrast}"
+ Click="Button_Click"
+ Tag="2"
+ Content="鍐峰嵈鍚姩"/>
+ </StackPanel>
+
+ <StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal" dp:StackPanelHelper.ChildSpace="5">
+ <pu:FormGroup Header="璁惧畾娓╁害">
+ <TextBox Style="{StaticResource ovenTb}" IsReadOnly="True" Text="{Binding SetTemp}"/>
+ </pu:FormGroup>
+ <pu:FormGroup Header="瀹夊叏娓╁害">
+ <TextBox Style="{StaticResource ovenTb}" IsReadOnly="True" Text="{Binding SaveTemp}"/>
+ </pu:FormGroup>
+ <pu:FormGroup Header="娓╁害涓嬮檺">
+ <TextBox Style="{StaticResource ovenTb}" IsReadOnly="True" Text="{Binding TempDown}"/>
+ </pu:FormGroup>
+ <pu:FormGroup Header="娓╁害涓婇檺">
+ <TextBox Style="{StaticResource ovenTb}" IsReadOnly="True" Text="{Binding TempUp}"/>
+ </pu:FormGroup>
+ <pu:FormGroup Header="骞冲潎娓╁害">
+ <TextBox Style="{StaticResource ovenTb}" IsReadOnly="True" Text="{Binding AvgTemp}"/>
+ </pu:FormGroup>
+ </StackPanel>
+
+ <UniformGrid Grid.Row="2" Grid.Column="0" x:Name="mainGrid"></UniformGrid>
+ </Grid>
+ </GroupBox>
+</UserControl>
diff --git a/Plugin.CurrentSensorControl/BurnInOven.xaml.cs b/Plugin.CurrentSensorControl/BurnInOven.xaml.cs
new file mode 100644
index 0000000..795e171
--- /dev/null
+++ b/Plugin.CurrentSensorControl/BurnInOven.xaml.cs
@@ -0,0 +1,233 @@
+锘縰sing CommunityToolkit.Mvvm.ComponentModel;
+using ConnectionUtil;
+using HslCommunication.Profinet.Siemens;
+using Plugin.CurrentSensorControl.Entity;
+using System.Drawing;
+using System.Windows.Controls;
+using System.Windows.Markup;
+
+namespace Plugin.CurrentSensorControl
+{
+ /// <summary>
+ /// BurnInOven.xaml 鐨勪氦浜掗�昏緫
+ /// </summary>
+ [ObservableObject]
+ public partial class BurnInOven : UserControl
+ {
+ private BaseConfig config;
+
+ private static readonly string[] datas = new string[] { "_LEDLight", "_Req", "_SetTemp", "_SaveTemp", "_TempDown", "_TempUp", "_AvgTemp" };
+
+ [ObservableProperty]
+ private string header;
+
+ [ObservableProperty]
+ private string req;
+ [ObservableProperty]
+ private string reqStatus;
+
+ [ObservableProperty]
+ private string setTemp;
+ [ObservableProperty]
+ private string saveTemp;
+ [ObservableProperty]
+ private string tempDown;
+ [ObservableProperty]
+ private string tempUp;
+ [ObservableProperty]
+ private string avgTemp;
+
+ private bool lightStatus;
+
+ public bool LightStatus
+ {
+ get => lightStatus;
+ set
+ {
+ try
+ {
+ string name = $"Oven{ovenIndex + 1}_LEDLight";
+ if (S7Context.WriteData(api, name, value))
+ {
+ lightStatus = value;
+ OnPropertyChanged(nameof(lightStatus));
+ }
+ }
+ catch (Exception ex)
+ {
+
+ }
+ }
+ }
+
+ private int ovenIndex;
+
+ private SiemensS7Net api;
+
+ private int cellCount;
+
+ private BurnInCell[] cells;
+
+ public BurnInOven(int ovenIndex)
+ {
+ this.ovenIndex = ovenIndex;
+ config = BaseConfig.Instance;
+ this.cellCount = config.PositionCount;
+ this.cells = new BurnInCell[cellCount];
+ DataContext = this;
+ api = S7Context.Get($"1");
+ InitializeComponent();
+ InitGrid();
+ }
+
+ private void InitGrid()
+ {
+ mainGrid.Columns = config.PositionColumn;
+ for (int i = 0; i < cellCount; i++)
+ {
+ var cell = new BurnInCell(ovenIndex, i);
+ cells[i] = cell;
+ mainGrid.Children.Add(cell);
+ }
+ }
+
+ public void Refresh()
+ {
+ try
+ {
+ //Task[] allTask = new Task[cells.Length];
+ //for (int i = 0; i < cells.Length; i++)
+ //{
+ // var cell = cells[i];
+ // var task = Task.Factory.StartNew(() =>
+ // {
+ // cell.Refresh();
+ // });
+ // allTask[i] = task;
+ //}
+ //Task.WaitAll(allTask);
+
+ foreach (var cell in cells)
+ {
+ cell.Refresh();
+ }
+
+ string name;
+ object v;
+ foreach (var data in datas)
+ {
+ name = $"Oven{ovenIndex + 1}{data}";
+ if (S7Context.GetData(api, name, out v))
+ {
+ var val = v?.ToString();
+ if (data == "_LEDLight")
+ {
+ lightStatus = bool.Parse(val);
+ OnPropertyChanged("LightStatus");
+ }
+ else if (data == "_Req")
+ {
+ Req = val;
+ if (val == "0")
+ {
+ ReqStatus = "鍋滄绛夊緟";
+ }
+ else if (val == "1")
+ {
+ ReqStatus = "鍔犵儹鍚姩";
+ }
+ else if (val == "2")
+ {
+ ReqStatus = "鍐峰嵈鍚姩";
+ }
+ }
+ else if (data == "_SetTemp")
+ {
+ SetTemp = val;
+ }
+ else if (data == "_SaveTemp")
+ {
+ SaveTemp = val;
+ }
+ else if (data == "_TempDown")
+ {
+ TempDown = val;
+ }
+ else if (data == "_TempUp")
+ {
+ TempUp = val;
+ }
+ else if (data == "_AvgTemp")
+ {
+ AvgTemp = val;
+ }
+ }
+
+
+ //;
+ //if (api.DoFctReadSingle(name, out string val, out _))
+ //{
+ // if (data == "_Req")
+ // {
+ // Req = val;
+ // if (val == "0")
+ // {
+ // ReqStatus = "鍋滄绛夊緟";
+ // }
+ // else if (val == "1")
+ // {
+ // ReqStatus = "鍔犵儹鍚姩";
+ // }
+ // else if (val == "2")
+ // {
+ // ReqStatus = "鍐峰嵈鍚姩";
+ // }
+ // }
+ // else if (data == "_SetTemp")
+ // {
+ // SetTemp = val;
+ // }
+ // else if (data == "_SaveTemp")
+ // {
+ // SaveTemp = val;
+ // }
+ // else if (data == "_TempDown")
+ // {
+ // TempDown = val;
+ // }
+ // else if (data == "_TempUp")
+ // {
+ // TempUp = val;
+ // }
+ // else if (data == "_AvgTemp")
+ // {
+ // AvgTemp = val;
+ // }
+ //}
+ }
+
+ //if (api.Connec (out string errMsg))
+ //{
+
+ //}
+ //else
+ //{
+ // OPCContext.Connect($"Oven{ovenIndex}");
+ // Thread.Sleep(1000);
+ //}
+ }
+ catch (Exception ex)
+ {
+
+ }
+ }
+
+ private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
+ {
+ var btn = sender as Button;
+ string name = $"Oven{ovenIndex + 1}_Cmd";
+ S7Context.WriteData(api, name, short.Parse(btn.Tag.ToString()));
+ //api.DoFctWriteSingle(name, btn.Tag.ToString(), out string errMsg);
+ }
+ }
+}
diff --git a/Plugin.CurrentSensorControl/BurnInOvenCollection.xaml b/Plugin.CurrentSensorControl/BurnInOvenCollection.xaml
new file mode 100644
index 0000000..7ff27fb
--- /dev/null
+++ b/Plugin.CurrentSensorControl/BurnInOvenCollection.xaml
@@ -0,0 +1,19 @@
+锘�<UserControl x:Class="Plugin.CurrentSensorControl.BurnInOvenCollection"
+ 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:Plugin.CurrentSensorControl"
+ mc:Ignorable="d"
+ xmlns:hb="clr-namespace:HMI.Base;assembly=HMI.Base"
+xmlns:uic="clr-namespace:HMI.UI.Converter;assembly=HMI.UI"
+xmlns:ui="clr-namespace:HMI.UI;assembly=HMI.UI"
+xmlns:mdi="clr-namespace:HMI.UI.MDI;assembly=HMI.UI"
+xmlns:pw="https://opensource.panuon.com/wpf"
+xmlns:pu="https://opensource.panuon.com/wpf-ui"
+xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
+ d:DesignHeight="450" d:DesignWidth="800">
+ <Grid x:Name="mainGrid" dp:GridHelper.Space="6">
+
+ </Grid>
+</UserControl>
diff --git a/Plugin.CurrentSensorControl/BurnInOvenCollection.xaml.cs b/Plugin.CurrentSensorControl/BurnInOvenCollection.xaml.cs
new file mode 100644
index 0000000..6da0961
--- /dev/null
+++ b/Plugin.CurrentSensorControl/BurnInOvenCollection.xaml.cs
@@ -0,0 +1,91 @@
+锘縰sing Plugin.CurrentSensorControl.Entity;
+using System.Drawing;
+using System.Windows.Controls;
+
+namespace Plugin.CurrentSensorControl
+{
+ /// <summary>
+ /// BurnInOvenCollection.xaml 鐨勪氦浜掗�昏緫
+ /// </summary>
+ public partial class BurnInOvenCollection : UserControl
+ {
+ private int rowCount;
+ private int colCount;
+ private int cellCount;
+ private BurnInOven[] ovens;
+ private BaseConfig config;
+
+ public BurnInOvenCollection()
+ {
+ config = BaseConfig.Instance;
+ InitializeComponent();
+ InitMainGrid();
+ }
+
+ public void InitMainGrid()
+ {
+ this.rowCount = config.Row;
+ this.colCount = config.Column;
+ ovens = new BurnInOven[this.rowCount * this.colCount];
+ if (config.CellCount < 0)
+ {
+ this.cellCount = rowCount * colCount;
+ }
+ else
+ {
+ this.cellCount = config.CellCount;
+ }
+ for (int r = 0; r < rowCount; r++)
+ {
+ RowDefinition row = new RowDefinition();
+ mainGrid.RowDefinitions.Add(row);
+ }
+
+ for (int c = 0; c < colCount; c++)
+ {
+ ColumnDefinition col = new ColumnDefinition();
+ mainGrid.ColumnDefinitions.Add(col);
+ }
+ string[] names = config.NameStr.Split(',');
+ for (int n = 0; n < cellCount; n++)
+ {
+ string name = n < names.Length ? names[n] : "";
+ BurnInOven child = new BurnInOven(n);
+ child.Header = name;
+ mainGrid.Children.Add(child);
+ ovens[n] = child;
+ int row = n / colCount;
+ int col = n % colCount;
+ Grid.SetRow(child, row);
+ Grid.SetColumn(child, col);
+ }
+ }
+
+ public void Refresh()
+ {
+ try
+ {
+ for (int i = 0; i < ovens.Length; i++)
+ {
+ var oven = ovens[i];
+ oven.Refresh();
+ }
+ //Task[] allTask = new Task[ovens.Length];
+ //for (int i = 0; i < ovens.Length; i++)
+ //{
+ // var oven = ovens[i];
+ // var task = Task.Factory.StartNew(() =>
+ // {
+ // oven.Refresh();
+ // });
+ // allTask[i] = task;
+ //}
+ //Task.WaitAll(allTask);
+ }
+ catch (Exception ex)
+ {
+
+ }
+ }
+ }
+}
diff --git a/Plugin.CurrentSensorControl/BurnInSettingModal.xaml b/Plugin.CurrentSensorControl/BurnInSettingModal.xaml
new file mode 100644
index 0000000..4c559d0
--- /dev/null
+++ b/Plugin.CurrentSensorControl/BurnInSettingModal.xaml
@@ -0,0 +1,159 @@
+锘�<pu:WindowX x:Class="Plugin.CurrentSensorControl.BurnInSettingModal"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:local="clr-namespace:Plugin.CurrentSensorControl"
+ xmlns:pw="https://opensource.panuon.com/wpf"
+ xmlns:pu="https://opensource.panuon.com/wpf-ui"
+ xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
+ xmlns:sys="clr-namespace:System;assembly=mscorlib"
+ mc:Ignorable="d"
+ Title="Form"
+ Width="1200"
+ Height="900"
+ WindowStartupLocation="CenterOwner"
+ Style="{StaticResource ModalWindow}">
+ <Window.Resources>
+ <ResourceDictionary>
+ <ResourceDictionary.MergedDictionaries>
+ <pu:StyleDictionary Includes="TabControl" />
+ <ResourceDictionary Source="/HMI.UI;component/Style/PanuonListView.xaml"/>
+ </ResourceDictionary.MergedDictionaries>
+ </ResourceDictionary>
+ </Window.Resources>
+ <Grid Margin="5" dp:GridHelper.Space="5" dp:GridHelper.SpaceIgnore="ALL">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition/>
+ </Grid.RowDefinitions>
+ <StackPanel Orientation="Horizontal" dp:StackPanelHelper.ChildSpace="10">
+ <Button Style="{StaticResource ExportBtn}" x:Name="exportBtn" Click="Button_Click"/>
+ <Button Style="{StaticResource ImportBtn}" x:Name="importBtn" Click="Button_Click"/>
+ </StackPanel>
+ <ListView Grid.Row="1" Style="{StaticResource DefaultListTable}" x:Name="table"
+ ItemsSource="{Binding Datasource}"
+ VirtualizingPanel.IsContainerVirtualizable="True"
+VirtualizingPanel.IsVirtualizing="True"
+VirtualizingPanel.VirtualizationMode="Standard">
+ <ListView.Resources>
+ <Style x:Key="RowLink" TargetType="Button" BasedOn="{StaticResource LinkButton}">
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding Path=IsMouseOver,
+ RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ListViewItem,AncestorLevel=1}}"
+ Value="True">
+ <Setter Property="Foreground" Value="#FFF"/>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Path=IsSelected,
+ RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ListViewItem,AncestorLevel=1}}"
+Value="True">
+ <Setter Property="Foreground" Value="#FFF"/>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+
+ <Style x:Key="DeleteLink" TargetType="Button" BasedOn="{StaticResource DangerLinkButton}">
+ <Setter Property="Content" Value="{DynamicResource App.Delete}"/>
+ </Style>
+
+ <Style x:Key="EditLink" TargetType="Button" BasedOn="{StaticResource RowLink}">
+ <Setter Property="Content" Value="{DynamicResource App.Edit}"/>
+ </Style>
+ </ListView.Resources>
+ <ListView.View>
+ <GridView AllowsColumnReorder="False">
+ <GridViewColumn Width="60" Header="#">
+ <GridViewColumn.CellTemplate>
+ <DataTemplate>
+ <TextBlock Text="{Binding Converter={StaticResource lvRowNumber},
+RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ListViewItem,AncestorLevel=1}}"/>
+ </DataTemplate>
+ </GridViewColumn.CellTemplate>
+ </GridViewColumn>
+
+ <GridViewColumn Width="200">
+ <GridViewColumn.Header>
+ <TextBlock Text="Name"/>
+ </GridViewColumn.Header>
+ <GridViewColumn.CellTemplate>
+ <DataTemplate>
+ <Border Style="{StaticResource CellBorder}">
+ <TextBlock Style="{StaticResource ListTableTextBlock}"
+ Text="{Binding Name}"/>
+ </Border>
+ </DataTemplate>
+ </GridViewColumn.CellTemplate>
+ </GridViewColumn>
+ <GridViewColumn Width="100">
+ <GridViewColumn.Header>
+ <TextBlock Text="Address"/>
+ </GridViewColumn.Header>
+ <GridViewColumn.CellTemplate>
+ <DataTemplate>
+ <Border Style="{StaticResource CellBorder}">
+ <TextBlock Style="{StaticResource ListTableTextBlock}"
+ Text="{Binding Address}"/>
+ </Border>
+ </DataTemplate>
+ </GridViewColumn.CellTemplate>
+ </GridViewColumn>
+ <GridViewColumn Width="120">
+ <GridViewColumn.Header>
+ <TextBlock Text="Type"/>
+ </GridViewColumn.Header>
+ <GridViewColumn.CellTemplate>
+ <DataTemplate>
+ <Border Style="{StaticResource CellBorder}">
+ <TextBlock Style="{StaticResource ListTableTextBlock}"
+ Text="{Binding Type}"/>
+ </Border>
+ </DataTemplate>
+ </GridViewColumn.CellTemplate>
+ </GridViewColumn>
+ <GridViewColumn Width="120">
+ <GridViewColumn.Header>
+ <TextBlock Text="Length"/>
+ </GridViewColumn.Header>
+ <GridViewColumn.CellTemplate>
+ <DataTemplate>
+ <Border Style="{StaticResource CellBorder}">
+ <TextBlock Style="{StaticResource ListTableTextBlock}"
+Text="{Binding Length}"/>
+ </Border>
+ </DataTemplate>
+ </GridViewColumn.CellTemplate>
+ </GridViewColumn>
+ <GridViewColumn Width="120">
+ <GridViewColumn.Header>
+ <TextBlock Text="Desc"/>
+ </GridViewColumn.Header>
+ <GridViewColumn.CellTemplate>
+ <DataTemplate>
+ <Border Style="{StaticResource CellBorder}">
+ <TextBlock Style="{StaticResource ListTableTextBlock}"
+ Text="{Binding Description}"/>
+ </Border>
+ </DataTemplate>
+ </GridViewColumn.CellTemplate>
+ </GridViewColumn>
+ <GridViewColumn Width="120">
+ <GridViewColumn.Header>
+ <TextBlock Text="{DynamicResource App.Opt}"/>
+ </GridViewColumn.Header>
+ <GridViewColumn.CellTemplate>
+ <DataTemplate>
+ <StackPanel Orientation="Horizontal" dp:StackPanelHelper.ChildSpace="10">
+ <Button x:Name="editBtn" Style="{StaticResource EditLink}"
+ Click="Button_Click" Tag="{Binding }"/>
+
+ <Button x:Name="delBtn" Style="{StaticResource DeleteLink}"
+ Click="Button_Click" Tag="{Binding }"/>
+ </StackPanel>
+ </DataTemplate>
+ </GridViewColumn.CellTemplate>
+ </GridViewColumn>
+ </GridView>
+ </ListView.View>
+ </ListView>
+ </Grid>
+</pu:WindowX>
diff --git a/Plugin.CurrentSensorControl/BurnInSettingModal.xaml.cs b/Plugin.CurrentSensorControl/BurnInSettingModal.xaml.cs
new file mode 100644
index 0000000..4269ecb
--- /dev/null
+++ b/Plugin.CurrentSensorControl/BurnInSettingModal.xaml.cs
@@ -0,0 +1,143 @@
+锘縰sing HMI.UI.DpUtil;
+using HMI.UI.Util;
+using HMI.Util;
+using Microsoft.Win32;
+using Panuon.WPF.UI;
+using Plugin.CurrentSensorControl.Entity;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Windows.Controls;
+
+namespace Plugin.CurrentSensorControl
+{
+ /// <summary>
+ /// ModalWindow.xaml 鐨勪氦浜掗�昏緫
+ /// </summary>
+ public partial class BurnInSettingModal : WindowX
+ {
+ public BurnInSettingModal()
+ {
+ this.DataContext = this;
+ InitializeComponent();
+ }
+
+ private ObservableCollection<PLCTagData> datasource;
+
+ public ObservableCollection<PLCTagData> Datasource
+ {
+ get => datasource;
+ set
+ {
+ Set(ref datasource, value);
+ }
+ }
+
+ private bool _isProcessing;
+
+ protected override void OnClosing(CancelEventArgs e)
+ {
+ //Press Continue Button
+ if (DialogResult == true)
+ {
+ if (_isProcessing)
+ {
+ e.Cancel = true;
+ return;
+ }
+ var okButton = WindowXModalDialog.GetOKButton(this);
+ try
+ {
+ _isProcessing = true;
+ ButtonHelper.SetIsPending(okButton, true);
+
+ }
+ catch (Exception ex)
+ {
+ ToastHelper.Error(this, $"Error锛亄ex.Message}");
+ e.Cancel = true;
+ return;
+ }
+ finally
+ {
+ _isProcessing = false;
+ ButtonHelper.SetIsPending(okButton, false);
+ }
+ }
+ base.OnClosing(e);
+ }
+
+ private bool ValidateName(object value, out string err)
+ {
+ err = null;
+ //string group = TbGroup.Text;
+ //var temp = Datasource.FirstOrDefault(d => d.Group == group && d.Name == value.ToString());
+ //if (temp != null && temp != Data)
+ //{
+ // err = this.lang("App.MustBeUnique", $"{this.lang("doc.group")},{this.lang("doc.name")}");
+ // return false;
+ //}
+ return true;
+ }
+
+ private bool ValidateAddress(object value, out string err)
+ {
+ err = null;
+ //string group = TbGroup.Text;
+ //var temp = Datasource.FirstOrDefault(d => d.Address == value.ToString());
+ //if (temp != null && temp != Data)
+ //{
+ // err = this.lang("App.MustBeUnique", this.lang("doc.Address"));
+ // return false;
+ //}
+ return true;
+ }
+
+ public bool? Open( ObservableCollection<PLCTagData> datasource)
+ {
+ this.Datasource = datasource;
+ return this.ShowDialog();
+ }
+
+ private void DoExport()
+ {
+ SaveFileDialog sfd = new SaveFileDialog();
+ if (sfd.ShowDialog() == true)
+ {
+ ExcelHelper.ExportExcel(sfd.FileName, Datasource);
+ }
+ }
+
+ private void DoImport()
+ {
+ OpenFileDialog ofd = new OpenFileDialog();
+ if (ofd.ShowDialog() == true)
+ {
+ try
+ {
+ Datasource = new ObservableCollection<PLCTagData>(ExcelHelper.ReadFromExcel<PLCTagData>(ofd.FileName));
+ }
+ catch (Exception ex)
+ {
+ ControlPage.Logger.Error("Import Error.", ex);
+ ToastHelper.Error(ex.Message);
+ }
+ }
+ }
+
+ private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
+ {
+ var btn = sender as Button;
+ switch (btn.Name) {
+ case "exportBtn":
+ DoExport();
+ break;
+ case "importBtn":
+ DoImport();
+ break;
+ default:
+ break;
+ }
+
+ }
+ }
+}
diff --git a/Plugin.CurrentSensorControl/ControlPage.xaml b/Plugin.CurrentSensorControl/ControlPage.xaml
new file mode 100644
index 0000000..102c624
--- /dev/null
+++ b/Plugin.CurrentSensorControl/ControlPage.xaml
@@ -0,0 +1,284 @@
+锘�<hb:SimpleMaskControl x:Class="Plugin.CurrentSensorControl.ControlPage"
+ 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:Plugin.CurrentSensorControl"
+ mc:Ignorable="d"
+ xmlns:hb="clr-namespace:HMI.Base;assembly=HMI.Base"
+xmlns:uic="clr-namespace:HMI.UI.Converter;assembly=HMI.UI"
+xmlns:ui="clr-namespace:HMI.UI;assembly=HMI.UI"
+xmlns:mdi="clr-namespace:HMI.UI.MDI;assembly=HMI.UI"
+xmlns:pw="https://opensource.panuon.com/wpf"
+xmlns:pu="https://opensource.panuon.com/wpf-ui"
+xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
+ Loaded="SimpleMaskControl_Loaded"
+ d:DesignHeight="450" d:DesignWidth="800">
+ <UserControl.Resources>
+ <ResourceDictionary>
+ <ResourceDictionary.MergedDictionaries>
+ <pu:StyleDictionary Includes="TabControl" />
+ <ResourceDictionary Source="/HMI.UI;component/Style/PanuonListView.xaml"/>
+ </ResourceDictionary.MergedDictionaries>
+ </ResourceDictionary>
+ </UserControl.Resources>
+
+ <Border Style="{StaticResource CardBoarder}" Padding="0" Background="#FFF">
+ <TabControl
+pu:TabControlHelper.HeaderPanelAlignment="Stretch"
+pu:TabControlHelper.ItemsBackground="{DynamicResource VerBar}"
+pu:TabControlHelper.ItemsForeground="#FFFFFF"
+pu:TabControlHelper.ItemsFontSize="14"
+pu:TabControlHelper.ItemsHeight="30"
+pu:TabControlHelper.ItemsHorizontalHeaderAlignment="Left"
+pu:TabControlHelper.ItemsHoverBackground="{DynamicResource SecondPrimaryColor}"
+pu:TabControlHelper.ItemsHoverForeground="#FFFFFF"
+pu:TabControlHelper.ItemsPadding="20,0,20,0"
+pu:TabControlHelper.ItemsRibbonLineCornerRadius="4"
+pu:TabControlHelper.ItemsRibbonLineMargin="0,5,0,5"
+pu:TabControlHelper.ItemsRibbonLineThickness="4"
+pu:TabControlHelper.ItemsRibbonLineVisibility="Visible"
+pu:TabControlHelper.ItemsSelectedBackground="#FFF"
+pu:TabControlHelper.ItemsSelectedRibbonLineBrush="#FFFFFF"
+pu:TabControlHelper.ItemsSelectedRibbonLineThickness="2">
+ <TabControl.Template>
+ <ControlTemplate TargetType="{x:Type TabControl}">
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="*"/>
+ </Grid.RowDefinitions>
+ <Border BorderThickness="1,1,1,0" BorderBrush="#acacac" Background="{DynamicResource VerBar}" Padding="2,2,10,0">
+ <TabPanel x:Name="HeaderPanel" Grid.Row="0" Panel.ZIndex="1" IsItemsHost="True"/>
+ </Border>
+
+ <Border Grid.Row="1" BorderBrush="{TemplateBinding BorderBrush}"
+BorderThickness="1,0,1,1" Background="{TemplateBinding Background}">
+ <ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent"/>
+ </Border>
+ </Grid>
+ </ControlTemplate>
+ </TabControl.Template>
+ <TabItem Header="鑰佸寲璋冭瘯">
+ <Grid dp:GridHelper.Space="5" dp:GridHelper.SpaceIgnore="ALL">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition/>
+ </Grid.RowDefinitions>
+ <StackPanel Orientation="Horizontal">
+ <Button Style="{StaticResource SettingBtn}" x:Name="burnInSettingBtn" Click="Button_Click"/>
+ </StackPanel>
+
+ <local:BurnInOvenCollection Grid.Row="1" Grid.Column="0" x:Name="ovenCollection"/>
+ </Grid>
+ </TabItem>
+ <TabItem Header="鐢垫祦鐩戞帶">
+
+ <Grid dp:GridHelper.Space="8">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition/>
+ </Grid.RowDefinitions>
+
+ <DockPanel>
+ <StackPanel dp:StackPanelHelper.ChildSpace="10" DockPanel.Dock="Right" Orientation="Horizontal">
+ <Button Style="{StaticResource AddBtn}" x:Name="addBtn" Click="Button_Click"/>
+ <Button Style="{StaticResource RfhBtn}" x:Name="rfhBtn" Click="Button_Click"/>
+ <Button Style="{StaticResource ExportBtn}" x:Name="exportBtn" Click="Button_Click"/>
+ <Button Style="{StaticResource ImportBtn}" x:Name="importBtn" Click="Button_Click"/>
+ <!--<Button Style="{StaticResource DelBtn}"/>-->
+ </StackPanel>
+
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center" dp:StackPanelHelper.ChildSpace="10">
+ <pu:FormGroup FontSize="18" Header="鐢垫祦浼犳劅鍣�" Orientation="Horizontal">
+
+ </pu:FormGroup>
+ <Button Style="{StaticResource ResetBtn}"
+ x:Name="connectAllBtn" Click="Button_Click" Content="鍏ㄩ儴杩炴帴" />
+ <Button Style="{StaticResource SettingBtn}" Content="鍏ㄩ儴鏂紑" x:Name="disConnectAllBtn" Click="Button_Click"/>
+ <!--<Button Style="{StaticResource SettingBtn}" Content="璁剧疆" x:Name="settingBtn" Click="Button_Click"/>-->
+ </StackPanel>
+ </DockPanel>
+ <TabControl Grid.Row="1"
+pu:TabControlHelper.HeaderPanelAlignment="Stretch"
+pu:TabControlHelper.ItemsBackground="{DynamicResource VerBar}"
+pu:TabControlHelper.ItemsForeground="#FFFFFF"
+pu:TabControlHelper.ItemsFontSize="14"
+pu:TabControlHelper.ItemsHeight="30"
+pu:TabControlHelper.ItemsHorizontalHeaderAlignment="Left"
+pu:TabControlHelper.ItemsHoverBackground="{DynamicResource SecondPrimaryColor}"
+pu:TabControlHelper.ItemsHoverForeground="#FFFFFF"
+pu:TabControlHelper.ItemsPadding="20,0,0,0"
+pu:TabControlHelper.ItemsRibbonLineCornerRadius="4"
+pu:TabControlHelper.ItemsRibbonLineMargin="0,5,0,5"
+pu:TabControlHelper.ItemsRibbonLineThickness="4"
+pu:TabControlHelper.ItemsRibbonLineVisibility="Visible"
+pu:TabControlHelper.ItemsSelectedBackground="#FFF"
+pu:TabControlHelper.ItemsSelectedRibbonLineBrush="#FFFFFF"
+pu:TabControlHelper.ItemsSelectedRibbonLineThickness="2"
+pu:TabControlHelper.ItemsWidth="100" >
+ <TabControl.Template>
+ <ControlTemplate TargetType="{x:Type TabControl}">
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="*"/>
+ </Grid.RowDefinitions>
+ <Border BorderThickness="1,1,1,0" BorderBrush="#acacac" Background="{DynamicResource VerBar}" Padding="2,2,10,0">
+ <TabPanel x:Name="HeaderPanel" Grid.Row="0" Panel.ZIndex="1" IsItemsHost="True"/>
+ </Border>
+
+ <Border Grid.Row="1" BorderBrush="{TemplateBinding BorderBrush}"
+ BorderThickness="1,0,1,1" Background="{TemplateBinding Background}">
+ <ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent"/>
+ </Border>
+ </Grid>
+ </ControlTemplate>
+ </TabControl.Template>
+
+ <TabItem Header="鎺т欢">
+ <ScrollViewer Grid.Row="1" Grid.Column="0"
+ Style="{StaticResource DefaultScrollViewer}"
+ VerticalScrollBarVisibility="Auto">
+ <WrapPanel Background="#FFF" x:Name="diWrap"/>
+ </ScrollViewer>
+ </TabItem>
+ <TabItem Header="鍒楄〃">
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition/>
+ </Grid.RowDefinitions>
+ <ListView Grid.Row="1" Style="{StaticResource DefaultListTable}" x:Name="table"
+ ItemsSource="{Binding Datasource}"
+ VirtualizingPanel.IsContainerVirtualizable="True"
+VirtualizingPanel.IsVirtualizing="True"
+VirtualizingPanel.VirtualizationMode="Standard">
+ <ListView.Resources>
+ <Style x:Key="RowLink" TargetType="Button" BasedOn="{StaticResource LinkButton}">
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding Path=IsMouseOver,
+ RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ListViewItem,AncestorLevel=1}}"
+ Value="True">
+ <Setter Property="Foreground" Value="#FFF"/>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Path=IsSelected,
+ RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ListViewItem,AncestorLevel=1}}"
+Value="True">
+ <Setter Property="Foreground" Value="#FFF"/>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+
+ <Style x:Key="DeleteLink" TargetType="Button" BasedOn="{StaticResource DangerLinkButton}">
+ <Setter Property="Content" Value="{DynamicResource App.Delete}"/>
+ </Style>
+
+ <Style x:Key="EditLink" TargetType="Button" BasedOn="{StaticResource RowLink}">
+ <Setter Property="Content" Value="{DynamicResource App.Edit}"/>
+ </Style>
+ </ListView.Resources>
+ <ListView.View>
+ <GridView AllowsColumnReorder="False">
+ <GridViewColumn Width="60" Header="#">
+ <GridViewColumn.CellTemplate>
+ <DataTemplate>
+ <TextBlock Text="{Binding Converter={StaticResource lvRowNumber},
+RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ListViewItem,AncestorLevel=1}}"/>
+ </DataTemplate>
+ </GridViewColumn.CellTemplate>
+ </GridViewColumn>
+
+ <GridViewColumn Width="700">
+ <GridViewColumn.Header>
+ <TextBlock Text="{DynamicResource doc.name}"/>
+ </GridViewColumn.Header>
+ <GridViewColumn.CellTemplate>
+ <DataTemplate>
+ <Border Style="{StaticResource CellBorder}">
+ <TextBlock Style="{StaticResource ListTableTextBlock}"
+ Text="{Binding Name}"/>
+ </Border>
+ </DataTemplate>
+ </GridViewColumn.CellTemplate>
+ </GridViewColumn>
+ <GridViewColumn Width="100">
+ <GridViewColumn.Header>
+ <TextBlock Text="IP"/>
+ </GridViewColumn.Header>
+ <GridViewColumn.CellTemplate>
+ <DataTemplate>
+ <Border Style="{StaticResource CellBorder}">
+ <TextBlock Style="{StaticResource ListTableTextBlock}"
+ Text="{Binding Ip}"/>
+ </Border>
+ </DataTemplate>
+ </GridViewColumn.CellTemplate>
+ </GridViewColumn>
+ <GridViewColumn Width="120">
+ <GridViewColumn.Header>
+ <TextBlock Text="绔彛"/>
+ </GridViewColumn.Header>
+ <GridViewColumn.CellTemplate>
+ <DataTemplate>
+ <Border Style="{StaticResource CellBorder}">
+ <TextBlock Style="{StaticResource ListTableTextBlock}"
+ Text="{Binding Port}"/>
+ </Border>
+ </DataTemplate>
+ </GridViewColumn.CellTemplate>
+ </GridViewColumn>
+ <GridViewColumn Width="120">
+ <GridViewColumn.Header>
+ <TextBlock Text="鍦板潃"/>
+ </GridViewColumn.Header>
+ <GridViewColumn.CellTemplate>
+ <DataTemplate>
+ <Border Style="{StaticResource CellBorder}">
+ <TextBlock Style="{StaticResource ListTableTextBlock}"
+Text="{Binding Address}"/>
+ </Border>
+ </DataTemplate>
+ </GridViewColumn.CellTemplate>
+ </GridViewColumn>
+ <GridViewColumn Width="120">
+ <GridViewColumn.Header>
+ <TextBlock Text="閫氶亾"/>
+ </GridViewColumn.Header>
+ <GridViewColumn.CellTemplate>
+ <DataTemplate>
+ <Border Style="{StaticResource CellBorder}">
+ <TextBlock Style="{StaticResource ListTableTextBlock}"
+ Text="{Binding Channel}"/>
+ </Border>
+ </DataTemplate>
+ </GridViewColumn.CellTemplate>
+ </GridViewColumn>
+ <GridViewColumn Width="120">
+ <GridViewColumn.Header>
+ <TextBlock Text="{DynamicResource App.Opt}"/>
+ </GridViewColumn.Header>
+ <GridViewColumn.CellTemplate>
+ <DataTemplate>
+ <StackPanel Orientation="Horizontal" dp:StackPanelHelper.ChildSpace="10">
+ <Button x:Name="editBtn" Style="{StaticResource EditLink}"
+ Click="Button_Click" Tag="{Binding }"/>
+
+ <Button x:Name="delBtn" Style="{StaticResource DeleteLink}"
+ Click="Button_Click" Tag="{Binding }"/>
+ </StackPanel>
+ </DataTemplate>
+ </GridViewColumn.CellTemplate>
+ </GridViewColumn>
+ </GridView>
+ </ListView.View>
+ </ListView>
+ </Grid>
+ </TabItem>
+ </TabControl>
+ </Grid>
+ </TabItem>
+ </TabControl>
+ </Border>
+</hb:SimpleMaskControl>
+
diff --git a/Plugin.CurrentSensorControl/ControlPage.xaml.cs b/Plugin.CurrentSensorControl/ControlPage.xaml.cs
new file mode 100644
index 0000000..fb11a44
--- /dev/null
+++ b/Plugin.CurrentSensorControl/ControlPage.xaml.cs
@@ -0,0 +1,410 @@
+锘縰sing CommunityToolkit.Mvvm.ComponentModel;
+using ConnectionUtil;
+using HMI.Base;
+using HMI.Core.Setting;
+using HMI.Core.Util;
+using HMI.UI.Util;
+using HMI.Util;
+using log4net;
+using Microsoft.Win32;
+using Plugin.CurrentSensorControl.Entity;
+using System.Collections.ObjectModel;
+using System.IO;
+using System.Timers;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace Plugin.CurrentSensorControl
+{
+ /// <summary>
+ /// ControlPage.xaml 鐨勪氦浜掗�昏緫
+ /// </summary>
+ [ObservableObject]
+ public partial class ControlPage : SimpleMaskControl
+ {
+ [ObservableProperty]
+ private ObservableCollection<SensorData> datasource = new ObservableCollection<SensorData>();
+ private List<SingleSensor> controls = new List<SingleSensor>();
+
+ private System.Timers.Timer timer;
+ private System.Timers.Timer opcTimer;
+ private SCADAApi api;
+ public static ILog Logger { get; private set; }
+
+ private volatile bool needRead = false;
+
+ public ControlPage()
+ {
+ timer = new System.Timers.Timer();
+ timer.Elapsed += Timer_Elapsed;
+ timer.AutoReset = false;
+ timer.Interval = 1000;
+
+ opcTimer = new System.Timers.Timer();
+ opcTimer.Elapsed += OpcTimer_Elapsed; ;
+ opcTimer.AutoReset = false;
+ opcTimer.Interval = 1000;
+
+ S7Context.Init(SystemSetting.Instance.PlcIp, SystemSetting.Instance.PlcPort);
+
+ DataContext = this;
+ InitializeComponent();
+ }
+
+ private void OpcTimer_Elapsed(object sender, ElapsedEventArgs e)
+ {
+ opcTimer.Enabled = false;
+ try
+ {
+ var time = DateTime.Now;
+ ovenCollection.Refresh();
+ log.Debug($"Time Cast: {(DateTime.Now - time).TotalMilliseconds}ms");
+
+ }
+ catch (Exception ex)
+ {
+ }
+ finally
+ {
+ if (needRead) opcTimer.Enabled = true;
+ }
+ }
+
+ private void Timer_Elapsed(object sender, ElapsedEventArgs e)
+ {
+ timer.Enabled = false;
+ try
+ {
+ foreach (var ctl in controls)
+ {
+ if (!needRead) return;
+ if (ctl is SingleSensor ss)
+ {
+ ss.ReadCurrent();
+ Thread.Sleep(50);
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+
+ }
+ finally
+ {
+ if (needRead) timer.Enabled = true;
+ }
+ }
+
+ public override void InitFinish()
+ {
+ Logger = log;
+ }
+
+ public override void Active()
+ {
+ StartReadCurrent();
+ }
+
+ public override void DeActive()
+ {
+ StopReadCurrent();
+ }
+
+ public override void DoClose(object sender, EventArgs e)
+ {
+ StopReadCurrent();
+ base.DoClose(sender, e);
+ }
+
+ public void StartReadCurrent()
+ {
+ needRead = true;
+ timer.Enabled = true;
+ opcTimer.Enabled = true;
+ }
+
+ public void StopReadCurrent()
+ {
+ needRead = false;
+ timer.Enabled = false;
+ opcTimer.Enabled = false;
+ }
+
+ private void LoadSensorData()
+ {
+ string path = Path.Combine(BaseFolder, "sensor.data");
+ var list = new ObservableCollection<SensorData>();
+ try
+ {
+ if (File.Exists(path))
+ {
+ list = XmlHelper.DeserializeFromXml<ObservableCollection<SensorData>>(path);
+ }
+ }
+ catch (Exception ex)
+ {
+ log.Error("Load Sensor Data Failed.", ex);
+ }
+ Datasource = list;
+ }
+
+ private void ClearSensorControl()
+ {
+ foreach (var ctl in diWrap.Children)
+ {
+ if (ctl is SingleSensor ss)
+ {
+ ss.Close();
+ }
+ }
+ diWrap.Children.Clear();
+ controls.Clear();
+ }
+
+ private void RefreshSensorControl(bool start)
+ {
+ StopReadCurrent();
+ ClearSensorControl();
+ foreach (var data in Datasource)
+ {
+ SingleSensor ss = new SingleSensor(data.Name, data.Ip, data.Port, data.Address, data.Channel)
+ {
+ Width = 240
+ };
+ diWrap.Children.Add(ss);
+ controls.Add(ss);
+ Task.Factory.StartNew(() =>
+ {
+ ss.Connect();
+ });
+ }
+ if (start) StartReadCurrent();
+ }
+
+ private void ConnectAllSensor()
+ {
+ foreach (var ctl in diWrap.Children)
+ {
+ if (ctl is SingleSensor ss)
+ {
+ ss.Connect();
+ }
+ }
+ }
+
+ private void DisconnectAllSensor()
+ {
+ foreach (var ctl in diWrap.Children)
+ {
+ if (ctl is SingleSensor ss)
+ {
+ ss.Close();
+ }
+ }
+ }
+
+ private void SimpleMaskControl_Loaded(object sender, System.Windows.RoutedEventArgs e)
+ {
+ LoadSensorData();
+ RefreshSensorControl(needRead);
+ LoadBurnInSetting();
+ Loaded -= SimpleMaskControl_Loaded;
+ }
+
+ private void OpenDataModal(SensorData data)
+ {
+ DataModal modal = new DataModal()
+ {
+ Title = "鏂板",
+ Owner = Window.GetWindow(this)
+ };
+ if (modal.Open(data, Datasource) == true)
+ {
+ string path = Path.Combine(BaseFolder, "sensor.data");
+ try
+ {
+ XmlHelper.SerializeToXml(path, Datasource);
+ LoadSensorData();
+ RefreshSensorControl(needRead);
+ }
+ catch (Exception ex)
+ {
+ ToastHelper.Error("淇濆瓨澶辫触");
+ log.Error("Save Sensor Data Failed.", ex);
+ }
+ }
+ }
+
+ private void DoExport()
+ {
+ try
+ {
+ SaveFileDialog sfd = new SaveFileDialog();
+ sfd.Filter = "Excel 鏂囦欢 (*.xls)|*.xls";
+ if (sfd.ShowDialog() == true)
+ {
+ ExcelHelper.ExportExcel(sfd.FileName, Datasource);
+ }
+ ToastHelper.Success(this.lang("App.ExportSuccess"));
+ }
+ catch (Exception ex)
+ {
+ log.Error("Export Failed.", ex);
+ ToastHelper.Error(this.lang("App.ExportFailed"));
+ }
+ }
+
+ private void DoImport()
+ {
+ try
+ {
+ OpenFileDialog ofd = new OpenFileDialog();
+ ofd.Filter = "Excel 鏂囦欢 (*.xls)|*.xls";
+ if (ofd.ShowDialog() == true)
+ {
+ var datas = ExcelHelper.ReadFromExcel<SensorData>(ofd.FileName);
+ string path = Path.Combine(BaseFolder, "sensor.data");
+ XmlHelper.SerializeToXml(path, datas);
+ DoRefresh();
+ ToastHelper.Success(this.lang("App.ExportSuccess"));
+ }
+ }
+ catch (Exception ex)
+ {
+ log.Error("Export Failed.", ex);
+ ToastHelper.Error(this.lang("App.ExportFailed"));
+ }
+ }
+
+ private void SaveDatasouce(object datasource)
+ {
+ string path = Path.Combine(BaseFolder, "sensor.data");
+ XmlHelper.SerializeToXml(path, datasource);
+ }
+
+ private void DoRefresh()
+ {
+ ShowMask(() =>
+ {
+ Dispatcher.BeginInvoke(new Action(() =>
+ {
+ LoadSensorData();
+ RefreshSensorControl(needRead);
+ }));
+ }, (ex) =>
+ {
+ log.Error("Refresh Sensor Data Failed.", ex);
+ }, "璇风◢鍚�", "姝e湪鍔犺浇...");
+ }
+
+ private void DoDelete(SensorData data)
+ {
+ if (MsgBoxHelper2.WarnChoose("鍒犻櫎?") == MessageBoxResult.OK)
+ {
+ var index = Datasource.IndexOf(data);
+ if (index >= 0)
+ {
+ Datasource.RemoveAt(index);
+ SaveDatasouce(Datasource);
+ DoRefresh();
+ }
+ }
+ }
+
+ private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
+ {
+ var btn = sender as Button;
+ var tag = btn?.Tag;
+ switch (btn?.Name)
+ {
+ case "addBtn":
+ OpenDataModal(new SensorData());
+ break;
+ case "rfhBtn":
+ DoRefresh();
+ break;
+ case "editBtn":
+ OpenDataModal((SensorData)tag);
+ break;
+ case "delBtn":
+ DoDelete((SensorData)tag);
+ break;
+ case "connectAllBtn":
+ ConnectAllSensor();
+ break;
+ case "disConnectAllBtn":
+ DisconnectAllSensor();
+ break;
+ case "exportBtn":
+ DoExport();
+ break;
+ case "importBtn":
+ DoImport();
+ break;
+ case "burnInSettingBtn":
+ OpenBurnSettingModal();
+ break;
+ default:
+ break;
+ }
+ }
+
+ [ObservableProperty]
+ private ObservableCollection<PLCTagData> burnInSettingData;
+
+ private void LoadBurnInSetting()
+ {
+ S7Context.dataCache.Clear();
+ ObservableCollection<PLCTagData> datas;
+ try
+ {
+ string path = Path.Combine(BaseFolder, "BurnInSettingData.data");
+ if (File.Exists(path))
+ {
+ datas = XmlHelper.DeserializeFromXml<ObservableCollection<PLCTagData>>(path);
+ }
+ else
+ {
+ datas = new ObservableCollection<PLCTagData>();
+ }
+ }
+ catch (Exception ex)
+ {
+ datas = new ObservableCollection<PLCTagData>();
+ }
+ BurnInSettingData = datas;
+ LoadBurnInSettingCache();
+ }
+
+ private void LoadBurnInSettingCache()
+ {
+ foreach (var data in BurnInSettingData)
+ {
+ S7Context.dataCache[data.Name] = data;
+ }
+ }
+
+ private void OpenBurnSettingModal()
+ {
+ BurnInSettingModal modal = new BurnInSettingModal
+ {
+ Owner = Window.GetWindow(this)
+ };
+ if (modal.Open(BurnInSettingData) == true)
+ {
+ var datas = modal.Datasource;
+ try
+ {
+ string path = Path.Combine(BaseFolder, "BurnInSettingData.data");
+ XmlHelper.SerializeToXml(path, datas);
+ BurnInSettingData = datas;
+ LoadBurnInSettingCache();
+ }
+ catch (Exception ex)
+ {
+
+ }
+ }
+ }
+ }
+}
diff --git a/Plugin.CurrentSensorControl/DataModal.xaml b/Plugin.CurrentSensorControl/DataModal.xaml
new file mode 100644
index 0000000..4fbf60e
--- /dev/null
+++ b/Plugin.CurrentSensorControl/DataModal.xaml
@@ -0,0 +1,59 @@
+锘�<pu:WindowX x:Class="Plugin.CurrentSensorControl.DataModal"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:local="clr-namespace:Plugin.CurrentSensorControl"
+ xmlns:pw="https://opensource.panuon.com/wpf"
+ xmlns:pu="https://opensource.panuon.com/wpf-ui"
+ xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
+ xmlns:sys="clr-namespace:System;assembly=mscorlib"
+ mc:Ignorable="d"
+ Title="Form"
+ SizeToContent="Height"
+ Width="600"
+ WindowStartupLocation="CenterOwner"
+ Style="{StaticResource ModalWindow}">
+ <Window.Resources>
+
+ </Window.Resources>
+
+ <Grid Margin="10">
+ <StackPanel x:Name="formPanel">
+ <pu:FormGroup x:Name="FgName" Header="鍚嶇О"
+ Style="{StaticResource InputFormGroupStyle}"
+ dp:FormGroupHelper.IsRequired="True"
+ GroupName="MyFormGroup">
+ <TextBox x:Name="TbName" Style="{StaticResource EditorTextBoxStyle}" />
+ </pu:FormGroup>
+
+ <pu:FormGroup x:Name="FgIP" Header="IP"
+ Style="{StaticResource InputFormGroupStyle}"
+ dp:FormGroupHelper.IsRequired="True"
+ GroupName="MyFormGroup">
+ <TextBox x:Name="TbIP" Style="{StaticResource EditorTextBoxStyle}" />
+ </pu:FormGroup>
+
+ <pu:FormGroup x:Name="FgPort" Header="Port"
+ Style="{StaticResource InputFormGroupStyle}"
+ dp:FormGroupHelper.IsRequired="True"
+ GroupName="MyFormGroup">
+ <pu:NumberInput x:Name="NiPort" Style="{StaticResource FormNumberInput}" />
+ </pu:FormGroup>
+
+ <pu:FormGroup x:Name="FgAddress" Header="Address"
+ Style="{StaticResource InputFormGroupStyle}"
+dp:FormGroupHelper.IsRequired="True"
+GroupName="MyFormGroup">
+ <pu:NumberInput x:Name="NiAddress" Style="{StaticResource FormNumberInput}" />
+ </pu:FormGroup>
+
+ <pu:FormGroup x:Name="FgChannel" Header="Channel"
+ Style="{StaticResource InputFormGroupStyle}"
+dp:FormGroupHelper.IsRequired="True"
+GroupName="MyFormGroup">
+ <pu:NumberInput x:Name="NiChannel" Style="{StaticResource FormNumberInput}" />
+ </pu:FormGroup>
+ </StackPanel>
+ </Grid>
+</pu:WindowX>
diff --git a/Plugin.CurrentSensorControl/DataModal.xaml.cs b/Plugin.CurrentSensorControl/DataModal.xaml.cs
new file mode 100644
index 0000000..df7e617
--- /dev/null
+++ b/Plugin.CurrentSensorControl/DataModal.xaml.cs
@@ -0,0 +1,128 @@
+锘縰sing HMI.UI.DpUtil;
+using HMI.UI.Util;
+using Panuon.WPF.UI;
+using Plugin.CurrentSensorControl.Entity;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+
+namespace Plugin.CurrentSensorControl
+{
+ /// <summary>
+ /// ModalWindow.xaml 鐨勪氦浜掗�昏緫
+ /// </summary>
+ public partial class DataModal : WindowX
+ {
+ public DataModal()
+ {
+ this.DataContext = this;
+ InitializeComponent();
+ }
+
+ public SensorData data { get; private set; }
+ public ObservableCollection<SensorData> datasource { get; private set; }
+
+ private bool _isProcessing;
+
+ protected override void OnClosing(CancelEventArgs e)
+ {
+ //Press Continue Button
+ if (DialogResult == true)
+ {
+ if (_isProcessing)
+ {
+ e.Cancel = true;
+ return;
+ }
+ var okButton = WindowXModalDialog.GetOKButton(this);
+ try
+ {
+ _isProcessing = true;
+ ButtonHelper.SetIsPending(okButton, true);
+ if (!ValidateForm())
+ {
+ e.Cancel = true;
+ return;
+ }
+ SaveOrUpdateData();
+ }
+ catch (Exception ex)
+ {
+ ToastHelper.Error(this, $"Error锛亄ex.Message}");
+ e.Cancel = true;
+ return;
+ }
+ finally
+ {
+ _isProcessing = false;
+ ButtonHelper.SetIsPending(okButton, false);
+ }
+ }
+ base.OnClosing(e);
+ }
+
+ private bool ValidateName(object value, out string err)
+ {
+ err = null;
+ //string group = TbGroup.Text;
+ //var temp = Datasource.FirstOrDefault(d => d.Group == group && d.Name == value.ToString());
+ //if (temp != null && temp != Data)
+ //{
+ // err = this.lang("App.MustBeUnique", $"{this.lang("doc.group")},{this.lang("doc.name")}");
+ // return false;
+ //}
+ return true;
+ }
+
+ private bool ValidateAddress(object value, out string err)
+ {
+ err = null;
+ //string group = TbGroup.Text;
+ //var temp = Datasource.FirstOrDefault(d => d.Address == value.ToString());
+ //if (temp != null && temp != Data)
+ //{
+ // err = this.lang("App.MustBeUnique", this.lang("doc.Address"));
+ // return false;
+ //}
+ return true;
+ }
+
+ private bool ValidateForm()
+ {
+ bool flag = FormGroupHelper.ValidateForm(formPanel);
+ if (flag)
+ {
+ data.Name = TbName.Text;
+ data.Ip = TbIP.Text;
+ data.Port = ((int?)NiPort.Value) ?? 0;
+ data.Address = ((int?)NiAddress.Value) ?? 0;
+ data.Channel = ((int?)NiChannel.Value) ?? 0;
+ }
+ return flag;
+ }
+
+ private void SaveOrUpdateData()
+ {
+ var index = datasource.IndexOf(data);
+ if (index > -1)
+ {
+ datasource[index] = data;
+ }
+ else
+ {
+ datasource.Add(data);
+ }
+ }
+
+ public bool? Open(SensorData data, ObservableCollection<SensorData> datasource)
+ {
+ this.data = data;
+ this.datasource = datasource;
+ TbName.Text = data.Name;
+ TbIP.Text = data.Ip;
+ NiPort.Value = data.Port;
+ NiAddress.Value = data.Address;
+ NiChannel.Value = data.Channel;
+ return this.ShowDialog();
+ }
+ }
+}
diff --git a/Plugin.CurrentSensorControl/Entity/BaseConfig.cs b/Plugin.CurrentSensorControl/Entity/BaseConfig.cs
new file mode 100644
index 0000000..fe1c99d
--- /dev/null
+++ b/Plugin.CurrentSensorControl/Entity/BaseConfig.cs
@@ -0,0 +1,187 @@
+锘縰sing System.Collections;
+using System.Configuration;
+using System.Runtime.CompilerServices;
+
+namespace Plugin.CurrentSensorControl.Entity
+{
+ public class BaseConfig
+ {
+ private static Hashtable customConfig = (Hashtable)ConfigurationManager.GetSection("TestResultConfig");
+
+ public static readonly BaseConfig Instance = new BaseConfig();
+
+ private BaseConfig() {
+
+ }
+
+ /// <summary>
+ /// 棣栭〉甯冨眬琛屾暟
+ /// </summary>
+ private int row = 1;
+ public int Row
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? row : int.Parse(data);
+ }
+ }
+
+ private string GetValue([CallerMemberName] string propertyName = null)
+ {
+ return (customConfig != null && customConfig.ContainsKey(propertyName)) ? customConfig[propertyName].ToString() : null;
+ }
+
+ /// <summary>
+ /// 棣栭〉甯冨眬鍒楁暟
+ /// </summary>
+ private int column = 2;
+ public int Column
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? column : int.Parse(data);
+ }
+ }
+
+ /// <summary>
+ /// 鐐夋暟 -1 灏辨槸row*column
+ /// </summary>
+ private int cellCount = -1;
+ public int CellCount
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? cellCount : int.Parse(data);
+ }
+ }
+
+ /// <summary>
+ /// 鐐逛綅鍒楁暟
+ /// </summary>
+ private int positionColumn = 6;
+ public int PositionColumn
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? positionColumn : int.Parse(data);
+ }
+ }
+
+ /// <summary>
+ /// 姣忎釜鐐夊瓙鐨勭偣浣嶆暟
+ /// </summary>
+ private int positionCount = 54;
+ public int PositionCount
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? positionCount : int.Parse(data);
+ }
+ }
+
+ /// <summary>
+ /// 鏇茬嚎鏈�澶氫繚瀛樺灏戞暟鎹�
+ /// </summary>
+ private int maxSize = 10000;
+ public int MaxSize
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? maxSize : int.Parse(data);
+ }
+ }
+
+ /// <summary>
+ /// 鍥捐〃鍒锋柊棰戠巼 ms
+ /// </summary>
+ private int refreshInterval = 500;
+ public int RefreshInterval
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? refreshInterval : int.Parse(data);
+ }
+ }
+
+ /// <summary>
+ /// 鐐夊瓙鍚嶇О
+ /// </summary>
+ private string nameStr = "A,B,C,D,E,F,G";
+ public string NameStr
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? nameStr : data;
+ }
+ }
+
+ /// <summary>
+ /// 榛樿灞曠ず鐨勫浘琛ㄦ爣棰�
+ /// </summary>
+ private string mainChartTitle = "骞冲潎娓╁害";
+ public string MainChartTitle
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? mainChartTitle : data;
+ }
+ }
+
+ /// <summary>
+ /// 鍙屽嚮鎵撳紑鐨勮缁嗗浘琛ㄦ爣棰�
+ /// </summary>
+ private string detailChartTitle = "璇︾粏娓╁害";
+ public string DetailChartTitle
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? detailChartTitle : data;
+ }
+ }
+
+ /// <summary>
+ /// 绌翠綅Step鍒楄〃鏈�澶у閲�
+ /// </summary>
+ private int cellListMaxSize = 10000;
+ public int CellListMaxSize
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? cellListMaxSize : int.Parse(data);
+ }
+ }
+
+ private int portStart = 6660;
+ public int PortStart
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? portStart : int.Parse(data);
+ }
+ }
+
+ private string codeParserType;
+ public string CodeParserType
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? codeParserType : data.ToString();
+ }
+ }
+
+ public bool testing = false;
+ }
+}
diff --git a/Plugin.CurrentSensorControl/Entity/OPCContext.cs b/Plugin.CurrentSensorControl/Entity/OPCContext.cs
new file mode 100644
index 0000000..04ed98a
--- /dev/null
+++ b/Plugin.CurrentSensorControl/Entity/OPCContext.cs
@@ -0,0 +1,40 @@
+锘縰sing ConnectionUtil;
+using OPCConnection;
+
+namespace Plugin.CurrentSensorControl.Entity
+{
+ public class OPCContext
+ {
+ private static Dictionary<string, SCADAApi> cache = new Dictionary<string, SCADAApi>();
+ private static string opcIP = "127.0.0.1";
+ private static int opcPort = 6543;
+ private static int localPort = 18888;
+
+ public static SCADAApi Get(string name)
+ {
+ if (!cache.ContainsKey(name))
+ {
+ var client = new OPCClient();
+ if (!client.Connect2(opcIP, opcPort, localPort, out string errMsg))
+ {
+
+ }
+ else
+ {
+
+ }
+ cache[name] = client;
+ }
+ return cache[name];
+ }
+
+ public static bool Connect(string name)
+ {
+ if (cache.ContainsKey(name))
+ {
+ return cache[name].Connect2(opcIP, opcPort, localPort, out string errMsg) == true;
+ }
+ return false;
+ }
+ }
+}
diff --git a/Plugin.CurrentSensorControl/Entity/PLCTagData.cs b/Plugin.CurrentSensorControl/Entity/PLCTagData.cs
new file mode 100644
index 0000000..88bceb8
--- /dev/null
+++ b/Plugin.CurrentSensorControl/Entity/PLCTagData.cs
@@ -0,0 +1,25 @@
+锘縰sing HMI.Core;
+
+namespace Plugin.CurrentSensorControl.Entity
+{
+ public enum PLCTagType {
+ BOOL,
+ SHORT,
+ INT,
+ FLOAT
+ }
+
+ public class PLCTagData
+ {
+ [ExcelColumn("鍚嶇О")]
+ public string Name { get; set; }
+ [ExcelColumn("鍦板潃")]
+ public string Address { get; set; }
+ [ExcelColumn("绫诲瀷")]
+ public PLCTagType Type { get; set; }
+ [ExcelColumn("闀垮害")]
+ public int Length { get; set; }
+ [ExcelColumn("鎻忚堪")]
+ public string Description { get; set; }
+ }
+}
diff --git a/Plugin.CurrentSensorControl/Entity/S7Context.cs b/Plugin.CurrentSensorControl/Entity/S7Context.cs
new file mode 100644
index 0000000..8705ea4
--- /dev/null
+++ b/Plugin.CurrentSensorControl/Entity/S7Context.cs
@@ -0,0 +1,114 @@
+锘縰sing HslCommunication;
+using HslCommunication.Core.Pipe;
+using HslCommunication.Profinet.Siemens;
+
+namespace Plugin.CurrentSensorControl.Entity
+{
+ public class S7Context
+ {
+ private static Dictionary<string, SiemensS7Net> cache = new Dictionary<string, SiemensS7Net>();
+ public static Dictionary<string, PLCTagData> dataCache = new Dictionary<string, PLCTagData>();
+
+ private static string Ip;
+ private static int Port;
+
+ public static void Init(string ip, int port)
+ {
+ Ip = ip;
+ Port = port;
+ }
+
+
+ public static SiemensS7Net Get(string name)
+ {
+ if (!cache.ContainsKey(name))
+ {
+ var client = new SiemensS7Net(SiemensPLCS.S1500);
+ cache[name] = client;
+ PipeTcpNet pipeTcpNet = new PipeTcpNet(Ip, Port);
+ pipeTcpNet.ConnectTimeOut = 5000;
+ pipeTcpNet.ReceiveTimeOut = 10000;
+ client.CommunicationPipe = pipeTcpNet;
+ client.ConnectServer();
+ }
+ return cache[name];
+ }
+
+ public static bool Connect(string name)
+ {
+
+ return false;
+ }
+
+ public static bool GetData(SiemensS7Net api, string name, out object val)
+ {
+ val = null;
+ if (dataCache.ContainsKey(name))
+ {
+ var data = dataCache[name];
+ string address = data.Address;
+ if (data.Type == PLCTagType.BOOL)
+ {
+ var res = api.ReadBool(address);
+ val = res.Content;
+ return res.IsSuccess;
+ }
+ else if (data.Type == PLCTagType.SHORT)
+ {
+ var res = api.ReadInt16(address);
+ val = res.Content;
+ return res.IsSuccess;
+ }
+ else if (data.Type == PLCTagType.INT)
+ {
+ var res = api.ReadInt32(address);
+ val = res.Content;
+ return res.IsSuccess;
+ }
+ else if (data.Type == PLCTagType.FLOAT)
+ {
+ var res = api.ReadFloat(address);
+ val = res.Content;
+ return res.IsSuccess;
+ }
+ return false;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public static bool WriteData(SiemensS7Net api, string name, object val)
+ {
+ if (dataCache.ContainsKey(name))
+ {
+ var data = dataCache[name];
+ string address = data.Address;
+ OperateResult res;
+ switch (data.Type)
+ {
+ case PLCTagType.BOOL:
+ res = api.Write(address, (bool)val);
+ break;
+ case PLCTagType.SHORT:
+ res = api.Write(address, (short)val);
+ break;
+ case PLCTagType.INT:
+ res = api.Write(address, (int)val);
+ break;
+ case PLCTagType.FLOAT:
+ res = api.Write(address, (float)val);
+ break;
+ default:
+ return true;
+ }
+ return res.IsSuccess;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+}
diff --git a/Plugin.CurrentSensorControl/Entity/SensorData.cs b/Plugin.CurrentSensorControl/Entity/SensorData.cs
new file mode 100644
index 0000000..851a45f
--- /dev/null
+++ b/Plugin.CurrentSensorControl/Entity/SensorData.cs
@@ -0,0 +1,20 @@
+锘縰sing HMI.Core;
+
+namespace Plugin.CurrentSensorControl.Entity
+{
+ public class SensorData
+ {
+ [ExcelColumn("鍚嶇О")]
+ public string Name { get; set; }
+ [ExcelColumn("IP")]
+ public string Ip { get; set; }
+ [ExcelColumn("绔彛")]
+ public int Port { get; set; }
+
+ [ExcelColumn("鍦板潃")]
+ public int Address { get; set; }
+
+ [ExcelColumn("閫氶亾")]
+ public int Channel { get; set; }
+ }
+}
diff --git a/Plugin.CurrentSensorControl/Plugin.CurrentSensorControl.csproj b/Plugin.CurrentSensorControl/Plugin.CurrentSensorControl.csproj
new file mode 100644
index 0000000..ffbe6e2
--- /dev/null
+++ b/Plugin.CurrentSensorControl/Plugin.CurrentSensorControl.csproj
@@ -0,0 +1,44 @@
+锘�<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <OutputType>Library</OutputType>
+ <TargetFramework>net472</TargetFramework>
+ <Nullable>enable</Nullable>
+ <LangVersion>10.0</LangVersion>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <UseWPF>true</UseWPF>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
+ <PackageReference Include="log4net" Version="3.0.4" />
+ <PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.135" />
+ <PackageReference Include="Panuon.WPF.UI" Version="1.3.0.2" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\HMI.Base\HMI.Base.csproj" />
+ <ProjectReference Include="..\HMI.Core\HMI.Core.csproj" />
+ <ProjectReference Include="..\HMI.UI\HMI.UI.csproj" />
+ <ProjectReference Include="..\OPCClient\OPCClient.csproj" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <Reference Include="CurrentReadHelper">
+ <HintPath>..\..\..\..\Users\chrry\Desktop\CurrentReadHelper\builds\CurrentReadHelper.dll</HintPath>
+ </Reference>
+ <Reference Include="HslCommunication">
+ <HintPath>..\Libs\HslCommunication.dll</HintPath>
+ </Reference>
+ <Reference Include="SimensDriver">
+ <HintPath>..\Libs\SimensDriver.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+
+ <ItemGroup>
+ <Compile Update="BurnInCell.xaml.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ </ItemGroup>
+
+</Project>
diff --git a/Plugin.CurrentSensorControl/SingleSensor.xaml b/Plugin.CurrentSensorControl/SingleSensor.xaml
new file mode 100644
index 0000000..704f43b
--- /dev/null
+++ b/Plugin.CurrentSensorControl/SingleSensor.xaml
@@ -0,0 +1,74 @@
+锘�<UserControl x:Class="Plugin.CurrentSensorControl.SingleSensor"
+ 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:Plugin.CurrentSensorControl"
+ mc:Ignorable="d"
+ xmlns:hb="clr-namespace:HMI.Base;assembly=HMI.Base"
+ xmlns:uic="clr-namespace:HMI.UI.Converter;assembly=HMI.UI"
+ xmlns:ui="clr-namespace:HMI.UI;assembly=HMI.UI"
+ xmlns:mdi="clr-namespace:HMI.UI.MDI;assembly=HMI.UI"
+ xmlns:pw="https://opensource.panuon.com/wpf"
+ xmlns:pu="https://opensource.panuon.com/wpf-ui"
+ xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
+ Background="#FFF"
+ Padding="5"
+ Width="Auto"
+ d:DesignHeight="450" d:DesignWidth="800">
+ <UserControl.Resources>
+ <ResourceDictionary>
+ <ResourceDictionary.MergedDictionaries>
+ <pu:StyleDictionary Includes="TabControl" />
+ <ResourceDictionary Source="/HMI.UI;component/Style/PanuonListView.xaml"/>
+ </ResourceDictionary.MergedDictionaries>
+
+ <Style TargetType="TextBox" x:Key="labelText">
+ <Setter Property="Height" Value="35"/>
+ <Setter Property="FontSize" Value="20"/>
+ <Setter Property="VerticalContentAlignment" Value="Center"/>
+ <Setter Property="BorderThickness" Value="0"/>
+ <Setter Property="Background" Value="Transparent"/>
+ <Setter Property="Width" Value="120"/>
+ </Style>
+ </ResourceDictionary>
+ </UserControl.Resources>
+
+ <GroupBox Header="{x:Null}" Padding="5">
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="12"/>
+ </Grid.RowDefinitions>
+ <StackPanel Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Center" dp:StackPanelHelper.ChildSpace="5">
+ <!--<TextBox IsReadOnly="True" Text="{Binding SensorName}" Style="{StaticResource labelText}">
+ <TextBox.ToolTip>
+ <ToolTip Padding="5" BorderThickness="1" BorderBrush="Black" Background="Yellow" Content="1231231"/>
+ </TextBox.ToolTip>
+ </TextBox>-->
+
+ <ui:ScrollLabel Width="80" Value="{Binding SensorName}"/>
+ <ui:LightBall Size="30" Value="{Binding IsConnected}"/>
+ <Button x:Name="controlBtn" Click="controlBtn_Click">
+ <Button.Style>
+ <Style TargetType="Button" BasedOn="{StaticResource ResetBtn}">
+ <Setter Property="Content" Value="杩炴帴"/>
+ <Setter Property="Background" Value="{DynamicResource GreenVerBar}"/>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding IsConnected}" Value="True">
+ <Setter Property="Background" Value="{DynamicResource DangerVerBar}"/>
+ <Setter Property="Content" Value="鏂紑"/>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Button.Style>
+ </Button>
+ </StackPanel>
+ <pu:FormGroup Grid.Row="1" Header="鐢垫祦(A)" Style="{StaticResource InputFormGroupStyle}">
+ <TextBox IsReadOnly="True" Text="{Binding Current}" Style="{StaticResource EditorTextBoxStyle}"/>
+ </pu:FormGroup>
+ <Label Grid.Row="2" Foreground="Red" Padding="0" FontSize="10" Content="{Binding ErrMsg}"/>
+ </Grid>
+ </GroupBox>
+</UserControl>
diff --git a/Plugin.CurrentSensorControl/SingleSensor.xaml.cs b/Plugin.CurrentSensorControl/SingleSensor.xaml.cs
new file mode 100644
index 0000000..9a1b0d3
--- /dev/null
+++ b/Plugin.CurrentSensorControl/SingleSensor.xaml.cs
@@ -0,0 +1,180 @@
+锘縰sing CommunityToolkit.Mvvm.ComponentModel;
+using HslCommunication;
+using HslCommunication.ModBus;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace Plugin.CurrentSensorControl
+{
+ /// <summary>
+ /// SingleSensor.xaml 鐨勪氦浜掗�昏緫
+ /// </summary>
+ [ObservableObject]
+ public partial class SingleSensor : UserControl
+ {
+ private static Dictionary<string, ModbusRtuOverTcp> clients = new Dictionary<string, ModbusRtuOverTcp>();
+ private static Dictionary<ModbusRtuOverTcp, bool> status = new Dictionary<ModbusRtuOverTcp, bool>();
+
+ [ObservableProperty]
+ private string sensorName;
+
+ [ObservableProperty]
+ private bool isConnected;
+
+ [ObservableProperty]
+ private string current;
+
+ [ObservableProperty]
+ private string ip;
+
+ [ObservableProperty]
+ private int port;
+
+
+
+ /// <summary>
+ /// 鍦板潃(绔欏彿)
+ /// </summary>
+ [ObservableProperty]
+ private int address;
+
+ [ObservableProperty]
+ private string errMsg;
+
+ /// <summary>
+ /// 閫氶亾
+ /// </summary>
+ [ObservableProperty]
+ private int channel;
+
+ private ModbusRtuOverTcp client;
+
+
+ public SingleSensor()
+ {
+ DataContext = this;
+ InitializeComponent();
+ }
+
+ public SingleSensor(string name, string ip, int port, int address, int channel) : this()
+ {
+ SensorName = name;
+ Ip = ip;
+ Port = port;
+ Address = address;
+ Channel = channel;
+ string key = $"{Ip}:{Port}:{Address}";
+ if (!clients.ContainsKey(key))
+ {
+ client = new ModbusRtuOverTcp(Ip, Port, (byte)Address);
+ clients[key] = client;
+ }
+ else
+ {
+ client = clients[key];
+ }
+ }
+
+ private void controlBtn_Click(object sender, RoutedEventArgs e)
+ {
+ if (IsConnected)
+ {
+ this.Close();
+ }
+ else
+ {
+ Task.Factory.StartNew(() => { this.Connect(); });
+ }
+ }
+
+ public void Connect()
+ {
+ lock (client)
+ {
+ if (!status.ContainsKey(client) || !status[client])
+ {
+ var res = client.ConnectServer();
+ IsConnected = res.IsSuccess;
+ status[client] = IsConnected;
+ }
+ else
+ {
+ IsConnected = status[client];
+ }
+ }
+ }
+
+ public void ReadCurrent()
+ {
+ //if (status.ContainsKey(client) && status[client])
+ //{
+ // OperateResult<double[]> res;
+ // lock (client)
+ // {
+ // res = client.ReadDouble(channel.ToString(), 1);
+ // }
+ // Dispatcher.Invoke(() =>
+ // {
+ // if (res.IsSuccess)
+ // {
+ // Current = res.Content[0].ToString();
+ // ErrMsg = string.Empty;
+ // }
+ // else
+ // {
+ // ErrMsg = res.Message;
+ // //Close();
+ // }
+ // });
+ //}
+ //else
+ //{
+ // IsConnected = false;
+ //}
+ var sb = status[client];
+ if (IsConnected)
+ {
+ OperateResult<double[]> res;
+ lock (client)
+ {
+ res = client.ReadDouble(channel.ToString(), 1);
+ }
+ Dispatcher.Invoke(() =>
+ {
+ if (res.IsSuccess)
+ {
+ Current = res.Content[0].ToString();
+ ErrMsg = string.Empty;
+ }
+ else
+ {
+ ErrMsg = res.Message;
+ //Close();
+ }
+ });
+ }
+ }
+
+ public void Close()
+ {
+ lock (client)
+ {
+ var connected = status[client];
+ if (connected)
+ {
+ var res = client.ConnectClose();
+ if (res.IsSuccess)
+ {
+ client.Dispose();
+ }
+ IsConnected = !res.IsSuccess;
+ status[client] = IsConnected;
+ }
+ else
+ {
+ IsConnected = connected;
+ }
+ }
+ }
+ }
+}
diff --git a/Plugin.DOControl/Plugin.DOControl.csproj b/Plugin.DOControl/Plugin.DOControl.csproj
index 0d99dca..bbf2eb1 100644
--- a/Plugin.DOControl/Plugin.DOControl.csproj
+++ b/Plugin.DOControl/Plugin.DOControl.csproj
@@ -118,6 +118,7 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
+ <None Include="app.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
@@ -125,8 +126,8 @@
</None>
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\..\ConnectionUtil\ConnectionUtil\ConnectionUtil.csproj">
- <Project>{D0806FA6-3F6D-4304-81B8-EAD9DA7CB5B2}</Project>
+ <ProjectReference Include="..\ConnectionUtil\ConnectionUtil.csproj">
+ <Project>{d0806fa6-3f6d-4304-81b8-ead9da7cb5b2}</Project>
<Name>ConnectionUtil</Name>
</ProjectReference>
<ProjectReference Include="..\HMI.Base\HMI.Base.csproj">
diff --git a/Plugin.DOControl/app.config b/Plugin.DOControl/app.config
new file mode 100644
index 0000000..a0cefc2
--- /dev/null
+++ b/Plugin.DOControl/app.config
@@ -0,0 +1,11 @@
+锘�<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
+</configuration>
\ No newline at end of file
diff --git a/Plugin.DODriverControl/Api/IDIOController.cs b/Plugin.DODriverControl/Api/IDIOController.cs
index fa2252b..fa50a41 100644
--- a/Plugin.DODriverControl/Api/IDIOController.cs
+++ b/Plugin.DODriverControl/Api/IDIOController.cs
@@ -5,6 +5,7 @@
bool Start(out string msg);
bool ReadDIBool(string address, out bool res, out string msg);
+ bool ReadDIDouble(string address, out double? res, out string msg);
bool ReadDOBool(string address, out bool res, out string msg);
diff --git a/Plugin.DODriverControl/Api/ModBusTcpController.cs b/Plugin.DODriverControl/Api/ModBusTcpController.cs
index f366f5e..e1b9fbf 100644
--- a/Plugin.DODriverControl/Api/ModBusTcpController.cs
+++ b/Plugin.DODriverControl/Api/ModBusTcpController.cs
@@ -51,5 +51,13 @@
{
client?.Dispose();
}
+
+ public bool ReadDIDouble(string address, out double? res, out string msg)
+ {
+ var result = client?.ReadDouble($"x=2;{address}");
+ msg = result?.Message;
+ res = result?.Content;
+ return result?.IsSuccess == true;
+ }
}
}
diff --git a/Plugin.DODriverControl/Api/PCIController.cs b/Plugin.DODriverControl/Api/PCIController.cs
index a8d1f30..76f26b3 100644
--- a/Plugin.DODriverControl/Api/PCIController.cs
+++ b/Plugin.DODriverControl/Api/PCIController.cs
@@ -45,5 +45,10 @@
{
this.Close();
}
+
+ public bool ReadDIDouble(string address, out double? res, out string msg)
+ {
+ throw new NotImplementedException();
+ }
}
}
diff --git a/Plugin.DODriverControl/Plugin.DODriverControl.csproj b/Plugin.DODriverControl/Plugin.DODriverControl.csproj
index cb21245..f4bb201 100644
--- a/Plugin.DODriverControl/Plugin.DODriverControl.csproj
+++ b/Plugin.DODriverControl/Plugin.DODriverControl.csproj
@@ -18,11 +18,16 @@
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\..\hslCommunicationV12.0.3甯︽簮鐮乨emo\HslCommunication\HslCommunication.csproj" />
<ProjectReference Include="..\HMI.Base\HMI.Base.csproj" />
<ProjectReference Include="..\HMI.Core\HMI.Core.csproj" />
<ProjectReference Include="..\HMI.UI\HMI.UI.csproj" />
<ProjectReference Include="..\HMI.Util\HMI.Util.csproj" />
</ItemGroup>
+ <ItemGroup>
+ <Reference Include="HslCommunication">
+ <HintPath>..\Libs\HslCommunication.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+
</Project>
diff --git a/Plugin.DODriverControl/SingleControl.xaml.cs b/Plugin.DODriverControl/SingleControl.xaml.cs
index 0767cb0..2cea7ba 100644
--- a/Plugin.DODriverControl/SingleControl.xaml.cs
+++ b/Plugin.DODriverControl/SingleControl.xaml.cs
@@ -311,11 +311,21 @@
{
if (data.Dio == DIOType.DI)
{
- return new LightBall
+ if (data.ControlType == ControlType.BOOL)
{
- Size = 40,
- DataContext = data
- };
+ return new LightBall
+ {
+ Size = 40,
+ DataContext = data
+ };
+ }
+ else
+ {
+ return new TextBox
+ {
+ IsReadOnly = true
+ };
+ }
}
Style btnStyle = this.FindResource("PrimaryButton") as Style;
var btn = new Button
@@ -513,9 +523,10 @@
case ControlType.LREAL:
case ControlType.STRING:
case ControlType.WSTRING:
- ((Button)ui).Content = value;
+ ((TextBox)ui).Text = value;
break;
default:
+ ((TextBox)ui).Text = value;
break;
}
});
@@ -539,6 +550,7 @@
value = null;
return false;
}
+ string msg;
switch (data.ControlType)
{
case ControlType.BOOL:
@@ -546,11 +558,11 @@
bool res = false;
if (data.Dio == DIOType.DI)
{
- res = controller.ReadDIBool(data.Address, out val, out string msg);
+ res = controller.ReadDIBool(data.Address, out val, out msg);
}
else
{
- res = controller.ReadDOBool(data.Address, out val, out string msg);
+ res = controller.ReadDOBool(data.Address, out val, out msg);
}
if (res == true)
{
@@ -560,6 +572,10 @@
value = null;
return false;
default:
+ if (controller.ReadDIDouble(data.Address, out double? dVal, out msg))
+ {
+ value = dVal.ToString();
+ }
value = null;
return true;
}
diff --git a/Plugin.DataBoard/DataBoard.xaml b/Plugin.DataBoard/DataBoard.xaml
index d73e377..c512b0f 100644
--- a/Plugin.DataBoard/DataBoard.xaml
+++ b/Plugin.DataBoard/DataBoard.xaml
@@ -14,8 +14,11 @@
Loaded="PluginControl_Loaded"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
- <Style TargetType="ComboBox" BasedOn="{StaticResource FormComboxStyle}">
+ <Style x:Key="cbDate" TargetType="ComboBox" BasedOn="{StaticResource FormComboxStyle}">
<EventSetter Event="SelectionChanged" Handler="ComboBox_SelectionChanged"/>
+ <Setter Property="pu:ComboBoxHelper.ClearButtonVisibility" Value="Collapsed"/>
+ <Setter Property="SelectedValuePath" Value="Value"/>
+ <Setter Property="DisplayMemberPath" Value="Name"/>
</Style>
<Style TargetType="pu:DateTimePicker" BasedOn="{StaticResource TimePicker}">
<Setter Property="MinWidth" Value="0"/>
@@ -28,6 +31,7 @@
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
+ <RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
@@ -37,17 +41,32 @@
<ColumnDefinition/>
</Grid.ColumnDefinitions>
- <ComboBox x:Name="cb0" ItemsSource="{Binding Options}" SelectedValuePath="Value" DisplayMemberPath="Name"/>
+ <pu:FormGroup Header="鍨嬪彿">
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition/>
+ <ColumnDefinition Width="Auto"/>
+ </Grid.ColumnDefinitions>
+ <ComboBox x:Name="modelSelect" Style="{StaticResource FormComboxStyle}"
+ pu:ComboBoxHelper.ClearButtonVisibility="Visible" SelectionChanged="modelSelect_SelectionChanged"/>
+ <Button x:Name="btnAll" Grid.Column="1" Click="Button_Click"
+ Style="{StaticResource RfhBtn}" Content="鍏ㄩ儴鍒锋柊"/>
+ </Grid>
+ </pu:FormGroup>
- <ComboBox x:Name="cb1" Grid.Column="1" ItemsSource="{Binding Options}"
- SelectedValuePath="Value" DisplayMemberPath="Name"/>
- <ComboBox x:Name="cb2" Grid.Column="2" ItemsSource="{Binding Options}"
- SelectedValuePath="Value" DisplayMemberPath="Name"/>
+ <ComboBox Grid.Row="1" Grid.Column="0" x:Name="cb0" ItemsSource="{Binding Options}"
+ Style="{StaticResource cbDate}"/>
- <ComboBox x:Name="cb3" Grid.Column="3" ItemsSource="{Binding Options}"
- SelectedValuePath="Value" DisplayMemberPath="Name"/>
+ <ComboBox Grid.Row="1" Grid.Column="1" x:Name="cb1" ItemsSource="{Binding Options}"
+ Style="{StaticResource cbDate}"/>
- <Grid Grid.Row="1" Grid.Column="0">
+ <ComboBox Grid.Row="1" Grid.Column="2" x:Name="cb2" ItemsSource="{Binding Options}"
+ Style="{StaticResource cbDate}"/>
+
+ <ComboBox Grid.Row="1" Grid.Column="3" x:Name="cb3" ItemsSource="{Binding Options}"
+ Style="{StaticResource cbDate}"/>
+
+ <Grid Grid.Row="2" Grid.Column="0">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
@@ -63,7 +82,7 @@
Content="{DynamicResource bd.btn}"/>
</Grid>
- <Grid Grid.Row="1" Grid.Column="1">
+ <Grid Grid.Row="2" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
@@ -79,7 +98,7 @@
Content="{DynamicResource bd.btn}"/>
</Grid>
- <Grid Grid.Row="1" Grid.Column="2">
+ <Grid Grid.Row="2" Grid.Column="2">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
@@ -95,7 +114,7 @@
Content="{DynamicResource bd.btn}"/>
</Grid>
- <Grid Grid.Row="1" Grid.Column="3">
+ <Grid Grid.Row="2" Grid.Column="3">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
@@ -111,7 +130,7 @@
Content="{DynamicResource bd.btn}"/>
</Grid>
- <wv2:WebView2 Grid.Row="2" Grid.ColumnSpan="4" Name = "webview2"
+ <wv2:WebView2 Grid.Row="3" Grid.ColumnSpan="4" Name = "webview2"
SizeChanged="webview2_SizeChanged"
NavigationCompleted="Webview2_NavigationCompleted"
Loaded="webview2_Loaded"/>
diff --git a/Plugin.DataBoard/DataBoard.xaml.cs b/Plugin.DataBoard/DataBoard.xaml.cs
index 7e66211..941dc5c 100644
--- a/Plugin.DataBoard/DataBoard.xaml.cs
+++ b/Plugin.DataBoard/DataBoard.xaml.cs
@@ -1,4 +1,6 @@
锘縰sing HMI.Base;
+using HMI.Core.Entity;
+using HMI.Core.Manager;
using HMI.Core.Util;
using HMI.UI.Util;
using HMI.Util;
@@ -41,9 +43,78 @@
set { Set(ref _options, value); }
}
+ private string iniFile;
+ public override void InitFinish()
+ {
+ iniFile = Path.Combine(BaseFolder, "Config.ini");
+ if (!File.Exists(iniFile))
+ {
+ File.Create(iniFile);
+ }
+ LoadProduct();
+ }
+
private void PluginControl_Loaded(object sender, RoutedEventArgs e)
{
+ }
+
+ private void LoadProduct()
+ {
+ List<ProductData> products = ProductManager.GetProducts<List<ProductData>>()
+ ?? new List<ProductData>();
+ this.modelSelect.Items.Clear();
+ List<string> productSource = new List<string>();
+ foreach (var prd in products)
+ {
+ this.modelSelect.Items.Add(prd.Name);
+ productSource.Add(prd.Name);
+ }
+
+ string model = IniFileHelper.ReadIniData("Config", "Model", "", iniFile);
+ if (!string.IsNullOrEmpty(model))
+ {
+ this.modelSelect.SelectedItem = model;
+ }
+ else if (products.Count > 0)
+ {
+ this.modelSelect.SelectedIndex = 0;
+ }
+ }
+
+ private void RefreshAll()
+ {
+ try
+ {
+ var start0 = dtp00.SelectedDateTime ?? DateTime.Now;
+ var end0 = dtp01.SelectedDateTime ?? DateTime.Now;
+ RefreshChart0(start0, end0);
+ }
+ catch { }
+
+ try
+ {
+ var start1 = dtp10.SelectedDateTime ?? DateTime.Now;
+ var end1 = dtp11.SelectedDateTime ?? DateTime.Now;
+ RefreshChart1(start1, end1);
+ }
+ catch { }
+
+ try
+ {
+ var start2 = dtp20.SelectedDateTime ?? DateTime.Now;
+ var end2 = dtp21.SelectedDateTime ?? DateTime.Now;
+ RefreshChart2(start2, end2);
+ }
+ catch { }
+
+ try
+ {
+ var start3 = dtp30.SelectedDateTime ?? DateTime.Now;
+ var end3 = dtp31.SelectedDateTime ?? DateTime.Now;
+ RefreshChart3(start3, end3);
+ }
+ catch { }
}
private void Button_Click(object sender, RoutedEventArgs e)
@@ -52,6 +123,9 @@
DateTime start, end;
switch (btn.Name)
{
+ case "btnAll":
+ RefreshAll();
+ break;
case "btn0":
start = dtp00.SelectedDateTime ?? DateTime.Now;
end = dtp01.SelectedDateTime ?? DateTime.Now;
@@ -99,7 +173,7 @@
}
- private List<SerialData> SelectSerialDataByTime(DateTime start, DateTime end)
+ private List<SerialData> SelectSerialDataByTime(string model, DateTime start, DateTime end)
{
var s1 = DateTime.Now;
string[] files = GetDbFiles(BaseFolder, start, end);
@@ -107,7 +181,14 @@
{
return new List<SerialData>();
}
- string sql = $"SELECT * FROM serialData WHERE time BETWEEN '{start:yyyy-MM-dd HH:mm:ss}' AND '{end:yyyy-MM-dd HH:mm:ss}' ORDER BY time DESC;";
+ string segment = string.Empty;
+ if (!string.IsNullOrEmpty(model))
+ {
+ segment = $"AND model = '{model}'";
+ }
+
+ string sql = $@"SELECT * FROM serialData WHERE time BETWEEN '{start:yyyy-MM-dd HH:mm:ss}' AND '{end:yyyy-MM-dd HH:mm:ss}'
+{segment} ORDER BY time DESC;";
DataTable dt = new DataTable();
foreach (string file in files)
@@ -124,14 +205,21 @@
return data;
}
- private List<SerialData> SelectResultDataByTime(DateTime start, DateTime end)
+ private List<SerialData> SelectResultDataByTime(string model, DateTime start, DateTime end)
{
string[] files = GetDbFiles(BaseFolder, start, end);
if (files == null || files.Length <= 0)
{
return new List<SerialData>();
}
- string sql = $"SELECT * FROM testResult WHERE time BETWEEN '{start:yyyy-MM-dd HH:mm:ss}' AND '{end:yyyy-MM-dd HH:mm:ss}';";
+
+ string segment = string.Empty;
+ if (!string.IsNullOrEmpty(model))
+ {
+ segment = $"AND model = '{model}'";
+ }
+
+ string sql = $@"SELECT * FROM testResult WHERE time BETWEEN '{start:yyyy-MM-dd HH:mm:ss}' AND '{end:yyyy-MM-dd HH:mm:ss}' {segment};";
DataTable dt = new DataTable();
foreach (string file in files)
@@ -206,6 +294,7 @@
{
dtp00.SelectedDateTime = start;
dtp01.SelectedDateTime = end;
+ string model = modelSelect.SelectedItem?.ToString();
Task.Run(() =>
{
try
@@ -214,7 +303,7 @@
{
webview2.CoreWebView2?.ExecuteScriptAsync($"loading0('鍔犺浇涓紝璇风◢鍚�...')");
}));
- List<SerialData> datas = SelectResultDataByTime(start, end);
+ List<SerialData> datas = SelectResultDataByTime(model, start, end);
datas.OrderByDescending(e => e.time);
int all = 0, output = 0;
HashSet<string> snCache = new HashSet<string>();
@@ -243,6 +332,7 @@
{
dtp10.SelectedDateTime = start;
dtp11.SelectedDateTime = end;
+ string model = modelSelect.SelectedItem?.ToString();
Task.Run(() =>
{
try
@@ -251,7 +341,7 @@
{
webview2.CoreWebView2?.ExecuteScriptAsync($"loading1('鍔犺浇涓紝璇风◢鍚�...')");
}));
- List<SerialData> datas = SelectResultDataByTime(start, end);
+ List<SerialData> datas = SelectResultDataByTime(model, start, end);
datas = datas.OrderByDescending(e => e.time).ToList();
Dictionary<string, int?> pieData = new Dictionary<string, int?> {
@@ -367,6 +457,7 @@
{
dtp20.SelectedDateTime = start;
dtp21.SelectedDateTime = end;
+ string model = modelSelect.SelectedItem?.ToString();
Task.Run(() =>
{
try
@@ -375,7 +466,7 @@
{
webview2.CoreWebView2?.ExecuteScriptAsync($"loading2('鍔犺浇涓紝璇风◢鍚�...')");
}));
- List<SerialData> datas = SelectResultDataByTime(start, end);
+ List<SerialData> datas = SelectResultDataByTime(model, start, end);
var groups =
datas.GroupBy(d => d.time.ToString("yyyy-MM-dd"));
@@ -446,6 +537,7 @@
{
dtp30.SelectedDateTime = start;
dtp31.SelectedDateTime = end;
+ string model = modelSelect.SelectedItem?.ToString();
Task.Run(() =>
{
try
@@ -455,7 +547,7 @@
webview2.CoreWebView2?.ExecuteScriptAsync($"loading3('鍔犺浇涓紝璇风◢鍚�...')");
}));
var st = DateTime.Now;
- List<SerialData> datas = SelectSerialDataByTime(start, end);
+ List<SerialData> datas = SelectSerialDataByTime(model, start, end);
var s2 = DateTime.Now;
log.Info($"RefreshChart3 Data Cast {(s2 - st).TotalMilliseconds}");
@@ -544,5 +636,13 @@
break;
}
}
+
+ private void modelSelect_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ if (e.AddedItems.Count > 0)
+ {
+ IniFileHelper.WriteIniData("Config", "Model", e.AddedItems[0].ToString(), iniFile);
+ }
+ }
}
}
diff --git a/Plugin.DataBoard/Properties/AssemblyInfo.cs b/Plugin.DataBoard/Properties/AssemblyInfo.cs
index 0038bd3..63f25d7 100644
--- a/Plugin.DataBoard/Properties/AssemblyInfo.cs
+++ b/Plugin.DataBoard/Properties/AssemblyInfo.cs
@@ -1,7 +1,5 @@
锘縰sing HMI.Core.Annotation;
using System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
diff --git a/Plugin.JarUI/JarUI.xaml.cs b/Plugin.JarUI/JarUI.xaml.cs
index 6ee24d7..2279e7a 100644
--- a/Plugin.JarUI/JarUI.xaml.cs
+++ b/Plugin.JarUI/JarUI.xaml.cs
@@ -446,6 +446,7 @@
try
{
SequenceContext?.StationGlobals.SetValBoolean("StationState.StopTest", 1, true);
+ log.Info($"Stop Result: {SequenceContext?.StationGlobals.GetValBoolean("StationState.StopTest", 1)}");
if (this.execution == null) return true;
return this.execution.WaitForEndEx(2000, true, null, null);
}
@@ -591,7 +592,7 @@
try
{
- //log.Info($"Event: {EventCase}, NumericData: {MethodCode}, StringData: {strData}");
+ log.Info($"Event: {EventCase}, NumericData: {MethodCode}, StringData: {strData}");
}
catch
{
@@ -615,6 +616,9 @@
int index2 = int.Parse(arr2[0]);
this.tsSockets[index2].SetInfo(arr2[1]);
break;
+ case 8:
+ IsRunning = false;
+ break;
default:
break;
}
diff --git a/Plugin.MaterialOpt/AssemblyInfo.cs b/Plugin.MaterialOpt/AssemblyInfo.cs
deleted file mode 100644
index cc29e7f..0000000
--- a/Plugin.MaterialOpt/AssemblyInfo.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System.Windows;
-
-[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/Plugin.MaterialOpt/MaterialOpt.xaml b/Plugin.MaterialOpt/MaterialOpt.xaml
deleted file mode 100644
index 4c7106b..0000000
--- a/Plugin.MaterialOpt/MaterialOpt.xaml
+++ /dev/null
@@ -1,251 +0,0 @@
-锘�<hb:SimpleControl x:Class="Plugin.MaterialOpt.MaterialOpt"
- 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:Plugin.MaterialOpt"
- mc:Ignorable="d"
- xmlns:hb="clr-namespace:HMI.Base;assembly=HMI.Base"
- xmlns:uic="clr-namespace:HMI.UI.Converter;assembly=HMI.UI"
- xmlns:ui="clr-namespace:HMI.UI;assembly=HMI.UI"
- xmlns:pw="https://opensource.panuon.com/wpf"
- xmlns:pu="https://opensource.panuon.com/wpf-ui"
- xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
- Loaded="SimpleControl_Loaded"
- d:DesignHeight="450" d:DesignWidth="800">
- <hb:SimpleControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="/HMI.UI;component/Style/PanuonDataGrid.xaml"/>
- <pu:StyleDictionary Includes="TabControl" />
- </ResourceDictionary.MergedDictionaries>
- </ResourceDictionary>
- </hb:SimpleControl.Resources>
- <Grid>
- <Border Style="{StaticResource CardBoarder}">
- <Grid dp:GridHelper.Space="10" Cursor="">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
-
- <TextBlock FontSize="{StaticResource TitleFontSize}"
-VerticalAlignment="Center" HorizontalAlignment="Left" Text="鐗╂枡鎿嶄綔"/>
- <TabControl Grid.Row="1"
- pu:TabControlHelper.HeaderPanelAlignment="Stretch"
- pu:TabControlHelper.ItemsBackground="{DynamicResource VerBar}"
- pu:TabControlHelper.ItemsForeground="#FFFFFF"
- pu:TabControlHelper.ItemsFontSize="14"
- pu:TabControlHelper.ItemsHeight="30"
- pu:TabControlHelper.ItemsHorizontalHeaderAlignment="Left"
- pu:TabControlHelper.ItemsHoverBackground="{DynamicResource SecondPrimaryColor}"
- pu:TabControlHelper.ItemsHoverForeground="#FFFFFF"
- pu:TabControlHelper.ItemsPadding="20,0,0,0"
- pu:TabControlHelper.ItemsRibbonLineCornerRadius="4"
- pu:TabControlHelper.ItemsRibbonLineMargin="0,5,0,5"
- pu:TabControlHelper.ItemsRibbonLineThickness="4"
- pu:TabControlHelper.ItemsRibbonLineVisibility="Visible"
- pu:TabControlHelper.ItemsSelectedBackground="#FFF"
- pu:TabControlHelper.ItemsSelectedRibbonLineBrush="#FFFFFF"
- pu:TabControlHelper.ItemsSelectedRibbonLineThickness="2"
- pu:TabControlHelper.ItemsWidth="150" >
- <TabControl.Template>
- <ControlTemplate TargetType="{x:Type TabControl}">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <Border BorderThickness="1,1,1,0" BorderBrush="#acacac" Background="{DynamicResource VerBar}" Padding="10,5,10,0">
- <TabPanel x:Name="HeaderPanel" Grid.Row="0" Panel.ZIndex="1" IsItemsHost="True"/>
- </Border>
-
- <Border Grid.Row="1" BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
- <ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent"/>
- </Border>
- </Grid>
- </ControlTemplate>
- </TabControl.Template>
- <TabItem Header="缁戝畾">
- <Grid dp:GridHelper.Space="5">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <DockPanel Grid.Row="0" Cursor="">
- <StackPanel DockPanel.Dock="Right" Style="{StaticResource ButtonGroup}">
- <Button Style="{StaticResource RfhBtn}" Content="缁戝畾"
- x:Name="bindBtn" Click="Button_Click"/>
-
- <Button Style="{StaticResource EditBtn}"
- pu:ButtonHelper.Icon="" Content="鏌ヨ"
- x:Name="bindQryBtn" Click="Button_Click"/>
-
- </StackPanel>
-
- <StackPanel Style="{StaticResource ButtonGroup}" HorizontalAlignment="Left" dp:StackPanelHelper.ChildSpace="10">
- <TextBlock Style="{StaticResource TitleBox}" FontSize="14" Text="浜у搧搴忓垪鍙�"/>
- <TextBox Style="{StaticResource EditorTextBoxStyle}" Width="180"
- Text="{Binding CurrentProductSN,UpdateSourceTrigger=PropertyChanged}" />
-
-
- <TextBlock Style="{StaticResource TitleBox}" FontSize="14" Text="鐗╂枡鏉$爜"/>
- <TextBox Style="{StaticResource EditorTextBoxStyle}" Width="180"
- Text="{Binding CurrentMaterialSN,UpdateSourceTrigger=PropertyChanged}" />
-
- <!--<TextBlock Style="{StaticResource TitleBox}" FontSize="14" Text="鐗╂枡鍚嶇О"/>
- <TextBox Style="{StaticResource EditorTextBoxStyle}" Width="180"
- Text="{Binding CurrentMaterialName,UpdateSourceTrigger=PropertyChanged}" />-->
-
- <TextBlock Style="{StaticResource TitleBox}" FontSize="14" Text="宸ョ珯"/>
- <ComboBox Style="{StaticResource FormComboxStyle}" Width="180"
- ItemsSource="{Binding WorkstationSource}"
- SelectedItem="{Binding CurrentWorkstation,Mode=TwoWay}"
- SelectedValuePath="Content"/>
- </StackPanel>
- </DockPanel>
-
- <DataGrid Grid.Row="1" x:Name="table"
- SelectionChanged="table_SelectionChanged"
- Style="{StaticResource DefaultDataGrid}">
- <DataGrid.Columns>
- <DataGridTemplateColumn Header="#" CanUserResize="False">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Converter={StaticResource rowNumber},
-RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow},AncestorLevel=1}}"/>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- <DataGridTextColumn Width="*" Binding="{Binding ProductSN}">
- <DataGridTextColumn.Header>
- <TextBlock Text="浜у搧搴忓垪鍙�"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- <DataGridTextColumn Width="*" Binding="{Binding MaterialSN}">
- <DataGridTextColumn.Header>
- <TextBlock Text="鐗╂枡鏉$爜"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- <!--<DataGridTextColumn Width="*" Binding="{Binding MaterialName}">
- <DataGridTextColumn.Header>
- <TextBlock Text="鐗╂枡鍚嶇О"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>-->
- <DataGridTextColumn Width="*" Binding="{Binding Workstation}">
- <DataGridTextColumn.Header>
- <TextBlock Text="{DynamicResource cm.workstation}"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- <DataGridTextColumn Width="*" Binding="{Binding Time}">
- <DataGridTextColumn.Header>
- <TextBlock Text="鏃堕棿"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- <!--<DataGridTemplateColumn Width="110" IsReadOnly="True" CanUserResize="False">
- <DataGridTemplateColumn.Header>
- <TextBlock Text="{DynamicResource App.Opt}"/>
- </DataGridTemplateColumn.Header>
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal">
- <Button x:Name="rowUnBindBtn" Style="{StaticResource EditLink}"
- Content="瑙g粦" Click="Button_Click" DataContext="{Binding Row}"/>
- </StackPanel>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>-->
- </DataGrid.Columns>
- </DataGrid>
- </Grid>
- </TabItem>
- <TabItem Header="瑙g粦">
- <Grid dp:GridHelper.Space="5">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <DockPanel Grid.Row="0" Cursor="">
- <StackPanel DockPanel.Dock="Right" Style="{StaticResource ButtonGroup}">
- <Button Style="{StaticResource EditBtn}" Content="瑙g粦" x:Name="unbindBtn" Click="Button_Click"/>
-
- <Button Style="{StaticResource EditBtn}"
- pu:ButtonHelper.Icon=""
- Content="鏌ヨ" x:Name="unbindQryBtn" Click="Button_Click"/>
-
- </StackPanel>
-
- <StackPanel Style="{StaticResource ButtonGroup}" HorizontalAlignment="Left" dp:StackPanelHelper.ChildSpace="10">
- <TextBlock Style="{StaticResource TitleBox}" FontSize="14" Text="浜у搧搴忓垪鍙�"/>
- <TextBox Style="{StaticResource EditorTextBoxStyle}" Width="180"
- Text="{Binding CurrentProductSN,UpdateSourceTrigger=PropertyChanged}" />
-
-
- <TextBlock Style="{StaticResource TitleBox}" FontSize="14" Text="鐗╂枡鏉$爜"/>
- <TextBox Style="{StaticResource EditorTextBoxStyle}" Width="180"
- Text="{Binding CurrentMaterialSN,UpdateSourceTrigger=PropertyChanged}" />
-
- <!--<TextBlock Style="{StaticResource TitleBox}" FontSize="14" Text="鐗╂枡鍚嶇О"/>
- <TextBox Style="{StaticResource EditorTextBoxStyle}" Width="180" Text="{Binding CurrentMaterialName}" />-->
- </StackPanel>
- </DockPanel>
-
- <DataGrid Grid.Row="1" x:Name="unbindTable" Style="{StaticResource DefaultDataGrid}">
- <DataGrid.Columns>
- <DataGridTemplateColumn Header="#" CanUserResize="False">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Converter={StaticResource rowNumber},
-RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow},AncestorLevel=1}}"/>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- <DataGridTextColumn Width="*" Binding="{Binding ProductSN}">
- <DataGridTextColumn.Header>
- <TextBlock Text="浜у搧搴忓垪鍙�"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- <DataGridTextColumn Width="*" Binding="{Binding MaterialSN}">
- <DataGridTextColumn.Header>
- <TextBlock Text="鐗╂枡鏉$爜"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- <!--<DataGridTextColumn Width="*" Binding="{Binding MaterialName}">
- <DataGridTextColumn.Header>
- <TextBlock Text="鐗╂枡鍚嶇О"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- <DataGridTextColumn Width="*" Binding="{Binding Workstation}">
- <DataGridTextColumn.Header>
- <TextBlock Text="{DynamicResource cm.workstation}"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>-->
- <DataGridTextColumn Width="*" Binding="{Binding Time}">
- <DataGridTextColumn.Header>
- <TextBlock Text="鏃堕棿"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- <!--<DataGridTemplateColumn Width="110" IsReadOnly="True" CanUserResize="False">
- <DataGridTemplateColumn.Header>
- <TextBlock Text="{DynamicResource App.Opt}"/>
- </DataGridTemplateColumn.Header>
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal">
- <Button x:Name="rowReBindBtn" Style="{StaticResource EditLink}"
- Content="閲嶆柊缁戝畾" Click="Button_Click" DataContext="{Binding }"/>
- </StackPanel>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>-->
- </DataGrid.Columns>
- </DataGrid>
- </Grid>
- </TabItem>
- </TabControl>
- </Grid>
- </Border>
- <ui:MaskControl x:Name="mask"/>
- </Grid>
-</hb:SimpleControl>
diff --git a/Plugin.MaterialOpt/MaterialOpt.xaml.cs b/Plugin.MaterialOpt/MaterialOpt.xaml.cs
deleted file mode 100644
index cc4c5f0..0000000
--- a/Plugin.MaterialOpt/MaterialOpt.xaml.cs
+++ /dev/null
@@ -1,429 +0,0 @@
-锘縰sing CommunityToolkit.Mvvm.ComponentModel;
-using HMI.Base;
-using HMI.Core.Entity;
-using HMI.Core.Manager;
-using HMI.Core.Util;
-using HMI.UI.Util;
-using LSMSInterface;
-using Newtonsoft.Json.Linq;
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.IO;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Web.SessionState;
-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.Data;
-using System.Windows.Media.Media3D;
-
-namespace Plugin.MaterialOpt
-{
- /// <summary>
- /// MaterialOpt.xaml 鐨勪氦浜掗�昏緫
- /// </summary>
- [ObservableObject]
- public partial class MaterialOpt : SimpleControl
- {
- public MaterialOpt()
- {
- DataContext = this;
- api = new LSMSApi();
- InitializeComponent();
- }
-
- [ObservableProperty]
- private string currentProductSN;
- [ObservableProperty]
- private string currentMaterialSN;
- [ObservableProperty]
- private string currentMaterialName;
- [ObservableProperty]
- private string currentWorkstation;
- [ObservableProperty]
- private ObservableCollection<string> workstationSource;
-
- private string lineName;
- private string mesIp;
- private int mesPort;
- private LSMSApi api;
- private bool isMesConnected = false;
- private SqliteHelper sqliteHelper;
-
- public override void InitFinish()
- {
- base.InitFinish();
- ParameterData parameter;
- try
- {
- parameter = ParameterManager.GetCommonParameterByName("MesIp");
- mesIp = parameter.Value;
- }
- catch
- {
- mesIp = "127.0.0.1";
- }
- try
- {
- parameter = ParameterManager.GetCommonParameterByName("MesPort");
- mesPort = int.Parse(parameter.Value);
- }
- catch
- {
- mesPort = 9909;
- }
-
- try
- {
- parameter = ParameterManager.GetCommonParameterByName("LineName");
- lineName = parameter.Value;
- }
- catch
- {
- lineName = string.Empty;
- }
-
- //try
- //{
- // parameter = ParameterManager.GetCommonParameterByName("ChangeModelByWorkOrder");
- // var res = bool.Parse(parameter.Value);
- // if (res) WorkOrderVisiable = Visibility.Visible;
- //}
- //catch
- //{
- // WorkOrderVisiable = Visibility.Collapsed;
- //}
-
- try
- {
- var dbPath = Path.Combine(BaseFolder, "MaterialOpt.db");
- if (!File.Exists(dbPath))
- {
- SqliteHelper.CreateDatabase(dbPath);
- }
- sqliteHelper = new SqliteHelper(dbPath);
- sqliteHelper.ExecuteSql(@"CREATE TABLE IF NOT EXISTS bind_record (
- id INTEGER PRIMARY KEY AUTOINCREMENT,
- ProductSN TEXT NOT NULL,
- MaterialSN TEXT NOT NULL,
- MaterialName TEXT ,
- Workstation TEXT ,
- Time TIME);");
- sqliteHelper.ExecuteSql(@"CREATE TABLE IF NOT EXISTS unbind_record (
- id INTEGER PRIMARY KEY AUTOINCREMENT,
- ProductSN TEXT NOT NULL,
- MaterialSN TEXT NOT NULL,
- MaterialName TEXT ,
- Workstation TEXT ,
- Time TIME);");
- }
- catch (Exception ex)
- {
- log.Error("Init MaterialOpt DB Failed.", ex);
- }
- }
-
- public override void Active()
- {
- base.Active();
- //if (!isMesConnected)
- //{
- // ConnectMes();
- // RefreshWorkstationSource();
- //}
- }
-
- public void ConnectMes()
- {
- string msg = string.Empty;
- try
- {
- if (api.Connect(this.mesIp, this.mesPort, ref msg))
- {
- isMesConnected = true;
- }
- else
- {
- throw new Exception(msg);
- }
- }
- catch (Exception ex)
- {
- isMesConnected = false;
- log.Error("ConnectMes Failed.", ex);
- MsgBoxHelper.Error(Window.GetWindow(this), this.lang("cm.mesConnectFail", ex.Message));
- }
- }
- private bool PingMes(out string errMsg)
- {
- errMsg = string.Empty;
- if (!isMesConnected)
- {
- errMsg = "MES鏈繛鎺ワ紝璇峰厛杩炴帴MES";
- return false;
- }
- try
- {
- if (!api.IsConnect(ref errMsg))
- {
- isMesConnected = false;
- return false;
- }
- return true;
- }
- catch (Exception ex)
- {
- errMsg = ex.Message;
- isMesConnected = false;
- return false;
- }
- }
-
- private void RefreshWorkstationSource()
- {
- string errMsg = string.Empty;
- try
- {
- if (api.Connect(mesIp, mesPort, ref errMsg))
- {
- string lineStr = api.GetAllStationByCurrentLine(lineName, out errMsg);
- JObject res = (JObject)JsonConvert.DeserializeObject(lineStr);
- string stations = res["WorkStations"]?.ToString();
- if (string.IsNullOrEmpty(stations))
- {
- WorkstationSource = new ObservableCollection<string>();
- }
- else
- {
- WorkstationSource = new ObservableCollection<string>(stations.Split(','));
- }
- }
- else
- {
- MsgBoxHelper.ErrorMessage(this, $"杩炴帴鏈嶅姟鍣ㄥけ璐�: {errMsg}");
- }
- }
- catch (Exception ex)
- {
- MsgBoxHelper.ErrorMessage(this, $"缁戝畾澶辫触: {errMsg}");
- }
- finally
- {
- api.DisConnect(ref errMsg);
- }
- }
-
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- var btn = sender as Button;
- switch (btn.Name)
- {
- case "bindBtn":
- BindMaterial();
- break;
- case "bindQryBtn":
- mask.ShowMask(this, RefreshBindLog, null, "璇风◢鍚�", "姝e湪鏌ヨ...");
- break;
- case "unbindBtn":
- UnBindMaterial();
- break;
- case "unbindQryBtn":
- mask.ShowMask(this, RefreshUnBindLog, null, "璇风◢鍚�", "姝e湪鏌ヨ...");
- break;
- //case "rowUnBindBtn":
- // UnBindMaterial(data.ItemArray[1].ToString(), data.ItemArray[2].ToString());
- // break;
- //case "rowReBindBtn":
- // BindMaterial();
- break;
- default:
- break;
- }
- }
-
- private void BindMaterial()
- {
- if (string.IsNullOrEmpty(CurrentProductSN))
- {
- ToastHelper.Warning("璇疯緭鍏ヤ骇鍝佸簭鍒楀彿");
- return;
- }
- if (string.IsNullOrEmpty(CurrentMaterialSN))
- {
- ToastHelper.Warning("璇疯緭鍏ョ墿鏂欐潯鐮�");
- return;
- }
- //if (string.IsNullOrEmpty(CurrentMaterialName))
- //{
- // ToastHelper.Warning("璇疯緭鍏ョ墿鏂欏悕绉�");
- // return;
- //}
- if (string.IsNullOrEmpty(CurrentWorkstation))
- {
- ToastHelper.Warning("璇烽�夋嫨宸ョ珯");
- return;
- }
-
- if (MsgBoxHelper.WarnMessage(this, "纭畾缁戝畾璇ョ墿鏂欏悧?") != MessageBoxResult.OK)
- {
- return;
- }
- mask.ShowMask(this, () =>
- {
- string errMsg = string.Empty;
- try
- {
- if (!api.Connect(mesIp, mesPort, ref errMsg))
- {
- throw new Exception($"杩炴帴鏈嶅姟鍣ㄥけ璐�: {errMsg}");
- }
- string text2 = api.CheckBoolMaterial_2163(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.FFF"),
- CurrentProductSN, CurrentWorkstation, CurrentMaterialName, CurrentMaterialSN, out errMsg);
- if (!string.IsNullOrEmpty(errMsg))
- {
- throw new Exception(errMsg);
- }
- sqliteHelper.ExecuteSql($@"INSERT INTO bind_record (ProductSN, MaterialSN, Workstation, Time)
-Values ('{CurrentProductSN}', '{CurrentMaterialSN}', '{CurrentWorkstation}','{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.FFF")}')");
- ToastHelper.Success("缁戝畾鎴愬姛");
- RefreshBindLog();
- }
- finally
- {
- api.DisConnect(ref errMsg);
- }
- },
- (ex) =>
- {
- Dispatcher.BeginInvoke(new Action(() =>
- {
- MsgBoxHelper.Error(this, $"缁戝畾澶辫触: {ex.Message}");
- }));
- }, "璇风◢鍚�", "姝e湪缁戝畾...");
- }
-
- private void UnBindMaterial(string productSN = null, string materialSN = null)
- {
- if (productSN == null)
- {
- productSN = CurrentProductSN;
- }
- if (materialSN == null)
- {
- materialSN = CurrentMaterialSN;
- }
-
- if (string.IsNullOrEmpty(productSN))
- {
- ToastHelper.Warning("璇疯緭鍏ヤ骇鍝佸簭鍒楀彿");
- return;
- }
- if (string.IsNullOrEmpty(materialSN))
- {
- ToastHelper.Warning("璇疯緭鍏ョ墿鏂欐潯鐮�");
- return;
- }
- if (MsgBoxHelper.WarnMessage(this, "纭畾瑙g粦璇ョ墿鏂欏悧?") != MessageBoxResult.OK)
- {
- return;
- }
-
- mask.ShowMask(this, () =>
- {
- string errMsg = string.Empty;
- try
- {
- if (!api.Connect(mesIp, mesPort, ref errMsg))
- {
- throw new Exception($"杩炴帴鏈嶅姟鍣ㄥけ璐�: {errMsg}");
-
- }
- string text2 = api.UnBookMaterial(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.FFF"),
- productSN, materialSN, out errMsg);
- if (!string.IsNullOrEmpty(errMsg))
- {
- throw new Exception(errMsg);
- }
- sqliteHelper.ExecuteSql($@"INSERT INTO unbind_record (ProductSN, MaterialSN, Workstation, Time)
-Values ('{productSN}', '{materialSN}', '', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.FFF")}')");
- ToastHelper.Success("瑙g粦鎴愬姛");
- RefreshUnBindLog();
- }
- finally
- {
- api.DisConnect(ref errMsg);
- }
- },
- (ex) =>
- {
- Dispatcher.BeginInvoke(new Action(() =>
- {
- MsgBoxHelper.Error(this, $"瑙g粦澶辫触: {ex.Message}");
- }));
- }, "璇风◢鍚�", "姝e湪瑙g粦...");
- }
-
- private void RefreshBindLog()
- {
- var dt = sqliteHelper.GetDataTable("SELECT * FROM bind_record ORDER BY Time DESC LIMIT 100");
- this.Dispatcher.BeginInvoke(new Action(() =>
- {
- table.ItemsSource = dt.DefaultView;
- }));
- }
-
- private void RefreshUnBindLog()
- {
- var dt = sqliteHelper.GetDataTable("SELECT * FROM unbind_record ORDER BY Time DESC LIMIT 100");
- this.Dispatcher.BeginInvoke(new Action(() =>
- {
- unbindTable.ItemsSource = dt.DefaultView;
- }));
- }
-
- private void SimpleControl_Loaded(object sender, RoutedEventArgs e)
- {
- RefreshWorkstationSource();
- RefreshBindLog();
- RefreshUnBindLog();
- //try
- //{
- // ConnectMes();
- // RefreshWorkstationSource();
- //}
- //catch (Exception ex)
- //{
- // log.Error("MaterialOpt Load Failed.", ex);
- //}
- }
-
- private void table_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- if (e.AddedItems == null || e.AddedItems.Count <= 0)
- {
- return;
- }
- var data = (e.AddedItems[0] as DataRowView).Row;
- if (sender == table)
- {
- CurrentProductSN = data.ItemArray[1].ToString();
- CurrentMaterialSN = data.ItemArray[2].ToString();
- CurrentWorkstation = data.ItemArray[4].ToString();
- }
- else if (sender == unbindTable)
- {
- CurrentProductSN = data.ItemArray[1].ToString();
- CurrentMaterialSN = data.ItemArray[2].ToString();
- }
- }
- }
-}
diff --git a/Plugin.MaterialOpt/Plugin.MaterialOpt.csproj b/Plugin.MaterialOpt/Plugin.MaterialOpt.csproj
deleted file mode 100644
index c85ac8f..0000000
--- a/Plugin.MaterialOpt/Plugin.MaterialOpt.csproj
+++ /dev/null
@@ -1,27 +0,0 @@
-锘�<Project Sdk="Microsoft.NET.Sdk">
-
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <TargetFramework>net472</TargetFramework>
- <Nullable>enable</Nullable>
- <LangVersion>10.0</LangVersion>
- <ImplicitUsings>enable</ImplicitUsings>
- <UseWPF>true</UseWPF>
- <Platforms>AnyCPU;x64</Platforms>
- </PropertyGroup>
-
- <ItemGroup>
- <PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
- <PackageReference Include="log4net" Version="3.0.4" />
- <PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.135" />
- <PackageReference Include="Panuon.WPF.UI" Version="1.3.0.2" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="..\..\MesApi\lmes.csproj" />
- <ProjectReference Include="..\HMI.Base\HMI.Base.csproj" />
- <ProjectReference Include="..\HMI.Core\HMI.Core.csproj" />
- <ProjectReference Include="..\HMI.UI\HMI.UI.csproj" />
- </ItemGroup>
-
-</Project>
diff --git a/Plugin.SNGenerateTool/Entity/DataInfo.cs b/Plugin.SNGenerateTool/Entity/DataInfo.cs
deleted file mode 100644
index 365d101..0000000
--- a/Plugin.SNGenerateTool/Entity/DataInfo.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-锘縰sing System;
-
-namespace Plugin.SNGenerateTool.Entity
-{
- public class DataInfo
- {
- public string GUID { get; set; }
-
- public string OrderID { get; set; }
-
- public string Model { get; set; }
-
- public string MESSN { get; set; }
-
- public string XDSN { get; set; }
-
- public string DHUID { get; set; }
-
- public string ProductSN { get; set; }
-
- public string HW { get; set; }
-
- public string SW { get; set; }
-
- public string GeelyDU { get; set; }
-
- public string GeelyHWSD { get; set; }
-
- public string SXBL { get; set; }
-
- public string SXDI_SXBL { get; set; }
-
- public string ECUDAPN { get; set; }
-
- public string ECUCAPN { get; set; }
-
- public string HSMKey { get; set; }
-
- public string JtagKey { get; set; }
-
- public string TEEKey { get; set; }
-
- public int Status { get; set; }
-
- public DateTime CreateTime { get; set; }
-
- public DateTime ModifyTime { get; set; }
-
- public bool IsPrint { get; set; }
-
- public DateTime PrintTime { get; set; }
- }
-}
diff --git a/Plugin.SNGenerateTool/Entity/UserSetting.cs b/Plugin.SNGenerateTool/Entity/UserSetting.cs
deleted file mode 100644
index 4ffe590..0000000
--- a/Plugin.SNGenerateTool/Entity/UserSetting.cs
+++ /dev/null
@@ -1,130 +0,0 @@
-锘縰sing Microsoft.Extensions.Configuration;
-using System.IO;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Windows.Forms;
-
-namespace Plugin.SNGenerateTool.Entity
-{
- public class UserSettings
- {
- public string OrderId { get; set; }
-
- public string Model { get; set; }
-
- public string SNPrefix { get; set; }
-
- public string MESSstartSN { get; set; }
-
- public string MESEndSN { get; set; }
-
- public string XDSNDate { get; set; }
-
- public string XDSNDaySN { get; set; }
-
- public string XDSNSpecialSN { get; set; }
-
- public string PartNo { get; set; }
-
- public string HW { get; set; }
-
- public string SW { get; set; }
-
- public string GeelyDU { get; set; }
-
- public string GeelyHWSD { get; set; }
-
- public string SXBL { get; set; }
-
- public string SXDISXBL { get; set; }
-
- public string VolvoDU { get; set; }
-
- public string VolvoHWSD { get; set; }
-
- public string DBConn { get; set; }
-
- private string IP { get; set; }
-
- private string DataBase { get; set; }
-
- private string Uid { get; set; }
-
- private string Pwd { get; set; }
-
- public string Models { get; set; }
-
- public string Field { get; set; }
-
- [DllImport("kernel32")]
- private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
-
- [DllImport("kernel32")]
- private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
-
- [DllImport("kernel32")]
- private static extern int GetPrivateProfileString(string section, string key, string def, byte[] retVal, int size, string filePath);
-
- public UserSettings(string file)
- {
- GetString(file);
- }
-
- public UserSettings(string section, string file)
- {
- GetString(section, file);
- }
-
- private void GetString(string fPath)
- {
- //IL_0027: Unknown result type (might be due to invalid IL or missing references)
- //IL_002d: Expected O, but got Unknown
- if (!File.Exists(fPath))
- {
- MessageBox.Show("閰嶇疆鏂囦欢涓嶅瓨鍦紝璇诲彇澶辫触", "閿欒鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- return;
- }
- ConfigurationBuilder val = new ConfigurationBuilder();
- IniConfigurationExtensions.AddIniFile((IConfigurationBuilder)(object)val, fPath);
- IConfigurationRoot val2 = val.Build();
- IP = ((IConfiguration)val2)["Server:ip"];
- DataBase = ((IConfiguration)val2)["Server:database"];
- Uid = ((IConfiguration)val2)["Server:uid"];
- Pwd = ((IConfiguration)val2)["Server:pwd"];
- DBConn = "Server=" + IP + ";DataBase=" + DataBase + ";Uid=" + Uid + ";Pwd=" + Pwd;
- Models = ((IConfiguration)val2)["UserDefined:models"];
- Field = ((IConfiguration)val2)["UserDefined:field"];
- }
-
- private void GetString(string section, string fPath)
- {
- //IL_0027: Unknown result type (might be due to invalid IL or missing references)
- //IL_002d: Expected O, but got Unknown
- if (!File.Exists(fPath))
- {
- MessageBox.Show("閰嶇疆鏂囦欢涓嶅瓨鍦紝璇诲彇澶辫触", "閿欒鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- return;
- }
- ConfigurationBuilder val = new ConfigurationBuilder();
- IniConfigurationExtensions.AddIniFile((IConfigurationBuilder)(object)val, fPath);
- IConfigurationRoot val2 = val.Build();
- OrderId = ((IConfiguration)val2)[section + ":Orderid"];
- Model = ((IConfiguration)val2)[section + ":Model"];
- SNPrefix = ((IConfiguration)val2)[section + ":SNPrefix"];
- MESSstartSN = ((IConfiguration)val2)[section + ":MESStartSN"];
- MESEndSN = ((IConfiguration)val2)[section + ":MESEndSN"];
- XDSNDate = ((IConfiguration)val2)[section + ":XDSNDate"];
- XDSNDaySN = ((IConfiguration)val2)[section + ":XDSNDaySN"];
- XDSNSpecialSN = ((IConfiguration)val2)[section + ":XDSNSpecialSN"];
- PartNo = ((IConfiguration)val2)[section + ":PartNo"];
- HW = ((IConfiguration)val2)[section + ":HW"];
- SW = ((IConfiguration)val2)[section + ":SW"];
- GeelyDU = ((IConfiguration)val2)[section + ":GeelyDU"];
- GeelyHWSD = ((IConfiguration)val2)[section + ":GeelyHWSD"];
- SXBL = ((IConfiguration)val2)[section + ":SXBL"];
- SXDISXBL = ((IConfiguration)val2)[section + ":SXDISXBL"];
- VolvoDU = ((IConfiguration)val2)[section + ":VolvoDU"];
- VolvoHWSD = ((IConfiguration)val2)[section + ":VolvoHWSD"];
- }
- }
-}
diff --git a/Plugin.SNGenerateTool/Form1.Designer.cs b/Plugin.SNGenerateTool/Form1.Designer.cs
deleted file mode 100644
index bbc08e7..0000000
--- a/Plugin.SNGenerateTool/Form1.Designer.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-锘縩amespace Plugin.SNGenerateTool
-{
-}
\ No newline at end of file
diff --git a/Plugin.SNGenerateTool/Form1.cs b/Plugin.SNGenerateTool/Form1.cs
deleted file mode 100644
index b322481..0000000
--- a/Plugin.SNGenerateTool/Form1.cs
+++ /dev/null
@@ -1,1984 +0,0 @@
-锘縰sing Plugin.SNGenerateTool;
-using Plugin.SNGenerateTool.Entity;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Data.SqlClient;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Globalization;
-using System.IO;
-using System.Reflection;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Timers;
-using System.Windows.Forms;
-public class Form1 : Form
-{
- private Point Point;
-
- private string iniFile = Path.Combine(Application.StartupPath, "Config", "UserSettings.ini");
-
- private UserSettings settings1;
-
- private UserSettings settings2;
-
- private DataTable table = new DataTable();
-
- private string[] years = new string[30]
- {
- "1", "2", "3", "4", "5", "6", "7", "8", "9", "A",
- "B", "C", "D", "E", "F", "G", "H", "J", "K", "L",
- "M", "N", "P", "R", "S", "T", "V", "W", "X", "Y"
- };
-
- private string[] months = new string[12]
- {
- "1", "2", "3", "4", "5", "6", "7", "8", "9", "A",
- "B", "C"
- };
-
- private string[] days = new string[31]
- {
- "1", "2", "3", "4", "5", "6", "7", "8", "9", "A",
- "B", "C", "D", "E", "F", "G", "H", "J", "K", "L",
- "M", "N", "P", "R", "S", "T", "V", "W", "X", "Y",
- "Z"
- };
-
- private string[] F18CY = new string[10] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
-
- private System.Timers.Timer timer = new System.Timers.Timer();
-
- private string fileNameWithoutExt = string.Empty;
-
- private ProgressBar progressBar = new ProgressBar();
-
- private IContainer components = null;
-
- private ToolStripPanel BottomToolStripPanel;
-
- private ToolStripPanel TopToolStripPanel;
-
- private ToolStripPanel RightToolStripPanel;
-
- private ToolStripPanel LeftToolStripPanel;
-
- private ToolStripContentPanel ContentPanel;
-
- private TabControl tabControl1;
-
- private TabPage tabPage1;
-
- private Panel panel1;
-
- private GroupBox groupBox2;
-
- private TextBox txt_FactoryCode;
-
- private Label label4;
-
- private TextBox txt_PCODE;
-
- private TextBox txt_LineNo1;
-
- private Label label5;
-
- private Label label6;
-
- private GroupBox groupBox1;
-
- private TextBox txt_StartSN;
-
- private Label label1;
-
- private TextBox txt_SNPrefix;
-
- private Label label2;
-
- private TabPage tabPage2;
-
- private StatusStrip statusStrip1;
-
- private GroupBox groupBox3;
-
- private TextBox txt_StartDHUIDSN;
-
- private Label label11;
-
- private TextBox txt_ShiftsNo;
-
- private Label label12;
-
- private TextBox txt_Date2;
-
- private Label label13;
-
- private TextBox txt_PN;
-
- private Label label14;
-
- private TextBox txt_VendorCode;
-
- private Label label15;
-
- private Label label17;
-
- private TextBox txt_EndDaySN;
-
- private TextBox txt_MinSpecialSN;
-
- private Label label10;
-
- private TextBox txt_StartDaySN;
-
- private Label label9;
-
- private TextBox txt_Date1;
-
- private Label label8;
-
- private Label label7;
-
- private TextBox txt_EndSN;
-
- private TextBox txt_MaxSpecialSN;
-
- private Label label18;
-
- private TextBox txt_EndDHUIDSN;
-
- private Label label19;
-
- private GroupBox groupBox4;
-
- private TextBox txt_HW;
-
- private TextBox txt_GeelyHWSD;
-
- private Label label21;
-
- private Label label20;
-
- private TextBox txt_SW;
-
- private Label label25;
-
- private TextBox txt_VolvoDU;
-
- private Label label24;
-
- private TextBox txt_VolvoHWSD;
-
- private Label label23;
-
- private TextBox txt_GeelyDU;
-
- private Label label22;
-
- private Button btn_ClearText;
-
- private Button btn_ImportData;
-
- private Button btn_CreateSN;
-
- private DataGridView dataGridView1;
-
- private ToolStripStatusLabel toolStripStatusLabel1;
-
- private ToolStripStatusLabel toolStripStatusLabel2;
-
- private ToolStripStatusLabel toolStripStatusLabel3;
-
- private ToolStripStatusLabel toolStripStatusLabel4;
-
- private ToolStripStatusLabel toolStripStatusLabel5;
-
- private ToolStripStatusLabel toolStripStatusLabel6;
-
- private ToolTip toolTip1;
-
- private ErrorProvider errorProvider1;
-
- private Label label3;
-
- private Label lbl_Title;
-
- private TextBox txt_MachineCode;
-
- private Label label16;
-
- private Button btn_Close;
-
- private Button btn_Minimize;
-
- private ToolStripStatusLabel toolStripStatusLabel7;
-
- private ToolStripStatusLabel toolStripStatusLabel8;
-
- private DataGridView dataGridView2;
-
- private Panel panel2;
-
- private Label label28;
-
- private Label label27;
-
- private Button btn_Delete;
-
- private Button btn_Modify;
-
- private Button btn_Query;
-
- private ComboBox cbox_Field;
-
- private TextBox tbx_content;
-
- private ComboBox cbox_Model;
-
- private Label label26;
-
- private TextBox txt_SXBL;
-
- private Label label29;
-
- private TextBox txt_SXDISXBL;
-
- private Label label30;
-
- private TextBox tbx_OrderID;
-
- private Button btn_OpenDlg;
-
- private Button btn_Export;
-
- [DllImport("kernel32")]
- private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
-
- [DllImport("kernel32")]
- private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
-
- public Form1()
- {
- InitializeComponent();
- settings1 = new UserSettings(iniFile);
- SetMainForm();
- SetTabControl();
- SetToolStrip();
- SetToolTip();
- SetErrorProvider();
- SetControls(base.Controls);
- SetDataGridColumn(dataGridView1);
- Timer(timer, Realtime);
- }
-
- private string GetVersion()
- {
- return "绋嬪簭闆嗙増鏈細" + Assembly.GetExecutingAssembly().GetName().Version.ToString();
- }
-
- private void SetMainForm()
- {
- Text = "E04 SN Generate Tool";
- base.ControlBox = false;
- base.FormBorderStyle = FormBorderStyle.None;
- base.StartPosition = FormStartPosition.CenterScreen;
- BackColor = Color.FromArgb(71, 236, 255);
- }
-
- private void SetTabControl()
- {
- tabControl1.DrawMode = TabDrawMode.OwnerDrawFixed;
- tabControl1.ItemSize = new Size(75, 25);
- tabControl1.SizeMode = TabSizeMode.Fixed;
- }
-
- private void SetToolStrip()
- {
- statusStrip1.BackColor = Color.FromArgb(227, 237, 243);
- statusStrip1.ForeColor = Color.MediumBlue;
- toolStripStatusLabel1.Text = "";
- toolStripStatusLabel1.AutoSize = false;
- toolStripStatusLabel1.Width = 700;
- toolStripStatusLabel2.Text = "褰撳墠鐢ㄦ埛锛�";
- toolStripStatusLabel3.Text = "";
- toolStripStatusLabel3.AutoSize = false;
- toolStripStatusLabel3.Width = 50;
- toolStripStatusLabel4.Text = GetVersion();
- toolStripStatusLabel5.Text = "";
- toolStripStatusLabel5.AutoSize = false;
- toolStripStatusLabel5.Width = 50;
- toolStripStatusLabel6.Text = "绯荤粺鏃堕棿锛�" + DateTime.Now.ToString("G");
- toolStripStatusLabel7.Text = "";
- toolStripStatusLabel7.AutoSize = false;
- toolStripStatusLabel7.Width = 50;
- toolStripStatusLabel8.Text = "0琛�";
- }
-
- private void SetToolTip()
- {
- toolTip1.InitialDelay = 10;
- toolTip1.ReshowDelay = 10;
- toolTip1.SetToolTip(txt_Date1, "鏃ユ湡鏍煎紡锛歽yyyMMdd");
- toolTip1.SetToolTip(txt_Date2, "鏃ユ湡鏍煎紡锛歽yyyMMdd");
- toolTip1.SetToolTip(btn_Minimize, "鏈�灏忓寲");
- toolTip1.SetToolTip(btn_Close, "鍏抽棴");
- }
-
- private void SetErrorProvider()
- {
- errorProvider1.BlinkStyle = ErrorBlinkStyle.AlwaysBlink;
- }
-
- private void SetControls(Control.ControlCollection controls)
- {
- foreach (Control control in controls)
- {
- if (control is TabControl tabControl)
- {
- tabControl.DrawItem += tabControl1_DrawItem;
- }
- else if (control is Panel panel)
- {
- panel.BackColor = Color.FromArgb(227, 237, 243);
- }
- else if (control is GroupBox groupBox)
- {
- groupBox.ForeColor = ColorTranslator.FromHtml("#442A9D");
- }
- else if (control is TextBox textBox)
- {
- textBox.ImeMode = ImeMode.Disable;
- if (textBox.Name == "txt_Date1" || textBox.Name == "txt_Date2")
- {
- textBox.Text = DateTime.Now.ToString("yyyyMMdd");
- }
- if (textBox.Name == "txt_EndDaySN" || textBox.Name == "txt_MaxSpecialSN" || textBox.Name == "txt_EndDHUIDSN")
- {
- textBox.Enabled = false;
- }
- textBox.KeyPress += textBox_KeyPress;
- if (textBox.Name == "tbx_content")
- {
- textBox.Validated += textBox_Validated;
- }
- else
- {
- textBox.Validating += textBox_Validating;
- }
- }
- else if (control is Label label)
- {
- label.ForeColor = ColorTranslator.FromHtml("#442A9D");
- if (label.Name == "lbl_Title")
- {
- label.MouseDown += LabelMouseDown;
- label.MouseMove += LabelMouseMove;
- }
- }
- else if (control is Button button)
- {
- if (button.Name == "btn_Minimize" || button.Name == "btn_Close" || button.Name == "btn_OpenDlg")
- {
- button.BackColor = Color.Transparent;
- button.BackgroundImageLayout = ImageLayout.Zoom;
- button.FlatStyle = FlatStyle.Flat;
- button.FlatAppearance.BorderSize = 0;
- button.FlatAppearance.MouseOverBackColor = Color.FromArgb(9, 229, 255);
- button.FlatAppearance.MouseDownBackColor = Color.FromArgb(64, 177, 255);
- }
- else
- {
- button.BackColor = ColorTranslator.FromHtml("#442A9D");
- button.ForeColor = Color.White;
- button.FlatStyle = FlatStyle.Flat;
- button.FlatAppearance.BorderColor = Color.FromArgb(0, 0, 0, 0);
- button.FlatAppearance.BorderSize = 0;
- button.FlatAppearance.MouseDownBackColor = Color.FromArgb(58, 102, 127);
- }
- button.Cursor = Cursors.Hand;
- }
- else if (control is DataGridView dataGridStyle)
- {
- SetDataGridStyle(dataGridStyle);
- }
- else if (control is ComboBox comboBox)
- {
- if (comboBox.Name == "cbox_Model")
- {
- ComboBox.ObjectCollection items = comboBox.Items;
- object[] items2 = settings1.Models.Split(',');
- items.AddRange(items2);
- comboBox.DropDownStyle = ComboBoxStyle.DropDownList;
- }
- else
- {
- ComboBox.ObjectCollection items3 = comboBox.Items;
- object[] items2 = settings1.Field.Split(',');
- items3.AddRange(items2);
- comboBox.DropDownStyle = ComboBoxStyle.DropDownList;
- }
- comboBox.Validating += ComboBox_Validating;
- }
- if (control.HasChildren)
- {
- SetControls(control.Controls);
- }
- }
- }
-
- private void tabControl1_DrawItem(object sender, DrawItemEventArgs e)
- {
- Font font;
- Brush brush;
- Brush brush2;
- if (e.Index == tabControl1.SelectedIndex)
- {
- font = new Font(e.Font, FontStyle.Bold);
- brush = new LinearGradientBrush(e.Bounds, Color.FromArgb(71, 236, 255), Color.FromArgb(0, 150, 255), LinearGradientMode.Vertical);
- brush2 = new SolidBrush(Color.FromArgb(255, 255, 255));
- }
- else
- {
- font = e.Font;
- brush = new SolidBrush(SystemColors.Control);
- brush2 = new SolidBrush(Color.DimGray);
- }
- string s = tabControl1.TabPages[e.Index].Text;
- StringFormat stringFormat = new StringFormat();
- stringFormat.LineAlignment = StringAlignment.Center;
- stringFormat.Alignment = StringAlignment.Center;
- e.Graphics.FillRectangle(brush, e.Bounds);
- Rectangle bounds = e.Bounds;
- bounds = new Rectangle(bounds.X, bounds.Y + 4, bounds.Width, bounds.Height - 4);
- e.Graphics.DrawString(s, font, brush2, bounds, stringFormat);
- }
-
- private void GDIPaint(object sender, PaintEventArgs e)
- {
- Label label = sender as Label;
- Graphics graphics = e.Graphics;
- Color color = Color.FromArgb(71, 236, 255);
- Color color2 = Color.FromArgb(64, 177, 255);
- Color color3 = Color.FromArgb(9, 229, 255);
- Color color4 = Color.FromArgb(0, 150, 255);
- Brush brush = new LinearGradientBrush(label.ClientRectangle, color, color2, LinearGradientMode.Vertical);
- graphics.FillRectangle(brush, label.ClientRectangle);
- }
-
- private void LabelMouseDown(object sender, MouseEventArgs e)
- {
- Point = e.Location;
- }
-
- private void LabelMouseMove(object sender, MouseEventArgs e)
- {
- if (e.Button == MouseButtons.Left)
- {
- base.Location = new Point(base.Location.X + e.X - Point.X, base.Location.Y + e.Y - Point.Y);
- }
- }
-
- private void textBox_Validated(object sender, EventArgs e)
- {
- TextBox textBox = sender as TextBox;
- ValidatingText(textBox, "姝ら」涓哄繀濉」");
- }
-
- private void textBox_Validating(object sender, CancelEventArgs e)
- {
- TextBox textBox = sender as TextBox;
- ValidatingText(textBox, "姝ら」涓哄繀濉」");
- }
-
- private void ComboBox_Validated(object sender, EventArgs e)
- {
- ComboBox comboBox = sender as ComboBox;
- ValidatingText(comboBox, "璇烽�夋嫨鏌ヨ瀛楁");
- }
-
- private void ComboBox_Validating(object sender, CancelEventArgs e)
- {
- ComboBox comboBox = sender as ComboBox;
- ValidatingText(comboBox, "璇烽�夋嫨鏌ヨ瀛楁");
- }
-
- private void textBox_KeyPress(object sender, KeyPressEventArgs e)
- {
- TextBox textBox = sender as TextBox;
- if (textBox.Name == "txt_StartSN" || textBox.Name == "txt_EndSN" || textBox.Name == "txt_StartDaySN" || textBox.Name == "txt_EndDaySN" || textBox.Name == "txt_MinSpecialSN" || textBox.Name == "txt_MaxSpecialSN" || textBox.Name == "txt_StartDHUIDSN" || textBox.Name == "txt_EndDHUIDSN")
- {
- if (char.IsDigit(e.KeyChar) || e.KeyChar == '\b' || char.IsControl(e.KeyChar))
- {
- e.Handled = false;
- }
- else
- {
- e.Handled = true;
- }
- }
- else if (char.IsLetterOrDigit(e.KeyChar) || char.IsPunctuation(e.KeyChar) || e.KeyChar == '\b' || char.IsControl(e.KeyChar))
- {
- e.Handled = false;
- }
- else
- {
- e.Handled = true;
- }
- e.KeyChar = char.ToUpper(e.KeyChar);
- }
-
- private bool ValidatingText(TextBox textBox, string errorMsg)
- {
- if (textBox.Text.Length == 0)
- {
- errorProvider1.SetError(textBox, errorMsg);
- return false;
- }
- errorProvider1.SetError(textBox, string.Empty);
- return true;
- }
-
- private bool ValidatingText(ComboBox comboBox, string errorMsg)
- {
- if (comboBox.Text.Length == 0)
- {
- errorProvider1.SetError(comboBox, errorMsg);
- return false;
- }
- errorProvider1.SetError(comboBox, string.Empty);
- return true;
- }
-
- private void SetDataGridColumn(DataGridView dataGrid)
- {
- string[] array = new string[23]
- {
- "GUID", "Orderid", "Model", "MESSN", "XDSN", "DHUID", "ProductSN", "HW", "SW", "GeelyDU",
- "GeelyHWSD", "SXBL", "SXDI_SXBL", "ECUDAPN", "ECUCAPN", "HSMKey", "JtagKey", "TEEKey", "Status", "CreateTime",
- "ModifyTime", "IsPrint", "PrintTime"
- };
- for (int i = 0; i < array.Length; i++)
- {
- table.Columns.Add(array[i]);
- }
- dataGrid.DataSource = table.DefaultView;
- }
-
- private void SetDataGridStyle(DataGridView dataGrid)
- {
- dataGrid.BackgroundColor = Color.White;
- dataGrid.AllowUserToAddRows = false;
- dataGrid.AllowUserToDeleteRows = false;
- dataGrid.AllowUserToOrderColumns = false;
- dataGrid.AllowUserToResizeColumns = true;
- dataGrid.AllowUserToResizeRows = false;
- dataGrid.ReadOnly = true;
- dataGrid.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
- dataGrid.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
- dataGrid.RowHeadersWidth = 35;
- dataGrid.ColumnHeadersHeight = 30;
- dataGrid.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
- foreach (DataGridViewColumn column in dataGrid.Columns)
- {
- column.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
- column.SortMode = DataGridViewColumnSortMode.Programmatic;
- }
- dataGrid.RowPostPaint += dataGridView_RowPostPaint;
- dataGrid.RowHeadersDefaultCellStyle.Padding = new Padding(dataGridView1.RowHeadersWidth);
- }
-
- private void dataGridView_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
- {
- DataGridView dataGridView = sender as DataGridView;
- Rectangle bounds = new Rectangle(e.RowBounds.Location.X, e.RowBounds.Location.Y, dataGridView1.RowHeadersWidth - 1, e.RowBounds.Height);
- TextRenderer.DrawText(e.Graphics, (e.RowIndex + 1).ToString(), dataGridView.RowHeadersDefaultCellStyle.Font, bounds, dataGridView.RowHeadersDefaultCellStyle.ForeColor, TextFormatFlags.VerticalCenter);
- List<int> list = new List<int> { e.RowIndex + 1 };
- }
-
- private void btn_CreateSN_Click(object sender, EventArgs e)
- {
- SaveSettings(cbox_Model.Text, iniFile);
- CreateSN();
- }
-
- private void CreateSN()
- {
- if (table.Rows.Count > 0)
- {
- table.Clear();
- }
- try
- {
- int num = Convert.ToInt32(txt_StartSN.Text);
- int num2 = Convert.ToInt32(txt_EndSN.Text);
- int num3 = Convert.ToInt32(txt_StartDaySN.Text);
- int num4 = Convert.ToInt32(txt_MinSpecialSN.Text);
- int num5 = Convert.ToInt32(txt_StartDHUIDSN.Text);
- int num6 = Convert.ToInt32(txt_Date1.Text.Substring(0, 4)) % 2001;
- int num7 = Convert.ToInt32(txt_Date1.Text.Substring(4, 2)) - 1;
- int num8 = Convert.ToInt32(txt_Date1.Text.Substring(6, 2)) - 1;
- if (Convert.ToInt32(txt_Date1.Text.Substring(0, 4)) < 2020)
- {
- MessageBox.Show("鐢熶骇鏃ユ湡涓殑骞翠唤鏃╀簬褰撳墠骞翠唤锛�", "閿欒鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- return;
- }
- int num9 = Convert.ToInt32(txt_Date1.Text.Substring(0, 4)) % 2020;
- GregorianCalendar gregorianCalendar = new GregorianCalendar();
- DateTime time = DateTime.ParseExact(txt_Date1.Text, "yyyyMMdd", CultureInfo.CurrentCulture);
- int weekOfYear = gregorianCalendar.GetWeekOfYear(time, CalendarWeekRule.FirstFullWeek, DayOfWeek.Monday);
- int num10 = 0;
- switch (time.DayOfWeek.ToString())
- {
- case "Monday":
- num10 = 1;
- break;
- case "Tuesday":
- num10 = 2;
- break;
- case "Wednesday":
- num10 = 3;
- break;
- case "Thursday":
- num10 = 4;
- break;
- case "Friday":
- num10 = 5;
- break;
- case "Saturday":
- num10 = 6;
- break;
- case "Sunday":
- num10 = 7;
- break;
- }
- if (txt_StartSN.Text != null && txt_EndSN.Text != null && num <= num2 && txt_EndSN.TextLength < 5)
- {
- int num11 = num;
- int num12 = num3;
- int num13 = num4;
- int num14 = num5;
- while (num11 <= num2)
- {
- DataRow dataRow = table.NewRow();
- if (num12.ToString().Length < 5 && num13.ToString().Length < 8 && num14.ToString().Length < 5)
- {
- string text = txt_PCODE.Text.Trim() + years[num6] + num13.ToString().PadLeft(7, '0');
- string text2 = HashPlus.GetHashMD5(text).ToUpper();
- text2 = text2.Substring(0, 8) + "-" + text2.Substring(8, 4) + "-" + text2.Substring(12, 4) + "-" + text2.Substring(16, 4) + "-" + text2.Substring(20, 12);
- string text3 = txt_SNPrefix.Text + num11.ToString().PadLeft(4, '0');
- string text4 = txt_PCODE.Text + txt_MachineCode.Text + txt_FactoryCode.Text + txt_LineNo1.Text + years[num6] + months[num7] + days[num8] + num12.ToString().PadLeft(4, '0') + num13.ToString().PadLeft(7, '0');
- string text5 = txt_VendorCode.Text + txt_PN.Text + years[num6] + months[num7] + days[num8] + txt_ShiftsNo.Text + num14.ToString().PadLeft(4, '0');
- string empty = string.Empty;
- empty = F18CY[num9] + weekOfYear.ToString().PadLeft(2, '0') + num10 + num12.ToString().PadLeft(4, '0');
- if (text3.Length != 14 && text4.Length != 24 && text5.Length != 24)
- {
- MessageBox.Show("MESSN / XDSN / DHUID闀垮害鏈夎锛岃妫�鏌ヨ緭鍏ョ殑鏁版嵁鏄惁鏈夎锛�", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- return;
- }
- dataRow["GUID"] = text2;
- dataRow["Orderid"] = tbx_OrderID.Text.Trim();
- dataRow["Model"] = cbox_Model.Text.Trim();
- dataRow["MESSN"] = text3.Trim();
- dataRow["XDSN"] = text4.Trim();
- dataRow["DHUID"] = text5.Trim();
- dataRow["ProductSN"] = empty.Trim();
- dataRow["HW"] = txt_HW.Text.PadRight(16, '0').Trim();
- dataRow["SW"] = txt_SW.Text.Trim();
- dataRow["SXBL"] = txt_SXBL.Text.Trim();
- dataRow["SXDI_SXBL"] = txt_SXDISXBL.Text.Trim();
- dataRow["GeelyDU"] = txt_GeelyDU.Text.Trim();
- dataRow["GeelyHWSD"] = txt_GeelyHWSD.Text.Trim();
- dataRow["ECUDAPN"] = txt_VolvoDU.Text.Trim();
- dataRow["ECUCAPN"] = txt_VolvoHWSD.Text.Trim();
- dataRow["Status"] = 0;
- dataRow["CreateTime"] = Convert.ToDateTime(DateTime.Now.ToString("G"));
- table.Rows.Add(dataRow);
- num11++;
- num12++;
- num13++;
- num14++;
- continue;
- }
- MessageBox.Show("鏃ユ祦姘村彿鎴栬繛缁彿浣嶆暟瓒呭嚭鑼冨洿", "閿欒鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- break;
- }
- dataGridView1.DataSource = table.DefaultView;
- dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells;
- toolStripStatusLabel8.Text = $"{table.Rows.Count}琛�";
- }
- else
- {
- MessageBox.Show("璇锋鏌ユ墍鏈夋枃鏈鏄惁鏈夊~鍐欙紝骞剁‘璁N鐨勬祦姘村彿鍙婁綅鏁版槸鍚︽湁璇�", "閿欒鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message, "閿欒鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- }
- }
-
- private void btn_ImportData_Click(object sender, EventArgs e)
- {
- ImportData();
- }
-
- private void ImportData()
- {
- //if (MessageBox.Show("纭鏄惁瀵煎叆鏁版嵁搴�?", "娑堟伅鎻愮ず", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
- //{
- // return;
- //}
- //if (table.Rows.Count != 0)
- //{
- // PwdForm pwdForm = new PwdForm();
- // if (pwdForm.ShowDialog() != DialogResult.OK)
- // {
- // return;
- // }
- // using (SqlConnection sqlConnection = new SqlConnection(settings1.DBConn))
- // {
- // try
- // {
- // sqlConnection.Open();
- // SqlBulkCopy sqlBulkCopy = new SqlBulkCopy(sqlConnection);
- // sqlBulkCopy.DestinationTableName = "SNDTL";
- // sqlBulkCopy.WriteToServer(table);
- // sqlBulkCopy.Close();
- // MessageBox.Show("鏁版嵁瀵煎叆鎴愬姛锛�", "娑堟伅鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // return;
- // }
- // catch (SqlException ex)
- // {
- // throw new Exception(ex.Message);
- // }
- // finally
- // {
- // sqlConnection.Close();
- // }
- // }
- //}
- MessageBox.Show("鏁版嵁涓虹┖锛屽鍏ュけ璐ワ紝璇风敓鎴愬簭鍒楀彿鍚庡啀瀵煎叆锛�", "娑堟伅鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- }
-
- private void btn_ClearText_Click(object sender, EventArgs e)
- {
- ClearText(base.Controls);
- }
-
- private void ClearText(Control.ControlCollection controls)
- {
- foreach (Control control in controls)
- {
- if (control is TextBox textBox)
- {
- textBox.ResetText();
- }
- if (control.HasChildren)
- {
- ClearText(control.Controls);
- }
- }
- }
-
- private void btn_Mininimze_Click(object sender, EventArgs e)
- {
- base.WindowState = FormWindowState.Minimized;
- }
-
- private void btn_Close_Click(object sender, EventArgs e)
- {
- Close();
- }
-
- private void MainForm_Paint(object sender, PaintEventArgs e)
- {
- Graphics graphics = e.Graphics;
- Color color = Color.FromArgb(71, 236, 255);
- Color color2 = Color.FromArgb(64, 177, 255);
- Color color3 = Color.FromArgb(9, 229, 255);
- Color color4 = Color.FromArgb(0, 150, 255);
- Brush brush = new LinearGradientBrush(base.ClientRectangle, color, color2, LinearGradientMode.Vertical);
- graphics.FillRectangle(brush, base.ClientRectangle);
- }
-
- private void Timer(System.Timers.Timer t, Action<object, ElapsedEventArgs> action)
- {
- t.Elapsed += action.Invoke;
- t.AutoReset = true;
- t.Enabled = true;
- }
-
- private void Realtime(object sender, EventArgs e)
- {
- timer.Interval = 1000.0;
- toolStripStatusLabel6.Text = "绯荤粺鏃堕棿锛�" + DateTime.Now.ToString("G");
- timer.Enabled = true;
- }
-
- private void cbx_Field_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (cbox_Field.Text.Equals("鏈�澶ц繛缁彿"))
- {
- tbx_content.Visible = false;
- btn_Query_Click(sender, e);
- }
- else
- {
- tbx_content.Visible = true;
- }
- }
-
- private void btn_Query_Click(object sender, EventArgs e)
- {
- if (cbox_Field.Text.Equals("鏈�澶ц繛缁彿"))
- {
- using (SqlConnection sqlConnection = new SqlConnection(settings1.DBConn))
- {
- string empty = string.Empty;
- string text = cbox_Field.Text;
- string text2 = text;
- if (text2 == "鏈�澶ц繛缁彿")
- {
- empty = "Subtring(XDSN,0,7)Substring(XDSN,11,1)Right(XDSN,7)";
- }
- string text3 = "select * FROM (select TOP(1) * FROM DBO.SNDTL WHERE XDSN LIKE 'SHU1011%' ORDER BY SUBSTRING(XDSN,0,7)+SUBSTRING(XDSN,11,1)+RIGHT(XDSN,7) DESC) AS TABLE1";
- string text4 = "select * FROM (select TOP(1) * FROM DBO.SNDTL WHERE XDSN LIKE 'SHU104S%' ORDER BY SUBSTRING(XDSN,0,7)+SUBSTRING(XDSN,11,1)+RIGHT(XDSN,7) DESC) AS TABLE2";
- string text5 = "select * FROM (select TOP(1) * FROM DBO.SNDTL WHERE XDSN LIKE 'SHU206S%' ORDER BY SUBSTRING(XDSN,0,7)+SUBSTRING(XDSN,11,1)+RIGHT(XDSN,7) DESC) AS TABLE3";
- string text6 = "select * FROM (select TOP(1) * FROM DBO.SNDTL WHERE XDSN LIKE '02647G1%' ORDER BY SUBSTRING(XDSN,0,7)+SUBSTRING(XDSN,11,1)+RIGHT(XDSN,7) DESC) AS TABLE4";
- string text7 = "select * FROM (select TOP(1) * FROM DBO.SNDTL WHERE XDSN LIKE '02647G2%' ORDER BY SUBSTRING(XDSN,0,7)+SUBSTRING(XDSN,11,1)+RIGHT(XDSN,7) DESC) AS TABLE5";
- string text8 = "select * FROM (select TOP(1) * FROM DBO.SNDTL WHERE XDSN LIKE '02648G3%' ORDER BY SUBSTRING(XDSN,0,7)+SUBSTRING(XDSN,11,1)+RIGHT(XDSN,7) DESC) AS TABLE6";
- string text9 = "select * FROM (select TOP(1) * FROM DBO.SNDTL WHERE XDSN LIKE '02648G1%' ORDER BY SUBSTRING(XDSN,0,7)+SUBSTRING(XDSN,11,1)+RIGHT(XDSN,7) DESC) AS TABLE7";
- string text10 = "select * FROM (select TOP(1) * FROM DBO.SNDTL WHERE XDSN LIKE '02648G2%' ORDER BY SUBSTRING(XDSN,0,7)+SUBSTRING(XDSN,11,1)+RIGHT(XDSN,7) DESC) AS TABLE8";
- string text11 = "select * FROM (select TOP(1) * FROM DBO.SNDTL WHERE XDSN LIKE '02601P3%' ORDER BY SUBSTRING(XDSN,0,7)+SUBSTRING(XDSN,11,1)+RIGHT(XDSN,7) DESC) AS TABLE9";
- string text12 = "select * FROM (select TOP(1) * FROM DBO.SNDTL WHERE XDSN LIKE 'DHU057L%' ORDER BY SUBSTRING(XDSN,0,7)+SUBSTRING(XDSN,11,1)+RIGHT(XDSN,7) DESC) AS TABLEA";
- string cmdText = text3 + "\r\nUNION\r\n" + text4 + "\r\nUNION\r\n" + text5 + "\r\nUNION\r\n" + text6 + "\r\nUNION\r\n" + text7 + "\r\nUNION\r\n" + text8 + "\r\nUNION\r\n" + text9 + "\r\nUNION\r\n" + text10 + "\r\nUNION\r\n" + text11 + "\r\nUNION\r\n" + text12;
- using (SqlCommand selectCommand = new SqlCommand(cmdText, sqlConnection))
- {
- sqlConnection.Open();
- SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(selectCommand);
- DataSet dataSet = new DataSet();
- sqlDataAdapter.Fill(dataSet);
- dataGridView2.DataSource = dataSet.Tables[0];
- dataGridView2.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells;
- toolStripStatusLabel8.Text = $"{dataSet.Tables[0].Rows.Count}琛�";
- sqlDataAdapter.Dispose();
- dataSet.Dispose();
- sqlConnection.Close();
- return;
- }
- }
- }
- if (!ValidatingText(cbox_Field, "璇烽�夋嫨鏌ヨ瀛楁") || !ValidatingText(tbx_content, "璇疯緭鍏ユ煡璇㈠唴瀹�"))
- {
- return;
- }
- using (SqlConnection sqlConnection2 = new SqlConnection(settings1.DBConn))
- {
- string text13 = string.Empty;
- switch (cbox_Field.Text)
- {
- case "宸ュ崟鍙�":
- text13 = "orderid";
- break;
- case "鏈哄瀷":
- text13 = "Model";
- break;
- case "杩囩珯鐮�":
- text13 = "MESSN";
- break;
- case "XDSN":
- text13 = "XDSN";
- break;
- case "DHUID":
- text13 = "DHUID";
- break;
- case "GeelyDU":
- text13 = "DU";
- break;
- case "纭欢鐗堟湰":
- text13 = "HW";
- break;
- case "杞欢鐗堟湰":
- text13 = "SW";
- break;
- case "JtagKey":
- text13 = "JtagKey";
- break;
- }
- string cmdText2 = "select * from [dbo].[SNDTL] where " + text13 + " like @value";
- using (SqlCommand sqlCommand = new SqlCommand(cmdText2, sqlConnection2))
- {
- sqlCommand.Parameters.AddWithValue("@value", "%" + tbx_content.Text + "%");
- sqlConnection2.Open();
- SqlDataAdapter sqlDataAdapter2 = new SqlDataAdapter(sqlCommand);
- DataSet dataSet2 = new DataSet();
- sqlDataAdapter2.Fill(dataSet2);
- dataGridView2.DataSource = dataSet2.Tables[0];
- dataGridView2.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells;
- toolStripStatusLabel8.Text = $"{dataSet2.Tables[0].Rows.Count}琛�";
- sqlDataAdapter2.Dispose();
- dataSet2.Dispose();
- sqlConnection2.Close();
- }
- }
- }
-
- private void tbx_content_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (e.KeyChar == '\r')
- {
- btn_Query_Click(sender, e);
- }
- }
-
- private void btn_Modify_Click(object sender, EventArgs e)
- {
- MessageBox.Show("姝ゅ姛鑳芥殏鏈紑鏀撅紒", "Tips:", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- }
-
- private void btn_Delete_Click(object sender, EventArgs e)
- {
- MessageBox.Show("姝ゅ姛鑳芥殏鏈紑鏀撅紒", "Tips:", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- }
-
- private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
- {
- ShowDataGridRows(base.Controls);
- }
-
- private void ShowDataGridRows(Control.ControlCollection controls)
- {
- foreach (Control control in controls)
- {
- if (control is DataGridView dataGridView)
- {
- toolStripStatusLabel8.Text = $"{dataGridView.Rows}琛�";
- }
- if (control.HasChildren)
- {
- ShowDataGridRows(control.Controls);
- }
- }
- }
-
- private void cbx_Model_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (!string.IsNullOrEmpty(fileNameWithoutExt))
- {
- string file = Path.Combine(Environment.CurrentDirectory, "Config", fileNameWithoutExt + ".ini");
- settings2 = new UserSettings(cbox_Model.Text, file);
- }
- else
- {
- settings2 = new UserSettings(cbox_Model.Text, iniFile);
- }
- GetVal();
- Commonparams(cbox_Model.Text);
- }
-
- private void Commonparams(string model)
- {
- switch (model)
- {
- case "E371-H-CN":
- txt_SNPrefix.Text = $"002101G1{DateTime.Now:yyMMdd}";
- txt_PCODE.Text = "SHU1011";
- break;
- case "E371-L-CN":
- txt_SNPrefix.Text = $"002101G2{DateTime.Now:yyMMdd}";
- txt_PCODE.Text = "SHU1011";
- break;
- case "HY11-H-CN":
- txt_SNPrefix.Text = $"002104S1{DateTime.Now:yyMMdd}";
- txt_PCODE.Text = "SHU104S";
- break;
- case "HY11-L-CN":
- txt_SNPrefix.Text = $"002104S2{DateTime.Now:yyMMdd}";
- txt_PCODE.Text = "SHU104S";
- break;
- case "HS11-H-CN":
- txt_SNPrefix.Text = $"002104S3{DateTime.Now:yyMMdd}";
- txt_PCODE.Text = "SHU104S";
- break;
- case "HS11-L-CN":
- txt_SNPrefix.Text = $"002104S4{DateTime.Now:yyMMdd}";
- txt_PCODE.Text = "SHU104S";
- break;
- case "HY11-H-EU":
- txt_SNPrefix.Text = $"002206S1{DateTime.Now:yyMMdd}";
- txt_PCODE.Text = "SHU206S";
- break;
- case "HY11-L-EU":
- txt_SNPrefix.Text = $"002206S2{DateTime.Now:yyMMdd}";
- txt_PCODE.Text = "SHU206S";
- break;
- case "HS11-H-EU":
- txt_SNPrefix.Text = $"002206S3{DateTime.Now:yyMMdd}";
- txt_PCODE.Text = "SHU206S";
- break;
- case "HS11-L-EU":
- txt_SNPrefix.Text = $"002206S4{DateTime.Now:yyMMdd}";
- txt_PCODE.Text = "SHU206S";
- break;
- case "E245-H-CN":
- txt_SNPrefix.Text = $"002647G1{DateTime.Now:yyMMdd}";
- txt_PCODE.Text = "02647G1";
- break;
- case "E245-L-CN":
- txt_SNPrefix.Text = $"002647G2{DateTime.Now:yyMMdd}";
- txt_PCODE.Text = "02647G2";
- break;
- }
- if (model.Contains("E245"))
- {
- txt_MachineCode.Text = "0";
- txt_FactoryCode.Text = "D";
- txt_LineNo1.Text = "9";
- txt_VendorCode.Text = "999722";
- txt_ShiftsNo.Text = "0";
- }
- else
- {
- txt_MachineCode.Text = "0";
- txt_FactoryCode.Text = "D";
- txt_LineNo1.Text = "1";
- txt_VendorCode.Text = "999722";
- txt_ShiftsNo.Text = "A";
- }
- }
-
- private void txt_StartSN_TextChanged(object sender, EventArgs e)
- {
- TextBox textBox = txt_StartDHUIDSN;
- string text2 = (txt_StartDaySN.Text = txt_StartSN.Text);
- textBox.Text = text2;
- }
-
- private void txt_StartDaySN_TextChanged(object sender, EventArgs e)
- {
- txt_StartDHUIDSN.Text = txt_StartDaySN.Text;
- }
-
- private void txt_Date1_TextChanged(object sender, EventArgs e)
- {
- txt_Date2.Text = txt_Date1.Text;
- }
-
- private void txt_GeelyDU_TextChanged(object sender, EventArgs e)
- {
- txt_PN.Text = txt_GeelyDU.Text.Split('/')[0];
- }
-
- private void GetVal()
- {
- tbx_OrderID.Text = settings2.OrderId;
- cbox_Model.SelectedItem = settings2.Model;
- txt_SNPrefix.Text = settings2.SNPrefix;
- txt_StartSN.Text = settings2.MESSstartSN;
- txt_EndSN.Text = settings2.MESEndSN;
- txt_Date1.Text = settings2.XDSNDate;
- txt_StartDaySN.Text = settings2.XDSNDaySN;
- txt_MinSpecialSN.Text = settings2.XDSNSpecialSN;
- txt_PN.Text = settings2.PartNo;
- txt_HW.Text = settings2.HW;
- txt_SW.Text = settings2.SW;
- txt_GeelyDU.Text = settings2.GeelyDU;
- txt_GeelyHWSD.Text = settings2.GeelyHWSD;
- txt_SXBL.Text = settings2.SXBL;
- txt_SXDISXBL.Text = settings2.SXDISXBL;
- txt_VolvoDU.Text = settings2.VolvoDU;
- txt_VolvoHWSD.Text = settings2.VolvoHWSD;
- }
-
- private void SaveSettings(string file)
- {
- if (!File.Exists(file))
- {
- MessageBox.Show("閰嶇疆鏂囦欢涓嶅瓨鍦紝淇濆瓨澶辫触", "閿欒鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- return;
- }
- WritePrivateProfileString("Settings", "OrderId", tbx_OrderID.Text, file);
- WritePrivateProfileString("Settings", "PartNo", txt_PN.Text, file);
- WritePrivateProfileString("Settings", "HW", txt_HW.Text, file);
- WritePrivateProfileString("Settings", "SW", txt_SW.Text, file);
- WritePrivateProfileString("Settings", "GeelyDU", txt_GeelyDU.Text, file);
- WritePrivateProfileString("Settings", "GeelyHWSD", txt_GeelyHWSD.Text, file);
- WritePrivateProfileString("Settings", "SXBL", txt_SXBL.Text, file);
- WritePrivateProfileString("Settings", "SXDISXBL", txt_SXDISXBL.Text, file);
- WritePrivateProfileString("Settings", "VolvoDU", txt_VolvoDU.Text, file);
- WritePrivateProfileString("Settings", "VolvoHWSD", txt_VolvoHWSD.Text, file);
- }
-
- private void SaveSettings(string section, string file)
- {
- if (!File.Exists(file))
- {
- MessageBox.Show("閰嶇疆鏂囦欢涓嶅瓨鍦紝淇濆瓨澶辫触", "閿欒鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- return;
- }
- WritePrivateProfileString(section, "OrderId", tbx_OrderID.Text, file);
- WritePrivateProfileString(section, "SNPrefix", txt_SNPrefix.Text, file);
- WritePrivateProfileString(section, "MESStartSN", txt_StartSN.Text, file);
- WritePrivateProfileString(section, "MESEndSN", txt_EndSN.Text, file);
- WritePrivateProfileString(section, "XDSNDate", txt_Date1.Text, file);
- WritePrivateProfileString(section, "XDSNDaySN", txt_StartDaySN.Text, file);
- WritePrivateProfileString(section, "XDSNSpecialSN", txt_MinSpecialSN.Text, file);
- WritePrivateProfileString(section, "PartNo", txt_PN.Text, file);
- WritePrivateProfileString(section, "HW", txt_HW.Text, file);
- WritePrivateProfileString(section, "SW", txt_SW.Text, file);
- WritePrivateProfileString(section, "GeelyDU", txt_GeelyDU.Text, file);
- WritePrivateProfileString(section, "GeelyHWSD", txt_GeelyHWSD.Text, file);
- WritePrivateProfileString(section, "SXBL", txt_SXBL.Text, file);
- WritePrivateProfileString(section, "SXDISXBL", txt_SXDISXBL.Text, file);
- WritePrivateProfileString(section, "VolvoDU", txt_VolvoDU.Text, file);
- WritePrivateProfileString(section, "VolvoHWSD", txt_VolvoHWSD.Text, file);
- }
-
- private void btn_OpenDlg_Click(object sender, EventArgs e)
- {
- cbox_Model.SelectedIndexChanged -= cbx_Model_SelectedIndexChanged;
- OpenFileDialog openFileDialog = new OpenFileDialog();
- openFileDialog.InitialDirectory = Path.Combine(Application.StartupPath, "Config");
- openFileDialog.Filter = "INI鏂囦欢(*.ini)|*.ini|鎵�鏈夋枃浠�(*.*)|*.*";
- openFileDialog.Multiselect = false;
- if (openFileDialog.ShowDialog() == DialogResult.OK)
- {
- fileNameWithoutExt = Path.GetFileNameWithoutExtension(openFileDialog.FileName);
- tbx_OrderID.Text = fileNameWithoutExt;
- string file = Path.Combine(Environment.CurrentDirectory, "Config", fileNameWithoutExt + ".ini");
- settings2 = new UserSettings("Config", file);
- GetVal();
- Commonparams(cbox_Model.Text);
- }
- else
- {
- openFileDialog.Dispose();
- }
- cbox_Model.SelectedIndexChanged += cbx_Model_SelectedIndexChanged;
- fileNameWithoutExt = string.Empty;
- }
-
- private void btn_Export_Click(object sender, EventArgs e)
- {
- if (dataGridView2.DataSource != null)
- {
- SaveFileDialog saveFileDialog = new SaveFileDialog();
- saveFileDialog.Filter = "Excel 97-2003宸ヤ綔绨縷*.xls";
- DialogResult dialogResult = saveFileDialog.ShowDialog();
- if (dialogResult == DialogResult.OK)
- {
- progressBar.Value = 0;
- progressBar.Minimum = 0;
- progressBar.Maximum = ((DataTable)dataGridView2.DataSource).Rows.Count;
- string fileName = saveFileDialog.FileName;
- //if (nPOIHelper.ExportExcel((DataTable)dataGridView2.DataSource, "瀵煎嚭鏁版嵁", fileName, progressBar))
- //{
- // MessageBox.Show("鏁版嵁瀵煎嚭瀹屾垚!", "鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // return;
- //}
- MessageBox.Show("鏁版嵁瀵煎嚭澶辫触!", "鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- progressBar.Value = 0;
- }
- }
- else
- {
- MessageBox.Show("鏈彂鐜版暟鎹紝瀵煎嚭澶辫触!", "閿欒", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- }
- }
-
- protected override void Dispose(bool disposing)
- {
- if (disposing && components != null)
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
- this.BottomToolStripPanel = new System.Windows.Forms.ToolStripPanel();
- this.TopToolStripPanel = new System.Windows.Forms.ToolStripPanel();
- this.RightToolStripPanel = new System.Windows.Forms.ToolStripPanel();
- this.LeftToolStripPanel = new System.Windows.Forms.ToolStripPanel();
- this.ContentPanel = new System.Windows.Forms.ToolStripContentPanel();
- this.tabControl1 = new System.Windows.Forms.TabControl();
- this.tabPage1 = new System.Windows.Forms.TabPage();
- this.dataGridView1 = new System.Windows.Forms.DataGridView();
- this.panel1 = new System.Windows.Forms.Panel();
- this.groupBox4 = new System.Windows.Forms.GroupBox();
- this.txt_SXBL = new System.Windows.Forms.TextBox();
- this.label29 = new System.Windows.Forms.Label();
- this.txt_SXDISXBL = new System.Windows.Forms.TextBox();
- this.label30 = new System.Windows.Forms.Label();
- this.btn_ClearText = new System.Windows.Forms.Button();
- this.txt_GeelyHWSD = new System.Windows.Forms.TextBox();
- this.label21 = new System.Windows.Forms.Label();
- this.btn_ImportData = new System.Windows.Forms.Button();
- this.txt_SW = new System.Windows.Forms.TextBox();
- this.label25 = new System.Windows.Forms.Label();
- this.btn_CreateSN = new System.Windows.Forms.Button();
- this.txt_VolvoDU = new System.Windows.Forms.TextBox();
- this.txt_VolvoHWSD = new System.Windows.Forms.TextBox();
- this.label23 = new System.Windows.Forms.Label();
- this.label24 = new System.Windows.Forms.Label();
- this.txt_GeelyDU = new System.Windows.Forms.TextBox();
- this.label22 = new System.Windows.Forms.Label();
- this.txt_HW = new System.Windows.Forms.TextBox();
- this.label20 = new System.Windows.Forms.Label();
- this.groupBox3 = new System.Windows.Forms.GroupBox();
- this.txt_EndDHUIDSN = new System.Windows.Forms.TextBox();
- this.label19 = new System.Windows.Forms.Label();
- this.txt_StartDHUIDSN = new System.Windows.Forms.TextBox();
- this.label11 = new System.Windows.Forms.Label();
- this.txt_ShiftsNo = new System.Windows.Forms.TextBox();
- this.label12 = new System.Windows.Forms.Label();
- this.txt_Date2 = new System.Windows.Forms.TextBox();
- this.label13 = new System.Windows.Forms.Label();
- this.txt_PN = new System.Windows.Forms.TextBox();
- this.label14 = new System.Windows.Forms.Label();
- this.txt_VendorCode = new System.Windows.Forms.TextBox();
- this.label15 = new System.Windows.Forms.Label();
- this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.txt_MachineCode = new System.Windows.Forms.TextBox();
- this.label16 = new System.Windows.Forms.Label();
- this.txt_MaxSpecialSN = new System.Windows.Forms.TextBox();
- this.label18 = new System.Windows.Forms.Label();
- this.label17 = new System.Windows.Forms.Label();
- this.txt_EndDaySN = new System.Windows.Forms.TextBox();
- this.txt_MinSpecialSN = new System.Windows.Forms.TextBox();
- this.label10 = new System.Windows.Forms.Label();
- this.txt_StartDaySN = new System.Windows.Forms.TextBox();
- this.label9 = new System.Windows.Forms.Label();
- this.txt_Date1 = new System.Windows.Forms.TextBox();
- this.label8 = new System.Windows.Forms.Label();
- this.txt_FactoryCode = new System.Windows.Forms.TextBox();
- this.label4 = new System.Windows.Forms.Label();
- this.txt_PCODE = new System.Windows.Forms.TextBox();
- this.txt_LineNo1 = new System.Windows.Forms.TextBox();
- this.label5 = new System.Windows.Forms.Label();
- this.label6 = new System.Windows.Forms.Label();
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.tbx_OrderID = new System.Windows.Forms.TextBox();
- this.btn_OpenDlg = new System.Windows.Forms.Button();
- this.cbox_Model = new System.Windows.Forms.ComboBox();
- this.label26 = new System.Windows.Forms.Label();
- this.label3 = new System.Windows.Forms.Label();
- this.label7 = new System.Windows.Forms.Label();
- this.txt_EndSN = new System.Windows.Forms.TextBox();
- this.txt_StartSN = new System.Windows.Forms.TextBox();
- this.label1 = new System.Windows.Forms.Label();
- this.txt_SNPrefix = new System.Windows.Forms.TextBox();
- this.label2 = new System.Windows.Forms.Label();
- this.tabPage2 = new System.Windows.Forms.TabPage();
- this.dataGridView2 = new System.Windows.Forms.DataGridView();
- this.panel2 = new System.Windows.Forms.Panel();
- this.btn_Export = new System.Windows.Forms.Button();
- this.tbx_content = new System.Windows.Forms.TextBox();
- this.cbox_Field = new System.Windows.Forms.ComboBox();
- this.btn_Delete = new System.Windows.Forms.Button();
- this.btn_Modify = new System.Windows.Forms.Button();
- this.btn_Query = new System.Windows.Forms.Button();
- this.label28 = new System.Windows.Forms.Label();
- this.label27 = new System.Windows.Forms.Label();
- this.statusStrip1 = new System.Windows.Forms.StatusStrip();
- this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
- this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
- this.toolStripStatusLabel3 = new System.Windows.Forms.ToolStripStatusLabel();
- this.toolStripStatusLabel4 = new System.Windows.Forms.ToolStripStatusLabel();
- this.toolStripStatusLabel5 = new System.Windows.Forms.ToolStripStatusLabel();
- this.toolStripStatusLabel6 = new System.Windows.Forms.ToolStripStatusLabel();
- this.toolStripStatusLabel7 = new System.Windows.Forms.ToolStripStatusLabel();
- this.toolStripStatusLabel8 = new System.Windows.Forms.ToolStripStatusLabel();
- this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
- this.errorProvider1 = new System.Windows.Forms.ErrorProvider(this.components);
- this.lbl_Title = new System.Windows.Forms.Label();
- this.btn_Close = new System.Windows.Forms.Button();
- this.btn_Minimize = new System.Windows.Forms.Button();
- this.tabControl1.SuspendLayout();
- this.tabPage1.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)this.dataGridView1).BeginInit();
- this.panel1.SuspendLayout();
- this.groupBox4.SuspendLayout();
- this.groupBox3.SuspendLayout();
- this.groupBox2.SuspendLayout();
- this.groupBox1.SuspendLayout();
- this.tabPage2.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)this.dataGridView2).BeginInit();
- this.panel2.SuspendLayout();
- this.statusStrip1.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)this.errorProvider1).BeginInit();
- base.SuspendLayout();
- this.BottomToolStripPanel.Location = new System.Drawing.Point(0, 0);
- this.BottomToolStripPanel.Name = "BottomToolStripPanel";
- this.BottomToolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal;
- this.BottomToolStripPanel.RowMargin = new System.Windows.Forms.Padding(3, 0, 0, 0);
- this.BottomToolStripPanel.Size = new System.Drawing.Size(0, 0);
- this.TopToolStripPanel.Location = new System.Drawing.Point(0, 0);
- this.TopToolStripPanel.Name = "TopToolStripPanel";
- this.TopToolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal;
- this.TopToolStripPanel.RowMargin = new System.Windows.Forms.Padding(3, 0, 0, 0);
- this.TopToolStripPanel.Size = new System.Drawing.Size(0, 0);
- this.RightToolStripPanel.Location = new System.Drawing.Point(0, 0);
- this.RightToolStripPanel.Name = "RightToolStripPanel";
- this.RightToolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal;
- this.RightToolStripPanel.RowMargin = new System.Windows.Forms.Padding(3, 0, 0, 0);
- this.RightToolStripPanel.Size = new System.Drawing.Size(0, 0);
- this.LeftToolStripPanel.Location = new System.Drawing.Point(0, 0);
- this.LeftToolStripPanel.Name = "LeftToolStripPanel";
- this.LeftToolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal;
- this.LeftToolStripPanel.RowMargin = new System.Windows.Forms.Padding(3, 0, 0, 0);
- this.LeftToolStripPanel.Size = new System.Drawing.Size(0, 0);
- this.ContentPanel.AutoScroll = true;
- this.ContentPanel.Size = new System.Drawing.Size(1578, 819);
- this.tabControl1.Controls.Add(this.tabPage1);
- this.tabControl1.Controls.Add(this.tabPage2);
- this.tabControl1.Location = new System.Drawing.Point(0, 81);
- this.tabControl1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.tabControl1.Name = "tabControl1";
- this.tabControl1.SelectedIndex = 0;
- this.tabControl1.Size = new System.Drawing.Size(1902, 925);
- this.tabControl1.TabIndex = 1;
- this.tabControl1.SelectedIndexChanged += new System.EventHandler(tabControl1_SelectedIndexChanged);
- this.tabPage1.Controls.Add(this.dataGridView1);
- this.tabPage1.Controls.Add(this.panel1);
- this.tabPage1.Location = new System.Drawing.Point(4, 25);
- this.tabPage1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.tabPage1.Name = "tabPage1";
- this.tabPage1.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.tabPage1.Size = new System.Drawing.Size(1894, 896);
- this.tabPage1.TabIndex = 0;
- this.tabPage1.Text = "鍒涘缓鍙风爜鈼�";
- this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
- this.dataGridView1.Location = new System.Drawing.Point(5, 298);
- this.dataGridView1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.dataGridView1.Name = "dataGridView1";
- this.dataGridView1.RowHeadersWidth = 51;
- this.dataGridView1.RowTemplate.Height = 30;
- this.dataGridView1.Size = new System.Drawing.Size(1886, 594);
- this.dataGridView1.TabIndex = 0;
- this.panel1.Controls.Add(this.groupBox4);
- this.panel1.Controls.Add(this.groupBox3);
- this.panel1.Controls.Add(this.groupBox2);
- this.panel1.Controls.Add(this.groupBox1);
- this.panel1.Location = new System.Drawing.Point(5, 5);
- this.panel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(1886, 289);
- this.panel1.TabIndex = 0;
- this.groupBox4.Controls.Add(this.txt_SXBL);
- this.groupBox4.Controls.Add(this.label29);
- this.groupBox4.Controls.Add(this.txt_SXDISXBL);
- this.groupBox4.Controls.Add(this.label30);
- this.groupBox4.Controls.Add(this.btn_ClearText);
- this.groupBox4.Controls.Add(this.txt_GeelyHWSD);
- this.groupBox4.Controls.Add(this.label21);
- this.groupBox4.Controls.Add(this.btn_ImportData);
- this.groupBox4.Controls.Add(this.txt_SW);
- this.groupBox4.Controls.Add(this.label25);
- this.groupBox4.Controls.Add(this.btn_CreateSN);
- this.groupBox4.Controls.Add(this.txt_VolvoDU);
- this.groupBox4.Controls.Add(this.txt_VolvoHWSD);
- this.groupBox4.Controls.Add(this.label23);
- this.groupBox4.Controls.Add(this.label24);
- this.groupBox4.Controls.Add(this.txt_GeelyDU);
- this.groupBox4.Controls.Add(this.label22);
- this.groupBox4.Controls.Add(this.txt_HW);
- this.groupBox4.Controls.Add(this.label20);
- this.groupBox4.Location = new System.Drawing.Point(5, 183);
- this.groupBox4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.groupBox4.Name = "groupBox4";
- this.groupBox4.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.groupBox4.Size = new System.Drawing.Size(1876, 100);
- this.groupBox4.TabIndex = 21;
- this.groupBox4.TabStop = false;
- this.groupBox4.Text = "鐗堟湰淇℃伅";
- this.txt_SXBL.Location = new System.Drawing.Point(800, 22);
- this.txt_SXBL.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_SXBL.Name = "txt_SXBL";
- this.txt_SXBL.Size = new System.Drawing.Size(202, 25);
- this.txt_SXBL.TabIndex = 29;
- this.label29.AutoSize = true;
- this.label29.Location = new System.Drawing.Point(755, 27);
- this.label29.Name = "label29";
- this.label29.Size = new System.Drawing.Size(39, 15);
- this.label29.TabIndex = 31;
- this.label29.Text = "SXBL";
- this.txt_SXDISXBL.Location = new System.Drawing.Point(801, 63);
- this.txt_SXDISXBL.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_SXDISXBL.Name = "txt_SXDISXBL";
- this.txt_SXDISXBL.Size = new System.Drawing.Size(201, 25);
- this.txt_SXDISXBL.TabIndex = 28;
- this.label30.AutoSize = true;
- this.label30.Location = new System.Drawing.Point(716, 68);
- this.label30.Name = "label30";
- this.label30.Size = new System.Drawing.Size(79, 15);
- this.label30.TabIndex = 30;
- this.label30.Text = "SXDI_SXBL";
- this.btn_ClearText.Location = new System.Drawing.Point(1751, 41);
- this.btn_ClearText.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.btn_ClearText.Name = "btn_ClearText";
- this.btn_ClearText.Size = new System.Drawing.Size(110, 47);
- this.btn_ClearText.TabIndex = 8;
- this.btn_ClearText.Text = "娓呯┖鍐呭";
- this.btn_ClearText.UseVisualStyleBackColor = true;
- this.btn_ClearText.Click += new System.EventHandler(btn_ClearText_Click);
- this.txt_GeelyHWSD.Location = new System.Drawing.Point(444, 63);
- this.txt_GeelyHWSD.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_GeelyHWSD.Name = "txt_GeelyHWSD";
- this.txt_GeelyHWSD.Size = new System.Drawing.Size(201, 25);
- this.txt_GeelyHWSD.TabIndex = 2;
- this.label21.AutoSize = true;
- this.label21.Location = new System.Drawing.Point(351, 68);
- this.label21.Name = "label21";
- this.label21.Size = new System.Drawing.Size(87, 15);
- this.label21.TabIndex = 19;
- this.label21.Text = "Geely HWSD";
- this.btn_ImportData.Location = new System.Drawing.Point(1622, 41);
- this.btn_ImportData.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.btn_ImportData.Name = "btn_ImportData";
- this.btn_ImportData.Size = new System.Drawing.Size(110, 47);
- this.btn_ImportData.TabIndex = 7;
- this.btn_ImportData.Text = "瀵煎叆鏁版嵁搴�";
- this.btn_ImportData.UseVisualStyleBackColor = true;
- this.btn_ImportData.Click += new System.EventHandler(btn_ImportData_Click);
- this.txt_SW.Location = new System.Drawing.Point(89, 63);
- this.txt_SW.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_SW.Name = "txt_SW";
- this.txt_SW.Size = new System.Drawing.Size(236, 25);
- this.txt_SW.TabIndex = 1;
- this.label25.AutoSize = true;
- this.label25.Location = new System.Drawing.Point(16, 68);
- this.label25.Name = "label25";
- this.label25.Size = new System.Drawing.Size(67, 15);
- this.label25.TabIndex = 27;
- this.label25.Text = "杞欢鐗堟湰";
- this.btn_CreateSN.Location = new System.Drawing.Point(1490, 41);
- this.btn_CreateSN.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.btn_CreateSN.Name = "btn_CreateSN";
- this.btn_CreateSN.Size = new System.Drawing.Size(110, 47);
- this.btn_CreateSN.TabIndex = 6;
- this.btn_CreateSN.Text = "鐢熸垚搴忓垪鍙�";
- this.btn_CreateSN.UseVisualStyleBackColor = true;
- this.btn_CreateSN.Click += new System.EventHandler(btn_CreateSN_Click);
- this.txt_VolvoDU.Location = new System.Drawing.Point(1155, 22);
- this.txt_VolvoDU.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_VolvoDU.Name = "txt_VolvoDU";
- this.txt_VolvoDU.Size = new System.Drawing.Size(202, 25);
- this.txt_VolvoDU.TabIndex = 5;
- this.txt_VolvoHWSD.Location = new System.Drawing.Point(1155, 63);
- this.txt_VolvoHWSD.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_VolvoHWSD.Name = "txt_VolvoHWSD";
- this.txt_VolvoHWSD.Size = new System.Drawing.Size(202, 25);
- this.txt_VolvoHWSD.TabIndex = 4;
- this.label23.AutoSize = true;
- this.label23.Location = new System.Drawing.Point(1062, 68);
- this.label23.Name = "label23";
- this.label23.Size = new System.Drawing.Size(87, 15);
- this.label23.TabIndex = 23;
- this.label23.Text = "Volvo HWSD";
- this.label24.AutoSize = true;
- this.label24.Location = new System.Drawing.Point(1062, 27);
- this.label24.Name = "label24";
- this.label24.Size = new System.Drawing.Size(71, 15);
- this.label24.TabIndex = 25;
- this.label24.Text = "Volvo DU";
- this.txt_GeelyDU.Location = new System.Drawing.Point(443, 22);
- this.txt_GeelyDU.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_GeelyDU.Name = "txt_GeelyDU";
- this.txt_GeelyDU.Size = new System.Drawing.Size(202, 25);
- this.txt_GeelyDU.TabIndex = 3;
- this.txt_GeelyDU.TextChanged += new System.EventHandler(txt_GeelyDU_TextChanged);
- this.label22.AutoSize = true;
- this.label22.Location = new System.Drawing.Point(366, 27);
- this.label22.Name = "label22";
- this.label22.Size = new System.Drawing.Size(71, 15);
- this.label22.TabIndex = 21;
- this.label22.Text = "Geely DU";
- this.txt_HW.Location = new System.Drawing.Point(89, 22);
- this.txt_HW.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_HW.Name = "txt_HW";
- this.txt_HW.Size = new System.Drawing.Size(236, 25);
- this.txt_HW.TabIndex = 0;
- this.label20.AutoSize = true;
- this.label20.Location = new System.Drawing.Point(16, 27);
- this.label20.Name = "label20";
- this.label20.Size = new System.Drawing.Size(67, 15);
- this.label20.TabIndex = 17;
- this.label20.Text = "纭欢鐗堟湰";
- this.groupBox3.Controls.Add(this.txt_EndDHUIDSN);
- this.groupBox3.Controls.Add(this.label19);
- this.groupBox3.Controls.Add(this.txt_StartDHUIDSN);
- this.groupBox3.Controls.Add(this.label11);
- this.groupBox3.Controls.Add(this.txt_ShiftsNo);
- this.groupBox3.Controls.Add(this.label12);
- this.groupBox3.Controls.Add(this.txt_Date2);
- this.groupBox3.Controls.Add(this.label13);
- this.groupBox3.Controls.Add(this.txt_PN);
- this.groupBox3.Controls.Add(this.label14);
- this.groupBox3.Controls.Add(this.txt_VendorCode);
- this.groupBox3.Controls.Add(this.label15);
- this.groupBox3.Location = new System.Drawing.Point(5, 119);
- this.groupBox3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.groupBox3.Name = "groupBox3";
- this.groupBox3.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.groupBox3.Size = new System.Drawing.Size(1876, 59);
- this.groupBox3.TabIndex = 12;
- this.groupBox3.TabStop = false;
- this.groupBox3.Text = "DHUID";
- this.txt_EndDHUIDSN.Location = new System.Drawing.Point(1147, 22);
- this.txt_EndDHUIDSN.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_EndDHUIDSN.Name = "txt_EndDHUIDSN";
- this.txt_EndDHUIDSN.Size = new System.Drawing.Size(84, 25);
- this.txt_EndDHUIDSN.TabIndex = 5;
- this.label19.AutoSize = true;
- this.label19.Location = new System.Drawing.Point(1119, 27);
- this.label19.Name = "label19";
- this.label19.Size = new System.Drawing.Size(22, 15);
- this.label19.TabIndex = 15;
- this.label19.Text = "鍒�";
- this.txt_StartDHUIDSN.Location = new System.Drawing.Point(1032, 22);
- this.txt_StartDHUIDSN.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_StartDHUIDSN.Name = "txt_StartDHUIDSN";
- this.txt_StartDHUIDSN.Size = new System.Drawing.Size(82, 25);
- this.txt_StartDHUIDSN.TabIndex = 4;
- this.label11.AutoSize = true;
- this.label11.Location = new System.Drawing.Point(940, 27);
- this.label11.Name = "label11";
- this.label11.Size = new System.Drawing.Size(82, 15);
- this.label11.TabIndex = 10;
- this.label11.Text = "鐢熶骇娴佹按鍙�";
- this.txt_ShiftsNo.Location = new System.Drawing.Point(848, 22);
- this.txt_ShiftsNo.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_ShiftsNo.Name = "txt_ShiftsNo";
- this.txt_ShiftsNo.Size = new System.Drawing.Size(69, 25);
- this.txt_ShiftsNo.TabIndex = 3;
- this.label12.AutoSize = true;
- this.label12.Location = new System.Drawing.Point(756, 27);
- this.label12.Name = "label12";
- this.label12.Size = new System.Drawing.Size(82, 15);
- this.label12.TabIndex = 8;
- this.label12.Text = "鐢熶骇鐝鍙�";
- this.txt_Date2.Location = new System.Drawing.Point(632, 22);
- this.txt_Date2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_Date2.Name = "txt_Date2";
- this.txt_Date2.Size = new System.Drawing.Size(104, 25);
- this.txt_Date2.TabIndex = 2;
- this.label13.AutoSize = true;
- this.label13.Location = new System.Drawing.Point(556, 27);
- this.label13.Name = "label13";
- this.label13.Size = new System.Drawing.Size(67, 15);
- this.label13.TabIndex = 6;
- this.label13.Text = "鐢熶骇鏃ユ湡";
- this.txt_PN.Location = new System.Drawing.Point(308, 22);
- this.txt_PN.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_PN.Name = "txt_PN";
- this.txt_PN.Size = new System.Drawing.Size(229, 25);
- this.txt_PN.TabIndex = 1;
- this.label14.AutoSize = true;
- this.label14.Location = new System.Drawing.Point(7, 27);
- this.label14.Name = "label14";
- this.label14.Size = new System.Drawing.Size(82, 15);
- this.label14.TabIndex = 0;
- this.label14.Text = "渚涘簲鍟嗕唬鐮�";
- this.txt_VendorCode.Location = new System.Drawing.Point(100, 22);
- this.txt_VendorCode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_VendorCode.Name = "txt_VendorCode";
- this.txt_VendorCode.Size = new System.Drawing.Size(100, 25);
- this.txt_VendorCode.TabIndex = 0;
- this.label15.AutoSize = true;
- this.label15.Location = new System.Drawing.Point(215, 27);
- this.label15.Name = "label15";
- this.label15.Size = new System.Drawing.Size(82, 15);
- this.label15.TabIndex = 2;
- this.label15.Text = "闆堕儴浠剁紪鍙�";
- this.groupBox2.Controls.Add(this.txt_MachineCode);
- this.groupBox2.Controls.Add(this.label16);
- this.groupBox2.Controls.Add(this.txt_MaxSpecialSN);
- this.groupBox2.Controls.Add(this.label18);
- this.groupBox2.Controls.Add(this.label17);
- this.groupBox2.Controls.Add(this.txt_EndDaySN);
- this.groupBox2.Controls.Add(this.txt_MinSpecialSN);
- this.groupBox2.Controls.Add(this.label10);
- this.groupBox2.Controls.Add(this.txt_StartDaySN);
- this.groupBox2.Controls.Add(this.label9);
- this.groupBox2.Controls.Add(this.txt_Date1);
- this.groupBox2.Controls.Add(this.label8);
- this.groupBox2.Controls.Add(this.txt_FactoryCode);
- this.groupBox2.Controls.Add(this.label4);
- this.groupBox2.Controls.Add(this.txt_PCODE);
- this.groupBox2.Controls.Add(this.txt_LineNo1);
- this.groupBox2.Controls.Add(this.label5);
- this.groupBox2.Controls.Add(this.label6);
- this.groupBox2.Location = new System.Drawing.Point(5, 59);
- this.groupBox2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.groupBox2.Size = new System.Drawing.Size(1876, 55);
- this.groupBox2.TabIndex = 9;
- this.groupBox2.TabStop = false;
- this.groupBox2.Text = "XDSN";
- this.txt_MachineCode.Location = new System.Drawing.Point(284, 22);
- this.txt_MachineCode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_MachineCode.Name = "txt_MachineCode";
- this.txt_MachineCode.Size = new System.Drawing.Size(97, 25);
- this.txt_MachineCode.TabIndex = 1;
- this.label16.AutoSize = true;
- this.label16.Location = new System.Drawing.Point(204, 27);
- this.label16.Name = "label16";
- this.label16.Size = new System.Drawing.Size(67, 15);
- this.label16.TabIndex = 15;
- this.label16.Text = "鏁存満浠g爜";
- this.txt_MaxSpecialSN.Location = new System.Drawing.Point(1487, 22);
- this.txt_MaxSpecialSN.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_MaxSpecialSN.Name = "txt_MaxSpecialSN";
- this.txt_MaxSpecialSN.Size = new System.Drawing.Size(92, 25);
- this.txt_MaxSpecialSN.TabIndex = 8;
- this.label18.AutoSize = true;
- this.label18.Location = new System.Drawing.Point(1458, 27);
- this.label18.Name = "label18";
- this.label18.Size = new System.Drawing.Size(22, 15);
- this.label18.TabIndex = 13;
- this.label18.Text = "鍒�";
- this.label17.AutoSize = true;
- this.label17.Location = new System.Drawing.Point(1163, 27);
- this.label17.Name = "label17";
- this.label17.Size = new System.Drawing.Size(22, 15);
- this.label17.TabIndex = 9;
- this.label17.Text = "鍒�";
- this.txt_EndDaySN.Location = new System.Drawing.Point(1192, 22);
- this.txt_EndDaySN.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_EndDaySN.Name = "txt_EndDaySN";
- this.txt_EndDaySN.Size = new System.Drawing.Size(92, 25);
- this.txt_EndDaySN.TabIndex = 6;
- this.txt_MinSpecialSN.Location = new System.Drawing.Point(1360, 22);
- this.txt_MinSpecialSN.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_MinSpecialSN.Name = "txt_MinSpecialSN";
- this.txt_MinSpecialSN.Size = new System.Drawing.Size(92, 25);
- this.txt_MinSpecialSN.TabIndex = 7;
- this.label10.AutoSize = true;
- this.label10.Location = new System.Drawing.Point(1297, 26);
- this.label10.Name = "label10";
- this.label10.Size = new System.Drawing.Size(52, 15);
- this.label10.TabIndex = 10;
- this.label10.Text = "杩炵画鍙�";
- this.txt_StartDaySN.Location = new System.Drawing.Point(1073, 22);
- this.txt_StartDaySN.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_StartDaySN.Name = "txt_StartDaySN";
- this.txt_StartDaySN.Size = new System.Drawing.Size(85, 25);
- this.txt_StartDaySN.TabIndex = 5;
- this.txt_StartDaySN.TextChanged += new System.EventHandler(txt_StartDaySN_TextChanged);
- this.label9.AutoSize = true;
- this.label9.Location = new System.Drawing.Point(993, 27);
- this.label9.Name = "label9";
- this.label9.Size = new System.Drawing.Size(67, 15);
- this.label9.TabIndex = 8;
- this.label9.Text = "鏃ユ祦姘村彿";
- this.txt_Date1.Location = new System.Drawing.Point(877, 22);
- this.txt_Date1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_Date1.Name = "txt_Date1";
- this.txt_Date1.Size = new System.Drawing.Size(97, 25);
- this.txt_Date1.TabIndex = 4;
- this.txt_Date1.TextChanged += new System.EventHandler(txt_Date1_TextChanged);
- this.label8.AutoSize = true;
- this.label8.Location = new System.Drawing.Point(797, 27);
- this.label8.Name = "label8";
- this.label8.Size = new System.Drawing.Size(67, 15);
- this.label8.TabIndex = 6;
- this.label8.Text = "鐢熶骇鏃ユ湡";
- this.txt_FactoryCode.Location = new System.Drawing.Point(492, 22);
- this.txt_FactoryCode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_FactoryCode.Name = "txt_FactoryCode";
- this.txt_FactoryCode.Size = new System.Drawing.Size(97, 25);
- this.txt_FactoryCode.TabIndex = 2;
- this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(16, 27);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(47, 15);
- this.label4.TabIndex = 0;
- this.label4.Text = "PCODE";
- this.txt_PCODE.Location = new System.Drawing.Point(73, 22);
- this.txt_PCODE.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_PCODE.Name = "txt_PCODE";
- this.txt_PCODE.Size = new System.Drawing.Size(96, 25);
- this.txt_PCODE.TabIndex = 0;
- this.txt_LineNo1.Location = new System.Drawing.Point(684, 22);
- this.txt_LineNo1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_LineNo1.Name = "txt_LineNo1";
- this.txt_LineNo1.Size = new System.Drawing.Size(97, 25);
- this.txt_LineNo1.TabIndex = 3;
- this.label5.AutoSize = true;
- this.label5.Location = new System.Drawing.Point(412, 27);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(67, 15);
- this.label5.TabIndex = 2;
- this.label5.Text = "宸ュ巶浠g爜";
- this.label6.AutoSize = true;
- this.label6.Location = new System.Drawing.Point(604, 27);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(67, 15);
- this.label6.TabIndex = 4;
- this.label6.Text = "浜х嚎缂栧彿";
- this.groupBox1.Controls.Add(this.tbx_OrderID);
- this.groupBox1.Controls.Add(this.btn_OpenDlg);
- this.groupBox1.Controls.Add(this.cbox_Model);
- this.groupBox1.Controls.Add(this.label26);
- this.groupBox1.Controls.Add(this.label3);
- this.groupBox1.Controls.Add(this.label7);
- this.groupBox1.Controls.Add(this.txt_EndSN);
- this.groupBox1.Controls.Add(this.txt_StartSN);
- this.groupBox1.Controls.Add(this.label1);
- this.groupBox1.Controls.Add(this.txt_SNPrefix);
- this.groupBox1.Controls.Add(this.label2);
- this.groupBox1.Location = new System.Drawing.Point(3, 2);
- this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.groupBox1.Size = new System.Drawing.Size(1878, 52);
- this.groupBox1.TabIndex = 8;
- this.groupBox1.TabStop = false;
- this.groupBox1.Text = "SN";
- this.tbx_OrderID.Location = new System.Drawing.Point(70, 17);
- this.tbx_OrderID.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.tbx_OrderID.Name = "tbx_OrderID";
- this.tbx_OrderID.Size = new System.Drawing.Size(172, 25);
- this.tbx_OrderID.TabIndex = 13;
- this.btn_OpenDlg.Location = new System.Drawing.Point(248, 15);
- this.btn_OpenDlg.Name = "btn_OpenDlg";
- this.btn_OpenDlg.Size = new System.Drawing.Size(41, 27);
- this.btn_OpenDlg.TabIndex = 12;
- this.btn_OpenDlg.Text = "...";
- this.btn_OpenDlg.UseVisualStyleBackColor = true;
- this.btn_OpenDlg.Click += new System.EventHandler(btn_OpenDlg_Click);
- this.cbox_Model.FormattingEnabled = true;
- this.cbox_Model.Location = new System.Drawing.Point(390, 16);
- this.cbox_Model.Name = "cbox_Model";
- this.cbox_Model.Size = new System.Drawing.Size(192, 23);
- this.cbox_Model.TabIndex = 11;
- this.cbox_Model.SelectedIndexChanged += new System.EventHandler(cbx_Model_SelectedIndexChanged);
- this.label26.AutoSize = true;
- this.label26.Location = new System.Drawing.Point(351, 19);
- this.label26.Name = "label26";
- this.label26.Size = new System.Drawing.Size(37, 15);
- this.label26.TabIndex = 10;
- this.label26.Text = "鏈哄瀷";
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(12, 20);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(52, 15);
- this.label3.TabIndex = 9;
- this.label3.Text = "宸ュ崟鍙�";
- this.label7.AutoSize = true;
- this.label7.Location = new System.Drawing.Point(1110, 18);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(22, 15);
- this.label7.TabIndex = 8;
- this.label7.Text = "鍒�";
- this.txt_EndSN.Location = new System.Drawing.Point(1139, 14);
- this.txt_EndSN.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_EndSN.Name = "txt_EndSN";
- this.txt_EndSN.Size = new System.Drawing.Size(92, 25);
- this.txt_EndSN.TabIndex = 3;
- this.txt_StartSN.Location = new System.Drawing.Point(1016, 14);
- this.txt_StartSN.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_StartSN.Name = "txt_StartSN";
- this.txt_StartSN.Size = new System.Drawing.Size(89, 25);
- this.txt_StartSN.TabIndex = 2;
- this.txt_StartSN.TextChanged += new System.EventHandler(txt_StartSN_TextChanged);
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(612, 18);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(53, 15);
- this.label1.TabIndex = 0;
- this.label1.Text = "SN鍓嶇紑";
- this.txt_SNPrefix.Location = new System.Drawing.Point(676, 14);
- this.txt_SNPrefix.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.txt_SNPrefix.Name = "txt_SNPrefix";
- this.txt_SNPrefix.Size = new System.Drawing.Size(231, 25);
- this.txt_SNPrefix.TabIndex = 1;
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(953, 18);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(52, 15);
- this.label2.TabIndex = 2;
- this.label2.Text = "娴佹按鍙�";
- this.tabPage2.Controls.Add(this.dataGridView2);
- this.tabPage2.Controls.Add(this.panel2);
- this.tabPage2.Location = new System.Drawing.Point(4, 25);
- this.tabPage2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.tabPage2.Name = "tabPage2";
- this.tabPage2.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.tabPage2.Size = new System.Drawing.Size(1894, 896);
- this.tabPage2.TabIndex = 1;
- this.tabPage2.Text = "鏌ヨ鍙风爜鈼�";
- this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
- this.dataGridView2.Location = new System.Drawing.Point(4, 83);
- this.dataGridView2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.dataGridView2.Name = "dataGridView2";
- this.dataGridView2.RowHeadersWidth = 51;
- this.dataGridView2.RowTemplate.Height = 30;
- this.dataGridView2.Size = new System.Drawing.Size(1886, 809);
- this.dataGridView2.TabIndex = 1;
- this.panel2.Controls.Add(this.btn_Export);
- this.panel2.Controls.Add(this.tbx_content);
- this.panel2.Controls.Add(this.cbox_Field);
- this.panel2.Controls.Add(this.btn_Delete);
- this.panel2.Controls.Add(this.btn_Modify);
- this.panel2.Controls.Add(this.btn_Query);
- this.panel2.Controls.Add(this.label28);
- this.panel2.Controls.Add(this.label27);
- this.panel2.Location = new System.Drawing.Point(3, 5);
- this.panel2.Name = "panel2";
- this.panel2.Size = new System.Drawing.Size(1888, 73);
- this.panel2.TabIndex = 0;
- this.btn_Export.Location = new System.Drawing.Point(1718, 11);
- this.btn_Export.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.btn_Export.Name = "btn_Export";
- this.btn_Export.Size = new System.Drawing.Size(110, 47);
- this.btn_Export.TabIndex = 22;
- this.btn_Export.Text = "瀵煎嚭鏁版嵁";
- this.btn_Export.UseVisualStyleBackColor = true;
- this.btn_Export.Click += new System.EventHandler(btn_Export_Click);
- this.tbx_content.Location = new System.Drawing.Point(424, 24);
- this.tbx_content.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.tbx_content.Name = "tbx_content";
- this.tbx_content.Size = new System.Drawing.Size(383, 25);
- this.tbx_content.TabIndex = 21;
- this.tbx_content.KeyPress += new System.Windows.Forms.KeyPressEventHandler(tbx_content_KeyPress);
- this.cbox_Field.FormattingEnabled = true;
- this.cbox_Field.Location = new System.Drawing.Point(97, 24);
- this.cbox_Field.Name = "cbox_Field";
- this.cbox_Field.Size = new System.Drawing.Size(199, 23);
- this.cbox_Field.TabIndex = 20;
- this.cbox_Field.SelectedIndexChanged += new System.EventHandler(cbx_Field_SelectedIndexChanged);
- this.btn_Delete.Location = new System.Drawing.Point(1436, 11);
- this.btn_Delete.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.btn_Delete.Name = "btn_Delete";
- this.btn_Delete.Size = new System.Drawing.Size(110, 47);
- this.btn_Delete.TabIndex = 19;
- this.btn_Delete.Text = "鍒犻櫎";
- this.btn_Delete.UseVisualStyleBackColor = true;
- this.btn_Delete.Visible = false;
- this.btn_Delete.Click += new System.EventHandler(btn_Delete_Click);
- this.btn_Modify.Location = new System.Drawing.Point(1295, 11);
- this.btn_Modify.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.btn_Modify.Name = "btn_Modify";
- this.btn_Modify.Size = new System.Drawing.Size(110, 47);
- this.btn_Modify.TabIndex = 18;
- this.btn_Modify.Text = "淇敼";
- this.btn_Modify.UseVisualStyleBackColor = true;
- this.btn_Modify.Visible = false;
- this.btn_Modify.Click += new System.EventHandler(btn_Modify_Click);
- this.btn_Query.Location = new System.Drawing.Point(1577, 11);
- this.btn_Query.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- this.btn_Query.Name = "btn_Query";
- this.btn_Query.Size = new System.Drawing.Size(110, 47);
- this.btn_Query.TabIndex = 17;
- this.btn_Query.Text = "鏌ヨ";
- this.btn_Query.UseVisualStyleBackColor = true;
- this.btn_Query.Click += new System.EventHandler(btn_Query_Click);
- this.label28.AutoSize = true;
- this.label28.Location = new System.Drawing.Point(351, 27);
- this.label28.Name = "label28";
- this.label28.Size = new System.Drawing.Size(67, 15);
- this.label28.TabIndex = 14;
- this.label28.Text = "鏌ヨ鍐呭";
- this.label27.AutoSize = true;
- this.label27.Location = new System.Drawing.Point(24, 27);
- this.label27.Name = "label27";
- this.label27.Size = new System.Drawing.Size(67, 15);
- this.label27.TabIndex = 11;
- this.label27.Text = "鏌ヨ瀛楁";
- this.statusStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
- this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[8] { this.toolStripStatusLabel1, this.toolStripStatusLabel2, this.toolStripStatusLabel3, this.toolStripStatusLabel4, this.toolStripStatusLabel5, this.toolStripStatusLabel6, this.toolStripStatusLabel7, this.toolStripStatusLabel8 });
- this.statusStrip1.Location = new System.Drawing.Point(0, 1007);
- this.statusStrip1.Name = "statusStrip1";
- this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 12, 0);
- this.statusStrip1.Size = new System.Drawing.Size(1902, 26);
- this.statusStrip1.TabIndex = 2;
- this.statusStrip1.Text = "statusStrip1";
- this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
- this.toolStripStatusLabel1.Size = new System.Drawing.Size(167, 20);
- this.toolStripStatusLabel1.Text = "toolStripStatusLabel1";
- this.toolStripStatusLabel2.Name = "toolStripStatusLabel2";
- this.toolStripStatusLabel2.Size = new System.Drawing.Size(167, 20);
- this.toolStripStatusLabel2.Text = "toolStripStatusLabel2";
- this.toolStripStatusLabel3.Name = "toolStripStatusLabel3";
- this.toolStripStatusLabel3.Size = new System.Drawing.Size(167, 20);
- this.toolStripStatusLabel3.Text = "toolStripStatusLabel3";
- this.toolStripStatusLabel4.Name = "toolStripStatusLabel4";
- this.toolStripStatusLabel4.Size = new System.Drawing.Size(167, 20);
- this.toolStripStatusLabel4.Text = "toolStripStatusLabel4";
- this.toolStripStatusLabel5.Name = "toolStripStatusLabel5";
- this.toolStripStatusLabel5.Size = new System.Drawing.Size(167, 20);
- this.toolStripStatusLabel5.Text = "toolStripStatusLabel5";
- this.toolStripStatusLabel6.Name = "toolStripStatusLabel6";
- this.toolStripStatusLabel6.Size = new System.Drawing.Size(167, 20);
- this.toolStripStatusLabel6.Text = "toolStripStatusLabel6";
- this.toolStripStatusLabel7.Name = "toolStripStatusLabel7";
- this.toolStripStatusLabel7.Size = new System.Drawing.Size(167, 20);
- this.toolStripStatusLabel7.Text = "toolStripStatusLabel7";
- this.toolStripStatusLabel8.Name = "toolStripStatusLabel8";
- this.toolStripStatusLabel8.Size = new System.Drawing.Size(167, 20);
- this.toolStripStatusLabel8.Text = "toolStripStatusLabel8";
- this.errorProvider1.ContainerControl = this;
- this.lbl_Title.Font = new System.Drawing.Font("寰蒋闆呴粦", 30f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 134);
- this.lbl_Title.Location = new System.Drawing.Point(0, 0);
- this.lbl_Title.Name = "lbl_Title";
- this.lbl_Title.Size = new System.Drawing.Size(1902, 66);
- this.lbl_Title.TabIndex = 3;
- this.lbl_Title.Text = "SN Generate Tool";
- //this.btn_Close.BackgroundImage = Hexiv.JK.SNGenerateTool.Properties.Resources.鍏抽棴3;
- this.btn_Close.Location = new System.Drawing.Point(1858, 5);
- this.btn_Close.Name = "btn_Close";
- this.btn_Close.Size = new System.Drawing.Size(32, 32);
- this.btn_Close.TabIndex = 5;
- this.btn_Close.UseVisualStyleBackColor = false;
- this.btn_Close.Click += new System.EventHandler(btn_Close_Click);
- //this.btn_Minimize.BackgroundImage = Hexiv.JK.SNGenerateTool.Properties.Resources.鏈�灏忓寲;
- this.btn_Minimize.Location = new System.Drawing.Point(1803, 5);
- this.btn_Minimize.Name = "btn_Minimize";
- this.btn_Minimize.Size = new System.Drawing.Size(32, 32);
- this.btn_Minimize.TabIndex = 4;
- this.btn_Minimize.UseVisualStyleBackColor = false;
- this.btn_Minimize.Click += new System.EventHandler(btn_Mininimze_Click);
- base.AutoScaleDimensions = new System.Drawing.SizeF(8f, 15f);
- base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- base.ClientSize = new System.Drawing.Size(1902, 1033);
- base.Controls.Add(this.btn_Close);
- base.Controls.Add(this.btn_Minimize);
- base.Controls.Add(this.lbl_Title);
- base.Controls.Add(this.tabControl1);
- base.Controls.Add(this.statusStrip1);
- //base.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
- base.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
- base.Name = "MainForm";
- this.Text = "Form1";
- base.Paint += new System.Windows.Forms.PaintEventHandler(MainForm_Paint);
- this.tabControl1.ResumeLayout(false);
- this.tabPage1.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)this.dataGridView1).EndInit();
- this.panel1.ResumeLayout(false);
- this.groupBox4.ResumeLayout(false);
- this.groupBox4.PerformLayout();
- this.groupBox3.ResumeLayout(false);
- this.groupBox3.PerformLayout();
- this.groupBox2.ResumeLayout(false);
- this.groupBox2.PerformLayout();
- this.groupBox1.ResumeLayout(false);
- this.groupBox1.PerformLayout();
- this.tabPage2.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)this.dataGridView2).EndInit();
- this.panel2.ResumeLayout(false);
- this.panel2.PerformLayout();
- this.statusStrip1.ResumeLayout(false);
- this.statusStrip1.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)this.errorProvider1).EndInit();
- base.ResumeLayout(false);
- base.PerformLayout();
- }
-}
diff --git a/Plugin.SNGenerateTool/HashPlus.cs b/Plugin.SNGenerateTool/HashPlus.cs
deleted file mode 100644
index b516b23..0000000
--- a/Plugin.SNGenerateTool/HashPlus.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-锘縰sing System.Security.Cryptography;
-using System.Text;
-
-namespace Plugin.SNGenerateTool
-{
- internal class HashPlus
- {
- public static string GetHashSHA256(string text)
- {
- byte[] bytes = Encoding.Unicode.GetBytes(text);
- using (SHA256Managed sHA256Managed = new SHA256Managed())
- {
- byte[] array = sHA256Managed.ComputeHash(bytes);
- string text2 = string.Empty;
- byte[] array2 = array;
- foreach (byte b in array2)
- {
- text2 += $"{b:x2}";
- }
- return text2;
- }
- }
-
- public static string GetHashSHA512(string text)
- {
- byte[] bytes = Encoding.Unicode.GetBytes(text);
- using (SHA512Managed sHA512Managed = new SHA512Managed())
- {
- byte[] array = sHA512Managed.ComputeHash(bytes);
- string text2 = string.Empty;
- byte[] array2 = array;
- foreach (byte b in array2)
- {
- text2 += $"{b:x2}";
- }
- return text2;
- }
- }
-
- public static string GetHashSHA384(string text)
- {
- byte[] bytes = Encoding.Unicode.GetBytes(text);
- using (SHA384Managed sHA384Managed = new SHA384Managed())
- {
- byte[] array = sHA384Managed.ComputeHash(bytes);
- string text2 = string.Empty;
- byte[] array2 = array;
- foreach (byte b in array2)
- {
- text2 += $"{b:x2}";
- }
- return text2;
- }
- }
-
- public static string GetHashSHA1(string text)
- {
- byte[] bytes = Encoding.Unicode.GetBytes(text);
- using (SHA1Managed sHA1Managed = new SHA1Managed())
- {
- byte[] array = sHA1Managed.ComputeHash(bytes);
- string text2 = string.Empty;
- byte[] array2 = array;
- foreach (byte b in array2)
- {
- text2 += $"{b:x2}";
- }
- return text2;
- }
- }
-
- public static string GetHashMD5(string text)
- {
- byte[] bytes = Encoding.Unicode.GetBytes(text);
- using (MD5 mD = MD5.Create())
- {
- byte[] array = mD.ComputeHash(bytes);
- string text2 = string.Empty;
- byte[] array2 = array;
- foreach (byte b in array2)
- {
- text2 += $"{b:x2}";
- }
- return text2;
- }
- }
- }
-
-}
diff --git a/Plugin.SNGenerateTool/Plugin.SNGenerateTool.csproj b/Plugin.SNGenerateTool/Plugin.SNGenerateTool.csproj
deleted file mode 100644
index e456031..0000000
--- a/Plugin.SNGenerateTool/Plugin.SNGenerateTool.csproj
+++ /dev/null
@@ -1,144 +0,0 @@
-<?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>{3E18AF3F-8212-45A5-A6E3-F5B1CFA3AFAE}</ProjectGuid>
- <OutputType>library</OutputType>
- <RootNamespace>Plugin.SNGenerateTool</RootNamespace>
- <AssemblyName>Plugin.SNGenerateTool</AssemblyName>
- <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <WarningLevel>4</WarningLevel>
- <Deterministic>true</Deterministic>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\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>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Microsoft.Extensions.Configuration, Version=9.0.0.3, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\Microsoft.Extensions.Configuration.9.0.3\lib\net462\Microsoft.Extensions.Configuration.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.Extensions.Configuration.Abstractions, Version=9.0.0.3, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\Microsoft.Extensions.Configuration.Abstractions.9.0.3\lib\net462\Microsoft.Extensions.Configuration.Abstractions.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.Extensions.Configuration.FileExtensions, Version=9.0.0.3, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\Microsoft.Extensions.Configuration.FileExtensions.9.0.3\lib\net462\Microsoft.Extensions.Configuration.FileExtensions.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.Extensions.Configuration.Ini, Version=9.0.0.3, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\Microsoft.Extensions.Configuration.Ini.9.0.3\lib\net462\Microsoft.Extensions.Configuration.Ini.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.Extensions.FileProviders.Abstractions, Version=9.0.0.3, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\Microsoft.Extensions.FileProviders.Abstractions.9.0.3\lib\net462\Microsoft.Extensions.FileProviders.Abstractions.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.Extensions.FileProviders.Physical, Version=9.0.0.3, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\Microsoft.Extensions.FileProviders.Physical.9.0.3\lib\net462\Microsoft.Extensions.FileProviders.Physical.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.Extensions.FileSystemGlobbing, Version=9.0.0.3, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\Microsoft.Extensions.FileSystemGlobbing.9.0.3\lib\net462\Microsoft.Extensions.FileSystemGlobbing.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.Extensions.Primitives, Version=9.0.0.3, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\Microsoft.Extensions.Primitives.9.0.3\lib\net462\Microsoft.Extensions.Primitives.dll</HintPath>
- </Reference>
- <Reference Include="Panuon.WPF, Version=1.1.2.2, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\Panuon.WPF.1.1.3\lib\net472\Panuon.WPF.dll</HintPath>
- </Reference>
- <Reference Include="Panuon.WPF.UI, Version=1.3.0.2, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\Panuon.WPF.UI.1.3.0.2\lib\net472\Panuon.WPF.UI.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
- </Reference>
- <Reference Include="System.Configuration" />
- <Reference Include="System.Data" />
- <Reference Include="System.Drawing" />
- <Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
- </Reference>
- <Reference Include="System.Numerics" />
- <Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
- </Reference>
- <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
- </Reference>
- <Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
- </Reference>
- <Reference Include="System.Windows.Forms" />
- <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>
- <Page Include="UserControl1.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Compile Include="Entity\DataInfo.cs" />
- <Compile Include="Entity\UserSetting.cs" />
- <Compile Include="Form1.cs">
- <SubType>Form</SubType>
- </Compile>
- <Compile Include="Form1.Designer.cs">
- <DependentUpon>Form1.cs</DependentUpon>
- </Compile>
- <Compile Include="HashPlus.cs" />
- <Compile Include="UserControl1.xaml.cs">
- <DependentUpon>UserControl1.xaml</DependentUpon>
- <SubType>Code</SubType>
- </Compile>
- </ItemGroup>
- <ItemGroup>
- <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>
- <EmbeddedResource Include="Properties\Resources.resx">
- <Generator>ResXFileCodeGenerator</Generator>
- <LastGenOutput>Resources.Designer.cs</LastGenOutput>
- </EmbeddedResource>
- <None Include="app.config" />
- <None Include="packages.config" />
- <None Include="Properties\Settings.settings">
- <Generator>SettingsSingleFileGenerator</Generator>
- <LastGenOutput>Settings.Designer.cs</LastGenOutput>
- </None>
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-</Project>
\ No newline at end of file
diff --git a/Plugin.SNGenerateTool/Properties/AssemblyInfo.cs b/Plugin.SNGenerateTool/Properties/AssemblyInfo.cs
deleted file mode 100644
index 1d07d66..0000000
--- a/Plugin.SNGenerateTool/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-锘縰sing System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Windows;
-
-// 鏈夊叧绋嬪簭闆嗙殑涓�鑸俊鎭敱浠ヤ笅
-// 鎺у埗銆傛洿鏀硅繖浜涚壒鎬у�煎彲淇敼
-// 涓庣▼搴忛泦鍏宠仈鐨勪俊鎭��
-[assembly: AssemblyTitle("Plugin.SNGenerateTool")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Plugin.SNGenerateTool")]
-[assembly: AssemblyCopyright("Copyright 漏 2025")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// 灏� ComVisible 璁剧疆涓� false 浼氫娇姝ょ▼搴忛泦涓殑绫诲瀷
-//瀵� COM 缁勪欢涓嶅彲瑙併�傚鏋滈渶瑕佷粠 COM 璁块棶姝ょ▼搴忛泦涓殑绫诲瀷
-//璇峰皢姝ょ被鍨嬬殑 ComVisible 鐗规�ц缃负 true銆�
-[assembly: ComVisible(false)]
-
-//鑻ヨ寮�濮嬬敓鎴愬彲鏈湴鍖栫殑搴旂敤绋嬪簭锛岃璁剧疆
-//.csproj 鏂囦欢涓殑 <UICulture>CultureYouAreCodingWith</UICulture>
-//鍦� <PropertyGroup> 涓�備緥濡傦紝濡傛灉浣犱娇鐢ㄧ殑鏄編鍥借嫳璇��
-//浣跨敤鐨勬槸缇庡浗鑻辫锛岃灏� <UICulture> 璁剧疆涓� en-US銆� 鐒跺悗鍙栨秷
-//瀵逛互涓� NeutralResourceLanguage 鐗规�х殑娉ㄩ噴銆� 鏇存柊
-//浠ヤ笅琛屼腑鐨勨�渆n-US鈥濅互鍖归厤椤圭洰鏂囦欢涓殑 UICulture 璁剧疆銆�
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
-[assembly:ThemeInfo(
- ResourceDictionaryLocation.None, //涓婚鐗瑰畾璧勬簮璇嶅吀鎵�澶勪綅缃�
- //(鏈湪椤甸潰涓壘鍒拌祫婧愭椂浣跨敤锛�
- //鎴栧簲鐢ㄧ▼搴忚祫婧愬瓧鍏镐腑鎵惧埌鏃朵娇鐢�)
- ResourceDictionaryLocation.SourceAssembly //甯歌璧勬簮璇嶅吀鎵�澶勪綅缃�
- //(鏈湪椤甸潰涓壘鍒拌祫婧愭椂浣跨敤锛�
- //銆佸簲鐢ㄧ▼搴忔垨浠讳綍涓婚涓撶敤璧勬簮瀛楀吀涓壘鍒版椂浣跨敤)
-)]
-
-
-// 绋嬪簭闆嗙殑鐗堟湰淇℃伅鐢变笅鍒楀洓涓�肩粍鎴�:
-//
-// 涓荤増鏈�
-// 娆$増鏈�
-// 鐢熸垚鍙�
-// 淇鍙�
-//
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Plugin.SNGenerateTool/Properties/Resources.Designer.cs b/Plugin.SNGenerateTool/Properties/Resources.Designer.cs
deleted file mode 100644
index ce28cea..0000000
--- a/Plugin.SNGenerateTool/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-锘�//------------------------------------------------------------------------------
-// <auto-generated>
-// 姝や唬鐮佺敱宸ュ叿鐢熸垚銆�
-// 杩愯鏃剁増鏈�: 4.0.30319.42000
-//
-// 瀵规鏂囦欢鐨勬洿鏀瑰彲鑳藉鑷翠笉姝g‘鐨勮涓猴紝濡傛灉
-// 閲嶆柊鐢熸垚浠g爜锛屽垯鎵�鍋氭洿鏀瑰皢涓㈠け銆�
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace Plugin.SNGenerateTool.Properties {
-
-
- /// <summary>
- /// 寮虹被鍨嬭祫婧愮被锛岀敤浜庢煡鎵炬湰鍦板寲瀛楃涓茬瓑銆�
- /// </summary>
- // 姝ょ被鏄敱 StronglyTypedResourceBuilder
- // 绫婚�氳繃绫讳技浜� ResGen 鎴� Visual Studio 鐨勫伐鍏疯嚜鍔ㄧ敓鎴愮殑銆�
- // 鑻ヨ娣诲姞鎴栫Щ闄ゆ垚鍛橈紝璇风紪杈� .ResX 鏂囦欢锛岀劧鍚庨噸鏂拌繍琛� ResGen
- // (浠� /str 浣滀负鍛戒护閫夐」)锛屾垨閲嶆柊鐢熸垚 VS 椤圭洰銆�
- [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>
- /// 杩斿洖姝ょ被浣跨敤鐨勭紦瀛� ResourceManager 瀹炰緥銆�
- /// </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("Plugin.SNGenerateTool.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// 閲嶅啓褰撳墠绾跨▼鐨� CurrentUICulture 灞炴�э紝瀵�
- /// 浣跨敤姝ゅ己绫诲瀷璧勬簮绫荤殑鎵�鏈夎祫婧愭煡鎵炬墽琛岄噸鍐欍��
- /// </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/Plugin.SNGenerateTool/Properties/Resources.resx b/Plugin.SNGenerateTool/Properties/Resources.resx
deleted file mode 100644
index af7dbeb..0000000
--- a/Plugin.SNGenerateTool/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-锘�<?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/Plugin.SNGenerateTool/Properties/Settings.Designer.cs b/Plugin.SNGenerateTool/Properties/Settings.Designer.cs
deleted file mode 100644
index 42641cf..0000000
--- a/Plugin.SNGenerateTool/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-锘�//------------------------------------------------------------------------------
-// <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 Plugin.SNGenerateTool.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/Plugin.SNGenerateTool/Properties/Settings.settings b/Plugin.SNGenerateTool/Properties/Settings.settings
deleted file mode 100644
index 033d7a5..0000000
--- a/Plugin.SNGenerateTool/Properties/Settings.settings
+++ /dev/null
@@ -1,7 +0,0 @@
-锘�<?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/Plugin.SNGenerateTool/UserControl1.xaml b/Plugin.SNGenerateTool/UserControl1.xaml
deleted file mode 100644
index a3a9568..0000000
--- a/Plugin.SNGenerateTool/UserControl1.xaml
+++ /dev/null
@@ -1,265 +0,0 @@
-锘�<UserControl x:Class="Plugin.SNGenerateTool.UserControl1"
- 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:Plugin.SNGenerateTool"
- mc:Ignorable="d"
- xmlns:pw="https://opensource.panuon.com/wpf"
- xmlns:pu="https://opensource.panuon.com/wpf-ui"
- Background="#FFF"
- FontSize="18"
- d:DesignHeight="450" d:DesignWidth="1920">
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <pu:StyleDictionary Includes="DataGrid" />
- </ResourceDictionary.MergedDictionaries>
- <Style TargetType="TextBox">
- <Setter Property="MinWidth" Value="100"/>
- <Setter Property="VerticalContentAlignment" Value="Center"/>
- <Setter Property="Height" Value="36"/>
- </Style>
-
- <Style TargetType="pu:FormGroup">
- <Setter Property="Margin" Value="0,10,30,10"/>
- </Style>
-
- <Style TargetType="GroupBox">
- </Style>
- </ResourceDictionary>
- </UserControl.Resources>
-
- <TabControl>
- <TabItem Header="鍒涘缓鍙风爜">
- <Grid Background="LightGray">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
-
- <StackPanel Margin="10">
- <GroupBox Header="SN">
- <StackPanel Orientation="Horizontal">
- <pu:FormGroup Header="宸ュ崟鍙�">
- <TextBox x:Name="tbx_OrderID" Width="200"/>
- </pu:FormGroup>
- <pu:FormGroup Header="鏈哄瀷">
- <ComboBox x:Name="cbox_Model"/>
- </pu:FormGroup>
- <pu:FormGroup Header="SN鍓嶇紑">
- <TextBox x:Name="txt_SNPrefix" Width="200"/>
- </pu:FormGroup>
- <pu:FormGroup Header="娴佹按鍙�" Margin="0,10,0,10">
- <TextBox x:Name="txt_StartSN"/>
- </pu:FormGroup>
- <pu:FormGroup Header="鍒�">
- <TextBox x:Name="txt_EndSN"/>
- </pu:FormGroup>
- </StackPanel>
- </GroupBox>
-
- <GroupBox Header="XDSN">
- <StackPanel Orientation="Horizontal">
- <pu:FormGroup Header="PCODE">
- <TextBox x:Name="txt_PCODE"/>
- </pu:FormGroup>
- <pu:FormGroup Header="鏁存満浠g爜">
- <TextBox x:Name="txt_MachineCode"/>
- </pu:FormGroup>
- <pu:FormGroup Header="宸ュ巶浠g爜">
- <TextBox x:Name="txt_FactoryCode"/>
- </pu:FormGroup>
- <pu:FormGroup Header="浜х嚎缂栧彿">
- <TextBox x:Name="txt_LineNo1"/>
- </pu:FormGroup>
- <pu:FormGroup Header="鐢熶骇鏃ユ湡">
- <TextBox x:Name="txt_Date1"/>
- </pu:FormGroup>
- <pu:FormGroup Header="鏃ユ祦姘村彿" Margin="0,10,0,10">
- <TextBox x:Name="txt_StartDaySN"/>
- </pu:FormGroup>
- <pu:FormGroup Header="鍒�">
- <TextBox IsEnabled="False"/>
- </pu:FormGroup>
- <pu:FormGroup Header="杩炵画鍙�" Margin="0,10,0,10">
- <TextBox x:Name="txt_MinSpecialSN"/>
- </pu:FormGroup>
- <pu:FormGroup Header="鍒�">
- <TextBox IsEnabled="False"/>
- </pu:FormGroup>
- </StackPanel>
- </GroupBox>
-
- <GroupBox Header="DHUID">
- <StackPanel Orientation="Horizontal">
- <pu:FormGroup Header="渚涘簲鍟嗕唬鐮�">
- <TextBox x:Name="txt_VendorCode"/>
- </pu:FormGroup>
- <pu:FormGroup Header="闆堕儴浠剁紪鍙�">
- <TextBox x:Name="txt_PN"/>
- </pu:FormGroup>
- <pu:FormGroup Header="鐢熶骇鏃ユ湡">
- <TextBox/>
- </pu:FormGroup>
- <pu:FormGroup Header="鐢熶骇鐝鍙�">
- <TextBox x:Name="txt_ShiftsNo"/>
- </pu:FormGroup>
- <pu:FormGroup Header="鐢熶骇娴佹按鍙�" Margin="0,10,0,10">
- <TextBox x:Name="txt_StartDHUIDSN"/>
- </pu:FormGroup>
- <pu:FormGroup Header="鍒�">
- <TextBox IsEnabled="False"/>
- </pu:FormGroup>
- </StackPanel>
- </GroupBox>
-
- <GroupBox Header="鐗堟湰淇℃伅">
- <GroupBox.Resources>
- <Style TargetType="TextBox">
- <Setter Property="MinWidth" Value="200"/>
- </Style>
- </GroupBox.Resources>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition/>
- <ColumnDefinition/>
- <ColumnDefinition/>
- <ColumnDefinition/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
- <pu:FormGroup Grid.Row="0" Grid.Column="0" Header="纭欢鐗堟湰" GroupName="Version">
- <TextBox x:Name="txt_HW"/>
- </pu:FormGroup>
- <pu:FormGroup Grid.Row="1" Grid.Column="0" Header="杞欢鐗堟湰" GroupName="Version">
- <TextBox x:Name="txt_SW"/>
- </pu:FormGroup>
-
- <pu:FormGroup Grid.Row="0" Grid.Column="1" Header="Geely DU" GroupName="Version">
- <TextBox x:Name="txt_GeelyDU"/>
- </pu:FormGroup>
- <pu:FormGroup Grid.Row="1" Grid.Column="1" Header="Geely HWSD" GroupName="Version">
- <TextBox x:Name="txt_GeelyHWSD"/>
- </pu:FormGroup>
-
- <pu:FormGroup Grid.Row="0" Grid.Column="2" Header="SXBL" GroupName="Version">
- <TextBox x:Name="txt_SXBL"/>
- </pu:FormGroup>
- <pu:FormGroup Grid.Row="1" Grid.Column="2" Header="SXDI_SXBL" GroupName="Version">
- <TextBox x:Name="txt_SXDISXBL"/>
- </pu:FormGroup>
-
- <pu:FormGroup Grid.Row="0" Grid.Column="3" Header="Volvo DU" GroupName="Version">
- <TextBox x:Name="txt_VolvoDU"/>
- </pu:FormGroup>
- <pu:FormGroup Grid.Row="1" Grid.Column="3" Header="Volvo HWSD" GroupName="Version">
- <TextBox x:Name="txt_VolvoHWSD"/>
- </pu:FormGroup>
-
- <StackPanel Orientation="Horizontal"
- Grid.Row="0" Grid.Column="4" Grid.ColumnSpan="2">
- <Button Click="Button_Click">鐢熸垚搴忓垪鍙�</Button>
- <Button>瀵煎叆鏁版嵁搴�</Button>
- <Button>娓呯┖鍐呭</Button>
- </StackPanel>
- </Grid>
- </GroupBox>
- </StackPanel>
- <DataGrid Grid.Row="1" x:Name="table1" AutoGenerateColumns="False"
- CanUserAddRows="False"
- CanUserDeleteRows="False"
- ItemsSource="{Binding Datasource}">
- <DataGrid.Columns>
- <DataGridTemplateColumn Header="#" IsReadOnly="True" CanUserResize="False">
-
- </DataGridTemplateColumn>
-
- <DataGridTextColumn IsReadOnly="True" Width="*" Binding="{Binding GUID}">
- <DataGridTextColumn.Header>
- <TextBlock Text="GUID"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
-
- <DataGridTextColumn IsReadOnly="True" Width="*" Binding="{Binding OrderID}">
- <DataGridTextColumn.Header>
- <TextBlock Text="OrderId"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
-
- <DataGridTextColumn IsReadOnly="True" Width="*" Binding="{Binding Model}">
- <DataGridTextColumn.Header>
- <TextBlock Text="Model"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
-
- <DataGridTextColumn IsReadOnly="True" Width="*" Binding="{Binding MESSN}">
- <DataGridTextColumn.Header>
- <TextBlock Text="MESSN"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
-
- <DataGridTextColumn IsReadOnly="True" Width="*" Binding="{Binding XDSN}">
- <DataGridTextColumn.Header>
- <TextBlock Text="XDSN"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
-
- <DataGridTextColumn IsReadOnly="True" Width="*" Binding="{Binding DHUID}">
- <DataGridTextColumn.Header>
- <TextBlock Text="DHUID"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
-
- <DataGridTextColumn IsReadOnly="True" Width="*" Binding="{Binding ProductSN}">
- <DataGridTextColumn.Header>
- <TextBlock Text="ProductSN"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
-
- <DataGridTextColumn IsReadOnly="True" Width="*" Binding="{Binding HW}">
- <DataGridTextColumn.Header>
- <TextBlock Text="HW"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
-
- <DataGridTextColumn IsReadOnly="True" Width="*" Binding="{Binding SW}">
- <DataGridTextColumn.Header>
- <TextBlock Text="SW"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
-
- <DataGridTextColumn IsReadOnly="True" Width="*" Binding="{Binding GeelyDU}">
- <DataGridTextColumn.Header>
- <TextBlock Text="GeelyDU"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
-
- <DataGridTextColumn IsReadOnly="True" Width="*" Binding="{Binding GeelyHWSD}">
- <DataGridTextColumn.Header>
- <TextBlock Text="GeelyHWSD"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
-
- <DataGridTextColumn IsReadOnly="True" Width="*" Binding="{Binding SXBL}">
- <DataGridTextColumn.Header>
- <TextBlock Text="SXBL"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
-
- <DataGridTextColumn IsReadOnly="True" Width="*" Binding="{Binding SXDI_SXBL}">
- <DataGridTextColumn.Header>
- <TextBlock Text="SXDI_SXBL"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
- </DataGrid.Columns>
- </DataGrid>
- </Grid>
- </TabItem>
- <TabItem Header="鏌ヨ鍙风爜"></TabItem>
- </TabControl>
-
-</UserControl>
diff --git a/Plugin.SNGenerateTool/UserControl1.xaml.cs b/Plugin.SNGenerateTool/UserControl1.xaml.cs
deleted file mode 100644
index e523016..0000000
--- a/Plugin.SNGenerateTool/UserControl1.xaml.cs
+++ /dev/null
@@ -1,251 +0,0 @@
-锘縰sing Panuon.WPF.UI;
-using Plugin.SNGenerateTool.Entity;
-using System;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.Data;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-
-namespace Plugin.SNGenerateTool
-{
- /// <summary>
- /// UserControl1.xaml 鐨勪氦浜掗�昏緫
- /// </summary>
- public partial class UserControl1 : UserControl, INotifyPropertyChanged
- {
- #region ...
- public virtual event PropertyChangedEventHandler PropertyChanged;
-
- protected virtual void Set(string name)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
- }
-
- protected void Set<T>(ref T old, T @new, [CallerMemberName] string propertyName = null)
- {
- old = @new;
- if (propertyName != null)
- {
- Set(propertyName);
- }
- }
- #endregion
-
- private string iniFile = Path.Combine(Environment.CurrentDirectory, "Config", "UserSettings.ini");
-
- private string[] years = new string[30]
- {
- "1", "2", "3", "4", "5", "6", "7", "8", "9", "A",
- "B", "C", "D", "E", "F", "G", "H", "J", "K", "L",
- "M", "N", "P", "R", "S", "T", "V", "W", "X", "Y"
- };
-
- private string[] months = new string[12]
- {
- "1", "2", "3", "4", "5", "6", "7", "8", "9", "A",
- "B", "C"
- };
-
- private string[] days = new string[31]
- {
- "1", "2", "3", "4", "5", "6", "7", "8", "9", "A",
- "B", "C", "D", "E", "F", "G", "H", "J", "K", "L",
- "M", "N", "P", "R", "S", "T", "V", "W", "X", "Y",
- "Z"
- };
-
- private string[] F18CY = new string[10] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
-
- private ObservableCollection<DataInfo> datasource = new ObservableCollection<DataInfo>();
- public ObservableCollection<DataInfo> Datasource
- {
- get => datasource;
- set
- {
- Set(ref datasource, value);
- }
- }
-
-
- public UserControl1()
- {
- this.DataContext = this;
- InitializeComponent();
- }
-
- [DllImport("kernel32")]
- private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
-
- [DllImport("kernel32")]
- private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
-
-
- private void SaveSettings(string section, string file)
- {
- if (!File.Exists(file))
- {
- MessageBox.Show("閰嶇疆鏂囦欢涓嶅瓨鍦紝淇濆瓨澶辫触", "閿欒鎻愮ず", MessageBoxButton.OK, MessageBoxImage.Hand);
- return;
- }
- WritePrivateProfileString(section, "OrderId", tbx_OrderID.Text, file);
- WritePrivateProfileString(section, "SNPrefix", txt_SNPrefix.Text, file);
- WritePrivateProfileString(section, "MESStartSN", txt_StartSN.Text, file);
- WritePrivateProfileString(section, "MESEndSN", txt_EndSN.Text, file);
- WritePrivateProfileString(section, "XDSNDate", txt_Date1.Text, file);
- WritePrivateProfileString(section, "XDSNDaySN", txt_StartDaySN.Text, file);
- WritePrivateProfileString(section, "XDSNSpecialSN", txt_MinSpecialSN.Text, file);
- WritePrivateProfileString(section, "PartNo", txt_PN.Text, file);
- WritePrivateProfileString(section, "HW", txt_HW.Text, file);
- WritePrivateProfileString(section, "SW", txt_SW.Text, file);
- WritePrivateProfileString(section, "GeelyDU", txt_GeelyDU.Text, file);
- WritePrivateProfileString(section, "GeelyHWSD", txt_GeelyHWSD.Text, file);
- WritePrivateProfileString(section, "SXBL", txt_SXBL.Text, file);
- WritePrivateProfileString(section, "SXDISXBL", txt_SXDISXBL.Text, file);
- WritePrivateProfileString(section, "VolvoDU", txt_VolvoDU.Text, file);
- WritePrivateProfileString(section, "VolvoHWSD", txt_VolvoHWSD.Text, file);
- }
-
- public void CreateSN()
- {
- Datasource.Clear();
-
- try
- {
- int num = Convert.ToInt32(txt_StartSN.Text);
- int num2 = Convert.ToInt32(txt_EndSN.Text);
- int num3 = Convert.ToInt32(txt_StartDaySN.Text);
- int num4 = Convert.ToInt32(txt_MinSpecialSN.Text);
- int num5 = Convert.ToInt32(txt_StartDHUIDSN.Text);
- int num6 = Convert.ToInt32(txt_Date1.Text.Substring(0, 4)) % 2001;
- int num7 = Convert.ToInt32(txt_Date1.Text.Substring(4, 2)) - 1;
- int num8 = Convert.ToInt32(txt_Date1.Text.Substring(6, 2)) - 1;
- if (Convert.ToInt32(txt_Date1.Text.Substring(0, 4)) < 2020)
- {
- MessageBox.Show("鐢熶骇鏃ユ湡涓殑骞翠唤鏃╀簬褰撳墠骞翠唤锛�", "閿欒鎻愮ず", MessageBoxButton.OK, MessageBoxImage.Hand);
- return;
- }
- int num9 = Convert.ToInt32(txt_Date1.Text.Substring(0, 4)) % 2020;
- GregorianCalendar gregorianCalendar = new GregorianCalendar();
- DateTime time = DateTime.ParseExact(txt_Date1.Text, "yyyyMMdd", CultureInfo.CurrentCulture);
- int weekOfYear = gregorianCalendar.GetWeekOfYear(time, CalendarWeekRule.FirstFullWeek, DayOfWeek.Monday);
- int num10 = 0;
- switch (time.DayOfWeek.ToString())
- {
- case "Monday":
- num10 = 1;
- break;
- case "Tuesday":
- num10 = 2;
- break;
- case "Wednesday":
- num10 = 3;
- break;
- case "Thursday":
- num10 = 4;
- break;
- case "Friday":
- num10 = 5;
- break;
- case "Saturday":
- num10 = 6;
- break;
- case "Sunday":
- num10 = 7;
- break;
- }
- if (txt_StartSN.Text != null && txt_EndSN.Text != null && num <= num2 && txt_EndSN.Text.Length < 5)
- {
- int num11 = num;
- int num12 = num3;
- int num13 = num4;
- int num14 = num5;
- while (num11 <= num2)
- {
- DataInfo di = new DataInfo();
- if (num12.ToString().Length < 5 && num13.ToString().Length < 8 && num14.ToString().Length < 5)
- {
- string text = txt_PCODE.Text.Trim() + years[num6] + num13.ToString().PadLeft(7, '0');
- string text2 = HashPlus.GetHashMD5(text).ToUpper();
- text2 = text2.Substring(0, 8) + "-" + text2.Substring(8, 4) + "-" + text2.Substring(12, 4) + "-" + text2.Substring(16, 4) + "-" + text2.Substring(20, 12);
- string text3 = txt_SNPrefix.Text + num11.ToString().PadLeft(4, '0');
- string text4 = txt_PCODE.Text + txt_MachineCode.Text + txt_FactoryCode.Text + txt_LineNo1.Text + years[num6] + months[num7] + days[num8] + num12.ToString().PadLeft(4, '0') + num13.ToString().PadLeft(7, '0');
- string text5 = txt_VendorCode.Text + txt_PN.Text + years[num6] + months[num7] + days[num8] + txt_ShiftsNo.Text + num14.ToString().PadLeft(4, '0');
- string empty = string.Empty;
- empty = F18CY[num9] + weekOfYear.ToString().PadLeft(2, '0') + num10 + num12.ToString().PadLeft(4, '0');
- if (text3.Length != 14 && text4.Length != 24 && text5.Length != 24)
- {
- MessageBox.Show("MESSN / XDSN / DHUID闀垮害鏈夎锛岃妫�鏌ヨ緭鍏ョ殑鏁版嵁鏄惁鏈夎锛�", "Error", MessageBoxButton.OK, MessageBoxImage.Hand);
- return;
- }
- //dataRow["GUID"] = text2;
- //dataRow["Orderid"] = tbx_OrderID.Text.Trim();
- //dataRow["Model"] = cbox_Model.Text.Trim();
- //dataRow["MESSN"] = text3.Trim();
- //dataRow["XDSN"] = text4.Trim();
- //dataRow["DHUID"] = text5.Trim();
- //dataRow["ProductSN"] = empty.Trim();
- //dataRow["HW"] = txt_HW.Text.PadRight(16, '0').Trim();
- //dataRow["SW"] = txt_SW.Text.Trim();
- //dataRow["SXBL"] = txt_SXBL.Text.Trim();
- //dataRow["SXDI_SXBL"] = txt_SXDISXBL.Text.Trim();
- //dataRow["GeelyDU"] = txt_GeelyDU.Text.Trim();
- //dataRow["GeelyHWSD"] = txt_GeelyHWSD.Text.Trim();
- //dataRow["ECUDAPN"] = txt_VolvoDU.Text.Trim();
- //dataRow["ECUCAPN"] = txt_VolvoHWSD.Text.Trim();
- //dataRow["Status"] = 0;
- //dataRow["CreateTime"] = Convert.ToDateTime(DateTime.Now.ToString("G"));
-
- di.GUID = text2;
- di.OrderID = tbx_OrderID.Text.Trim();
- di.Model = cbox_Model.Text.Trim();
- di.MESSN = text3.Trim();
- di.XDSN = text4.Trim();
- di.DHUID = text5.Trim();
- di.ProductSN = empty.Trim();
- di.HW = txt_HW.Text.PadRight(16, '0').Trim();
- di.SW = txt_SW.Text.Trim();
- di.SXBL = txt_SXBL.Text.Trim();
- di.SXDI_SXBL = txt_SXDISXBL.Text.Trim();
- di.GeelyDU = txt_GeelyDU.Text.Trim();
- di.GeelyHWSD = txt_GeelyHWSD.Text.Trim();
- di.ECUDAPN = txt_VolvoDU.Text.Trim();
- di.ECUCAPN = txt_VolvoHWSD.Text.Trim();
- di.Status = 0;
- di.CreateTime = Convert.ToDateTime(DateTime.Now.ToString("G"));
- Datasource.Add(di);
- num11++;
- num12++;
- num13++;
- num14++;
- continue;
- }
- MessageBox.Show("鏃ユ祦姘村彿鎴栬繛缁彿浣嶆暟瓒呭嚭鑼冨洿", "閿欒鎻愮ず", MessageBoxButton.OK, MessageBoxImage.Hand);
- break;
- }
- //toolStripStatusLabel8.Text = $"{table.Rows.Count}琛�";
- }
- else
- {
- MessageBox.Show("璇锋鏌ユ墍鏈夋枃鏈鏄惁鏈夊~鍐欙紝骞剁‘璁N鐨勬祦姘村彿鍙婁綅鏁版槸鍚︽湁璇�", "閿欒鎻愮ず", MessageBoxButton.OK, MessageBoxImage.Hand);
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message, "閿欒鎻愮ず", MessageBoxButton.OK, MessageBoxImage.Hand);
- }
- }
-
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- SaveSettings(cbox_Model.Text, iniFile);
- CreateSN();
- }
- }
-}
diff --git a/Plugin.SNGenerateTool/app.config b/Plugin.SNGenerateTool/app.config
deleted file mode 100644
index 1696df6..0000000
--- a/Plugin.SNGenerateTool/app.config
+++ /dev/null
@@ -1,11 +0,0 @@
-锘�<?xml version="1.0" encoding="utf-8"?>
-<configuration>
- <runtime>
- <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
- </dependentAssembly>
- </assemblyBinding>
- </runtime>
-</configuration>
\ No newline at end of file
diff --git a/Plugin.SNGenerateTool/packages.config b/Plugin.SNGenerateTool/packages.config
deleted file mode 100644
index e6f2be1..0000000
--- a/Plugin.SNGenerateTool/packages.config
+++ /dev/null
@@ -1,18 +0,0 @@
-锘�<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="Microsoft.Extensions.Configuration" version="9.0.3" targetFramework="net472" />
- <package id="Microsoft.Extensions.Configuration.Abstractions" version="9.0.3" targetFramework="net472" />
- <package id="Microsoft.Extensions.Configuration.FileExtensions" version="9.0.3" targetFramework="net472" />
- <package id="Microsoft.Extensions.Configuration.Ini" version="9.0.3" targetFramework="net472" />
- <package id="Microsoft.Extensions.FileProviders.Abstractions" version="9.0.3" targetFramework="net472" />
- <package id="Microsoft.Extensions.FileProviders.Physical" version="9.0.3" targetFramework="net472" />
- <package id="Microsoft.Extensions.FileSystemGlobbing" version="9.0.3" targetFramework="net472" />
- <package id="Microsoft.Extensions.Primitives" version="9.0.3" targetFramework="net472" />
- <package id="Panuon.WPF" version="1.1.3" targetFramework="net472" />
- <package id="Panuon.WPF.UI" version="1.3.0.2" targetFramework="net472" />
- <package id="System.Buffers" version="4.5.1" targetFramework="net472" />
- <package id="System.Memory" version="4.5.5" targetFramework="net472" />
- <package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
- <package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" />
- <package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
-</packages>
\ No newline at end of file
diff --git a/Plugin.ServoManage/Entity/ServoData.cs b/Plugin.ServoManage/Entity/ServoData.cs
deleted file mode 100644
index a9b4834..0000000
--- a/Plugin.ServoManage/Entity/ServoData.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-锘縰sing HMI.Core.Entity;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Plugin.ServoManage.Entity
-{
- public class ServoData :SelectBase
- {
- public string Name { get; set; }
- public string Unit { get; set; }
- }
-}
diff --git a/Plugin.ServoManage/Entity/ServoProductData.cs b/Plugin.ServoManage/Entity/ServoProductData.cs
deleted file mode 100644
index 2505f3e..0000000
--- a/Plugin.ServoManage/Entity/ServoProductData.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Plugin.ServoManage.Entity
-{
- public class ServoProductData
- {
- public string Model { get; set; }
- public string ProgramCode { get; set; }
- }
-}
diff --git a/Plugin.ServoManage/Plugin.ServoManage.csproj b/Plugin.ServoManage/Plugin.ServoManage.csproj
deleted file mode 100644
index 0f6e25d..0000000
--- a/Plugin.ServoManage/Plugin.ServoManage.csproj
+++ /dev/null
@@ -1,166 +0,0 @@
-<?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>{1853E00F-6865-4BC6-974B-6A5E1C00BAFE}</ProjectGuid>
- <OutputType>library</OutputType>
- <RootNamespace>Plugin.ServoManage</RootNamespace>
- <AssemblyName>Plugin.ServoManage</AssemblyName>
- <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <WarningLevel>4</WarningLevel>
- <Deterministic>true</Deterministic>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\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>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
- <DebugSymbols>true</DebugSymbols>
- <OutputPath>bin\x64\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <DebugType>full</DebugType>
- <PlatformTarget>x64</PlatformTarget>
- <LangVersion>7.3</LangVersion>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
- <OutputPath>bin\x64\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <Optimize>true</Optimize>
- <DebugType>pdbonly</DebugType>
- <PlatformTarget>x64</PlatformTarget>
- <LangVersion>7.3</LangVersion>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="log4net, Version=3.0.4.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\log4net.3.0.4\lib\net462\log4net.dll</HintPath>
- </Reference>
- <Reference Include="Panuon.WPF, Version=1.1.2.2, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\Panuon.WPF.1.1.3\lib\net472\Panuon.WPF.dll</HintPath>
- </Reference>
- <Reference Include="Panuon.WPF.UI, Version=1.3.0.2, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\Panuon.WPF.UI.1.3.0.2\lib\net472\Panuon.WPF.UI.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Configuration" />
- <Reference Include="System.Data" />
- <Reference Include="System.Web" />
- <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="Entity\ServoData.cs" />
- <Compile Include="Entity\ServoProductData.cs" />
- <Compile Include="ServoProductModal.xaml.cs">
- <DependentUpon>ServoProductModal.xaml</DependentUpon>
- </Compile>
- <Compile Include="ServoModal.xaml.cs">
- <DependentUpon>ServoModal.xaml</DependentUpon>
- </Compile>
- <Compile Include="ServoSetting.xaml.cs">
- <DependentUpon>ServoSetting.xaml</DependentUpon>
- </Compile>
- <Page Include="ServoManage.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Compile Include="ServoManage.xaml.cs">
- <DependentUpon>ServoManage.xaml</DependentUpon>
- <SubType>Code</SubType>
- </Compile>
- <Page Include="ServoProductModal.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="ServoModal.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="ServoSetting.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- </ItemGroup>
- <ItemGroup>
- <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>
- <EmbeddedResource Include="Properties\Resources.resx">
- <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>
- <ProjectReference Include="..\..\ConnectionUtil\ConnectionUtil\ConnectionUtil.csproj">
- <Project>{D0806FA6-3F6D-4304-81B8-EAD9DA7CB5B2}</Project>
- <Name>ConnectionUtil</Name>
- </ProjectReference>
- <ProjectReference Include="..\HMI.Base\HMI.Base.csproj">
- <Project>{2a6f9720-a890-4036-9d73-41a0dae28341}</Project>
- <Name>HMI.Base</Name>
- </ProjectReference>
- <ProjectReference Include="..\HMI.Core\HMI.Core.csproj">
- <Project>{3e3bf44a-0b69-45c5-9512-528cb48a7106}</Project>
- <Name>HMI.Core</Name>
- </ProjectReference>
- <ProjectReference Include="..\HMI.ParameterManage\HMI.ParameterManage.csproj">
- <Project>{736cd77d-b81e-4866-bb00-84b0b57110f0}</Project>
- <Name>HMI.ParameterManage</Name>
- </ProjectReference>
- <ProjectReference Include="..\HMI.UI\HMI.UI.csproj">
- <Project>{f17de6b5-af1d-48c6-94a0-6b763a6546a6}</Project>
- <Name>HMI.UI</Name>
- </ProjectReference>
- <ProjectReference Include="..\OPCClient\OPCClient.csproj">
- <Project>{e5740bb5-9fc6-4a20-b7c2-cc90c281ed05}</Project>
- <Name>OPCClient</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <WCFMetadata Include="Connected Services\" />
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-</Project>
\ No newline at end of file
diff --git a/Plugin.ServoManage/Properties/AssemblyInfo.cs b/Plugin.ServoManage/Properties/AssemblyInfo.cs
deleted file mode 100644
index f17020b..0000000
--- a/Plugin.ServoManage/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-锘縰sing System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Windows;
-
-// 鏈夊叧绋嬪簭闆嗙殑涓�鑸俊鎭敱浠ヤ笅
-// 鎺у埗銆傛洿鏀硅繖浜涚壒鎬у�煎彲淇敼
-// 涓庣▼搴忛泦鍏宠仈鐨勪俊鎭��
-[assembly: AssemblyTitle("Plugin.ServoManage")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Plugin.ServoManage")]
-[assembly: AssemblyCopyright("Copyright 漏 2025")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// 灏� ComVisible 璁剧疆涓� false 浼氫娇姝ょ▼搴忛泦涓殑绫诲瀷
-//瀵� COM 缁勪欢涓嶅彲瑙併�傚鏋滈渶瑕佷粠 COM 璁块棶姝ょ▼搴忛泦涓殑绫诲瀷
-//璇峰皢姝ょ被鍨嬬殑 ComVisible 鐗规�ц缃负 true銆�
-[assembly: ComVisible(false)]
-
-//鑻ヨ寮�濮嬬敓鎴愬彲鏈湴鍖栫殑搴旂敤绋嬪簭锛岃璁剧疆
-//.csproj 鏂囦欢涓殑 <UICulture>CultureYouAreCodingWith</UICulture>
-//鍦� <PropertyGroup> 涓�備緥濡傦紝濡傛灉浣犱娇鐢ㄧ殑鏄編鍥借嫳璇��
-//浣跨敤鐨勬槸缇庡浗鑻辫锛岃灏� <UICulture> 璁剧疆涓� en-US銆� 鐒跺悗鍙栨秷
-//瀵逛互涓� NeutralResourceLanguage 鐗规�х殑娉ㄩ噴銆� 鏇存柊
-//浠ヤ笅琛屼腑鐨勨�渆n-US鈥濅互鍖归厤椤圭洰鏂囦欢涓殑 UICulture 璁剧疆銆�
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
-[assembly:ThemeInfo(
- ResourceDictionaryLocation.None, //涓婚鐗瑰畾璧勬簮璇嶅吀鎵�澶勪綅缃�
- //(鏈湪椤甸潰涓壘鍒拌祫婧愭椂浣跨敤锛�
- //鎴栧簲鐢ㄧ▼搴忚祫婧愬瓧鍏镐腑鎵惧埌鏃朵娇鐢�)
- ResourceDictionaryLocation.SourceAssembly //甯歌璧勬簮璇嶅吀鎵�澶勪綅缃�
- //(鏈湪椤甸潰涓壘鍒拌祫婧愭椂浣跨敤锛�
- //銆佸簲鐢ㄧ▼搴忔垨浠讳綍涓婚涓撶敤璧勬簮瀛楀吀涓壘鍒版椂浣跨敤)
-)]
-
-
-// 绋嬪簭闆嗙殑鐗堟湰淇℃伅鐢变笅鍒楀洓涓�肩粍鎴�:
-//
-// 涓荤増鏈�
-// 娆$増鏈�
-// 鐢熸垚鍙�
-// 淇鍙�
-//
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Plugin.ServoManage/Properties/Resources.Designer.cs b/Plugin.ServoManage/Properties/Resources.Designer.cs
deleted file mode 100644
index 5ddb6f8..0000000
--- a/Plugin.ServoManage/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-锘�//------------------------------------------------------------------------------
-// <auto-generated>
-// 姝や唬鐮佺敱宸ュ叿鐢熸垚銆�
-// 杩愯鏃剁増鏈�: 4.0.30319.42000
-//
-// 瀵规鏂囦欢鐨勬洿鏀瑰彲鑳藉鑷翠笉姝g‘鐨勮涓猴紝濡傛灉
-// 閲嶆柊鐢熸垚浠g爜锛屽垯鎵�鍋氭洿鏀瑰皢涓㈠け銆�
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace Plugin.ServoManage.Properties {
-
-
- /// <summary>
- /// 寮虹被鍨嬭祫婧愮被锛岀敤浜庢煡鎵炬湰鍦板寲瀛楃涓茬瓑銆�
- /// </summary>
- // 姝ょ被鏄敱 StronglyTypedResourceBuilder
- // 绫婚�氳繃绫讳技浜� ResGen 鎴� Visual Studio 鐨勫伐鍏疯嚜鍔ㄧ敓鎴愮殑銆�
- // 鑻ヨ娣诲姞鎴栫Щ闄ゆ垚鍛橈紝璇风紪杈� .ResX 鏂囦欢锛岀劧鍚庨噸鏂拌繍琛� ResGen
- // (浠� /str 浣滀负鍛戒护閫夐」)锛屾垨閲嶆柊鐢熸垚 VS 椤圭洰銆�
- [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>
- /// 杩斿洖姝ょ被浣跨敤鐨勭紦瀛� ResourceManager 瀹炰緥銆�
- /// </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("Plugin.ServoManage.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// 閲嶅啓褰撳墠绾跨▼鐨� CurrentUICulture 灞炴�э紝瀵�
- /// 浣跨敤姝ゅ己绫诲瀷璧勬簮绫荤殑鎵�鏈夎祫婧愭煡鎵炬墽琛岄噸鍐欍��
- /// </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/Plugin.ServoManage/Properties/Resources.resx b/Plugin.ServoManage/Properties/Resources.resx
deleted file mode 100644
index af7dbeb..0000000
--- a/Plugin.ServoManage/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-锘�<?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/Plugin.ServoManage/Properties/Settings.Designer.cs b/Plugin.ServoManage/Properties/Settings.Designer.cs
deleted file mode 100644
index 8064725..0000000
--- a/Plugin.ServoManage/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-锘�//------------------------------------------------------------------------------
-// <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 Plugin.ServoManage.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/Plugin.ServoManage/Properties/Settings.settings b/Plugin.ServoManage/Properties/Settings.settings
deleted file mode 100644
index 033d7a5..0000000
--- a/Plugin.ServoManage/Properties/Settings.settings
+++ /dev/null
@@ -1,7 +0,0 @@
-锘�<?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/Plugin.ServoManage/ServoManage.xaml b/Plugin.ServoManage/ServoManage.xaml
deleted file mode 100644
index 6fac78e..0000000
--- a/Plugin.ServoManage/ServoManage.xaml
+++ /dev/null
@@ -1,526 +0,0 @@
-锘�<hb:PluginControl x:Class="Plugin.ServoManage.ServoManage"
- 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:Plugin.ServoManage"
- mc:Ignorable="d"
- xmlns:hb="clr-namespace:HMI.Base;assembly=HMI.Base"
- xmlns:uic="clr-namespace:HMI.UI.Converter;assembly=HMI.UI"
- xmlns:pw="https://opensource.panuon.com/wpf"
- xmlns:pu="https://opensource.panuon.com/wpf-ui"
- xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
- xmlns:cc="clr-namespace:HMI.Core;assembly=HMI.Core"
- Loaded="UserControl_Loaded"
- d:DesignHeight="450" d:DesignWidth="800">
- <UserControl.Resources>
- <Style x:Key="PrimaryButton" TargetType="Button" BasedOn="{StaticResource PrimaryButton}">
- <Setter Property="Padding" Value="15"/>
- </Style>
-
- <Style x:Key="LightBall" TargetType="Ellipse">
- <Setter Property="Height" Value="35"/>
- <Setter Property="Width" Value="35"/>
- <Setter Property="Fill" Value="{StaticResource Normal}"/>
- <Setter Property="Margin" Value="0,10,0,0"/>
- <Style.Triggers>
- <DataTrigger Binding="{Binding }" Value="1">
- <Setter Property="Fill" Value="{StaticResource Ok}"/>
- </DataTrigger>
- </Style.Triggers>
- </Style>
-
- <Style x:Key="Desc" TargetType="Label">
- <Setter Property="Padding" Value="10,15"/>
- <Setter Property="MinWidth" Value="90"/>
- <Setter Property="FontSize" Value="14"/>
- <Setter Property="BorderThickness" Value="1"/>
- <Setter Property="BorderBrush" Value="#3a3a3a"/>
- <Setter Property="HorizontalContentAlignment" Value="Center"/>
- <Setter Property="VerticalContentAlignment" Value="Center"/>
- </Style>
-
- <Style x:Key="ReadLabel" TargetType="Label" BasedOn="{StaticResource Desc}">
- <Setter Property="BorderThickness" Value="1,0,1,1"/>
- <Setter Property="Background" Value="LightGray"/>
- </Style>
-
- <Style x:Key="LabelText" TargetType="Label" BasedOn="{StaticResource Desc}">
- <Setter Property="BorderThickness" Value="1,0,1,1"/>
- <Setter Property="Cursor" Value="Hand"/>
- </Style>
-
- <Style x:Key="BDesc" TargetType="Label" BasedOn="{StaticResource Desc}">
- <Setter Property="Background" Value="#afeeee"/>
- </Style>
-
- <Style x:Key="YDesc" TargetType="Label" BasedOn="{StaticResource Desc}">
- <Setter Property="Background" Value="#ffff00"/>
- </Style>
-
- <Style TargetType="GroupBox">
- <Setter Property="Padding" Value="5"/>
- </Style>
- </UserControl.Resources>
-
- <Border Style="{StaticResource CardBoarder}">
- <Grid dp:GridHelper.Space="10">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="7*"/>
- <ColumnDefinition Width="3*"/>
- </Grid.ColumnDefinitions>
-
- <DockPanel Grid.ColumnSpan="2">
- <StackPanel DockPanel.Dock="Right" Style="{StaticResource ButtonGroup}">
- <Button Style="{StaticResource AddBtn}" x:Name="addServoBtn" Click="Button_Click"/>
- <Button Style="{StaticResource RfhBtn}" x:Name="rfhServoBtn" Click="Button_Click"/>
- </StackPanel>
- <TextBlock Style="{StaticResource TitleBox}" Text="{DynamicResource svo.title}"/>
- </DockPanel>
-
- <DockPanel Grid.Row="2" Grid.ColumnSpan="2" Margin="0,10,0,0">
- <pu:Drawer DockPanel.Dock="Left" x:Name="DrwMenu" MinWidth="35" MaxWidth="400"
- Padding="0"
- ShadowColor="{x:Null}"
- AnimationDuration="0" BorderThickness="2,0,0,2" BorderBrush="{StaticResource CommonBoarder}">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition/>
- <ColumnDefinition Width="Auto"/>
- </Grid.ColumnDefinitions>
-
- <Border Grid.ColumnSpan="2" BorderThickness="2" BorderBrush="{StaticResource CommonBoarder}" Background="{StaticResource VerBar}">
- <DockPanel Height="35">
- <ToggleButton x:Name="drawerBtn" BorderThickness="0"
- DockPanel.Dock="Right"
- Background="Transparent"
- Width="35" Height="35" HorizontalAlignment="Right"
- RenderTransformOrigin="0.5,0.5"
- Foreground="{StaticResource PrimaryColorContract}"
- FontFamily="{StaticResource iconfont}"
- Content="" IsChecked="{Binding IsOpen, ElementName=DrwMenu, Mode=TwoWay}">
- <ToggleButton.Style>
- <Style TargetType="ToggleButton" BasedOn="{StaticResource CommonToggle}">
- <Style.Triggers>
- <DataTrigger Binding="{Binding IsOpen, ElementName=DrwMenu}" Value="False">
- <Setter Property="RenderTransform">
- <Setter.Value>
- <RotateTransform Angle="-90"/>
- </Setter.Value>
- </Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding IsOpen, ElementName=DrwMenu}" Value="True">
- <Setter Property="Background" Value="Red"/>
- <Setter Property="RenderTransform">
- <Setter.Value>
- <RotateTransform Angle="90"/>
- </Setter.Value>
- </Setter>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </ToggleButton.Style>
- </ToggleButton>
-
- <TextBlock Text="{DynamicResource svo.list}" FontSize="16"
- Foreground="{StaticResource PrimaryColorContract}"
- VerticalAlignment="Center" HorizontalAlignment="Center"/>
- </DockPanel>
- </Border>
-
-
- <Grid Grid.Row="1">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
-
- <DataGrid Grid.Row="1" Grid.ColumnSpan="2" Style="{StaticResource DefaultDataGrid}"
- IsReadOnly="False"
- SelectionMode="Single"
- BorderThickness="0"
- SelectedItem="{Binding SelectedServo}"
- ItemsSource="{Binding Servos}">
- <DataGrid.Columns>
- <DataGridTemplateColumn Header="#" IsReadOnly="True" CanUserResize="False">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Converter={StaticResource rowNumber},
-RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow},AncestorLevel=1}}"/>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
-
- <DataGridTextColumn IsReadOnly="True" Width="*" Binding="{Binding Name}">
- <DataGridTextColumn.Header>
- <TextBlock Text="{DynamicResource svo.name}"/>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
-
- <DataGridTemplateColumn Width="100" IsReadOnly="True" CanUserResize="False">
- <DataGridTemplateColumn.Header>
- <TextBlock Text="{DynamicResource App.Opt}"/>
- </DataGridTemplateColumn.Header>
-
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal" dp:StackPanelHelper.ChildSpace="10">
- <Button x:Name="editServoBtn" Style="{StaticResource EditLink}" DataContext="{Binding }"
-Click="Button_Click"/>
- <Button x:Name="delServoBtn" Style="{StaticResource DeleteLink}"
-DataContext="{Binding }"
-Click="Button_Click"/>
- </StackPanel>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- </DataGrid.Columns>
- </DataGrid>
- </Grid>
-
- <Label Grid.Row="1" Grid.Column="1" Width="100" Height="34"
- VerticalContentAlignment="Center"
- HorizontalContentAlignment="Center"
- Content="{DynamicResource svo.list}"
- FontSize="16">
- <Label.LayoutTransform>
- <RotateTransform CenterX="25" CenterY="25" Angle="270"/>
- </Label.LayoutTransform>
-
- <Label.Style>
- <Style TargetType="Label">
- <Style.Triggers>
- <DataTrigger Binding="{Binding IsOpen, ElementName=DrwMenu,Mode=OneWay}" Value="True">
- <Setter Property="Visibility" Value="Collapsed"/>
- </DataTrigger>
- <DataTrigger Binding="{Binding IsOpen, ElementName=DrwMenu}" Value="False">
- <Setter Property="Visibility" Value="Visible"/>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Label.Style>
- </Label>
- </Grid>
- </pu:Drawer>
-
- <Border BorderThickness="2" BorderBrush="{StaticResource CommonBoarder}">
- <Grid dp:GridHelper.Space="10">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
-
- <DockPanel>
- <StackPanel Style="{StaticResource ButtonGroup}" HorizontalAlignment="Left">
- <!--<TextBlock Style="{StaticResource TitleBox}"
- FontSize="{StaticResource ContentFontSize2}"
- Text="{DynamicResource svo.product.model}"/>
- <ComboBox x:Name="productInput"
- IsEnabled="{Binding HasSelectedServo}"
- SelectedItem="{Binding SelectedProduct}"
- ItemsSource="{Binding ServoProducts}"
- DisplayMemberPath="Model"
- Style="{StaticResource FormComboxStyle}" MinWidth="180" />
-
- <Button Style="{StaticResource AddBtn}" x:Name="addProductBtn" Click="Button_Click"/>
- <Button Style="{StaticResource EditBtn}" x:Name="editProductBtn" Click="Button_Click"/>
- <Button Style="{StaticResource RfhBtn}" x:Name="rfhProductBtn" Click="Button_Click"/>
- <Button Style="{StaticResource DelBtn}" x:Name="delProductBtn" Click="Button_Click"/>-->
- </StackPanel>
- </DockPanel>
-
- <Grid Grid.Row="1" dp:GridHelper.Space="10" x:Name="panel">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition Width="Auto"/>
- </Grid.ColumnDefinitions>
-
- <GroupBox Header="{DynamicResource App.Opt}" Padding="10">
- <Grid dp:GridHelper.Space="10">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- </Grid.RowDefinitions>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
- <Label
- Style="{StaticResource BDesc}" MinWidth="80" Padding="0"
- Content="{DynamicResource svo.product.model}"/>
- <ComboBox Grid.Column="1" x:Name="productInput"
-IsEnabled="{Binding HasSelectedServo}"
-SelectedValue="{Binding SelectedProduct}"
-ItemsSource="{Binding ServoProducts}"
-SelectedValuePath="ProgramCode"
-DisplayMemberPath="Model"
- BorderThickness="0,1,1,1"
- FontSize="14"
- BorderBrush="Black"
-Style="{StaticResource FormComboxStyle}" MinWidth="180" />
- </Grid>
-
- <Button Grid.Row="1" Style="{StaticResource PrimaryButton}"
- Content="{DynamicResource svo.debugMode}"/>
- <UniformGrid Grid.Row="2" Columns="2">
- <Button Margin="0,0,5,0" Tag="Enable" Click="Servo_Click">
- <Button.Style>
- <Style TargetType="Button" BasedOn="{StaticResource PrimaryButton}">
- <Setter Property="Content" Value="{DynamicResource svo.enable}"/>
- <Style.Triggers>
- <DataTrigger Binding="{Binding Enable}" Value="1">
- <Setter Property="Content" Value="{DynamicResource svo.disable}"/>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Button.Style>
- </Button>
- <Button Style="{StaticResource PrimaryButton}"
- Margin="5,0,0,0" Content="{DynamicResource svo.reset}" Tag="Reset"
- PreviewMouseLeftButtonDown="Button_PreviewMouseLeftButtonDown"
- PreviewMouseLeftButtonUp="Button_PreviewMouseLeftButtonUp" />
- </UniformGrid>
- <Button Grid.Row="3" Style="{StaticResource PrimaryButton}"
- Content="{DynamicResource svo.init}"
- Tag="Initialization"
- PreviewMouseLeftButtonDown="Button_PreviewMouseLeftButtonDown"
- PreviewMouseLeftButtonUp="Button_PreviewMouseLeftButtonUp"/>
- <Button Grid.Row="4" Style="{StaticResource PrimaryButton}"
- Content="{DynamicResource svo.stop}"
- Tag="Stop"
- PreviewMouseLeftButtonDown="Button_PreviewMouseLeftButtonDown"
- PreviewMouseLeftButtonUp="Button_PreviewMouseLeftButtonUp"/>
- <UniformGrid Grid.Row="5" Columns="3">
- <Button Style="{StaticResource PrimaryButton}"
- Content="{DynamicResource svo.JOG+}"
- Tag="JoGadd"
- PreviewMouseLeftButtonDown="Button_PreviewMouseLeftButtonDown"
- PreviewMouseLeftButtonUp="Button_PreviewMouseLeftButtonUp"/>
- <Label Style="{StaticResource LabelText}" MinWidth="90"
-Margin="10,0,10,0"
-BorderThickness="1" MouseLeftButtonUp="Label_MouseLeftButtonUp" Tag="JogVelocity" Content="{Binding JogVelocity}"/>
- <Button Style="{StaticResource PrimaryButton}"
- Content="{DynamicResource svo.JOG-}"
- Tag="JOGsub"
- PreviewMouseLeftButtonDown="Button_PreviewMouseLeftButtonDown"
- PreviewMouseLeftButtonUp="Button_PreviewMouseLeftButtonUp"/>
- </UniformGrid>
- </Grid>
- </GroupBox>
- <StackPanel Grid.Column="1">
- <GroupBox Header="{DynamicResource svo.position}">
- <Grid dp:GridHelper.Space="10">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition/>
- <ColumnDefinition/>
- <ColumnDefinition/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
-
- <StackPanel>
- <Label Style="{StaticResource BDesc}"
- Content="{DynamicResource svo.currentPosition}"/>
- <Label Style="{StaticResource ReadLabel}" Content="{Binding CurrentPosition}"/>
- </StackPanel>
-
- <StackPanel Grid.Column="1">
- <Label Style="{StaticResource BDesc}"
- Content="{DynamicResource svo.currentSpeed}"/>
- <Label Style="{StaticResource ReadLabel}" Content="{Binding CurrentSpeed}"/>
- </StackPanel>
- <StackPanel Grid.Column="2">
- <Label Style="{StaticResource BDesc}"
- Content="{DynamicResource svo.OverAcc}"/>
- <Label Style="{StaticResource LabelText}"
- MouseLeftButtonUp="Label_MouseLeftButtonUp"
- Tag="OverAcc"
- Content="{Binding OverAcc}"/>
- </StackPanel>
- <StackPanel Grid.Column="3">
- <Label Style="{StaticResource BDesc}"
- Content="{DynamicResource svo.OverDec}"/>
- <Label Style="{StaticResource LabelText}"
- MouseLeftButtonUp="Label_MouseLeftButtonUp"
- Tag="OverDec"
- Content="{Binding OverDec}"/>
- </StackPanel>
-
- <StackPanel Grid.Row="1">
- <Label Style="{StaticResource BDesc}"
- Content="{DynamicResource svo.HMIPosition}"/>
- <Label Style="{StaticResource LabelText}"
- MouseLeftButtonUp="Label_MouseLeftButtonUp"
- Tag="HMIPosition" Content="{Binding HMIPosition}"/>
- </StackPanel>
-
- <StackPanel Grid.Row="1" Grid.Column="1">
- <Label Style="{StaticResource BDesc}"
- Content="{DynamicResource svo.HMISpeed}"/>
- <Label Style="{StaticResource LabelText}"
- MouseLeftButtonUp="Label_MouseLeftButtonUp"
- Tag="HMISpeed"
- Content="{Binding HMISpeed}"/>
- </StackPanel>
- <Button Grid.Row="1" Grid.Column="2"
- Grid.ColumnSpan="2"
- Style="{StaticResource PrimaryButton}"
- Tag="AbsExecute"
- PreviewMouseLeftButtonDown="Button_PreviewMouseLeftButtonDown"
- PreviewMouseLeftButtonUp="Button_PreviewMouseLeftButtonUp"
- Content="{DynamicResource svo.absExecute}"/>
- </Grid>
- </GroupBox>
-
- <GroupBox Header="{DynamicResource svo.inching}">
- <DockPanel>
- <Button DockPanel.Dock="Left"
- Margin="0,0,10,0"
- Style="{StaticResource PrimaryButton}"
- Tag="Inch"
- PreviewMouseLeftButtonDown="Button_PreviewMouseLeftButtonDown"
- PreviewMouseLeftButtonUp="Button_PreviewMouseLeftButtonUp"
- Content="{DynamicResource svo.inching}"/>
- <Button DockPanel.Dock="Right"
- Tag="Dir" Click="Servo_Click">
- <Button.Style>
- <Style TargetType="Button" BasedOn="{StaticResource PrimaryButton}">
- <Setter Property="Content" Value="{DynamicResource svo.forward}"/>
- <Style.Triggers>
- <DataTrigger Binding="{Binding Dir}" Value="1">
- <Setter Property="Content" Value="{DynamicResource svo.backward}"/>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Button.Style>
- </Button>
- <Label
- Margin="0,0,10,0"
- Style="{StaticResource LabelText}"
- MouseLeftButtonUp="Label_MouseLeftButtonUp"
- Tag="InchDistance"
- BorderThickness="1" Content="{Binding InchDistance}"/>
- </DockPanel>
- </GroupBox>
- </StackPanel>
-
- <StackPanel Grid.Column="2" HorizontalAlignment="Center">
- <GroupBox Header="{DynamicResource svo.alarm}">
- <StackPanel Style="{StaticResource ButtonGroup}">
- <StackPanel>
- <Label Style="{StaticResource YDesc}"
- Content="{DynamicResource svo.controlAlarm}"/>
- <Label Style="{StaticResource ReadLabel}" Content="{Binding AlarmCode}"/>
- </StackPanel>
- <StackPanel>
- <Label Style="{StaticResource YDesc}"
- Content="{DynamicResource svo.driverAlarm}"/>
- <Label Style="{StaticResource ReadLabel}" Content="{Binding WarnCode}"/>
- </StackPanel>
- <StackPanel>
- <Label Style="{StaticResource YDesc}"
- Content="{DynamicResource svo.faultDriven}"/>
- <Label Style="{StaticResource ReadLabel}" Content="{Binding FaultCode}"/>
- </StackPanel>
- </StackPanel>
- </GroupBox>
-
- <GroupBox Header="{DynamicResource svo.limitSensor}">
- <StackPanel Style="{StaticResource ButtonGroup}">
- <StackPanel>
- <Label Style="{StaticResource YDesc}"
- Content="{DynamicResource svo.limit+}"/>
- <Ellipse Style="{StaticResource LightBall}" DataContext="{Binding PositiveLimit}" />
- </StackPanel>
-
- <StackPanel>
- <Label Style="{StaticResource YDesc}"
- Content="{DynamicResource svo.limit0}"/>
- <Ellipse Style="{StaticResource LightBall}" DataContext="{Binding HomeSwitch}" />
- </StackPanel>
- <StackPanel>
- <Label Style="{StaticResource YDesc}"
- Content="{DynamicResource svo.limit-}"/>
- <Ellipse Style="{StaticResource LightBall}" DataContext="{Binding NegativeLimit}" />
- </StackPanel>
- </StackPanel>
- </GroupBox>
- </StackPanel>
-
- <StackPanel Grid.Row="1" Grid.ColumnSpan="2">
- <GroupBox Header="{DynamicResource svo.status}">
- <StackPanel Style="{StaticResource ButtonGroup}" HorizontalAlignment="Center">
- <StackPanel>
- <Label Style="{StaticResource YDesc}"
- Content="{DynamicResource svo.enable}"/>
- <Ellipse Style="{StaticResource LightBall}" DataContext="{Binding AxisEnabled}"/>
- </StackPanel>
-
- <StackPanel>
- <Label Style="{StaticResource YDesc}"
- Content="{DynamicResource svo.isReady}"/>
- <Ellipse Style="{StaticResource LightBall}" DataContext="{Binding ReadyOK}" />
- </StackPanel>
- <StackPanel>
- <Label Style="{StaticResource YDesc}"
- Content="{DynamicResource svo.isRunning}"/>
- <Ellipse Style="{StaticResource LightBall}" DataContext="{Binding Running}" />
- </StackPanel>
- <StackPanel>
- <Label Style="{StaticResource YDesc}"
- Content="{DynamicResource svo.reOriginOk}"/>
- <Ellipse Style="{StaticResource LightBall}" DataContext="{Binding Homed}" />
- </StackPanel>
- <StackPanel>
- <Label Style="{StaticResource YDesc}"
- Content="{DynamicResource svo.fault}"/>
- <Ellipse Style="{StaticResource LightBall}" DataContext="{Binding AxisError}" />
- </StackPanel>
- <StackPanel>
- <Label Style="{StaticResource YDesc}"
- Content="{DynamicResource svo.axisAlarm}"/>
- <Ellipse Style="{StaticResource LightBall}" DataContext="{Binding AxisWarn}" />
- </StackPanel>
- <StackPanel>
- <Label Style="{StaticResource YDesc}"
- Content="{DynamicResource svo.code}"/>
- <Label Style="{StaticResource ReadLabel}" Content="{Binding PosCode}"/>
- </StackPanel>
- </StackPanel>
- </GroupBox>
- </StackPanel>
- </Grid>
- </Grid>
- </Border>
- </DockPanel>
- </Grid>
- </Border>
-</hb:PluginControl>
diff --git a/Plugin.ServoManage/ServoManage.xaml.cs b/Plugin.ServoManage/ServoManage.xaml.cs
deleted file mode 100644
index 10e593d..0000000
--- a/Plugin.ServoManage/ServoManage.xaml.cs
+++ /dev/null
@@ -1,768 +0,0 @@
-锘縰sing ConnectionUtil;
-using HMI.Base;
-using HMI.Core.Entity;
-using HMI.Core.Manager;
-using HMI.Core.Setting;
-using HMI.Core.Util;
-using HMI.UI;
-using HMI.UI.Util;
-using OPCConnection;
-using Plugin.ServoManage.Entity;
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Threading;
-using System.Timers;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Threading;
-
-namespace Plugin.ServoManage
-{
- [AttributeUsage(AttributeTargets.Property)]
- public class IsStatusAttribute : Attribute
- {
- }
-
- /// <summary>
- /// UserControl1.xaml 鐨勪氦浜掗�昏緫
- /// </summary>
- public partial class ServoManage : PluginControl
- {
- public static string FilePath { get; private set; }
- public static string ProductFilePath { get; private set; }
-
- private ObservableCollection<ServoData> servos;
- public ObservableCollection<ServoData> Servos
- {
- get => servos;
- set
- {
- Set(ref servos, value);
- }
- }
-
- private ServoData selectedServo;
- public ServoData SelectedServo
- {
- get => selectedServo;
- set
- {
- Set(ref selectedServo, value);
- Set("HasSelectedServo");
- RefreshServoStatus();
- }
- }
-
- public bool HasSelectedServo
- {
- get => SelectedServo != null;
- }
-
- private string selectedProduct;
- [IsStatus]
- public string SelectedProduct
- {
- get => selectedProduct;
- set
- {
- if (value != selectedProduct)
- {
- Set(ref selectedProduct, value);
- if (SelectedServo != null)
- {
- SetBitValue($"{SelectedServo.Name}_sRecipeCode", value);
- }
- }
- }
- }
-
- private ObservableCollection<ServoProductData> servoProducts;
- public ObservableCollection<ServoProductData> ServoProducts
- {
- get => servoProducts;
- set
- {
- Set(ref servoProducts, value);
- }
- }
-
- /// <summary>
- /// 瀹炰緥鍖栨湇鍔″櫒鎺ュ彛鍑芥暟
- /// </summary>
- private SCADAApi lTSCADAApi = new OPCClient();
- private bool isActived = false;
- private System.Timers.Timer motorMonitorTimer;
-
- #region ServoData
- private string enable;
- [IsStatus]
- public string Enable
- {
- get => enable;
- set
- {
- Set(ref enable, value);
- }
- }
-
- private string currentPosition;
- [IsStatus]
- public string CurrentPosition
- {
- get => $"{currentPosition}{SelectedServo?.Unit}";
- set
- {
- Set(ref currentPosition, value);
- }
- }
-
- private string currentSpeed;
- [IsStatus]
- public string CurrentSpeed
- {
- get => $"{currentSpeed}{SelectedServo?.Unit}/s";
- set
- {
- Set(ref currentSpeed, value);
- }
- }
-
- private string overAcc;
- [IsStatus]
- public string OverAcc
- {
- get => $"{overAcc}{SelectedServo?.Unit}/s虏";
- set
- {
- Set(ref overAcc, value);
- }
- }
-
- private string overDec;
- [IsStatus]
- public string OverDec
- {
- get => $"{overDec}{SelectedServo?.Unit}/s虏";
- set
- {
- Set(ref overDec, value);
- }
- }
-
- private string hmiPosition;
- [IsStatus]
- public string HMIPosition
- {
- get => $"{hmiPosition}{SelectedServo?.Unit}";
- set
- {
- Set(ref hmiPosition, value);
- }
- }
-
- private string hmiSpeed;
- [IsStatus]
- public string HMISpeed
- {
- get => $"{hmiSpeed}{SelectedServo?.Unit}/s";
- set
- {
- Set(ref hmiSpeed, value);
- }
- }
-
- private string jogVelocity;
- [IsStatus]
- public string JogVelocity
- {
- get => $"{jogVelocity}%";
- set
- {
- Set(ref jogVelocity, value);
- }
- }
-
- private string inchDistance;
- [IsStatus]
- public string InchDistance
- {
- get => $"{inchDistance}{SelectedServo?.Unit}";
- set
- {
- Set(ref inchDistance, value);
- }
- }
-
- private string dir;
- [IsStatus]
- public string Dir
- {
- get => dir;
- set
- {
- Set(ref dir, value);
- }
- }
-
- private string alarmCode = "0";
- [IsStatus]
- public string AlarmCode
- {
- get => alarmCode;
- set
- {
- Set(ref alarmCode, value);
- }
- }
-
- private string warnCode = "0";
- [IsStatus]
- public string WarnCode
- {
- get => warnCode;
- set
- {
- Set(ref warnCode, value);
- }
- }
-
- private string faultCode = "0";
- [IsStatus]
- public string FaultCode
- {
- get => faultCode;
- set
- {
- Set(ref faultCode, value);
- }
- }
-
- private string positiveLimit;
- [IsStatus]
- public string PositiveLimit
- {
- get => positiveLimit;
- set
- {
- Set(ref positiveLimit, value);
- }
- }
-
- private string homeSwitch;
- [IsStatus]
- public string HomeSwitch
- {
- get => homeSwitch;
- set
- {
- Set(ref homeSwitch, value);
- }
- }
-
- private string negativeLimit;
- [IsStatus]
- public string NegativeLimit
- {
- get => negativeLimit;
- set
- {
- Set(ref negativeLimit, value);
- }
- }
-
- private string axisEnabled;
- [IsStatus]
- public string AxisEnabled
- {
- get => axisEnabled;
- set
- {
- Set(ref axisEnabled, value);
- }
- }
-
- private string readyOK;
- [IsStatus]
- public string ReadyOK
- {
- get => readyOK;
- set
- {
- Set(ref readyOK, value);
- }
- }
-
- private string running;
- [IsStatus]
- public string Running
- {
- get => running;
- set
- {
- Set(ref running, value);
- }
- }
-
- private string homed;
- [IsStatus]
- public string Homed
- {
- get => homed;
- set
- {
- Set(ref homed, value);
- }
- }
-
- private string axisError;
- [IsStatus]
- public string AxisError
- {
- get => axisError;
- set
- {
- Set(ref axisError, value);
- }
- }
-
- private string axisWarn;
- [IsStatus]
- public string AxisWarn
- {
- get => axisWarn;
- set
- {
- Set(ref axisWarn, value);
- }
- }
-
- private string posCode = "0";
- [IsStatus]
- public string PosCode
- {
- get => posCode;
- set
- {
- Set(ref posCode, value);
- }
- }
- #endregion
-
- public ServoManage()
- {
- DataContext = this;
- motorMonitorTimer = new System.Timers.Timer();
- motorMonitorTimer.Elapsed += MotorMonitorTimer_Elapsed;
- motorMonitorTimer.Interval = 100;
- InitializeComponent();
- }
-
- private void MotorMonitorTimer_Elapsed(object sender, ElapsedEventArgs e)
- {
- RefreshServoStatus();
- }
-
- public override void SetBaseFolder(string folder)
- {
- FilePath = Path.Combine(folder, "Servo.data");
- ProductFilePath = Path.Combine(folder, "ServoProduct.data");
- base.SetBaseFolder(folder);
- }
-
- public override void Active()
- {
- base.Active();
- if (!isActived)
- {
- try
- {
- if (SystemSetting.Instance.PlcEnabled)
- {
- if (lTSCADAApi.Connect2("127.0.0.1", 6543, 18888, out string errMsg))
- {
- motorMonitorTimer.Enabled = true;
- isActived = true;
- }
- else
- {
- MsgBoxHelper2.Error(errMsg);
- }
- }
- else
- {
-
- isActived = true;
- }
- }
- catch (Exception ex)
- {
- log.Error("Active Failed.", ex);
- MsgBoxHelper2.Error(ex.Message);
- }
- }
- else
- {
- motorMonitorTimer.Enabled = true;
- }
- }
-
- public override void DeActive()
- {
- motorMonitorTimer.Enabled = false;
- base.DeActive();
- }
-
- private void UserControl_Loaded(object sender, RoutedEventArgs e)
- {
- LoadData();
- LoadProductData();
- this.Loaded -= UserControl_Loaded;
- }
-
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- Button btn = sender as Button;
- ServoData data = btn.DataContext as ServoData;
- switch (btn.Name)
- {
- case "addServoBtn":
- OpenServoModal(null);
- break;
- case "editServoBtn":
- OpenServoModal(data);
- break;
- case "delServoBtn":
- TryDeleteServo(data);
- break;
- case "rfhServoBtn":
- LoadData();
- break;
- case "addProductBtn":
- OpenProductModal(null);
- break;
- default:
- break;
- }
- }
-
- #region Servo
- private void LoadData()
- {
- try
- {
- ObservableCollection<ServoData> data = new ObservableCollection<ServoData>();
- if (File.Exists(FilePath))
- {
- data = XmlHelper.DeserializeFromXml<ObservableCollection<ServoData>>(FilePath);
- }
- Servos = data;
- }
- catch (Exception ex)
- {
- log.Error("Load Servo Data Failed.", ex);
- ToastHelper.Error(this.lang("App.LoadFailed"));
- }
- }
-
- private void OpenServoModal(ServoData data)
- {
- bool isUpdate = data != null;
- try
- {
-
- ServoModal modal = new ServoModal
- {
- Title = isUpdate ? this.lang("App.Edit") : this.lang("App.Add"),
- Owner = Window.GetWindow(this)
- };
- if (modal.Open(data ?? new ServoData(), Servos) == true)
- {
- LoadData();
- }
- }
- catch (Exception ex)
- {
- log.Error($"Add Or Edit Data Failed.", ex);
- var title = isUpdate ? this.lang("App.EditFailed") : this.lang("App.AddFailed");
- MsgBoxHelper2.Error($"{title}: {ex.Message}");
- }
- }
-
- private void TryDeleteServo(ServoData data)
- {
- try
- {
- if (MsgBoxHelper2.WarnChoose(this.lang("HMI.MakeSureDeleteSingle", data.Name)) == MessageBoxResult.OK)
- {
- int index = Servos.IndexOf(data);
- if (index > 0)
- {
- var temp = XmlHelper.DeepClone(Servos);
- temp.RemoveAt(index);
- XmlHelper.SerializeToXml(FilePath, temp);
- }
- LoadData();
- }
- }
- catch (Exception ex)
- {
- log.Error($"Delete Servo Failed.", ex);
- MsgBoxHelper2.Error($"{this.lang("App.DeleteFailed")}: {ex.Message}");
- }
- }
- #endregion
-
- #region product
- public ObservableCollection<ServoProductData> ReadCommonProducts()
- {
- ObservableCollection<ServoProductData> datas = new ObservableCollection<ServoProductData>();
- List<ProductData> products = ProductManager.GetProducts<List<ProductData>>();
- if (products != null && products.Count > 0)
- {
- foreach (var product in products)
- {
- var parameter = ProductManager.GetParametersByProductName(product.Name)
- ?.FirstOrDefault(p => p.Name == "ProgramCode");
- if (parameter != null)
- {
- datas.Add(new ServoProductData
- {
- Model = product.Name,
- ProgramCode = parameter.Value,
- });
- }
- }
- }
- return datas;
- }
-
- private void LoadProductData()
- {
- try
- {
- //ObservableCollection<ServoProductData> datas = new ObservableCollection<ServoProductData>();
- //if (File.Exists(FilePath))
- //{
- // datas = XmlHelper.DeserializeFromXml<ObservableCollection<ServoProductData>>(ProductFilePath);
- //}
- ServoProducts = ReadCommonProducts();
- }
- catch (Exception ex)
- {
- log.Error("Load Servo Product Data Failed.", ex);
- ToastHelper.Error(this.lang("App.LoadFailed"));
- }
- }
-
- private void OpenProductModal(ServoProductData data)
- {
- bool isUpdate = data != null;
- try
- {
-
- ServoProductModal modal = new ServoProductModal
- {
- Title = isUpdate ? this.lang("App.Edit") : this.lang("App.Add"),
- Owner = Window.GetWindow(this)
- };
- if (modal.Open(data ?? new ServoProductData(), ServoProducts) == true)
- {
- LoadProductData();
- }
- }
- catch (Exception ex)
- {
- log.Error($"Add Or Edit Product Data Failed.", ex);
- var title = isUpdate ? this.lang("App.EditFailed") : this.lang("App.AddFailed");
- MsgBoxHelper2.Error($"{title}: {ex.Message}");
- }
- }
- #endregion
-
- private void RefreshServoStatus()
- {
- this.motorMonitorTimer.Enabled = false;
- try
- {
- if (SelectedServo == null) return;
- PropertyInfo[] properties = this.GetType().GetProperties();
- foreach (var prop in properties)
- {
- if (!Attribute.IsDefined(prop, typeof(IsStatusAttribute)))
- {
- continue;
- }
- Dispatcher.InvokeAsync(new Action(() =>
- {
- if (prop.Name == "SelectedProduct")
- {
- var data = GetBitValue($"{SelectedServo.Name}_sRecipeCode");
- SelectedProduct = data;
- }
- else
- {
- var data = GetBitValue($"{SelectedServo.Name}_{prop.Name}");
- prop.SetValue(this, data);
- }
- }), DispatcherPriority.SystemIdle);
- }
- }
- catch (Exception ex)
- {
-
- }
- finally
- {
- this.motorMonitorTimer.Enabled = true;
- }
- }
-
- /// <summary>
- /// 璁剧疆DB鍦板潃bool鍊�
- /// </summary>
- /// <param name="subbuttonX">瀛愭寜閽�</param>
- /// <param name="address">鍦板潃</param>
- /// <param name="bol">鍊�</param>
- private void SetBitValue(string tag, string val)
- {
- if (!lTSCADAApi.DoFctWriteSingle(tag, val, out string errMsg))
- {
- log.Error($"Set Bit Value Failed.{errMsg}");
- MsgBoxHelper2.Error(errMsg);
- }
- }
-
- /// <summary>
- /// 閫氳繃褰撳墠鏍囩璇诲彇鍊�
- /// </summary>
- /// <param name="tag">鏍囩</param>
- /// <returns>杩斿洖鍊�</returns>
- private string GetBitValue(string tag)
- {
- if (lTSCADAApi.DoFctReadSingle(tag, out string res, out string err))
- {
- return res;
- }
- else
- {
- return "";
- }
- }
-
- private void Servo_Click(object sender, RoutedEventArgs e)
- {
- if (SelectedServo == null)
- {
- ToastHelper.Warning(this.lang("svo.selectAServo"));
- return;
- }
- Button btn = sender as Button;
- try
- {
- switch (btn.Tag)
- {
- case "Enable":
- EnableDoClick(btn.Tag.ToString());
- break;
- case "Dir":
- EnableDoClick(btn.Tag.ToString());
- break;
- default:
- //DoSignClick(btn.Tag?.ToString());
- break;
- }
- }
- catch (Exception ex)
- {
- log.Error($"Servo Opt Failed, BtnName is {btn.Name}", ex);
- MsgBoxHelper2.Error(ex.Message);
- }
- finally
- {
- }
- }
-
- private void DoSignClick(string tag)
- {
- if (!string.IsNullOrEmpty(tag))
- {
- SetBitValue($"{SelectedServo?.Name}_{tag}", "true");
- Thread.Sleep(50);
- SetBitValue($"{SelectedServo?.Name}_{tag}", "false");
- }
- }
-
- /// <summary>
- /// 浣胯兘/鏂娇鑳� 鎸夐挳
- /// </summary>
- /// <param name="btnName"></param>
- private void EnableDoClick(string btnName)
- {
- bool val = GetBitValue($"{SelectedServo?.Name}_{btnName}") == "1";
- SetBitValue($"{SelectedServo?.Name}_{btnName}", $"{(!val ? 1 : 0)}");
- }
-
- private void Label_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
- {
- if (SelectedServo == null)
- {
- ToastHelper.Warning(this.lang("svo.selectAServo"));
- return;
- }
- Label label = sender as Label;
- var tag = label.Tag.ToString();
- NumberPanel np = new NumberPanel()
- {
- Title = this.lang($"svo.{tag}"),
- Owner = Window.GetWindow(this)
- };
- string value = label.Content.ToString();
- if (value.Contains("%"))
- {
- value = value.Replace("%", "");
- }
- else if (SelectedServo != null)
- {
- value = value.Split(new string[] { SelectedServo.Unit }, StringSplitOptions.None)[0];
- }
- if (np.Open(value) == true)
- {
- SetBitValue($"{SelectedServo?.Name}_{tag}", np.Data?.ToString());
- }
- }
-
- private void Button_PreviewMouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
- {
- Button btn = sender as Button;
- var tag = btn.Tag.ToString();
- try
- {
- motorMonitorTimer.Enabled = false;
- SetBitValue($"{SelectedServo?.Name}_{tag}", "true");
- }
- finally
- {
- motorMonitorTimer.Enabled = true;
- }
- }
-
- private void Button_PreviewMouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
- {
- Button btn = sender as Button;
- var tag = btn.Tag.ToString();
- try
- {
- motorMonitorTimer.Enabled = false;
- SetBitValue($"{SelectedServo?.Name}_{tag}", "false");
- }
- finally
- {
- motorMonitorTimer.Enabled = true;
- }
- }
- }
-}
diff --git a/Plugin.ServoManage/ServoModal.xaml b/Plugin.ServoManage/ServoModal.xaml
deleted file mode 100644
index 4a60f3e..0000000
--- a/Plugin.ServoManage/ServoModal.xaml
+++ /dev/null
@@ -1,37 +0,0 @@
-锘�<pu:WindowX x:Class="Plugin.ServoManage.ServoModal"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:local="clr-namespace:Plugin.ServoManage"
- xmlns:pw="https://opensource.panuon.com/wpf"
- xmlns:pu="https://opensource.panuon.com/wpf-ui"
- xmlns:uic="clr-namespace:HMI.UI.Converter;assembly=HMI.UI"
- xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
- mc:Ignorable="d"
- Title="Form"
- SizeToContent="Height"
- Width="600"
- WindowStartupLocation="CenterOwner"
- Style="{StaticResource ModalWindow}">
- <Grid Margin="10">
- <StackPanel x:Name="formPanel">
- <pu:FormGroup x:Name="FgName" Style="{StaticResource InputFormGroupStyle}"
- Header="{DynamicResource svo.name}"
- dp:FormGroupHelper.IsRequired="True"
- dp:FormGroupHelper.ValidateMethod="ValidateName"
- GroupName="MyFormGroup">
- <TextBox x:Name="TbName" Style="{StaticResource EditorTextBoxStyle}" />
- </pu:FormGroup>
-
- <pu:FormGroup x:Name="FgUnit" Style="{StaticResource InputFormGroupStyle}"
- Header="{DynamicResource svo.unit}"
- dp:FormGroupHelper.IsRequired="True" GroupName="MyFormGroup">
- <ComboBox x:Name="CbUnit" Style="{StaticResource FormComboxStyle}" SelectedValuePath="Content">
- <ComboBoxItem>mm</ComboBoxItem>
- <ComboBoxItem>掳</ComboBoxItem>
- </ComboBox>
- </pu:FormGroup>
- </StackPanel>
- </Grid>
-</pu:WindowX>
diff --git a/Plugin.ServoManage/ServoModal.xaml.cs b/Plugin.ServoManage/ServoModal.xaml.cs
deleted file mode 100644
index bf9b2c9..0000000
--- a/Plugin.ServoManage/ServoModal.xaml.cs
+++ /dev/null
@@ -1,126 +0,0 @@
-锘縰sing HMI.Core.Util;
-using HMI.UI.DpUtil;
-using HMI.UI.Util;
-using Panuon.WPF.UI;
-using Plugin.ServoManage.Entity;
-using System;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.Linq;
-
-namespace Plugin.ServoManage
-{
- /// <summary>
- /// ModalWindow.xaml 鐨勪氦浜掗�昏緫
- /// </summary>
- public partial class ServoModal : WindowX
- {
- public ServoModal()
- {
- this.DataContext = this;
- InitializeComponent();
- }
-
- public ServoData Data { get; set; }
- private ObservableCollection<ServoData> Datasource;
-
- private bool _isProcessing;
-
- protected override void OnClosing(CancelEventArgs e)
- {
- //Press Continue Button
- if (DialogResult == true)
- {
- if (_isProcessing)
- {
- e.Cancel = true;
- return;
- }
- var okButton = WindowXModalDialog.GetOKButton(this);
- try
- {
- _isProcessing = true;
- ButtonHelper.SetIsPending(okButton, true);
- if (!ValidateForm())
- {
- e.Cancel = true;
- return;
- }
-
- SaveOrUpdateData();
- }
- catch (Exception ex)
- {
- ToastHelper.Error(this, $"Error锛亄ex.Message}");
- e.Cancel = true;
- return;
- }
- finally
- {
- _isProcessing = false;
- ButtonHelper.SetIsPending(okButton, false);
- }
- }
- base.OnClosing(e);
- }
-
- private bool ValidateName(object value, out string err)
- {
- err = null;
- var data = Datasource?.FirstOrDefault(d => d.Name == value.ToString());
- if (data != null && data != Data)
- {
- err = string.Format(LangUtil.Get("App.MustBeUnique"), LangUtil.Get("svo.name"));
- return false;
- }
- return true;
- }
-
- private bool ValidateForm()
- {
- bool flag = FormGroupHelper.ValidateForm(formPanel);
- if (flag)
- {
- Data.Name = TbName.Text;
- Data.Unit = CbUnit.Text;
- }
-
- return flag;
- }
-
- public bool? Open(ServoData data, ObservableCollection<ServoData> datasource)
- {
- Datasource = datasource;
- Data = data;
- TbName.Text = Data.Name;
- CbUnit.SelectedValue = Data.Unit;
- return this.ShowDialog();
- }
-
- private void SaveOrUpdateData()
- {
- int index = Datasource.IndexOf(Data);
- if (index < 0)
- {
- InsertData(Data);
- }
- else
- {
- UpdateData(index, Data);
- }
- }
-
- public void InsertData(ServoData data)
- {
- Datasource.Add(data);
- XmlHelper.SerializeToXml(ServoManage.FilePath, Datasource);
- }
-
- public void UpdateData(int index, ServoData data)
- {
- var temp = XmlHelper.DeepClone(Datasource);
- temp[index] = data;
- XmlHelper.SerializeToXml(ServoManage.FilePath, Datasource);
- }
- }
-}
diff --git a/Plugin.ServoManage/ServoProductModal.xaml b/Plugin.ServoManage/ServoProductModal.xaml
deleted file mode 100644
index 07a9c27..0000000
--- a/Plugin.ServoManage/ServoProductModal.xaml
+++ /dev/null
@@ -1,34 +0,0 @@
-锘�<pu:WindowX x:Class="Plugin.ServoManage.ServoProductModal"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:local="clr-namespace:Plugin.ServoManage"
- xmlns:pw="https://opensource.panuon.com/wpf"
- xmlns:pu="https://opensource.panuon.com/wpf-ui"
- xmlns:uic="clr-namespace:HMI.UI.Converter;assembly=HMI.UI"
- xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
- mc:Ignorable="d"
- Title="Form"
- SizeToContent="Height"
- Width="600"
- WindowStartupLocation="CenterOwner"
- Style="{StaticResource ModalWindow}">
- <Grid Margin="10">
- <StackPanel x:Name="formPanel">
- <pu:FormGroup x:Name="FgModel" Style="{StaticResource InputFormGroupStyle}"
- Header="{DynamicResource svo.product.model}"
- dp:FormGroupHelper.ValidateMethod="ValidateModel"
- dp:FormGroupHelper.IsRequired="True" GroupName="MyFormGroup">
- <TextBox x:Name="TbModel" Style="{StaticResource EditorTextBoxStyle}" />
- </pu:FormGroup>
-
- <pu:FormGroup x:Name="FgProgramCode" Style="{StaticResource InputFormGroupStyle}"
- dp:FormGroupHelper.ValidateMethod="ValidateProgramCode"
- Header="{DynamicResource svo.product.programCode}"
- dp:FormGroupHelper.IsRequired="True" GroupName="MyFormGroup">
- <pu:NumberInput x:Name="NiProgramCode" Style="{StaticResource FormNumberInput}" />
- </pu:FormGroup>
- </StackPanel>
- </Grid>
-</pu:WindowX>
diff --git a/Plugin.ServoManage/ServoProductModal.xaml.cs b/Plugin.ServoManage/ServoProductModal.xaml.cs
deleted file mode 100644
index 997c415..0000000
--- a/Plugin.ServoManage/ServoProductModal.xaml.cs
+++ /dev/null
@@ -1,138 +0,0 @@
-锘縰sing HMI.Core.Util;
-using HMI.UI.DpUtil;
-using HMI.UI.Util;
-using Panuon.WPF.UI;
-using Plugin.ServoManage.Entity;
-using System;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.Linq;
-
-namespace Plugin.ServoManage
-{
- /// <summary>
- /// ModalWindow.xaml 鐨勪氦浜掗�昏緫
- /// </summary>
- public partial class ServoProductModal : WindowX
- {
- public ServoProductModal()
- {
- this.DataContext = this;
- InitializeComponent();
- }
-
- public ServoProductData Data { get; set; }
- private ObservableCollection<ServoProductData> Datasource;
-
- private bool _isProcessing;
-
- protected override void OnClosing(CancelEventArgs e)
- {
- //Press Continue Button
- if (DialogResult == true)
- {
- if (_isProcessing)
- {
- e.Cancel = true;
- return;
- }
- var okButton = WindowXModalDialog.GetOKButton(this);
- try
- {
- _isProcessing = true;
- ButtonHelper.SetIsPending(okButton, true);
- if (!ValidateForm())
- {
- e.Cancel = true;
- return;
- }
-
- SaveOrUpdateData();
- }
- catch (Exception ex)
- {
- ToastHelper.Error(this, $"Error锛亄ex.Message}");
- e.Cancel = true;
- return;
- }
- finally
- {
- _isProcessing = false;
- ButtonHelper.SetIsPending(okButton, false);
- }
- }
- base.OnClosing(e);
- }
-
- private bool ValidateModel(object value, out string err)
- {
- err = null;
- var data = Datasource?.FirstOrDefault(d => d.Model == value.ToString());
- if (data != null && data != Data)
- {
- err = string.Format(LangUtil.Get("App.MustBeUnique"), LangUtil.Get("svo.product.model"));
- return false;
- }
- return true;
- }
-
- private bool ValidateProgramCode(object value, out string err)
- {
- err = null;
- var data = Datasource?.FirstOrDefault(d => d.ProgramCode == value.ToString());
- if (data != null && data != Data)
- {
- err = string.Format(LangUtil.Get("App.MustBeUnique"), LangUtil.Get("svo.product.programCode"));
- return false;
- }
- return true;
- }
-
- private bool ValidateForm()
- {
- bool flag = FormGroupHelper.ValidateForm(formPanel);
- if (flag)
- {
- Data.Model = TbModel.Text;
- Data.ProgramCode = NiProgramCode.Value?.ToString();
- }
-
- return flag;
- }
-
- public bool? Open(ServoProductData data, ObservableCollection<ServoProductData> datasource)
- {
- Datasource = datasource ?? new ObservableCollection<ServoProductData>();
- Data = data;
- TbModel.Text = Data.Model;
- NiProgramCode.Value = int.Parse(Data.ProgramCode ?? "0");
- return this.ShowDialog();
- }
-
- private void SaveOrUpdateData()
- {
- int index = Datasource.IndexOf(Data);
- if (index < 0)
- {
- InsertData(Data);
- }
- else
- {
- UpdateData(index, Data);
- }
- }
-
- public void InsertData(ServoProductData data)
- {
- Datasource.Add(data);
- XmlHelper.SerializeToXml(ServoManage.ProductFilePath, Datasource);
- }
-
- public void UpdateData(int index, ServoProductData data)
- {
- var temp = XmlHelper.DeepClone(Datasource);
- temp[index] = data;
- XmlHelper.SerializeToXml(ServoManage.ProductFilePath, Datasource);
- }
- }
-}
diff --git a/Plugin.ServoManage/ServoSetting.xaml b/Plugin.ServoManage/ServoSetting.xaml
deleted file mode 100644
index e284bb5..0000000
--- a/Plugin.ServoManage/ServoSetting.xaml
+++ /dev/null
@@ -1,10 +0,0 @@
-锘�<UserControl x:Class="Plugin.ServoManage.ServoSetting"
- 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:Plugin.ServoManage"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800">
-
-</UserControl>
diff --git a/Plugin.ServoManage/ServoSetting.xaml.cs b/Plugin.ServoManage/ServoSetting.xaml.cs
deleted file mode 100644
index 92c2fe8..0000000
--- a/Plugin.ServoManage/ServoSetting.xaml.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-锘縰sing 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 Plugin.ServoManage
-{
- /// <summary>
- /// ServoSetting.xaml 鐨勪氦浜掗�昏緫
- /// </summary>
- public partial class ServoSetting : UserControl
- {
- public ServoSetting()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Plugin.ServoManage/packages.config b/Plugin.ServoManage/packages.config
deleted file mode 100644
index c3ebe09..0000000
--- a/Plugin.ServoManage/packages.config
+++ /dev/null
@@ -1,6 +0,0 @@
-锘�<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="log4net" version="3.0.4" targetFramework="net472" />
- <package id="Panuon.WPF" version="1.1.3" targetFramework="net472" />
- <package id="Panuon.WPF.UI" version="1.3.0.2" targetFramework="net472" />
-</packages>
\ No newline at end of file
diff --git a/Plugin.TestBuilder/Container/FunctionSetting.xaml b/Plugin.TestBuilder/Container/FunctionSetting.xaml
deleted file mode 100644
index 5544887..0000000
--- a/Plugin.TestBuilder/Container/FunctionSetting.xaml
+++ /dev/null
@@ -1,44 +0,0 @@
-锘�<UserControl x:Class="Plugin.TestBuilder.FunctionSetting"
- 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:Plugin.TestBuilder"
- xmlns:pw="https://opensource.panuon.com/wpf"
- xmlns:pu="https://opensource.panuon.com/wpf-ui"
- xmlns:dd="urn:gong-wpf-dragdrop"
- xmlns:m="clr-namespace:Plugin.TestBuilder.Model"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800">
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <pu:StyleDictionary Includes="TreeView"/>
- </ResourceDictionary.MergedDictionaries>
- </ResourceDictionary>
- </UserControl.Resources>
-
- <Grid>
- <TabControl>
- <TabItem Header="鍑芥暟鍒楄〃">
- <StackPanel>
- <!--<hc:SearchBar hc:InfoElement.Placeholder="杈撳叆鏂囨湰鏌ヨ" Style="{StaticResource SearchBarPlus}" Margin="10,5,10,5"/>-->
- <TreeView ItemsSource="{Binding FuncModels}"
- Style="{StaticResource DefaultTreeView}"
- dd:DragDrop.IsDragSource="True"
- dd:DragDrop.ShowAlwaysDropTargetAdorner="True"
- dd:DragDrop.UseDefaultDragAdorner="True"
- dd:DragDrop.DragHandler="{Binding dragHandler}">
- <TreeView.ItemTemplate>
- <HierarchicalDataTemplate DataType="{x:Type m:FuncModel}" ItemsSource="{Binding Path=Children}">
- <ContentControl Content="{Binding Name}"/>
- </HierarchicalDataTemplate>
- </TreeView.ItemTemplate>
- </TreeView>
- </StackPanel>
- </TabItem>
- <TabItem Header="鍙橀噺鍒楄〃">
- </TabItem>
- </TabControl>
- </Grid>
-</UserControl>
diff --git a/Plugin.TestBuilder/Container/FunctionSetting.xaml.cs b/Plugin.TestBuilder/Container/FunctionSetting.xaml.cs
deleted file mode 100644
index 7f2b261..0000000
--- a/Plugin.TestBuilder/Container/FunctionSetting.xaml.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-锘縰sing Plugin.TestBuilder.Model;
-using Plugin.TestBuilder.UI;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.Runtime.CompilerServices;
-using System.Windows.Controls;
-
-namespace Plugin.TestBuilder
-{
- /// <summary>
- /// FunctionSetting.xaml 鐨勪氦浜掗�昏緫
- /// </summary>
- public partial class FunctionSetting : UserControl, INotifyPropertyChanged
- {
- public virtual event PropertyChangedEventHandler PropertyChanged;
-
- protected virtual void RaisePropertyChanged(string name)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
- }
-
- protected void RaiseAndSetIfChanged<T>(ref T old, T @new, [CallerMemberName] string propertyName = null)
- {
- old = @new;
- if (propertyName != null)
- {
- RaisePropertyChanged(propertyName);
- }
- }
-
- public FunctionSetting()
- {
- DataContext = this;
- InitializeComponent();
- }
-
- public DdDragHandler dragHandler { get; set; } = new DdDragHandler();
-
- private ObservableCollection<FuncModel> _FuncModels = new ObservableCollection<FuncModel>() {
-
- new FuncModel(){
- Name = "111",
- Children = new ObservableCollection<FuncModel>(){
- new FuncModel(){ Name = "1123"},
- new FuncModel(){ Name = "1223"},
- }
- },
- new FuncModel()
- {
- Name = "222",
- Children = new ObservableCollection<FuncModel>(){
- new FuncModel(){ Name = "2123"},
- new FuncModel(){ Name = "2223"},
- }
- }
- };
-
- public ObservableCollection<FuncModel> FuncModels
- {
- get { return _FuncModels; }
- set => RaiseAndSetIfChanged(ref _FuncModels, value);
- }
- }
-}
diff --git a/Plugin.TestBuilder/Container/ProgramList.xaml b/Plugin.TestBuilder/Container/ProgramList.xaml
deleted file mode 100644
index aef8888..0000000
--- a/Plugin.TestBuilder/Container/ProgramList.xaml
+++ /dev/null
@@ -1,32 +0,0 @@
-锘�<UserControl x:Class="Plugin.TestBuilder.ProgramList"
- 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:Plugin.TestBuilder"
- xmlns:dd="urn:gong-wpf-dragdrop"
- xmlns:pw="https://opensource.panuon.com/wpf"
- xmlns:pu="https://opensource.panuon.com/wpf-ui"
- mc:Ignorable="d"
- HorizontalAlignment="Stretch"
- HorizontalContentAlignment="Stretch"
- Background="#FFF" >
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <pu:StyleDictionary Includes="ListBox"/>
- </ResourceDictionary.MergedDictionaries>
- </ResourceDictionary>
- </UserControl.Resources>
-
- <Grid>
- <ListBox ItemsSource="{Binding Programs}" Style="{StaticResource DefaultListBox}" VerticalContentAlignment="Center"
- SelectionChanged="ListView_SelectionChanged">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <ContentControl Content="{Binding Name}"/>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </Grid>
-</UserControl>
diff --git a/Plugin.TestBuilder/Container/ProgramList.xaml.cs b/Plugin.TestBuilder/Container/ProgramList.xaml.cs
deleted file mode 100644
index 0c86bd8..0000000
--- a/Plugin.TestBuilder/Container/ProgramList.xaml.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-锘縰sing Plugin.TestBuilder.Model;
-using System;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.Runtime.CompilerServices;
-using System.Windows.Controls;
-
-namespace Plugin.TestBuilder
-{
- /// <summary>
- /// ProgramList.xaml 鐨勪氦浜掗�昏緫
- /// </summary>
- public partial class ProgramList : UserControl, INotifyPropertyChanged
- {
- public virtual event PropertyChangedEventHandler PropertyChanged;
-
- protected virtual void RaisePropertyChanged(string name)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
- }
-
- protected void RaiseAndSetIfChanged<T>(ref T old, T @new, [CallerMemberName] string propertyName = null)
- {
- old = @new;
- if (propertyName != null)
- {
- RaisePropertyChanged(propertyName);
- }
- }
-
- private ObservableCollection<Program> _Programs = new ObservableCollection<Program> {
- new Program{ Name="123"}.AddSequnce(new Sequence{
- Name="S123"
- },new Sequence
- {
- Name="S223"
- }),
- new Program{ Name="223"}.AddSequnce(new Sequence{
- Name="D123"
- },new Sequence
- {
- Name="D223"
- })
- };
-
- public ObservableCollection<Program> Programs
- {
- get { return _Programs; }
- set => RaiseAndSetIfChanged(ref _Programs, value);
- }
-
- public ProgramList()
- {
- DataContext = this;
- InitializeComponent();
- }
-
- public event EventHandler<Program> ProgramChanged;
-
- private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- ttt();
- if (e.AddedItems.Count > 0)
- {
- Program program = e.AddedItems[0] as Program;
- ProgramChanged?.Invoke(this, program);
- program.RunProgram();
- }
- }
-
- public void ttt()
- {
- //string path = "X:\\vs\\WPFProject\\test.xml";
- //XmlUtil.SerialToFile(Programs, path);
- }
- }
-}
diff --git a/Plugin.TestBuilder/Container/SequnceList.xaml b/Plugin.TestBuilder/Container/SequnceList.xaml
deleted file mode 100644
index e3c3689..0000000
--- a/Plugin.TestBuilder/Container/SequnceList.xaml
+++ /dev/null
@@ -1,204 +0,0 @@
-锘�<UserControl x:Class="Plugin.TestBuilder.SequnceList"
- 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:Plugin.TestBuilder"
- xmlns:dd="urn:gong-wpf-dragdrop"
-
- mc:Ignorable="d"
- Background="#FFF"
- d:DesignHeight="450" d:DesignWidth="800">
- <UserControl.Resources>
- <ResourceDictionary>
- <Style TargetType="DataGridRow" x:Key="CommonRow">
- <Setter Property="Margin" Value="0"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="DataGridRow">
- <SelectiveScrollingGrid>
- <SelectiveScrollingGrid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition Width="*"/>
- </SelectiveScrollingGrid.ColumnDefinitions>
- <SelectiveScrollingGrid.RowDefinitions>
- <RowDefinition Height="*"/>
- <RowDefinition Height="Auto"/>
- </SelectiveScrollingGrid.RowDefinitions>
- <Border Grid.ColumnSpan="2" x:Name="DGR_Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True"/>
- <DataGridCellsPresenter MinHeight="{TemplateBinding MinHeight}" VerticalContentAlignment="Center" Grid.Row="0" Grid.Column="1" ItemsPanel="{TemplateBinding ItemsPanel}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
- <DataGridDetailsPresenter Grid.Column="1" Grid.Row="1" SelectiveScrollingGrid.SelectiveScrollingOrientation="{Binding AreRowDetailsFrozen, ConverterParameter={x:Static SelectiveScrollingOrientation.Vertical}, Converter={x:Static DataGrid.RowDetailsScrollingConverter}, RelativeSource={RelativeSource AncestorType=DataGrid}}" Visibility="{TemplateBinding DetailsVisibility}"/>
- <DataGridRowHeader Grid.Row="0" Grid.Column="0" SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.Row}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
- </SelectiveScrollingGrid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter Property="Background" Value="{StaticResource SecondaryImportant}"/>
- </Trigger>
- <Trigger Property="IsSelected" Value="True">
- <Setter Property="Background" Value="{StaticResource Important}"/>
- <Setter Property="TextElement.Foreground" Value="#FFF"/>
- </Trigger>
- <!--<MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsSelected" Value="true"/>
- <Condition Property="Selector.IsSelectionActive" Value="false"/>
- </MultiTrigger.Conditions>
- <Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}"/>
- <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
- </MultiTrigger>-->
- </Style.Triggers>
-
- </Style>
-
- <Style TargetType="DataGridColumnHeader" x:Key="CommonColumnHeader">
- <Setter Property="BorderBrush" Value="{Binding Path=HorizontalGridLinesBrush,RelativeSource={RelativeSource FindAncestor,AncestorType=DataGrid}}"/>
- <Setter Property="BorderThickness" Value="0,1,1,1"/>
-
- <Style.Triggers>
- <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Column.DisplayIndex}" Value="0">
- <Setter Property="BorderThickness" Value="1,1,1,1"/>
- </DataTrigger>
- </Style.Triggers>
- </Style>
-
- <Style TargetType="DataGridCell" x:Key="CommonCell">
- <Setter Property="BorderBrush" Value="{Binding Path=HorizontalGridLinesBrush,RelativeSource={RelativeSource FindAncestor,AncestorType=DataGrid}}"/>
- <Setter Property="BorderThickness" Value="0,0,1,1"/>
- <Setter Property="Padding" Value="0"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="DataGridCell">
- <Border Padding="{TemplateBinding Padding}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
- <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Column.DisplayIndex}" Value="0">
- <Setter Property="BorderThickness" Value="1,0,1,1"/>
- </DataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected,RelativeSource={RelativeSource Self}}" Value="true"/>
- <Condition Binding="{Binding SelectionUnit,RelativeSource={RelativeSource FindAncestor,AncestorType=DataGrid}}" Value="Cell"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Foreground" Value="{StaticResource ImportantFont}"/>
- <Setter Property="Background" Value="{StaticResource Important}"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected,RelativeSource={RelativeSource Self}}" Value="true"/>
- <Condition Binding="{Binding IsSelected,RelativeSource={RelativeSource AncestorType=DataGridRow}}" Value="False"/>
- <Condition Binding="{Binding SelectionUnit,RelativeSource={RelativeSource FindAncestor,AncestorType=DataGrid}}" Value="CellOrRowHeader"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Foreground" Value="{StaticResource ImportantFont}"/>
- <Setter Property="Background" Value="{StaticResource Important}"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected,RelativeSource={RelativeSource Self}}" Value="true"/>
- <Condition Binding="{Binding IsSelected,RelativeSource={RelativeSource AncestorType=DataGridRow}}" Value="True"/>
- <Condition Binding="{Binding SelectionUnit,RelativeSource={RelativeSource FindAncestor,AncestorType=DataGrid}}" Value="CellOrRowHeader"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Foreground" Value="{StaticResource ImportantFont}"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected,RelativeSource={RelativeSource Self}}" Value="true"/>
- <Condition Binding="{Binding SelectionUnit,RelativeSource={RelativeSource FindAncestor,AncestorType=DataGrid}}" Value="FullRow"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Foreground" Value="{StaticResource ImportantFont}"/>
- </MultiDataTrigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsSelected" Value="true"/>
- <Condition Property="Selector.IsSelectionActive" Value="false"/>
- </MultiTrigger.Conditions>
- <Setter Property="Foreground" Value="{StaticResource ImportantFont}"/>
- <Setter Property="Background" Value="{StaticResource Important}"/>
- </MultiTrigger>
- </Style.Triggers>
- </Style>
-
- <Style TargetType="DataGrid" BasedOn="{StaticResource DefaultDataGrid}">
- <Setter Property="GridLinesVisibility" Value="None"/>
- <Setter Property="HorizontalGridLinesBrush" Value="Gray"/>
- <Setter Property="RowStyle" Value="{StaticResource CommonRow}"/>
- <Setter Property="CellStyle" Value="{StaticResource CommonCell}"/>
- <Setter Property="ColumnHeaderStyle" Value="{StaticResource CommonColumnHeader}"/>
- <Setter Property="RowHeight" Value="30"/>
- </Style>
- </ResourceDictionary>
- </UserControl.Resources>
-
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="2*"/>
- <ColumnDefinition Width="2"/>
- <ColumnDefinition Width="8*"/>
- </Grid.ColumnDefinitions>
- <ListBox ItemsSource="{Binding Sequences}" Style="{StaticResource DefaultListBox}" BorderThickness="0"
- dd:DragDrop.IsDragSource="True"
- dd:DragDrop.IsDropTarget="True"
- dd:DragDrop.ShowAlwaysDropTargetAdorner="True"
- dd:DragDrop.UseDefaultDragAdorner="True"
- SelectionChanged="ListView_SelectionChanged">
-
- <ListBox.ItemTemplate>
- <DataTemplate>
- <ContentControl Cursor="Hand" Content="{Binding Name}"/>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
-
- <GridSplitter Grid.Column="1" Background="LightGray" HorizontalAlignment="Center" Width="2" ResizeDirection="Columns"/>
-
- <Grid Grid.Column="2">
- <Grid.RowDefinitions>
- <RowDefinition Height="30"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <Label Content="娴嬭瘯娴佺▼" VerticalContentAlignment="Center"/>
-
- <DataGrid x:Name="dataGrid" AutoGenerateColumns="False"
-
- CanUserAddRows="False"
- CanUserSortColumns="False"
- FrozenColumnCount="1" Background="#FFF" Grid.Row="1"
- BorderThickness="0"
- dd:DragDrop.IsDragSource="True"
- dd:DragDrop.IsDropTarget="True"
- dd:DragDrop.ShowAlwaysDropTargetAdorner="True"
- dd:DragDrop.UseDefaultDragAdorner="True"
-
- dd:DragDrop.SelectDroppedItems="True"
- dd:DragDrop.DropHandler="{Binding dropHandler}"
-
- ItemsSource="{Binding Steps}">
- <DataGrid.Columns>
- <DataGridTextColumn IsReadOnly="True" Binding="{Binding Index}" Header="#"/>
-
- <DataGridTextColumn Header="鏍囬1" Binding="{Binding Name}"></DataGridTextColumn>
- <DataGridTextColumn Header="鏍囬2" Binding="{Binding Name}"></DataGridTextColumn>
- <DataGridTextColumn Header="鏍囬3" Binding="{Binding Name}"></DataGridTextColumn>
- <DataGridTextColumn Header="鏍囬4" Binding="{Binding Name}"></DataGridTextColumn>
-
- <DataGridTemplateColumn x:Name="opt" Width="*" Header="鎿嶄綔">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal">
- <Button Style="{StaticResource LinkButton}" Margin="0,0,20,0">缂栬緫</Button>
- <Button Style="{StaticResource LinkButton}">鍒犻櫎</Button>
- </StackPanel>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- </DataGrid.Columns>
- </DataGrid>
- </Grid>
- </Grid>
-</UserControl>
diff --git a/Plugin.TestBuilder/Container/SequnceList.xaml.cs b/Plugin.TestBuilder/Container/SequnceList.xaml.cs
deleted file mode 100644
index 770235a..0000000
--- a/Plugin.TestBuilder/Container/SequnceList.xaml.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-锘縰sing GongSolutions.Wpf.DragDrop;
-using Plugin.TestBuilder.Model;
-using Plugin.TestBuilder.UI;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.Runtime.CompilerServices;
-using System.Windows.Controls;
-
-namespace Plugin.TestBuilder
-{
- /// <summary>
- /// SequnceList.xaml 鐨勪氦浜掗�昏緫
- /// </summary>
- public partial class SequnceList : UserControl, INotifyPropertyChanged
- {
- public virtual event PropertyChangedEventHandler PropertyChanged;
-
- protected virtual void RaisePropertyChanged(string name)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
- }
-
- protected void RaiseAndSetIfChanged<T>(ref T old, T @new, [CallerMemberName] string propertyName = null)
- {
- old = @new;
- if (propertyName != null)
- {
- RaisePropertyChanged(propertyName);
- }
- }
- public SequnceList()
- {
- DataContext = this;
-
- Sequences = new ObservableCollection<Sequence>
- {
- new Sequence{ Name="SSSSS"},
- new Sequence{ Name="SSSSS2"},
- };
-
- Steps = Sequences[0].Steps;
-
- InitializeComponent();
- }
- private ObservableCollection<Program> _ps = new ObservableCollection<Program>();
- public ObservableCollection<Program> Ps
- {
- get => _ps;
- set => RaiseAndSetIfChanged(ref _ps, value);
- }
-
-
- private ObservableCollection<Sequence> _Sequences;
- public ObservableCollection<Sequence> Sequences
- {
- get => _Sequences;
- set
- {
- if (value != null && value.Count > 0)
- {
- Steps = value[0].Steps;
- }
- else {
- Steps = null;
- }
- RaiseAndSetIfChanged(ref _Sequences, value);
- }
- }
-
- private ObservableCollection<Step> _Steps;
- public ObservableCollection<Step> Steps
- {
- get => _Steps;
- set => RaiseAndSetIfChanged(ref _Steps, value);
- }
-
-
- public void Selected_Program_Changed(object sender, Program program)
- {
- this.Sequences = program.Sequences;
- }
-
- private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- if (e.AddedItems.Count > 0)
- {
- Steps = (e.AddedItems[0] as Sequence).Steps;
- }
- }
-
- public IDropTarget dropHandler { get; set; } = new DdDropHandler();
-
- }
-}
diff --git a/Plugin.TestBuilder/Container/StepSetting.xaml b/Plugin.TestBuilder/Container/StepSetting.xaml
deleted file mode 100644
index 1f0a71e..0000000
--- a/Plugin.TestBuilder/Container/StepSetting.xaml
+++ /dev/null
@@ -1,31 +0,0 @@
-锘�<UserControl x:Class="Plugin.TestBuilder.StepSetting"
- 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:Plugin.TestBuilder"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800">
- <UserControl.Resources>
- <ResourceDictionary>
- <Style TargetType="Label"></Style>
- <Style TargetType="ListView"></Style>
- <Style TargetType="TabControl"/>
-
- <Color x:Key="DarkPrimaryColor">#e17933</Color>
- <Color x:Key="PrimaryColor">#e17933</Color>
- <Color x:Key="PrimaryTextColor">#e17933</Color>
- <Color x:Key="SecondaryTitleColor">#e17933</Color>
- <Color x:Key="BorderColor">#e17933</Color>
- </ResourceDictionary>
- </UserControl.Resources>
-
- <Grid>
- <TabControl TabStripPlacement="Left">
- <TabItem Header="鍑芥暟鍒楄〃">
- </TabItem>
- <TabItem Header="鍙橀噺鍒楄〃">
- </TabItem>
- </TabControl>
- </Grid>
-</UserControl>
diff --git a/Plugin.TestBuilder/Container/StepSetting.xaml.cs b/Plugin.TestBuilder/Container/StepSetting.xaml.cs
deleted file mode 100644
index 345ff9d..0000000
--- a/Plugin.TestBuilder/Container/StepSetting.xaml.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-锘縰sing System.Windows.Controls;
-
-namespace Plugin.TestBuilder
-{
- /// <summary>
- /// StepSetting.xaml 鐨勪氦浜掗�昏緫
- /// </summary>
- public partial class StepSetting : UserControl
- {
- public StepSetting()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Plugin.TestBuilder/Entity/CanvasPosition.cs b/Plugin.TestBuilder/Entity/CanvasPosition.cs
deleted file mode 100644
index 8fdf7f0..0000000
--- a/Plugin.TestBuilder/Entity/CanvasPosition.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-锘縩amespace Plugin.TestBuilder.Entity
-{
- public class CanvasPosition
- {
- public double Top { get; set; }
- public double Left { get; set; }
- public double Width { get; set; }
- public double Height { get; set; }
-
- public double LimitWidth { get; set; }
- public double LimitHeight { get; set; }
- }
-}
diff --git a/Plugin.TestBuilder/Entity/SeqData.cs b/Plugin.TestBuilder/Entity/SeqData.cs
deleted file mode 100644
index 092c32a..0000000
--- a/Plugin.TestBuilder/Entity/SeqData.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-锘縰sing HMI.Core.Entity;
-using System.Collections.ObjectModel;
-using System.Dynamic;
-
-namespace Plugin.TestBuilder.Entity
-{
- public class SeqData : NotifyBase
- {
- public string Name { get; set; }
- public string Item { get; set; }
- public string LimitUp { get; set; }
- public string LimitDown { get; set; }
- public string Unit { get; set; }
- public bool IsEnable { get; set; }
- public bool IsUploadMes { get; set; }
- public bool IsRetest { get; set; }
-
- public ObservableCollection<SeqData> Children { get; set; } = new ObservableCollection<SeqData>();
- }
-}
diff --git a/Plugin.TestBuilder/Model/FuncModel.cs b/Plugin.TestBuilder/Model/FuncModel.cs
deleted file mode 100644
index fe58c6b..0000000
--- a/Plugin.TestBuilder/Model/FuncModel.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-锘縰sing HMI.Core.Entity;
-using System.Collections.ObjectModel;
-
-namespace Plugin.TestBuilder.Model
-{
- public class FuncModel : NotifyBase
- {
- private string _Name;
-
- public string Name
- {
- get { return _Name; }
- set => Set(ref _Name, value);
- }
-
- private ObservableCollection<FuncModel> _Children;
-
- public ObservableCollection<FuncModel> Children
- {
- get { return _Children; }
- set => Set(ref _Children, value);
- }
-
- }
-}
diff --git a/Plugin.TestBuilder/Model/Program.cs b/Plugin.TestBuilder/Model/Program.cs
deleted file mode 100644
index c081722..0000000
--- a/Plugin.TestBuilder/Model/Program.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-锘縰sing HMI.Core.Entity;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Xml.Serialization;
-
-namespace Plugin.TestBuilder.Model
-{
- public class Program : NotifyBase
- {
- /// <summary>
- /// 绋嬪簭鍚�
- /// </summary>
- private string _Name;
- public string Name
- {
- get { return _Name; }
- set => Set(ref _Name, value);
- }
-
- /// <summary>
- /// 搴忓垪闆嗗悎
- /// </summary>
- private ObservableCollection<Sequence> _Sequences = new ObservableCollection<Sequence>();
- public ObservableCollection<Sequence> Sequences
- {
- get { return _Sequences; }
- set => Set(ref _Sequences, value);
- }
-
- /// <summary>
- /// 绋嬪簭鎵�闇�鍙傛暟
- /// </summary>
- private ObservableCollection<Variable> _Variables;
- public ObservableCollection<Variable> Variables
- {
- get { return _Variables; }
- set => Set(ref _Variables, value);
- }
-
- /// <summary>
- /// 鍒濆鍙傛暟鍙傛暟
- /// </summary>
- private Dictionary<string, Variable> _InitVars;
- [XmlIgnore]
- public Dictionary<string, Variable> InitVars
- {
- get { return _InitVars; }
- set { _InitVars = value; }
- }
-
- /// <summary>
- /// 璁$畻涓存椂鍙傛暟
- /// </summary>
- private Dictionary<string, object> _TempVars = new Dictionary<string, object>();
- [XmlIgnore]
- public Dictionary<string, object> TempVars
- {
- get { return _TempVars; }
- set { _TempVars = value; }
- }
-
- public Program AddSequnce(params Sequence[] sequences)
- {
- foreach (Sequence sequence in sequences)
- {
- if (sequence == null) continue;
- sequence.Program = this;
- Sequences.Add(sequence);
- }
- return this;
- }
-
- public void RunProgram()
- {
- foreach (Sequence sequence in Sequences)
- {
- sequence.RunSequnce();
- }
- }
- }
-}
diff --git a/Plugin.TestBuilder/Model/Sequence.cs b/Plugin.TestBuilder/Model/Sequence.cs
deleted file mode 100644
index 3c6c553..0000000
--- a/Plugin.TestBuilder/Model/Sequence.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-锘縰sing HMI.Core.Entity;
-using System.Collections.ObjectModel;
-using System.Xml.Serialization;
-
-namespace Plugin.TestBuilder.Model
-{
- public class Sequence : NotifyBase
- {
- private string _Name;
-
- public string Name
- {
- get { return _Name; }
- set => Set(ref _Name, value);
- }
-
- [XmlIgnore]
- public Program Program { get; set; }
-
- private ObservableCollection<Step> _Steps = new ObservableCollection<Step>();
- public ObservableCollection<Step> Steps
- {
- get { return _Steps; }
- set => Set(ref _Steps, value);
- }
-
- public Sequence AddStep(params Step[] steps)
- {
- foreach (Step step in steps)
- {
- if (step == null) continue;
- step.Sequence = this;
- Steps.Add(step);
- }
- return this;
- }
-
- public void RunSequnce()
- {
- foreach (Step step in Steps)
- {
- step.RunStep();
- }
- }
-
- public Sequence()
- {
- AddStep(new Step { Name = "000" }, new Step { Name = "111" });
- }
-
- }
-}
diff --git a/Plugin.TestBuilder/Model/Step.cs b/Plugin.TestBuilder/Model/Step.cs
deleted file mode 100644
index 6dc9c6e..0000000
--- a/Plugin.TestBuilder/Model/Step.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-锘縰sing HMI.Core.Entity;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Xml.Serialization;
-
-namespace Plugin.TestBuilder.Model
-{
- public class Step : NotifyBase
- {
- //private static readonly Type InterfaceType = typeof(IStepRunner);
- private static readonly Dictionary<string, Assembly> Cache = new Dictionary<string, Assembly>();
- #region 瀛楁
- [XmlIgnore]
- public Program Program { get; set; }
-
- [XmlIgnore]
- public Sequence Sequence { get; set; }
-
- private int _Index;
- public int Index
- {
- get { return _Index; }
- set => Set(ref _Index, value);
- }
-
- private string _Name;
- public string Name
- {
- get { return _Name; }
- set => Set(ref _Name, value);
- }
-
- private string _DllPath = "C:/Users/cheng/source/repos/WPFProject/VisionBuilder.Test/bin/Debug/VisionBuilder.Test.dll";
- public string DllPath
- {
- get { return _DllPath; }
- set => Set(ref _DllPath, value);
- }
-
- private string _ClassName = "VisionBuilder.Test.PluginOne";
- public string ClassName
- {
- get { return _ClassName; }
- set => Set(ref _ClassName, value);
- }
-
- private string _MethodName;
- public string MethodName
- {
- get { return _MethodName; }
- set => Set(ref _MethodName, value);
- }
-
- private string _Description;
- public string Description
- {
- get { return _Description; }
- set => Set(ref _Description, value);
- }
-
- #endregion
-
- public void RunStep()
- {
- //Assembly assembly = Assembly.LoadFrom(DllPath);
- //Type type = assembly.GetType(ClassName);
- //if (type != null && InterfaceType.IsAssignableFrom(type))
- //{
- // IStepRunner stepRunner = (IStepRunner)assembly.CreateInstance(ClassName);
- // stepRunner.RunStep(Sequence.Program.TempVars);
- //}
- }
- }
-}
diff --git a/Plugin.TestBuilder/Model/Variable.cs b/Plugin.TestBuilder/Model/Variable.cs
deleted file mode 100644
index f523f75..0000000
--- a/Plugin.TestBuilder/Model/Variable.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-锘縰sing HMI.Core.Entity;
-using System;
-using System.Xml.Serialization;
-
-namespace Plugin.TestBuilder.Model
-{
- public class Variable : NotifyBase
- {
- /// <summary>
- /// 鍙傛暟鍚�
- /// </summary>
- private string _Name;
- public string Name
- {
- get { return _Name; }
- set => Set(ref _Name, value);
- }
-
- /// <summary>
- /// 鍙傛暟绫诲瀷
- /// </summary>
- private string _TypeName;
- public string TypeName
- {
- get { return _TypeName; }
- set
- {
- Set(ref _TypeName, value);
- Type = value == null ? null : Type.GetType(value);
- }
- }
-
- [XmlIgnore]
- public Type Type { get; private set; }
-
- /// <summary>
- /// 鍊煎瓧绗�
- /// </summary>
- private string _ValueStr;
- public string ValueStr
- {
- get { return _ValueStr; }
- set => Set(ref _ValueStr, value);
- }
-
- /// <summary>
- /// 鍙傛暟鍊�
- /// </summary>
- private object _Value;
- public object Value
- {
- get { return _Value; }
- set { _Value = value; }
- }
-
- }
-}
diff --git a/Plugin.TestBuilder/Plugin.TestBuilder.csproj b/Plugin.TestBuilder/Plugin.TestBuilder.csproj
deleted file mode 100644
index be3e7b1..0000000
--- a/Plugin.TestBuilder/Plugin.TestBuilder.csproj
+++ /dev/null
@@ -1,200 +0,0 @@
-<?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>{30201EC1-9A82-48DB-94B9-BD5C1190228B}</ProjectGuid>
- <OutputType>library</OutputType>
- <RootNamespace>Plugin.TestBuilder</RootNamespace>
- <AssemblyName>Plugin.TestBuilder</AssemblyName>
- <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <WarningLevel>4</WarningLevel>
- <Deterministic>true</Deterministic>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\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>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
- <DebugSymbols>true</DebugSymbols>
- <OutputPath>bin\x64\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <DebugType>full</DebugType>
- <PlatformTarget>x64</PlatformTarget>
- <LangVersion>7.3</LangVersion>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
- <OutputPath>bin\x64\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <Optimize>true</Optimize>
- <DebugType>pdbonly</DebugType>
- <PlatformTarget>x64</PlatformTarget>
- <LangVersion>7.3</LangVersion>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="GongSolutions.WPF.DragDrop, Version=4.0.0.0, Culture=neutral, PublicKeyToken=91f1945125b7a587, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\gong-wpf-dragdrop.4.0.0\lib\net462\GongSolutions.WPF.DragDrop.dll</HintPath>
- </Reference>
- <Reference Include="log4net, Version=3.0.4.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\log4net.3.0.4\lib\net462\log4net.dll</HintPath>
- </Reference>
- <Reference Include="Panuon.WPF, Version=1.1.2.2, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\Panuon.WPF.1.1.3\lib\net472\Panuon.WPF.dll</HintPath>
- </Reference>
- <Reference Include="Panuon.WPF.UI, Version=1.3.0.2, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\WPFProject\packages\Panuon.WPF.UI.1.3.0.2\lib\net472\Panuon.WPF.UI.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Configuration" />
- <Reference Include="System.Data" />
- <Reference Include="System.Web" />
- <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>
- <Page Include="Container\FunctionSetting.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="Workspace.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="UI\BottomBar.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="UI\InnerWindow.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="UI\MinInnerWindow.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="Container\ProgramList.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="Container\SequnceList.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="Container\StepSetting.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="TestBuilder.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Compile Include="Entity\CanvasPosition.cs" />
- <Compile Include="Entity\SeqData.cs" />
- <Compile Include="Model\FuncModel.cs" />
- <Compile Include="Model\Program.cs" />
- <Compile Include="Model\Sequence.cs" />
- <Compile Include="Model\Step.cs" />
- <Compile Include="Model\Variable.cs" />
- <Compile Include="Workspace.xaml.cs">
- <DependentUpon>Workspace.xaml</DependentUpon>
- </Compile>
- <Compile Include="UI\BottomBar.xaml.cs">
- <DependentUpon>BottomBar.xaml</DependentUpon>
- </Compile>
- <Compile Include="Container\FunctionSetting.xaml.cs">
- <DependentUpon>FunctionSetting.xaml</DependentUpon>
- </Compile>
- <Compile Include="UI\DdDragHandler.cs" />
- <Compile Include="UI\DdDropHandler.cs" />
- <Compile Include="UI\InnerWindow.xaml.cs">
- <DependentUpon>InnerWindow.xaml</DependentUpon>
- </Compile>
- <Compile Include="UI\MinInnerWindow.xaml.cs">
- <DependentUpon>MinInnerWindow.xaml</DependentUpon>
- </Compile>
- <Compile Include="Container\ProgramList.xaml.cs">
- <DependentUpon>ProgramList.xaml</DependentUpon>
- </Compile>
- <Compile Include="UI\Resize.cs" />
- <Compile Include="Container\SequnceList.xaml.cs">
- <DependentUpon>SequnceList.xaml</DependentUpon>
- </Compile>
- <Compile Include="Container\StepSetting.xaml.cs">
- <DependentUpon>StepSetting.xaml</DependentUpon>
- </Compile>
- <Compile Include="TestBuilder.xaml.cs">
- <DependentUpon>TestBuilder.xaml</DependentUpon>
- </Compile>
- </ItemGroup>
- <ItemGroup>
- <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>
- <EmbeddedResource Include="Properties\Resources.resx">
- <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>
- <ProjectReference Include="..\HMI.Base\HMI.Base.csproj">
- <Project>{2a6f9720-a890-4036-9d73-41a0dae28341}</Project>
- <Name>HMI.Base</Name>
- </ProjectReference>
- <ProjectReference Include="..\HMI.Core\HMI.Core.csproj">
- <Project>{3e3bf44a-0b69-45c5-9512-528cb48a7106}</Project>
- <Name>HMI.Core</Name>
- </ProjectReference>
- <ProjectReference Include="..\HMI.UI\HMI.UI.csproj">
- <Project>{f17de6b5-af1d-48c6-94a0-6b763a6546a6}</Project>
- <Name>HMI.UI</Name>
- </ProjectReference>
- <ProjectReference Include="..\HMI.Util\HMI.Util.csproj">
- <Project>{afea100a-9223-448d-ab10-3015d93dd98c}</Project>
- <Name>HMI.Util</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-</Project>
\ No newline at end of file
diff --git a/Plugin.TestBuilder/Properties/AssemblyInfo.cs b/Plugin.TestBuilder/Properties/AssemblyInfo.cs
deleted file mode 100644
index 052fd07..0000000
--- a/Plugin.TestBuilder/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-锘縰sing System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Windows;
-
-// 鏈夊叧绋嬪簭闆嗙殑涓�鑸俊鎭敱浠ヤ笅
-// 鎺у埗銆傛洿鏀硅繖浜涚壒鎬у�煎彲淇敼
-// 涓庣▼搴忛泦鍏宠仈鐨勪俊鎭��
-[assembly: AssemblyTitle("Plugin.TestBuilder")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Plugin.TestBuilder")]
-[assembly: AssemblyCopyright("Copyright 漏 2025")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// 灏� ComVisible 璁剧疆涓� false 浼氫娇姝ょ▼搴忛泦涓殑绫诲瀷
-//瀵� COM 缁勪欢涓嶅彲瑙併�傚鏋滈渶瑕佷粠 COM 璁块棶姝ょ▼搴忛泦涓殑绫诲瀷
-//璇峰皢姝ょ被鍨嬬殑 ComVisible 鐗规�ц缃负 true銆�
-[assembly: ComVisible(false)]
-
-//鑻ヨ寮�濮嬬敓鎴愬彲鏈湴鍖栫殑搴旂敤绋嬪簭锛岃璁剧疆
-//.csproj 鏂囦欢涓殑 <UICulture>CultureYouAreCodingWith</UICulture>
-//鍦� <PropertyGroup> 涓�備緥濡傦紝濡傛灉浣犱娇鐢ㄧ殑鏄編鍥借嫳璇��
-//浣跨敤鐨勬槸缇庡浗鑻辫锛岃灏� <UICulture> 璁剧疆涓� en-US銆� 鐒跺悗鍙栨秷
-//瀵逛互涓� NeutralResourceLanguage 鐗规�х殑娉ㄩ噴銆� 鏇存柊
-//浠ヤ笅琛屼腑鐨勨�渆n-US鈥濅互鍖归厤椤圭洰鏂囦欢涓殑 UICulture 璁剧疆銆�
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
-[assembly:ThemeInfo(
- ResourceDictionaryLocation.None, //涓婚鐗瑰畾璧勬簮璇嶅吀鎵�澶勪綅缃�
- //(鏈湪椤甸潰涓壘鍒拌祫婧愭椂浣跨敤锛�
- //鎴栧簲鐢ㄧ▼搴忚祫婧愬瓧鍏镐腑鎵惧埌鏃朵娇鐢�)
- ResourceDictionaryLocation.SourceAssembly //甯歌璧勬簮璇嶅吀鎵�澶勪綅缃�
- //(鏈湪椤甸潰涓壘鍒拌祫婧愭椂浣跨敤锛�
- //銆佸簲鐢ㄧ▼搴忔垨浠讳綍涓婚涓撶敤璧勬簮瀛楀吀涓壘鍒版椂浣跨敤)
-)]
-
-
-// 绋嬪簭闆嗙殑鐗堟湰淇℃伅鐢变笅鍒楀洓涓�肩粍鎴�:
-//
-// 涓荤増鏈�
-// 娆$増鏈�
-// 鐢熸垚鍙�
-// 淇鍙�
-//
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Plugin.TestBuilder/Properties/Resources.Designer.cs b/Plugin.TestBuilder/Properties/Resources.Designer.cs
deleted file mode 100644
index 7900792..0000000
--- a/Plugin.TestBuilder/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-锘�//------------------------------------------------------------------------------
-// <auto-generated>
-// 姝や唬鐮佺敱宸ュ叿鐢熸垚銆�
-// 杩愯鏃剁増鏈�: 4.0.30319.42000
-//
-// 瀵规鏂囦欢鐨勬洿鏀瑰彲鑳藉鑷翠笉姝g‘鐨勮涓猴紝濡傛灉
-// 閲嶆柊鐢熸垚浠g爜锛屽垯鎵�鍋氭洿鏀瑰皢涓㈠け銆�
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace Plugin.TestBuilder.Properties {
-
-
- /// <summary>
- /// 寮虹被鍨嬭祫婧愮被锛岀敤浜庢煡鎵炬湰鍦板寲瀛楃涓茬瓑銆�
- /// </summary>
- // 姝ょ被鏄敱 StronglyTypedResourceBuilder
- // 绫婚�氳繃绫讳技浜� ResGen 鎴� Visual Studio 鐨勫伐鍏疯嚜鍔ㄧ敓鎴愮殑銆�
- // 鑻ヨ娣诲姞鎴栫Щ闄ゆ垚鍛橈紝璇风紪杈� .ResX 鏂囦欢锛岀劧鍚庨噸鏂拌繍琛� ResGen
- // (浠� /str 浣滀负鍛戒护閫夐」)锛屾垨閲嶆柊鐢熸垚 VS 椤圭洰銆�
- [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>
- /// 杩斿洖姝ょ被浣跨敤鐨勭紦瀛� ResourceManager 瀹炰緥銆�
- /// </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("Plugin.TestBuilder.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// 閲嶅啓褰撳墠绾跨▼鐨� CurrentUICulture 灞炴�э紝瀵�
- /// 浣跨敤姝ゅ己绫诲瀷璧勬簮绫荤殑鎵�鏈夎祫婧愭煡鎵炬墽琛岄噸鍐欍��
- /// </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/Plugin.TestBuilder/Properties/Resources.resx b/Plugin.TestBuilder/Properties/Resources.resx
deleted file mode 100644
index af7dbeb..0000000
--- a/Plugin.TestBuilder/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-锘�<?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/Plugin.TestBuilder/Properties/Settings.Designer.cs b/Plugin.TestBuilder/Properties/Settings.Designer.cs
deleted file mode 100644
index 72b0451..0000000
--- a/Plugin.TestBuilder/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-锘�//------------------------------------------------------------------------------
-// <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 Plugin.TestBuilder.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/Plugin.TestBuilder/Properties/Settings.settings b/Plugin.TestBuilder/Properties/Settings.settings
deleted file mode 100644
index 033d7a5..0000000
--- a/Plugin.TestBuilder/Properties/Settings.settings
+++ /dev/null
@@ -1,7 +0,0 @@
-锘�<?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/Plugin.TestBuilder/TestBuilder.xaml b/Plugin.TestBuilder/TestBuilder.xaml
deleted file mode 100644
index 0f38613..0000000
--- a/Plugin.TestBuilder/TestBuilder.xaml
+++ /dev/null
@@ -1,238 +0,0 @@
-锘�<hb:PluginControl x:Class="Plugin.TestBuilder.TestBuilder"
- 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:hb="clr-namespace:HMI.Base;assembly=HMI.Base"
- xmlns:pw="https://opensource.panuon.com/wpf"
- xmlns:pu="https://opensource.panuon.com/wpf-ui"
- xmlns:ui="clr-namespace:Plugin.TestBuilder.UI"
- xmlns:dd="urn:gong-wpf-dragdrop"
- xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
- xmlns:hui="clr-namespace:HMI.UI;assembly=HMI.UI"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800">
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <pu:StyleDictionary Includes="ListBox"/>
- <ResourceDictionary Source="/HMI.UI;component/Controls/TreeGrid/Themes/TreeItemContentControl.xaml"/>
- <ResourceDictionary Source="/HMI.UI;component/Controls/TreeGrid/Themes/TreeGrid.xaml"/>
- </ResourceDictionary.MergedDictionaries>
-
- <!-- 鏍慓rid缁勪欢 -->
- <hui:TreeItemDataConverter x:Key="TreeItemDataConverter"/>
-
- <CollectionViewSource x:Key="TreeGridFilter" Filter="CollectionViewSource_Filter"
- Source="{Binding Datasource,Converter={StaticResource TreeItemDataConverter},ConverterParameter=Children}">
-
- </CollectionViewSource>
- </ResourceDictionary>
- </UserControl.Resources>
-
- <Border Style="{StaticResource CardBoarder}">
- <Grid dp:GridHelper.Space="10" Cursor="">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
-
-
- <DockPanel>
- <StackPanel DockPanel.Dock="Right" Style="{StaticResource ButtonGroup}">
- <Button Style="{StaticResource AddBtn}"
- x:Name="addBtn" Click="Button_Click"/>
- <Button Style="{StaticResource RfhBtn}"
- x:Name="resetBtn" Click="Button_Click"/>
- <Button x:Name="exportBtn"
- Style="{StaticResource ExportBtn}" Click="Button_Click"/>
- </StackPanel>
- <TextBlock FontSize="{StaticResource TitleFontSize}"
-VerticalAlignment="Center" HorizontalAlignment="Left" Text="adsad"/>
-
- <!--<StackPanel Style="{StaticResource ButtonGroup}" HorizontalAlignment="Left">
- <TextBlock Style="{StaticResource TitleBox}" FontSize="14" Text="{DynamicResource log.level}"/>
- <ComboBox Style="{StaticResource FormComboxStyle}" x:Name="levelInput"
- Width="180"
- SelectedValuePath="Content">
- <ComboBoxItem Content="Debug"/>
- <ComboBoxItem Content="Info"/>
- <ComboBoxItem Content="Warn"/>
- <ComboBoxItem Content="Error"/>
- </ComboBox>
-
- <TextBlock Style="{StaticResource TitleBox}" FontSize="14" Text="{DynamicResource App.StartTime}"/>
- <pu:DateTimePicker Style="{StaticResource TimePicker}" x:Name="startTimeInput"/>
-
- <TextBlock Style="{StaticResource TitleBox}" FontSize="14" Text="{DynamicResource App.EndTime}"/>
- <pu:DateTimePicker Style="{StaticResource TimePicker}" x:Name="endTimeInput"/>
-
- <TextBlock Style="{StaticResource TitleBox}" FontSize="14" Text="{DynamicResource log.source}"/>
- <TextBox Style="{StaticResource EditorTextBoxStyle}" x:Name="sourceInput" Width="180"/>
-
- <TextBlock Style="{StaticResource TitleBox}" FontSize="14" Text="{DynamicResource log.autoRefresh}"/>
- <CheckBox x:Name="autoRfhInput" HorizontalAlignment="Center" VerticalAlignment="Center"
- IsChecked="{Binding AutoRfh,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
- </StackPanel>-->
- </DockPanel>
-
- <hui:TreeDataGrid Grid.Row="1" x:Name="treeDataGrid"
- ExpandedChange="treeDataGrid_ExpandedChange"
- ItemsSource="{Binding Source={StaticResource TreeGridFilter}}"
- dd:DragDrop.IsDragSource="True"
- dd:DragDrop.IsDropTarget="True"
- dd:DragDrop.ShowAlwaysDropTargetAdorner="True"
- dd:DragDrop.UseDefaultDragAdorner="True"
- dd:DragDrop.DropHandler="{Binding dropHandler}"
-
- Style="{StaticResource DefaultDataGrid}" ColumnWidth="*">
- <!--LoadingRow="treeDataGrid_LoadingRow">-->
- <!--<hui:TreeDataGrid.Resources>
-
- </hui:TreeDataGrid.Resources>-->
- <hui:TreeDataGrid.Columns>
- <DataGridTemplateColumn IsReadOnly="True">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <hui:TreeItemContentControl IconLineStroke="Black" TreeData="{Binding }"/>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
-
-
-
- <DataGridTextColumn Header="鍚嶇О" x:Name="nameCol" Binding="{Binding Data.Name}"></DataGridTextColumn>
- <DataGridTextColumn Header="娴嬭瘯椤�" Binding="{Binding Item}"></DataGridTextColumn>
- <DataGridTextColumn Header="涓婇檺" Binding="{Binding LimitUp}"></DataGridTextColumn>
- <DataGridTextColumn Header="涓嬮檺" Binding="{Binding LimitDown}"></DataGridTextColumn>
- <DataGridTextColumn Header="鍗曚綅" Binding="{Binding Unit}"></DataGridTextColumn>
- <DataGridTextColumn Header="鍚敤" Binding="{Binding IsEnable}"></DataGridTextColumn>
- <DataGridTextColumn Header="MES涓婁紶" Binding="{Binding IsUploadMes}"></DataGridTextColumn>
- <DataGridTextColumn Header="閲嶆祴" Binding="{Binding IsRetest}"></DataGridTextColumn>
-
- </hui:TreeDataGrid.Columns>
- </hui:TreeDataGrid>
-
- <!--<DataGrid Style="{StaticResource DefaultDataGrid}" AutoGenerateColumns="False"
- CanUserSortColumns="False"
- FrozenColumnCount="1" Background="#FFF" Grid.Row="1"
- BorderThickness="0"
- dd:DragDrop.IsDragSource="True"
- dd:DragDrop.IsDropTarget="True"
- dd:DragDrop.ShowAlwaysDropTargetAdorner="True"
- dd:DragDrop.UseDefaultDragAdorner="True"
- IsReadOnly="False"
- x:Name="table"
- dd:DragDrop.SelectDroppedItems="True"
- dd:DragDrop.DropHandler="{Binding dropHandler}"
- RowDetailsVisibilityMode="Collapsed"
- ItemsSource="{Binding Datasource}">
-
- <DataGrid.RowDetailsTemplate>
- <DataTemplate>
- <DataGrid Style="{StaticResource DefaultDataGrid}"
- HeadersVisibility="None"
- ItemsSource="{Binding Children}">
- <DataGrid.Columns>
- <DataGridTemplateColumn Header="#" CanUserResize="False">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Converter={StaticResource rowNumber},
-RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow},AncestorLevel=1}}"/>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
-
- <DataGridTextColumn Header="鍚嶇О" Width="{Binding ElementName=nameCol,Path=Width}"
- Binding="{Binding Name}"></DataGridTextColumn>
- </DataGrid.Columns>
- </DataGrid>
- </DataTemplate>
- </DataGrid.RowDetailsTemplate>
-
-
- --><!--<DataGrid.GroupStyle>
- -->
- <!-- Style for groups at top level. -->
- <!--
- <GroupStyle>
- <GroupStyle.ContainerStyle>
- <Style TargetType="{x:Type GroupItem}">
- <Setter Property="Margin" Value="0,0,0,5"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type GroupItem}">
- <Expander IsExpanded="True" Background="Pink" BorderBrush="Pink" BorderThickness="1,1,1,5">
- <Expander.Header>
- <DockPanel>
- <TextBlock FontWeight="Bold" Text="{Binding Path=Name}" Margin="5,0,0,0" Width="100"/>
- <TextBlock FontWeight="Bold" Text="{Binding Path=ItemCount}"/>
- </DockPanel>
- </Expander.Header>
- <Expander.Content>
- <ItemsPresenter />
- </Expander.Content>
- </Expander>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </GroupStyle.ContainerStyle>
- </GroupStyle>
- -->
- <!-- Style for groups under the top level. -->
- <!--
- <GroupStyle>
- <GroupStyle.HeaderTemplate>
- <DataTemplate>
- <DockPanel Background="LightBlue">
- <TextBlock Text="{Binding Path=Name}" Foreground="Blue" Margin="30,0,0,0" Width="100"/>
- <TextBlock Text="{Binding Path=ItemCount}" Foreground="Blue"/>
- </DockPanel>
- </DataTemplate>
- </GroupStyle.HeaderTemplate>
- </GroupStyle>
- </DataGrid.GroupStyle>--><!--
-
- <DataGrid.Columns>
- <DataGridTemplateColumn Header="#" x:Name="numCol" CanUserResize="False">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Converter={StaticResource rowNumber},
-RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow},AncestorLevel=1}}"/>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
-
- <DataGridTextColumn Header="鍚嶇О" x:Name="nameCol" Binding="{Binding Name}"></DataGridTextColumn>
- <DataGridTextColumn Header="娴嬭瘯椤�" Binding="{Binding Item}"></DataGridTextColumn>
- <DataGridTextColumn Header="涓婇檺" Binding="{Binding LimitUp}"></DataGridTextColumn>
- <DataGridTextColumn Header="涓嬮檺" Binding="{Binding LimitDown}"></DataGridTextColumn>
- <DataGridTextColumn Header="鍗曚綅" Binding="{Binding Unit}"></DataGridTextColumn>
- <DataGridTextColumn Header="鍚敤" Binding="{Binding IsEnable}"></DataGridTextColumn>
- <DataGridTextColumn Header="MES涓婁紶" Binding="{Binding IsUploadMes}"></DataGridTextColumn>
- <DataGridTextColumn Header="閲嶆祴" Binding="{Binding IsRetest}"></DataGridTextColumn>
- --><!--<DataGridTextColumn Header="涓嬩竴姝�" Binding="{Binding NextSeq}"></DataGridTextColumn>--><!--
-
- <DataGridTemplateColumn x:Name="opt" Width="*" Header="鎿嶄綔">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal">
- <Button Style="{StaticResource EditLink}" Margin="0,0,20,0"/>
- <Button Style="{StaticResource DeleteLink}"/>
- <Button Style="{StaticResource DeleteLink}" Click="Button_Click"
- DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor,
- AncestorType=DataGridRow,AncestorLevel=1}}"
- Tag="{Binding }"
- x:Name="sda"
- Content="灞曞紑"/>
- </StackPanel>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- </DataGrid.Columns>
- </DataGrid>-->
- </Grid>
- </Border>
-</hb:PluginControl>
diff --git a/Plugin.TestBuilder/TestBuilder.xaml.cs b/Plugin.TestBuilder/TestBuilder.xaml.cs
deleted file mode 100644
index 498846c..0000000
--- a/Plugin.TestBuilder/TestBuilder.xaml.cs
+++ /dev/null
@@ -1,237 +0,0 @@
-锘縰sing GongSolutions.Wpf.DragDrop;
-using GongSolutions.Wpf.DragDrop.Utilities;
-using HMI.Base;
-using HMI.UI;
-using Plugin.TestBuilder.Entity;
-using Plugin.TestBuilder.Model;
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-
-namespace Plugin.TestBuilder
-{
- public class TestHandler : DefaultDropHandler
- {
- /// <summary>
- /// Test the specified drop information for the right data.
- /// </summary>
- /// <param name="dropInfo">The drop information.</param>
- private bool CanDrop(IDropInfo dropInfo)
- {
- if (dropInfo?.DragInfo == null)
- {
- return false;
- }
-
- if (!dropInfo.IsSameDragDropContextAsSource)
- {
- return false;
- }
-
- // do not drop on itself
- var isTreeViewItem = dropInfo.InsertPosition.HasFlag(RelativeInsertPosition.TargetItemCenter)
- && dropInfo.VisualTargetItem is TreeViewItem;
- if (isTreeViewItem && dropInfo.VisualTargetItem == dropInfo.DragInfo.VisualSourceItem)
- {
- return false;
- }
-
- if (dropInfo.TargetCollection is null)
- {
- return false;
- }
-
- if (ReferenceEquals(dropInfo.DragInfo.SourceCollection, dropInfo.TargetCollection))
- {
- var dragData = dropInfo.DragInfo?.Data as TreeItemData;
- var dropData = dropInfo.Data as TreeItemData;
- if (dragData == null || dropData == null)
- {
- return false;
- }
- if (dropData.ParentItem != dragData.ParentItem)
- {
- return false;
- }
-
- var targetList = dropInfo.TargetCollection.TryGetList();
- return targetList != null;
- }
-
- if (TestCompatibleTypes(dropInfo.TargetCollection, dropInfo.Data))
- {
- var isChildOf = IsChildOf(dropInfo.VisualTargetItem, dropInfo.DragInfo.VisualSourceItem);
- return !isChildOf;
- }
-
- return false;
- }
-
- public bool CanConvert(IDropInfo dropInfo)
- {
- bool InterfaceFilter(Type t, object o) => (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(IEnumerable<>));
- Type[] enumerableInterfaces = dropInfo.TargetCollection.GetType().FindInterfaces(InterfaceFilter, null);
- var enumerableTypes = from i in enumerableInterfaces
- select i.GetGenericArguments().Single();
-
- if (enumerableTypes.Any())
- {
- Type dataType = TypeUtilities.GetCommonBaseClass(ExtractData(dropInfo.Data));
- return dataType == typeof(FuncModel) && enumerableTypes.Any(t => t == typeof(Step));
- }
-
- return false;
- }
-
- public Step ConvertFunc2Step(FuncModel func)
- {
- return new Step
- {
- Name = func.Name
- };
- }
-
- public override void DragOver(IDropInfo dropInfo)
- {
- if (CanAcceptData(dropInfo))
- {
- base.DragOver(dropInfo);
- }
- else if (CanConvert(dropInfo))
- {
- // 鍥哄畾Copy
- dropInfo.Effects = DragDropEffects.Copy;
- var isTreeViewItem = dropInfo.InsertPosition.HasFlag(RelativeInsertPosition.TargetItemCenter) && dropInfo.VisualTargetItem is TreeViewItem;
- dropInfo.DropTargetAdorner = isTreeViewItem ? DropTargetAdorners.Highlight : DropTargetAdorners.Insert;
- }
- }
-
- public override void Drop(IDropInfo dropInfo)
- {
- if (CanDrop(dropInfo))
- {
- base.Drop(dropInfo);
- }
- else if (CanConvert(dropInfo))
- {
- int insertIndex = GetInsertIndex(dropInfo);
- var destinationList = dropInfo.TargetCollection.TryGetList();
- var data = ExtractData(dropInfo.Data).OfType<object>().ToList();
-
- if (destinationList != null)
- {
- var objects2Insert = new List<object>();
-
- foreach (var o in data)
- {
- var obj2Insert = ConvertFunc2Step(o as FuncModel);
-
- objects2Insert.Add(obj2Insert);
-
- destinationList.Insert(insertIndex++, obj2Insert);
- // 涓嬫柟瀵硅薄濡傛灉瀹炵幇浜� IDragItemSource 鎺ュ彛锛屼細鍦ㄨ繖閲岃皟鐢� ItemDropped 鏂规硶锛岀畻鏄悗缃鐞�
- if (obj2Insert is IDragItemSource dragItemSource)
- {
- dragItemSource.ItemDropped(dropInfo);
- }
- }
-
- SelectDroppedItems(dropInfo, objects2Insert);
- }
- }
-
- }
-
- }
-
- /// <summary>
- /// WorkControl.xaml 鐨勪氦浜掗�昏緫
- /// </summary>
- public partial class TestBuilder : PluginControl
- {
- public TestBuilder()
- {
- DataContext = this;
- InitializeComponent();
- Loaded += UserControl_Loaded;
- }
- public IDropTarget dropHandler { get; set; } = new TestHandler();
-
- private ObservableCollection<SeqData> datasource = new ObservableCollection<SeqData>() {
- new SeqData{ Name="test",Children = new ObservableCollection<SeqData>{
- new SeqData{ Name="CCC"}
- } }
- };
-
- public ObservableCollection<SeqData> Datasource
- {
- get => datasource;
- set { Set(ref datasource, value); }
- }
-
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- Button btn = sender as Button;
- switch (btn.Name)
- {
- case "addBtn":
- Datasource.Add(new SeqData());
- break;
- case "sda":
- DataGridRow s = (DataGridRow)btn.DataContext;
- SeqData data = s.Item as SeqData;
- data.Children.Add(new SeqData { Name = "CCC" });
-
- s.DetailsVisibility =
- s.DetailsVisibility == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible;
- break;
- default:
- break;
- }
- }
-
- private void UserControl_Loaded(object sender, RoutedEventArgs e)
- {
- SizeChanged += WorkControl_SizeChanged;
- Loaded -= UserControl_Loaded;
- }
-
- /// <summary>
- /// 閲嶈澶у皬
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void WorkControl_SizeChanged(object sender, SizeChangedEventArgs e)
- {
-
- }
-
- /// <summary>
- /// 鏍戞暟鎹睍绀鸿繃婊�
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void CollectionViewSource_Filter(object sender, FilterEventArgs e)
- {
- if (e.Item is TreeItemData data)
- {
- e.Accepted = data.IsVisible;
- }
- }
-
- /// <summary>
- /// 鏍戝睍寮�/鍏抽棴浜嬩欢
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void treeDataGrid_ExpandedChange(object sender, bool e)
- {
- CollectionViewSource cvs = this.Resources["TreeGridFilter"] as CollectionViewSource;
- cvs?.View.Refresh();
- }
- }
-}
\ No newline at end of file
diff --git a/Plugin.TestBuilder/UI/BottomBar.xaml b/Plugin.TestBuilder/UI/BottomBar.xaml
deleted file mode 100644
index 7116db2..0000000
--- a/Plugin.TestBuilder/UI/BottomBar.xaml
+++ /dev/null
@@ -1,15 +0,0 @@
-锘�<UserControl x:Class="Plugin.TestBuilder.UI.BottomBar"
- 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:Plugin.TestBuilder.UI"
- mc:Ignorable="d"
- d:DesignHeight="30" d:DesignWidth="800">
- <ScrollViewer HorizontalScrollBarVisibility="Auto" Background="Transparent" VerticalScrollBarVisibility="Hidden">
- <StackPanel x:Name="stackPanel" Orientation="Horizontal" HorizontalAlignment="Stretch">
-
- </StackPanel>
- </ScrollViewer>
-
-</UserControl>
diff --git a/Plugin.TestBuilder/UI/BottomBar.xaml.cs b/Plugin.TestBuilder/UI/BottomBar.xaml.cs
deleted file mode 100644
index dfa725f..0000000
--- a/Plugin.TestBuilder/UI/BottomBar.xaml.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-锘縰sing System.Windows;
-using System.Windows.Controls;
-
-namespace Plugin.TestBuilder.UI
-{
- /// <summary>
- /// BottomBar.xaml 鐨勪氦浜掗�昏緫
- /// </summary>
- public partial class BottomBar : UserControl
- {
- public BottomBar()
- {
- Visibility = Visibility.Collapsed;
- InitializeComponent();
- }
-
- public void AddMinWindow(MinInnerWindow min)
- {
- stackPanel.Children.Add(min);
- Visibility = Visibility.Visible;
- }
-
- public void RemoveMinWindow(MinInnerWindow min)
- {
- stackPanel.Children.Remove(min);
- Visibility = stackPanel.Children.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
- }
- }
-}
diff --git a/Plugin.TestBuilder/UI/DdDragHandler.cs b/Plugin.TestBuilder/UI/DdDragHandler.cs
deleted file mode 100644
index cbf479a..0000000
--- a/Plugin.TestBuilder/UI/DdDragHandler.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-锘縰sing GongSolutions.Wpf.DragDrop;
-using Plugin.TestBuilder.Model;
-
-namespace Plugin.TestBuilder.UI
-{
- public class DdDragHandler : DefaultDragHandler
- {
- public override bool CanStartDrag(IDragInfo dragInfo)
- {
- FuncModel model = dragInfo.SourceItem as FuncModel;
- return model.Children ==null || model.Children.Count == 0;
- }
- }
-}
diff --git a/Plugin.TestBuilder/UI/DdDropHandler.cs b/Plugin.TestBuilder/UI/DdDropHandler.cs
deleted file mode 100644
index 3ee87bf..0000000
--- a/Plugin.TestBuilder/UI/DdDropHandler.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-锘縰sing GongSolutions.Wpf.DragDrop;
-using GongSolutions.Wpf.DragDrop.Utilities;
-using Plugin.TestBuilder.Model;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Windows;
-using System.Windows.Controls;
-
-namespace Plugin.TestBuilder.UI
-{
- public class DdDropHandler : DefaultDropHandler
- {
- public bool CanConvert(IDropInfo dropInfo)
- {
- bool InterfaceFilter(Type t, object o) => (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(IEnumerable<>));
- Type[] enumerableInterfaces = dropInfo.TargetCollection.GetType().FindInterfaces(InterfaceFilter, null);
- var enumerableTypes = from i in enumerableInterfaces
- select i.GetGenericArguments().Single();
-
- if (enumerableTypes.Any())
- {
- Type dataType = TypeUtilities.GetCommonBaseClass(ExtractData(dropInfo.Data));
- return dataType == typeof(FuncModel) && enumerableTypes.Any(t => t==typeof(Step));
- }
-
- return false;
- }
-
- public Step ConvertFunc2Step(FuncModel func) {
- return new Step
- {
- Name = func.Name
- };
- }
-
-
-
- public override void DragOver(IDropInfo dropInfo)
- {
- if (CanAcceptData(dropInfo))
- {
- base.DragOver(dropInfo);
- }
- else if (CanConvert(dropInfo))
- {
- // 鍥哄畾Copy
- dropInfo.Effects = DragDropEffects.Copy;
- var isTreeViewItem = dropInfo.InsertPosition.HasFlag(RelativeInsertPosition.TargetItemCenter) && dropInfo.VisualTargetItem is TreeViewItem;
- dropInfo.DropTargetAdorner = isTreeViewItem ? DropTargetAdorners.Highlight : DropTargetAdorners.Insert;
- }
- }
-
- public override void Drop(IDropInfo dropInfo)
- {
- if (CanAcceptData(dropInfo))
- {
- base.Drop(dropInfo);
- }
- else if (CanConvert(dropInfo))
- {
- int insertIndex = GetInsertIndex(dropInfo);
- var destinationList = dropInfo.TargetCollection.TryGetList();
- var data = ExtractData(dropInfo.Data).OfType<object>().ToList();
-
- if (destinationList != null)
- {
- var objects2Insert = new List<object>();
-
- foreach (var o in data)
- {
- var obj2Insert = ConvertFunc2Step(o as FuncModel);
-
- objects2Insert.Add(obj2Insert);
-
- destinationList.Insert(insertIndex++, obj2Insert);
- // 涓嬫柟瀵硅薄濡傛灉瀹炵幇浜� IDragItemSource 鎺ュ彛锛屼細鍦ㄨ繖閲岃皟鐢� ItemDropped 鏂规硶锛岀畻鏄悗缃鐞�
- if (obj2Insert is IDragItemSource dragItemSource)
- {
- dragItemSource.ItemDropped(dropInfo);
- }
- }
-
- SelectDroppedItems(dropInfo, objects2Insert);
- }
- }
-
- }
-
- }
-}
diff --git a/Plugin.TestBuilder/UI/InnerWindow.xaml b/Plugin.TestBuilder/UI/InnerWindow.xaml
deleted file mode 100644
index 79c530b..0000000
--- a/Plugin.TestBuilder/UI/InnerWindow.xaml
+++ /dev/null
@@ -1,65 +0,0 @@
-锘�<UserControl x:Class="HMI.UI.InnerWindow"
- 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:HMI.UI"
- mc:Ignorable="d"
- HorizontalAlignment="Stretch"
- HorizontalContentAlignment="Stretch"
- MouseLeftButtonDown="Grid_MouseLeftButtonDown"
- Background="#FFF"
- Focusable="True">
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="/HMI.UI;component/Style/colors.xaml"/>
- <ResourceDictionary Source="/HMI.UI;component/Style/WindowResources.xaml"/>
- </ResourceDictionary.MergedDictionaries>
-
- <Style x:Key="SliderThumbStyle" TargetType="{x:Type Thumb}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate>
- <Label VerticalContentAlignment="Center"
- Foreground="{Binding HeaderFontColor}" Content="{Binding Title}"/>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
- </UserControl.Resources>
-
- <UserControl.Template>
- <ControlTemplate TargetType="local:InnerWindow">
- <AdornerDecorator x:Name="PART_Adorner" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
- <Grid GotFocus="Grid_GotFocus">
- <Grid.RowDefinitions>
- <RowDefinition Height="30"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
-
- <Grid Background="{StaticResource ReVerBar}">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="Auto"/>
- </Grid.ColumnDefinitions>
-
- <Thumb Style="{StaticResource SliderThumbStyle}" Grid.Column="0" x:Name="thumb1" DragDelta="DragDelta"
- DragStarted="DragStarted" DragCompleted="DragCompleted"/>
-
- <StackPanel Grid.Column="1" Orientation="Horizontal">
- <Button Style="{StaticResource ChildWindowButton}" Background="Transparent" Click="Min_Click"></Button>
- <Button Style="{StaticResource ChildWindowButton}" Background="Transparent" Click="Max_Click" ></Button>
- <!--<Button Style="{StaticResource ChildWindowCloseButton}" Background="Transparent" Click="CLose_Click"></Button>-->
- </StackPanel>
- </Grid>
-
- <Border Grid.Row="1" Background="LightGray" VerticalAlignment="Stretch" BorderThickness="2,0,2,2" BorderBrush="{Binding HeaderBackground}">
- <ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Stretch"></ContentPresenter>
- </Border>
- </Grid>
- </AdornerDecorator>
- </ControlTemplate>
- </UserControl.Template>
-</UserControl>
\ No newline at end of file
diff --git a/Plugin.TestBuilder/UI/InnerWindow.xaml.cs b/Plugin.TestBuilder/UI/InnerWindow.xaml.cs
deleted file mode 100644
index 54edb24..0000000
--- a/Plugin.TestBuilder/UI/InnerWindow.xaml.cs
+++ /dev/null
@@ -1,262 +0,0 @@
-锘縰sing Plugin.TestBuilder.Entity;
-using System;
-using System.ComponentModel;
-using System.Runtime.CompilerServices;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-
-namespace HMI.UI
-{
- /// <summary>
- /// InnerWindow.xaml 鐨勪氦浜掗�昏緫
- /// </summary>
- public partial class InnerWindow : UserControl, INotifyPropertyChanged
- {
- #region INotifyPropertyChanged
- public virtual event PropertyChangedEventHandler PropertyChanged;
-
- protected virtual void RaisePropertyChanged(string name)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
- }
-
- protected void RaiseAndSetIfChanged<T>(ref T old, T @new, [CallerMemberName] string propertyName = null)
- {
- old = @new;
- if (propertyName != null)
- {
- RaisePropertyChanged(propertyName);
- }
- }
- #endregion
-
- #region 灞炴��
-
- #region Common
- public DragType DragType { get; set; } = DragType.Canvas;
- public CanvasPosition canvasPosition;
- private Canvas canvas;
- public WindowState WindowState { get; set; } = WindowState.Normal;
- public AdornerDecorator ResizeAdornerDecorator
- {
- get
- {
- return this.Template.FindName("PART_Adorner", this) as AdornerDecorator;
- }
- }
-
- private string _Title;
- public string Title
- {
- get { return _Title; }
- set => RaiseAndSetIfChanged(ref _Title, value);
- }
-
- public int Zindex
- {
- get
- {
- return Canvas.GetZIndex(this);
- }
- set
- {
- Canvas.SetZIndex(this, value);
- }
- }
- #endregion
-
- #region 浜嬩欢
- public event EventHandler MinEvent;
- public event EventHandler MaxEvent;
- public event EventHandler CloseEvent;
- public event EventHandler ZIndexEvent;
- #endregion
-
- #region DependencyProperty
- public Brush HeaderBackground
- {
- get { return (Brush)GetValue(HeaderBackgroundProperty); }
- set { SetValue(HeaderBackgroundProperty, value); }
- }
-
- public static readonly DependencyProperty HeaderBackgroundProperty =
- DependencyProperty.Register("HeaderBackground", typeof(Brush), typeof(InnerWindow),
- new PropertyMetadata(new SolidColorBrush(Color.FromRgb(54, 146, 225))));
-
- public Brush HeaderFontColor
- {
- get { return (Brush)GetValue(HeaderFontColorProperty); }
- set { SetValue(HeaderFontColorProperty, value); }
- }
-
- public static readonly DependencyProperty HeaderFontColorProperty =
- DependencyProperty.Register("HeaderFontColor", typeof(Brush), typeof(InnerWindow),
- new PropertyMetadata(new SolidColorBrush(Color.FromRgb(255, 255, 225))));
- #endregion
-
- #endregion
-
- public InnerWindow() : this(null)
- {
-
- }
-
- public InnerWindow(CanvasPosition canvasPosition)
- {
- this.canvasPosition = canvasPosition;
- if (canvasPosition != null)
- {
- Width = canvasPosition.Width;
- Height = canvasPosition.Height;
- }
-
- DataContext = this;
- InitializeComponent();
- Loaded += InnerWindow_Loaded;
- }
-
- private void InnerWindow_Loaded(object sender, RoutedEventArgs e)
- {
- if (canvasPosition == null)
- {
- canvasPosition = new CanvasPosition
- {
- Left = Canvas.GetLeft(this),
- Top = Canvas.GetTop(this),
- Width = ActualWidth,
- Height = ActualHeight
- };
- }
- Loaded -= InnerWindow_Loaded;
- }
-
- #region 鎷栨嫿绉诲姩鐩稿叧
- private void DragDelta(object sender, System.Windows.Controls.Primitives.DragDeltaEventArgs e)
- {
- switch (DragType)
- {
- case DragType.Canvas:
- {
- double offsetX = e.HorizontalChange;
- double offsetY = e.VerticalChange;
-
- Width = ActualWidth > canvas.ActualWidth ? canvas.ActualWidth : Width;
- Height = ActualHeight > canvas.ActualHeight ? canvas.ActualHeight : Height;
-
- double newLeft = Canvas.GetLeft(this) + e.HorizontalChange;
- newLeft = newLeft < 0 ? 0 : newLeft;
-
-
- double newTop = Canvas.GetTop(this) + e.VerticalChange;
- newTop = newTop < 0 ? 0 : newTop;
-
- double fixLeft = canvasPosition == null || canvasPosition.LimitWidth <= 0 ? ActualWidth : canvasPosition.LimitWidth;
- double fixTop = canvasPosition == null || canvasPosition.LimitHeight <= 0 ? ActualHeight : canvasPosition.LimitHeight;
-
- if (canvas != null)
- {
- newLeft = offsetX > 0 && newLeft > canvas.ActualWidth - fixLeft ? canvas.ActualWidth - fixLeft : newLeft;
- newTop = offsetY > 0 && newTop > canvas.ActualHeight - fixTop ? canvas.ActualHeight - fixTop : newTop;
- }
-
- Canvas.SetLeft(this, newLeft);
- Canvas.SetTop(this, newTop);
- break;
- }
- }
- }
-
- private void DragStarted(object sender, System.Windows.Controls.Primitives.DragStartedEventArgs e)
- {
- ZIndexEvent?.Invoke(this, null);
- // thumb1.Background = Brushes.White;
- }
-
- private void DragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e)
- {
- canvasPosition.Top = Canvas.GetTop(this);
- canvasPosition.Left = Canvas.GetLeft(this);
- }
- #endregion
-
- /// <summary>
- /// 娣诲姞鍒扮敾甯冧笂
- /// </summary>
- /// <param name="canvas"></param>
- public void AttachToCanvas(Canvas canvas)
- {
- if (true)
- {
- Resize.SetIsResizeable(this, true);
- }
- canvas.Children.Add(this);
- this.canvas = canvas;
- if (ActualWidth < MinWidth)
- {
- Width = MinWidth;
- }
- if (ActualHeight < MinHeight)
- {
- Height = MinHeight;
- }
- Canvas.SetLeft(this, canvasPosition == null ? 0 : canvasPosition.Left);
- Canvas.SetTop(this, canvasPosition == null ? 0 : canvasPosition.Top);
- canvas.SizeChanged += Canvas_SizeChanged;
- }
-
- private void Canvas_SizeChanged(object sender, SizeChangedEventArgs e)
- {
- Size newSize = e.NewSize;
- Size previousSize = e.PreviousSize;
-
- double xRate = newSize.Width / previousSize.Width;
- double yRate = newSize.Height / previousSize.Height;
-
- Canvas.SetLeft(this, Canvas.GetLeft(this) * xRate);
- Canvas.SetTop(this, Canvas.GetTop(this) * yRate);
- this.Width = this.Width * xRate;
- this.Height = this.Height * yRate;
- }
-
- private void Min_Click(object sender, RoutedEventArgs e)
- {
- MinEvent?.Invoke(this, null);
- }
-
- private void Max_Click(object sender, RoutedEventArgs e)
- {
- MaxEvent?.Invoke(this, null);
- }
-
- private void CLose_Click(object sender, RoutedEventArgs e)
- {
-
- }
-
- private void Grid_GotFocus(object sender, RoutedEventArgs e)
- {
-
- }
-
- private void Grid_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
- {
- this.Focus();
- }
-
- private void UserControl_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
- {
-
- }
- }
-
- public enum DragType
- {
- Canvas = 0,
- Dock = 1
- }
-
-}
-
diff --git a/Plugin.TestBuilder/UI/MinInnerWindow.xaml b/Plugin.TestBuilder/UI/MinInnerWindow.xaml
deleted file mode 100644
index 426b353..0000000
--- a/Plugin.TestBuilder/UI/MinInnerWindow.xaml
+++ /dev/null
@@ -1,24 +0,0 @@
-锘�<UserControl x:Class="Plugin.TestBuilder.UI.MinInnerWindow"
- 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:Plugin.TestBuilder.UI"
- mc:Ignorable="d"
- Height="30"
- d:DesignHeight="450" d:DesignWidth="800">
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="/HMI.UI;component/Style/colors.xaml"/>
- <ResourceDictionary Source="/HMI.UI;component/Style/WindowResources.xaml"/>
- </ResourceDictionary.MergedDictionaries>
- </ResourceDictionary>
- </UserControl.Resources>
-
- <StackPanel Background="{StaticResource VerBar}" Orientation="Horizontal">
- <Label BorderBrush="{StaticResource PrimaryColor}" Foreground="#FFF" BorderThickness="2,0,0,0" VerticalContentAlignment="Center" ToolTip="{Binding Title}" Content="{Binding Title}"/>
- <Button Style="{StaticResource ChildWindowButton}" Background="Transparent" Click="Max_Click" ></Button>
- <!--<Button Style="{StaticResource ChildWindowCloseButton}" Click="CLose_Click"></Button>-->
- </StackPanel>
-</UserControl>
diff --git a/Plugin.TestBuilder/UI/MinInnerWindow.xaml.cs b/Plugin.TestBuilder/UI/MinInnerWindow.xaml.cs
deleted file mode 100644
index 459dfc4..0000000
--- a/Plugin.TestBuilder/UI/MinInnerWindow.xaml.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-锘縰sing System;
-using System.Windows.Controls;
-
-namespace Plugin.TestBuilder.UI
-{
- /// <summary>
- /// MinInnerWindow.xaml 鐨勪氦浜掗�昏緫
- /// </summary>
- public partial class MinInnerWindow : UserControl
- {
- public event EventHandler MaxEvent;
- public event EventHandler CloseEvent;
- public InnerWindow Inner { get; set; }
-
- public string Title
- {
- get => Inner == null ? null : Inner.Title;
- }
-
- public MinInnerWindow() : this(null)
- {
-
- }
-
- public MinInnerWindow(InnerWindow inner)
- {
- DataContext = this;
- Inner = inner;
- InitializeComponent();
- }
-
- private void Max_Click(object sender, System.Windows.RoutedEventArgs e)
- {
- MaxEvent?.Invoke(this, null);
- }
-
- private void CLose_Click(object sender, System.Windows.RoutedEventArgs e)
- {
- CloseEvent?.Invoke(this, null);
- }
- }
-}
diff --git a/Plugin.TestBuilder/UI/Resize.cs b/Plugin.TestBuilder/UI/Resize.cs
deleted file mode 100644
index de8812a..0000000
--- a/Plugin.TestBuilder/UI/Resize.cs
+++ /dev/null
@@ -1,625 +0,0 @@
-锘縰sing HMI.UI.DpUtil;
-using System;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Controls.Primitives;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Shapes;
-
-namespace HMI.UI
-{
- public class Resize
- {
- private static readonly double MinWidth = 60;
- private static readonly double MinHeight = 60;
-
- public static double GetReMaxWidth(DependencyObject obj)
- {
- return (double)obj.GetValue(ReMaxWithProperty);
- }
- public static void SetReMaxWidth(DependencyObject obj, double value)
- {
- obj.SetValue(ReMaxWithProperty, value);
- }
- public static readonly DependencyProperty ReMaxWithProperty =
- DependencyProperty.RegisterAttached("ReMaxWith", typeof(double), typeof(Resize), new PropertyMetadata(0.0));
-
-
- // 鎷栨嫿妯℃澘
- public static ControlTemplate GetResizeTemplate(DependencyObject obj)
- {
- return (ControlTemplate)obj.GetValue(ResizeTemplateProperty);
- }
-
- public static void SetResizeTemplate(DependencyObject obj, ControlTemplate value)
- {
- obj.SetValue(ResizeTemplateProperty, value);
- }
-
- public static readonly DependencyProperty ResizeTemplateProperty =
- DependencyProperty.RegisterAttached("ResizeTemplate", typeof(ControlTemplate), typeof(Resize), new PropertyMetadata(null, (d, e) =>
- {
- FrameworkElement element = d as FrameworkElement;
- if (element == null) return;
- Resizeable resize = GetResizeable(element);
- if (resize == null) return;
- resize.Detach();
- resize.Attach();
- }));
-
- // 鏄惁鍙互鎷栨嫿鏀瑰彉澶у皬
- public static bool GetIsResizeable(DependencyObject obj)
- {
- return (bool)obj.GetValue(IsResizeableProperty);
- }
- public static void SetIsResizeable(DependencyObject obj, bool value)
- {
- obj.SetValue(IsResizeableProperty, value);
- }
- public static readonly DependencyProperty IsResizeableProperty =
- DependencyProperty.RegisterAttached("IsResizeable", typeof(bool), typeof(Resize), new PropertyMetadata(false, (d, e) =>
- {
- FrameworkElement element = d as FrameworkElement;
- if (element == null) return;
- // 鍏堝彇娑堜箣鍓嶇殑鎷栨嫿瑁呴グ
- Resizeable resize = GetResizeable(element);
- if (resize != null) resize.Detach();
- // 瀹炵幇閫昏緫
- // 鍒ゆ柇灞炴�ц缃殑鏄笉鏄痶rue
- if (!(bool)e.NewValue)
- {
- SetResizeable(element, null);
- return;
- }
-
- if (!element.IsLoaded)
- {
- RoutedEventHandler Loaded_Resize = null;
- Loaded_Resize = (sender, e1) =>
- {
- FrameworkElement senderElement = sender as FrameworkElement;
- Resizeable r = new Resizeable(senderElement);
- r.Attach();
- SetResizeable(senderElement, r);
- senderElement.Loaded -= Loaded_Resize;
- };
- element.Loaded += Loaded_Resize;
- }
- else
- {
- resize = new Resizeable(element);
- resize.Attach();
- SetResizeable(element, resize);
- }
- }));
-
- public static Resizeable GetResizeable(DependencyObject obj)
- {
- return (Resizeable)obj.GetValue(ResizeableProperty);
- }
-
- public static void SetResizeable(DependencyObject obj, Resizeable value)
- {
- obj.SetValue(ResizeableProperty, value);
- }
-
- // Using a DependencyProperty as the backing store for Resizeable. This enables animation, styling, binding, etc...
- static readonly DependencyProperty ResizeableProperty =
- DependencyProperty.RegisterAttached("Resizeable", typeof(Resizeable), typeof(Resize), new PropertyMetadata(null));
-
- static int i = 0;
- static SolidColorBrush[] colors = new SolidColorBrush[] {
- new SolidColorBrush(Colors.White),
- new SolidColorBrush(Colors.Red),
- new SolidColorBrush(Colors.Blue),
- new SolidColorBrush(Colors.Green),
- new SolidColorBrush(Colors.LightBlue),
- new SolidColorBrush(Colors.Orange),
- new SolidColorBrush(Colors.Yellow),
- new SolidColorBrush(Colors.Black),
- };
-
- public class Resizeable
- {
- ResizeType _resizeType;
- enum ResizeType
- {
- None,
- Grid,
- Canvas,
- Window,
- Others,
- }
- FrameworkElement _resizeTarget;
-
- FrameworkElement _thumbsParent = null;
- public Resizeable(FrameworkElement resizeTarget)
- {
- _resizeTarget = resizeTarget;
- }
-
- public void Attach()
- {
- FrameworkElement thumbsRoot = null;
- ControlTemplate template = GetResizeTemplate(_resizeTarget);
- // 鐪嬩笉鎳備簡锛屽ぇ姒傛槸鎷栨嫿妯℃澘
- if (template != null)
- {
- Control control = new Control();
- control.Template = template;
- control.ApplyTemplate();
- thumbsRoot = control;
- _thumbsParent = VisualTreeHelper.GetChild(thumbsRoot, 0) as FrameworkElement;
- }
-
- if (thumbsRoot != null)
- {
- UIElement element = _resizeTarget is Window _windowTarget ? _windowTarget.Content as UIElement : _resizeTarget;
- if (element != null)
- {
- if (element is InnerWindow _inner)
- {
- AdornerLayer layer = _inner.ResizeAdornerDecorator.AdornerLayer;
- if (layer == null)
- throw new Exception("鑾峰彇鎺т欢瑁呴グ灞傚け璐ワ紝鎺т欢鍙兘娌℃湁瑁呴グ灞傦紒");
- layer.Add(new ResizeAdorner(layer, thumbsRoot));
- }
- else
- {
- AdornerLayer layer = AdornerLayer.GetAdornerLayer(element);
- if (layer == null)
- throw new Exception("鑾峰彇鎺т欢瑁呴グ灞傚け璐ワ紝鎺т欢鍙兘娌℃湁瑁呴グ灞傦紒");
- layer.Add(new ResizeAdorner(element, thumbsRoot));
- }
- }
- }
-
- // 浣跨敤缂虹渷鏍峰紡
- if (thumbsRoot == null)
- {
- Thumb leftThumb = null, topThumb = null, rightThumb = null, bottomThumb = null,
- lefTopThumb = null, rightTopThumb = null, rightBottomThumb = null, leftbottomThumb = null;
- int thumnSize = 5;
- // 鍒濆鍖杢humb
- leftThumb = new Thumb();
- leftThumb.Template = new ControlTemplate(typeof(Thumb))
- {
- VisualTree = GetFactory(new SolidColorBrush(Colors.Transparent))
- };
- leftThumb.HorizontalAlignment = HorizontalAlignment.Left;
- leftThumb.VerticalAlignment = VerticalAlignment.Stretch;
- leftThumb.Cursor = Cursors.SizeWE;
- leftThumb.Width = thumnSize;
- leftThumb.Height = double.NaN;
- leftThumb.Margin = new Thickness(0, thumnSize, 0, thumnSize);
-
- topThumb = new Thumb();
- topThumb.Template = new ControlTemplate(typeof(Thumb))
- {
- VisualTree = GetFactory(new SolidColorBrush(Colors.Transparent))
- };
- topThumb.HorizontalAlignment = HorizontalAlignment.Stretch;
- topThumb.VerticalAlignment = VerticalAlignment.Top;
- topThumb.Cursor = Cursors.SizeNS;
- topThumb.Width = double.NaN;
- topThumb.Height = thumnSize;
- topThumb.Margin = new Thickness(thumnSize, 0, thumnSize, 0);
-
- rightThumb = new Thumb();
- rightThumb.Template = new ControlTemplate(typeof(Thumb))
- {
- VisualTree = GetFactory(new SolidColorBrush(Colors.Transparent))
- };
- rightThumb.HorizontalAlignment = HorizontalAlignment.Right;
- rightThumb.VerticalAlignment = VerticalAlignment.Stretch;
- rightThumb.Cursor = Cursors.SizeWE;
- rightThumb.Width = thumnSize;
- rightThumb.Height = double.NaN;
- rightThumb.Margin = new Thickness(0, thumnSize, 0, thumnSize);
-
- bottomThumb = new Thumb();
- bottomThumb.Template = new ControlTemplate(typeof(Thumb))
- {
- VisualTree = GetFactory(new SolidColorBrush(Colors.Transparent))
- };
- bottomThumb.HorizontalAlignment = HorizontalAlignment.Stretch;
- bottomThumb.VerticalAlignment = VerticalAlignment.Bottom;
- bottomThumb.Cursor = Cursors.SizeNS;
- bottomThumb.Width = double.NaN;
- bottomThumb.Height = thumnSize;
- bottomThumb.Margin = new Thickness(thumnSize, 0, thumnSize, 0);
-
- lefTopThumb = new Thumb();
- lefTopThumb.Template = new ControlTemplate(typeof(Thumb))
- {
- VisualTree = GetFactory(new SolidColorBrush(Colors.Transparent))
- };
- lefTopThumb.HorizontalAlignment = HorizontalAlignment.Left;
- lefTopThumb.VerticalAlignment = VerticalAlignment.Top;
- lefTopThumb.Cursor = Cursors.SizeNWSE;
- lefTopThumb.Width = thumnSize;
- lefTopThumb.Height = thumnSize;
-
- rightTopThumb = new Thumb();
- rightTopThumb.Template = new ControlTemplate(typeof(Thumb))
- {
- VisualTree = GetFactory(new SolidColorBrush(Colors.Transparent))
- };
- rightTopThumb.HorizontalAlignment = HorizontalAlignment.Right;
- rightTopThumb.VerticalAlignment = VerticalAlignment.Top;
- rightTopThumb.Cursor = Cursors.SizeNESW;
- rightTopThumb.Width = thumnSize;
- rightTopThumb.Height = thumnSize;
-
- rightBottomThumb = new Thumb();
- rightBottomThumb.Template = new ControlTemplate(typeof(Thumb))
- {
- VisualTree = GetFactory(new SolidColorBrush(Colors.Transparent))
- };
- rightBottomThumb.HorizontalAlignment = HorizontalAlignment.Right;
- rightBottomThumb.VerticalAlignment = VerticalAlignment.Bottom;
- rightBottomThumb.Cursor = Cursors.SizeNWSE;
- rightBottomThumb.Width = thumnSize;
- rightBottomThumb.Height = thumnSize;
-
- leftbottomThumb = new Thumb();
- leftbottomThumb.Template = new ControlTemplate(typeof(Thumb))
- {
- VisualTree = GetFactory(new SolidColorBrush(Colors.Transparent))
- };
- leftbottomThumb.HorizontalAlignment = HorizontalAlignment.Left;
- leftbottomThumb.VerticalAlignment = VerticalAlignment.Bottom;
- leftbottomThumb.Cursor = Cursors.SizeNESW;
- leftbottomThumb.Width = thumnSize;
- leftbottomThumb.Height = thumnSize;
-
-
- Grid grid = new Grid();
- grid.Children.Add(leftThumb);
- grid.Children.Add(topThumb);
- grid.Children.Add(rightThumb);
- grid.Children.Add(bottomThumb);
- grid.Children.Add(lefTopThumb);
- grid.Children.Add(rightTopThumb);
- grid.Children.Add(rightBottomThumb);
- grid.Children.Add(leftbottomThumb);
- UIElement element;
- if (_resizeTarget is Window _resizeTargetWindow)
- {
- element = _resizeTargetWindow.Content as UIElement;
- }
- else
- {
- element = _resizeTarget;
- }
- if (element != null)
- {
- if (element is InnerWindow _inner)
- {
- AdornerLayer layer = _inner.ResizeAdornerDecorator?.AdornerLayer;
- if (layer == null)
- throw new Exception("鑾峰彇鎺т欢瑁呴グ灞傚け璐ワ紝鎺т欢鍙兘娌℃湁瑁呴グ灞傦紒");
- layer.Add(new ResizeAdorner(layer, grid));
- }
- else
- {
- AdornerLayer layer = AdornerLayer.GetAdornerLayer(element);
- if (layer == null)
- throw new Exception("鑾峰彇鎺т欢瑁呴グ灞傚け璐ワ紝鎺т欢鍙兘娌℃湁瑁呴グ灞傦紒");
- layer.Add(new ResizeAdorner(element, grid));
- }
- }
- thumbsRoot = grid;
- _thumbsParent = thumbsRoot;
- }
-
- //娉ㄥ唽浜嬩欢
- for (int i = 0; i < VisualTreeHelper.GetChildrenCount(_thumbsParent); i++)
- {
- Thumb thumb = VisualTreeHelper.GetChild(_thumbsParent, i) as Thumb;
- if (thumb != null)
- {
- thumb.DragStarted += Thumb_DragStarted;
- thumb.DragDelta += Thumb_DragDelta;
- }
- }
- }
- public void Detach()
- {
- for (int i = 0; i < VisualTreeHelper.GetChildrenCount(_thumbsParent); i++)
- {
- Thumb thumb = VisualTreeHelper.GetChild(_thumbsParent, i) as Thumb;
- if (thumb != null)
- {
- thumb.DragStarted -= Thumb_DragStarted;
- thumb.DragDelta -= Thumb_DragDelta;
- }
- }
- _thumbsParent = null;
- }
-
- private void Thumb_DragStarted(object sender, DragStartedEventArgs e)
- {
- _resizeType = GetResizeType();
- if (_resizeType == ResizeType.Canvas && _resizeTarget is InnerWindow _inner)
- {
- Canvas parent = GetCanvas(_inner);
- // 濡傛灉鏄釜InnerWindow锛屽氨鎶奍nnerWindowZIndex缃《
- // TODO 鍙互鏀规垚鎺ュ彛鎴栬�匘ependencyPrope鏉ュ仛
- CanvasHelper.SetTopZIndex(_inner, parent, _inner.GetType());
- }
- }
-
- private void Thumb_DragDelta(object sender, DragDeltaEventArgs e)
- {
- switch (_resizeType)
- {
- case ResizeType.None:
- break;
- case ResizeType.Grid:
- {
- FrameworkElement element = _resizeTarget;
- FrameworkElement thumb = sender as FrameworkElement;
- double left, top, right, bottom, width, height;
- if (thumb.HorizontalAlignment == HorizontalAlignment.Left)
- {
- right = element.Margin.Right;
- left = element.Margin.Left + e.HorizontalChange;
- width = (double.IsNaN(element.Width) ? element.ActualWidth : element.Width) - e.HorizontalChange;
- }
- else
- {
- left = element.Margin.Left;
- right = element.Margin.Right - e.HorizontalChange;
- width = (double.IsNaN(element.Width) ? element.ActualWidth : element.Width) + e.HorizontalChange;
- }
-
- if (thumb.VerticalAlignment == VerticalAlignment.Top)
- {
- bottom = element.Margin.Bottom;
- top = element.Margin.Top + e.VerticalChange;
- height = (double.IsNaN(element.Height) ? element.ActualHeight : element.Height) - e.VerticalChange;
- }
- else
- {
- top = element.Margin.Top;
- bottom = element.Margin.Bottom - e.VerticalChange;
- height = (double.IsNaN(element.Height) ? element.ActualHeight : element.Height) + e.VerticalChange;
- }
- if (thumb.HorizontalAlignment != HorizontalAlignment.Center && thumb.HorizontalAlignment != HorizontalAlignment.Stretch)
- {
- if (width >= 0)
- {
- element.Margin = new Thickness(left, element.Margin.Top, right, element.Margin.Bottom);
- element.Width = width;
- }
- }
- if (thumb.VerticalAlignment != VerticalAlignment.Center && thumb.VerticalAlignment != VerticalAlignment.Stretch)
- {
- if (height >= 0)
- {
- element.Margin = new Thickness(element.Margin.Left, top, element.Margin.Right, bottom);
- element.Height = height;
- }
- }
- }
- break;
- case ResizeType.Canvas:
- {
- FrameworkElement target = _resizeTarget;
- Canvas parent = GetCanvas(target);
- FrameworkElement thumb = sender as FrameworkElement;
- if (parent == null)
- {
- // 涓�鑸笉浼氬嚭鐜拌繖绉嶆儏鍐碉紝淇濋櫓鍒ゆ柇涓�涓�
- return;
- }
-
- double oldLeft = double.IsNaN(Canvas.GetLeft(target)) ? 0 : Canvas.GetLeft(target),
- oldTop = double.IsNaN(Canvas.GetTop(target)) ? 0 : Canvas.GetTop(target),
- oldWidth = double.IsNaN(target.ActualWidth) ? 0 : target.ActualWidth,
- oldHeight = double.IsNaN(target.ActualHeight) ? 0 : target.ActualHeight;
-
- double left, top, width, height;
- double x = e.HorizontalChange, y = e.VerticalChange;
- bool toLeft = x < 0, toTop = y < 0;
- bool isLeft = thumb.HorizontalAlignment == HorizontalAlignment.Left,
- isTop = thumb.VerticalAlignment == VerticalAlignment.Top;
- if (isLeft)
- {
- // 宸︿晶鐨勬嫋鎷�
- left = oldLeft + x;
- width = oldWidth - x;
- if (left < 0) { left = 0; width = oldWidth - (left - oldLeft); }
- width = width < MinWidth ? MinWidth : width;
- }
- else
- {
- // 鍙充晶鐨勬嫋鎷�
- left = oldLeft >= 0 ? oldLeft : 0;
- width = oldWidth + x;
- width = width < MinWidth ? MinWidth : width;
- if (left + width > parent.ActualWidth) width = parent.ActualWidth - left;
- }
-
- if (isTop)
- {
- // 涓婅竟鐨勬嫋鎷�
- top = oldTop + y;
- height = oldHeight - y;
- if (top < 0) { top = 0; height = oldHeight - (top - oldTop); }
- height = height < MinHeight ? MinHeight : height;
- }
- else
- {
- // 涓嬭竟鐨勬嫋鎷�
- top = oldTop > 0 ? oldTop : 0;
- height = oldHeight + y;
- height = height < MinHeight ? MinHeight : height;
- if (top + height > parent.ActualHeight) height = parent.ActualHeight - top;
- }
-
- if (thumb.HorizontalAlignment != HorizontalAlignment.Center &&
- thumb.HorizontalAlignment != HorizontalAlignment.Stretch)
- {
- // 姘村钩鏂瑰悜鏈�缁堝垽鏂�
- Canvas.SetLeft(target, left);
- target.Width = width;
- //if ((isLeft && toLeft && left >= 0) ||
- // (isLeft && !toLeft && width >= MinWidth) ||
- // (!isLeft && toLeft && width >= MinWidth) ||
- // (!isLeft && !toLeft && (left + width) <= parent.ActualWidth))
- //{
- // Canvas.SetLeft(target, left);
- // target.Width = width;
- //}
- }
-
- if (thumb.VerticalAlignment != VerticalAlignment.Center &&
- thumb.VerticalAlignment != VerticalAlignment.Stretch)
- {
- // 鍨傜洿鏂瑰悜鏈�缁堝垽鏂�
- Canvas.SetTop(target, top);
- target.Height = height;
- //if ((isTop && toTop && top >= 0) ||
- // (isTop && !toTop && height >= MinHeight) ||
- // (!isTop && toTop && height >= MinHeight) ||
- // (!isTop && !toTop && (top + height) <= parent.ActualHeight))
- //{
- // Canvas.SetTop(target, top);
- // target.Height = height;
- //}
- }
- }
- break;
- case ResizeType.Window:
- {
- var c = _resizeTarget as Window;
- var thumb = sender as FrameworkElement;
- double left, top, width, height;
- if (thumb.HorizontalAlignment == HorizontalAlignment.Left)
- {
- left = c.Left + e.HorizontalChange;
- width = c.Width - e.HorizontalChange;
- }
- else
- {
- left = c.Left;
- width = c.Width + e.HorizontalChange;
- }
-
- if (thumb.VerticalAlignment == VerticalAlignment.Top)
- {
-
- top = c.Top + e.VerticalChange;
- height = c.Height - e.VerticalChange;
- }
- else
- {
- top = c.Top;
- height = c.Height + e.VerticalChange;
- }
-
- if (thumb.HorizontalAlignment != HorizontalAlignment.Center && thumb.HorizontalAlignment != HorizontalAlignment.Stretch)
- {
- if (width > 63)
- {
- c.Width = width;
- c.Left = left;
- }
- }
- if (thumb.VerticalAlignment != VerticalAlignment.Center && thumb.VerticalAlignment != VerticalAlignment.Stretch)
- {
- if (height > 63)
- {
- c.Top = top;
- c.Height = height;
- }
- }
- }
- break;
- case ResizeType.Others:
-
- break;
- }
- }
- ResizeType GetResizeType()
- {
- ResizeType rt;
- DependencyObject parent = VisualTreeHelper.GetParent(_resizeTarget);
- if (parent is Grid)
- {
- rt = ResizeType.Grid;
- }
- else if (parent is Canvas)
- {
- rt = ResizeType.Canvas;
- }
- else if (_resizeTarget is Window)
- {
- rt = ResizeType.Window;
- }
- else
- {
- rt = ResizeType.Grid;
- }
- return rt;
- }
-
- // 鏂瑰舰宸ュ巶
- FrameworkElementFactory GetFactory(Brush back)
- {
- FrameworkElementFactory fac = new FrameworkElementFactory(typeof(Rectangle));
- fac.SetValue(Rectangle.FillProperty, back);
- return fac;
- }
-
- // 瑁呴グ鍣�
- public class ResizeAdorner : Adorner
- {
- // 甯冨眬瀹瑰櫒锛屽鏋滀笉浣跨敤甯冨眬瀹瑰櫒锛屽垯闇�瑕佺粰涓婅堪8涓帶浠跺竷灞�锛屽疄鐜板拰Grid甯冨眬瀹氫綅鏄竴鏍风殑锛屼細姣旇緝绻佺悙涓旀剰涔変笉澶с��
- UIElement _child;
- public ResizeAdorner(UIElement adornedElement, UIElement child) : base(adornedElement)
- {
- _child = child;
- AddVisualChild(child);
- }
-
- protected override Visual GetVisualChild(int index)
- {
- return _child;
- }
- protected override int VisualChildrenCount { get; } = 1;
- protected override Size ArrangeOverride(Size finalSize)
- {
- // 鐩存帴缁檊rid甯冨眬锛実rid鍐呴儴鐨則humb浼氳嚜鍔ㄥ竷灞�銆�
- _child.Arrange(new Rect(new Point(0, 0), finalSize));
- return finalSize;
- }
- public void ttt(int index)
- {
- for (int i = 0; i < VisualTreeHelper.GetChildrenCount(_child); i++)
- {
- DependencyObject child = VisualTreeHelper.GetChild(_child, i);
- Canvas.SetZIndex(child as UIElement, index);
-
- }
-
- }
-
- }
- }
-
- static Canvas GetCanvas(DependencyObject element)
- {
- DependencyObject e = element;
- while (e != null && !(e is Canvas))
- {
- e = VisualTreeHelper.GetParent(e);
- }
- return e == null ? null : e as Canvas;
- }
- }
-}
diff --git a/Plugin.TestBuilder/Workspace.xaml b/Plugin.TestBuilder/Workspace.xaml
deleted file mode 100644
index e482fe0..0000000
--- a/Plugin.TestBuilder/Workspace.xaml
+++ /dev/null
@@ -1,68 +0,0 @@
-锘�<hb:PluginControl x:Class="Plugin.TestBuilder.Workspace"
- 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:hb="clr-namespace:HMI.Base;assembly=HMI.Base"
- xmlns:pw="https://opensource.panuon.com/wpf"
- xmlns:pu="https://opensource.panuon.com/wpf-ui"
- xmlns:ui="clr-namespace:Plugin.TestBuilder.UI"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800">
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <pu:StyleDictionary Includes="ListBox"/>
- </ResourceDictionary.MergedDictionaries>
- </ResourceDictionary>
- </UserControl.Resources>
-
- <Grid>
- <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
- <Canvas x:Name="WorkArea" Background="{StaticResource CommonBoarder}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
- <!--<vt:ProgramList BorderThickness="1" BorderBrush="#000" Canvas.Left="335" Canvas.Top="121" utils:Resize.IsResizeable="True"></vt:ProgramList>
- <vt:ProgramList BorderThickness="1" BorderBrush="#000" Canvas.Left="600" Canvas.Top="121" FocusableChanged="ProgramList_FocusableChanged"></vt:ProgramList>-->
-
- <ui:BottomBar x:Name="BottomBar" Canvas.Bottom="0" Panel.ZIndex="9999999"/>
- </Canvas>
- </ScrollViewer>
-
- <!-- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="2*"/>
- <ColumnDefinition Width="5" />
- <ColumnDefinition Width="4*"/>
- <ColumnDefinition Width="5" />
- <ColumnDefinition Width="4*"/>
- </Grid.ColumnDefinitions>
-
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition/>
- <RowDefinition Height="5"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <vt:ProgramList Grid.Row="0" BorderThickness="1" BorderBrush="#000"></vt:ProgramList>
- <GridSplitter Grid.Row="1" Background="Red" HorizontalAlignment="Stretch" Height="5" ResizeDirection="Rows"/>
- <vt:ProgramList Grid.Row="2" BorderThickness="1" BorderBrush="#000"></vt:ProgramList>
- </Grid>
-
- <GridSplitter Grid.Column="1" Background="Red" HorizontalAlignment="Center" Width="5" ResizeDirection="Columns"/>
-
- <Grid Grid.Column="2">
- <vt:ProgramList BorderThickness="1" BorderBrush="#000"></vt:ProgramList>
- </Grid>
-
- <GridSplitter Grid.Column="3" Background="Red" HorizontalAlignment="Center" Width="5" ResizeDirection="Columns"/>
-
- <Grid Grid.Column="4">
- <Grid.RowDefinitions>
- <RowDefinition/>
- <RowDefinition Height="5"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <vt:ProgramList Grid.Row="0" BorderThickness="1" BorderBrush="#000"></vt:ProgramList>
- <GridSplitter Grid.Row="1" Background="Red" HorizontalAlignment="Stretch" Height="5" ResizeDirection="Rows"/>
- <vt:ProgramList Grid.Row="2" BorderThickness="1" BorderBrush="#000"></vt:ProgramList>
- </Grid>-->
- </Grid>
-</hb:PluginControl>
diff --git a/Plugin.TestBuilder/Workspace.xaml.cs b/Plugin.TestBuilder/Workspace.xaml.cs
deleted file mode 100644
index df6f286..0000000
--- a/Plugin.TestBuilder/Workspace.xaml.cs
+++ /dev/null
@@ -1,266 +0,0 @@
-锘縰sing HMI.Base;
-using Plugin.TestBuilder.Entity;
-using Plugin.TestBuilder.UI;
-using System;
-using System.Collections.Generic;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Media;
-
-namespace Plugin.TestBuilder
-{
- /// <summary>
- /// WorkControl.xaml 鐨勪氦浜掗�昏緫
- /// </summary>
- public partial class Workspace : PluginControl
- {
- public Workspace()
- {
- InitializeComponent();
- Loaded += UserControl_Loaded;
- }
-
- private List<CanvasPosition> InitGridSize()
- {
- List<CanvasPosition> result = new List<CanvasPosition>();
- result.Add(new CanvasPosition
- {
- Left = 0,
- Top = 0,
- Width = 0.1 * ActualWidth - 2,
- Height = 0.5 * ActualHeight - 2
- });
- result.Add(new CanvasPosition
- {
- Left = 0.1 * ActualWidth + 2,
- Top = 0,
- Width = 0.5 * ActualWidth - 4,
- Height = ActualHeight,
- });
-
- result.Add(new CanvasPosition
- {
- Left = 0.6 * ActualWidth + 2,
- Top = 0,
- Width = 0.4 * ActualWidth - 2,
- Height = 0.5 * ActualHeight - 2
- });
-
- result.Add(new CanvasPosition
- {
- Left = 0,
- Top = 0.5 * ActualHeight + 2,
- Width = 0.1 * ActualWidth - 2,
- Height = 0.5 * ActualHeight - 2
- });
-
- result.Add(new CanvasPosition
- {
- Left = 0.6 * ActualWidth + 2,
- Top = 0.5 * ActualHeight + 2,
- Width = 0.4 * ActualWidth - 2,
- Height = 0.5 * ActualHeight - 2
- });
-
- return result;
- }
-
- private void UserControl_Loaded(object sender, RoutedEventArgs e)
- {
- List<CanvasPosition> pos = InitGridSize();
- ProgramList programList = new ProgramList();
- InnerWindow p = new InnerWindow(pos[0])
- {
- Title = "绋嬪簭鍒楄〃",
- Content = programList
- };
- HandleInnerWindow(p);
-
- InnerWindow p1 = new InnerWindow(pos[1])
- {
- Title = "鍥剧墖"
- };
- HandleInnerWindow(p1);
-
- SequnceList sequnceList = new SequnceList();
- programList.ProgramChanged += sequnceList.Selected_Program_Changed;
-
- InnerWindow p2 = new InnerWindow(pos[2])
- {
- Title = "搴忓垪",
- Content = sequnceList
- };
- HandleInnerWindow(p2);
-
- FunctionSetting functionSetting = new FunctionSetting();
- InnerWindow p3 = new InnerWindow(pos[3])
- {
- Title = "鍑芥暟",
- Content = functionSetting
- };
- HandleInnerWindow(p3);
-
- StepSetting stepSetting = new StepSetting();
- InnerWindow p4 = new InnerWindow(pos[4])
- {
- Title = "鍗曟璁剧疆",
- Content = stepSetting
- };
- HandleInnerWindow(p4);
-
-
- SizeChanged += WorkControl_SizeChanged;
- Loaded -= UserControl_Loaded;
-
- }
-
- public int CanvasChildrenCount { get; private set; } = 0;
-
- #region InnerWindow鎿嶄綔閫昏緫
- /// <summary>
- /// 璁剧疆InnerWindow
- /// </summary>
- /// <param name="inner"></param>
- private void HandleInnerWindow(InnerWindow inner)
- {
- inner.MinEvent += InnerWindowMin;
- inner.MaxEvent += InnerWindowMax;
- inner.ZIndexEvent += Inner_ZIndexEvent;
- inner.GotFocus += Inner_GotFocus;
- inner.AttachToCanvas(WorkArea);
- inner.Zindex = CanvasChildrenCount++;
- }
-
- /// <summary>
- /// InnerWindow鐒︾偣浜嬩欢
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Inner_GotFocus(object sender, RoutedEventArgs e)
- {
- CanvasHelper.SetTopZIndex(sender as InnerWindow, WorkArea, typeof(InnerWindow));
- }
-
- /// <summary>
- /// InnerWindow ZIndex鍒囨崲浜嬩欢
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Inner_ZIndexEvent(object sender, EventArgs e)
- {
- CanvasHelper.SetTopZIndex(sender as InnerWindow, WorkArea, typeof(InnerWindow));
- }
-
- /// <summary>
- /// InnerWindow鏈�灏忓寲浜嬩欢
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void InnerWindowMin(object sender, System.EventArgs e)
- {
- InnerWindow inner = sender as InnerWindow;
- inner.Visibility = Visibility.Collapsed;
- HandleMinInnerWindow(inner);
- }
-
- /// <summary>
- /// InnerWindow鏈�澶у寲浜嬩欢
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void InnerWindowMax(object sender, System.EventArgs e)
- {
- InnerWindow inner = sender as InnerWindow;
- if (inner.WindowState == WindowState.Maximized)
- {
- Canvas.SetLeft(inner, inner.canvasPosition.Left);
- Canvas.SetTop(inner, inner.canvasPosition.Top);
-
- inner.Width = inner.canvasPosition.Width;
- inner.Height = inner.canvasPosition.Height;
- inner.WindowState = WindowState.Normal;
- }
- else
- {
- Canvas.SetLeft(inner, 0);
- Canvas.SetTop(inner, 0);
- inner.Width = WorkArea.ActualWidth;
- inner.Height = WorkArea.ActualHeight;
- inner.WindowState = WindowState.Maximized;
- }
- }
-
- /// <summary>
- /// 閲嶈澶у皬
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void WorkControl_SizeChanged(object sender, SizeChangedEventArgs e)
- {
- Size newSize = e.NewSize;
- Size previousSize = e.PreviousSize;
-
- double xRate = newSize.Width / previousSize.Width;
- double yRate = newSize.Height / previousSize.Height;
- for (int i = 0; i < VisualTreeHelper.GetChildrenCount(WorkArea); i++)
- {
- UIElement child = VisualTreeHelper.GetChild(WorkArea, i) as UIElement;
- Canvas.SetLeft(child, Canvas.GetLeft(child) * xRate);
- Canvas.SetTop(child, Canvas.GetTop(child) * yRate);
- }
-
- for (int i = 0; i < VisualTreeHelper.GetChildrenCount(WorkArea); i++)
- {
- UIElement child = VisualTreeHelper.GetChild(WorkArea, i) as UIElement;
- if (Canvas.GetLeft(child) >= newSize.Width)
- {
- Canvas.SetLeft(child, Canvas.GetLeft(child) + newSize.Width - previousSize.Width);
- }
- if (Canvas.GetTop(child) >= newSize.Height)
- {
- Canvas.SetTop(child, Canvas.GetTop(child) + newSize.Height - previousSize.Height);
- }
- }
- }
- #endregion
-
- #region 搴曢儴MinInnerWindow鐩稿叧
- /// <summary>
- /// 搴曢儴MinInnerWindow澶勭悊
- /// </summary>
- /// <param name="inner"></param>
- private void HandleMinInnerWindow(InnerWindow inner)
- {
- MinInnerWindow min = new MinInnerWindow(inner);
- min.MaxEvent += MinInnerWindowMax;
- min.CloseEvent += MinInnerWindowClose;
- BottomBar.AddMinWindow(min);
- }
-
- /// <summary>
- /// 搴曢儴MinInnerWindow灞曞紑
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MinInnerWindowMax(object sender, System.EventArgs e)
- {
- MinInnerWindow min = sender as MinInnerWindow;
- min.Inner.Visibility = Visibility.Visible;
- CanvasHelper.SetTopZIndex(min.Inner, WorkArea, typeof(InnerWindow));
- BottomBar.RemoveMinWindow(min);
- }
-
- /// <summary>
- /// 搴曢儴MinInnerWin鍏抽棴
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MinInnerWindowClose(object sender, System.EventArgs e)
- {
- MinInnerWindow min = sender as MinInnerWindow;
- BottomBar.RemoveMinWindow(min);
- }
- #endregion
-
- }
-}
\ No newline at end of file
diff --git a/Plugin.TestBuilder/packages.config b/Plugin.TestBuilder/packages.config
deleted file mode 100644
index 4909f4c..0000000
--- a/Plugin.TestBuilder/packages.config
+++ /dev/null
@@ -1,7 +0,0 @@
-锘�<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="gong-wpf-dragdrop" version="4.0.0" targetFramework="net472" />
- <package id="log4net" version="3.0.4" targetFramework="net472" />
- <package id="Panuon.WPF" version="1.1.3" targetFramework="net472" />
- <package id="Panuon.WPF.UI" version="1.3.0.2" targetFramework="net472" />
-</packages>
\ No newline at end of file
diff --git a/Plugin.TestResult/Constant/CommonConstant.cs b/Plugin.TestResult/Constant/CommonConstant.cs
index cb338e3..b9cb371 100644
--- a/Plugin.TestResult/Constant/CommonConstant.cs
+++ b/Plugin.TestResult/Constant/CommonConstant.cs
@@ -28,6 +28,7 @@
{ "testing","娴嬭瘯涓�"},
{ "alert","鎶ヨ"},
{ "ready","鍑嗗灏辩华"},
+ { "abort","鎵嬪姩鍋滄"},
};
public static readonly Dictionary<string, SolidBrush> COLOR_MAP = new Dictionary<string, SolidBrush>() {
@@ -37,6 +38,7 @@
{ "testing",new SolidBrush(Color.FromArgb(0,0,0,0))},
{ "checkInFailed",new SolidBrush(Color.FromArgb(0,0,0,0))},
{ "checkIn",new SolidBrush(Color.FromArgb(0,0,0,0))},
+ { "abort",new SolidBrush(Color.FromArgb(0,0,0,0))},
};
public static string GetRandomStatus()
diff --git a/Plugin.TestResult/DataTable.xaml b/Plugin.TestResult/DataTable.xaml
index 501ee89..65344ce 100644
--- a/Plugin.TestResult/DataTable.xaml
+++ b/Plugin.TestResult/DataTable.xaml
@@ -40,7 +40,7 @@
</Grid.ColumnDefinitions>
<TextBlock FontSize="{Binding ActualWidth,RelativeSource={RelativeSource AncestorType=UserControl},
-Converter={StaticResource FontSizeConverter}, ConverterParameter='30,940'}"
+Converter={StaticResource FontSizeConverter}, ConverterParameter='20,940'}"
FontWeight="Bold"
Margin="0"
HorizontalAlignment="Center"
@@ -51,6 +51,7 @@
Style="{StaticResource FormComboxStyle}"
pu:ComboBoxHelper.ClearButtonVisibility="Collapsed"
BorderBrush="Black"
+ Height="26"
BorderThickness="0,1,0,0"
pu:ComboBoxHelper.Watermark="{DynamicResource Tr.ProductInfo}"
Width="{Binding ActualWidth,RelativeSource={RelativeSource AncestorType=UserControl},
@@ -61,7 +62,7 @@
<local:InfoTable x:Name="infoTable" Grid.Row="0" Grid.Column="1"
Grid.RowSpan="2"
FontSize="{Binding ActualWidth,RelativeSource={RelativeSource AncestorType=UserControl},
- Converter={StaticResource FontSizeConverter}, ConverterParameter='15,940'}"></local:InfoTable>
+ Converter={StaticResource FontSizeConverter}, ConverterParameter='12,940'}"></local:InfoTable>
</Grid>
<UniformGrid x:Name="mainGrid" Grid.Row="1" dp:UniformGridHelper.InnerBorder="1"
@@ -71,7 +72,7 @@
<!--<local:Chart Grid.Row="2" x:Name="chart" BorderThickness="0,1,0,1" BorderBrush="Black"
MouseDoubleClick="chart_MouseDoubleClick"/>-->
- <StatusBar Grid.Row="3">
+ <StatusBar FontSize="18" Grid.Row="3">
<StatusBar.ItemsPanel>
<ItemsPanelTemplate>
<DockPanel/>
@@ -83,7 +84,7 @@
<StatusBarItem DockPanel.Dock="Right">
<StackPanel Orientation="Horizontal" dp:StackPanelHelper.ChildSpace="8">
- <Button Style="{StaticResource DeleteLink}" Click="Button_Click_2" Content="鍋滄娴嬭瘯"/>
+ <!--<Button Style="{StaticResource DeleteLink}" Click="Button_Click_2" Content="鍋滄娴嬭瘯"/>-->
<StackPanel Orientation="Horizontal">
<Ellipse Width="10" Height="10">
@@ -122,8 +123,21 @@
Content="{DynamicResource Tr.Scan}"/>
<Button Grid.Column="1" Click="ClearAllSnr_Click" Style="{StaticResource DangerButton}"
Content="{DynamicResource Tr.ClearAllSNR}"/>
- <Button Grid.Column="2" Click="SetStationGlobal_Click" Style="{StaticResource SuccessButton}"
- Content="{DynamicResource App.Start}"/>
+ <!--<Button Grid.Column="2" Click="SetStationGlobal_Click" Style="{StaticResource SuccessButton}"
+ Content="{DynamicResource App.Start}"/>-->
+ <Button Grid.Column="2" Click="StartSingleClick">
+ <Button.Style>
+ <Style TargetType="Button" BasedOn="{StaticResource SuccessButton}">
+ <Setter Property="Content" Value="{DynamicResource App.Start}"/>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding IsTesting}" Value="True">
+ <Setter Property="Background" Value="{DynamicResource DangerVerBar}"/>
+ <Setter Property="Content" Value="鍋滄娴嬭瘯"/>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Button.Style>
+ </Button>
</Grid>
</Grid>
diff --git a/Plugin.TestResult/DataTable.xaml.cs b/Plugin.TestResult/DataTable.xaml.cs
index 84911cd..71069df 100644
--- a/Plugin.TestResult/DataTable.xaml.cs
+++ b/Plugin.TestResult/DataTable.xaml.cs
@@ -2,14 +2,19 @@
using HMI.UI.Util;
using HMI.Util;
using Plugin.TestResult;
+using Plugin.TestResult.Util;
using Plugin.TestResult_WPF.Model;
using Plugin.TestResult_WPF.Util;
+using SuperSocket.SocketBase.Config;
using SuperSocket.SocketBase.Protocol;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
+using System.Net.WebSockets;
using System.Runtime.CompilerServices;
+using System.Threading.Tasks;
+using System.Timers;
using System.Windows;
using System.Windows.Controls;
@@ -51,6 +56,14 @@
set => RaiseAndSetIfchanged(ref _statusText, value);
}
+ private bool _isTesting;
+
+ public bool IsTesting
+ {
+ get { return _isTesting; }
+ set => RaiseAndSetIfchanged(ref _isTesting, value);
+ }
+
private string tcpServerStatus;
public string TcpServerStatus
@@ -67,7 +80,7 @@
set { RaiseAndSetIfchanged(ref tcpServerInfo, value); }
}
- private static CommonCodeParser codeParser = new CommonCodeParser();
+ private static ICodeParser codeParser;
private readonly int index;
private readonly int cellCount;
private readonly string chartTitle;
@@ -80,6 +93,10 @@
private TcpServer tcpServer;
private string CountIniPath;
+
+ private DateTime? testStartTime;
+
+ private Timer testTimeTimer;
// 骞冲潎娓╁害
public List<double> tempratures = new List<double>();
@@ -112,11 +129,38 @@
for (int i = 0; i < this.cellCount; i++)
{
- var cell = new SingleCell(title, i, config.CellListMaxSize, countIniPath);
+ var cellRow = (i / config.PositionColumn) + 1;
+ var cellCol = (i % config.PositionColumn) + 1;
+ var cellTitle = $"{title}-{cellRow}-{cellCol}";
+
+ var cell = new SingleCell(this, cellTitle, i, config.CellListMaxSize, countIniPath);
mainGrid.Children.Add(cell);
cells[i] = cell;
}
+
+ if (config.CodeParserType == "JK01")
+ {
+ codeParser = new JKCodeParser();
+ }
+ else
+ {
+ codeParser = new CommonCodeParser();
+ }
ReadCount();
+ testTimeTimer = new Timer();
+ testTimeTimer.Interval = 10000;
+ testTimeTimer.AutoReset = true;
+ testTimeTimer.Elapsed += TestTimeTimer_Elapsed;
+ }
+
+ private void TestTimeTimer_Elapsed(object sender, ElapsedEventArgs e)
+ {
+ if (testStartTime == null) return;
+ var now = DateTime.Now;
+ Dispatcher.BeginInvoke(new Action(() =>
+ {
+ SetConsumeTime((now - testStartTime).Value.TotalSeconds);
+ }));
}
public int GetSize()
@@ -159,7 +203,42 @@
public void SetStatus(string status)
{
- infoTable.status = status;
+ ViewControl.Logger.Debug($"In Status: {status}");
+ Dispatcher.BeginInvoke(new Action(() =>
+ {
+ var lastStatus = infoTable.status;
+ if (status == "preCheck")
+ {
+ ViewControl.Logger.Debug($"In preCheck");
+ IsTesting = true;
+ return;
+ }
+ if (status == "stop")
+ {
+ IsTesting = false;
+ return;
+ }
+ if (status == "abort")
+ {
+ IsTesting = false;
+ }
+ infoTable.status = status;
+
+ if (lastStatus != "testing" && status == "testing")
+ {
+ testStartTime = DateTime.Now;
+ SetStartTime(testStartTime?.ToString("yyyy-MM-dd HH:mm:ss"));
+ testTimeTimer.Start();
+ }
+ if (lastStatus == "testing" && status != "testing")
+ {
+ testTimeTimer.Stop();
+ var now = DateTime.Now;
+ SetConsumeTime((now - testStartTime).Value.TotalSeconds);
+ SetEndTime(now.ToString("yyyy-MM-dd HH:mm:ss"));
+ testStartTime = null;
+ }
+ }));
}
public void SetOkCount(int count)
@@ -215,8 +294,23 @@
private void SetStationGlobal_Click(object sender, RoutedEventArgs e)
{
- ClearChartData();
- parent.SetStartFlag(this.index, true);
+
+ }
+
+ private void StartSingleClick(object sender, RoutedEventArgs e)
+ {
+ if (IsTesting)
+ {
+ if (MsgBoxHelper2.WarnChoose($"纭疄鍋滄鑰佸寲鐐塠{title}]鐨勬祴璇曞悧") == MessageBoxResult.OK)
+ {
+ parent.SetStartFlag(this.index, false);
+ }
+ }
+ else
+ {
+ ClearChartData();
+ parent.SetStartFlag(this.index, true);
+ }
}
private void ScanWindow_Click(object sender, RoutedEventArgs e)
@@ -229,18 +323,27 @@
if (scanner != null)
{
- scanner.Activate();
+ scanner.ShowDialog();
}
else
{
scanner = new Scanner(this.lang("Tr.ScanTitle", title))
{
+ Owner = Window.GetWindow(this),
Tag = title
};
scanner.FinishBarcode += Scanner_FinishBarcode;
+ scanner.ComplateClick += Scanner_ComplateClick; ;
scanner.Closed += Scanner_Closed;
- scanner.Show();
+ scanner.ShowDialog();
}
+ }
+
+ private void Scanner_ComplateClick(object sender, RoutedEventArgs e)
+ {
+ string paramName = $"StationState.Scanner[{index}]";
+ parent.engine.Globals.SetValBoolean(paramName, 1, true);
+ //parent.engine.CommitGlobalsToDisk(promptOnSaveConflicts: false);
}
private void Scanner_Closed(object sender, EventArgs e)
@@ -251,24 +354,50 @@
private void Scanner_FinishBarcode(object sender, BarcodeEventArg e)
{
if (parent.SequenceContext == null) return;
- CellInfo cellInfo = codeParser.GetCellInfoByCode(e.positionCode);
- string paramName = $"StationState.StartScanner_{title}";
- parent.engine.Globals.SetValBoolean(paramName, 0, true);
+ CellInfo cellInfo = codeParser.GetCellInfoByCode(e.positionCode);
string positionCode = e.positionCode, snrCode = e.snrCode;
- //TODO 闇�瑕佸鍔犳潯鐮佹牎楠屽姛鑳�
//灏嗚鍒扮殑鏉$爜鍐欏叆鍒癝N涓�
- int dutNo = Convert.ToInt16(positionCode.Split('-')[2]) - 1;
- dutNo = this.index * this.cellCount + dutNo;
+ int dutNo = this.index * this.cellCount + cellInfo.Index;
string LookupStr = $"StationState.SN[{dutNo}]";
- ViewControl.Logger.Info($"PositionCode: [{e.positionCode}], SNR: [{e.snrCode}], LookUpStr: [{LookupStr}]");
- parent.engine.Globals.SetValString(LookupStr, 0, snrCode);
+ ViewControl.Logger.Debug($"PositionCode: [{e.positionCode}], SNR: [{e.snrCode}], LookUpStr: [{LookupStr}]");
+ ViewControl.Logger.Debug($"OvenName: [{cellInfo.OvenName}], CellIndex: [{cellInfo.Index}]");
+ var cell = parent.nameTables[cellInfo.OvenName].GetSingleCell(cellInfo.Index);
+ if (snrCode == null)
+ {
+ string oldLookUp = $"StationState.SN[{e.oldIndex}]";
+ var oldCellInfo = codeParser.GetCellInfoByCode(e.oldPosition);
+ var oldCell = parent.nameTables[oldCellInfo.OvenName].GetSingleCell(oldCellInfo.Index);
+ if (oldCell.status != "hadCode")
+ {
+ throw new Exception($"绌翠綅[{e.oldPosition}]褰撳墠涓嶅厑璁告竻闄ゆ潯鐮�!");
+ }
+ // 绉婚櫎鏉$爜
+ parent.engine.Globals.SetValString(oldLookUp, 1, "");
+ parent.engine.CommitGlobalsToDisk(promptOnSaveConflicts: false);
+
+ oldCell.SetStatus("waiting");
+ oldCell.sn = "";
+ return;
+ }
+
+ /// 娓呮帀涓婁釜鏉$爜鐨勮褰�
+ var lastSn = cell.sn;
+ if (!string.IsNullOrEmpty(lastSn))
+ {
+ Scanner.RemoveSNR(lastSn);
+ }
+
+ // 鍐欏叆鏉$爜
+ parent.engine.Globals.SetValString(LookupStr, 1, snrCode);
parent.engine.CommitGlobalsToDisk(promptOnSaveConflicts: false);
- string code = parent.engine.Globals.GetValString(LookupStr, 0);
+
parent.nameTables[cellInfo.OvenName].GetSingleCell(cellInfo.Index).SetStatus("hadCode");
+ parent.nameTables[cellInfo.OvenName].GetSingleCell(cellInfo.Index).sn = snrCode;
+ Scanner.InsertNewCode(snrCode, positionCode, dutNo);
}
@@ -289,13 +418,18 @@
/// </summary>
private void StartTcpServer()
{
+ var serverConfig = new ServerConfig()
+ {
+ MaxRequestLength = 1024 * 1024,
+ Port = config.PortStart + index
+ };
try
{
if (tcpServer == null)
{
tcpServer = new TcpServer();
tcpServer.NewRequestReceived += TcpServer_NewRequestReceived;
- if (!tcpServer.Setup(config.PortStart + index))
+ if (!tcpServer.Setup(serverConfig))
{
ChangeTcpServerStatus("ERROR", this.lang("Tr.TcpServer.SettingFailed"));
return;
@@ -309,7 +443,7 @@
}
else if (tcpServer.State != SuperSocket.SocketBase.ServerState.Running)
{
- if (!tcpServer.Setup(config.PortStart + index))
+ if (!tcpServer.Setup(serverConfig))
{
ChangeTcpServerStatus("ERROR", this.lang("Tr.TcpServer.SettingFailed"));
return;
@@ -365,6 +499,7 @@
/// </summary>
public void RelaseResource()
{
+ testTimeTimer?.Stop();
StopTcpServer();
}
@@ -376,7 +511,7 @@
private void TcpServer_NewRequestReceived(TcpSession session, StringRequestInfo requestInfo)
{
string msg = requestInfo.Body;
- //ViewControl.Logger.Info($"TCP Data From {session.RemoteEndPoint}: {msg}.");
+ ViewControl.Logger.Debug($"TCP Data From {session.RemoteEndPoint}: {msg}.");
string[] datas_10015 = msg.Split(';');
int cellIndex = int.Parse(datas_10015[1]);
@@ -389,10 +524,11 @@
{
step = values[0],
value = values[1],
- result = values[2],
- range = values[3],
- condition = values[4],
- updateTime = values[5]
+ limitUp = values[2],
+ limitDown = values[3],
+ unit = values[4],
+ result = values[5],
+ updateTime = values[6]
});
//session.Send("1");
}
@@ -518,6 +654,14 @@
}
}
+ public void ClearVData()
+ {
+ foreach (var cell in cells)
+ {
+ cell.ClearVData();
+ }
+ }
+
private void Button_Click_1(object sender, RoutedEventArgs e)
{
ScannerSetting setting = new ScannerSetting()
@@ -529,7 +673,7 @@
private void ClearAllSnr_Click(object sender, RoutedEventArgs e)
{
- var str = $"StationState.Start_{title}";
+ var str = $"StationState.DoorClose[{index}]";
if (parent.engine.Globals.GetValBoolean(str, 0) == true)
{
MsgBoxHelper.Error(Window.GetWindow(this), "绋嬪簭杩愯涓紝涓嶈兘娓呯┖鏉$爜");
@@ -540,13 +684,7 @@
{
try
{
- for (int i = 0; i < this.cellCount; i++)
- {
- int dutNo = this.index * this.cellCount + i;
- string LookupStr = $"StationState.SN[{dutNo}]";
- parent.engine.Globals.SetValString(LookupStr, 0, "");
- GetSingleCell(i).SetStatus("waiting");
- }
+ ClearAllSN();
ToastHelper.Success(LangUtil.Get("App.DeleteSuccess"));
}
catch (Exception ex)
@@ -557,6 +695,38 @@
}
}
+ public void ClearAllSN()
+ {
+ for (int i = 0; i < this.cellCount; i++)
+ {
+ ClearCellSN(i);
+ }
+ }
+
+ public void TryClearCellSN(int cellIndex)
+ {
+ var str = $"StationState.DoorClose[{this.index}]";
+ if (parent.engine.Globals.GetValBoolean(str, 0) == true)
+ {
+ MsgBoxHelper.Error(Window.GetWindow(this), "绋嬪簭杩愯涓紝涓嶈兘娓呯┖鏉$爜");
+ return;
+ }
+ ClearCellSN(cellIndex);
+ }
+
+ private void ClearCellSN(int index)
+ {
+ var cell = GetSingleCell(index);
+ int dutNo = this.index * this.cellCount + index;
+ string LookupStr = $"StationState.SN[{dutNo}]";
+ var lastSN = cell.sn;
+ cell.sn = "";
+ cell.SetStatus("waiting");
+ parent.engine.Globals.SetValString(LookupStr, 1, "");
+ parent.engine.CommitGlobalsToDisk(promptOnSaveConflicts: false);
+ if (!string.IsNullOrEmpty(lastSN)) Scanner.RemoveSNR(lastSN);
+ }
+
private void Button_Click_2(object sender, RoutedEventArgs e)
{
if (MsgBoxHelper.WarnMessage(Window.GetWindow(this), "纭畾瑕佸仠姝㈣鐐変綅鐨勮�佸寲娴嬭瘯鍚楋紵") == MessageBoxResult.OK)
diff --git a/Plugin.TestResult/InfoTable.xaml b/Plugin.TestResult/InfoTable.xaml
index 2cbb831..29a5670 100644
--- a/Plugin.TestResult/InfoTable.xaml
+++ b/Plugin.TestResult/InfoTable.xaml
@@ -71,6 +71,10 @@
<DataTrigger Binding="{Binding status}" Value="ready">
<Setter Property="Background" Value="#FF08FF00"/>
</DataTrigger>
+ <DataTrigger Binding="{Binding status}" Value="abort">
+ <Setter Property="Background" Value="Black"/>
+ <Setter Property="Foreground" Value="White"/>
+ </DataTrigger>
</Style.Triggers>
</Style>
</Label.Style>
diff --git a/Plugin.TestResult/InfoWindow.xaml b/Plugin.TestResult/InfoWindow.xaml
index 290ba69..139d3eb 100644
--- a/Plugin.TestResult/InfoWindow.xaml
+++ b/Plugin.TestResult/InfoWindow.xaml
@@ -15,15 +15,17 @@
InteropOwnersMask="False"
Topmost="False"
Loaded="Window_Loaded"
+ SizeToContent="Height"
Unloaded="Window_Unloaded"
SizeChanged="Window_SizeChanged"
pu:WindowXModalDialog.Buttons="{x:Null}"
- Title="{Binding title}" Height="500" Width="800">
+ Title="{Binding title}" Width="800" Height="825">
<Grid x:Name="mainGrid">
<Grid.RowDefinitions>
- <RowDefinition/>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
+ <RowDefinition Height="500"/>
+ <RowDefinition Height="150"/>
+ <RowDefinition Height="150"/>
+ <RowDefinition Height="25"/>
</Grid.RowDefinitions>
<DataGrid ItemsSource="{Binding dataSource}" AutoGenerateColumns="False"
CanUserAddRows="False"
@@ -41,16 +43,17 @@
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>-->
- <DataGridTextColumn Header="娴嬭瘯椤瑰悕绉�" Binding="{Binding step}"/>
+ <DataGridTextColumn Header="娴嬭瘯椤�" Binding="{Binding step}"/>
<DataGridTextColumn Header="娴嬭瘯鍊�" Binding="{Binding value}"/>
+ <DataGridTextColumn Header="涓婇檺" Binding="{Binding limitUp}"/>
+ <DataGridTextColumn Header="涓嬮檺" Binding="{Binding limitDown}"/>
+ <DataGridTextColumn Header="鍗曚綅" Binding="{Binding unit}"/>
<DataGridTextColumn Header="娴嬭瘯缁撴灉" Binding="{Binding result}"/>
- <DataGridTextColumn Header="娴嬭瘯鑼冨洿" Binding="{Binding range}"/>
- <DataGridTextColumn Header="娴嬭瘯鏉′欢" Binding="{Binding condition}"/>
<DataGridTextColumn Header="鏇存柊鏃堕棿" Binding="{Binding updateTime}"/>
</DataGrid.Columns>
</DataGrid>
- <Grid Background="#f1eded" Grid.Row="2" Height="25">
+ <Grid Background="#f1eded" Grid.Row="3">
<DockPanel>
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" Margin="0,0,30,0">
<Label Padding="0" FontSize="12"
diff --git a/Plugin.TestResult/InfoWindow.xaml.cs b/Plugin.TestResult/InfoWindow.xaml.cs
index 58b265e..5e402af 100644
--- a/Plugin.TestResult/InfoWindow.xaml.cs
+++ b/Plugin.TestResult/InfoWindow.xaml.cs
@@ -35,7 +35,8 @@
set => Set(ref _dataSource, value);
}
private Chart electricChart;
- public InfoWindow(string title, ObservableCollection<Info> infos, Chart electricChart, int probeCount)
+ private Chart vChart;
+ public InfoWindow(string title, ObservableCollection<Info> infos, Chart electricChart, Chart vChart, int probeCount)
{
this.title = title;
this.dataSource = infos;
@@ -53,6 +54,10 @@
this.electricChart = electricChart;
mainGrid.Children.Add(electricChart);
Grid.SetRow(electricChart, 1);
+
+ this.vChart = vChart;
+ mainGrid.Children.Add(vChart);
+ Grid.SetRow(vChart, 2);
}
private static int AlarmProbeCount;
@@ -119,16 +124,17 @@
protected override void OnClosed(EventArgs e)
{
electricChart = null;
+ vChart = null;
mainGrid.Children.Clear();
base.OnClosed(e);
}
private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
{
- if (electricChart != null)
- {
- electricChart.Height = this.ActualHeight * 0.3;
- }
+ //if (electricChart != null)
+ //{
+ // electricChart.Height = this.ActualHeight * 0.3;
+ //}
}
private void Button_Click(object sender, RoutedEventArgs e)
diff --git a/Plugin.TestResult/Model/BaseConfig.cs b/Plugin.TestResult/Model/BaseConfig.cs
index bdb2a53..5aca5c4 100644
--- a/Plugin.TestResult/Model/BaseConfig.cs
+++ b/Plugin.TestResult/Model/BaseConfig.cs
@@ -165,6 +165,16 @@
}
}
+ private string codeParserType;
+ public string CodeParserType
+ {
+ get
+ {
+ var data = GetValue();
+ return data == null ? codeParserType : data.ToString();
+ }
+ }
+
public bool testing = false;
}
}
diff --git a/Plugin.TestResult/Model/Info.cs b/Plugin.TestResult/Model/Info.cs
index 5874718..7d4f075 100644
--- a/Plugin.TestResult/Model/Info.cs
+++ b/Plugin.TestResult/Model/Info.cs
@@ -20,6 +20,15 @@
set => RaiseAndSetIfchanged(ref _value, value);
}
+ private string _unit;
+
+ public string unit
+ {
+ get => _unit;
+
+ set => RaiseAndSetIfchanged(ref _unit, value);
+ }
+
private string _result;
public string result
@@ -29,22 +38,22 @@
set => RaiseAndSetIfchanged(ref _result, value);
}
- private string _range;
+ private string _limitDown;
- public string range
+ public string limitDown
{
- get => _range;
+ get => _limitDown;
- set => RaiseAndSetIfchanged(ref _range, value);
+ set => RaiseAndSetIfchanged(ref _limitDown, value);
}
- private string _condition;
+ private string _limitUp;
- public string condition
+ public string limitUp
{
- get => _condition;
+ get => _limitUp;
- set => RaiseAndSetIfchanged(ref _condition, value);
+ set => RaiseAndSetIfchanged(ref _limitUp, value);
}
private string _updateTime;
diff --git a/Plugin.TestResult/Plugin.TestResult.csproj b/Plugin.TestResult/Plugin.TestResult.csproj
index 764cf99..50c4793 100644
--- a/Plugin.TestResult/Plugin.TestResult.csproj
+++ b/Plugin.TestResult/Plugin.TestResult.csproj
@@ -187,6 +187,8 @@
<Compile Include="ScannerSetting.xaml.cs">
<DependentUpon>ScannerSetting.xaml</DependentUpon>
</Compile>
+ <Compile Include="Util\ICodeParser.cs" />
+ <Compile Include="Util\JKCodeParser.cs" />
<Compile Include="Util\CommonCodeParser.cs" />
<Compile Include="Util\FontSizeConverter.cs" />
<Compile Include="ViewControl.xaml.cs">
@@ -313,6 +315,10 @@
<Project>{736cd77d-b81e-4866-bb00-84b0b57110f0}</Project>
<Name>HMI.ParameterManage</Name>
</ProjectReference>
+ <ProjectReference Include="..\HMI.StdControl\HMI.StdControl.csproj">
+ <Project>{7a066856-182f-4435-b648-e9fb91aff657}</Project>
+ <Name>HMI.StdControl</Name>
+ </ProjectReference>
<ProjectReference Include="..\HMI.UI\HMI.UI.csproj">
<Project>{f17de6b5-af1d-48c6-94a0-6b763a6546a6}</Project>
<Name>HMI.UI</Name>
@@ -326,6 +332,9 @@
<Name>Plugin.TsSupport</Name>
</ProjectReference>
</ItemGroup>
+ <ItemGroup>
+ <Resource Include="Resource\abort.png" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\WPFProject\packages\HarfBuzzSharp.NativeAssets.macOS.7.3.0.3\build\net462\HarfBuzzSharp.NativeAssets.macOS.targets" Condition="Exists('..\WPFProject\packages\HarfBuzzSharp.NativeAssets.macOS.7.3.0.3\build\net462\HarfBuzzSharp.NativeAssets.macOS.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
diff --git a/Plugin.TestResult/Properties/AssemblyInfo.cs b/Plugin.TestResult/Properties/AssemblyInfo.cs
index 7552199..eebb8a0 100644
--- a/Plugin.TestResult/Properties/AssemblyInfo.cs
+++ b/Plugin.TestResult/Properties/AssemblyInfo.cs
@@ -52,3 +52,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: PluginClassName("Plugin.TestResult_WPF.ViewControl")]
diff --git a/Plugin.TestResult/Resource/abort.png b/Plugin.TestResult/Resource/abort.png
new file mode 100644
index 0000000..1b6b094
--- /dev/null
+++ b/Plugin.TestResult/Resource/abort.png
Binary files differ
diff --git a/Plugin.TestResult/Scanner.xaml b/Plugin.TestResult/Scanner.xaml
index 0f2e3df..6a9a3d0 100644
--- a/Plugin.TestResult/Scanner.xaml
+++ b/Plugin.TestResult/Scanner.xaml
@@ -15,7 +15,7 @@
xmlns:pu="https://opensource.panuon.com/wpf-ui"
xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
xmlns:cc="clr-namespace:HMI.Core;assembly=HMI.Core"
- InteropOwnersMask="False"
+ InteropOwnersMask="True"
SizeToContent="Height"
pu:WindowXModalDialog.Buttons="{x:Null}"
Title="{Binding title}" Width="600">
@@ -58,21 +58,21 @@
Header="{DynamicResource Tr.PositionSnr}"
dp:FormGroupHelper.IsRequired="True"
Style="{StaticResource InputFormGroupStyle}">
- <TextBox Style="{StaticResource EditorTextBoxStyle}" x:Name="positionText" TextWrapping="NoWrap"/>
+ <TextBox Style="{StaticResource EditorTextBoxStyle}" x:Name="positionText" TextWrapping="NoWrap" KeyDown="TextBox_KeyDown"/>
</pu:FormGroup>
<pu:FormGroup
Header="{DynamicResource Tr.ProductSnr}"
dp:FormGroupHelper.IsRequired="True" Style="{StaticResource InputFormGroupStyle}">
- <TextBox Style="{StaticResource EditorTextBoxStyle}" x:Name="snrText" TextWrapping="NoWrap"/>
+ <TextBox Style="{StaticResource EditorTextBoxStyle}" x:Name="snrText" TextWrapping="NoWrap" KeyDown="TextBox_KeyDown"/>
</pu:FormGroup>
</StackPanel>
</GroupBox>
- <Button Grid.Row="2" Click="Con_Click" Style="{StaticResource PrimaryButton}"
- Content="{DynamicResource Tr.ContinueScan}"/>
- <Button Grid.Row="2" Grid.Column="1" Click="Ok_Click" Style="{StaticResource SuccessButton}"
+ <!--<Button Grid.Row="2" Click="Con_Click" Style="{StaticResource PrimaryButton}"
+ Content="{DynamicResource Tr.ContinueScan}"/>-->
+ <Button Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Click="Ok_Click" Style="{StaticResource SuccessButton}"
Content="{DynamicResource Tr.FinishScan}"/>
</Grid>
</pu:WindowX>
diff --git a/Plugin.TestResult/Scanner.xaml.cs b/Plugin.TestResult/Scanner.xaml.cs
index f545677..d8fa36e 100644
--- a/Plugin.TestResult/Scanner.xaml.cs
+++ b/Plugin.TestResult/Scanner.xaml.cs
@@ -1,12 +1,15 @@
锘縰sing HMI.Core.Util;
+using HMI.UI.MDI;
using HMI.UI.Util;
using HMI.Util;
using Panuon.WPF.UI;
using Plugin.TestResult.Model;
using System;
+using System.Collections.Generic;
using System.ComponentModel;
using System.IO.Ports;
using System.Windows;
+using System.Windows.Input;
namespace Plugin.TestResult_WPF
{
@@ -15,12 +18,16 @@
public string name { get; private set; }
public string positionCode { get; private set; }
public string snrCode { get; private set; }
+ public string oldPosition { get; private set; }
+ public int oldIndex { get; private set; }
- public BarcodeEventArg(string name, string positionCode, string snrCode)
+ public BarcodeEventArg(string name, string positionCode, string snrCode, string oldPosition, int oldIndex)
{
this.name = name;
this.positionCode = positionCode;
this.snrCode = snrCode;
+ this.oldPosition = oldPosition;
+ this.oldIndex = oldIndex;
}
}
@@ -38,6 +45,10 @@
}
public event EventHandler<BarcodeEventArg> FinishBarcode;
+ public event EventHandler<RoutedEventArgs> ComplateClick;
+
+ private static Dictionary<string, string> snrCache = new Dictionary<string, string>();
+ private static Dictionary<string, int> snrIndex = new Dictionary<string, int>();
private DataTable dataTable;
SerialPort serialPort;
@@ -142,6 +153,44 @@
}
}
+ public static void InsertNewCode(string snr, string position, int index)
+ {
+ snrCache[snr] = position;
+ snrIndex[snr] = index;
+ }
+
+ public static void RemoveSNR(string snr)
+ {
+ snrCache.Remove(snr);
+ snrIndex.Remove(snr);
+ }
+
+ private void SendCode(string tag, string position, string snr)
+ {
+ if (snrCache.ContainsKey(snr))
+ {
+ var oldPosition = snrCache[snr];
+ if (MsgBoxHelper2.WarnChoose($"鏉$爜[{snr}]宸叉斁缃簬[{oldPosition}]涓紝鏄惁娓呴櫎锛�") == MessageBoxResult.OK)
+ {
+ try
+ {
+ FinishBarcode.Invoke(this, new BarcodeEventArg(tag, position, null, oldPosition, snrIndex[snr]));
+ snrCache.Remove(snr);
+ snrIndex.Remove(snr);
+ FinishBarcode.Invoke(this, new BarcodeEventArg(tag, position, snr, null, -1));
+ }
+ catch (Exception ex)
+ {
+ ToastHelper.Error(ex.Message);
+ }
+ }
+ }
+ else
+ {
+ FinishBarcode.Invoke(this, new BarcodeEventArg(tag, position, snr, null, -1));
+ }
+ }
+
private void Con_Click(object sender, RoutedEventArgs e)
{
Dispatcher.Invoke(() =>
@@ -154,9 +203,9 @@
}
try
{
- FinishBarcode.Invoke(this, new BarcodeEventArg(Tag.ToString(), position, snr));
- //positionText.Text = "";
- //snrText.Text = "";
+ SendCode(Tag.ToString(), position, snr);
+ positionText.Text = "";
+ snrText.Text = "";
positionText.Focus();
}
catch (Exception ex)
@@ -167,24 +216,35 @@
});
}
+ /// <summary>
+ /// 鍘熸潵鐨勫畬鎴愭壂鎻忛�昏緫
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ //private void Ok_Click(object sender, RoutedEventArgs e)
+ //{
+ // string position = positionText.Text, snr = snrText.Text;
+ // if (string.IsNullOrEmpty(position) || string.IsNullOrEmpty(snr))
+ // {
+ // ToastHelper.Warning(this, this.lang("Tr.PleaseInputSnrs"));
+ // return;
+ // }
+ // try
+ // {
+ // SendCode(Tag.ToString(), position, snr);
+ // this.Close();
+ // }
+ // catch (Exception ex)
+ // {
+ // ViewControl.Logger.Error("Con_Click Failed.", ex);
+ // ToastHelper.Warning(this, ex.Message);
+ // }
+ //}
+
private void Ok_Click(object sender, RoutedEventArgs e)
{
- string position = positionText.Text, snr = snrText.Text;
- if (string.IsNullOrEmpty(position) || string.IsNullOrEmpty(snr))
- {
- ToastHelper.Warning(this, this.lang("Tr.PleaseInputSnrs"));
- return;
- }
- try
- {
- FinishBarcode.Invoke(this, new BarcodeEventArg(Tag.ToString(), position, snr));
- this.Close();
- }
- catch (Exception ex)
- {
- ViewControl.Logger.Error("Con_Click Failed.", ex);
- ToastHelper.Warning(this, ex.Message);
- }
+ ComplateClick?.Invoke(this, e);
+ this.Close();
}
private string ReadDataFrom(SerialPort sp)
@@ -194,7 +254,7 @@
{
byte[] buffer = new byte[sp.BytesToRead];
sp.Read(buffer, 0, buffer.Length);
- barcode += System.Text.Encoding.UTF8.GetString(buffer);
+ barcode += System.Text.Encoding.ASCII.GetString(buffer);
System.Threading.Thread.Sleep(50);
}
return barcode;
@@ -211,5 +271,24 @@
{
}
}
+
+ private void TextBox_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
+ {
+ if (e.Key == Key.Enter)
+ {
+ //string barcode =
+ Dispatcher.Invoke(() =>
+ {
+ if (snrText.IsFocused)
+ {
+ Con_Click(null, null);
+ }
+ else
+ {
+ snrText.Focus();
+ }
+ });
+ }
+ }
}
}
diff --git a/Plugin.TestResult/SingleCell.xaml b/Plugin.TestResult/SingleCell.xaml
index 57c824f..327493f 100644
--- a/Plugin.TestResult/SingleCell.xaml
+++ b/Plugin.TestResult/SingleCell.xaml
@@ -7,8 +7,8 @@
mc:Ignorable="d"
xmlns:pw="https://opensource.panuon.com/wpf"
xmlns:pu="https://opensource.panuon.com/wpf-ui"
+xmlns:ui="clr-namespace:HMI.UI;assembly=HMI.UI"
x:Name="uc"
- Padding="5"
MouseDoubleClick="UserControl_MouseDoubleClick"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
@@ -21,7 +21,8 @@
<UserControl.ContextMenu>
<ContextMenu>
- <MenuItem IsCheckable="True" IsChecked="{Binding CellIsDisabled,Mode=TwoWay}" Header="绂佺敤"/>
+ <!--<MenuItem IsCheckable="True" IsChecked="{Binding CellIsDisabled,Mode=TwoWay}" Header="绂佺敤"/>-->
+ <MenuItem IsCheckable="False" x:Name="clearSNRItem" Click="MenuItem_Click" Header="娓呴櫎鏉$爜"/>
</ContextMenu>
</UserControl.ContextMenu>
@@ -55,26 +56,62 @@
<DataTrigger Binding="{Binding status}" Value="hadCode">
<Setter Property="Background" Value="#FFF"/>
</DataTrigger>
+ <DataTrigger Binding="{Binding status}" Value="abort">
+ <Setter Property="Background" Value="Black"/>
+ </DataTrigger>
</Style.Triggers>
</Style>
</UserControl.Style>
<Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="18"/>
+ </Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
- <ColumnDefinition/>
+ <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
- <!--<TextBox Grid.Row="0" IsReadOnly="True" TextAlignment="Center" Margin="0,0,0,3" FontSize="15"
- Background="Transparent" BorderThickness="0" Text="{Binding title}"/>-->
- <Label Grid.Column="0" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" Padding="0" Margin="0"
- FontSize="{Binding ActualWidth,RelativeSource={RelativeSource AncestorType=UserControl},
- Converter={StaticResource FontSizeConverter}, ConverterParameter='15,103'}"
- FontWeight="Bold"
- Background="Transparent" BorderThickness="0" Content="{Binding title}"/>
- <Image Grid.Column="1">
+ <StackPanel Orientation="Horizontal" Background="LightGray" Grid.Row="1" Grid.Column="1" VerticalAlignment="Top" HorizontalAlignment="Right">
+ <TextBlock Foreground="Red" Text="鎺㈤拡棰勮">
+ <TextBlock.Style>
+ <Style TargetType="TextBlock">
+ <Setter Property="Visibility" Value="Collapsed"/>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding probeAlarm}" Value="True">
+ <Setter Property="Visibility" Value="Visible"/>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </TextBlock.Style>
+ </TextBlock>
+ <TextBlock Margin="0">
+ <Run Text="{Binding ProbeCount}"/>
+ <Run Text="/"/>
+ <Run Text="{Binding probeWarn}"/>
+ </TextBlock>
+ </StackPanel>
+ <Label Grid.Row="0" Grid.Column="0" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" Padding="0" Margin="5,5,0,0"
+ FontSize="{Binding ActualWidth,RelativeSource={RelativeSource AncestorType=UserControl},
+ Converter={StaticResource FontSizeConverter}, ConverterParameter='8,103'}"
+ FontWeight="Bold"
+Background="Transparent" BorderThickness="0" Content="{Binding title}">
+ <Label.Style>
+ <Style TargetType="Label">
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding status}" Value="abort">
+ <Setter Property="Foreground" Value="#FFF"/>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Label.Style>
+ </Label>
+ <ui:ScrollLabel Grid.Row="1" Grid.Column="0" Margin="3,0,0,5" Padding="0" Value="{Binding sn}"/>
+
+ <Image Grid.Row="0" Grid.Column="1" Width="30" HorizontalAlignment="Right" Height="30" Margin="0,5,5,0">
<Image.Style>
<Style TargetType="Image">
<Setter Property="HorizontalAlignment" Value="Center"/>
- <Setter Property="VerticalAlignment" Value="Bottom"/>
+ <Setter Property="VerticalAlignment" Value="Top"/>
<Style.Triggers>
<DataTrigger Binding="{Binding status}" Value="ok">
<Setter Property="Source" Value="Resource/ok2.png"/>
@@ -103,6 +140,9 @@
<DataTrigger Binding="{Binding status}" Value="hadCode">
<Setter Property="Source" Value="Resource/barcode.png"/>
</DataTrigger>
+ <DataTrigger Binding="{Binding status}" Value="abort">
+ <Setter Property="Source" Value="Resource/abort.png"/>
+ </DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
diff --git a/Plugin.TestResult/SingleCell.xaml.cs b/Plugin.TestResult/SingleCell.xaml.cs
index b8b62a7..bf88c56 100644
--- a/Plugin.TestResult/SingleCell.xaml.cs
+++ b/Plugin.TestResult/SingleCell.xaml.cs
@@ -1,4 +1,7 @@
-锘縰sing HMI.Util;
+锘縰sing HMI.Core.Manager;
+using HMI.Core.Util;
+using HMI.UI.Util;
+using HMI.Util;
using Plugin.TestResult_WPF.Constant;
using Plugin.TestResult_WPF.Model;
using System;
@@ -38,31 +41,61 @@
private InfoWindow window;
private int maxSize;
+ private static string dataLogPath;
+ private static int ProbeWarn;
+
+ static SingleCell()
+ {
+ try
+ {
+ var value = ParameterManager.GetCommonParameterByName("TS_DataLogPath");
+ dataLogPath = value?.Value ?? Path.Combine(PathHelper.ConfigFolder, "DataBoard");
+ }
+ catch
+ {
+ dataLogPath = Path.Combine(PathHelper.ConfigFolder, "DataBoard");
+ }
+
+ try
+ {
+ var value = ParameterManager.GetCommonParameterByName("ProbeWarn");
+ ProbeWarn = value != null ? int.Parse(value.Value) : 1000;
+ }
+ catch
+ {
+ ProbeWarn = 1000;
+ }
+ }
+
public SingleCell()
{
DataContext = this;
InitializeComponent();
}
- public SingleCell(string parentName, int index, int maxSize, string iniFile)
+ private DataTable table;
+
+ public SingleCell(DataTable table, string title, int index, int maxSize, string iniFile)
{
- this.parentName = parentName;
+ this.table = table;
+ this.title = title;
this.index = index;
this.maxSize = maxSize;
this.countIniPath = iniFile;
+ this.probeWarn = ProbeWarn;
DataContext = this;
InitializeComponent();
LoadProbeCount();
}
- private string _parentName;
- public string parentName
+ private string _sn;
+ public string sn
{
- get { return _parentName; }
+ get { return _sn; }
set
{
- RaiseAndSetIfchanged(ref _parentName, value);
- RaisePropertyChanged("title");
+ RaiseAndSetIfchanged(ref _sn, value);
+ RaisePropertyChanged("sn");
}
}
@@ -89,8 +122,25 @@
}
}
+ private string _title;
+ public string title
+ {
+ get => _title;
+ set
+ {
+ RaiseAndSetIfchanged(ref _title, value);
+ }
+ }
- public string title => $"{parentName}-{index + 1}";
+ private int _probeWarn;
+ public int probeWarn
+ {
+ get => _probeWarn;
+ set
+ {
+ RaiseAndSetIfchanged(ref _probeWarn, value);
+ }
+ }
private string _status = CommonStatus.WAITING;
@@ -118,6 +168,8 @@
private ConcurrentQueue<Info> queue = new ConcurrentQueue<Info>();
+ private List<Info> allInfos = new List<Info>();
+
private ObservableCollection<Info> _infos = new ObservableCollection<Info>();
public ObservableCollection<Info> infos
@@ -141,6 +193,17 @@
set
{
RaiseAndSetIfchanged(ref probeCount, value);
+ probeAlarm = value >= probeWarn;
+ }
+ }
+
+ private bool _probeAlarm;
+ public bool probeAlarm
+ {
+ get => _probeAlarm;
+ set
+ {
+ RaiseAndSetIfchanged(ref _probeAlarm, value);
}
}
@@ -165,7 +228,7 @@
{
if (window == null)
{
- window = new InfoWindow(title, infos, electricChart, ProbeCount);
+ window = new InfoWindow(title, infos, electricChart, vChart, ProbeCount);
window.Closed += Window_Closed;
window.ClearProbeCountEvent += Window_ClearProbeCountEvent;
window.Owner = Window.GetWindow(this);
@@ -189,8 +252,9 @@
public void SetStatus(string status)
{
+ var oldStatus = this.status;
this.status = status;
- if (status == "testing")
+ if (oldStatus != "testing" && status == "testing")
{
UpdateProbeCount(ProbeCount + 1);
}
@@ -198,6 +262,7 @@
public void SetInfos(Info info)
{
+ allInfos.Add(info);
if (queue.Count >= maxSize)
{
queue.TryDequeue(out var first);
@@ -228,13 +293,18 @@
public void ClearInfo()
{
+ allInfos.Clear();
queue = new ConcurrentQueue<Info>();
var list = new ObservableCollection<Info>(queue);
this.infos = list;
if (window != null) window.UpdateSource(this.infos);
}
- private Chart electricChart = new Chart("鐢垫祦鏇茬嚎(A)", false, 20);
+ private Chart electricChart = new Chart("鐢垫祦鏇茬嚎(A)", false, 20)
+ {
+ Height = 150
+ };
+
public void AddElectricData(double data)
{
electricChart.AddData(data);
@@ -243,6 +313,21 @@
public void ClearElectricData()
{
electricChart.Clear();
+ }
+
+ private Chart vChart = new Chart("鐢靛帇鏇茬嚎(V)", false, 20)
+ {
+ Height = 150
+ };
+
+ public void AddVData(double data)
+ {
+ vChart.AddData(data);
+ }
+
+ public void ClearVData()
+ {
+ vChart.Clear();
}
public void SaveElectricDataToCSV(string filePath)
@@ -276,5 +361,148 @@
Console.WriteLine(ex.ToString());
}
}
+
+ public void SaveVDataToCSV(string filePath)
+ {
+ try
+ {
+ List<double> datas = vChart?.GetSingleData();
+
+ FileInfo fi = new FileInfo(filePath);
+ if (!fi.Directory.Exists)
+ {
+ fi.Directory.Create(); //鏂囦欢涓嶅瓨鍦紝鍒涘缓鏂囦欢
+ }
+
+ using (FileStream fs = new FileStream(filePath, FileMode.Create, FileAccess.Write))
+ using (StreamWriter sw = new StreamWriter(fs, System.Text.Encoding.UTF8))
+ {
+ string title = "鐢靛帇鏁版嵁(V)";
+ sw.WriteLine(title);
+ if (datas != null)
+ {
+ for (int i = 0; i < datas.Count; i++)
+ {
+ sw.WriteLine(datas[i].ToString());
+ }
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine(ex.ToString());
+ }
+ }
+
+ /// <summary>
+ /// 淇濆瓨娴嬭瘯鏁版嵁鍒癈SV
+ /// </summary>
+ /// <param name="filePath"></param>
+ public void SaveInfoToCSV(string filePath)
+ {
+ try
+ {
+ FileInfo fi = new FileInfo(filePath);
+ if (!fi.Directory.Exists)
+ {
+ fi.Directory.Create(); //鏂囦欢涓嶅瓨鍦紝鍒涘缓鏂囦欢
+ }
+
+ using (FileStream fs = new FileStream(filePath, FileMode.Create, FileAccess.Write))
+ using (StreamWriter sw = new StreamWriter(fs, System.Text.Encoding.UTF8))
+ {
+ string title = "娴嬭瘯椤�,娴嬭瘯鍊�,涓嬮檺,涓婇檺,鍗曚綅,缁撴灉,娴嬭瘯鏃堕棿";
+ sw.WriteLine(title);
+ foreach (var info in allInfos)
+ {
+ string row = $"{info.step},{info.value},{info.limitDown},{info.limitUp},{info.unit},{info.result},{info.updateTime}";
+ sw.WriteLine(row);
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ ViewControl.Logger.Error($"Cell[{title}] SaveInfoToCSV Error.", ex);
+ }
+ }
+
+ private SqliteHelper CheckSqlHelper()
+ {
+ string today = DateTime.Now.ToString("yyyyMMdd");
+ string dbPath = Path.Combine(dataLogPath, $"Data_{today}.db");
+ if (!File.Exists(dbPath))
+ {
+ SqliteHelper.CreateDatabase(dbPath);
+ }
+ var sqliteHelper = new SqliteHelper(dbPath);
+ sqliteHelper.ExecuteSql(@"CREATE TABLE IF NOT EXISTS serialData (
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ sn TEXT NOT NULL,
+ model TEXT,
+ station TEXT NOT NULL,
+ step TEXT NOT NULL,
+ position TEXT,
+ limitDown TEXT,
+ limitUp TEXT,
+ unit TEXT,
+ offset TEXT,
+ value TEXT,
+ status TEXT,
+ finalStatus TEXT,
+ consumeTime TEXT,
+ totalConsumeTime TEXT,
+ time DATETIME NOT NULL);");
+ sqliteHelper.ExecuteSql(@"CREATE TABLE IF NOT EXISTS testResult (
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ sn TEXT NOT NULL,
+ model TEXT,
+ station TEXT NOT NULL,
+ position TEXT,
+ status TEXT,
+ result TEXT NOT NULL,
+ time DATETIME NOT NULL);");
+ return sqliteHelper;
+ }
+
+ /// <summary>
+ /// 淇濆瓨娴嬭瘯鏁版嵁鍒癝qlite
+ /// </summary>
+ /// <param name="filePath"></param>
+ public void SaveInfoToDB()
+ {
+ try
+ {
+ using (var helper = CheckSqlHelper())
+ {
+ List<string> sqls = new List<string>();
+ var timestr = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+ foreach (var info in allInfos)
+ {
+ string sql = $@"INSERT INTO serialData (sn,station,step,limitDown,limitUp,unit,value,status,finalStatus,time)
+VALUES ('{sn}','','{info.step}','{info.limitDown}','{info.limitUp}','{info.unit}','{info.value}','{info.result}','{this.status}','{timestr}');";
+ sqls.Add(sql);
+ }
+ sqls.Add($"INSERT INTO testResult (sn,station,position,result,time) VALUES ('{sn}','','{title}','{this.status}','{timestr}');");
+ helper.ExecuteBatchSql(sqls);
+ }
+ }
+ catch (Exception ex)
+ {
+ ViewControl.Logger.Error($"Cell[{title}] SaveToDB Error.", ex);
+ }
+ }
+
+ private void MenuItem_Click(object sender, RoutedEventArgs e)
+ {
+ var item = sender as MenuItem;
+ switch (item?.Name)
+ {
+ case "clearSNRItem":
+ table.TryClearCellSN(this.index);
+ break;
+ default:
+ break;
+ }
+ }
}
}
diff --git a/Plugin.TestResult/TestResultView.xaml b/Plugin.TestResult/TestResultView.xaml
index 794990b..167db86 100644
--- a/Plugin.TestResult/TestResultView.xaml
+++ b/Plugin.TestResult/TestResultView.xaml
@@ -14,7 +14,7 @@
d:DesignHeight="450" d:DesignWidth="800">
<Grid x:Name="panel">
<WindowsFormsHost x:Name="host" Visibility="Collapsed"></WindowsFormsHost>
- <Grid x:Name="mainGrid" dp:GridHelper.Space="10">
+ <Grid x:Name="mainGrid" dp:GridHelper.Space="6">
</Grid>
</Grid>
diff --git a/Plugin.TestResult/TestResultView.xaml.cs b/Plugin.TestResult/TestResultView.xaml.cs
index f2f148d..8db8a85 100644
--- a/Plugin.TestResult/TestResultView.xaml.cs
+++ b/Plugin.TestResult/TestResultView.xaml.cs
@@ -3,7 +3,6 @@
using NationalInstruments.TestStand.Interop.API;
using NationalInstruments.TestStand.Interop.UI.Ax;
using NationalInstruments.TestStand.Utility;
-using Plugin.TestResult_WPF.Constant;
using Plugin.TestResult_WPF.Model;
using Plugin.TsSupport;
using System;
@@ -82,42 +81,6 @@
private void Refresh()
{
- for (int i = 0; i < tables.Length; i++)
- {
- var sb = new System.Timers.Timer()
- {
- Interval = 1000,
- AutoReset = true,
- };
- var table = tables[i];
- Random random = new Random(i * 13);
- sb.Elapsed += (s, e) =>
- {
- table.RefreshCount(1, 0);
- table.SetTemperature(random.Next(100));
- for (int j = 0; j < 3; j++)
- {
- table.SetTemperature(j + "89", random.Next(100));
- }
- //table.SetOkCount(random.Next(100));
- //table.SetNgCount(random.Next(100));
- table.SetStatus(CommonStatus.GetRandomStatus());
- table.SetStartTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
- table.SetEndTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
- table.SetConsumeTime(random.Next(10000));
- tables[0].GetSingleCell(0).AddElectricData(random.Next(100));
-
- var cell = tables[0].GetSingleCell(0);//table.GetSingleCell(random.Next(table.GetSize()));
- cell.SetStatus(CommonStatus.GetRandomStatus());
- cell.SetInfos(new Info
- {
- step = random.Next(1000) + "",
- value = random.Next(1000) + ""
- });
- table.SetStatusText(DateTime.Now + "");
- };
- sb.Start();
- }
}
private string CountIniPath;
@@ -187,6 +150,7 @@
{
try
{
+ if (string.IsNullOrEmpty(testSeqFile)) return;
this.modeSeq = this.engine.GetSequenceFileEx(@"C:\Program Files\National Instruments\TestStand 2020\Components\Models\TestStandModels\ParallelModel.seq");
this.testSeq = this.engine.GetSequenceFileEx(this.testSeqFile, 0, TypeConflictHandlerTypes.ConflictHandler_UseGlobalType);
this.execution = this.engine.NewExecution(this.testSeq, "Test UUTs", this.modeSeq, false, 0, null, null, null);
@@ -360,10 +324,11 @@
{
step = values[0],
value = values[1],
- result = values[2],
- range = values[3],
- condition = values[4],
- updateTime = values[5]
+ limitUp = values[2],
+ limitDown = values[3],
+ unit = values[4],
+ result = values[5],
+ updateTime = values[6]
});
return;
}
@@ -387,7 +352,7 @@
}
if (MethodCode == 12)
{
- /// 淇濆瓨娓╁害鏂囦欢
+ /// 淇濆瓨鐐変綋娓╁害鏂囦欢
strData = e.uiMsg.StringData;
string[] datas = strData.Split(';');
int ovenIndex = int.Parse(datas[0]);
@@ -408,21 +373,95 @@
}
if (MethodCode == 14)
{
- /// 娓呯┖鐢垫祦鏁版嵁
+ /// 娓呯┖鐢垫祦鍜岀數鍘嬫暟鎹�
strData = e.uiMsg.StringData;
int ovenIndex = int.Parse(strData);
tables[ovenIndex].ClearElectricData();
+ tables[ovenIndex].ClearVData();
return;
}
+
if (MethodCode == 15)
{
- /// 娓呯┖鐢垫祦鏁版嵁
+ /// 淇濆瓨鐢垫祦鏁版嵁
strData = e.uiMsg.StringData;
string[] datas = strData.Split(';');
int ovenIndex = int.Parse(datas[0]);
int cellIndex = int.Parse(datas[1]);
string filePath = datas[2];
tables[ovenIndex].GetSingleCell(cellIndex).SaveElectricDataToCSV(filePath);
+ return;
+ }
+
+ if (MethodCode == 16)
+ {
+ /// 娣诲姞鐢靛帇鏁版嵁
+ strData = e.uiMsg.StringData;
+ string[] datas = strData.Split(';');
+ int ovenIndex = int.Parse(datas[0]);
+ int cellIndex = int.Parse(datas[1]);
+ double eData = double.Parse(datas[2]);
+ tables[ovenIndex].GetSingleCell(cellIndex).AddVData(eData);
+ return;
+ }
+
+ if (MethodCode == 17)
+ {
+ /// 淇濆瓨鐢靛帇鏁版嵁
+ strData = e.uiMsg.StringData;
+ string[] datas = strData.Split(';');
+ int ovenIndex = int.Parse(datas[0]);
+ int cellIndex = int.Parse(datas[1]);
+ string filePath = datas[2];
+ tables[ovenIndex].GetSingleCell(cellIndex).SaveVDataToCSV(filePath);
+ return;
+ }
+
+ if (MethodCode == 18)
+ {
+ /// 淇濆瓨绌翠綅娴嬭瘯鏁版嵁鍒癈SV
+ strData = e.uiMsg.StringData;
+ string[] datas = strData.Split(';');
+ int ovenIndex = int.Parse(datas[0]);
+ int cellIndex = int.Parse(datas[1]);
+ string filePath = datas[2];
+ tables[ovenIndex].GetSingleCell(cellIndex).SaveInfoToCSV(filePath);
+ return;
+ }
+
+ if (MethodCode == 19)
+ {
+ /// 淇濆瓨绌翠綅娴嬭瘯鏁版嵁鍒癝qlite
+ strData = e.uiMsg.StringData;
+ string[] datas = strData.Split(';');
+ int ovenIndex = int.Parse(datas[0]);
+ int cellIndex = int.Parse(datas[1]);
+ tables[ovenIndex].GetSingleCell(cellIndex).SaveInfoToDB();
+ return;
+ }
+
+ if (MethodCode == 20)
+ {
+ /// 娓呯┖鏉$爜
+ strData = e.uiMsg.StringData;
+ int ovenIndex = int.Parse(strData);
+ tables[ovenIndex].ClearAllSN();
+ return;
+ }
+
+ if (MethodCode == 99)
+ {
+ strData = e.uiMsg.StringData;
+ string[] datas = strData.Split(';');
+ int index = int.Parse(datas[0]);
+ if (MsgBoxHelper2.WarnChoose(datas[1], "鎻愮ず") == MessageBoxResult.OK)
+ {
+ SequenceContext.StationGlobals.SetValNumber($"StationState.Pipe[{index}]", 1, 1);
+ }
+ else
+ {
+ SequenceContext.StationGlobals.SetValNumber($"StationState.Pipe[{index}]", 1, 0);
+ }
return;
}
}
@@ -436,7 +475,7 @@
{
if (this.SequenceContext == null) return;
string name = tables[index].title;
- string key = $"StationState.Start_{name}";
+ string key = $"StationState.Start[{index}]";
this.engine.Globals.SetValBoolean(key, 1, data);
//bool val = this.engine.Globals.GetValBoolean(key, 0);
//this.SequenceContext.StationGlobals.SetValBoolean(key, 0, data);
@@ -475,16 +514,21 @@
public void SetCurrentProduct(string currentProduct)
{
- foreach (var table in tables)
+ for (int i = 0; i < tables.Length; i++)
{
- table.SetCurrentProduct(currentProduct);
+ var table = tables[i];
+ // table.SetCurrentProduct(currentProduct);
+ string LookupStr = $"StationState.Model[{i}]";
+ string tableModel = engine?.Globals?.GetValString(LookupStr, 1);
+ table.SetCurrentProduct(tableModel);
}
}
public void SetOvenProduct(int index, string product)
{
- string LookupStr = $"StationState.ProductModel_{tables[index].title}";
+ string LookupStr = $"StationState.Model[{index}]";
engine?.Globals?.SetValString(LookupStr, 1, product);
+ engine?.CommitGlobalsToDisk(promptOnSaveConflicts: false);
}
}
}
diff --git a/Plugin.TestResult/Util/CommonCodeParser.cs b/Plugin.TestResult/Util/CommonCodeParser.cs
index 605ea69..cda2076 100644
--- a/Plugin.TestResult/Util/CommonCodeParser.cs
+++ b/Plugin.TestResult/Util/CommonCodeParser.cs
@@ -1,13 +1,10 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+锘縰sing Plugin.TestResult.Util;
using Plugin.TestResult_WPF.Model;
+using System;
namespace Plugin.TestResult_WPF.Util
{
- public class CommonCodeParser
+ public class CommonCodeParser: ICodeParser
{
public CellInfo GetCellInfoByCode(string code)
{
diff --git a/Plugin.TestResult/Util/ICodeParser.cs b/Plugin.TestResult/Util/ICodeParser.cs
new file mode 100644
index 0000000..abdb248
--- /dev/null
+++ b/Plugin.TestResult/Util/ICodeParser.cs
@@ -0,0 +1,9 @@
+锘縰sing Plugin.TestResult_WPF.Model;
+
+namespace Plugin.TestResult.Util
+{
+ public interface ICodeParser
+ {
+ CellInfo GetCellInfoByCode(string code);
+ }
+}
diff --git a/Plugin.TestResult/Util/JKCodeParser.cs b/Plugin.TestResult/Util/JKCodeParser.cs
new file mode 100644
index 0000000..74115ab
--- /dev/null
+++ b/Plugin.TestResult/Util/JKCodeParser.cs
@@ -0,0 +1,26 @@
+锘縰sing Plugin.TestResult.Util;
+using Plugin.TestResult_WPF.Model;
+using System;
+
+namespace Plugin.TestResult_WPF.Util
+{
+ public class JKCodeParser : ICodeParser
+ {
+ public CellInfo GetCellInfoByCode(string code)
+ {
+ string[] arr = code.Split('-');
+ if (arr == null || arr.Length != 3)
+ {
+ throw new Exception("鎵爜鏍煎紡寮傚父");
+ }
+ int row = int.Parse(arr[1]);
+ int index = int.Parse(arr[2]);
+
+ return new CellInfo()
+ {
+ OvenName = arr[0],
+ Index = (row - 1) * 4 + (index - 1),
+ };
+ }
+ }
+}
diff --git a/Plugin.TestResult/ViewControl.xaml b/Plugin.TestResult/ViewControl.xaml
index 48d2036..9e29eb9 100644
--- a/Plugin.TestResult/ViewControl.xaml
+++ b/Plugin.TestResult/ViewControl.xaml
@@ -1,16 +1,14 @@
锘�<hb:PluginMaskControl x:Class="Plugin.TestResult_WPF.ViewControl"
- 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:Plugin.TestResult_WPF"
- xmlns:hb="clr-namespace:HMI.Base;assembly=HMI.Base"
- xmlns:uic="clr-namespace:HMI.UI.Converter;assembly=HMI.UI"
-xmlns:ui="clr-namespace:HMI.UI;assembly=HMI.UI"
-xmlns:pw="https://opensource.panuon.com/wpf"
-xmlns:pu="https://opensource.panuon.com/wpf-ui"
-xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
- mc:Ignorable="d"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:hb="clr-namespace:HMI.Base;assembly=HMI.Base"
+ xmlns:std="clr-namespace:HMI.StdControl;assembly=HMI.StdControl"
+ xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
+ xmlns:local="clr-namespace:Plugin.TestResult_WPF"
+ xmlns:pu="https://opensource.panuon.com/wpf-ui"
+ mc:Ignorable="d"
Style="{StaticResource pluginMaskControl}"
Loaded="UserControl_Loaded"
d:DesignHeight="450" d:DesignWidth="800">
@@ -34,20 +32,59 @@
</Style>
</UserControl.Resources>
<Grid>
- <Grid.ColumnDefinitions>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition/>
+ </Grid.RowDefinitions>
+ <!--<Grid.ColumnDefinitions>
<ColumnDefinition Width="7.5*"/>
<ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <local:TestResultView x:Name="testResultView" Grid.Column="0" Loaded="testResultView_Loaded" />
- <StackPanel Grid.Column="1" Background="#FFF">
- <GroupBox Header="{DynamicResource Tr.ProductInfo}">
- <ComboBox x:Name="modelSelect" Style="{StaticResource FormComboxStyle}"
+ </Grid.ColumnDefinitions>-->
+ <local:TestResultView x:Name="testResultView" Grid.Row="1" Grid.Column="0" Loaded="testResultView_Loaded" />
+ <DockPanel Margin="10,0" Grid.Row="0" Grid.Column="1" Background="#FFF" VerticalAlignment="Center">
+ <pu:FormGroup DockPanel.Dock="Right">
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center" dp:StackPanelHelper.ChildSpace="20">
+ <Button x:Name="btnStart" Click="Start_Click" Style="{StaticResource SuccessButton}"
+ Width="100" FontSize="14" Padding="0" Height="30" Content="{DynamicResource App.Start}"/>
+
+ <Button x:Name="btnStop" Click="Stop_Click" Style="{StaticResource DangerButton}"
+ Width="100" FontSize="14" Padding="0" Height="30"
+ Content="{DynamicResource App.Stop}"/>
+
+ <Button x:Name="btnClear" Click="BtnClear_Click" Style="{StaticResource PrimaryButton}"
+ Width="100" FontSize="14" Padding="0" Height="30"
+ Content="{DynamicResource Ts.BtnClearNum}"/>
+
+ <Button x:Name="scannerSetting" Click="ScannerSetting_Click" Style="{StaticResource PrimaryButton}"
+ Width="100" FontSize="14" Padding="0" Height="30" Content="鎵爜鏋缃�" Cursor="Hand"/>
+
+ <!--<Button x:Name="btnScan1" Click="Scan_Click_1" Style="{StaticResource PrimaryButton}"
+ Content="{DynamicResource Tr.Zone1Scan}"/>
+
+ <Button x:Name="btnScan2" Click="Scan_Click_2" Style="{StaticResource PrimaryButton}"
+ Content="{DynamicResource Tr.Zone2Scan}"/>-->
+ </StackPanel>
+ </pu:FormGroup>
+ <pu:FormGroup Header="{DynamicResource Tr.ProductInfo}" FontSize="16" Visibility="Collapsed">
+ <ComboBox x:Name="modelSelect" Style="{StaticResource FormComboxStyle}" Width="200"
+ Height="28"
pu:ComboBoxHelper.ClearButtonVisibility="Collapsed"
SelectionChanged="modelSelect_SelectionChanged"/>
- </GroupBox>
- <GroupBox Header="{DynamicResource Tr.Status}">
- <StackPanel>
- <Label HorizontalContentAlignment="Center" HorizontalAlignment="Stretch">
+ </pu:FormGroup>
+
+ <pu:FormGroup Header="娴嬭瘯绋嬪簭" FontSize="16">
+ <TextBox IsReadOnly="True" x:Name="tbFileName" Style="{StaticResource EditorTextBoxStyle}" Width="200"
+Height="28" Text="{Binding FileName}"/>
+ </pu:FormGroup>
+
+ <pu:FormGroup>
+ <std:StdEnableMes DockPanel.Dock="Left" FontSize="20" ValueChanged="StdEnableMes_ValueChanged"/>
+ </pu:FormGroup>
+
+
+ <!--<pu:FormGroup Header="{DynamicResource Tr.Status}" FontSize="16">
+ <StackPanel Orientation="Horizontal" dp:StackPanelHelper.ChildSpace="10">
+ <Label HorizontalContentAlignment="Center" VerticalAlignment="Center">
<Label.Style>
<Style TargetType="Label">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
@@ -73,6 +110,7 @@
<Style TargetType="Label">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
+ <Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Content" Value="{Binding produceStatus}"/>
<Setter Property="Margin" Value="0,10"/>
<Style.Triggers>
@@ -93,28 +131,7 @@
</Label.Style>
</Label>
</StackPanel>
- </GroupBox>
- <GroupBox Header="鎿嶄綔">
- <StackPanel dp:StackPanelHelper.ChildSpace="20">
- <Button x:Name="btnStart" Click="Start_Click" Style="{StaticResource SuccessButton}"
- Content="{DynamicResource App.Start}"/>
-
- <Button x:Name="btnStop" Click="Stop_Click" Style="{StaticResource DangerButton}"
- Content="{DynamicResource App.Stop}"/>
-
- <Button x:Name="btnClear" Click="BtnClear_Click" Style="{StaticResource PrimaryButton}"
- Content="{DynamicResource Ts.BtnClearNum}"/>
-
- <Button x:Name="scannerSetting" Click="ScannerSetting_Click" Style="{StaticResource PrimaryButton}"
- Content="鎵爜鏋缃�"/>
-
- <!--<Button x:Name="btnScan1" Click="Scan_Click_1" Style="{StaticResource PrimaryButton}"
- Content="{DynamicResource Tr.Zone1Scan}"/>
-
- <Button x:Name="btnScan2" Click="Scan_Click_2" Style="{StaticResource PrimaryButton}"
- Content="{DynamicResource Tr.Zone2Scan}"/>-->
- </StackPanel>
- </GroupBox>
- </StackPanel>
+ </pu:FormGroup>-->
+ </DockPanel>
</Grid>
</hb:PluginMaskControl>
diff --git a/Plugin.TestResult/ViewControl.xaml.cs b/Plugin.TestResult/ViewControl.xaml.cs
index 13cb7c7..1d140ef 100644
--- a/Plugin.TestResult/ViewControl.xaml.cs
+++ b/Plugin.TestResult/ViewControl.xaml.cs
@@ -2,6 +2,7 @@
using HMI.Core.Entity;
using HMI.Core.Manager;
using HMI.Core.Util;
+using HMI.StdControl;
using HMI.UI;
using HMI.UI.Util;
using log4net;
@@ -13,6 +14,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
+using System.Threading;
using System.Windows;
using System.Windows.Controls;
@@ -30,7 +32,6 @@
private double TestVoltage = 12;
private double Time_Heating_Low = 300;
private double Time_Heating_High = 2400;
- private string testSeqFile;
private Scanner scannerWindow1;
private Scanner scannerWindow2;
/// <summary>
@@ -57,6 +58,14 @@
set => Set(ref _produceStatus, value);
}
+ private string _fileName;
+
+ public string FileName
+ {
+ get => _fileName;
+ set => Set(ref _fileName, value);
+ }
+
public override void SetLogger(ILog logger)
{
base.SetLogger(logger);
@@ -76,6 +85,8 @@
this.btnStop.IsEnabled = value;
}
}
+
+ private bool AutoExecuteSeq = true;
public ViewControl()
{
@@ -107,6 +118,28 @@
}
SannerIniFile = path;
LoadProduct();
+
+ try
+ {
+ var value = ParameterManager.GetCommonParameterByName("AutoExecuteSeq");
+ AutoExecuteSeq = bool.Parse(value.Value);
+ }
+ catch
+ {
+ AutoExecuteSeq = true;
+ }
+
+ try
+ {
+ var value = ParameterManager.GetCommonParameterByName("BurnInMainSeq");
+ testResultView.testSeqFile = value.Value;
+ FileName = Path.GetFileName(value.Value);
+ }
+ catch
+ {
+ testResultView.testSeqFile = string.Empty;
+ FileName = string.Empty;
+ }
}
public override void DoClose(object sender, EventArgs e)
@@ -136,16 +169,22 @@
int MethodCode = Convert.ToInt16(e.uiMsg.NumericData);
string strData;
- if (EventCase != 10014) return;
-
try
{
- log.Info($"EventCase: {EventCase}, MethodCode: {MethodCode}, StrData: {e.uiMsg.StringData}");
+ log.Debug($"EventCase: {EventCase}, MethodCode: {MethodCode}, StrData: {e.uiMsg.StringData}");
}
catch
{
}
+
+ if (EventCase == 8)
+ {
+ IsRunning = false;
+ return;
+ }
+
+ if (EventCase != 10014) return;
if (MethodCode == 0)
{
@@ -178,24 +217,45 @@
private bool isLoaded;
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
- new MaskWindow(Window.GetWindow(this), (win) =>
+ if (AutoExecuteSeq)
{
- try
+ ShowMask(() =>
{
Dispatcher.BeginInvoke(new Action(() =>
{
Start_Click(null, null);
- Loaded -= UserControl_Loaded;
- }));
- }
- finally
+ }), System.Windows.Threading.DispatcherPriority.Background);
+ }, (ex) =>
{
- Dispatcher.Invoke(() =>
- {
- win.Close();
- });
- }
- }).Info(LangUtil.Get("Ts.SequenceIsStarting"), 100);
+ ToastHelper.Error("Loaded Failed.");
+ log.Error("Loaded Failed.", ex);
+ }, "璇风◢鍚�", LangUtil.Get("Ts.SequenceIsStarting"));
+ }
+ else
+ {
+ IsRunning = false;
+ }
+ Loaded -= UserControl_Loaded;
+
+
+ //new MaskWindow(Window.GetWindow(this), (win) =>
+ //{
+ // try
+ // {
+ // Dispatcher.BeginInvoke(new Action(() =>
+ // {
+ // Start_Click(null, null);
+ // Loaded -= UserControl_Loaded;
+ // }));
+ // }
+ // finally
+ // {
+ // Dispatcher.Invoke(() =>
+ // {
+ // win.Close();
+ // });
+ // }
+ //}).Info(LangUtil.Get("Ts.SequenceIsStarting"), 100);
//ShowMask(() =>
//{
@@ -254,7 +314,7 @@
//this.SaftyTemperature = Convert.ToDouble(this.parameterManager.Find("SaftyTemperature").ParmValue);
//this.Time_Heating_Low = Convert.ToDouble(this.parameterManager.Find("Time_Heat_Low").ParmValue);
//this.Time_Heating_High = Convert.ToDouble(this.parameterManager.Find("Time_Heat_High").ParmValue);
- testResultView.testSeqFile = parameters.FirstOrDefault(p => p.Name == "TestSequence")?.Value;
+ //testResultView.testSeqFile = parameters.FirstOrDefault(p => p.Name == "TestSequence")?.Value;
testResultView.engine.Globals.SetValString("ProductModel", 0, currentModel);
testResultView.engine.CommitGlobalsToDisk(promptOnSaveConflicts: false);
@@ -269,6 +329,12 @@
{
try
{
+ if (string.IsNullOrEmpty(testResultView.testSeqFile))
+ {
+ MsgBoxHelper2.Warn("璇峰厛璁剧疆BurnInMainSeq灞炴��!");
+ IsRunning = false;
+ return;
+ }
testResultView.StartTestSequence();
IsRunning = true;
}
@@ -293,70 +359,6 @@
MsgBoxHelper.Error(Window.GetWindow(this),
$"{this.lang("Ts.StopTestSequenceFailed")}: {ex.Message}");
}
- }
-
- private void Scan_Click_1(object sender, RoutedEventArgs e)
- {
- if (scannerWindow1 == null)
- {
- scannerWindow1 = new Scanner(this.lang("Tr.Zone1Scan"))
- {
- Tag = "Zone1"
- };
- scannerWindow1.FinishBarcode += ScannerWindow_FinishBarcode;
- //scannerWindow1.Owner = Window.GetWindow(this);
- scannerWindow1.Closed += ScannerWindow1_Closed;
- scannerWindow1.Show();
- }
- else
- {
- scannerWindow1.Activate();
- }
- }
-
- private void Scan_Click_2(object sender, RoutedEventArgs e)
- {
- if (scannerWindow2 == null)
- {
- scannerWindow2 = new Scanner(this.lang("Tr.Zone2Scan"))
- {
- Tag = "Zone2"
- };
- scannerWindow2.FinishBarcode += ScannerWindow_FinishBarcode;
- scannerWindow2.Owner = Window.GetWindow(this);
- scannerWindow2.Closed += ScannerWindow2_Closed;
- scannerWindow2.Show();
- }
- else
- {
- scannerWindow2.Activate();
- }
- }
-
- /// <summary>
- /// 鎵爜瀹屾垚閫昏緫
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ScannerWindow_FinishBarcode(object sender, BarcodeEventArg e)
- {
- if (this.SequenceContext == null) return;
- CellInfo cellInfo = codeParser.GetCellInfoByCode(e.positionCode);
-
- string paramName = e.name == "Zone1" ? "StationState.StartScanner_A" : "StationState.StartScanner_B";
- testResultView.engine.Globals.SetValBoolean(paramName, 0, true);
- string positionCode = e.positionCode, snrCode = e.snrCode;
- //闇�瑕佸鍔犳潯鐮佹牎楠屽姛鑳�
-
- //灏嗚鍒扮殑鏉$爜鍐欏叆鍒癝N涓�
- int dutNo = Convert.ToInt16(positionCode.Split('-')[2]) - 1;
- string LookupStr = e.name == "Zone1" ? $"StationState.SN[{dutNo}]" : $"StationState.SN[{(dutNo + 54)}]";
- //this.SequenceContext.StationGlobals.SetValString(LookupStr, 0, snrCode);
- //string code = this.SequenceContext.StationGlobals.GetValString(LookupStr, 0);
-
- testResultView.engine.Globals.SetValString(LookupStr, 0, snrCode);
- string code = testResultView.engine.Globals.GetValString(LookupStr, 0);
- testResultView.nameTables[cellInfo.OvenName].GetSingleCell(cellInfo.Index).SetStatus("hadCode");
}
private void ScannerWindow1_Closed(object sender, EventArgs e)
@@ -391,5 +393,10 @@
};
setting.Open(false, "Config");
}
+
+ private void StdEnableMes_ValueChanged(object sender, StdUIEventArg e)
+ {
+ testResultView.SequenceContext?.StationGlobals.SetValBoolean($"SystemSetting.{e.StringValue}", 1, e.BoolValue);
+ }
}
}
diff --git a/Plugin.TsExecution/Properties/AssemblyInfo.cs b/Plugin.TsExecution/Properties/AssemblyInfo.cs
index 66e36ba..7fb240e 100644
--- a/Plugin.TsExecution/Properties/AssemblyInfo.cs
+++ b/Plugin.TsExecution/Properties/AssemblyInfo.cs
@@ -49,6 +49,6 @@
// 鐢熸垚鍙�
// 淇鍙�
//
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.1")]
+[assembly: AssemblyVersion("1.0.0.2")]
+[assembly: AssemblyFileVersion("1.0.0.2")]
[assembly: PluginClassName("Plugin.TsExecution.TsExecution")]
diff --git a/Plugin.TsExecution/SingleControl.xaml b/Plugin.TsExecution/SingleControl.xaml
index 06c8185..ff6a19b 100644
--- a/Plugin.TsExecution/SingleControl.xaml
+++ b/Plugin.TsExecution/SingleControl.xaml
@@ -354,8 +354,7 @@
RowHeight="{StaticResource nanD}"
ColumnHeaderHeight="{Binding ActualWidth,ElementName=control,
Converter={StaticResource fc}, ConverterParameter='32,1093,30,45'}"
- ItemsSource="{Binding Datasource}"
- x:Name="table">
+ ItemsSource="{Binding Datasource}" x:Name="table">
<DataGrid.Resources>
<Style TargetType="DataGridCell"
BasedOn="{StaticResource {x:Static pu:StyleKeys.DataGridCellStyle}}">
diff --git a/Plugin.TsExecution/SingleControl.xaml.cs b/Plugin.TsExecution/SingleControl.xaml.cs
index a31533f..8c3aec9 100644
--- a/Plugin.TsExecution/SingleControl.xaml.cs
+++ b/Plugin.TsExecution/SingleControl.xaml.cs
@@ -25,7 +25,6 @@
protected void Set([CallerMemberName] string name = null)
{
-
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
@@ -221,8 +220,8 @@
public SingleControl(int Index, string CountIniPath, int probeWarn)
{
- this.CountIniPath = CountIniPath;
DataContext = this;
+ this.CountIniPath = CountIniPath;
this.index = Index;
ProbeWarn = probeWarn;
@@ -550,14 +549,6 @@
//var modal = scannerVisualModal;
//Canvas.SetLeft(modal, (scannerPanel.ActualWidth - scannerVisualModal.ActualWidth) / 2);
//Canvas.SetTop(modal, (scannerPanel.ActualHeight - scannerVisualModal.ActualHeight) / 2);
- }
- }
-
- private void TextBlock_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
- {
- DependencyObject parent = VisualTreeHelper.GetParent((DependencyObject)sender);
- while (parent != null) {
- parent = VisualTreeHelper.GetParent(parent);
}
}
}
diff --git a/Plugin.TsExecution/TsExecution.xaml.cs b/Plugin.TsExecution/TsExecution.xaml.cs
index 11614c4..da56cd3 100644
--- a/Plugin.TsExecution/TsExecution.xaml.cs
+++ b/Plugin.TsExecution/TsExecution.xaml.cs
@@ -6,7 +6,6 @@
using HMI.Core.Util;
using HMI.MQUtil;
using HMI.UI;
-using HMI.UI.Controls;
using HMI.UI.Util;
using HMI.Util;
using log4net;
@@ -26,7 +25,6 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Forms.DataVisualization.Charting;
-using System.Windows.Media;
namespace Plugin.TsExecution
{
@@ -268,6 +266,7 @@
private SqliteHelper sqliteHelper;
private MQConnector mqConnector;
+ private int probeWarn;
public TsExecution()
{
@@ -279,6 +278,7 @@
//鍒濆鍖朤estStand寮曟搸
this.InitTestStandEngine();
}
+
public override void SetBaseFolder(string folder)
{
CountIniPath = Path.Combine(folder, "Count.ini");
@@ -330,8 +330,8 @@
{
this.ReadCount(out int pass, out int fail);
this.DisplayCount(pass, fail);
- InitProducts();
ReadConfig();
+ InitProducts();
CheckSqlHelper();
base.InitFinish();
}
@@ -352,30 +352,6 @@
{
HandleUIMessage(eventCode, index, strData);
}));
- }
-
- void createChildInNewThread(int index, string configFile, int probeWarn)
- {
- HostVisual hostVisual = new HostVisual();
-
- UIElement content = new VisualHost(hostVisual);
-
- System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ThreadStart(() =>
- {
- VisualTarget visualTarget = new VisualTarget(hostVisual);
-
- var control = new SingleControl(index, configFile, probeWarn);
- control.Arrange(new Rect(new Point(), content.RenderSize));
-
- visualTarget.RootVisual = control;
- tsSockets.Add(control);
- System.Windows.Threading.Dispatcher.Run();
- }));
- //panel.Children.Add(content);
-
- thread.SetApartmentState(System.Threading.ApartmentState.STA);
- thread.IsBackground = true;
- thread.Start();
}
/// <summary>
@@ -421,28 +397,19 @@
Products = ProductManager.GetProducts<ObservableCollection<ProductData>>();
if (Products != null && Products.Count > 0)
{
- List<ParameterData> parameters =
- ParameterManager.GetCommonParameter<List<ParameterData>>();
- string tmpNum = parameters?.FirstOrDefault(p => p.Name == "SocketNum")?.Value?.ToString();
- if (!string.IsNullOrEmpty(tmpNum))
- {
- this.socketNum = Convert.ToInt32(tmpNum);
- }
string lastModel = engine?.Globals.GetValString("StationState.ProductModel", 1);
-
+ var tempProduct = Products[0];
if (!string.IsNullOrEmpty(lastModel))
{
var product = Products.FirstOrDefault(p => p.Name == lastModel);
if (product != null)
{
- SelectedProduct = product;
- RefershUI();
- return;
+ tempProduct = product;
}
}
- SelectedProduct = Products[0];
- RefershUI();
+ SelectedProduct = tempProduct;
}
+ RefershUI();
SampleStatus = false;
}
@@ -552,25 +519,11 @@
private void RefershUI()
{
- ParameterData p = ParameterManager.GetCommonParameterByName("ProbeWarn");
- int ProbeWarn = 0;
- if (p != null)
- {
- try
- {
- ProbeWarn = Convert.ToInt32(p.Value);
- }
- catch
- {
- ProbeWarn = 0;
- }
- }
-
panel.Children.Clear();
//閲嶆柊鐢熸垚瀛愰潰鏉�
for (int i = 0; i < this.socketNum; i++)
{
- SingleControl control = new SingleControl(i, CountIniPath, ProbeWarn);
+ SingleControl control = new SingleControl(i, CountIniPath, this.probeWarn);
panel.Children.Add(control);
tsSockets.Add(control);
@@ -641,6 +594,19 @@
catch
{
flag = false;
+ }
+
+ try
+ {
+ value = ParameterManager.GetCommonParameterByName("SocketNum");
+ if (value != null)
+ {
+ this.socketNum = int.Parse(value.Value);
+ }
+ }
+ catch
+ {
+ this.socketNum = 2;
}
if (flag)
@@ -860,26 +826,23 @@
tsModelPath = @"C:\Users\Public\Documents\National Instruments\TestStand 2020 (64-bit)\Components\Models\ParallelModel.seq";
}
+ try
+ {
+ value = ParameterManager.GetCommonParameterByName("ProbeWarn");
+ probeWarn = int.Parse(value?.Value);
+ }
+ catch
+ {
+ probeWarn = 0;
+ }
//Convert.ToBoolean(IniFileHelper.ReadIniData("Config", "EnableMes", "true", CountIniPath));
//EnableCanLog = Convert.ToBoolean(IniFileHelper.ReadIniData("Config", "EnableCanLog", "true", CountIniPath));
//EnableDebugMode = Convert.ToBoolean(IniFileHelper.ReadIniData("Config", "EnableDebugMode", "true", CountIniPath));
}
- //private void WriteToTsWhenInit()
- //{
- // foreach (var ts in tsSockets)
- // {
- // ts?.SequenceFileContext?.StationGlobals.SetValBoolean($"SystemSetting.EnableMes", 1, EnableMes);
- // ts?.SequenceFileContext?.StationGlobals.SetValBoolean($"SystemSetting.EnableNGPause", 1, EnableNGPause);
- // ts?.SequenceFileContext?.StationGlobals.SetValBoolean($"SystemSetting.EnableCanLog", 1, EnableCanLog);
- // ts?.SequenceFileContext?.StationGlobals.SetValBoolean($"SystemSetting.EnableDebugMode", 1, EnableDebugMode);
- // }
- //}
-
private bool WriteConfig(string name, bool value)
{
- //IniFileHelper.WriteIniData("Config", name, value.ToString(), CountIniPath);
try
{
if (ParameterManager.UpdateCommonParameter(name, value, out string errMsg))
@@ -1170,21 +1133,30 @@
this.tsSockets[index].WriteToCSV(csvPath);
}
+ public void SaveTemplateCSV(int index)
+ {
+ var time = DateTime.Now;
+ string status = this.tsSockets[index].Status == "Passed" ? "PASS" : "FAIL";
+ string csvPath = Path.Combine(csvDir, SelectedProduct?.Name ?? "鏈煡浜у搧", time.ToString("yyyyMMdd"), status, $"{this.tsSockets[index].Barcode}-{time.ToString("HHmmss")}.csv");
+ this.tsSockets[index].WriteToCSV(csvPath);
+ }
+
public void SavePositionDB(int index, string status)
{
CheckSqlHelper();
var socket = this.tsSockets[index];
var time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
string snr = socket.Barcode;
+ string model = SelectedProduct?.Name;
List<string> sqls = new List<string>();
foreach (var data in socket.Datasource)
{
- sqls.Add($@"INSERT INTO serialData (sn,model,station,step,limitDown,limitUp,unit,value,status,finalStatus,consumeTime,totalConsumeTime,time) VALUES
-('{snr}','{socket.Model}','','{data.Name}','{data.LimitDown}','{data.LimitUp}','{data.Unit}','{data.Value}','{data.Result}','{socket.Status}','{data.ConsumeTime}','{socket.ElapseTime}','{time}')");
+ sqls.Add($@"INSERT INTO serialData (sn,model,station,step,position,limitDown,limitUp,unit,value,status,finalStatus,consumeTime,totalConsumeTime,time) VALUES
+('{snr}','{model}','','{data.Name}','{index}','{data.LimitDown}','{data.LimitUp}','{data.Unit}','{data.Value}','{data.Result}','{socket.Status}','{data.ConsumeTime}','{socket.ElapseTime}','{time}')");
}
sqls.Add($@"INSERT INTO testResult (sn,model,station,result,time,position,status) VALUES
-('{snr}','{socket.Model}','','{socket.Status}','{time}','{index}','{status}')");
+('{snr}','{model}','','{socket.Status}','{time}','{index}','{status}')");
sqliteHelper.ExecuteBatchSql(sqls);
}
@@ -1272,9 +1244,30 @@
this.tsSockets[index].SetTestProcess(ProcessVal);
break;
case 10031://瀵煎嚭CSV
- string[] datas = strData.Split(';');
- SavePositionCSV(index, datas[0]);
- SavePositionDB(index, datas[1]);
+ if (string.IsNullOrEmpty(strData))
+ {
+ SaveTemplateCSV(index);
+ return;
+ }
+ try
+ {
+ string[] datas = strData.Split(';');
+ SavePositionCSV(index, datas[0]);
+ if (datas.Length >= 2)
+ {
+ SavePositionDB(index, datas[1]);
+ }
+ else
+ {
+ var sss = this.tsSockets[index].Status;
+ SavePositionDB(index, sss);
+ }
+ }
+ catch (Exception ex)
+ {
+ log.Warn("10031 Error.", ex);
+ SaveTemplateCSV(index);
+ }
break;
case 10032://鎸変笅鏍囨殏鍋滄祴璇�
this.tsSockets[index].ShowPausePanel();
diff --git a/SimpleUtil/DIOController/DIOController.csproj b/SimpleUtil/DIOController/DIOController.csproj
index 21817a0..82431c8 100644
--- a/SimpleUtil/DIOController/DIOController.csproj
+++ b/SimpleUtil/DIOController/DIOController.csproj
@@ -51,12 +51,6 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\..\..\hslCommunicationV12.0.3甯︽簮鐮乨emo\HslCommunication\HslCommunication.csproj">
- <Project>{aa30059e-7269-415c-9df2-55c310dd5548}</Project>
- <Name>HslCommunication</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
<Content Include="PCI-Dask64.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
diff --git a/SimpleUtil/HMI.Simple.Util/ProductUtil.cs b/SimpleUtil/HMI.Simple.Util/ProductUtil.cs
index a6969e3..9a7e156 100644
--- a/SimpleUtil/HMI.Simple.Util/ProductUtil.cs
+++ b/SimpleUtil/HMI.Simple.Util/ProductUtil.cs
@@ -16,7 +16,7 @@
}
else if (data.Type == "Int")
{
- context.FileGlobals.SetValInteger64($"DUTSetting.{data.Name}", 1, int.Parse(data.Value));
+ context.FileGlobals.SetValNumber($"DUTSetting.{data.Name}", 1, int.Parse(data.Value));
}
else if (data.Type == "Double")
{
diff --git a/SimpleUtil/HMI.Util.Base/AlarmUtil.cs b/SimpleUtil/HMI.Util.Base/AlarmUtil.cs
new file mode 100644
index 0000000..587a6e1
--- /dev/null
+++ b/SimpleUtil/HMI.Util.Base/AlarmUtil.cs
@@ -0,0 +1,66 @@
+锘縰sing System;
+using System.Diagnostics;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Windows;
+using System.Windows.Interop;
+
+namespace HMI.Util.Base
+{
+ public interface AlarmBase
+ {
+
+ bool? Alarm(string message);
+ }
+
+ public class AlarmUtil
+ {
+ [DllImport("kernel32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
+ public static extern IntPtr GetModuleHandle(string lpModuleName);
+
+ [DllImport("user32.dll")]
+ private static extern bool IsWindow(IntPtr hWnd);
+
+ [DllImport("user32.dll")]
+ private static extern int GetClassName(IntPtr hWnd, System.Text.StringBuilder lpClassName, int nMaxCount);
+
+ [DllImport("user32.dll")]
+ private static extern bool SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
+
+
+ /// <summary>
+ /// 鏍规嵁绐楀彛鏍囬鑾峰彇WPF绐楀彛瀵硅薄
+ /// </summary>
+ /// <param name="windowTitle">绐楀彛鏍囬</param>
+ /// <returns>WPF绐楀彛瀵硅薄锛屽鏋滄湭鎵惧埌鍒欒繑鍥瀗ull</returns>
+ public static IntPtr GetProcessIdByName(string windowTitle)
+ {
+ Process[] processes = Process.GetProcesses();
+ foreach (Process process in processes)
+ {
+ if (process.ProcessName == windowTitle)
+ {
+ var handle = process.MainWindowHandle;
+ Console.WriteLine(process.MainWindowHandle.ToString());
+ Console.WriteLine(IsWindow(process.MainWindowHandle));
+ var className = new System.Text.StringBuilder(256);
+ GetClassName(handle, className, className.Capacity);
+ Console.WriteLine(className.ToString());
+
+ Console.WriteLine(SendMessage(handle, 0x12, IntPtr.Zero, IntPtr.Zero));
+
+
+ var source = HwndSource.FromHwnd(process.MainWindowHandle);
+ var v = source?.RootVisual;
+ if (v is AlarmBase ab) Console.WriteLine(ab.Alarm("123").ToString());
+ return process.MainWindowHandle;
+ }
+ }
+
+
+ return IntPtr.Zero;
+ }
+
+
+ }
+}
diff --git a/SimpleUtil/HMI.Util.Base/HMI.Util.Base.csproj b/SimpleUtil/HMI.Util.Base/HMI.Util.Base.csproj
index 4404d58..de652e8 100644
--- a/SimpleUtil/HMI.Util.Base/HMI.Util.Base.csproj
+++ b/SimpleUtil/HMI.Util.Base/HMI.Util.Base.csproj
@@ -49,6 +49,8 @@
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="PresentationCore" />
+ <Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
@@ -57,8 +59,10 @@
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
+ <Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="AlarmUtil.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RegUtil.cs" />
</ItemGroup>
diff --git a/VisionBuilder.Engine/Runner.cs b/VisionBuilder.Engine/Runner.cs
deleted file mode 100644
index 83114c1..0000000
--- a/VisionBuilder.Engine/Runner.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace VisionBuilder.Engine
-{
- public class Runner
- {
- }
-}
diff --git a/VisionBuilder.Engine/app.config b/VisionBuilder.Engine/app.config
deleted file mode 100644
index d23a83e..0000000
--- a/VisionBuilder.Engine/app.config
+++ /dev/null
@@ -1,19 +0,0 @@
-锘�<?xml version="1.0" encoding="utf-8"?>
-<configuration>
- <runtime>
- <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.ComponentModel.Annotations" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
- </dependentAssembly>
- </assemblyBinding>
- </runtime>
-</configuration>
\ No newline at end of file
diff --git a/VisionBuilder.Run/Properties/AssemblyInfo.cs b/VisionBuilder.Run/Properties/AssemblyInfo.cs
deleted file mode 100644
index 63a35d4..0000000
--- a/VisionBuilder.Run/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-锘縰sing System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Windows;
-
-// 鏈夊叧绋嬪簭闆嗙殑涓�鑸俊鎭敱浠ヤ笅
-// 鎺у埗銆傛洿鏀硅繖浜涚壒鎬у�煎彲淇敼
-// 涓庣▼搴忛泦鍏宠仈鐨勪俊鎭��
-[assembly: AssemblyTitle("VisionBuilder.Run")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Organization")]
-[assembly: AssemblyProduct("VisionBuilder.Run")]
-[assembly: AssemblyCopyright("Copyright 漏 Organization 2025")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// 灏� ComVisible 璁剧疆涓� false 浼氫娇姝ょ▼搴忛泦涓殑绫诲瀷
-//瀵� COM 缁勪欢涓嶅彲瑙併�傚鏋滈渶瑕佷粠 COM 璁块棶姝ょ▼搴忛泦涓殑绫诲瀷
-//璇峰皢姝ょ被鍨嬬殑 ComVisible 鐗规�ц缃负 true銆�
-[assembly: ComVisible(false)]
-
-//鑻ヨ寮�濮嬬敓鎴愬彲鏈湴鍖栫殑搴旂敤绋嬪簭锛岃璁剧疆
-//.csproj 鏂囦欢涓殑 <UICulture>CultureYouAreCodingWith</UICulture>
-//鍦� <PropertyGroup> 涓�備緥濡傦紝濡傛灉浣犱娇鐢ㄧ殑鏄編鍥借嫳璇��
-//浣跨敤鐨勬槸缇庡浗鑻辫锛岃灏� <UICulture> 璁剧疆涓� en-US銆� 鐒跺悗鍙栨秷
-//瀵逛互涓� NeutralResourceLanguage 鐗规�х殑娉ㄩ噴銆� 鏇存柊
-//浠ヤ笅琛屼腑鐨勨�渆n-US鈥濅互鍖归厤椤圭洰鏂囦欢涓殑 UICulture 璁剧疆銆�
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
-[assembly:ThemeInfo(
- ResourceDictionaryLocation.None, //涓婚鐗瑰畾璧勬簮璇嶅吀鎵�澶勪綅缃�
- //(鏈湪椤甸潰涓壘鍒拌祫婧愭椂浣跨敤锛�
- //鎴栧簲鐢ㄧ▼搴忚祫婧愬瓧鍏镐腑鎵惧埌鏃朵娇鐢�)
- ResourceDictionaryLocation.SourceAssembly //甯歌璧勬簮璇嶅吀鎵�澶勪綅缃�
- //(鏈湪椤甸潰涓壘鍒拌祫婧愭椂浣跨敤锛�
- //銆佸簲鐢ㄧ▼搴忔垨浠讳綍涓婚涓撶敤璧勬簮瀛楀吀涓壘鍒版椂浣跨敤)
-)]
-
-
-// 绋嬪簭闆嗙殑鐗堟湰淇℃伅鐢变笅鍒楀洓涓�肩粍鎴�:
-//
-// 涓荤増鏈�
-// 娆$増鏈�
-// 鐢熸垚鍙�
-// 淇鍙�
-//
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/VisionBuilder.Run/Properties/Resources.Designer.cs b/VisionBuilder.Run/Properties/Resources.Designer.cs
deleted file mode 100644
index d74c4aa..0000000
--- a/VisionBuilder.Run/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-锘�//------------------------------------------------------------------------------
-// <auto-generated>
-// 姝や唬鐮佺敱宸ュ叿鐢熸垚銆�
-// 杩愯鏃剁増鏈�: 4.0.30319.42000
-//
-// 瀵规鏂囦欢鐨勬洿鏀瑰彲鑳藉鑷翠笉姝g‘鐨勮涓猴紝濡傛灉
-// 閲嶆柊鐢熸垚浠g爜锛屽垯鎵�鍋氭洿鏀瑰皢涓㈠け銆�
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace VisionBuilder.Run.Properties {
-
-
- /// <summary>
- /// 寮虹被鍨嬭祫婧愮被锛岀敤浜庢煡鎵炬湰鍦板寲瀛楃涓茬瓑銆�
- /// </summary>
- // 姝ょ被鏄敱 StronglyTypedResourceBuilder
- // 绫婚�氳繃绫讳技浜� ResGen 鎴� Visual Studio 鐨勫伐鍏疯嚜鍔ㄧ敓鎴愮殑銆�
- // 鑻ヨ娣诲姞鎴栫Щ闄ゆ垚鍛橈紝璇风紪杈� .ResX 鏂囦欢锛岀劧鍚庨噸鏂拌繍琛� ResGen
- // (浠� /str 浣滀负鍛戒护閫夐」)锛屾垨閲嶆柊鐢熸垚 VS 椤圭洰銆�
- [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>
- /// 杩斿洖姝ょ被浣跨敤鐨勭紦瀛� ResourceManager 瀹炰緥銆�
- /// </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("VisionBuilder.Run.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// 閲嶅啓褰撳墠绾跨▼鐨� CurrentUICulture 灞炴�э紝瀵�
- /// 浣跨敤姝ゅ己绫诲瀷璧勬簮绫荤殑鎵�鏈夎祫婧愭煡鎵炬墽琛岄噸鍐欍��
- /// </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/VisionBuilder.Run/Properties/Resources.resx b/VisionBuilder.Run/Properties/Resources.resx
deleted file mode 100644
index af7dbeb..0000000
--- a/VisionBuilder.Run/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-锘�<?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/VisionBuilder.Run/Properties/Settings.Designer.cs b/VisionBuilder.Run/Properties/Settings.Designer.cs
deleted file mode 100644
index 90546e5..0000000
--- a/VisionBuilder.Run/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-锘�//------------------------------------------------------------------------------
-// <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 VisionBuilder.Run.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/VisionBuilder.Run/Properties/Settings.settings b/VisionBuilder.Run/Properties/Settings.settings
deleted file mode 100644
index 033d7a5..0000000
--- a/VisionBuilder.Run/Properties/Settings.settings
+++ /dev/null
@@ -1,7 +0,0 @@
-锘�<?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/VisionBuilder.Run/VisionBuilder.Run.csproj b/VisionBuilder.Run/VisionBuilder.Run.csproj
deleted file mode 100644
index 454f928..0000000
--- a/VisionBuilder.Run/VisionBuilder.Run.csproj
+++ /dev/null
@@ -1,92 +0,0 @@
-<?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>{7C299AED-88CC-437E-A68B-1550AA72E6B0}</ProjectGuid>
- <OutputType>library</OutputType>
- <RootNamespace>VisionBuilder.Run</RootNamespace>
- <AssemblyName>VisionBuilder.Run</AssemblyName>
- <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <WarningLevel>4</WarningLevel>
- <Deterministic>true</Deterministic>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\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>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
- <DebugSymbols>true</DebugSymbols>
- <OutputPath>bin\x64\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <DebugType>full</DebugType>
- <PlatformTarget>x64</PlatformTarget>
- <LangVersion>7.3</LangVersion>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
- <OutputPath>bin\x64\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <Optimize>true</Optimize>
- <DebugType>pdbonly</DebugType>
- <PlatformTarget>x64</PlatformTarget>
- <LangVersion>7.3</LangVersion>
- <ErrorReport>prompt</ErrorReport>
- </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="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>
- <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>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-</Project>
\ No newline at end of file
diff --git a/VisionBuilder.Test/PluginOne.cs b/VisionBuilder.Test/PluginOne.cs
deleted file mode 100644
index ca5baf2..0000000
--- a/VisionBuilder.Test/PluginOne.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-锘縰sing System.Collections.Generic;
-using HMI.Core.Api;
-using HMI.Core.Entity;
-
-namespace VisionBuilder.Test
-{
- public class PluginOne
- {
- }
-}
diff --git a/VisionBuilder.Test/Properties/AssemblyInfo.cs b/VisionBuilder.Test/Properties/AssemblyInfo.cs
deleted file mode 100644
index 3fc0b33..0000000
--- a/VisionBuilder.Test/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-锘縰sing System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// 鏈夊叧绋嬪簭闆嗙殑涓�鑸俊鎭敱浠ヤ笅
-// 鎺у埗銆傛洿鏀硅繖浜涚壒鎬у�煎彲淇敼
-// 涓庣▼搴忛泦鍏宠仈鐨勪俊鎭��
-[assembly: AssemblyTitle("VisionBuilder.Test")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("HP Inc.")]
-[assembly: AssemblyProduct("VisionBuilder.Test")]
-[assembly: AssemblyCopyright("Copyright 漏 HP Inc. 2024")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// 灏� ComVisible 璁剧疆涓� false 浼氫娇姝ょ▼搴忛泦涓殑绫诲瀷
-//瀵� COM 缁勪欢涓嶅彲瑙併�傚鏋滈渶瑕佷粠 COM 璁块棶姝ょ▼搴忛泦涓殑绫诲瀷
-//璇峰皢姝ょ被鍨嬬殑 ComVisible 鐗规�ц缃负 true銆�
-[assembly: ComVisible(false)]
-
-// 濡傛灉姝ら」鐩悜 COM 鍏紑锛屽垯涓嬪垪 GUID 鐢ㄤ簬绫诲瀷搴撶殑 ID
-[assembly: Guid("6e1cc97a-b3cb-4e9f-94e0-f264de0d8298")]
-
-// 绋嬪簭闆嗙殑鐗堟湰淇℃伅鐢变笅鍒楀洓涓�肩粍鎴�:
-//
-// 涓荤増鏈�
-// 娆$増鏈�
-// 鐢熸垚鍙�
-// 淇鍙�
-//
-//鍙互鎸囧畾鎵�鏈夎繖浜涘�硷紝涔熷彲浠ヤ娇鐢ㄢ�滅敓鎴愬彿鈥濆拰鈥滀慨璁㈠彿鈥濈殑榛樿鍊�
-//閫氳繃浣跨敤 "*"锛屽涓嬫墍绀�:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/VisionBuilder.Test/VisionBuilder.Test.csproj b/VisionBuilder.Test/VisionBuilder.Test.csproj
deleted file mode 100644
index e9a3d64..0000000
--- a/VisionBuilder.Test/VisionBuilder.Test.csproj
+++ /dev/null
@@ -1,72 +0,0 @@
-锘�<?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>{6E1CC97A-B3CB-4E9F-94E0-F264DE0D8298}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>VisionBuilder.Test</RootNamespace>
- <AssemblyName>VisionBuilder.Test</AssemblyName>
- <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <Deterministic>true</Deterministic>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\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>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
- <DebugSymbols>true</DebugSymbols>
- <OutputPath>bin\x64\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <DebugType>full</DebugType>
- <PlatformTarget>x64</PlatformTarget>
- <LangVersion>7.3</LangVersion>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
- <OutputPath>bin\x64\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <Optimize>true</Optimize>
- <DebugType>pdbonly</DebugType>
- <PlatformTarget>x64</PlatformTarget>
- <LangVersion>7.3</LangVersion>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Core" />
- <Reference Include="System.Xml.Linq" />
- <Reference Include="System.Data.DataSetExtensions" />
- <Reference Include="Microsoft.CSharp" />
- <Reference Include="System.Data" />
- <Reference Include="System.Net.Http" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="PluginOne.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\HMI.Core\HMI.Core.csproj">
- <Project>{3e3bf44a-0b69-45c5-9512-528cb48a7106}</Project>
- <Name>HMI.Core</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-</Project>
\ No newline at end of file
diff --git a/VisionBuilder.Test/app.config b/VisionBuilder.Test/app.config
deleted file mode 100644
index d23a83e..0000000
--- a/VisionBuilder.Test/app.config
+++ /dev/null
@@ -1,19 +0,0 @@
-锘�<?xml version="1.0" encoding="utf-8"?>
-<configuration>
- <runtime>
- <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.ComponentModel.Annotations" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
- </dependentAssembly>
- </assemblyBinding>
- </runtime>
-</configuration>
\ No newline at end of file
diff --git a/WPFProject/App.config b/WPFProject/App.config
index 603cbae..30e1e75 100644
--- a/WPFProject/App.config
+++ b/WPFProject/App.config
@@ -3,13 +3,13 @@
<configSections>
<section name="TestResultConfig" type="System.Configuration.SingleTagSectionHandler" />
</configSections>
- <TestResultConfig Row="2" Column="3" PortStart="6660" PositionColumn="3" PositionCount="18" NameStr="A1,A2,A3,B1,B2,B3" />
+ <TestResultConfig Row="2" Column="2" PortStart="6660" PositionColumn="4" PositionCount="20" NameStr="A,B,C,D,E,F,G" CodeParserType="JK01" />
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <probing privatePath="Libs;ThirdParty;Plugin;3rds;" />
+ <probing privatePath="Libs;ThirdParty;Plugin;3rds;Api;" />
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
diff --git a/WPFProject/Config/log4net.config b/WPFProject/Config/log4net.config
index cc9e4f9..94554c2 100644
--- a/WPFProject/Config/log4net.config
+++ b/WPFProject/Config/log4net.config
@@ -31,7 +31,7 @@
</appender>
<root>
- <level value="INFO" />
+ <level value="DEBUG" />
<appender-ref ref="Console" />
<appender-ref ref="RollingFile" />
</root>
diff --git a/WPFProject/LoadingWindow.xaml b/WPFProject/LoadingWindow.xaml
index edb3d37..5a6125f 100644
--- a/WPFProject/LoadingWindow.xaml
+++ b/WPFProject/LoadingWindow.xaml
@@ -78,7 +78,7 @@
<Image Height="25"
Stretch="Uniform"
HorizontalAlignment="Left"
- Source="/Resources/JingCeLogo.png"
+ Source="/Icon/JingCeLogo.png"
Margin="0,0,0,10"
RenderOptions.BitmapScalingMode="HighQuality" />
diff --git a/WPFProject/Login.xaml b/WPFProject/Login.xaml
index 3bc96d1..2b57e75 100644
--- a/WPFProject/Login.xaml
+++ b/WPFProject/Login.xaml
@@ -94,7 +94,7 @@
<Image Height="25"
Stretch="Uniform"
HorizontalAlignment="Left"
- Source="/Resources/JingCeLogo.png"
+ Source="/Icon/JingCeLogo.png"
RenderOptions.BitmapScalingMode="HighQuality" />
<StackPanel Margin="0,50,0,0" Grid.Row="1" x:Name="formPanel" dp:StackPanelHelper.ChildSpace="20" >
<pu:FormGroup x:Name="FrmAccount"
diff --git a/WPFProject/PanuonWindow.xaml.cs b/WPFProject/PanuonWindow.xaml.cs
index f2026f0..494eb98 100644
--- a/WPFProject/PanuonWindow.xaml.cs
+++ b/WPFProject/PanuonWindow.xaml.cs
@@ -13,6 +13,8 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
+using HMI.Util.Base;
+using System.Windows.Interop;
namespace WPFProject
{
@@ -29,7 +31,7 @@
/// <summary>
/// PanuonWindow.xaml 鐨勪氦浜掗�昏緫
/// </summary>
- public partial class PanuonWindow : WindowX, IPluginContainer,IAlarmShow
+ public partial class PanuonWindow : WindowX, IPluginContainer,IAlarmShow, AlarmBase
{
public PanuonWindow()
{
@@ -259,6 +261,11 @@
sb.Loaded -= list_Loaded;
}
+ public bool? Alarm(string message)
+ {
+ return true;
+ }
+
//private void BaseWindow_Loaded(object sender, RoutedEventArgs e)
//{
// var s = (Style)this.Resources["WindowButton"];
diff --git a/WPFProject/WPFProject.csproj b/WPFProject/WPFProject.csproj
index f219855..57b3353 100644
--- a/WPFProject/WPFProject.csproj
+++ b/WPFProject/WPFProject.csproj
@@ -456,10 +456,6 @@
<Project>{a580de4a-34e7-4efe-ad2c-0871396000e9}</Project>
<Name>HMI.DataViewer</Name>
</ProjectReference>
- <ProjectReference Include="..\HMI.IOMonitor\HMI.IOMonitor.csproj">
- <Project>{f7663c79-7047-42f3-b129-73a2575ee7c6}</Project>
- <Name>HMI.IOMonitor</Name>
- </ProjectReference>
<ProjectReference Include="..\HMI.LogViewer\HMI.LogViewer.csproj">
<Project>{20c23602-b029-4e21-8c11-b9e5f2223237}</Project>
<Name>HMI.LogViewer</Name>
@@ -484,9 +480,9 @@
<Project>{de4205c6-5923-46fd-a4b9-65169bf61c75}</Project>
<Name>HMI.MenuManage</Name>
</ProjectReference>
- <ProjectReference Include="..\Plugin.ChangeModel\Plugin.ChangeModel.csproj">
- <Project>{ef5972b1-dd20-404d-b2b3-37e70e2a478a}</Project>
- <Name>Plugin.ChangeModel</Name>
+ <ProjectReference Include="..\Plugin.CurrentSensorControl\Plugin.CurrentSensorControl.csproj">
+ <Project>{e4505d51-248b-4c21-b0e3-a4b2a7551d6a}</Project>
+ <Name>Plugin.CurrentSensorControl</Name>
</ProjectReference>
<ProjectReference Include="..\Plugin.DataBoard\Plugin.DataBoard.csproj">
<Project>{be42ab26-3270-43e1-84b8-6929d862ff8d}</Project>
@@ -504,10 +500,6 @@
<Project>{968fe602-22d6-42bd-981c-601ad518a896}</Project>
<Name>Plugin.JarUI</Name>
</ProjectReference>
- <ProjectReference Include="..\Plugin.MaterialOpt\Plugin.MaterialOpt.csproj">
- <Project>{e1f90cbd-a0d4-48da-ab25-7f490935aa4a}</Project>
- <Name>Plugin.MaterialOpt</Name>
- </ProjectReference>
<ProjectReference Include="..\Plugin.ModelManage\Plugin.ModelManage.csproj">
<Project>{76ce4d21-702c-416f-95b4-f4f4c5b2d162}</Project>
<Name>Plugin.ModelManage</Name>
@@ -515,10 +507,6 @@
<ProjectReference Include="..\Plugin.SeqEditor\Plugin.SeqEditor.csproj">
<Project>{717fd815-ff95-4f30-b4d9-9cea978ca40e}</Project>
<Name>Plugin.SeqEditor</Name>
- </ProjectReference>
- <ProjectReference Include="..\Plugin.ServoManage\Plugin.ServoManage.csproj">
- <Project>{1853e00f-6865-4bc6-974b-6a5e1c00bafe}</Project>
- <Name>Plugin.ServoManage</Name>
</ProjectReference>
<ProjectReference Include="..\Plugin.TestResult\Plugin.TestResult.csproj">
<Project>{7375b74c-b6bf-4814-9838-e1caacad1897}</Project>
@@ -539,6 +527,10 @@
<ProjectReference Include="..\SimpleUtil\HMI.Simple.Util\HMI.Simple.Util.csproj">
<Project>{cf5bebe9-2803-49c3-b773-73d082e0984a}</Project>
<Name>HMI.Simple.Util</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\SimpleUtil\HMI.Util.Base\HMI.Util.Base.csproj">
+ <Project>{d59e25d1-9b27-46a1-8438-92661dd23fae}</Project>
+ <Name>HMI.Util.Base</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
@@ -568,6 +560,7 @@
move /y "$(TargeDir)HMI.UI.dll" $(TargeDir)Libs\HMI.UI.dll"
move /y "$(TargeDir)HMI.Util.dll" $(TargeDir)Libs\HMI.Util.dll"
move /y "$(TargeDir)ConnectionUtil.dll" $(TargeDir)Libs\ConnectionUtil.dll"
+move /y "$(TargeDir)HMI.StdControl.dll" $(TargeDir)Libs\HMI.StdControl.dll"
move /y "$(TargeDir)HMI.LogUtil.dll" $(TargeDir)Api\HMI.LogUtil.dll"
move /y "$(TargeDir)HMI.SerialData.Util.dll" $(TargeDir)Api\HMI.SerialData.Util.dll"
@@ -593,6 +586,7 @@
move /y "$(TargeDir)Plugin.MaterialOpt.dll" $(TargeDir)Plugin\Plugin.MaterialOpt.dll"
move /y "$(TargeDir)Plugin.DODriverControl.dll" $(TargeDir)Plugin\Plugin.DODriverControl.dll"
move /y "$(TargeDir)Plugin.ModelManage.dll" $(TargeDir)Plugin\Plugin.ModelManage.dll"
+move /y "$(TargeDir)Plugin.CurrentSensorControl.dll" $(TargeDir)Plugin\Plugin.CurrentSensorControl.dll"
setlocal enabledelayedexpansion
diff --git a/WPFProject/WPFProject.sln b/WPFProject/WPFProject.sln
index 0c98dc2..d920a5c 100644
--- a/WPFProject/WPFProject.sln
+++ b/WPFProject/WPFProject.sln
@@ -7,15 +7,9 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HMI.Core", "..\HMI.Core\HMI.Core.csproj", "{3E3BF44A-0B69-45C5-9512-528CB48A7106}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisionBuilder.Test", "..\VisionBuilder.Test\VisionBuilder.Test.csproj", "{6E1CC97A-B3CB-4E9F-94E0-F264DE0D8298}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisionBuilder.Engine", "..\VisionBuilder.Engine\VisionBuilder.Engine.csproj", "{8E5E8A68-0B9D-4A6A-B325-730C64603FDF}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HMI.UI", "..\HMI.UI\HMI.UI.csproj", "{F17DE6B5-AF1D-48C6-94A0-6B763A6546A6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HMI.MenuManage", "..\HMI.MenuManage\HMI.MenuManage.csproj", "{DE4205C6-5923-46FD-A4B9-65169BF61C75}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisionBuilder.Run", "..\VisionBuilder.Run\VisionBuilder.Run.csproj", "{7C299AED-88CC-437E-A68B-1550AA72E6B0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HMI.UnitTest", "..\HMI.UnitTest\HMI.UnitTest.csproj", "{325A7F52-FE51-44F0-B3AC-5F42F5356605}"
EndProject
@@ -27,8 +21,6 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HMI.DataViewer", "..\HMI.DataViewer\HMI.DataViewer.csproj", "{A580DE4A-34E7-4EFE-AD2C-0871396000E9}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HMI.IOMonitor", "..\HMI.IOMonitor\HMI.IOMonitor.csproj", "{F7663C79-7047-42F3-B129-73A2575EE7C6}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HMI.ParameterManage", "..\HMI.ParameterManage\HMI.ParameterManage.csproj", "{736CD77D-B81E-4866-BB00-84B0B57110F0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HMI.LogViewer", "..\HMI.LogViewer\HMI.LogViewer.csproj", "{20C23602-B029-4E21-8C11-B9E5F2223237}"
@@ -39,15 +31,11 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HMI.Util", "..\HMI.Util\HMI.Util.csproj", "{AFEA100A-9223-448D-AB10-3015D93DD98C}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin.ServoManage", "..\Plugin.ServoManage\Plugin.ServoManage.csproj", "{1853E00F-6865-4BC6-974B-6A5E1C00BAFE}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin.DOControl", "..\Plugin.DOControl\Plugin.DOControl.csproj", "{306A83DC-A7DB-4057-BAA7-477D8756F5D9}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConnectionUtil", "..\..\ConnectionUtil\ConnectionUtil\ConnectionUtil.csproj", "{D0806FA6-3F6D-4304-81B8-EAD9DA7CB5B2}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConnectionUtil", "..\ConnectionUtil\ConnectionUtil.csproj", "{D0806FA6-3F6D-4304-81B8-EAD9DA7CB5B2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OPCClient", "..\OPCClient\OPCClient.csproj", "{E5740BB5-9FC6-4A20-B7C2-CC90C281ED05}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin.TestBuilder", "..\Plugin.TestBuilder\Plugin.TestBuilder.csproj", "{30201EC1-9A82-48DB-94B9-BD5C1190228B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin.DataBoard", "..\Plugin.DataBoard\Plugin.DataBoard.csproj", "{BE42AB26-3270-43E1-84B8-6929D862FF8D}"
EndProject
@@ -65,17 +53,9 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin.SeqEditor", "..\Plugin.SeqEditor\Plugin.SeqEditor.csproj", "{717FD815-FF95-4F30-B4D9-9CEA978CA40E}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin.ChangeModel", "..\Plugin.ChangeModel\Plugin.ChangeModel.csproj", "{EF5972B1-DD20-404D-B2B3-37E70E2A478A}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lmes", "..\..\MesApi\lmes.csproj", "{376CA791-49D8-B4D7-6F98-6E86BD46CAEF}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin.MaterialOpt", "..\Plugin.MaterialOpt\Plugin.MaterialOpt.csproj", "{E1F90CBD-A0D4-48DA-AB25-7F490935AA4A}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HMI.MQUtil", "..\SimpleUtil\HMI.MQUtil\HMI.MQUtil.csproj", "{F8B8B6B6-821B-4FF6-B556-9CAB840EA57A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin.DODriverControl", "..\Plugin.DODriverControl\Plugin.DODriverControl.csproj", "{61DF853D-829A-4426-BEF8-0135586005B6}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HslCommunication", "..\..\hslCommunicationV12.0.3甯︽簮鐮乨emo\HslCommunication\HslCommunication.csproj", "{AA30059E-7269-415C-9DF2-55C310DD5548}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin.TsSupport", "..\Plugin.TsSupport\Plugin.TsSupport.csproj", "{3068124E-F12B-473E-99A0-2DA5A0385D05}"
EndProject
@@ -84,6 +64,12 @@
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DIOController", "..\SimpleUtil\DIOController\DIOController.csproj", "{34FFBAFE-478F-4B6E-95E7-92A949011A9B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleTest", "..\ConsoleTest\ConsoleTest.csproj", "{2BDDB984-199B-4913-96BB-39C252E101F2}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin.CurrentSensorControl", "..\Plugin.CurrentSensorControl\Plugin.CurrentSensorControl.csproj", "{E4505D51-248B-4C21-B0E3-A4B2A7551D6A}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModBusTcpController", "..\ModBusTcpController\ModBusTcpController.csproj", "{49DB0C9B-B239-4608-A91E-F5ED43AFAF96}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HMI.StdControl", "..\HMI.StdControl\HMI.StdControl.csproj", "{7A066856-182F-4435-B648-E9FB91AFF657}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -119,30 +105,6 @@
{3E3BF44A-0B69-45C5-9512-528CB48A7106}.Release|x64.Build.0 = Release|x64
{3E3BF44A-0B69-45C5-9512-528CB48A7106}.Release|x86.ActiveCfg = Release|x86
{3E3BF44A-0B69-45C5-9512-528CB48A7106}.Release|x86.Build.0 = Release|x86
- {6E1CC97A-B3CB-4E9F-94E0-F264DE0D8298}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6E1CC97A-B3CB-4E9F-94E0-F264DE0D8298}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6E1CC97A-B3CB-4E9F-94E0-F264DE0D8298}.Debug|x64.ActiveCfg = Debug|x64
- {6E1CC97A-B3CB-4E9F-94E0-F264DE0D8298}.Debug|x64.Build.0 = Debug|x64
- {6E1CC97A-B3CB-4E9F-94E0-F264DE0D8298}.Debug|x86.ActiveCfg = Debug|Any CPU
- {6E1CC97A-B3CB-4E9F-94E0-F264DE0D8298}.Debug|x86.Build.0 = Debug|Any CPU
- {6E1CC97A-B3CB-4E9F-94E0-F264DE0D8298}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6E1CC97A-B3CB-4E9F-94E0-F264DE0D8298}.Release|Any CPU.Build.0 = Release|Any CPU
- {6E1CC97A-B3CB-4E9F-94E0-F264DE0D8298}.Release|x64.ActiveCfg = Release|x64
- {6E1CC97A-B3CB-4E9F-94E0-F264DE0D8298}.Release|x64.Build.0 = Release|x64
- {6E1CC97A-B3CB-4E9F-94E0-F264DE0D8298}.Release|x86.ActiveCfg = Release|Any CPU
- {6E1CC97A-B3CB-4E9F-94E0-F264DE0D8298}.Release|x86.Build.0 = Release|Any CPU
- {8E5E8A68-0B9D-4A6A-B325-730C64603FDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {8E5E8A68-0B9D-4A6A-B325-730C64603FDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8E5E8A68-0B9D-4A6A-B325-730C64603FDF}.Debug|x64.ActiveCfg = Debug|x64
- {8E5E8A68-0B9D-4A6A-B325-730C64603FDF}.Debug|x64.Build.0 = Debug|x64
- {8E5E8A68-0B9D-4A6A-B325-730C64603FDF}.Debug|x86.ActiveCfg = Debug|Any CPU
- {8E5E8A68-0B9D-4A6A-B325-730C64603FDF}.Debug|x86.Build.0 = Debug|Any CPU
- {8E5E8A68-0B9D-4A6A-B325-730C64603FDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {8E5E8A68-0B9D-4A6A-B325-730C64603FDF}.Release|Any CPU.Build.0 = Release|Any CPU
- {8E5E8A68-0B9D-4A6A-B325-730C64603FDF}.Release|x64.ActiveCfg = Release|x64
- {8E5E8A68-0B9D-4A6A-B325-730C64603FDF}.Release|x64.Build.0 = Release|x64
- {8E5E8A68-0B9D-4A6A-B325-730C64603FDF}.Release|x86.ActiveCfg = Release|Any CPU
- {8E5E8A68-0B9D-4A6A-B325-730C64603FDF}.Release|x86.Build.0 = Release|Any CPU
{F17DE6B5-AF1D-48C6-94A0-6B763A6546A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F17DE6B5-AF1D-48C6-94A0-6B763A6546A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F17DE6B5-AF1D-48C6-94A0-6B763A6546A6}.Debug|x64.ActiveCfg = Debug|x64
@@ -167,18 +129,6 @@
{DE4205C6-5923-46FD-A4B9-65169BF61C75}.Release|x64.Build.0 = Release|Any CPU
{DE4205C6-5923-46FD-A4B9-65169BF61C75}.Release|x86.ActiveCfg = Release|Any CPU
{DE4205C6-5923-46FD-A4B9-65169BF61C75}.Release|x86.Build.0 = Release|Any CPU
- {7C299AED-88CC-437E-A68B-1550AA72E6B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7C299AED-88CC-437E-A68B-1550AA72E6B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7C299AED-88CC-437E-A68B-1550AA72E6B0}.Debug|x64.ActiveCfg = Debug|x64
- {7C299AED-88CC-437E-A68B-1550AA72E6B0}.Debug|x64.Build.0 = Debug|x64
- {7C299AED-88CC-437E-A68B-1550AA72E6B0}.Debug|x86.ActiveCfg = Debug|Any CPU
- {7C299AED-88CC-437E-A68B-1550AA72E6B0}.Debug|x86.Build.0 = Debug|Any CPU
- {7C299AED-88CC-437E-A68B-1550AA72E6B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7C299AED-88CC-437E-A68B-1550AA72E6B0}.Release|Any CPU.Build.0 = Release|Any CPU
- {7C299AED-88CC-437E-A68B-1550AA72E6B0}.Release|x64.ActiveCfg = Release|Any CPU
- {7C299AED-88CC-437E-A68B-1550AA72E6B0}.Release|x64.Build.0 = Release|Any CPU
- {7C299AED-88CC-437E-A68B-1550AA72E6B0}.Release|x86.ActiveCfg = Release|Any CPU
- {7C299AED-88CC-437E-A68B-1550AA72E6B0}.Release|x86.Build.0 = Release|Any CPU
{325A7F52-FE51-44F0-B3AC-5F42F5356605}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{325A7F52-FE51-44F0-B3AC-5F42F5356605}.Debug|Any CPU.Build.0 = Debug|Any CPU
{325A7F52-FE51-44F0-B3AC-5F42F5356605}.Debug|x64.ActiveCfg = Debug|x64
@@ -239,18 +189,6 @@
{A580DE4A-34E7-4EFE-AD2C-0871396000E9}.Release|x64.Build.0 = Release|Any CPU
{A580DE4A-34E7-4EFE-AD2C-0871396000E9}.Release|x86.ActiveCfg = Release|Any CPU
{A580DE4A-34E7-4EFE-AD2C-0871396000E9}.Release|x86.Build.0 = Release|Any CPU
- {F7663C79-7047-42F3-B129-73A2575EE7C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F7663C79-7047-42F3-B129-73A2575EE7C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F7663C79-7047-42F3-B129-73A2575EE7C6}.Debug|x64.ActiveCfg = Debug|x64
- {F7663C79-7047-42F3-B129-73A2575EE7C6}.Debug|x64.Build.0 = Debug|x64
- {F7663C79-7047-42F3-B129-73A2575EE7C6}.Debug|x86.ActiveCfg = Debug|Any CPU
- {F7663C79-7047-42F3-B129-73A2575EE7C6}.Debug|x86.Build.0 = Debug|Any CPU
- {F7663C79-7047-42F3-B129-73A2575EE7C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F7663C79-7047-42F3-B129-73A2575EE7C6}.Release|Any CPU.Build.0 = Release|Any CPU
- {F7663C79-7047-42F3-B129-73A2575EE7C6}.Release|x64.ActiveCfg = Release|Any CPU
- {F7663C79-7047-42F3-B129-73A2575EE7C6}.Release|x64.Build.0 = Release|Any CPU
- {F7663C79-7047-42F3-B129-73A2575EE7C6}.Release|x86.ActiveCfg = Release|Any CPU
- {F7663C79-7047-42F3-B129-73A2575EE7C6}.Release|x86.Build.0 = Release|Any CPU
{736CD77D-B81E-4866-BB00-84B0B57110F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{736CD77D-B81E-4866-BB00-84B0B57110F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{736CD77D-B81E-4866-BB00-84B0B57110F0}.Debug|x64.ActiveCfg = Debug|x64
@@ -311,18 +249,6 @@
{AFEA100A-9223-448D-AB10-3015D93DD98C}.Release|x64.Build.0 = Release|Any CPU
{AFEA100A-9223-448D-AB10-3015D93DD98C}.Release|x86.ActiveCfg = Release|Any CPU
{AFEA100A-9223-448D-AB10-3015D93DD98C}.Release|x86.Build.0 = Release|Any CPU
- {1853E00F-6865-4BC6-974B-6A5E1C00BAFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1853E00F-6865-4BC6-974B-6A5E1C00BAFE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1853E00F-6865-4BC6-974B-6A5E1C00BAFE}.Debug|x64.ActiveCfg = Debug|x64
- {1853E00F-6865-4BC6-974B-6A5E1C00BAFE}.Debug|x64.Build.0 = Debug|x64
- {1853E00F-6865-4BC6-974B-6A5E1C00BAFE}.Debug|x86.ActiveCfg = Debug|Any CPU
- {1853E00F-6865-4BC6-974B-6A5E1C00BAFE}.Debug|x86.Build.0 = Debug|Any CPU
- {1853E00F-6865-4BC6-974B-6A5E1C00BAFE}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1853E00F-6865-4BC6-974B-6A5E1C00BAFE}.Release|Any CPU.Build.0 = Release|Any CPU
- {1853E00F-6865-4BC6-974B-6A5E1C00BAFE}.Release|x64.ActiveCfg = Release|Any CPU
- {1853E00F-6865-4BC6-974B-6A5E1C00BAFE}.Release|x64.Build.0 = Release|Any CPU
- {1853E00F-6865-4BC6-974B-6A5E1C00BAFE}.Release|x86.ActiveCfg = Release|Any CPU
- {1853E00F-6865-4BC6-974B-6A5E1C00BAFE}.Release|x86.Build.0 = Release|Any CPU
{306A83DC-A7DB-4057-BAA7-477D8756F5D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{306A83DC-A7DB-4057-BAA7-477D8756F5D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{306A83DC-A7DB-4057-BAA7-477D8756F5D9}.Debug|x64.ActiveCfg = Debug|x64
@@ -359,18 +285,6 @@
{E5740BB5-9FC6-4A20-B7C2-CC90C281ED05}.Release|x64.Build.0 = Release|Any CPU
{E5740BB5-9FC6-4A20-B7C2-CC90C281ED05}.Release|x86.ActiveCfg = Release|Any CPU
{E5740BB5-9FC6-4A20-B7C2-CC90C281ED05}.Release|x86.Build.0 = Release|Any CPU
- {30201EC1-9A82-48DB-94B9-BD5C1190228B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {30201EC1-9A82-48DB-94B9-BD5C1190228B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {30201EC1-9A82-48DB-94B9-BD5C1190228B}.Debug|x64.ActiveCfg = Debug|x64
- {30201EC1-9A82-48DB-94B9-BD5C1190228B}.Debug|x64.Build.0 = Debug|x64
- {30201EC1-9A82-48DB-94B9-BD5C1190228B}.Debug|x86.ActiveCfg = Debug|Any CPU
- {30201EC1-9A82-48DB-94B9-BD5C1190228B}.Debug|x86.Build.0 = Debug|Any CPU
- {30201EC1-9A82-48DB-94B9-BD5C1190228B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {30201EC1-9A82-48DB-94B9-BD5C1190228B}.Release|Any CPU.Build.0 = Release|Any CPU
- {30201EC1-9A82-48DB-94B9-BD5C1190228B}.Release|x64.ActiveCfg = Release|Any CPU
- {30201EC1-9A82-48DB-94B9-BD5C1190228B}.Release|x64.Build.0 = Release|Any CPU
- {30201EC1-9A82-48DB-94B9-BD5C1190228B}.Release|x86.ActiveCfg = Release|Any CPU
- {30201EC1-9A82-48DB-94B9-BD5C1190228B}.Release|x86.Build.0 = Release|Any CPU
{BE42AB26-3270-43E1-84B8-6929D862FF8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BE42AB26-3270-43E1-84B8-6929D862FF8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BE42AB26-3270-43E1-84B8-6929D862FF8D}.Debug|x64.ActiveCfg = Debug|x64
@@ -455,42 +369,6 @@
{717FD815-FF95-4F30-B4D9-9CEA978CA40E}.Release|x64.Build.0 = Release|x64
{717FD815-FF95-4F30-B4D9-9CEA978CA40E}.Release|x86.ActiveCfg = Release|x86
{717FD815-FF95-4F30-B4D9-9CEA978CA40E}.Release|x86.Build.0 = Release|x86
- {EF5972B1-DD20-404D-B2B3-37E70E2A478A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {EF5972B1-DD20-404D-B2B3-37E70E2A478A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {EF5972B1-DD20-404D-B2B3-37E70E2A478A}.Debug|x64.ActiveCfg = Debug|x64
- {EF5972B1-DD20-404D-B2B3-37E70E2A478A}.Debug|x64.Build.0 = Debug|x64
- {EF5972B1-DD20-404D-B2B3-37E70E2A478A}.Debug|x86.ActiveCfg = Debug|Any CPU
- {EF5972B1-DD20-404D-B2B3-37E70E2A478A}.Debug|x86.Build.0 = Debug|Any CPU
- {EF5972B1-DD20-404D-B2B3-37E70E2A478A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {EF5972B1-DD20-404D-B2B3-37E70E2A478A}.Release|Any CPU.Build.0 = Release|Any CPU
- {EF5972B1-DD20-404D-B2B3-37E70E2A478A}.Release|x64.ActiveCfg = Release|Any CPU
- {EF5972B1-DD20-404D-B2B3-37E70E2A478A}.Release|x64.Build.0 = Release|Any CPU
- {EF5972B1-DD20-404D-B2B3-37E70E2A478A}.Release|x86.ActiveCfg = Release|Any CPU
- {EF5972B1-DD20-404D-B2B3-37E70E2A478A}.Release|x86.Build.0 = Release|Any CPU
- {376CA791-49D8-B4D7-6F98-6E86BD46CAEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {376CA791-49D8-B4D7-6F98-6E86BD46CAEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {376CA791-49D8-B4D7-6F98-6E86BD46CAEF}.Debug|x64.ActiveCfg = Debug|Any CPU
- {376CA791-49D8-B4D7-6F98-6E86BD46CAEF}.Debug|x64.Build.0 = Debug|Any CPU
- {376CA791-49D8-B4D7-6F98-6E86BD46CAEF}.Debug|x86.ActiveCfg = Debug|Any CPU
- {376CA791-49D8-B4D7-6F98-6E86BD46CAEF}.Debug|x86.Build.0 = Debug|Any CPU
- {376CA791-49D8-B4D7-6F98-6E86BD46CAEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {376CA791-49D8-B4D7-6F98-6E86BD46CAEF}.Release|Any CPU.Build.0 = Release|Any CPU
- {376CA791-49D8-B4D7-6F98-6E86BD46CAEF}.Release|x64.ActiveCfg = Release|Any CPU
- {376CA791-49D8-B4D7-6F98-6E86BD46CAEF}.Release|x64.Build.0 = Release|Any CPU
- {376CA791-49D8-B4D7-6F98-6E86BD46CAEF}.Release|x86.ActiveCfg = Release|Any CPU
- {376CA791-49D8-B4D7-6F98-6E86BD46CAEF}.Release|x86.Build.0 = Release|Any CPU
- {E1F90CBD-A0D4-48DA-AB25-7F490935AA4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E1F90CBD-A0D4-48DA-AB25-7F490935AA4A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E1F90CBD-A0D4-48DA-AB25-7F490935AA4A}.Debug|x64.ActiveCfg = Debug|x64
- {E1F90CBD-A0D4-48DA-AB25-7F490935AA4A}.Debug|x64.Build.0 = Debug|x64
- {E1F90CBD-A0D4-48DA-AB25-7F490935AA4A}.Debug|x86.ActiveCfg = Debug|Any CPU
- {E1F90CBD-A0D4-48DA-AB25-7F490935AA4A}.Debug|x86.Build.0 = Debug|Any CPU
- {E1F90CBD-A0D4-48DA-AB25-7F490935AA4A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E1F90CBD-A0D4-48DA-AB25-7F490935AA4A}.Release|Any CPU.Build.0 = Release|Any CPU
- {E1F90CBD-A0D4-48DA-AB25-7F490935AA4A}.Release|x64.ActiveCfg = Release|Any CPU
- {E1F90CBD-A0D4-48DA-AB25-7F490935AA4A}.Release|x64.Build.0 = Release|Any CPU
- {E1F90CBD-A0D4-48DA-AB25-7F490935AA4A}.Release|x86.ActiveCfg = Release|Any CPU
- {E1F90CBD-A0D4-48DA-AB25-7F490935AA4A}.Release|x86.Build.0 = Release|Any CPU
{F8B8B6B6-821B-4FF6-B556-9CAB840EA57A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F8B8B6B6-821B-4FF6-B556-9CAB840EA57A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F8B8B6B6-821B-4FF6-B556-9CAB840EA57A}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -515,18 +393,6 @@
{61DF853D-829A-4426-BEF8-0135586005B6}.Release|x64.Build.0 = Release|Any CPU
{61DF853D-829A-4426-BEF8-0135586005B6}.Release|x86.ActiveCfg = Release|Any CPU
{61DF853D-829A-4426-BEF8-0135586005B6}.Release|x86.Build.0 = Release|Any CPU
- {AA30059E-7269-415C-9DF2-55C310DD5548}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {AA30059E-7269-415C-9DF2-55C310DD5548}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {AA30059E-7269-415C-9DF2-55C310DD5548}.Debug|x64.ActiveCfg = Debug|Any CPU
- {AA30059E-7269-415C-9DF2-55C310DD5548}.Debug|x64.Build.0 = Debug|Any CPU
- {AA30059E-7269-415C-9DF2-55C310DD5548}.Debug|x86.ActiveCfg = Debug|Any CPU
- {AA30059E-7269-415C-9DF2-55C310DD5548}.Debug|x86.Build.0 = Debug|Any CPU
- {AA30059E-7269-415C-9DF2-55C310DD5548}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {AA30059E-7269-415C-9DF2-55C310DD5548}.Release|Any CPU.Build.0 = Release|Any CPU
- {AA30059E-7269-415C-9DF2-55C310DD5548}.Release|x64.ActiveCfg = Release|Any CPU
- {AA30059E-7269-415C-9DF2-55C310DD5548}.Release|x64.Build.0 = Release|Any CPU
- {AA30059E-7269-415C-9DF2-55C310DD5548}.Release|x86.ActiveCfg = Release|Any CPU
- {AA30059E-7269-415C-9DF2-55C310DD5548}.Release|x86.Build.0 = Release|Any CPU
{3068124E-F12B-473E-99A0-2DA5A0385D05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3068124E-F12B-473E-99A0-2DA5A0385D05}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3068124E-F12B-473E-99A0-2DA5A0385D05}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -565,8 +431,8 @@
{34FFBAFE-478F-4B6E-95E7-92A949011A9B}.Release|x86.Build.0 = Release|Any CPU
{2BDDB984-199B-4913-96BB-39C252E101F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2BDDB984-199B-4913-96BB-39C252E101F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {2BDDB984-199B-4913-96BB-39C252E101F2}.Debug|x64.ActiveCfg = Debug|Any CPU
- {2BDDB984-199B-4913-96BB-39C252E101F2}.Debug|x64.Build.0 = Debug|Any CPU
+ {2BDDB984-199B-4913-96BB-39C252E101F2}.Debug|x64.ActiveCfg = Debug|x64
+ {2BDDB984-199B-4913-96BB-39C252E101F2}.Debug|x64.Build.0 = Debug|x64
{2BDDB984-199B-4913-96BB-39C252E101F2}.Debug|x86.ActiveCfg = Debug|Any CPU
{2BDDB984-199B-4913-96BB-39C252E101F2}.Debug|x86.Build.0 = Debug|Any CPU
{2BDDB984-199B-4913-96BB-39C252E101F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -575,6 +441,42 @@
{2BDDB984-199B-4913-96BB-39C252E101F2}.Release|x64.Build.0 = Release|Any CPU
{2BDDB984-199B-4913-96BB-39C252E101F2}.Release|x86.ActiveCfg = Release|Any CPU
{2BDDB984-199B-4913-96BB-39C252E101F2}.Release|x86.Build.0 = Release|Any CPU
+ {E4505D51-248B-4C21-B0E3-A4B2A7551D6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E4505D51-248B-4C21-B0E3-A4B2A7551D6A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E4505D51-248B-4C21-B0E3-A4B2A7551D6A}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {E4505D51-248B-4C21-B0E3-A4B2A7551D6A}.Debug|x64.Build.0 = Debug|Any CPU
+ {E4505D51-248B-4C21-B0E3-A4B2A7551D6A}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {E4505D51-248B-4C21-B0E3-A4B2A7551D6A}.Debug|x86.Build.0 = Debug|Any CPU
+ {E4505D51-248B-4C21-B0E3-A4B2A7551D6A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E4505D51-248B-4C21-B0E3-A4B2A7551D6A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E4505D51-248B-4C21-B0E3-A4B2A7551D6A}.Release|x64.ActiveCfg = Release|Any CPU
+ {E4505D51-248B-4C21-B0E3-A4B2A7551D6A}.Release|x64.Build.0 = Release|Any CPU
+ {E4505D51-248B-4C21-B0E3-A4B2A7551D6A}.Release|x86.ActiveCfg = Release|Any CPU
+ {E4505D51-248B-4C21-B0E3-A4B2A7551D6A}.Release|x86.Build.0 = Release|Any CPU
+ {49DB0C9B-B239-4608-A91E-F5ED43AFAF96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {49DB0C9B-B239-4608-A91E-F5ED43AFAF96}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {49DB0C9B-B239-4608-A91E-F5ED43AFAF96}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {49DB0C9B-B239-4608-A91E-F5ED43AFAF96}.Debug|x64.Build.0 = Debug|Any CPU
+ {49DB0C9B-B239-4608-A91E-F5ED43AFAF96}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {49DB0C9B-B239-4608-A91E-F5ED43AFAF96}.Debug|x86.Build.0 = Debug|Any CPU
+ {49DB0C9B-B239-4608-A91E-F5ED43AFAF96}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {49DB0C9B-B239-4608-A91E-F5ED43AFAF96}.Release|Any CPU.Build.0 = Release|Any CPU
+ {49DB0C9B-B239-4608-A91E-F5ED43AFAF96}.Release|x64.ActiveCfg = Release|Any CPU
+ {49DB0C9B-B239-4608-A91E-F5ED43AFAF96}.Release|x64.Build.0 = Release|Any CPU
+ {49DB0C9B-B239-4608-A91E-F5ED43AFAF96}.Release|x86.ActiveCfg = Release|Any CPU
+ {49DB0C9B-B239-4608-A91E-F5ED43AFAF96}.Release|x86.Build.0 = Release|Any CPU
+ {7A066856-182F-4435-B648-E9FB91AFF657}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7A066856-182F-4435-B648-E9FB91AFF657}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7A066856-182F-4435-B648-E9FB91AFF657}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {7A066856-182F-4435-B648-E9FB91AFF657}.Debug|x64.Build.0 = Debug|Any CPU
+ {7A066856-182F-4435-B648-E9FB91AFF657}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {7A066856-182F-4435-B648-E9FB91AFF657}.Debug|x86.Build.0 = Debug|Any CPU
+ {7A066856-182F-4435-B648-E9FB91AFF657}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7A066856-182F-4435-B648-E9FB91AFF657}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7A066856-182F-4435-B648-E9FB91AFF657}.Release|x64.ActiveCfg = Release|Any CPU
+ {7A066856-182F-4435-B648-E9FB91AFF657}.Release|x64.Build.0 = Release|Any CPU
+ {7A066856-182F-4435-B648-E9FB91AFF657}.Release|x86.ActiveCfg = Release|Any CPU
+ {7A066856-182F-4435-B648-E9FB91AFF657}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
--
Gitblit v1.9.1