diff --git a/DMS.Application/Class1.cs b/DMS.Application/Class1.cs
new file mode 100644
index 0000000..72e9e8c
--- /dev/null
+++ b/DMS.Application/Class1.cs
@@ -0,0 +1,7 @@
+namespace DMS.Application
+{
+ public class Class1
+ {
+
+ }
+}
diff --git a/DMS.Application/DMS.Application.csproj b/DMS.Application/DMS.Application.csproj
new file mode 100644
index 0000000..f3717bb
--- /dev/null
+++ b/DMS.Application/DMS.Application.csproj
@@ -0,0 +1,16 @@
+
+
+
+ net8.0
+ enable
+ enable
+
+
+
+
+
+
+
+
+
+
diff --git a/DMS/Config/nlog.config b/DMS.Core/Configurations/nlog.config
similarity index 100%
rename from DMS/Config/nlog.config
rename to DMS.Core/Configurations/nlog.config
diff --git a/DMS.Core/DMS.Core.csproj b/DMS.Core/DMS.Core.csproj
new file mode 100644
index 0000000..f3eb51a
--- /dev/null
+++ b/DMS.Core/DMS.Core.csproj
@@ -0,0 +1,34 @@
+
+
+
+ net8.0
+ enable
+ enable
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Always
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DMS/Enums/Brand.cs b/DMS.Core/Enums/Brand.cs
similarity index 88%
rename from DMS/Enums/Brand.cs
rename to DMS.Core/Enums/Brand.cs
index 3cba679..fbee5e5 100644
--- a/DMS/Enums/Brand.cs
+++ b/DMS.Core/Enums/Brand.cs
@@ -1,4 +1,4 @@
-namespace DMS.Enums;
+namespace DMS.Core.Enums;
///
/// PLC品牌
diff --git a/DMS/Enums/DeviceType.cs b/DMS.Core/Enums/DeviceType.cs
similarity index 84%
rename from DMS/Enums/DeviceType.cs
rename to DMS.Core/Enums/DeviceType.cs
index 587fc9d..90d4c15 100644
--- a/DMS/Enums/DeviceType.cs
+++ b/DMS.Core/Enums/DeviceType.cs
@@ -1,6 +1,6 @@
using System.ComponentModel;
-namespace DMS.Enums;
+namespace DMS.Core.Enums;
public enum DeviceType
{
diff --git a/DMS/Enums/LoadTypes.cs b/DMS.Core/Enums/LoadTypes.cs
similarity index 70%
rename from DMS/Enums/LoadTypes.cs
rename to DMS.Core/Enums/LoadTypes.cs
index d363c7d..45a3d85 100644
--- a/DMS/Enums/LoadTypes.cs
+++ b/DMS.Core/Enums/LoadTypes.cs
@@ -1,4 +1,4 @@
-namespace DMS.Enums;
+namespace DMS.Core.Enums;
public enum LoadTypes
{
diff --git a/DMS/Enums/MenuType.cs b/DMS.Core/Enums/MenuType.cs
similarity index 80%
rename from DMS/Enums/MenuType.cs
rename to DMS.Core/Enums/MenuType.cs
index 3185e4e..39da8c6 100644
--- a/DMS/Enums/MenuType.cs
+++ b/DMS.Core/Enums/MenuType.cs
@@ -1,4 +1,4 @@
-namespace DMS.Enums;
+namespace DMS.Core.Enums;
public enum MenuType
{
diff --git a/DMS/Enums/MqttPlatform.cs b/DMS.Core/Enums/MqttPlatform.cs
similarity index 84%
rename from DMS/Enums/MqttPlatform.cs
rename to DMS.Core/Enums/MqttPlatform.cs
index 664001d..258687b 100644
--- a/DMS/Enums/MqttPlatform.cs
+++ b/DMS.Core/Enums/MqttPlatform.cs
@@ -1,6 +1,6 @@
using System.ComponentModel;
-namespace DMS.Enums;
+namespace DMS.Core.Enums;
public enum MqttPlatform
{
diff --git a/DMS/Enums/NotificationType.cs b/DMS.Core/Enums/NotificationType.cs
similarity index 79%
rename from DMS/Enums/NotificationType.cs
rename to DMS.Core/Enums/NotificationType.cs
index 5b46ff8..f8f0f77 100644
--- a/DMS/Enums/NotificationType.cs
+++ b/DMS.Core/Enums/NotificationType.cs
@@ -1,4 +1,4 @@
-namespace DMS.Enums;
+namespace DMS.Core.Enums;
public enum NotificationType
{
diff --git a/DMS/Enums/OpcUaUpdateType.cs b/DMS.Core/Enums/OpcUaUpdateType.cs
similarity index 86%
rename from DMS/Enums/OpcUaUpdateType.cs
rename to DMS.Core/Enums/OpcUaUpdateType.cs
index 0340ec7..6f3bb03 100644
--- a/DMS/Enums/OpcUaUpdateType.cs
+++ b/DMS.Core/Enums/OpcUaUpdateType.cs
@@ -1,6 +1,6 @@
using System.ComponentModel;
-namespace DMS.Enums;
+namespace DMS.Core.Enums;
public enum OpcUaUpdateType
{
diff --git a/DMS/Enums/PollLevelType.cs b/DMS.Core/Enums/PollLevelType.cs
similarity index 97%
rename from DMS/Enums/PollLevelType.cs
rename to DMS.Core/Enums/PollLevelType.cs
index 79afbd2..bfdd639 100644
--- a/DMS/Enums/PollLevelType.cs
+++ b/DMS.Core/Enums/PollLevelType.cs
@@ -1,6 +1,6 @@
using System.ComponentModel;
-namespace DMS.Enums
+namespace DMS.Core.Enums
{
public enum PollLevelType
{
diff --git a/DMS/Enums/ProtocolType.cs b/DMS.Core/Enums/ProtocolType.cs
similarity index 89%
rename from DMS/Enums/ProtocolType.cs
rename to DMS.Core/Enums/ProtocolType.cs
index 5d322a8..6cdac1d 100644
--- a/DMS/Enums/ProtocolType.cs
+++ b/DMS.Core/Enums/ProtocolType.cs
@@ -1,6 +1,6 @@
using System.ComponentModel;
-namespace DMS.Enums;
+namespace DMS.Core.Enums;
public enum ProtocolType
{
diff --git a/DMS/Enums/SignalType.cs b/DMS.Core/Enums/SignalType.cs
similarity index 95%
rename from DMS/Enums/SignalType.cs
rename to DMS.Core/Enums/SignalType.cs
index 7761507..30b81b5 100644
--- a/DMS/Enums/SignalType.cs
+++ b/DMS.Core/Enums/SignalType.cs
@@ -1,6 +1,6 @@
using System.ComponentModel;
-namespace DMS.Enums;
+namespace DMS.Core.Enums;
public enum SignalType
{
diff --git a/DMS/Helper/NlogHelper.cs b/DMS.Core/Helper/NlogHelper.cs
similarity index 100%
rename from DMS/Helper/NlogHelper.cs
rename to DMS.Core/Helper/NlogHelper.cs
diff --git a/DMS.Core/Models/Device.cs b/DMS.Core/Models/Device.cs
new file mode 100644
index 0000000..f223c1e
--- /dev/null
+++ b/DMS.Core/Models/Device.cs
@@ -0,0 +1,88 @@
+using System.Collections.ObjectModel;
+
+using DMS.Core.Enums;
+
+
+namespace DMS.Models;
+
+///
+/// 表示设备信息。
+///
+public partial class Device
+{
+ ///
+ /// 设备的描述信息。
+ ///
+ private string description;
+
+ ///
+ /// 设备的类型。
+ ///
+ public DeviceType DeviceType { get; set; }
+
+ ///
+ /// 设备的唯一标识符。
+ ///
+ private int id;
+
+ ///
+ /// 设备的IP地址。
+ ///
+ private string ip;
+
+ ///
+ /// 表示设备是否处于活动状态。
+ ///
+ private bool isActive = true;
+
+
+ ///
+ /// 表示是否添加默认变量表。
+ ///
+ private bool isAddDefVarTable = true;
+
+ ///
+ /// 表示设备是否正在运行。
+ ///
+ private bool isRuning;
+
+ ///
+ /// 设备的名称。
+ ///
+ private string name;
+
+ ///
+ /// 设备的端口号。
+ ///
+ private int prot;
+
+ ///
+ /// PLC的CPU类型。
+ ///
+ //private CpuType cpuType;
+
+ ///
+ /// PLC的机架号。
+ ///
+ private short rack;
+
+ ///
+ /// PLC的槽号。
+ ///
+ private short slot;
+
+ ///
+ /// 设备的通信协议类型。
+ ///
+ public ProtocolType ProtocolType { get; set; }
+
+ ///
+ /// OPC UA Endpoint URL。
+ ///
+ private string? opcUaEndpointUrl;
+
+ ///
+ /// 设备关联的变量表列表。
+ ///
+ public ObservableCollection? VariableTables { get; set; }
+}
\ No newline at end of file
diff --git a/DMS.Core/Models/MenuBean.cs b/DMS.Core/Models/MenuBean.cs
new file mode 100644
index 0000000..71f4171
--- /dev/null
+++ b/DMS.Core/Models/MenuBean.cs
@@ -0,0 +1,55 @@
+using DMS.Core.Enums;
+
+namespace DMS.Models;
+
+///
+/// 表示菜单项。
+///
+public class MenuBean
+{
+ ///
+ /// 菜单项关联的数据。
+ ///
+ public object? Data { get; set; }
+
+ ///
+ /// 菜单项关联的数据ID。
+ ///
+ public int DataId { get; set; }
+
+ ///
+ /// 菜单项的图标。
+ ///
+ public string Icon { get; set; }
+
+ ///
+ /// 菜单项的唯一标识符。
+ ///
+ public int Id { get; set; }
+
+ ///
+ /// 子菜单项列表。
+ ///
+ public List Items { get; set; }
+
+ ///
+ /// 菜单项的名称。
+ ///
+ public string Name { get; set; }
+
+ ///
+ /// 父菜单项。
+ ///
+ public MenuBean Parent { get; set; }
+
+ ///
+ /// 父菜单项的ID。
+ ///
+ public int ParentId { get; set; }
+
+ ///
+ /// 菜单项的类型。
+ ///
+ public MenuType Type { get; set; }
+
+}
\ No newline at end of file
diff --git a/DMS.Core/Models/Mqtt.cs b/DMS.Core/Models/Mqtt.cs
new file mode 100644
index 0000000..57e8de7
--- /dev/null
+++ b/DMS.Core/Models/Mqtt.cs
@@ -0,0 +1,96 @@
+using DMS.Core.Enums;
+
+namespace DMS.Models;
+
+///
+/// 表示MQTT配置信息。
+///
+public partial class Mqtt
+{
+
+ ///
+ /// MQTT客户端ID。
+ ///
+ public string ClientID { get; set; }
+
+ ///
+ /// 连接时间。
+ ///
+ public DateTime ConnTime { get; set; }
+
+ ///
+ /// MQTT主机。
+ ///
+ public string Host { get; set; }
+
+ ///
+ /// MQTT配置的唯一标识符。
+ ///
+ public int Id { get; set; }
+
+ ///
+ /// 是否启用此MQTT配置。
+ ///
+ private bool IsActive { get; set; }
+
+
+ ///
+ /// 显示连接的消息:
+ ///
+ private string ConnectMessage { get; set; }
+
+ ///
+ /// 是否设置为默认MQTT客户端。
+ ///
+ public int IsDefault { get; set; }
+
+ ///
+ /// MQTT客户端名字。
+ ///
+ public string Name { get; set; }
+
+ ///
+ /// MQTT客户端登录密码。
+ ///
+ public string PassWord { get; set; }
+
+ ///
+ /// Mqtt平台类型。
+ ///
+ public MqttPlatform Platform { get; set; }
+
+ ///
+ /// MQTT主机端口。
+ ///
+ public int Port { get; set; }
+
+ ///
+ /// MQTT发布主题。
+ ///
+ public string PublishTopic { get; set; }
+
+ ///
+ /// MQTT备注。
+ ///
+ public string Remark { get; set; } = String.Empty;
+
+ ///
+ /// MQTT订阅主题。
+ ///
+ public string SubTopic { get; set; }
+
+ ///
+ /// MQTT客户端登录用户名。
+ ///
+ public string UserName { get; set; }
+
+ ///
+ /// 关联的变量数据列表。
+ ///
+ public List? VariableMqtts { get; set; }
+
+ ///
+ /// 是否连接。
+ ///
+ private bool IsConnected { get; set; }
+}
\ No newline at end of file
diff --git a/DMS/Models/Notification.cs b/DMS.Core/Models/Notification.cs
similarity index 94%
rename from DMS/Models/Notification.cs
rename to DMS.Core/Models/Notification.cs
index 6fa6435..4c8b7e3 100644
--- a/DMS/Models/Notification.cs
+++ b/DMS.Core/Models/Notification.cs
@@ -1,4 +1,4 @@
-using DMS.Enums;
+using DMS.Core.Enums;
namespace DMS.Models;
diff --git a/DMS.Core/Models/OpcUaNode.cs b/DMS.Core/Models/OpcUaNode.cs
new file mode 100644
index 0000000..d3c604c
--- /dev/null
+++ b/DMS.Core/Models/OpcUaNode.cs
@@ -0,0 +1,68 @@
+using System.Collections.ObjectModel;
+
+namespace DMS.Models;
+
+///
+/// 表示OPC UA节点,用于构建节点树。
+///
+public partial class OpcUaNode
+{
+ ///
+ /// 节点的显示名称。
+ ///
+ public string DisplayName { get; set; }
+
+ ///
+ /// 节点的唯一标识符。
+ ///
+ public string NodeId { get; set; }
+
+ ///
+ /// 节点的类型(例如,文件夹、变量)。
+ ///
+ public NodeType NodeType { get; set; }
+
+ ///
+ /// 子节点集合。
+ ///
+ private ObservableCollection _children;
+
+ ///
+ /// 指示节点是否已加载子节点。
+ ///
+ private bool _isLoaded;
+
+ ///
+ /// 指示节点是否正在加载子节点。
+ ///
+ private bool _isLoading;
+
+ ///
+ /// 节点的完整路径(可选,用于调试或显示)。
+ ///
+ public string Path { get; set; }
+
+ ///
+ /// 构造函数。
+ ///
+ /// 显示名称。
+ /// 节点ID。
+ /// 节点类型。
+ //public OpcUaNode(string displayName, NodeId nodeId, NodeType nodeType)
+ //{
+ // DisplayName = displayName;
+ // NodeId = nodeId;
+ // NodeType = nodeType;
+ // Children = new ObservableCollection();
+ //}
+}
+
+///
+/// OPC UA节点类型枚举。
+///
+public enum NodeType
+{
+ Folder,
+ Object,
+ Variable
+}
diff --git a/DMS/Models/User.cs b/DMS.Core/Models/User.cs
similarity index 100%
rename from DMS/Models/User.cs
rename to DMS.Core/Models/User.cs
diff --git a/DMS.Core/Models/Variable.cs b/DMS.Core/Models/Variable.cs
new file mode 100644
index 0000000..41b87a2
--- /dev/null
+++ b/DMS.Core/Models/Variable.cs
@@ -0,0 +1,168 @@
+using DMS.Core.Enums;
+
+namespace DMS.Models;
+
+///
+/// 表示变量数据信息。
+///
+public partial class Variable
+{
+ ///
+ /// 变量唯一标识符。
+ ///
+ public int Id { get; set; }
+
+ ///
+ /// 变量名称。
+ ///
+ private string name;
+
+ ///
+ /// 节点ID,用于标识变量在设备或系统中的唯一路径。
+ ///
+ public string NodeId { get; set; }
+
+ ///
+ /// 节点ID,用于标识变量在设备或系统中的唯一路径。
+ ///
+ public string S7Address { get; set; }
+
+ ///
+ /// OPC UA Endpoint URL。
+ ///
+ public string? OpcUaEndpointUrl { get; set; }
+
+ ///
+ /// OPC UA Node ID。
+ ///
+ public string? OpcUaNodeId { get; set; }
+
+
+ ///
+ /// 变量描述。
+ ///
+ private string description = String.Empty;
+
+ ///
+ /// 协议类型,例如Modbus、OPC UA等。
+ ///
+ public ProtocolType ProtocolType { get; set; }
+
+ ///
+ /// 信号类型,例如模拟量、数字量等。
+ ///
+ public SignalType SignalType { get; set; }
+
+ ///
+ /// 数据类型,例如Int、Float、String等。
+ ///
+ public string DataType { get; set; }
+
+ ///
+ /// 变量当前原始数据值。
+ ///
+ private string dataValue = String.Empty;
+
+ ///
+ /// 变量经过转换或格式化后的显示值。
+ ///
+ private string displayValue = String.Empty;
+
+ ///
+ /// 指示变量是否处于激活状态。
+ ///
+ public bool isActive;
+
+ ///
+ /// 指示变量是否被选中
+ ///
+ public bool isSelect;
+
+ ///
+ /// 指示是否需要保存变量数据。
+ ///
+ public bool IsSave { get; set; }
+
+ ///
+ /// 指示是否需要对变量进行报警监测。
+ ///
+ public bool IsAlarm { get; set; }
+
+ ///
+ /// 轮询级别,例如1秒、5秒等。
+ ///
+ private PollLevelType pollLevelType = PollLevelType.ThirtySeconds;
+
+ ///
+ /// OPC UA更新类型,例如轮询或订阅。
+ ///
+ private OpcUaUpdateType opcUaUpdateType = OpcUaUpdateType.OpcUaPoll;
+
+ ///
+ /// 最后一次轮询时间。
+ ///
+ public DateTime LastPollTime { get; set; } = DateTime.MinValue;
+
+ ///
+ /// 指示变量是否已被逻辑删除。
+ ///
+ public bool IsDeleted { get; set; }
+
+ ///
+ /// 指示变量是否已被修改了。
+ ///
+ private bool isModified;
+
+ ///
+ /// 报警的最大值阈值。
+ ///
+ public double AlarmMax { get; set; }
+
+ ///
+ /// 报警的最小值阈值。
+ ///
+ public double AlarmMin { get; set; }
+
+ ///
+ /// 数据转换规则或表达式。
+ ///
+ private string converstion = String.Empty;
+
+ ///
+ /// 数据保存的范围或阈值。
+ ///
+ public double SaveRange { get; set; }
+
+ ///
+ /// 变量数据创建时间。
+ ///
+ private DateTime createTime;
+
+
+ ///
+ /// 变量数据最后更新时间。
+ ///
+ private DateTime updateTime = DateTime.Now;
+
+ ///
+ /// 最后更新变量数据的用户。
+ ///
+ public User UpdateUser { get; set; }
+
+ ///
+ /// 关联的变量表ID。
+ ///
+ public int VariableTableId { get; set; }
+
+ ///
+ /// 关联的变量表实体。
+ ///
+ public VariableTable? VariableTable { get; set; }
+
+ ///
+ /// 关联的MQTT配置列表。
+ ///
+ public List? VariableMqtts { get; set; }
+
+
+}
\ No newline at end of file
diff --git a/DMS/Models/VariableContext.cs b/DMS.Core/Models/VariableContext.cs
similarity index 100%
rename from DMS/Models/VariableContext.cs
rename to DMS.Core/Models/VariableContext.cs
diff --git a/DMS.Core/Models/VariableMqtt.cs b/DMS.Core/Models/VariableMqtt.cs
new file mode 100644
index 0000000..c2604c2
--- /dev/null
+++ b/DMS.Core/Models/VariableMqtt.cs
@@ -0,0 +1,76 @@
+using System;
+using DMS.Core.Enums;
+
+namespace DMS.Models;
+
+///
+/// 表示变量数据与MQTT服务器之间的关联模型,包含MQTT别名。
+///
+public partial class VariableMqtt
+{
+
+
+ ///
+ /// 关联的唯一标识符。
+ ///
+ public int Id { get; set; }
+
+ ///
+ /// 关联的变量数据ID。
+ ///
+ public int VariableId { get; set; }
+
+ ///
+ /// 关联的MQTT服务器ID。
+ ///
+ public int MqttId { get; set; }
+
+ ///
+ /// 变量在该MQTT服务器上的别名。
+ ///
+ private string _mqttAlias = string.Empty;
+
+ ///
+ /// 变量的唯一标识符(S7地址或OPC UA NodeId)。
+ ///
+ public string Identifier
+ {
+ get
+ {
+ if (Variable!=null)
+ {
+
+
+ if (Variable.ProtocolType == ProtocolType.S7)
+ {
+ return Variable.S7Address;
+ }
+ else if (Variable.ProtocolType == ProtocolType.OpcUA)
+ {
+ return Variable.OpcUaNodeId;
+ }
+ }
+ return string.Empty;
+ }
+ }
+
+ ///
+ /// 创建时间。
+ ///
+ public DateTime CreateTime { get; set; } = DateTime.Now;
+
+ ///
+ /// 更新时间。
+ ///
+ public DateTime UpdateTime { get; set; } = DateTime.Now;
+
+ ///
+ /// 导航属性:关联的变量数据。
+ ///
+ public Variable Variable { get; set; }
+
+ ///
+ /// 导航属性:关联的MQTT服务器。
+ ///
+ public Mqtt Mqtt { get; set; }
+}
\ No newline at end of file
diff --git a/DMS.Core/Models/VariableTable.cs b/DMS.Core/Models/VariableTable.cs
new file mode 100644
index 0000000..dbcc3c5
--- /dev/null
+++ b/DMS.Core/Models/VariableTable.cs
@@ -0,0 +1,51 @@
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using DMS.Core.Enums;
+
+namespace DMS.Models;
+
+///
+/// 表示变量表信息。
+///
+public partial class VariableTable
+{
+ ///
+ /// 变量表关联的设备。
+ ///
+ public Device? Device { get; set; }
+
+ ///
+ /// 变量表关联的设备ID。
+ ///
+ public int? DeviceId { get; set; }
+
+ ///
+ /// 变量表描述。
+ ///
+ private string description;
+
+ ///
+ /// 变量表中包含的数据变量列表。
+ ///
+ public ObservableCollection variables;
+
+ ///
+ /// 变量表的唯一标识符。
+ ///
+ public int Id { get; set; }
+
+ ///
+ /// 表示变量表是否处于活动状态。
+ ///
+ private bool isActive;
+
+ ///
+ /// 变量表名称。
+ ///
+ private string name;
+
+ ///
+ /// 变量表使用的协议类型。
+ ///
+ public ProtocolType ProtocolType { get; set; }
+}
\ No newline at end of file
diff --git a/DMS.Infrastructure/Class1.cs b/DMS.Infrastructure/Class1.cs
new file mode 100644
index 0000000..f43bb86
--- /dev/null
+++ b/DMS.Infrastructure/Class1.cs
@@ -0,0 +1,7 @@
+namespace DMS.Infrastructure
+{
+ public class Class1
+ {
+
+ }
+}
diff --git a/DMS/Config/ConnectionSettings.cs b/DMS.Infrastructure/Configurations/ConnectionSettings.cs
similarity index 100%
rename from DMS/Config/ConnectionSettings.cs
rename to DMS.Infrastructure/Configurations/ConnectionSettings.cs
diff --git a/DMS.Infrastructure/DMS.Infrastructure.csproj b/DMS.Infrastructure/DMS.Infrastructure.csproj
new file mode 100644
index 0000000..2de6fef
--- /dev/null
+++ b/DMS.Infrastructure/DMS.Infrastructure.csproj
@@ -0,0 +1,27 @@
+
+
+
+ net8.0
+ enable
+ enable
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DMS/Data/DbContext.cs b/DMS.Infrastructure/Data/DbContext.cs
similarity index 95%
rename from DMS/Data/DbContext.cs
rename to DMS.Infrastructure/Data/DbContext.cs
index 9037e02..c8ad1b7 100644
--- a/DMS/Data/DbContext.cs
+++ b/DMS.Infrastructure/Data/DbContext.cs
@@ -1,7 +1,7 @@
using DMS.Config;
using SqlSugar;
-namespace DMS.Data;
+namespace DMS.Infrastructure;
public class DbContext
{
diff --git a/DMS/Data/Entities/DbDevice.cs b/DMS.Infrastructure/Entities/DbDevice.cs
similarity index 93%
rename from DMS/Data/Entities/DbDevice.cs
rename to DMS.Infrastructure/Entities/DbDevice.cs
index f732c42..c1893b4 100644
--- a/DMS/Data/Entities/DbDevice.cs
+++ b/DMS.Infrastructure/Entities/DbDevice.cs
@@ -1,11 +1,9 @@
-using DMS.Enums;
using SqlSugar;
using SqlSugar.DbConvert;
-using ProtocolType = DMS.Enums.ProtocolType;
using S7.Net;
-using Enums_ProtocolType = DMS.Enums.ProtocolType; // AddAsync this using directive
+using DMS.Core.Enums;
-namespace DMS.Data.Entities;
+namespace DMS.Infrastructure.Entities;
///
/// 表示数据库中的设备实体。
diff --git a/DMS/Data/Entities/DbMenu.cs b/DMS.Infrastructure/Entities/DbMenu.cs
similarity index 95%
rename from DMS/Data/Entities/DbMenu.cs
rename to DMS.Infrastructure/Entities/DbMenu.cs
index a1fb965..6bd14d0 100644
--- a/DMS/Data/Entities/DbMenu.cs
+++ b/DMS.Infrastructure/Entities/DbMenu.cs
@@ -1,8 +1,8 @@
-using DMS.Enums;
+using DMS.Core.Enums;
using SqlSugar;
using SqlSugar.DbConvert;
-namespace DMS.Data.Entities;
+namespace DMS.Infrastructure.Entities;
///
/// 表示数据库中的菜单实体。
diff --git a/DMS/Data/Entities/DbMqtt.cs b/DMS.Infrastructure/Entities/DbMqtt.cs
similarity index 97%
rename from DMS/Data/Entities/DbMqtt.cs
rename to DMS.Infrastructure/Entities/DbMqtt.cs
index 84c9d09..952a3a4 100644
--- a/DMS/Data/Entities/DbMqtt.cs
+++ b/DMS.Infrastructure/Entities/DbMqtt.cs
@@ -1,8 +1,8 @@
-using DMS.Enums;
+using DMS.Core.Enums;
using SqlSugar;
using SqlSugar.DbConvert;
-namespace DMS.Data.Entities;
+namespace DMS.Infrastructure.Entities;
///
/// 表示数据库中的MQTT配置实体。
diff --git a/DMS/Data/Entities/DbNlog.cs b/DMS.Infrastructure/Entities/DbNlog.cs
similarity index 97%
rename from DMS/Data/Entities/DbNlog.cs
rename to DMS.Infrastructure/Entities/DbNlog.cs
index 5354595..a822a82 100644
--- a/DMS/Data/Entities/DbNlog.cs
+++ b/DMS.Infrastructure/Entities/DbNlog.cs
@@ -1,6 +1,6 @@
using SqlSugar;
-namespace DMS.Data.Entities;
+namespace DMS.Infrastructure.Entities;
///
/// 表示数据库中的NLog日志实体。
diff --git a/DMS/Data/Entities/DbUser.cs b/DMS.Infrastructure/Entities/DbUser.cs
similarity index 93%
rename from DMS/Data/Entities/DbUser.cs
rename to DMS.Infrastructure/Entities/DbUser.cs
index e9cdbd4..4fa1ce4 100644
--- a/DMS/Data/Entities/DbUser.cs
+++ b/DMS.Infrastructure/Entities/DbUser.cs
@@ -1,6 +1,6 @@
using SqlSugar;
-namespace DMS.Data.Entities;
+namespace DMS.Infrastructure.Entities;
///
/// 表示数据库中的用户实体。
diff --git a/DMS/Data/Entities/DbVariable.cs b/DMS.Infrastructure/Entities/DbVariable.cs
similarity index 98%
rename from DMS/Data/Entities/DbVariable.cs
rename to DMS.Infrastructure/Entities/DbVariable.cs
index d8fac42..f5cc221 100644
--- a/DMS/Data/Entities/DbVariable.cs
+++ b/DMS.Infrastructure/Entities/DbVariable.cs
@@ -1,8 +1,8 @@
-using DMS.Enums;
+using DMS.Core.Enums;
using SqlSugar;
using SqlSugar.DbConvert;
-namespace DMS.Data.Entities;
+namespace DMS.Infrastructure.Entities;
///
/// 表示数据库中的变量数据实体。
diff --git a/DMS/Data/Entities/DbVariableHistory.cs b/DMS.Infrastructure/Entities/DbVariableHistory.cs
similarity index 96%
rename from DMS/Data/Entities/DbVariableHistory.cs
rename to DMS.Infrastructure/Entities/DbVariableHistory.cs
index b0cea18..29649ba 100644
--- a/DMS/Data/Entities/DbVariableHistory.cs
+++ b/DMS.Infrastructure/Entities/DbVariableHistory.cs
@@ -1,7 +1,7 @@
using System;
using SqlSugar;
-namespace DMS.Data.Entities;
+namespace DMS.Infrastructure.Entities;
///
/// 表示数据库中的变量数据历史实体。
diff --git a/DMS/Data/Entities/DbVariableMqtt.cs b/DMS.Infrastructure/Entities/DbVariableMqtt.cs
similarity index 97%
rename from DMS/Data/Entities/DbVariableMqtt.cs
rename to DMS.Infrastructure/Entities/DbVariableMqtt.cs
index f862751..e71dfa9 100644
--- a/DMS/Data/Entities/DbVariableMqtt.cs
+++ b/DMS.Infrastructure/Entities/DbVariableMqtt.cs
@@ -1,7 +1,7 @@
using System;
using SqlSugar;
-namespace DMS.Data.Entities;
+namespace DMS.Infrastructure.Entities;
///
/// 表示变量数据与MQTT服务器之间的关联实体,包含MQTT别名。
diff --git a/DMS/Data/Entities/DbVariableTable.cs b/DMS.Infrastructure/Entities/DbVariableTable.cs
similarity index 95%
rename from DMS/Data/Entities/DbVariableTable.cs
rename to DMS.Infrastructure/Entities/DbVariableTable.cs
index 91ff197..1017124 100644
--- a/DMS/Data/Entities/DbVariableTable.cs
+++ b/DMS.Infrastructure/Entities/DbVariableTable.cs
@@ -1,8 +1,8 @@
-using DMS.Enums;
+using DMS.Core.Enums;
using SqlSugar;
using SqlSugar.DbConvert;
-namespace DMS.Data.Entities;
+namespace DMS.Infrastructure.Entities;
///
/// 表示数据库中的变量表实体。
diff --git a/DMS/Profiles/MappingProfile.cs b/DMS.Infrastructure/Profiles/MappingProfile.cs
similarity index 96%
rename from DMS/Profiles/MappingProfile.cs
rename to DMS.Infrastructure/Profiles/MappingProfile.cs
index 96cf4d0..4affa9d 100644
--- a/DMS/Profiles/MappingProfile.cs
+++ b/DMS.Infrastructure/Profiles/MappingProfile.cs
@@ -1,6 +1,6 @@
using System;
using AutoMapper;
-using DMS.Data.Entities;
+using DMS.Infrastructure.Entities;
using DMS.Models;
namespace DMS.Profiles;
diff --git a/DMS/Data/Repositories/DeviceRepository.cs b/DMS.Infrastructure/Repositories/DeviceRepository.cs
similarity index 98%
rename from DMS/Data/Repositories/DeviceRepository.cs
rename to DMS.Infrastructure/Repositories/DeviceRepository.cs
index 64d73e1..532f4c0 100644
--- a/DMS/Data/Repositories/DeviceRepository.cs
+++ b/DMS.Infrastructure/Repositories/DeviceRepository.cs
@@ -1,14 +1,14 @@
using System.Diagnostics;
using AutoMapper;
-using DMS.Data.Entities;
-using DMS.Enums;
+using DMS.Infrastructure.Entities;
+using DMS.Core.Enums;
using DMS.Helper;
using DMS.Models;
using iNKORE.UI.WPF.Modern.Common.IconKeys;
using DMS.Extensions;
using SqlSugar;
-namespace DMS.Data.Repositories;
+namespace DMS.Infrastructure.Repositories;
public class DeviceRepository
{
diff --git a/DMS/Data/Repositories/MenuRepository.cs b/DMS.Infrastructure/Repositories/MenuRepository.cs
similarity index 98%
rename from DMS/Data/Repositories/MenuRepository.cs
rename to DMS.Infrastructure/Repositories/MenuRepository.cs
index 5da3020..1488dc6 100644
--- a/DMS/Data/Repositories/MenuRepository.cs
+++ b/DMS.Infrastructure/Repositories/MenuRepository.cs
@@ -3,12 +3,12 @@ using iNKORE.UI.WPF.Modern.Common.IconKeys;
using DMS.Extensions;
using SqlSugar;
using AutoMapper;
-using DMS.Data.Entities;
-using DMS.Enums;
+using DMS.Infrastructure.Entities;
+using DMS.Core.Enums;
using DMS.Helper;
using DMS.Models;
-namespace DMS.Data.Repositories;
+namespace DMS.Infrastructure.Repositories;
public class MenuRepository
{
diff --git a/DMS/Data/Repositories/MqttRepository.cs b/DMS.Infrastructure/Repositories/MqttRepository.cs
similarity index 98%
rename from DMS/Data/Repositories/MqttRepository.cs
rename to DMS.Infrastructure/Repositories/MqttRepository.cs
index 84a1d51..3d8543a 100644
--- a/DMS/Data/Repositories/MqttRepository.cs
+++ b/DMS.Infrastructure/Repositories/MqttRepository.cs
@@ -1,12 +1,12 @@
using System.Diagnostics;
using AutoMapper;
-using DMS.Data.Entities;
-using DMS.Enums;
+using DMS.Infrastructure.Entities;
+using DMS.Core.Enums;
using DMS.Helper;
using DMS.Models;
using iNKORE.UI.WPF.Modern.Common.IconKeys;
-namespace DMS.Data.Repositories;
+namespace DMS.Infrastructure.Repositories;
///
/// Mqtt仓储类,用于操作DbMqtt实体
diff --git a/DMS/Data/Repositories/UserRepository.cs b/DMS.Infrastructure/Repositories/UserRepository.cs
similarity index 97%
rename from DMS/Data/Repositories/UserRepository.cs
rename to DMS.Infrastructure/Repositories/UserRepository.cs
index 7c7748d..830448f 100644
--- a/DMS/Data/Repositories/UserRepository.cs
+++ b/DMS.Infrastructure/Repositories/UserRepository.cs
@@ -1,10 +1,10 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
-using DMS.Data.Entities;
+using DMS.Infrastructure.Entities;
using DMS.Helper;
-namespace DMS.Data.Repositories;
+namespace DMS.Infrastructure.Repositories;
///
/// 用户仓储类,用于操作DbUser实体
diff --git a/DMS/Data/Repositories/VarDataRepository.cs b/DMS.Infrastructure/Repositories/VarDataRepository.cs
similarity index 99%
rename from DMS/Data/Repositories/VarDataRepository.cs
rename to DMS.Infrastructure/Repositories/VarDataRepository.cs
index 470af20..7d007e7 100644
--- a/DMS/Data/Repositories/VarDataRepository.cs
+++ b/DMS.Infrastructure/Repositories/VarDataRepository.cs
@@ -5,11 +5,11 @@ using DMS.Extensions;
using SqlSugar;
using AutoMapper;
using Dm.util;
-using DMS.Data.Entities;
+using DMS.Infrastructure.Entities;
using DMS.Helper;
using DMS.Models;
-namespace DMS.Data.Repositories;
+namespace DMS.Infrastructure.Repositories;
///
/// VariableData仓储类,用于操作DbVariableData实体
diff --git a/DMS/Data/Repositories/VarTableRepository.cs b/DMS.Infrastructure/Repositories/VarTableRepository.cs
similarity index 97%
rename from DMS/Data/Repositories/VarTableRepository.cs
rename to DMS.Infrastructure/Repositories/VarTableRepository.cs
index e9b404a..46e2b71 100644
--- a/DMS/Data/Repositories/VarTableRepository.cs
+++ b/DMS.Infrastructure/Repositories/VarTableRepository.cs
@@ -1,14 +1,14 @@
using iNKORE.UI.WPF.Modern.Common.IconKeys;
-using DMS.Enums;
+using DMS.Core.Enums;
using DMS.Extensions;
using SqlSugar;
using System.Diagnostics;
using AutoMapper;
-using DMS.Data.Entities;
+using DMS.Infrastructure.Entities;
using DMS.Helper;
using DMS.Models;
-namespace DMS.Data.Repositories;
+namespace DMS.Infrastructure.Repositories;
public class VarTableRepository
{
diff --git a/DMS/Data/Repositories/VariableMqttAliasRepository.cs b/DMS.Infrastructure/Repositories/VariableMqttAliasRepository.cs
similarity index 98%
rename from DMS/Data/Repositories/VariableMqttAliasRepository.cs
rename to DMS.Infrastructure/Repositories/VariableMqttAliasRepository.cs
index 3070de6..04edb51 100644
--- a/DMS/Data/Repositories/VariableMqttAliasRepository.cs
+++ b/DMS.Infrastructure/Repositories/VariableMqttAliasRepository.cs
@@ -1,9 +1,9 @@
using SqlSugar;
using System.Collections.Generic;
using System.Threading.Tasks;
-using DMS.Data.Entities;
+using DMS.Infrastructure.Entities;
-namespace DMS.Data.Repositories;
+namespace DMS.Infrastructure.Repositories;
///
/// 变量与MQTT服务器别名关联的数据仓库。
diff --git a/DMS.WPF/App.xaml b/DMS.WPF/App.xaml
new file mode 100644
index 0000000..ee0bcda
--- /dev/null
+++ b/DMS.WPF/App.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/DMS.WPF/App.xaml.cs b/DMS.WPF/App.xaml.cs
new file mode 100644
index 0000000..0f78989
--- /dev/null
+++ b/DMS.WPF/App.xaml.cs
@@ -0,0 +1,14 @@
+using System.Configuration;
+using System.Data;
+using System.Windows;
+
+namespace DMS.WPF
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : Application
+ {
+ }
+
+}
diff --git a/DMS.WPF/AssemblyInfo.cs b/DMS.WPF/AssemblyInfo.cs
new file mode 100644
index 0000000..b0ec827
--- /dev/null
+++ b/DMS.WPF/AssemblyInfo.cs
@@ -0,0 +1,10 @@
+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/DMS/Assets/AppIcon.png b/DMS.WPF/Assets/AppIcon.png
similarity index 100%
rename from DMS/Assets/AppIcon.png
rename to DMS.WPF/Assets/AppIcon.png
diff --git a/DMS.WPF/DMS.WPF.csproj b/DMS.WPF/DMS.WPF.csproj
new file mode 100644
index 0000000..a6925d7
--- /dev/null
+++ b/DMS.WPF/DMS.WPF.csproj
@@ -0,0 +1,152 @@
+
+
+
+ WinExe
+ net8.0-windows
+ enable
+ enable
+ true
+
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+ MSBuild:Compile
+ Wpf
+ Designer
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DMS/Extensions/BindingProxy.cs b/DMS.WPF/Extensions/BindingProxy.cs
similarity index 100%
rename from DMS/Extensions/BindingProxy.cs
rename to DMS.WPF/Extensions/BindingProxy.cs
diff --git a/DMS/Extensions/EnumBindingSourceExtension.cs b/DMS.WPF/Extensions/EnumBindingSourceExtension.cs
similarity index 100%
rename from DMS/Extensions/EnumBindingSourceExtension.cs
rename to DMS.WPF/Extensions/EnumBindingSourceExtension.cs
diff --git a/DMS/Extensions/ObjectExtensions.cs b/DMS.WPF/Extensions/ObjectExtensions.cs
similarity index 100%
rename from DMS/Extensions/ObjectExtensions.cs
rename to DMS.WPF/Extensions/ObjectExtensions.cs
diff --git a/DMS/Extensions/TaskExtensions.cs b/DMS.WPF/Extensions/TaskExtensions.cs
similarity index 100%
rename from DMS/Extensions/TaskExtensions.cs
rename to DMS.WPF/Extensions/TaskExtensions.cs
diff --git a/DMS/Helper/DataServicesHelper.cs b/DMS.WPF/Helper/DataServicesHelper.cs
similarity index 99%
rename from DMS/Helper/DataServicesHelper.cs
rename to DMS.WPF/Helper/DataServicesHelper.cs
index eb8f7d8..80966da 100644
--- a/DMS/Helper/DataServicesHelper.cs
+++ b/DMS.WPF/Helper/DataServicesHelper.cs
@@ -1,4 +1,4 @@
-using DMS.Enums;
+using DMS.Core.Enums;
using DMS.Models;
using DMS.ViewModels;
using Microsoft.Extensions.DependencyInjection;
diff --git a/DMS/Helper/ExcelHelper.cs b/DMS.WPF/Helper/ExcelHelper.cs
similarity index 99%
rename from DMS/Helper/ExcelHelper.cs
rename to DMS.WPF/Helper/ExcelHelper.cs
index 9ab164e..a6d0bd7 100644
--- a/DMS/Helper/ExcelHelper.cs
+++ b/DMS.WPF/Helper/ExcelHelper.cs
@@ -5,7 +5,7 @@ using System.Data;
using System.IO;
using System.Linq;
using System.Reflection;
-using DMS.Enums;
+using DMS.Core.Enums;
using DMS.Models;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
diff --git a/DMS/Helper/MenuHelper.cs b/DMS.WPF/Helper/MenuHelper.cs
similarity index 100%
rename from DMS/Helper/MenuHelper.cs
rename to DMS.WPF/Helper/MenuHelper.cs
diff --git a/DMS/Helper/MessageHelper.cs b/DMS.WPF/Helper/MessageHelper.cs
similarity index 97%
rename from DMS/Helper/MessageHelper.cs
rename to DMS.WPF/Helper/MessageHelper.cs
index eaa2e60..f2a4a6b 100644
--- a/DMS/Helper/MessageHelper.cs
+++ b/DMS.WPF/Helper/MessageHelper.cs
@@ -1,5 +1,5 @@
using CommunityToolkit.Mvvm.Messaging;
-using DMS.Enums;
+using DMS.Core.Enums;
using DMS.Message;
using DMS.ViewModels;
diff --git a/DMS/Helper/NotificationHelper.cs b/DMS.WPF/Helper/NotificationHelper.cs
similarity index 99%
rename from DMS/Helper/NotificationHelper.cs
rename to DMS.WPF/Helper/NotificationHelper.cs
index 05608c2..6a28cf9 100644
--- a/DMS/Helper/NotificationHelper.cs
+++ b/DMS.WPF/Helper/NotificationHelper.cs
@@ -4,7 +4,7 @@ using System.Collections.Concurrent;
using System.Runtime.CompilerServices;
using System.Threading;
using CommunityToolkit.Mvvm.Messaging;
-using DMS.Enums;
+using DMS.Core.Enums;
using DMS.Message;
namespace DMS.Helper;
diff --git a/DMS/Helper/ServiceHelper.cs b/DMS.WPF/Helper/ServiceHelper.cs
similarity index 99%
rename from DMS/Helper/ServiceHelper.cs
rename to DMS.WPF/Helper/ServiceHelper.cs
index fc2aedb..7ee58ce 100644
--- a/DMS/Helper/ServiceHelper.cs
+++ b/DMS.WPF/Helper/ServiceHelper.cs
@@ -1,4 +1,4 @@
-using DMS.Enums;
+using DMS.Core.Enums;
using Opc.Ua;
using Opc.Ua.Client;
using Opc.Ua.Configuration;
diff --git a/DMS/Helper/SiemensHelper.cs b/DMS.WPF/Helper/SiemensHelper.cs
similarity index 100%
rename from DMS/Helper/SiemensHelper.cs
rename to DMS.WPF/Helper/SiemensHelper.cs
diff --git a/DMS/Helper/ThemeHelper.cs b/DMS.WPF/Helper/ThemeHelper.cs
similarity index 100%
rename from DMS/Helper/ThemeHelper.cs
rename to DMS.WPF/Helper/ThemeHelper.cs
diff --git a/DMS.WPF/MainWindow.xaml b/DMS.WPF/MainWindow.xaml
new file mode 100644
index 0000000..be9bd37
--- /dev/null
+++ b/DMS.WPF/MainWindow.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
diff --git a/DMS.WPF/MainWindow.xaml.cs b/DMS.WPF/MainWindow.xaml.cs
new file mode 100644
index 0000000..0138b1a
--- /dev/null
+++ b/DMS.WPF/MainWindow.xaml.cs
@@ -0,0 +1,24 @@
+using System.Text;
+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 DMS.WPF
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ public MainWindow()
+ {
+ InitializeComponent();
+ }
+ }
+}
\ No newline at end of file
diff --git a/DMS/Message/LoadMessage.cs b/DMS.WPF/Message/LoadMessage.cs
similarity index 92%
rename from DMS/Message/LoadMessage.cs
rename to DMS.WPF/Message/LoadMessage.cs
index 75c1ef5..cda7baa 100644
--- a/DMS/Message/LoadMessage.cs
+++ b/DMS.WPF/Message/LoadMessage.cs
@@ -1,5 +1,5 @@
using CommunityToolkit.Mvvm.Messaging.Messages;
-using DMS.Enums;
+using DMS.Core.Enums;
namespace DMS.Message;
diff --git a/DMS/Message/MyMessage.cs b/DMS.WPF/Message/MyMessage.cs
similarity index 100%
rename from DMS/Message/MyMessage.cs
rename to DMS.WPF/Message/MyMessage.cs
diff --git a/DMS/Message/NavgatorMessage.cs b/DMS.WPF/Message/NavgatorMessage.cs
similarity index 100%
rename from DMS/Message/NavgatorMessage.cs
rename to DMS.WPF/Message/NavgatorMessage.cs
diff --git a/DMS/Message/NotificationMessage.cs b/DMS.WPF/Message/NotificationMessage.cs
similarity index 95%
rename from DMS/Message/NotificationMessage.cs
rename to DMS.WPF/Message/NotificationMessage.cs
index 184898f..d18e825 100644
--- a/DMS/Message/NotificationMessage.cs
+++ b/DMS.WPF/Message/NotificationMessage.cs
@@ -1,5 +1,5 @@
using CommunityToolkit.Mvvm.Messaging.Messages;
-using DMS.Enums;
+using DMS.Core.Enums;
namespace DMS.Message;
diff --git a/DMS/Message/ReqMessage.cs b/DMS.WPF/Message/ReqMessage.cs
similarity index 100%
rename from DMS/Message/ReqMessage.cs
rename to DMS.WPF/Message/ReqMessage.cs
diff --git a/DMS/Message/UpdateMenuMessage.cs b/DMS.WPF/Message/UpdateMenuMessage.cs
similarity index 100%
rename from DMS/Message/UpdateMenuMessage.cs
rename to DMS.WPF/Message/UpdateMenuMessage.cs
diff --git a/DMS/Models/Device.cs b/DMS.WPF/Models/Device.cs
similarity index 99%
rename from DMS/Models/Device.cs
rename to DMS.WPF/Models/Device.cs
index 1faf6bc..b70c156 100644
--- a/DMS/Models/Device.cs
+++ b/DMS.WPF/Models/Device.cs
@@ -1,6 +1,6 @@
using System.Collections.ObjectModel;
using CommunityToolkit.Mvvm.ComponentModel;
-using DMS.Enums;
+using DMS.Core.Enums;
using SqlSugar;
using SqlSugar.DbConvert;
using S7.Net; // AddAsync this using directive
diff --git a/DMS/Models/MenuBean.cs b/DMS.WPF/Models/MenuBean.cs
similarity index 98%
rename from DMS/Models/MenuBean.cs
rename to DMS.WPF/Models/MenuBean.cs
index 638722c..10c5596 100644
--- a/DMS/Models/MenuBean.cs
+++ b/DMS.WPF/Models/MenuBean.cs
@@ -1,5 +1,5 @@
using CommunityToolkit.Mvvm.ComponentModel;
-using DMS.Enums;
+using DMS.Core.Enums;
using DMS.ViewModels;
namespace DMS.Models;
diff --git a/DMS/Models/Mqtt.cs b/DMS.WPF/Models/Mqtt.cs
similarity index 99%
rename from DMS/Models/Mqtt.cs
rename to DMS.WPF/Models/Mqtt.cs
index b575434..762c451 100644
--- a/DMS/Models/Mqtt.cs
+++ b/DMS.WPF/Models/Mqtt.cs
@@ -1,5 +1,5 @@
using CommunityToolkit.Mvvm.ComponentModel;
-using DMS.Enums;
+using DMS.Core.Enums;
namespace DMS.Models;
diff --git a/DMS.WPF/Models/Notification.cs b/DMS.WPF/Models/Notification.cs
new file mode 100644
index 0000000..4c8b7e3
--- /dev/null
+++ b/DMS.WPF/Models/Notification.cs
@@ -0,0 +1,24 @@
+using DMS.Core.Enums;
+
+namespace DMS.Models;
+
+///
+/// 表示通知信息。
+///
+public class Notification
+{
+ ///
+ /// 通知是否为全局通知。
+ ///
+ public bool IsGlobal { get; set; }
+
+ ///
+ /// 通知消息内容。
+ ///
+ public string Message { get; set; }
+
+ ///
+ /// 通知类型。
+ ///
+ public NotificationType Type { get; set; }
+}
\ No newline at end of file
diff --git a/DMS/Models/OpcUaNode.cs b/DMS.WPF/Models/OpcUaNode.cs
similarity index 100%
rename from DMS/Models/OpcUaNode.cs
rename to DMS.WPF/Models/OpcUaNode.cs
diff --git a/DMS.WPF/Models/User.cs b/DMS.WPF/Models/User.cs
new file mode 100644
index 0000000..2b26fe4
--- /dev/null
+++ b/DMS.WPF/Models/User.cs
@@ -0,0 +1,14 @@
+namespace DMS.Models;
+
+public class User
+{
+
+ public int Id { get; set; }
+
+ public string Name { get; set; }
+
+ public string Password { get; set; }
+ public string Email { get; set; }
+ public string PhoneNumber { get; set; }
+ public string Address { get; set; }
+}
\ No newline at end of file
diff --git a/DMS/Models/Variable.cs b/DMS.WPF/Models/Variable.cs
similarity index 99%
rename from DMS/Models/Variable.cs
rename to DMS.WPF/Models/Variable.cs
index 500cd66..fb097d5 100644
--- a/DMS/Models/Variable.cs
+++ b/DMS.WPF/Models/Variable.cs
@@ -1,5 +1,5 @@
using CommunityToolkit.Mvvm.ComponentModel;
-using DMS.Enums;
+using DMS.Core.Enums;
namespace DMS.Models;
diff --git a/DMS.WPF/Models/VariableContext.cs b/DMS.WPF/Models/VariableContext.cs
new file mode 100644
index 0000000..f023cc5
--- /dev/null
+++ b/DMS.WPF/Models/VariableContext.cs
@@ -0,0 +1,16 @@
+using DMS.Models;
+
+namespace DMS.Models
+{
+ public class VariableContext
+ {
+ public Variable Data { get; set; }
+ public bool IsHandled { get; set; }
+
+ public VariableContext(Variable data)
+ {
+ Data = data;
+ IsHandled = false; // 默认未处理
+ }
+ }
+}
\ No newline at end of file
diff --git a/DMS/Models/VariableMqtt.cs b/DMS.WPF/Models/VariableMqtt.cs
similarity index 98%
rename from DMS/Models/VariableMqtt.cs
rename to DMS.WPF/Models/VariableMqtt.cs
index f52840f..226bc99 100644
--- a/DMS/Models/VariableMqtt.cs
+++ b/DMS.WPF/Models/VariableMqtt.cs
@@ -1,6 +1,6 @@
using System;
using CommunityToolkit.Mvvm.ComponentModel;
-using DMS.Enums;
+using DMS.Core.Enums;
using DMS.Data.Entities;
namespace DMS.Models;
diff --git a/DMS/Models/VariableTable.cs b/DMS.WPF/Models/VariableTable.cs
similarity index 98%
rename from DMS/Models/VariableTable.cs
rename to DMS.WPF/Models/VariableTable.cs
index 2461bf1..6fe1c08 100644
--- a/DMS/Models/VariableTable.cs
+++ b/DMS.WPF/Models/VariableTable.cs
@@ -1,7 +1,7 @@
using System.Collections.ObjectModel;
using System.ComponentModel;
using CommunityToolkit.Mvvm.ComponentModel;
-using DMS.Enums;
+using DMS.Core.Enums;
namespace DMS.Models;
diff --git a/DMS/Resources/DevicesItemTemplateDictionary.xaml b/DMS.WPF/Resources/DevicesItemTemplateDictionary.xaml
similarity index 100%
rename from DMS/Resources/DevicesItemTemplateDictionary.xaml
rename to DMS.WPF/Resources/DevicesItemTemplateDictionary.xaml
diff --git a/DMS/Services/DataProcessingService.cs b/DMS.WPF/Services/DataProcessingService.cs
similarity index 100%
rename from DMS/Services/DataProcessingService.cs
rename to DMS.WPF/Services/DataProcessingService.cs
diff --git a/DMS/Services/DataServices.cs b/DMS.WPF/Services/DataServices.cs
similarity index 99%
rename from DMS/Services/DataServices.cs
rename to DMS.WPF/Services/DataServices.cs
index 9a0a90a..7d3d1e6 100644
--- a/DMS/Services/DataServices.cs
+++ b/DMS.WPF/Services/DataServices.cs
@@ -3,7 +3,7 @@ using AutoMapper;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Messaging;
using DMS.Data.Repositories;
-using DMS.Enums;
+using DMS.Core.Enums;
using DMS.Helper;
using DMS.Message;
using DMS.Models;
diff --git a/DMS/Services/DialogService.cs b/DMS.WPF/Services/DialogService.cs
similarity index 99%
rename from DMS/Services/DialogService.cs
rename to DMS.WPF/Services/DialogService.cs
index f65d11a..a3facfb 100644
--- a/DMS/Services/DialogService.cs
+++ b/DMS.WPF/Services/DialogService.cs
@@ -1,4 +1,4 @@
-using DMS.Enums;
+using DMS.Core.Enums;
using DMS.Models;
using DMS.ViewModels.Dialogs;
using DMS.Views.Dialogs;
diff --git a/DMS/Services/GrowlNotificationService.cs b/DMS.WPF/Services/GrowlNotificationService.cs
similarity index 99%
rename from DMS/Services/GrowlNotificationService.cs
rename to DMS.WPF/Services/GrowlNotificationService.cs
index 51831f7..0803c57 100644
--- a/DMS/Services/GrowlNotificationService.cs
+++ b/DMS.WPF/Services/GrowlNotificationService.cs
@@ -1,6 +1,6 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Messaging;
-using DMS.Enums;
+using DMS.Core.Enums;
using DMS.Message;
using HandyControl.Controls;
using Models_Notification = DMS.Models.Notification;
diff --git a/DMS/Services/IDataProcessingService.cs b/DMS.WPF/Services/IDataProcessingService.cs
similarity index 100%
rename from DMS/Services/IDataProcessingService.cs
rename to DMS.WPF/Services/IDataProcessingService.cs
diff --git a/DMS/Services/IDialogService.cs b/DMS.WPF/Services/IDialogService.cs
similarity index 98%
rename from DMS/Services/IDialogService.cs
rename to DMS.WPF/Services/IDialogService.cs
index f2ebe55..3938406 100644
--- a/DMS/Services/IDialogService.cs
+++ b/DMS.WPF/Services/IDialogService.cs
@@ -1,4 +1,4 @@
-using DMS.Enums;
+using DMS.Core.Enums;
using DMS.Models;
using iNKORE.UI.WPF.Modern.Controls;
diff --git a/DMS/Services/INotificationService.cs b/DMS.WPF/Services/INotificationService.cs
similarity index 90%
rename from DMS/Services/INotificationService.cs
rename to DMS.WPF/Services/INotificationService.cs
index c0b1baf..7933909 100644
--- a/DMS/Services/INotificationService.cs
+++ b/DMS.WPF/Services/INotificationService.cs
@@ -1,4 +1,4 @@
-using DMS.Enums;
+using DMS.Core.Enums;
using DMS.Models;
namespace DMS.Services;
diff --git a/DMS/Services/IVariableProcessor.cs b/DMS.WPF/Services/IVariableProcessor.cs
similarity index 100%
rename from DMS/Services/IVariableProcessor.cs
rename to DMS.WPF/Services/IVariableProcessor.cs
diff --git a/DMS/Services/LogService.cs b/DMS.WPF/Services/LogService.cs
similarity index 100%
rename from DMS/Services/LogService.cs
rename to DMS.WPF/Services/LogService.cs
diff --git a/DMS/Services/MqttBackgroundService.cs b/DMS.WPF/Services/MqttBackgroundService.cs
similarity index 100%
rename from DMS/Services/MqttBackgroundService.cs
rename to DMS.WPF/Services/MqttBackgroundService.cs
diff --git a/DMS/Services/NavgatorServices.cs b/DMS.WPF/Services/NavgatorServices.cs
similarity index 98%
rename from DMS/Services/NavgatorServices.cs
rename to DMS.WPF/Services/NavgatorServices.cs
index 82c9f07..2665bc4 100644
--- a/DMS/Services/NavgatorServices.cs
+++ b/DMS.WPF/Services/NavgatorServices.cs
@@ -5,7 +5,7 @@ using DMS.Message;
using DMS.ViewModels;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
-using DMS.Enums;
+using DMS.Core.Enums;
namespace DMS.Services;
diff --git a/DMS/Services/OpcUaBackgroundService.cs b/DMS.WPF/Services/OpcUaBackgroundService.cs
similarity index 99%
rename from DMS/Services/OpcUaBackgroundService.cs
rename to DMS.WPF/Services/OpcUaBackgroundService.cs
index a34dd1a..d6d172a 100644
--- a/DMS/Services/OpcUaBackgroundService.cs
+++ b/DMS.WPF/Services/OpcUaBackgroundService.cs
@@ -1,5 +1,5 @@
using System.Collections.Concurrent;
-using DMS.Enums;
+using DMS.Core.Enums;
using DMS.Helper;
using DMS.Models;
using Microsoft.Extensions.Hosting;
diff --git a/DMS/Services/Processors/CheckValueChangedProcessor.cs b/DMS.WPF/Services/Processors/CheckValueChangedProcessor.cs
similarity index 100%
rename from DMS/Services/Processors/CheckValueChangedProcessor.cs
rename to DMS.WPF/Services/Processors/CheckValueChangedProcessor.cs
diff --git a/DMS/Services/Processors/HistoryProcessor.cs b/DMS.WPF/Services/Processors/HistoryProcessor.cs
similarity index 100%
rename from DMS/Services/Processors/HistoryProcessor.cs
rename to DMS.WPF/Services/Processors/HistoryProcessor.cs
diff --git a/DMS/Services/Processors/LoggingProcessor.cs b/DMS.WPF/Services/Processors/LoggingProcessor.cs
similarity index 100%
rename from DMS/Services/Processors/LoggingProcessor.cs
rename to DMS.WPF/Services/Processors/LoggingProcessor.cs
diff --git a/DMS/Services/Processors/MqttPublishProcessor.cs b/DMS.WPF/Services/Processors/MqttPublishProcessor.cs
similarity index 100%
rename from DMS/Services/Processors/MqttPublishProcessor.cs
rename to DMS.WPF/Services/Processors/MqttPublishProcessor.cs
diff --git a/DMS/Services/Processors/UpdateDbVariableProcessor.cs b/DMS.WPF/Services/Processors/UpdateDbVariableProcessor.cs
similarity index 100%
rename from DMS/Services/Processors/UpdateDbVariableProcessor.cs
rename to DMS.WPF/Services/Processors/UpdateDbVariableProcessor.cs
diff --git a/DMS/Services/S7BackgroundService.cs b/DMS.WPF/Services/S7BackgroundService.cs
similarity index 99%
rename from DMS/Services/S7BackgroundService.cs
rename to DMS.WPF/Services/S7BackgroundService.cs
index 31adeb3..14232aa 100644
--- a/DMS/Services/S7BackgroundService.cs
+++ b/DMS.WPF/Services/S7BackgroundService.cs
@@ -1,5 +1,5 @@
using System.Collections.Concurrent;
-using DMS.Enums;
+using DMS.Core.Enums;
using DMS.Helper;
using DMS.Models;
using Microsoft.Extensions.Hosting;
diff --git a/DMS/ValueConverts/EnumDescriptionConverter.cs b/DMS.WPF/ValueConverts/EnumDescriptionConverter.cs
similarity index 100%
rename from DMS/ValueConverts/EnumDescriptionConverter.cs
rename to DMS.WPF/ValueConverts/EnumDescriptionConverter.cs
diff --git a/DMS/ValueConverts/NullableBooleanConverter.cs b/DMS.WPF/ValueConverts/NullableBooleanConverter.cs
similarity index 100%
rename from DMS/ValueConverts/NullableBooleanConverter.cs
rename to DMS.WPF/ValueConverts/NullableBooleanConverter.cs
diff --git a/DMS/ViewModels/DataTransformViewModel.cs b/DMS.WPF/ViewModels/DataTransformViewModel.cs
similarity index 100%
rename from DMS/ViewModels/DataTransformViewModel.cs
rename to DMS.WPF/ViewModels/DataTransformViewModel.cs
diff --git a/DMS/ViewModels/DeviceDetailViewModel.cs b/DMS.WPF/ViewModels/DeviceDetailViewModel.cs
similarity index 99%
rename from DMS/ViewModels/DeviceDetailViewModel.cs
rename to DMS.WPF/ViewModels/DeviceDetailViewModel.cs
index fcd74ed..e075d3e 100644
--- a/DMS/ViewModels/DeviceDetailViewModel.cs
+++ b/DMS.WPF/ViewModels/DeviceDetailViewModel.cs
@@ -3,7 +3,7 @@ using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using DMS.Data;
using DMS.Data.Repositories;
-using DMS.Enums;
+using DMS.Core.Enums;
using DMS.Helper;
using DMS.Models;
using DMS.Services;
diff --git a/DMS/ViewModels/DevicesViewModel.cs b/DMS.WPF/ViewModels/DevicesViewModel.cs
similarity index 99%
rename from DMS/ViewModels/DevicesViewModel.cs
rename to DMS.WPF/ViewModels/DevicesViewModel.cs
index f06e249..90dcf1c 100644
--- a/DMS/ViewModels/DevicesViewModel.cs
+++ b/DMS.WPF/ViewModels/DevicesViewModel.cs
@@ -2,7 +2,7 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using DMS.Data.Repositories;
-using DMS.Enums;
+using DMS.Core.Enums;
using DMS.Helper;
using DMS.Models;
using DMS.Services;
diff --git a/DMS/ViewModels/Dialogs/ConfrimDialogViewModel.cs b/DMS.WPF/ViewModels/Dialogs/ConfrimDialogViewModel.cs
similarity index 100%
rename from DMS/ViewModels/Dialogs/ConfrimDialogViewModel.cs
rename to DMS.WPF/ViewModels/Dialogs/ConfrimDialogViewModel.cs
diff --git a/DMS/ViewModels/Dialogs/DeviceDialogViewModel.cs b/DMS.WPF/ViewModels/Dialogs/DeviceDialogViewModel.cs
similarity index 100%
rename from DMS/ViewModels/Dialogs/DeviceDialogViewModel.cs
rename to DMS.WPF/ViewModels/Dialogs/DeviceDialogViewModel.cs
diff --git a/DMS/ViewModels/Dialogs/ImportExcelDialogViewModel.cs b/DMS.WPF/ViewModels/Dialogs/ImportExcelDialogViewModel.cs
similarity index 100%
rename from DMS/ViewModels/Dialogs/ImportExcelDialogViewModel.cs
rename to DMS.WPF/ViewModels/Dialogs/ImportExcelDialogViewModel.cs
diff --git a/DMS/ViewModels/Dialogs/ImportResultDialogViewModel.cs b/DMS.WPF/ViewModels/Dialogs/ImportResultDialogViewModel.cs
similarity index 100%
rename from DMS/ViewModels/Dialogs/ImportResultDialogViewModel.cs
rename to DMS.WPF/ViewModels/Dialogs/ImportResultDialogViewModel.cs
diff --git a/DMS/ViewModels/Dialogs/IsActiveDialogViewModel.cs b/DMS.WPF/ViewModels/Dialogs/IsActiveDialogViewModel.cs
similarity index 96%
rename from DMS/ViewModels/Dialogs/IsActiveDialogViewModel.cs
rename to DMS.WPF/ViewModels/Dialogs/IsActiveDialogViewModel.cs
index 6425a91..a3a2401 100644
--- a/DMS/ViewModels/Dialogs/IsActiveDialogViewModel.cs
+++ b/DMS.WPF/ViewModels/Dialogs/IsActiveDialogViewModel.cs
@@ -1,6 +1,6 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
-using DMS.Enums;
+using DMS.Core.Enums;
namespace DMS.ViewModels.Dialogs;
diff --git a/DMS/ViewModels/Dialogs/MqttAliasBatchEditDialogViewModel.cs b/DMS.WPF/ViewModels/Dialogs/MqttAliasBatchEditDialogViewModel.cs
similarity index 100%
rename from DMS/ViewModels/Dialogs/MqttAliasBatchEditDialogViewModel.cs
rename to DMS.WPF/ViewModels/Dialogs/MqttAliasBatchEditDialogViewModel.cs
diff --git a/DMS/ViewModels/Dialogs/MqttAliasDialogViewModel.cs b/DMS.WPF/ViewModels/Dialogs/MqttAliasDialogViewModel.cs
similarity index 100%
rename from DMS/ViewModels/Dialogs/MqttAliasDialogViewModel.cs
rename to DMS.WPF/ViewModels/Dialogs/MqttAliasDialogViewModel.cs
diff --git a/DMS/ViewModels/Dialogs/MqttDialogViewModel.cs b/DMS.WPF/ViewModels/Dialogs/MqttDialogViewModel.cs
similarity index 100%
rename from DMS/ViewModels/Dialogs/MqttDialogViewModel.cs
rename to DMS.WPF/ViewModels/Dialogs/MqttDialogViewModel.cs
diff --git a/DMS/ViewModels/Dialogs/MqttSelectionDialogViewModel.cs b/DMS.WPF/ViewModels/Dialogs/MqttSelectionDialogViewModel.cs
similarity index 100%
rename from DMS/ViewModels/Dialogs/MqttSelectionDialogViewModel.cs
rename to DMS.WPF/ViewModels/Dialogs/MqttSelectionDialogViewModel.cs
diff --git a/DMS/ViewModels/Dialogs/OpcUaImportDialogViewModel.cs b/DMS.WPF/ViewModels/Dialogs/OpcUaImportDialogViewModel.cs
similarity index 99%
rename from DMS/ViewModels/Dialogs/OpcUaImportDialogViewModel.cs
rename to DMS.WPF/ViewModels/Dialogs/OpcUaImportDialogViewModel.cs
index 7d204c1..b3a857b 100644
--- a/DMS/ViewModels/Dialogs/OpcUaImportDialogViewModel.cs
+++ b/DMS.WPF/ViewModels/Dialogs/OpcUaImportDialogViewModel.cs
@@ -3,7 +3,7 @@ using System.Linq;
using System.Threading.Tasks;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
-using DMS.Enums;
+using DMS.Core.Enums;
using DMS.Helper;
using DMS.Models;
using Opc.Ua;
diff --git a/DMS/ViewModels/Dialogs/OpcUaUpdateTypeDialogViewModel.cs b/DMS.WPF/ViewModels/Dialogs/OpcUaUpdateTypeDialogViewModel.cs
similarity index 95%
rename from DMS/ViewModels/Dialogs/OpcUaUpdateTypeDialogViewModel.cs
rename to DMS.WPF/ViewModels/Dialogs/OpcUaUpdateTypeDialogViewModel.cs
index 104c7d5..2d23daf 100644
--- a/DMS/ViewModels/Dialogs/OpcUaUpdateTypeDialogViewModel.cs
+++ b/DMS.WPF/ViewModels/Dialogs/OpcUaUpdateTypeDialogViewModel.cs
@@ -1,5 +1,5 @@
using CommunityToolkit.Mvvm.ComponentModel;
-using DMS.Enums;
+using DMS.Core.Enums;
namespace DMS.ViewModels.Dialogs
{
diff --git a/DMS/ViewModels/Dialogs/PollLevelDialogViewModel.cs b/DMS.WPF/ViewModels/Dialogs/PollLevelDialogViewModel.cs
similarity index 96%
rename from DMS/ViewModels/Dialogs/PollLevelDialogViewModel.cs
rename to DMS.WPF/ViewModels/Dialogs/PollLevelDialogViewModel.cs
index 57532f6..bd1825a 100644
--- a/DMS/ViewModels/Dialogs/PollLevelDialogViewModel.cs
+++ b/DMS.WPF/ViewModels/Dialogs/PollLevelDialogViewModel.cs
@@ -2,7 +2,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using CommunityToolkit.Mvvm.ComponentModel;
-using DMS.Enums;
+using DMS.Core.Enums;
namespace DMS.ViewModels.Dialogs
{
diff --git a/DMS/ViewModels/Dialogs/ProcessingDialogViewModel.cs b/DMS.WPF/ViewModels/Dialogs/ProcessingDialogViewModel.cs
similarity index 100%
rename from DMS/ViewModels/Dialogs/ProcessingDialogViewModel.cs
rename to DMS.WPF/ViewModels/Dialogs/ProcessingDialogViewModel.cs
diff --git a/DMS/ViewModels/Dialogs/VarDataDialogViewModel.cs b/DMS.WPF/ViewModels/Dialogs/VarDataDialogViewModel.cs
similarity index 100%
rename from DMS/ViewModels/Dialogs/VarDataDialogViewModel.cs
rename to DMS.WPF/ViewModels/Dialogs/VarDataDialogViewModel.cs
diff --git a/DMS/ViewModels/Dialogs/VarTableDialogViewModel.cs b/DMS.WPF/ViewModels/Dialogs/VarTableDialogViewModel.cs
similarity index 100%
rename from DMS/ViewModels/Dialogs/VarTableDialogViewModel.cs
rename to DMS.WPF/ViewModels/Dialogs/VarTableDialogViewModel.cs
diff --git a/DMS/ViewModels/HomeViewModel.cs b/DMS.WPF/ViewModels/HomeViewModel.cs
similarity index 100%
rename from DMS/ViewModels/HomeViewModel.cs
rename to DMS.WPF/ViewModels/HomeViewModel.cs
diff --git a/DMS/ViewModels/MainViewModel.cs b/DMS.WPF/ViewModels/MainViewModel.cs
similarity index 99%
rename from DMS/ViewModels/MainViewModel.cs
rename to DMS.WPF/ViewModels/MainViewModel.cs
index e7a977e..7ec56d0 100644
--- a/DMS/ViewModels/MainViewModel.cs
+++ b/DMS.WPF/ViewModels/MainViewModel.cs
@@ -4,7 +4,7 @@ using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using DMS.Data;
using DMS.Data.Repositories;
-using DMS.Enums;
+using DMS.Core.Enums;
using DMS.Helper;
using DMS.Models;
using DMS.Services;
diff --git a/DMS/ViewModels/MqttServerDetailViewModel.cs b/DMS.WPF/ViewModels/MqttServerDetailViewModel.cs
similarity index 99%
rename from DMS/ViewModels/MqttServerDetailViewModel.cs
rename to DMS.WPF/ViewModels/MqttServerDetailViewModel.cs
index a03de4f..78ee2af 100644
--- a/DMS/ViewModels/MqttServerDetailViewModel.cs
+++ b/DMS.WPF/ViewModels/MqttServerDetailViewModel.cs
@@ -1,7 +1,7 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Microsoft.Extensions.Logging;
-using DMS.Enums;
+using DMS.Core.Enums;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
diff --git a/DMS/ViewModels/MqttsViewModel.cs b/DMS.WPF/ViewModels/MqttsViewModel.cs
similarity index 99%
rename from DMS/ViewModels/MqttsViewModel.cs
rename to DMS.WPF/ViewModels/MqttsViewModel.cs
index a8c7774..b5203c0 100644
--- a/DMS/ViewModels/MqttsViewModel.cs
+++ b/DMS.WPF/ViewModels/MqttsViewModel.cs
@@ -2,7 +2,7 @@ using System.Collections.ObjectModel;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using DMS.Data.Repositories;
-using DMS.Enums;
+using DMS.Core.Enums;
using DMS.Helper;
using DMS.Models;
using DMS.Services;
diff --git a/DMS/ViewModels/SettingViewModel.cs b/DMS.WPF/ViewModels/SettingViewModel.cs
similarity index 100%
rename from DMS/ViewModels/SettingViewModel.cs
rename to DMS.WPF/ViewModels/SettingViewModel.cs
diff --git a/DMS/ViewModels/VariableTableViewModel.cs b/DMS.WPF/ViewModels/VariableTableViewModel.cs
similarity index 99%
rename from DMS/ViewModels/VariableTableViewModel.cs
rename to DMS.WPF/ViewModels/VariableTableViewModel.cs
index 0d08b36..b566637 100644
--- a/DMS/ViewModels/VariableTableViewModel.cs
+++ b/DMS.WPF/ViewModels/VariableTableViewModel.cs
@@ -6,7 +6,7 @@ using AutoMapper;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using DMS.Data.Repositories;
-using DMS.Enums;
+using DMS.Core.Enums;
using DMS.Helper;
using DMS.Models;
using DMS.Services;
diff --git a/DMS/ViewModels/ViewModelBase.cs b/DMS.WPF/ViewModels/ViewModelBase.cs
similarity index 100%
rename from DMS/ViewModels/ViewModelBase.cs
rename to DMS.WPF/ViewModels/ViewModelBase.cs
diff --git a/DMS/Views/DataTransformView.xaml b/DMS.WPF/Views/DataTransformView.xaml
similarity index 100%
rename from DMS/Views/DataTransformView.xaml
rename to DMS.WPF/Views/DataTransformView.xaml
diff --git a/DMS/Views/DataTransformView.xaml.cs b/DMS.WPF/Views/DataTransformView.xaml.cs
similarity index 100%
rename from DMS/Views/DataTransformView.xaml.cs
rename to DMS.WPF/Views/DataTransformView.xaml.cs
diff --git a/DMS/Views/DeviceDetailView.xaml b/DMS.WPF/Views/DeviceDetailView.xaml
similarity index 100%
rename from DMS/Views/DeviceDetailView.xaml
rename to DMS.WPF/Views/DeviceDetailView.xaml
diff --git a/DMS/Views/DeviceDetailView.xaml.cs b/DMS.WPF/Views/DeviceDetailView.xaml.cs
similarity index 100%
rename from DMS/Views/DeviceDetailView.xaml.cs
rename to DMS.WPF/Views/DeviceDetailView.xaml.cs
diff --git a/DMS/Views/DevicesView.xaml b/DMS.WPF/Views/DevicesView.xaml
similarity index 100%
rename from DMS/Views/DevicesView.xaml
rename to DMS.WPF/Views/DevicesView.xaml
diff --git a/DMS/Views/DevicesView.xaml.cs b/DMS.WPF/Views/DevicesView.xaml.cs
similarity index 100%
rename from DMS/Views/DevicesView.xaml.cs
rename to DMS.WPF/Views/DevicesView.xaml.cs
diff --git a/DMS/Views/Dialogs/ConfirmDialog.xaml b/DMS.WPF/Views/Dialogs/ConfirmDialog.xaml
similarity index 96%
rename from DMS/Views/Dialogs/ConfirmDialog.xaml
rename to DMS.WPF/Views/Dialogs/ConfirmDialog.xaml
index f82de9f..1bd2758 100644
--- a/DMS/Views/Dialogs/ConfirmDialog.xaml
+++ b/DMS.WPF/Views/Dialogs/ConfirmDialog.xaml
@@ -8,7 +8,7 @@
xmlns:vmd="clr-namespace:DMS.ViewModels.Dialogs"
xmlns:vc="clr-namespace:DMS.ValueConverts"
xmlns:ex="clr-namespace:DMS.Extensions"
- xmlns:en="clr-namespace:DMS.Enums"
+ xmlns:en="clr-namespace:DMS.Core.Enums"
Title="{Binding Title}"
CloseButtonText="取消"
DefaultButton="Primary"
diff --git a/DMS/Views/Dialogs/ConfirmDialog.xaml.cs b/DMS.WPF/Views/Dialogs/ConfirmDialog.xaml.cs
similarity index 100%
rename from DMS/Views/Dialogs/ConfirmDialog.xaml.cs
rename to DMS.WPF/Views/Dialogs/ConfirmDialog.xaml.cs
diff --git a/DMS/Views/Dialogs/DeviceDialog.xaml b/DMS.WPF/Views/Dialogs/DeviceDialog.xaml
similarity index 99%
rename from DMS/Views/Dialogs/DeviceDialog.xaml
rename to DMS.WPF/Views/Dialogs/DeviceDialog.xaml
index 62d6e47..52f3bab 100644
--- a/DMS/Views/Dialogs/DeviceDialog.xaml
+++ b/DMS.WPF/Views/Dialogs/DeviceDialog.xaml
@@ -8,7 +8,7 @@
xmlns:vmd="clr-namespace:DMS.ViewModels.Dialogs"
xmlns:vc="clr-namespace:DMS.ValueConverts"
xmlns:ex="clr-namespace:DMS.Extensions"
- xmlns:en="clr-namespace:DMS.Enums"
+ xmlns:en="clr-namespace:DMS.Core.Enums"
Title="{Binding Title}"
CloseButtonText="取消"
DefaultButton="Primary"
diff --git a/DMS/Views/Dialogs/DeviceDialog.xaml.cs b/DMS.WPF/Views/Dialogs/DeviceDialog.xaml.cs
similarity index 100%
rename from DMS/Views/Dialogs/DeviceDialog.xaml.cs
rename to DMS.WPF/Views/Dialogs/DeviceDialog.xaml.cs
diff --git a/DMS/Views/Dialogs/ImportExcelDialog.xaml b/DMS.WPF/Views/Dialogs/ImportExcelDialog.xaml
similarity index 100%
rename from DMS/Views/Dialogs/ImportExcelDialog.xaml
rename to DMS.WPF/Views/Dialogs/ImportExcelDialog.xaml
diff --git a/DMS/Views/Dialogs/ImportExcelDialog.xaml.cs b/DMS.WPF/Views/Dialogs/ImportExcelDialog.xaml.cs
similarity index 100%
rename from DMS/Views/Dialogs/ImportExcelDialog.xaml.cs
rename to DMS.WPF/Views/Dialogs/ImportExcelDialog.xaml.cs
diff --git a/DMS/Views/Dialogs/ImportResultDialog.xaml b/DMS.WPF/Views/Dialogs/ImportResultDialog.xaml
similarity index 100%
rename from DMS/Views/Dialogs/ImportResultDialog.xaml
rename to DMS.WPF/Views/Dialogs/ImportResultDialog.xaml
diff --git a/DMS/Views/Dialogs/ImportResultDialog.xaml.cs b/DMS.WPF/Views/Dialogs/ImportResultDialog.xaml.cs
similarity index 100%
rename from DMS/Views/Dialogs/ImportResultDialog.xaml.cs
rename to DMS.WPF/Views/Dialogs/ImportResultDialog.xaml.cs
diff --git a/DMS/Views/Dialogs/IsActiveDialog.xaml b/DMS.WPF/Views/Dialogs/IsActiveDialog.xaml
similarity index 100%
rename from DMS/Views/Dialogs/IsActiveDialog.xaml
rename to DMS.WPF/Views/Dialogs/IsActiveDialog.xaml
diff --git a/DMS/Views/Dialogs/IsActiveDialog.xaml.cs b/DMS.WPF/Views/Dialogs/IsActiveDialog.xaml.cs
similarity index 100%
rename from DMS/Views/Dialogs/IsActiveDialog.xaml.cs
rename to DMS.WPF/Views/Dialogs/IsActiveDialog.xaml.cs
diff --git a/DMS/Views/Dialogs/MqttAliasBatchEditDialog.xaml b/DMS.WPF/Views/Dialogs/MqttAliasBatchEditDialog.xaml
similarity index 100%
rename from DMS/Views/Dialogs/MqttAliasBatchEditDialog.xaml
rename to DMS.WPF/Views/Dialogs/MqttAliasBatchEditDialog.xaml
diff --git a/DMS/Views/Dialogs/MqttAliasBatchEditDialog.xaml.cs b/DMS.WPF/Views/Dialogs/MqttAliasBatchEditDialog.xaml.cs
similarity index 100%
rename from DMS/Views/Dialogs/MqttAliasBatchEditDialog.xaml.cs
rename to DMS.WPF/Views/Dialogs/MqttAliasBatchEditDialog.xaml.cs
diff --git a/DMS/Views/Dialogs/MqttAliasDialog.xaml b/DMS.WPF/Views/Dialogs/MqttAliasDialog.xaml
similarity index 100%
rename from DMS/Views/Dialogs/MqttAliasDialog.xaml
rename to DMS.WPF/Views/Dialogs/MqttAliasDialog.xaml
diff --git a/DMS/Views/Dialogs/MqttAliasDialog.xaml.cs b/DMS.WPF/Views/Dialogs/MqttAliasDialog.xaml.cs
similarity index 100%
rename from DMS/Views/Dialogs/MqttAliasDialog.xaml.cs
rename to DMS.WPF/Views/Dialogs/MqttAliasDialog.xaml.cs
diff --git a/DMS/Views/Dialogs/MqttDialog.xaml b/DMS.WPF/Views/Dialogs/MqttDialog.xaml
similarity index 98%
rename from DMS/Views/Dialogs/MqttDialog.xaml
rename to DMS.WPF/Views/Dialogs/MqttDialog.xaml
index 519b685..6b5f7e8 100644
--- a/DMS/Views/Dialogs/MqttDialog.xaml
+++ b/DMS.WPF/Views/Dialogs/MqttDialog.xaml
@@ -8,7 +8,7 @@
xmlns:vmd="clr-namespace:DMS.ViewModels.Dialogs"
xmlns:vc="clr-namespace:DMS.ValueConverts"
xmlns:ex="clr-namespace:DMS.Extensions"
- xmlns:en="clr-namespace:DMS.Enums"
+ xmlns:en="clr-namespace:DMS.Core.Enums"
Title="{Binding Title}"
CloseButtonText="取消"
DefaultButton="Primary"
diff --git a/DMS/Views/Dialogs/MqttDialog.xaml.cs b/DMS.WPF/Views/Dialogs/MqttDialog.xaml.cs
similarity index 100%
rename from DMS/Views/Dialogs/MqttDialog.xaml.cs
rename to DMS.WPF/Views/Dialogs/MqttDialog.xaml.cs
diff --git a/DMS/Views/Dialogs/MqttSelectionDialog.xaml b/DMS.WPF/Views/Dialogs/MqttSelectionDialog.xaml
similarity index 100%
rename from DMS/Views/Dialogs/MqttSelectionDialog.xaml
rename to DMS.WPF/Views/Dialogs/MqttSelectionDialog.xaml
diff --git a/DMS/Views/Dialogs/MqttSelectionDialog.xaml.cs b/DMS.WPF/Views/Dialogs/MqttSelectionDialog.xaml.cs
similarity index 100%
rename from DMS/Views/Dialogs/MqttSelectionDialog.xaml.cs
rename to DMS.WPF/Views/Dialogs/MqttSelectionDialog.xaml.cs
diff --git a/DMS/Views/Dialogs/OpcUaImportDialog.xaml b/DMS.WPF/Views/Dialogs/OpcUaImportDialog.xaml
similarity index 100%
rename from DMS/Views/Dialogs/OpcUaImportDialog.xaml
rename to DMS.WPF/Views/Dialogs/OpcUaImportDialog.xaml
diff --git a/DMS/Views/Dialogs/OpcUaImportDialog.xaml.cs b/DMS.WPF/Views/Dialogs/OpcUaImportDialog.xaml.cs
similarity index 100%
rename from DMS/Views/Dialogs/OpcUaImportDialog.xaml.cs
rename to DMS.WPF/Views/Dialogs/OpcUaImportDialog.xaml.cs
diff --git a/DMS/Views/Dialogs/OpcUaUpdateTypeDialog.xaml b/DMS.WPF/Views/Dialogs/OpcUaUpdateTypeDialog.xaml
similarity index 95%
rename from DMS/Views/Dialogs/OpcUaUpdateTypeDialog.xaml
rename to DMS.WPF/Views/Dialogs/OpcUaUpdateTypeDialog.xaml
index 37bc5f5..9ef4a91 100644
--- a/DMS/Views/Dialogs/OpcUaUpdateTypeDialog.xaml
+++ b/DMS.WPF/Views/Dialogs/OpcUaUpdateTypeDialog.xaml
@@ -4,7 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
- xmlns:enums="clr-namespace:DMS.Enums"
+ xmlns:enums="clr-namespace:DMS.Core.Enums"
xmlns:extensions="clr-namespace:DMS.Extensions"
xmlns:viewModels="clr-namespace:DMS.ViewModels.Dialogs"
mc:Ignorable="d"
diff --git a/DMS/Views/Dialogs/OpcUaUpdateTypeDialog.xaml.cs b/DMS.WPF/Views/Dialogs/OpcUaUpdateTypeDialog.xaml.cs
similarity index 100%
rename from DMS/Views/Dialogs/OpcUaUpdateTypeDialog.xaml.cs
rename to DMS.WPF/Views/Dialogs/OpcUaUpdateTypeDialog.xaml.cs
diff --git a/DMS/Views/Dialogs/PollLevelDialog.xaml b/DMS.WPF/Views/Dialogs/PollLevelDialog.xaml
similarity index 96%
rename from DMS/Views/Dialogs/PollLevelDialog.xaml
rename to DMS.WPF/Views/Dialogs/PollLevelDialog.xaml
index 23eb4ff..151a7fa 100644
--- a/DMS/Views/Dialogs/PollLevelDialog.xaml
+++ b/DMS.WPF/Views/Dialogs/PollLevelDialog.xaml
@@ -3,7 +3,7 @@
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:enums="clr-namespace:DMS.Enums"
+ xmlns:enums="clr-namespace:DMS.Core.Enums"
xmlns:extensions="clr-namespace:DMS.Extensions"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:vc="clr-namespace:DMS.ValueConverts"
diff --git a/DMS/Views/Dialogs/PollLevelDialog.xaml.cs b/DMS.WPF/Views/Dialogs/PollLevelDialog.xaml.cs
similarity index 100%
rename from DMS/Views/Dialogs/PollLevelDialog.xaml.cs
rename to DMS.WPF/Views/Dialogs/PollLevelDialog.xaml.cs
diff --git a/DMS/Views/Dialogs/ProcessingDialog.xaml b/DMS.WPF/Views/Dialogs/ProcessingDialog.xaml
similarity index 100%
rename from DMS/Views/Dialogs/ProcessingDialog.xaml
rename to DMS.WPF/Views/Dialogs/ProcessingDialog.xaml
diff --git a/DMS/Views/Dialogs/ProcessingDialog.xaml.cs b/DMS.WPF/Views/Dialogs/ProcessingDialog.xaml.cs
similarity index 100%
rename from DMS/Views/Dialogs/ProcessingDialog.xaml.cs
rename to DMS.WPF/Views/Dialogs/ProcessingDialog.xaml.cs
diff --git a/DMS/Views/Dialogs/VarDataDialog.xaml b/DMS.WPF/Views/Dialogs/VarDataDialog.xaml
similarity index 99%
rename from DMS/Views/Dialogs/VarDataDialog.xaml
rename to DMS.WPF/Views/Dialogs/VarDataDialog.xaml
index 14ee74c..eb8bd3d 100644
--- a/DMS/Views/Dialogs/VarDataDialog.xaml
+++ b/DMS.WPF/Views/Dialogs/VarDataDialog.xaml
@@ -8,7 +8,7 @@
xmlns:vmd="clr-namespace:DMS.ViewModels.Dialogs"
xmlns:vc="clr-namespace:DMS.ValueConverts"
xmlns:ex="clr-namespace:DMS.Extensions"
- xmlns:en="clr-namespace:DMS.Enums"
+ xmlns:en="clr-namespace:DMS.Core.Enums"
Title="{Binding Title}"
CloseButtonText="取消"
DefaultButton="Primary"
diff --git a/DMS/Views/Dialogs/VarDataDialog.xaml.cs b/DMS.WPF/Views/Dialogs/VarDataDialog.xaml.cs
similarity index 100%
rename from DMS/Views/Dialogs/VarDataDialog.xaml.cs
rename to DMS.WPF/Views/Dialogs/VarDataDialog.xaml.cs
diff --git a/DMS/Views/Dialogs/VarTableDialog.xaml b/DMS.WPF/Views/Dialogs/VarTableDialog.xaml
similarity index 97%
rename from DMS/Views/Dialogs/VarTableDialog.xaml
rename to DMS.WPF/Views/Dialogs/VarTableDialog.xaml
index 7584ce9..b1b729c 100644
--- a/DMS/Views/Dialogs/VarTableDialog.xaml
+++ b/DMS.WPF/Views/Dialogs/VarTableDialog.xaml
@@ -8,7 +8,7 @@
xmlns:vmd="clr-namespace:DMS.ViewModels.Dialogs"
xmlns:vc="clr-namespace:DMS.ValueConverts"
xmlns:ex="clr-namespace:DMS.Extensions"
- xmlns:en="clr-namespace:DMS.Enums"
+ xmlns:en="clr-namespace:DMS.Core.Enums"
Title="{Binding Title}"
CloseButtonText="取消"
DefaultButton="Primary"
diff --git a/DMS/Views/Dialogs/VarTableDialog.xaml.cs b/DMS.WPF/Views/Dialogs/VarTableDialog.xaml.cs
similarity index 100%
rename from DMS/Views/Dialogs/VarTableDialog.xaml.cs
rename to DMS.WPF/Views/Dialogs/VarTableDialog.xaml.cs
diff --git a/DMS/Views/HomeView.xaml b/DMS.WPF/Views/HomeView.xaml
similarity index 100%
rename from DMS/Views/HomeView.xaml
rename to DMS.WPF/Views/HomeView.xaml
diff --git a/DMS/Views/HomeView.xaml.cs b/DMS.WPF/Views/HomeView.xaml.cs
similarity index 100%
rename from DMS/Views/HomeView.xaml.cs
rename to DMS.WPF/Views/HomeView.xaml.cs
diff --git a/DMS/Views/MainView.xaml b/DMS.WPF/Views/MainView.xaml
similarity index 100%
rename from DMS/Views/MainView.xaml
rename to DMS.WPF/Views/MainView.xaml
diff --git a/DMS/Views/MainView.xaml.cs b/DMS.WPF/Views/MainView.xaml.cs
similarity index 98%
rename from DMS/Views/MainView.xaml.cs
rename to DMS.WPF/Views/MainView.xaml.cs
index 6e671d7..537f03d 100644
--- a/DMS/Views/MainView.xaml.cs
+++ b/DMS.WPF/Views/MainView.xaml.cs
@@ -5,7 +5,7 @@ using DMS.Services;
using DMS.ViewModels;
using iNKORE.UI.WPF.Modern.Controls;
using Microsoft.Extensions.DependencyInjection;
-using DMS.Enums;
+using DMS.Core.Enums;
namespace DMS.Views;
diff --git a/DMS/Views/MqttServerDetailView.xaml b/DMS.WPF/Views/MqttServerDetailView.xaml
similarity index 99%
rename from DMS/Views/MqttServerDetailView.xaml
rename to DMS.WPF/Views/MqttServerDetailView.xaml
index 98d96e1..8c2b388 100644
--- a/DMS/Views/MqttServerDetailView.xaml
+++ b/DMS.WPF/Views/MqttServerDetailView.xaml
@@ -9,7 +9,7 @@
xmlns:iNKORE="clr-namespace:iNKORE.UI.WPF.Modern.Controls;assembly=iNKORE.UI.WPF.Modern"
xmlns:converters="clr-namespace:DMS.ValueConverts"
xmlns:extensions="clr-namespace:DMS.Extensions"
- xmlns:enums="clr-namespace:DMS.Enums"
+ xmlns:enums="clr-namespace:DMS.Core.Enums"
d:DataContext="{d:DesignInstance Type=viewmodels:MqttServerDetailViewModel}"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
diff --git a/DMS/Views/MqttServerDetailView.xaml.cs b/DMS.WPF/Views/MqttServerDetailView.xaml.cs
similarity index 100%
rename from DMS/Views/MqttServerDetailView.xaml.cs
rename to DMS.WPF/Views/MqttServerDetailView.xaml.cs
diff --git a/DMS/Views/MqttsView.xaml b/DMS.WPF/Views/MqttsView.xaml
similarity index 100%
rename from DMS/Views/MqttsView.xaml
rename to DMS.WPF/Views/MqttsView.xaml
diff --git a/DMS/Views/MqttsView.xaml.cs b/DMS.WPF/Views/MqttsView.xaml.cs
similarity index 100%
rename from DMS/Views/MqttsView.xaml.cs
rename to DMS.WPF/Views/MqttsView.xaml.cs
diff --git a/DMS/Views/SettingView.xaml b/DMS.WPF/Views/SettingView.xaml
similarity index 100%
rename from DMS/Views/SettingView.xaml
rename to DMS.WPF/Views/SettingView.xaml
diff --git a/DMS/Views/SettingView.xaml.cs b/DMS.WPF/Views/SettingView.xaml.cs
similarity index 100%
rename from DMS/Views/SettingView.xaml.cs
rename to DMS.WPF/Views/SettingView.xaml.cs
diff --git a/DMS/Views/VariableTableView.xaml b/DMS.WPF/Views/VariableTableView.xaml
similarity index 99%
rename from DMS/Views/VariableTableView.xaml
rename to DMS.WPF/Views/VariableTableView.xaml
index fa0a5c9..b343ec4 100644
--- a/DMS/Views/VariableTableView.xaml
+++ b/DMS.WPF/Views/VariableTableView.xaml
@@ -10,7 +10,7 @@
mc:Ignorable="d"
xmlns:vc="clr-namespace:DMS.ValueConverts"
xmlns:ex="clr-namespace:DMS.Extensions"
- xmlns:en="clr-namespace:DMS.Enums"
+ xmlns:en="clr-namespace:DMS.Core.Enums"
Loaded="VariableTableView_OnLoaded"
d:DataContext="{d:DesignInstance vm:VariableTableViewModel}"
d:DesignHeight="600"
diff --git a/DMS/Views/VariableTableView.xaml.cs b/DMS.WPF/Views/VariableTableView.xaml.cs
similarity index 99%
rename from DMS/Views/VariableTableView.xaml.cs
rename to DMS.WPF/Views/VariableTableView.xaml.cs
index a217548..144f2b4 100644
--- a/DMS/Views/VariableTableView.xaml.cs
+++ b/DMS.WPF/Views/VariableTableView.xaml.cs
@@ -9,7 +9,7 @@ using iNKORE.UI.WPF.Modern.Controls;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NLog;
-using DMS.Enums;
+using DMS.Core.Enums;
namespace DMS.Views;
diff --git a/DMS.sln b/DMS.sln
index fbc0702..7cfaeb6 100644
--- a/DMS.sln
+++ b/DMS.sln
@@ -3,7 +3,22 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.12.35728.132
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DMS", "DMS\DMS.csproj", "{CD3529C9-218C-41EE-B64B-A884DC56E21E}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DMS.Core", "DMS.Core\DMS.Core.csproj", "{CD16527A-A5F9-482F-ABF7-755DDE1B0406}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DMS.Application", "DMS.Application\DMS.Application.csproj", "{46E180A5-38CB-4229-915F-C9BC44534E77}"
+ ProjectSection(ProjectDependencies) = postProject
+ {66FB5295-C6B7-4767-948C-5986480F6733} = {66FB5295-C6B7-4767-948C-5986480F6733}
+ EndProjectSection
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DMS.Infrastructure", "DMS.Infrastructure\DMS.Infrastructure.csproj", "{66FB5295-C6B7-4767-948C-5986480F6733}"
+ ProjectSection(ProjectDependencies) = postProject
+ {CD16527A-A5F9-482F-ABF7-755DDE1B0406} = {CD16527A-A5F9-482F-ABF7-755DDE1B0406}
+ EndProjectSection
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DMS.WPF", "DMS.WPF\DMS.WPF.csproj", "{6059F299-9EE8-4A3F-8CD2-D00E2BDB5D5F}"
+ ProjectSection(ProjectDependencies) = postProject
+ {46E180A5-38CB-4229-915F-C9BC44534E77} = {46E180A5-38CB-4229-915F-C9BC44534E77}
+ EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -11,12 +26,27 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {CD3529C9-218C-41EE-B64B-A884DC56E21E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {CD3529C9-218C-41EE-B64B-A884DC56E21E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {CD3529C9-218C-41EE-B64B-A884DC56E21E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {CD3529C9-218C-41EE-B64B-A884DC56E21E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {CD16527A-A5F9-482F-ABF7-755DDE1B0406}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {CD16527A-A5F9-482F-ABF7-755DDE1B0406}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {CD16527A-A5F9-482F-ABF7-755DDE1B0406}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {CD16527A-A5F9-482F-ABF7-755DDE1B0406}.Release|Any CPU.Build.0 = Release|Any CPU
+ {46E180A5-38CB-4229-915F-C9BC44534E77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {46E180A5-38CB-4229-915F-C9BC44534E77}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {46E180A5-38CB-4229-915F-C9BC44534E77}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {46E180A5-38CB-4229-915F-C9BC44534E77}.Release|Any CPU.Build.0 = Release|Any CPU
+ {66FB5295-C6B7-4767-948C-5986480F6733}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {66FB5295-C6B7-4767-948C-5986480F6733}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {66FB5295-C6B7-4767-948C-5986480F6733}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {66FB5295-C6B7-4767-948C-5986480F6733}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6059F299-9EE8-4A3F-8CD2-D00E2BDB5D5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {6059F299-9EE8-4A3F-8CD2-D00E2BDB5D5F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6059F299-9EE8-4A3F-8CD2-D00E2BDB5D5F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {6059F299-9EE8-4A3F-8CD2-D00E2BDB5D5F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {7F3416E9-65CD-44B1-B98B-67CF3B6DCFF9}
+ EndGlobalSection
EndGlobal
diff --git a/DMS/App.xaml b/DMS/App.xaml
deleted file mode 100644
index 5da72cb..0000000
--- a/DMS/App.xaml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/DMS/App.xaml.cs b/DMS/App.xaml.cs
deleted file mode 100644
index 7c421a2..0000000
--- a/DMS/App.xaml.cs
+++ /dev/null
@@ -1,260 +0,0 @@
-using System.Windows;
-using DMS.Data;
-using DMS.Data.Entities;
-using DMS.Data.Repositories;
-using DMS.Enums;
-using DMS.Helper;
-using DMS.Services;
-using DMS.Services.Processors;
-using DMS.ViewModels;
-using DMS.Views;
-using iNKORE.UI.WPF.Modern.Common.IconKeys;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
-using NLog;
-using NLog.Extensions.Logging;
-using DMS.Extensions;
-using Microsoft.Extensions.Hosting;
-using DMS.Config;
-using SqlSugar;
-using LogLevel = Microsoft.Extensions.Logging.LogLevel;
-
-namespace DMS;
-
-///
-/// Interaction logic for App.xaml
-///
-public partial class App : Application
-{
- public IServiceProvider Services { get; }
-
- public App()
- {
- Host = Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder()
- .ConfigureServices((context, services) =>
- {
- ConfigureServices(services);
- })
- .ConfigureLogging(loggingBuilder =>
- {
- ConfigureLogging(loggingBuilder);
- })
- .Build();
- Services = Host.Services;
- }
-
- public new static App Current => (App)Application.Current;
- public IHost Host { get; }
-
- protected override async void OnStartup(StartupEventArgs e)
- {
- base.OnStartup(e);
- ShutdownMode = ShutdownMode.OnExplicitShutdown;
- ThemeHelper.InitializeTheme();
- await Host.StartAsync();
-
- try
- {
- InitializeDataBase();
- InitializeMenu()
- .Await((e) => { NotificationHelper.ShowError($"初始化主菜单失败:{e.Message}", e); },
- () => { MessageHelper.SendLoadMessage(LoadTypes.Menu); });
- Host.Services.GetRequiredService();
-
- // 初始化数据处理链
- var dataProcessingService = Host.Services.GetRequiredService();
- dataProcessingService.AddProcessor(Host.Services.GetRequiredService());
- dataProcessingService.AddProcessor(Host.Services.GetRequiredService());
- dataProcessingService.AddProcessor(Host.Services.GetRequiredService());
- dataProcessingService.AddProcessor(Host.Services.GetRequiredService());
- dataProcessingService.AddProcessor(Host.Services.GetRequiredService());
- }
- catch (Exception exception)
- {
- NotificationHelper.ShowError("加载数据时发生错误,如果是连接字符串不正确,可以在设置界面更改:{exception.Message}", exception);
- }
-
- MainWindow = Host.Services.GetRequiredService();
- MainWindow.Show();
-
- // 根据配置启动服务
- // var connectionSettings = DMS.Config.ConnectionSettings.Load();
- // if (connectionSettings.EnableMqttService)
- // {
- // Host.Services.GetRequiredService().StartService();
- // }
- // if (connectionSettings.EnableOpcUaService)
- // {
- // Host.Services.GetRequiredService().StartService();
- // }
- }
-
- protected override async void OnExit(ExitEventArgs e)
- {
- // 停止服务
- await Host.StopAsync();
- Host.Dispose();
- LogManager.Shutdown();
- base.OnExit(e);
- }
-
- private void ConfigureServices(IServiceCollection services)
- {
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddHostedService();
- services.AddHostedService();
- services.AddSingleton();
- services.AddHostedService(provider => provider.GetRequiredService());
- services.AddSingleton();
-
- // 注册 AutoMapper
- services.AddAutoMapper(typeof(App).Assembly);
-
- // 注册数据处理服务和处理器
- services.AddSingleton();
- services.AddHostedService(provider => (DataProcessingService)provider.GetRequiredService());
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
-
- // 注册数据仓库
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- // 注册视图模型
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddScoped();
- services.AddSingleton();
- services.AddScoped();
- //注册View视图
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddSingleton();
- services.AddScoped();
- services.AddScoped();
- }
-
- private void ConfigureLogging(ILoggingBuilder loggingBuilder)
- {
- LogManager.Setup().LoadConfigurationFromFile("Config/nlog.config");
- loggingBuilder.ClearProviders();
- loggingBuilder.SetMinimumLevel(LogLevel.Trace);
- loggingBuilder.AddNLog();
-
- // 捕获未处理的异常并记录
- AppDomain.CurrentDomain.UnhandledException += (sender, args) =>
- {
- var ex = args.ExceptionObject as Exception;
- if (ex != null)
- {
- // 可以使用一个专用的 Logger 来记录未处理异常
- LogManager.GetLogger("UnhandledExceptionLogger")
- .Fatal($"应用程序发生未处理的异常:{ex}");
- }
- };
-
- // 捕获 Dispatcher 线程上的未处理异常 (UI 线程)
- this.DispatcherUnhandledException += (sender, args) =>
- {
- LogManager.GetLogger("DispatcherExceptionLogger")
- .Fatal($"UI 线程发生未处理的异常:{args.Exception}");
- // 标记为已处理,防止应用程序崩溃 (生产环境慎用,可能掩盖问题)
- // args.Handled = true;
- };
-
- // 如果您使用 Task (异步方法) 并且没有正确 await,可能会导致异常丢失,
- // 可以通过以下方式捕获 Task 中的异常。
- TaskScheduler.UnobservedTaskException += (sender, args) =>
- {
- LogManager.GetLogger("UnobservedTaskExceptionLogger")
- .Fatal($"异步任务发生未观察到的异常:{args.Exception}");
- // args.SetObserved(); // 标记为已观察,防止进程终止
- };
- }
-
- ///
- /// 初始化菜单
- ///
- private async Task InitializeMenu()
- {
- using (var db = DbContext.GetInstance())
- {
- var homeMenu = new DbMenu()
- { Name = "主页", Type = MenuType.MainMenu, Icon = SegoeFluentIcons.Home.Glyph, ParentId = 0 };
-
- var deviceMenu = new DbMenu()
- {
- Name = "设备", Type = MenuType.MainMenu, Icon = SegoeFluentIcons.Devices3.Glyph,
- ParentId = 0
- };
- var dataTransfromMenu = new DbMenu()
- {
- Name = "数据转换", Type = MenuType.MainMenu,
- Icon = SegoeFluentIcons.ChromeSwitch.Glyph, ParentId = 0
- };
- var mqttMenu = new DbMenu()
- {
- Name = "Mqtt服务器", Type = MenuType.MainMenu, Icon = SegoeFluentIcons.Cloud.Glyph,
- ParentId = 0
- };
-
- var settingMenu = new DbMenu()
- {
- Name = "设置", Type = MenuType.MainMenu, Icon = SegoeFluentIcons.Settings.Glyph,
- ParentId = 0
- };
- var aboutMenu = new DbMenu()
- { Name = "关于", Type = MenuType.MainMenu, Icon = SegoeFluentIcons.Info.Glyph, ParentId = 0 };
- await CheckMainMenuExist(db, homeMenu);
- await CheckMainMenuExist(db, deviceMenu);
- await CheckMainMenuExist(db, dataTransfromMenu);
- await CheckMainMenuExist(db, mqttMenu);
- await CheckMainMenuExist(db, settingMenu);
- await CheckMainMenuExist(db, aboutMenu);
- }
- }
-
- private static async Task CheckMainMenuExist(SqlSugarClient db, DbMenu menu)
- {
- var homeMenuExist = await db.Queryable()
- .FirstAsync(dm => dm.Name == menu.Name);
- if (homeMenuExist == null)
- {
- await db.Insertable(menu)
- .ExecuteCommandAsync();
- }
- }
-
- private void InitializeDataBase()
- {
- var _db = DbContext.GetInstance();
- _db.DbMaintenance.CreateDatabase();
- _db.CodeFirst.InitTables();
- _db.CodeFirst.InitTables();
- _db.CodeFirst.InitTables();
- _db.CodeFirst.InitTables();
- _db.CodeFirst.InitTables();
- _db.CodeFirst.InitTables();
- _db.CodeFirst.InitTables();
- _db.CodeFirst.InitTables();
- _db.CodeFirst.InitTables();
- _db.CodeFirst.InitTables();
- }
-}
\ No newline at end of file
diff --git a/DMS/AppIcon2.ico b/DMS/AppIcon2.ico
deleted file mode 100644
index 6c7fb71..0000000
Binary files a/DMS/AppIcon2.ico and /dev/null differ
diff --git a/DMS/DMS.csproj b/DMS/DMS.csproj
deleted file mode 100644
index ecafec8..0000000
--- a/DMS/DMS.csproj
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
- WinExe
- net8.0-windows
- enable
- enable
- true
- AppIcon2.ico
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Always
-
-
-
-
- Always
-
-
-
-
-
-
-
- MSBuild:Compile
-
-
- MqttsView.xaml
-
-
- MSBuild:Compile
-
-
- MqttDialog.xaml
-
-
-
-
-
-
-
-
-
diff --git a/DMS/Data/Repositories/BaseRepositories.cs b/DMS/Data/Repositories/BaseRepositories.cs
deleted file mode 100644
index 90aa47c..0000000
--- a/DMS/Data/Repositories/BaseRepositories.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-using PMSWPF.Data.Entities;
-using SqlSugar;
-
-namespace PMSWPF.Data.Repositories;
-
-public class BaseRepositories
-{
- protected readonly SqlSugarClient _db;
-
- public BaseRepositories()
- {
- try
- {
- _db = DbContext.GetInstance();
- // _db.DbMaintenance.CreateDatabase();
- // CheckDbTables();
- }
- catch (Exception e)
- {
- Console.WriteLine(e);
- throw;
- }
- }
-
- private void CheckDbTables()
- {
- Stopwatch stopwatch = new Stopwatch();
- stopwatch.Start();
- if (!_db.DbMaintenance.IsAnyTable())
- _db.CodeFirst.InitTables();
- if (!_db.DbMaintenance.IsAnyTable())
- _db.CodeFirst.InitTables();
- if (!_db.DbMaintenance.IsAnyTable())
- _db.CodeFirst.InitTables();
- if (!_db.DbMaintenance.IsAnyTable())
- _db.CodeFirst.InitTables();
- if (!_db.DbMaintenance.IsAnyTable())
- _db.CodeFirst.InitTables();
- if (!_db.DbMaintenance.IsAnyTable())
- _db.CodeFirst.InitTables();
- if (!_db.DbMaintenance.IsAnyTable())
- _db.CodeFirst.InitTables();
- stopwatch.Stop();
- // Assuming NLog is available and configured for BaseRepositories
- // If not, you might need to add a Logger field similar to DeviceRepository
- // For now, I'll assume it's available or will be added.
- // LogManager.GetCurrentClassLogger().Info($"检查数据库表耗时:{stopwatch.ElapsedMilliseconds}ms");
- }
-}
\ No newline at end of file
diff --git a/DMS/Exceptions/DbExistException.cs b/DMS/Exceptions/DbExistException.cs
deleted file mode 100644
index 9296baf..0000000
--- a/DMS/Exceptions/DbExistException.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-namespace DMS.Excptions;
-
-public class DbExistException : Exception
-{
- public DbExistException()
- {
- }
-
- public DbExistException(string message) : base(message)
- {
- }
-
- public DbExistException(string message, Exception innerException) : base(message, innerException)
- {
- }
-}
\ No newline at end of file
diff --git a/DMS/LICENSE.txt b/DMS/LICENSE.txt
deleted file mode 100644
index 0ad25db..0000000
--- a/DMS/LICENSE.txt
+++ /dev/null
@@ -1,661 +0,0 @@
- GNU AFFERO GENERAL PUBLIC LICENSE
- Version 3, 19 November 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU Affero General Public License is a free, copyleft license for
-software and other kinds of works, specifically designed to ensure
-cooperation with the community in the case of network server software.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-our General Public Licenses are intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- Developers that use our General Public Licenses protect your rights
-with two steps: (1) assert copyright on the software, and (2) offer
-you this License which gives you legal permission to copy, distribute
-and/or modify the software.
-
- A secondary benefit of defending all users' freedom is that
-improvements made in alternate versions of the program, if they
-receive widespread use, become available for other developers to
-incorporate. Many developers of free software are heartened and
-encouraged by the resulting cooperation. However, in the case of
-software used on network servers, this result may fail to come about.
-The GNU General Public License permits making a modified version and
-letting the public access it on a server without ever releasing its
-source code to the public.
-
- The GNU Affero General Public License is designed specifically to
-ensure that, in such cases, the modified source code becomes available
-to the community. It requires the operator of a network server to
-provide the source code of the modified version running there to the
-users of that server. Therefore, public use of a modified version, on
-a publicly accessible server, gives the public access to the source
-code of the modified version.
-
- An older license, called the Affero General Public License and
-published by Affero, was designed to accomplish similar goals. This is
-a different license, not a version of the Affero GPL, but Affero has
-released a new version of the Affero GPL which permits relicensing under
-this license.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU Affero General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Remote Network Interaction; Use with the GNU General Public License.
-
- Notwithstanding any other provision of this License, if you modify the
-Program, your modified version must prominently offer all users
-interacting with it remotely through a computer network (if your version
-supports such interaction) an opportunity to receive the Corresponding
-Source of your version by providing access to the Corresponding Source
-from a network server at no charge, through some standard or customary
-means of facilitating copying of software. This Corresponding Source
-shall include the Corresponding Source for any work covered by version 3
-of the GNU General Public License that is incorporated pursuant to the
-following paragraph.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the work with which it is combined will remain governed by version
-3 of the GNU General Public License.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU Affero General Public License from time to time. Such new versions
-will be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU Affero General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU Affero General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU Affero General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published
- by the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see .
-
-Also add information on how to contact you by electronic and paper mail.
-
- If your software can interact with users remotely through a computer
-network, you should also make sure that it provides a way for users to
-get its source. For example, if your program is a web application, its
-interface could display a "Source" link that leads users to an archive
-of the code. There are many ways you could offer source, and different
-solutions will be better for different programs; see section 13 for the
-specific requirements.
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU AGPL, see
-.
diff --git a/DMS/NetIcon256X256.ico b/DMS/NetIcon256X256.ico
deleted file mode 100644
index 2cc7523..0000000
Binary files a/DMS/NetIcon256X256.ico and /dev/null differ
diff --git a/DMS/PMSWPF.OpcUaClient.Config.xml b/DMS/PMSWPF.OpcUaClient.Config.xml
deleted file mode 100644
index 4c6679c..0000000
--- a/DMS/PMSWPF.OpcUaClient.Config.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
- DMS OPC UA Client
- urn:{System.Net.Dns.GetHostName()}:DMS.OpcUaClient
- 0
-
-
-
- Directory
- %CommonApplicationData%/OPC Foundation/CertificateStores/MachineDefault
- CN=DMS OPC UA Client, O=OPC Foundation, OU=UA Applications
-
-
- Directory
- %CommonApplicationData%/OPC Foundation/CertificateStores/UA Certificate Authorities
-
-
- Directory
- %CommonApplicationData%/OPC Foundation/CertificateStores/UA Applications
-
-
- Directory
- %CommonApplicationData%/OPC Foundation/CertificateStores/RejectedCertificates
-
- true
-
-
-
- 15000
- 4194304
- 65535
- 65535
- 4194304
-
-
-
- 60000
-
-
-
-
- en-US
-
- 10000
-
-
-
- ./Logs/OpcUaClient.log
- true
- 1023
-
-
-
-
\ No newline at end of file
diff --git a/PMSWPF.Tests/ExcelHelperTests.cs b/PMSWPF.Tests/ExcelHelperTests.cs
deleted file mode 100644
index e4e8669..0000000
--- a/PMSWPF.Tests/ExcelHelperTests.cs
+++ /dev/null
@@ -1,150 +0,0 @@
-using NUnit.Framework;
-using PMSWPF.Helper;
-using System.Collections.Generic;
-using System.Data;
-using System.IO;
-using PMSWPF.Enums;
-using PMSWPF.Models;
-
-namespace PMSWPF.Tests
-{
- [TestFixture]
- public class ExcelHelperTests
- {
- private string _testFilePath;
-
- [SetUp]
- public void Setup()
- {
- // Create a temporary file for testing
- // _testFilePath = Path.Combine(Path.GetTempPath(), "test.xlsx");
- _testFilePath = "e:/test.xlsx";
- }
-
- [TearDown]
- public void TearDown()
- {
- // Clean up the temporary file
- if (File.Exists(_testFilePath))
- {
- File.Delete(_testFilePath);
- }
- }
-
- [Test]
- public void ExportToExcel_WithListOfObjects_CreatesFile()
- {
- // Arrange
- var data = new List
- {
- new TestData { Id = 1, Name = "Test1" },
- new TestData { Id = 2, Name = "Test2" }
- };
-
- // Act
- ExcelHelper.ExportToExcel(data, _testFilePath);
-
- // Assert
- Assert.IsTrue(File.Exists(_testFilePath));
- }
-
- [Test]
- public void ExportToExcel_WithDataTable_CreatesFile()
- {
- // Arrange
- var dataTable = new DataTable();
- dataTable.Columns.Add("Id", typeof(int));
- dataTable.Columns.Add("Name", typeof(string));
- dataTable.Rows.Add(1, "Test1");
- dataTable.Rows.Add(2, "Test2");
-
- // Act
- ExcelHelper.ExportToExcel(dataTable, _testFilePath);
-
- // Assert
- Assert.IsTrue(File.Exists(_testFilePath));
- }
-
- [Test]
- public void ImportFromExcel_ToDataTable_ReturnsCorrectData()
- {
- // Arrange
- var dataTable = new DataTable();
- dataTable.Columns.Add("Id", typeof(int));
- dataTable.Columns.Add("Name", typeof(string));
- dataTable.Rows.Add(1, "Test1");
- dataTable.Rows.Add(2, "Test2");
- ExcelHelper.ExportToExcel(dataTable, _testFilePath);
-
- // Act
- var result = ExcelHelper.ImportFromExcel(_testFilePath);
-
- // Assert
- Assert.AreEqual(2, result.Rows.Count);
- Assert.AreEqual("1", result.Rows[0]["Id"]);
- Assert.AreEqual("Test1", result.Rows[0]["Name"]);
- }
-
- [Test]
- public void ImportVarDataFormExcel()
- {
- // Act
- _testFilePath = "C:\\Users\\Administrator\\Desktop\\浓度变量.xlsx";
- var dataTable = ExcelHelper.ImportFromExcel(_testFilePath);
- // 判断表头的名字
- if (dataTable.Columns[0].ColumnName != "Name" || dataTable.Columns[2].ColumnName != "Data Type" &&
- dataTable.Columns[3].ColumnName != "Logical Address")
- throw new AggregateException(
- "Excel表格式不正确:第一列的名字是:Name,第三列的名字是:Data Type,Data Type,第四列的名字是:Logical Address,请检查");
-
-
- List variables = new List();
- foreach (DataRow dataRow in dataTable.Rows)
- {
- Variable variable = new Variable();
- variable.Name=dataRow["Name"].ToString();
- variable.DataType=SiemensHelper.S7ToCSharpTypeString(dataRow["Data Type"].ToString()) ;
- var exS7Addr=dataRow["Logical Address"].ToString();
- if (exS7Addr.StartsWith("%"))
- {
- variable.S7Address = exS7Addr.Substring(1);
- }
-
- variable.ProtocolType = ProtocolType.S7;
- variable.SignalType = SignalType.OtherASignal;
- variables.Add(variable);
- }
- Assert.Greater(variables.Count, 0);
- // Assert
- // Assert.AreEqual(2, result.Rows.Count);FDFD
- // Assert.AreEqual("1", result.Rows[0]["Id"]);
- // Assert.AreEqual("Test1", result.Rows[0]["Name"]);
- }
-
- [Test]
- public void ImportFromExcel_ToListOfObjects_ReturnsCorrectData()
- {
- // Arrange
- var data = new List
- {
- new TestData { Id = 1, Name = "Test1" },
- new TestData { Id = 2, Name = "Test2" }
- };
- ExcelHelper.ExportToExcel(data, _testFilePath);
-
- // Act
- var result = ExcelHelper.ImportFromExcel(_testFilePath);
-
- // Assert
- Assert.AreEqual(2, result.Count);
- Assert.AreEqual(1, result[0].Id);
- Assert.AreEqual("Test1", result[0].Name);
- }
-
- private class TestData
- {
- public int Id { get; set; }
- public string Name { get; set; }
- }
- }
-}
\ No newline at end of file
diff --git a/PMSWPF.Tests/MqttRepositoryTests.cs b/PMSWPF.Tests/MqttRepositoryTests.cs
deleted file mode 100644
index 371621a..0000000
--- a/PMSWPF.Tests/MqttRepositoryTests.cs
+++ /dev/null
@@ -1,152 +0,0 @@
-using NUnit.Framework;
-using PMSWPF.Data.Repositories;
-using PMSWPF.Data.Entities;
-using System.Threading.Tasks;
-using System.Collections.Generic;
-using System.Linq;
-using SqlSugar;
-using System;
-using System.Data;
-using DbType = SqlSugar.DbType;
-
-namespace PMSWPF.Tests
-{
- [TestFixture]
- public class MqttRepositoryTests
- {
- private MqttRepository _mqttRepository;
- private SqlSugarClient _db;
-
- [SetUp]
- public void Setup()
- {
- // Use an in-memory SQLite database for testing
- _db = new SqlSugarClient(new ConnectionConfig()
- {
- DbType = DbType.MySql,
- ConnectionString = "server=127.0.0.1;port=3306;user=root;password=Pgw15221236646; database=pmswpf;",
- IsAutoCloseConnection = true,
- InitKeyType = InitKeyType.Attribute
- });
-
- // Create tables
- _db.CodeFirst.InitTables();
-
- // Initialize repository with the in-memory database instance
- // This requires modifying DbContext.GetInstance() or MqttRepository to accept an ISqlSugarClient
- // For now, we'll assume DbContext.GetInstance() can be configured for testing.
- // In a real scenario, you'd typically inject ISqlSugarClient into MqttRepository.
- // For this example, we'll directly use the _db instance for setup and verification.
- // _mqttRepository = new MqttRepository(); // This will still use the static DbContext.GetInstance()
-
- // To properly test, DbContext.GetInstance() needs to be mockable or configurable.
- // For demonstration, we'll simulate the DbContext behavior directly here.
- // This is a simplification and not ideal for true unit testing without refactoring DbContext.
- }
-
- [TearDown]
- public void TearDown()
- {
- _db.Dispose();
- }
-
- [Test]
- public async Task AddAsync_ShouldAddMqttEntity()
- {
- // Arrange
- var mqtt = new DbMqtt
- {
- Name = "TestMqtt", Host = "127.0.0.1", Port = 1883, UserName = "user", PassWord = "password",
- };
-
- // Act
- // This test will currently fail or interact with the real database
- // because MqttRepository uses static DbContext.GetInstance().
- // Proper testing requires dependency injection for DbContext.
- // For now, we'll simulate the expected outcome if DbContext was mocked.
- // int result = await _mqttRepository.AddAsync(mqtt); // This line would be uncommented with proper DI
-
- // Simulate adding to the in-memory DB for verification
- int result = await _db.Insertable(mqtt).ExecuteReturnIdentityAsync();
-
- // Assert
- Assert.Greater(result, 0);
- var addedMqtt = await _db.Queryable().In(result).SingleAsync();
- Assert.IsNotNull(addedMqtt);
- Assert.AreEqual("TestMqtt", addedMqtt.Name);
- }
-
- [Test]
- public async Task GetByIdAsync_ShouldReturnCorrectMqttEntity()
- {
- // Arrange
- var mqtt = new DbMqtt
- { Name = "TestMqtt", Host = "127.0.0.1", Port = 1883, UserName = "user", PassWord = "password" };
- int id = await _db.Insertable(mqtt).ExecuteReturnIdentityAsync();
-
- // Act
- // DbMqtt result = await _mqttRepository.GetByIdAsync(id); // Uncomment with proper DI
- DbMqtt result = await _db.Queryable().In(id).SingleAsync(); // Simulate repository call
-
- // Assert
- Assert.IsNotNull(result);
- Assert.AreEqual(id, result.Id);
- Assert.AreEqual("TestMqtt", result.Name);
- }
-
- [Test]
- public async Task GetAllAsync_ShouldReturnAllMqttEntities()
- {
- // Arrange
- await _db.Insertable(new DbMqtt { Name = "Mqtt1", Host = "127.0.0.1", Port = 1883 }).ExecuteCommandAsync();
- await _db.Insertable(new DbMqtt { Name = "Mqtt2", Host = "127.0.0.2", Port = 1884 }).ExecuteCommandAsync();
-
- // Act
- // List result = await _mqttRepository.GetAllAsync(); // Uncomment with proper DI
- List result = await _db.Queryable().ToListAsync(); // Simulate repository call
-
- // Assert
- Assert.AreEqual(2, result.Count);
- Assert.IsTrue(result.Any(m => m.Name == "Mqtt1"));
- Assert.IsTrue(result.Any(m => m.Name == "Mqtt2"));
- }
-
- [Test]
- public async Task UpdateAsync_ShouldUpdateMqttEntity()
- {
- // Arrange
- var mqtt = new DbMqtt { Name = "OldName", Host = "127.0.0.1", Port = 1883 };
- int id = await _db.Insertable(mqtt).ExecuteReturnIdentityAsync();
-
- mqtt.Id = id;
- mqtt.Name = "NewName";
-
- // Act
- // int affectedRows = await _mqttRepository.UpdateAsync(mqtt); // Uncomment with proper DI
- int affectedRows = await _db.Updateable(mqtt).ExecuteCommandAsync(); // Simulate repository call
-
- // Assert
- Assert.AreEqual(1, affectedRows);
- var updatedMqtt = await _db.Queryable().In(id).SingleAsync();
- Assert.IsNotNull(updatedMqtt);
- Assert.AreEqual("NewName", updatedMqtt.Name);
- }
-
- [Test]
- public async Task DeleteAsync_ShouldDeleteMqttEntity()
- {
- // Arrange
- var mqtt = new DbMqtt { Name = "ToDelete", Host = "127.0.0.1", Port = 1883 };
- int id = await _db.Insertable(mqtt).ExecuteReturnIdentityAsync();
-
- // Act
- // int affectedRows = await _mqttRepository.DeleteAsync(id); // Uncomment with proper DI
- int affectedRows = await _db.Deleteable().In(id).ExecuteCommandAsync(); // Simulate repository call
-
- // Assert
- Assert.AreEqual(1, affectedRows);
- var deletedMqtt = await _db.Queryable().In(id).SingleAsync();
- Assert.IsNull(deletedMqtt);
- }
- }
-}
\ No newline at end of file
diff --git a/PMSWPF.Tests/NotificationHelperTests.cs b/PMSWPF.Tests/NotificationHelperTests.cs
deleted file mode 100644
index d76f8b8..0000000
--- a/PMSWPF.Tests/NotificationHelperTests.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-using NLog;
-using NLog.Config;
-using NLog.Targets;
-using NUnit.Framework;
-using PMSWPF.Helper;
-using System;
-using System.Linq;
-
-namespace PMSWPF.Tests
-{
- [TestFixture]
- public class NotificationHelperTests
- {
- private MemoryTarget _memoryTarget;
- // private Logger _logger; // 声明一个 Logger 变量 - 这个不再需要了
-
- [SetUp]
- public void Setup()
- {
- // 1. 加载外部的 nlog.config 文件
- LogManager.LoadConfiguration("nlog.config");
-
- // 2. 获取当前加载的配置
- var config = LogManager.Configuration;
-
- // 3. 创建 MemoryTarget
- _memoryTarget = new MemoryTarget("testMemoryTarget")
- {
- // 捕获消息、级别、异常和 MDC 数据
- Layout
- = "${message}|${level}|${exception:format=tostring}|${mdlc:item=CallerFilePath}|${mdlc:item=CallerParentLineNumber}"
- };
-
- // 4. 将 MemoryTarget 添加到配置中
- config.AddTarget(_memoryTarget);
-
- // 5. 定义一个规则,将所有日志路由到 MemoryTarget
- // 注意:这里我们添加一个新的规则,确保日志也发送到 MemoryTarget
- config.AddRule(LogLevel.Trace, LogLevel.Fatal, _memoryTarget);
-
- // 6. 重新应用配置,以包含新的 MemoryTarget 和规则
- LogManager.Configuration = config;
-
- // 7. 清空 MemoryTarget 中的日志
- _memoryTarget.Logs.Clear();
- }
-
- [TearDown]
- public void Teardown()
- {
- // 在每个测试结束后,重置 NLog 配置,避免影响其他测试
- LogManager.Configuration = null;
- // 清除 _memoryTarget 引用,以满足静态分析工具的建议
- _memoryTarget.Dispose();
- _memoryTarget = null;
- }
-
- [Test]
- public void ShowException_ShouldLogErrorWithExceptionAndCallerInfo()
- {
- // Arrange
- // var testMessage = "这是一个测试异常消息";
- // var innerException = new InvalidOperationException("内部操作失败");
- // var testException = new Exception("外部异常", innerException);
- // var expectedCallerFilePath = "D:\\CShap\\PMSWPF\\Tests\\NotificationHelperTests.cs"; // 模拟调用文件路径
- // var expectedCallerLineNumber = 49; // 模拟调用行号 (根据实际测试代码行数调整)
-
- // Act
- // 调用 ShowException 方法,并传入模拟的异常和调用信息
- // NotificationHelper.ShowException(testMessage, testException, expectedCallerFilePath, expectedCallerLineNumber);
-
- NlogHelper.Info("info");
- NlogHelper.Warn("warn");
- NlogHelper.Trace("trace");
- NlogHelper.Error("hello");
-
- // Assert
- Assert.That(_memoryTarget.Logs.Count, Is.EqualTo(1), "应该只记录一条日志");
-
- var logEntry = _memoryTarget.Logs[0];
-
- // 验证日志消息
- // Assert.That(logEntry, Does.Contain(testMessage), "日志消息应该包含测试消息");
- //
- // // 验证日志级别
- // Assert.That(logEntry, Does.Contain("|Error|"), "日志级别应该是 Error");
- //
- // // 验证异常信息
- // Assert.That(logEntry, Does.Contain(testException.Message), "日志应该包含外部异常消息");
- // Assert.That(logEntry, Does.Contain(innerException.Message), "日志应该包含内部异常消息");
- // Assert.That(logEntry, Does.Contain(nameof(InvalidOperationException)), "日志应该包含内部异常类型");
- // Assert.That(logEntry, Does.Contain(nameof(Exception)), "日志应该包含外部异常类型");
- //
- // // 验证 CallerFilePath 和 CallerParentLineNumber
- // Assert.That(logEntry, Does.Contain($"|{expectedCallerFilePath}|"), "日志应该包含 CallerFilePath");
- // Assert.That(logEntry, Does.Contain($"|{expectedCallerLineNumber}"), "日志应该包含 CallerParentLineNumber");
- }
- }
-}
\ No newline at end of file
diff --git a/PMSWPF.Tests/PMSWPF.Tests.csproj b/PMSWPF.Tests/PMSWPF.Tests.csproj
deleted file mode 100644
index 868e305..0000000
--- a/PMSWPF.Tests/PMSWPF.Tests.csproj
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
- net8.0-windows
- enable
- enable
-
- false
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PreserveNewest
-
-
-
-