添加了数据库相关了类,和枚举类型相关的类,并且将枚举类型绑定到前段
This commit is contained in:
27
Models/DataVariable.cs
Normal file
27
Models/DataVariable.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using PMSWPF.Enums;
|
||||
|
||||
namespace PMSWPF.Models;
|
||||
|
||||
public class DataVariable
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string NodeId { get; set; }
|
||||
public ProtocolType ProtocolType { get; set; }
|
||||
public string DataType { get; set; }
|
||||
public List<Mqtt> Mqtts { get; set; }
|
||||
public string DataValue { get; set; }
|
||||
public string DisplayValue { get; set; }
|
||||
public DateTime UpdateTime { get; set; }
|
||||
public User UpdateUser { get; set; }
|
||||
public string Converstion { get; set; }
|
||||
public bool IsDeleted { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public bool IsSave { get; set; }
|
||||
public Double SaveRange { get; set; }
|
||||
public bool IsAlarm { get; set; }
|
||||
public Double AlarmMin { get; set; }
|
||||
public Double AlarmMax { get; set; }
|
||||
public SignalType SignalType { get; set; }
|
||||
}
|
||||
@@ -1,4 +1,7 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using PMSWPF.Enums;
|
||||
using SqlSugar;
|
||||
using SqlSugar.DbConvert;
|
||||
|
||||
namespace PMSWPF.Models;
|
||||
|
||||
@@ -13,8 +16,13 @@ public partial class Device:ObservableObject
|
||||
[ObservableProperty]
|
||||
private string ip ;
|
||||
[ObservableProperty]
|
||||
private bool isActive ;
|
||||
private bool isActive =true;
|
||||
[ObservableProperty]
|
||||
private bool isRuning ;
|
||||
[SugarColumn(ColumnDataType="varchar(20)",SqlParameterDbType=typeof(EnumToStringConvert))]
|
||||
public DeviceType DeviceType { get; set; }
|
||||
|
||||
public List<DataVariable>? DataVariables { get; set; }
|
||||
public ProtocolType ProtocolType { get; set; }
|
||||
|
||||
}
|
||||
6
Models/Mqtt.cs
Normal file
6
Models/Mqtt.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace PMSWPF.Models;
|
||||
|
||||
public class Mqtt
|
||||
{
|
||||
|
||||
}
|
||||
6
Models/User.cs
Normal file
6
Models/User.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace PMSWPF.Models;
|
||||
|
||||
public class User
|
||||
{
|
||||
|
||||
}
|
||||
14
Models/VariableTable.cs
Normal file
14
Models/VariableTable.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using PMSWPF.Enums;
|
||||
|
||||
namespace PMSWPF.Models;
|
||||
|
||||
public class VariableTable
|
||||
{
|
||||
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public ProtocolType ProtocolType { get; set; }
|
||||
public List<DataVariable> DataVariables { get; set; }
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user