重新设计了标签变量系统
This commit is contained in:
88
CapMachine.Wpf/Models/Tag/BaseTag.cs
Normal file
88
CapMachine.Wpf/Models/Tag/BaseTag.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Wpf.Models.Tag
|
||||
{
|
||||
public abstract class BaseTag<T> : BindableBase, ITag
|
||||
{
|
||||
|
||||
#region 公共属性
|
||||
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称 中文
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称 英文
|
||||
/// </summary>
|
||||
public string EnName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称 无单位中文名称
|
||||
/// </summary>
|
||||
public string NameNoUnit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标签组
|
||||
/// </summary>
|
||||
public string Group { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据类型信息
|
||||
/// </summary>
|
||||
public TagDataType DataType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 读写信息
|
||||
/// </summary>
|
||||
public RWInfo RWInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最大值
|
||||
/// </summary>
|
||||
public double MaxValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最小值
|
||||
/// </summary>
|
||||
public double MinValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 精度 到PLC的转换精度/分辨率
|
||||
/// </summary>
|
||||
public short Precision { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 小数点 展示时用的小数点
|
||||
/// </summary>
|
||||
public short DecimalPoint { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位
|
||||
/// </summary>
|
||||
public string? Unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否为仪表参数
|
||||
/// </summary>
|
||||
public bool IsMeter { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// PV 工程值 字符串
|
||||
/// </summary>
|
||||
public string? PVEngValueStr { get; set; }
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
20
CapMachine.Wpf/Models/Tag/CalcTag.cs
Normal file
20
CapMachine.Wpf/Models/Tag/CalcTag.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using CapMachine.Wpf.Models.Tag.Cell;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Wpf.Models.Tag
|
||||
{
|
||||
/// <summary>
|
||||
/// 计算得到的标签
|
||||
/// </summary>
|
||||
public class CalcTag : BaseTag<double>
|
||||
{
|
||||
/// <summary>
|
||||
/// PV Value Model
|
||||
/// </summary>
|
||||
public QuickAttrCell? PVModel { get; set; }
|
||||
}
|
||||
}
|
||||
20
CapMachine.Wpf/Models/Tag/CapTag.cs
Normal file
20
CapMachine.Wpf/Models/Tag/CapTag.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using CapMachine.Wpf.Models.Tag.Cell;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Wpf.Models.Tag
|
||||
{
|
||||
/// <summary>
|
||||
/// 压缩机通信标签
|
||||
/// </summary>
|
||||
public class CapTag : BaseTag<double>
|
||||
{
|
||||
/// <summary>
|
||||
/// PV Value Model
|
||||
/// </summary>
|
||||
public QuickAttrCell? PVModel { get; set; }
|
||||
}
|
||||
}
|
||||
62
CapMachine.Wpf/Models/Tag/Cell/MeterExdAttrCell.cs
Normal file
62
CapMachine.Wpf/Models/Tag/Cell/MeterExdAttrCell.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Wpf.Models.Tag
|
||||
{
|
||||
/// <summary>
|
||||
/// 标签信息仪表值拓展属性单元
|
||||
/// 比如 PID Limit ALARM的值信息
|
||||
/// </summary>
|
||||
public class MeterExdAttrCell : BindableBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 地址
|
||||
/// </summary>
|
||||
public string? Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 启用
|
||||
/// </summary>
|
||||
public bool? Enable { get; set; } = true;
|
||||
|
||||
///// <summary>
|
||||
///// 读取的块信息
|
||||
///// 人工确认
|
||||
///// </summary>
|
||||
//public string? Block { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 读取的块信息的Index
|
||||
///// </summary>
|
||||
//public short BlockIndex { get; set; }
|
||||
|
||||
private double _EngValue;
|
||||
/// <summary>
|
||||
/// 工程值 SV
|
||||
/// </summary>
|
||||
public double EngValue
|
||||
{
|
||||
get { return _EngValue; }
|
||||
set
|
||||
{
|
||||
_EngValue = value;
|
||||
RaisePropertyChanged();
|
||||
//EngValueStr = Math.Round(value, DecimalPoint).ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private string? _EngValueStr;
|
||||
/// <summary>
|
||||
/// 工程值的字符串 MV
|
||||
/// </summary>
|
||||
public string? EngValueStr
|
||||
{
|
||||
get { return _EngValueStr; }
|
||||
set { _EngValueStr = value; RaisePropertyChanged(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
99
CapMachine.Wpf/Models/Tag/Cell/MeterValueAttrCell.cs
Normal file
99
CapMachine.Wpf/Models/Tag/Cell/MeterValueAttrCell.cs
Normal file
@@ -0,0 +1,99 @@
|
||||
using Prism.Mvvm;
|
||||
|
||||
namespace CapMachine.Wpf.Models.Tag
|
||||
{
|
||||
/// <summary>
|
||||
/// 标签信息的主要仪表值的属性单元
|
||||
/// 比如SV PV MV等主要数据的属性单元
|
||||
/// </summary>
|
||||
public class MeterValueAttrCell : BindableBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 实例化构造函数
|
||||
/// </summary>
|
||||
/// <param name="Precision"></param>
|
||||
/// <param name="DecimalPoint"></param>
|
||||
public MeterValueAttrCell()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 地址
|
||||
/// </summary>
|
||||
public string? Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 启用
|
||||
/// </summary>
|
||||
public bool? Enable { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 读取的块信息
|
||||
/// 人工确认
|
||||
/// </summary>
|
||||
public string? Block { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 读取的块信息的Index
|
||||
/// </summary>
|
||||
public short BlockIndex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 精度 到PLC的转换精度/分辨率
|
||||
/// 引用的属性信息
|
||||
/// </summary>
|
||||
public short Precision { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 小数点 展示时用的小数点
|
||||
/// 引用的属性信息
|
||||
/// </summary>
|
||||
public short DecimalPoint { get; set; }
|
||||
|
||||
private short _EngSrcValue = -1;
|
||||
/// <summary>
|
||||
/// PLC的原始值 SV
|
||||
/// </summary>
|
||||
public short EngSrcValue
|
||||
{
|
||||
get { return _EngSrcValue; }
|
||||
set
|
||||
{
|
||||
//有改动的话则更新
|
||||
if (value != _EngSrcValue)
|
||||
{
|
||||
_EngSrcValue = value;
|
||||
//原始数据转换成工程值
|
||||
EngValue = _EngSrcValue * 1.0 / Precision;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private double _EngValue;
|
||||
/// <summary>
|
||||
/// 工程值 SV
|
||||
/// </summary>
|
||||
public double EngValue
|
||||
{
|
||||
get { return _EngValue; }
|
||||
set
|
||||
{
|
||||
_EngValue = value;
|
||||
RaisePropertyChanged();
|
||||
//工程值转换成字符串,可以灵活显示
|
||||
EngValueStr = Math.Round(value, DecimalPoint).ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private string? _EngValueStr;
|
||||
/// <summary>
|
||||
/// 工程值的字符串 MV
|
||||
/// </summary>
|
||||
public string? EngValueStr
|
||||
{
|
||||
get { return _EngValueStr; }
|
||||
set { _EngValueStr = value; RaisePropertyChanged(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
66
CapMachine.Wpf/Models/Tag/Cell/MvAmAttrCell.cs
Normal file
66
CapMachine.Wpf/Models/Tag/Cell/MvAmAttrCell.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Wpf.Models.Tag.Cell
|
||||
{
|
||||
/// <summary>
|
||||
/// MV的手自动的值的属性
|
||||
/// </summary>
|
||||
public class MvAmAttrCell : BindableBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 地址
|
||||
/// </summary>
|
||||
public string? Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 启用
|
||||
/// </summary>
|
||||
public bool? Enable { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 读取的块信息
|
||||
/// 人工确认
|
||||
/// </summary>
|
||||
public string? Block { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 读取的块信息的Index
|
||||
/// </summary>
|
||||
public short BlockIndex { get; set; }
|
||||
|
||||
private short _EngSrcValue = -1;
|
||||
/// <summary>
|
||||
/// PLC的原始值
|
||||
/// 手自动的切换应该没有转换,直接0和1的区别,直接使用工程的原值
|
||||
/// </summary>
|
||||
public short EngSrcValue
|
||||
{
|
||||
get { return _EngSrcValue; }
|
||||
set
|
||||
{
|
||||
//有改动的话则更新
|
||||
if (value != _EngSrcValue)
|
||||
{
|
||||
_EngSrcValue = value;
|
||||
//原始数据转换成工程值
|
||||
EngValueStr = _EngSrcValue.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string? _EngValueStr;
|
||||
/// <summary>
|
||||
/// 工程值的字符串 MV
|
||||
/// </summary>
|
||||
public string? EngValueStr
|
||||
{
|
||||
get { return _EngValueStr; }
|
||||
set { _EngValueStr = value; RaisePropertyChanged(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
52
CapMachine.Wpf/Models/Tag/Cell/QuickAttrCell.cs
Normal file
52
CapMachine.Wpf/Models/Tag/Cell/QuickAttrCell.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Wpf.Models.Tag.Cell
|
||||
{
|
||||
/// <summary>
|
||||
/// 快速属性标签
|
||||
/// </summary>
|
||||
public class QuickAttrCell : BindableBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 地址 PLC分配的地址
|
||||
/// 可能分配给PLC展示用,也可能不使用
|
||||
/// </summary>
|
||||
public string? Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 启用
|
||||
/// </summary>
|
||||
public bool? Enable { get; set; } = true;
|
||||
|
||||
private double _EngValue;
|
||||
/// <summary>
|
||||
/// 工程值 SV
|
||||
/// </summary>
|
||||
public double EngValue
|
||||
{
|
||||
get { return _EngValue; }
|
||||
set
|
||||
{
|
||||
_EngValue = value;
|
||||
RaisePropertyChanged();
|
||||
//EngValueStr = Math.Round(value, DecimalPoint).ToString();
|
||||
EngValueStr = value.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private string? _EngValueStr;
|
||||
/// <summary>
|
||||
/// 工程值的字符串
|
||||
/// </summary>
|
||||
public string? EngValueStr
|
||||
{
|
||||
get { return _EngValueStr; }
|
||||
set { _EngValueStr = value; RaisePropertyChanged(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,11 @@ namespace CapMachine.Wpf.Models.Tag
|
||||
/// </summary>
|
||||
public interface ITag
|
||||
{
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 中文名称
|
||||
/// </summary>
|
||||
@@ -31,42 +36,6 @@ namespace CapMachine.Wpf.Models.Tag
|
||||
/// </summary>
|
||||
string? Unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工程值 PV
|
||||
/// </summary>
|
||||
double EngPvValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工程值的字符串 PV
|
||||
/// </summary>
|
||||
string EngPvValueStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工程值 Sv
|
||||
/// </summary>
|
||||
double EngSvValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工程值的字符串 Sv
|
||||
/// </summary>
|
||||
string EngSvValueStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工程值 Mv
|
||||
/// </summary>
|
||||
double EngMvValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工程值的字符串 Mv
|
||||
/// </summary>
|
||||
string EngMvValueStr { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// MV
|
||||
/// </summary>
|
||||
double MVValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最大值
|
||||
/// </summary>
|
||||
@@ -78,29 +47,14 @@ namespace CapMachine.Wpf.Models.Tag
|
||||
double MinValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 值类型
|
||||
/// 标签值类型
|
||||
/// </summary>
|
||||
Type ValueType { get; set; }
|
||||
TagDataType DataType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址
|
||||
/// 标签读写信息
|
||||
/// </summary>
|
||||
string PVAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址
|
||||
/// </summary>
|
||||
string SVAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址
|
||||
/// </summary>
|
||||
string MVAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Index
|
||||
/// </summary>
|
||||
string Index { get; set; }
|
||||
RWInfo RWInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 精度
|
||||
@@ -116,29 +70,11 @@ namespace CapMachine.Wpf.Models.Tag
|
||||
/// 是否为仪表参数
|
||||
/// </summary>
|
||||
bool IsMeter { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 手自动切换地址
|
||||
/// PV 工程值 字符串
|
||||
/// UI展示用
|
||||
/// </summary>
|
||||
string AutoHandSwitchAddress { get; set; }
|
||||
/// <summary>
|
||||
/// Pid-p地址
|
||||
/// </summary>
|
||||
string Pid_PAddress { get; set; }
|
||||
/// <summary>
|
||||
/// Pid-i地址
|
||||
/// </summary>
|
||||
string Pid_IAddress { get; set; }
|
||||
/// <summary>
|
||||
/// Pid-D地址
|
||||
/// </summary>
|
||||
string Pid_DAddress { get; set; }
|
||||
/// <summary>
|
||||
/// Limit_Up地址
|
||||
/// </summary>
|
||||
string Limit_UpAddress { get; set; }
|
||||
/// <summary>
|
||||
/// Limit_Down地址
|
||||
/// </summary>
|
||||
string Limit_DownAddress { get; set; }
|
||||
string? PVEngValueStr { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
35
CapMachine.Wpf/Models/Tag/RWInfo.cs
Normal file
35
CapMachine.Wpf/Models/Tag/RWInfo.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Wpf.Models.Tag
|
||||
{
|
||||
/// <summary>
|
||||
/// 读写信息
|
||||
/// </summary>
|
||||
public enum RWInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 控制
|
||||
/// </summary>
|
||||
Control = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 从PLC读取
|
||||
/// </summary>
|
||||
PLCRead = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 从压缩机读取
|
||||
/// </summary>
|
||||
CapRead = 5,
|
||||
|
||||
/// <summary>
|
||||
/// 计算
|
||||
/// </summary>
|
||||
PCCalcu = 8,
|
||||
|
||||
}
|
||||
}
|
||||
112
CapMachine.Wpf/Models/Tag/ShortControlTag.cs
Normal file
112
CapMachine.Wpf/Models/Tag/ShortControlTag.cs
Normal file
@@ -0,0 +1,112 @@
|
||||
using CapMachine.Wpf.Models.Tag.Cell;
|
||||
using HslCommunication;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Wpf.Models.Tag
|
||||
{
|
||||
/// <summary>
|
||||
/// Short类型 步序控制 标签数据
|
||||
/// 当前的数据无论是整型、浮点数等其他数据都是用Short表示,然后根据精度运算成所需数据
|
||||
/// 如果后期其他项目不是这样处理,则新建其他类对应
|
||||
/// </summary>
|
||||
public class ShortControlTag : BaseTag<short>
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public ShortControlTag()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 初始化数据
|
||||
/// </summary>
|
||||
public void UpdateInit()
|
||||
{
|
||||
PVModel!.DecimalPoint = this.DecimalPoint;
|
||||
PVModel!.Precision = this.Precision;
|
||||
|
||||
SVModel!.DecimalPoint = this.DecimalPoint;
|
||||
SVModel!.Precision = this.Precision;
|
||||
|
||||
//MV的值是固定到0-100,不需要转换
|
||||
MVModel!.DecimalPoint = 0;
|
||||
MVModel!.Precision = 1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// PV Model
|
||||
/// </summary>
|
||||
public MeterValueAttrCell PVModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SV Model
|
||||
/// </summary>
|
||||
public MeterValueAttrCell SVModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// MV Model
|
||||
/// </summary>
|
||||
public MeterValueAttrCell MVModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// AutoHand Model
|
||||
/// 仪表的MV手动和自动 模型
|
||||
/// </summary>
|
||||
public MvAmAttrCell MVAutoHandModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Pid-P
|
||||
/// </summary>
|
||||
public MeterExdAttrCell Pid_PModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Pid-I
|
||||
/// </summary>
|
||||
public MeterExdAttrCell Pid_IModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Pid-D
|
||||
/// </summary>
|
||||
public MeterExdAttrCell Pid_DModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Limit-Up
|
||||
/// </summary>
|
||||
public MeterExdAttrCell Limit_UpModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Limit-Down
|
||||
/// </summary>
|
||||
public MeterExdAttrCell Limit_DownModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Alarm
|
||||
/// </summary>
|
||||
public MeterExdAttrCell AlarmModel { get; set; }
|
||||
|
||||
|
||||
private bool _AutoHandState;
|
||||
/// <summary>
|
||||
/// 手自动状态
|
||||
/// </summary>
|
||||
public bool AutoHandState
|
||||
{
|
||||
get { return _AutoHandState; }
|
||||
set { _AutoHandState = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// 手自动切换地址
|
||||
///// </summary>
|
||||
//public string AutoHandSwitchAddress { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
29
CapMachine.Wpf/Models/Tag/ShortValueTag.cs
Normal file
29
CapMachine.Wpf/Models/Tag/ShortValueTag.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Wpf.Models.Tag
|
||||
{
|
||||
/// <summary>
|
||||
/// Short类型 标签数据
|
||||
/// </summary>
|
||||
public class ShortValueTag : BaseTag<short>
|
||||
{
|
||||
/// <summary>
|
||||
/// PV Model
|
||||
/// </summary>
|
||||
public MeterValueAttrCell PVModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 初始化数据
|
||||
/// </summary>
|
||||
public void UpdateInit()
|
||||
{
|
||||
PVModel!.DecimalPoint = this.DecimalPoint;
|
||||
PVModel!.Precision = this.Precision;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,311 +3,311 @@ using Prism.Mvvm;
|
||||
|
||||
namespace CapMachine.Wpf.Models.Tag
|
||||
{
|
||||
/// <summary>
|
||||
/// 基础模型
|
||||
/// </summary>
|
||||
public class Tag<T> : BindableBase, ITag
|
||||
{
|
||||
/// <summary>
|
||||
/// 实例化函数
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="enName"></param>
|
||||
/// <param name="tagType"></param>
|
||||
public Tag(string nameNoUnit, string name, string enName, string group, string PVaddress, double maxValue, double minValue, short precision, string unit, ITagValue<T> tagValue, bool isMeter)
|
||||
{
|
||||
Group = group;
|
||||
Name = name;
|
||||
Unit = unit;
|
||||
EnName = enName;
|
||||
PVAddress = PVaddress;
|
||||
MaxValue = maxValue;
|
||||
MinValue = minValue;
|
||||
Precision = precision;
|
||||
///// <summary>
|
||||
///// 基础模型
|
||||
///// </summary>
|
||||
//public class Tag<T> : BindableBase, ITag
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// 实例化函数
|
||||
// /// </summary>
|
||||
// /// <param name="name"></param>
|
||||
// /// <param name="enName"></param>
|
||||
// /// <param name="tagType"></param>
|
||||
// public Tag(string nameNoUnit, string name, string enName, string group, string PVaddress, double maxValue, double minValue, short precision, string unit, ITagValue<T> tagValue, bool isMeter)
|
||||
// {
|
||||
// Group = group;
|
||||
// Name = name;
|
||||
// Unit = unit;
|
||||
// EnName = enName;
|
||||
// PVAddress = PVaddress;
|
||||
// MaxValue = maxValue;
|
||||
// MinValue = minValue;
|
||||
// Precision = precision;
|
||||
|
||||
IsMeter = isMeter;
|
||||
// IsMeter = isMeter;
|
||||
|
||||
NameNoUnit = nameNoUnit;
|
||||
// NameNoUnit = nameNoUnit;
|
||||
|
||||
//实例化
|
||||
TagValue = tagValue;
|
||||
ValueType = typeof(T);
|
||||
// //实例化
|
||||
// TagValue = tagValue;
|
||||
// ValueType = typeof(T);
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// 实例化函数
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="enName"></param>
|
||||
/// <param name="tagType"></param>
|
||||
public Tag(ITagValue<T> tagValue)
|
||||
{
|
||||
//实例化
|
||||
TagValue = tagValue;
|
||||
ValueType = typeof(T);
|
||||
// /// <summary>
|
||||
// /// 实例化函数
|
||||
// /// </summary>
|
||||
// /// <param name="name"></param>
|
||||
// /// <param name="enName"></param>
|
||||
// /// <param name="tagType"></param>
|
||||
// public Tag(ITagValue<T> tagValue)
|
||||
// {
|
||||
// //实例化
|
||||
// TagValue = tagValue;
|
||||
// ValueType = typeof(T);
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// 实例化函数
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="enName"></param>
|
||||
/// <param name="tagType"></param>
|
||||
public Tag()
|
||||
{
|
||||
//实例化
|
||||
ValueType = typeof(T);
|
||||
// /// <summary>
|
||||
// /// 实例化函数
|
||||
// /// </summary>
|
||||
// /// <param name="name"></param>
|
||||
// /// <param name="enName"></param>
|
||||
// /// <param name="tagType"></param>
|
||||
// public Tag()
|
||||
// {
|
||||
// //实例化
|
||||
// ValueType = typeof(T);
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// 名称 中文
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
// /// <summary>
|
||||
// /// 名称 中文
|
||||
// /// </summary>
|
||||
// public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称 英文
|
||||
/// </summary>
|
||||
public string EnName { get; set; }
|
||||
// /// <summary>
|
||||
// /// 名称 英文
|
||||
// /// </summary>
|
||||
// public string EnName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称 无单位中文名称
|
||||
/// </summary>
|
||||
public string NameNoUnit { get; set; }
|
||||
// /// <summary>
|
||||
// /// 名称 无单位中文名称
|
||||
// /// </summary>
|
||||
// public string NameNoUnit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标签组
|
||||
/// </summary>
|
||||
public string Group { get; set; }
|
||||
// /// <summary>
|
||||
// /// 标签组
|
||||
// /// </summary>
|
||||
// public string Group { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 实时值
|
||||
///// </summary>
|
||||
//public abstract IRegisterValue<short> RtValue { get; set; }
|
||||
// ///// <summary>
|
||||
// ///// 实时值
|
||||
// ///// </summary>
|
||||
// //public abstract IRegisterValue<short> RtValue { get; set; }
|
||||
|
||||
private ITagValue<T> _TagValue;
|
||||
/// <summary>
|
||||
/// 实时值
|
||||
/// </summary>
|
||||
public ITagValue<T> TagValue
|
||||
{
|
||||
get { return _TagValue; }
|
||||
set { _TagValue = value; RaisePropertyChanged(); }
|
||||
}
|
||||
// private ITagValue<T> _TagValue;
|
||||
// /// <summary>
|
||||
// /// 实时值
|
||||
// /// </summary>
|
||||
// public ITagValue<T> TagValue
|
||||
// {
|
||||
// get { return _TagValue; }
|
||||
// set { _TagValue = value; RaisePropertyChanged(); }
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// 原始值实时值
|
||||
/// </summary>
|
||||
public OperateResult<T> OperateResultSource { get; set; } //
|
||||
// /// <summary>
|
||||
// /// 原始值实时值
|
||||
// /// </summary>
|
||||
// public OperateResult<T> OperateResultSource { get; set; } //
|
||||
|
||||
/// <summary>
|
||||
/// 数据类型信息
|
||||
/// </summary>
|
||||
public Type ValueType { get; set; }
|
||||
// /// <summary>
|
||||
// /// 数据类型信息
|
||||
// /// </summary>
|
||||
// public Type ValueType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址信息 PV
|
||||
/// </summary>
|
||||
public string PVAddress { get; set; }
|
||||
// /// <summary>
|
||||
// /// 地址信息 PV
|
||||
// /// </summary>
|
||||
// public string PVAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址信息 SV
|
||||
/// </summary>
|
||||
public string SVAddress { get; set; }
|
||||
// /// <summary>
|
||||
// /// 地址信息 SV
|
||||
// /// </summary>
|
||||
// public string SVAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址信息 MV
|
||||
/// </summary>
|
||||
public string MVAddress { get; set; }
|
||||
// /// <summary>
|
||||
// /// 地址信息 MV
|
||||
// /// </summary>
|
||||
// public string MVAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址信息 Pid_P
|
||||
/// </summary>
|
||||
public string Pid_PAddress { get; set; }
|
||||
// /// <summary>
|
||||
// /// 地址信息 Pid_P
|
||||
// /// </summary>
|
||||
// public string Pid_PAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址信息 Pid_I
|
||||
/// </summary>
|
||||
public string Pid_IAddress { get; set; }
|
||||
// /// <summary>
|
||||
// /// 地址信息 Pid_I
|
||||
// /// </summary>
|
||||
// public string Pid_IAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址信息 Pid_D
|
||||
/// </summary>
|
||||
public string Pid_DAddress { get; set; }
|
||||
// /// <summary>
|
||||
// /// 地址信息 Pid_D
|
||||
// /// </summary>
|
||||
// public string Pid_DAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址信息 Limit_Up
|
||||
/// </summary>
|
||||
public string Limit_UpAddress { get; set; }
|
||||
// /// <summary>
|
||||
// /// 地址信息 Limit_Up
|
||||
// /// </summary>
|
||||
// public string Limit_UpAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址信息 Limit_Down
|
||||
/// </summary>
|
||||
public string Limit_DownAddress { get; set; }
|
||||
// /// <summary>
|
||||
// /// 地址信息 Limit_Down
|
||||
// /// </summary>
|
||||
// public string Limit_DownAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址信息 Index
|
||||
/// </summary>
|
||||
public string Index { get; set; }
|
||||
// /// <summary>
|
||||
// /// 地址信息 Index
|
||||
// /// </summary>
|
||||
// public string Index { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最大值
|
||||
/// </summary>
|
||||
public double MaxValue { get; set; }
|
||||
// /// <summary>
|
||||
// /// 最大值
|
||||
// /// </summary>
|
||||
// public double MaxValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最小值
|
||||
/// </summary>
|
||||
public double MinValue { get; set; }
|
||||
// /// <summary>
|
||||
// /// 最小值
|
||||
// /// </summary>
|
||||
// public double MinValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 精度 到PLC的转换精度/分辨率
|
||||
/// </summary>
|
||||
public short Precision { get; set; }
|
||||
// /// <summary>
|
||||
// /// 精度 到PLC的转换精度/分辨率
|
||||
// /// </summary>
|
||||
// public short Precision { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 小数点 展示时用的小数点
|
||||
/// </summary>
|
||||
public short DecimalPoint { get; set; }
|
||||
// /// <summary>
|
||||
// /// 小数点 展示时用的小数点
|
||||
// /// </summary>
|
||||
// public short DecimalPoint { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位
|
||||
/// </summary>
|
||||
public string? Unit { get; set; }
|
||||
// /// <summary>
|
||||
// /// 单位
|
||||
// /// </summary>
|
||||
// public string? Unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 采样周期
|
||||
/// </summary>
|
||||
public int Samp { get; set; }
|
||||
// /// <summary>
|
||||
// /// 采样周期
|
||||
// /// </summary>
|
||||
// public int Samp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否为仪表参数
|
||||
/// </summary>
|
||||
public bool IsMeter { get; set; }
|
||||
// /// <summary>
|
||||
// /// 是否为仪表参数
|
||||
// /// </summary>
|
||||
// public bool IsMeter { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 手自动切换地址
|
||||
/// </summary>
|
||||
public string AutoHandSwitchAddress { get; set; }
|
||||
// /// <summary>
|
||||
// /// 手自动切换地址
|
||||
// /// </summary>
|
||||
// public string AutoHandSwitchAddress { get; set; }
|
||||
|
||||
private bool _AutoHandState;
|
||||
/// <summary>
|
||||
/// 手自动状态
|
||||
/// </summary>
|
||||
public bool AutoHandState
|
||||
{
|
||||
get { return _AutoHandState; }
|
||||
set { _AutoHandState = value; RaisePropertyChanged(); }
|
||||
}
|
||||
// private bool _AutoHandState;
|
||||
// /// <summary>
|
||||
// /// 手自动状态
|
||||
// /// </summary>
|
||||
// public bool AutoHandState
|
||||
// {
|
||||
// get { return _AutoHandState; }
|
||||
// set { _AutoHandState = value; RaisePropertyChanged(); }
|
||||
// }
|
||||
|
||||
private double _EngSvValue;
|
||||
/// <summary>
|
||||
/// 工程值 SV
|
||||
/// </summary>
|
||||
public double EngSvValue
|
||||
{
|
||||
get { return _EngSvValue; }
|
||||
set
|
||||
{
|
||||
_EngSvValue = value;
|
||||
if (TagValue.IsShow)
|
||||
{
|
||||
RaisePropertyChanged();
|
||||
}
|
||||
EngSvValueStr = Math.Round(value, DecimalPoint).ToString();
|
||||
}
|
||||
}
|
||||
// private double _EngSvValue;
|
||||
// /// <summary>
|
||||
// /// 工程值 SV
|
||||
// /// </summary>
|
||||
// public double EngSvValue
|
||||
// {
|
||||
// get { return _EngSvValue; }
|
||||
// set
|
||||
// {
|
||||
// _EngSvValue = value;
|
||||
// if (TagValue.IsShow)
|
||||
// {
|
||||
// RaisePropertyChanged();
|
||||
// }
|
||||
// EngSvValueStr = Math.Round(value, DecimalPoint).ToString();
|
||||
// }
|
||||
// }
|
||||
|
||||
private string _EngSvValueStr;
|
||||
/// <summary>
|
||||
/// 工程值的字符串 SV
|
||||
/// </summary>
|
||||
public string EngSvValueStr
|
||||
{
|
||||
get { return _EngSvValueStr; }
|
||||
set { _EngSvValueStr = value; RaisePropertyChanged(); }
|
||||
}
|
||||
// private string _EngSvValueStr;
|
||||
// /// <summary>
|
||||
// /// 工程值的字符串 SV
|
||||
// /// </summary>
|
||||
// public string EngSvValueStr
|
||||
// {
|
||||
// get { return _EngSvValueStr; }
|
||||
// set { _EngSvValueStr = value; RaisePropertyChanged(); }
|
||||
// }
|
||||
|
||||
|
||||
private double _EngPvValue;
|
||||
/// <summary>
|
||||
/// 工程值 PV
|
||||
/// </summary>
|
||||
public double EngPvValue
|
||||
{
|
||||
get { return _EngPvValue; }
|
||||
set
|
||||
{
|
||||
_EngPvValue = value;
|
||||
if (TagValue.IsShow)
|
||||
{
|
||||
RaisePropertyChanged();
|
||||
}
|
||||
EngPvValueStr = Math.Round(value, DecimalPoint).ToString();
|
||||
}
|
||||
}
|
||||
// private double _EngPvValue;
|
||||
// /// <summary>
|
||||
// /// 工程值 PV
|
||||
// /// </summary>
|
||||
// public double EngPvValue
|
||||
// {
|
||||
// get { return _EngPvValue; }
|
||||
// set
|
||||
// {
|
||||
// _EngPvValue = value;
|
||||
// if (TagValue.IsShow)
|
||||
// {
|
||||
// RaisePropertyChanged();
|
||||
// }
|
||||
// EngPvValueStr = Math.Round(value, DecimalPoint).ToString();
|
||||
// }
|
||||
// }
|
||||
|
||||
private string _EngPvValueStr;
|
||||
/// <summary>
|
||||
/// 工程值的字符串
|
||||
/// </summary>
|
||||
public string EngPvValueStr
|
||||
{
|
||||
get { return _EngPvValueStr; }
|
||||
set { _EngPvValueStr = value; RaisePropertyChanged(); }
|
||||
}
|
||||
// private string _EngPvValueStr;
|
||||
// /// <summary>
|
||||
// /// 工程值的字符串
|
||||
// /// </summary>
|
||||
// public string EngPvValueStr
|
||||
// {
|
||||
// get { return _EngPvValueStr; }
|
||||
// set { _EngPvValueStr = value; RaisePropertyChanged(); }
|
||||
// }
|
||||
|
||||
|
||||
private double _EngMvValue;
|
||||
/// <summary>
|
||||
/// 工程值 MV
|
||||
/// </summary>
|
||||
public double EngMvValue
|
||||
{
|
||||
get { return _EngMvValue; }
|
||||
set
|
||||
{
|
||||
_EngMvValue = value;
|
||||
if (TagValue.IsShow)
|
||||
{
|
||||
RaisePropertyChanged();
|
||||
}
|
||||
EngMvValueStr = value.ToString();
|
||||
}
|
||||
}
|
||||
// private double _EngMvValue;
|
||||
// /// <summary>
|
||||
// /// 工程值 MV
|
||||
// /// </summary>
|
||||
// public double EngMvValue
|
||||
// {
|
||||
// get { return _EngMvValue; }
|
||||
// set
|
||||
// {
|
||||
// _EngMvValue = value;
|
||||
// if (TagValue.IsShow)
|
||||
// {
|
||||
// RaisePropertyChanged();
|
||||
// }
|
||||
// EngMvValueStr = value.ToString();
|
||||
// }
|
||||
// }
|
||||
|
||||
private string _EngMvValueStr;
|
||||
/// <summary>
|
||||
/// 工程值的字符串 MV
|
||||
/// </summary>
|
||||
public string EngMvValueStr
|
||||
{
|
||||
get { return _EngMvValueStr; }
|
||||
set { _EngMvValueStr = value; RaisePropertyChanged(); }
|
||||
}
|
||||
// private string _EngMvValueStr;
|
||||
// /// <summary>
|
||||
// /// 工程值的字符串 MV
|
||||
// /// </summary>
|
||||
// public string EngMvValueStr
|
||||
// {
|
||||
// get { return _EngMvValueStr; }
|
||||
// set { _EngMvValueStr = value; RaisePropertyChanged(); }
|
||||
// }
|
||||
|
||||
|
||||
private double _MVValue = 20;
|
||||
/// <summary>
|
||||
/// MV值
|
||||
/// 不是所有的数据都有MV值,只有仪表参数设置的有
|
||||
/// </summary>
|
||||
public double MVValue
|
||||
{
|
||||
get { return _MVValue; }
|
||||
set
|
||||
{
|
||||
_MVValue = value;
|
||||
if (TagValue.IsShow)
|
||||
{
|
||||
RaisePropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
// private double _MVValue = 20;
|
||||
// /// <summary>
|
||||
// /// MV值
|
||||
// /// 不是所有的数据都有MV值,只有仪表参数设置的有
|
||||
// /// </summary>
|
||||
// public double MVValue
|
||||
// {
|
||||
// get { return _MVValue; }
|
||||
// set
|
||||
// {
|
||||
// _MVValue = value;
|
||||
// if (TagValue.IsShow)
|
||||
// {
|
||||
// RaisePropertyChanged();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
28
CapMachine.Wpf/Models/Tag/TagDataType.cs
Normal file
28
CapMachine.Wpf/Models/Tag/TagDataType.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Wpf.Models.Tag
|
||||
{
|
||||
/// <summary>
|
||||
/// 标签的数据类型
|
||||
/// </summary>
|
||||
public enum TagDataType
|
||||
{
|
||||
Short,
|
||||
Int,
|
||||
Long,
|
||||
Float,
|
||||
Double,
|
||||
String,
|
||||
Bool,
|
||||
DateTime,
|
||||
Byte,
|
||||
UShort,
|
||||
UInt,
|
||||
ULong,
|
||||
UByte
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,8 @@
|
||||
namespace CapMachine.Wpf.Models.Tag
|
||||
using CapMachine.Wpf.Models.Tag.Cell;
|
||||
using HslCommunication.Algorithms.PID;
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
namespace CapMachine.Wpf.Models.Tag
|
||||
{
|
||||
/// <summary>
|
||||
/// 标签管理中心
|
||||
@@ -17,23 +21,614 @@
|
||||
/// <summary>
|
||||
/// 标签集合数据
|
||||
/// </summary>
|
||||
public Dictionary<string, ITag> DicTags { get; set; } = new Dictionary<string, ITag>();
|
||||
//public Dictionary<string, ITag> DicTags { get; set; } = new Dictionary<string, ITag>();
|
||||
|
||||
/// <summary>
|
||||
/// 标签集合数据
|
||||
/// 线程安全
|
||||
/// </summary>
|
||||
public readonly ConcurrentDictionary<string, ITag> DicTags = new ConcurrentDictionary<string, ITag>();
|
||||
|
||||
/// <summary>
|
||||
/// 增加标签
|
||||
/// </summary>
|
||||
public void AddTag<T>(Tag<T> baseTag)
|
||||
public void AddTag<T>(BaseTag<T> baseTag)
|
||||
{
|
||||
DicTags[baseTag.Name] = baseTag;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取标签信息
|
||||
/// PV锁
|
||||
/// </summary>
|
||||
private static readonly object PvLock = new object();
|
||||
|
||||
|
||||
#region 获取标签的PVModel SVModel MVModel
|
||||
|
||||
/// <summary>
|
||||
/// 尝试获取标签的PVModel模型
|
||||
/// </summary>
|
||||
/// <param name="tagName">标签名称</param>
|
||||
/// <param name="pVModel">输出的pVModel模型,如果获取失败则为null</param>
|
||||
/// <returns>是否成功获取PV模型</returns>
|
||||
public bool TryGetPVModel(string tagName, out MeterValueAttrCell? pVModel)
|
||||
{
|
||||
lock (PvLock)
|
||||
{
|
||||
pVModel = null;
|
||||
|
||||
if (string.IsNullOrEmpty(tagName))
|
||||
return false;
|
||||
|
||||
// 尝试从字典中获取标签
|
||||
if (DicTags.TryGetValue(tagName, out var tag))
|
||||
{
|
||||
// 尝试将标签转换为ShortControlTag
|
||||
if (tag is ShortControlTag controlTag)
|
||||
{
|
||||
pVModel = controlTag.PVModel;
|
||||
return true;
|
||||
}
|
||||
else if (tag is ShortValueTag shortTag)
|
||||
{
|
||||
pVModel = shortTag.PVModel;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 尝试获取标签的PVModel模型
|
||||
/// 给数据记录使用
|
||||
/// </summary>
|
||||
/// <param name="tagName">标签名称</param>
|
||||
/// <param name="pVModel">输出的pVModel模型,如果获取失败则为null</param>
|
||||
/// <returns>是否成功获取PV模型</returns>
|
||||
public MeterValueAttrCell TryGetRecordPVModel(string tagName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(tagName))
|
||||
return null;
|
||||
|
||||
// 尝试从字典中获取标签
|
||||
if (DicTags.TryGetValue(tagName, out var tag))
|
||||
{
|
||||
// 尝试将标签转换为ShortControlTag
|
||||
if (tag is ShortControlTag controlTag)
|
||||
{
|
||||
return controlTag.PVModel;
|
||||
}
|
||||
else if (tag is ShortValueTag shortTag)
|
||||
{
|
||||
return shortTag.PVModel;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 尝试获取标签的PVModel模型的数据
|
||||
/// 给数据记录使用
|
||||
/// </summary>
|
||||
/// <param name="tagName">标签名称</param>
|
||||
/// <param name="pVModel">输出的pVModel模型,如果获取失败则为null</param>
|
||||
/// <returns>是否成功获取PV模型</returns>
|
||||
public double TryGetRecordPVValue(string tagName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(tagName))
|
||||
return 0;
|
||||
|
||||
// 尝试从字典中获取标签
|
||||
if (DicTags.TryGetValue(tagName, out var tag))
|
||||
{
|
||||
// 尝试将标签转换为ShortControlTag
|
||||
if (tag is ShortControlTag controlTag)
|
||||
{
|
||||
return controlTag.PVModel.EngValue;
|
||||
}
|
||||
else if (tag is ShortValueTag shortTag)
|
||||
{
|
||||
return shortTag.PVModel.EngValue;
|
||||
}
|
||||
else if (tag is CalcTag calcTag)
|
||||
{
|
||||
return calcTag.PVModel!.EngValue;
|
||||
}
|
||||
else if (tag is CapTag capTag)
|
||||
{
|
||||
return capTag.PVModel!.EngValue;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 尝试获取标签的SVModel模型
|
||||
/// </summary>
|
||||
/// <param name="tagName">标签名称</param>
|
||||
/// <param name="SVModel">输出的sVModel模型,如果获取失败则为null</param>
|
||||
/// <returns>是否成功获取SV模型</returns>
|
||||
public bool TryGetSVModel(string tagName, out MeterValueAttrCell? sVModel)
|
||||
{
|
||||
sVModel = null;
|
||||
|
||||
if (string.IsNullOrEmpty(tagName))
|
||||
return false;
|
||||
|
||||
// 尝试从字典中获取标签
|
||||
if (DicTags.TryGetValue(tagName, out var tag))
|
||||
{
|
||||
// 尝试将标签转换为ShortControlTag
|
||||
if (tag is ShortControlTag controlTag)
|
||||
{
|
||||
sVModel = controlTag.SVModel;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 尝试获取标签的MVModel模型
|
||||
/// </summary>
|
||||
/// <param name="tagName">标签名称</param>
|
||||
/// <param name="mVModel">输出的MVModel模型,如果获取失败则为null</param>
|
||||
/// <returns>是否成功获取MV模型</returns>
|
||||
public bool TryGetMVModel(string tagName, out MeterValueAttrCell? mVModel)
|
||||
{
|
||||
mVModel = null;
|
||||
|
||||
if (string.IsNullOrEmpty(tagName))
|
||||
return false;
|
||||
|
||||
// 尝试从字典中获取标签
|
||||
if (DicTags.TryGetValue(tagName, out var tag))
|
||||
{
|
||||
// 尝试将标签转换为ShortControlTag
|
||||
if (tag is ShortControlTag controlTag)
|
||||
{
|
||||
mVModel = controlTag.MVModel;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 尝试获取标签的MVAm模型
|
||||
/// </summary>
|
||||
/// <param name="tagName">标签名称</param>
|
||||
/// <param name="MVAm">输出的MVAmModel模型,如果获取失败则为null</param>
|
||||
/// <returns>是否成功获取MV模型</returns>
|
||||
public bool TryGetMVAmModel(string tagName, out MvAmAttrCell? mVAmModel)
|
||||
{
|
||||
mVAmModel = null;
|
||||
|
||||
if (string.IsNullOrEmpty(tagName))
|
||||
return false;
|
||||
|
||||
// 尝试从字典中获取标签
|
||||
if (DicTags.TryGetValue(tagName, out var tag))
|
||||
{
|
||||
// 尝试将标签转换为ShortControlTag
|
||||
if (tag is ShortControlTag controlTag)
|
||||
{
|
||||
mVAmModel = controlTag.MVAutoHandModel;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 获取控制属性的PID LIMIT ALARM
|
||||
|
||||
/// <summary>
|
||||
/// 尝试获取标签的PID_P模型
|
||||
/// </summary>
|
||||
/// <param name="tagName"></param>
|
||||
/// <param name="pidPModel"></param>
|
||||
/// <returns></returns>
|
||||
public bool TryGetPidPModel(string tagName, out MeterExdAttrCell? pidPModel)
|
||||
{
|
||||
pidPModel = null;
|
||||
|
||||
if (string.IsNullOrEmpty(tagName))
|
||||
return false;
|
||||
|
||||
// 尝试从字典中获取标签
|
||||
if (DicTags.TryGetValue(tagName, out var tag))
|
||||
{
|
||||
// 尝试将标签转换为ShortControlTag
|
||||
if (tag is ShortControlTag controlTag)
|
||||
{
|
||||
pidPModel = controlTag.Pid_PModel;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 尝试获取标签的PID_I模型
|
||||
/// </summary>
|
||||
/// <param name="tagName"></param>
|
||||
/// <param name="pidIModel"></param>
|
||||
/// <returns></returns>
|
||||
public bool TryGetPidIModel(string tagName, out MeterExdAttrCell? pidIModel)
|
||||
{
|
||||
pidIModel = null;
|
||||
|
||||
if (string.IsNullOrEmpty(tagName))
|
||||
return false;
|
||||
|
||||
// 尝试从字典中获取标签
|
||||
if (DicTags.TryGetValue(tagName, out var tag))
|
||||
{
|
||||
// 尝试将标签转换为ShortControlTag
|
||||
if (tag is ShortControlTag controlTag)
|
||||
{
|
||||
pidIModel = controlTag.Pid_IModel;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 尝试获取标签的PID_D模型
|
||||
/// </summary>
|
||||
/// <param name="tagName">标签名称</param>
|
||||
/// <param name="pidDModel">输出的PID_D模型,如果获取失败则为null</param>
|
||||
/// <returns>是否成功获取PID_D模型</returns>
|
||||
public bool TryGetPidDModel(string tagName, out MeterExdAttrCell? pidDModel)
|
||||
{
|
||||
pidDModel = null;
|
||||
|
||||
if (string.IsNullOrEmpty(tagName))
|
||||
return false;
|
||||
|
||||
// 尝试从字典中获取标签
|
||||
if (DicTags.TryGetValue(tagName, out var tag))
|
||||
{
|
||||
// 尝试将标签转换为ShortControlTag
|
||||
if (tag is ShortControlTag controlTag)
|
||||
{
|
||||
pidDModel = controlTag.Pid_DModel;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 尝试获取标签的limitUpModel模型
|
||||
/// </summary>
|
||||
/// <param name="tagName"></param>
|
||||
/// <param name="limitUpModel"></param>
|
||||
/// <returns></returns>
|
||||
public bool TryGetLimitUpModel(string tagName, out MeterExdAttrCell? limitUpModel)
|
||||
{
|
||||
limitUpModel = null;
|
||||
|
||||
if (string.IsNullOrEmpty(tagName))
|
||||
return false;
|
||||
|
||||
// 尝试从字典中获取标签
|
||||
if (DicTags.TryGetValue(tagName, out var tag))
|
||||
{
|
||||
// 尝试将标签转换为ShortControlTag
|
||||
if (tag is ShortControlTag controlTag)
|
||||
{
|
||||
limitUpModel = controlTag.Limit_UpModel;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 尝试获取标签的limitDownModel模型
|
||||
/// </summary>
|
||||
/// <param name="tagName"></param>
|
||||
/// <param name="limitDownModel"></param>
|
||||
/// <returns></returns>
|
||||
public bool TryGetLimitDownModel(string tagName, out MeterExdAttrCell? limitDownModel)
|
||||
{
|
||||
limitDownModel = null;
|
||||
|
||||
if (string.IsNullOrEmpty(tagName))
|
||||
return false;
|
||||
|
||||
// 尝试从字典中获取标签
|
||||
if (DicTags.TryGetValue(tagName, out var tag))
|
||||
{
|
||||
// 尝试将标签转换为ShortControlTag
|
||||
if (tag is ShortControlTag controlTag)
|
||||
{
|
||||
limitDownModel = controlTag.Limit_DownModel;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 尝试获取标签的Alarm模型
|
||||
/// </summary>
|
||||
/// <param name="tagName"></param>
|
||||
/// <param name="alarmModel"></param>
|
||||
/// <returns></returns>
|
||||
public bool TryGetAlarmModel(string tagName, out MeterExdAttrCell? alarmModel)
|
||||
{
|
||||
alarmModel = null;
|
||||
|
||||
if (string.IsNullOrEmpty(tagName))
|
||||
return false;
|
||||
|
||||
// 尝试从字典中获取标签
|
||||
if (DicTags.TryGetValue(tagName, out var tag))
|
||||
{
|
||||
// 尝试将标签转换为ShortControlTag
|
||||
if (tag is ShortControlTag controlTag)
|
||||
{
|
||||
alarmModel = controlTag.AlarmModel;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 尝试获取标签的MvAmAttrCelll模型
|
||||
/// </summary>
|
||||
/// <param name="tagName"></param>
|
||||
/// <param name="mvAmModel"></param>
|
||||
/// <returns></returns>
|
||||
public bool TryGetMvAmModel(string tagName, out MvAmAttrCell? mvAmModel)
|
||||
{
|
||||
mvAmModel = null;
|
||||
|
||||
if (string.IsNullOrEmpty(tagName))
|
||||
return false;
|
||||
|
||||
// 尝试从字典中获取标签
|
||||
if (DicTags.TryGetValue(tagName, out var tag))
|
||||
{
|
||||
// 尝试将标签转换为ShortControlTag
|
||||
if (tag is ShortControlTag controlTag)
|
||||
{
|
||||
mvAmModel = controlTag.MVAutoHandModel;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 尝试获取标签的MvAmAttrCelll模型
|
||||
/// </summary>
|
||||
/// <param name="tagName"></param>
|
||||
/// <param name="limitModel"></param>
|
||||
/// <returns></returns>
|
||||
public bool TryGetQuickAttrModel(string tagName, out QuickAttrCell? quickAttrCell)
|
||||
{
|
||||
quickAttrCell = null;
|
||||
|
||||
if (string.IsNullOrEmpty(tagName))
|
||||
return false;
|
||||
|
||||
// 尝试从字典中获取标签
|
||||
if (DicTags.TryGetValue(tagName, out var tag))
|
||||
{
|
||||
// 尝试将标签转换为ShortControlTag
|
||||
if (tag is CapTag capTag)
|
||||
{
|
||||
quickAttrCell = capTag.PVModel;
|
||||
return true;
|
||||
}
|
||||
else if (tag is CalcTag calcTag)
|
||||
{
|
||||
quickAttrCell = calcTag.PVModel;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 获取标签
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 尝试获取ShortControlTag变量
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="shortControlTag"></param>
|
||||
/// <returns></returns>
|
||||
public bool TryGetShortControlTagByName(string name, out ShortControlTag? shortControlTag)
|
||||
{
|
||||
shortControlTag = null;
|
||||
|
||||
if (string.IsNullOrEmpty(name))
|
||||
return false;
|
||||
|
||||
// 尝试从字典中获取标签
|
||||
if (DicTags.TryGetValue(name, out var tag))
|
||||
{
|
||||
// 尝试将标签转换为ShortControlTag
|
||||
if (tag is ShortControlTag controlTag)
|
||||
{
|
||||
shortControlTag = controlTag;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 尝试获取ShortTag变量
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="shortTag"></param>
|
||||
/// <returns></returns>
|
||||
public bool TryGetShortTagByName(string name, out ShortValueTag? shortTag)
|
||||
{
|
||||
shortTag = null;
|
||||
|
||||
if (string.IsNullOrEmpty(name))
|
||||
return false;
|
||||
|
||||
// 尝试从字典中获取标签
|
||||
if (DicTags.TryGetValue(name, out var tag))
|
||||
{
|
||||
// 尝试将标签转换为ShortControlTag
|
||||
if (tag is ShortValueTag getshortTag)
|
||||
{
|
||||
shortTag = getshortTag;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 尝试获取CapTag变量
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="shortTag"></param>
|
||||
/// <returns></returns>
|
||||
public bool TryGetCapTagByName(string name, out CapTag? capTag)
|
||||
{
|
||||
capTag = null;
|
||||
|
||||
if (string.IsNullOrEmpty(name))
|
||||
return false;
|
||||
|
||||
// 尝试从字典中获取标签
|
||||
if (DicTags.TryGetValue(name, out var tag))
|
||||
{
|
||||
// 尝试将标签转换为ShortControlTag
|
||||
if (tag is CapTag getshortTag)
|
||||
{
|
||||
capTag = getshortTag;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 尝试获取CalcTag变量
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="shortTag"></param>
|
||||
/// <returns></returns>
|
||||
public bool TryGetCalcTagByName(string name, out CalcTag? calcTag)
|
||||
{
|
||||
calcTag = null;
|
||||
|
||||
if (string.IsNullOrEmpty(name))
|
||||
return false;
|
||||
|
||||
// 尝试从字典中获取标签
|
||||
if (DicTags.TryGetValue(name, out var tag))
|
||||
{
|
||||
// 尝试将标签转换为ShortControlTag
|
||||
if (tag is CalcTag getshortTag)
|
||||
{
|
||||
calcTag = getshortTag;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 检查标签是否为ShortControlTag标签类型
|
||||
/// </summary>
|
||||
/// <param name="tagName">标签名称</param>
|
||||
/// <returns>如果是ShortControlTag类型返回true,否则返回false</returns>
|
||||
public bool IsShortControlTag(string tagName)
|
||||
{
|
||||
if (DicTags.TryGetValue(tagName, out var tag))
|
||||
{
|
||||
return tag is ShortControlTag;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查标签是否为ShortTag标签类型
|
||||
/// </summary>
|
||||
/// <param name="tagName">标签名称</param>
|
||||
/// <returns>如果是ShortValueTag类型返回true,否则返回false</returns>
|
||||
public bool IsShortTag(string tagName)
|
||||
{
|
||||
if (DicTags.TryGetValue(tagName, out var tag))
|
||||
{
|
||||
return tag is ShortValueTag;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 检查标签是否为CapTag标签类型
|
||||
/// </summary>
|
||||
/// <param name="tagName">标签名称</param>
|
||||
/// <returns>如果是CapTag类型返回true,否则返回false</returns>
|
||||
public bool IsCapTag(string tagName)
|
||||
{
|
||||
if (DicTags.TryGetValue(tagName, out var tag))
|
||||
{
|
||||
return tag is CapTag;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 检查标签是否为CalcTag标签类型
|
||||
/// </summary>
|
||||
/// <param name="tagName">标签名称</param>
|
||||
/// <returns>如果是CalcTag类型返回true,否则返回false</returns>
|
||||
public bool IsCalcTag(string tagName)
|
||||
{
|
||||
if (DicTags.TryGetValue(tagName, out var tag))
|
||||
{
|
||||
return tag is CalcTag;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取原始标签信息
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public Tag<T>? GetTagByName<T>(string name)
|
||||
public BaseTag<T>? GetBaseTagByName<T>(string name)
|
||||
{
|
||||
//return ListTag.OfType<BaseTag<T>>()
|
||||
// .FirstOrDefault(t => t.Name.Equals(name, StringComparison.OrdinalIgnoreCase));
|
||||
@@ -41,47 +636,47 @@
|
||||
// 尝试从字典中获取标签,并使用 as 关键字避免类型转换失败抛出异常
|
||||
if (DicTags.TryGetValue(name, out var FindTag))
|
||||
{
|
||||
return FindTag as Tag<T>;// 成功转换返回具体类型的标签,失败返回 null
|
||||
return FindTag as BaseTag<T>;// 成功转换返回具体类型的标签,失败返回 null
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 通过标签名称获取 ShortControlTag 信息 无返回是否为空
|
||||
/// </summary>
|
||||
/// <param name="Name">标签名称</param>
|
||||
/// <returns>找到则返回ShortControlTag,否则返回null</returns>
|
||||
public ShortControlTag? GetShortControlTagByName(string Name)
|
||||
{
|
||||
// 尝试从字典中获取标签
|
||||
if (DicTags.TryGetValue(Name, out var findTag))
|
||||
{
|
||||
// 尝试转换为 ShortControlTag
|
||||
return findTag as ShortControlTag;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取标签的值
|
||||
/// 通过标签名称获取 ShortTag 信息 无返回是否为空
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public T? GetTagValueByName<T>(string name)
|
||||
public ShortValueTag GetShortTagByName(string name)
|
||||
{
|
||||
var FindTag = GetTagByName<T>(name);
|
||||
|
||||
// 如果找到标签,则返回其值,否则返回默认值
|
||||
if (FindTag != null)
|
||||
// 尝试从字典中获取标签
|
||||
if (DicTags.TryGetValue(name, out var findTag))
|
||||
{
|
||||
return FindTag!.TagValue.Value;
|
||||
// 尝试转换为 ShortControlTag
|
||||
return findTag as ShortValueTag;
|
||||
}
|
||||
|
||||
return default;
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取标签的值信息
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public ITagValue<T>? GetTagInfoValueByName<T>(string name)
|
||||
{
|
||||
var FindTag = GetTagByName<T>(name);
|
||||
|
||||
// 如果找到标签,则返回其值,否则返回默认值
|
||||
if (FindTag != null)
|
||||
{
|
||||
return FindTag!.TagValue;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
return default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
using HslCommunication;
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Wpf.Models.Tag
|
||||
{
|
||||
/// <summary>
|
||||
/// Short类型的寄存器数据
|
||||
/// </summary>
|
||||
public class ByteTagValue : BindableBase, ITagValue<byte>
|
||||
{
|
||||
private byte _Value;
|
||||
/// <summary>
|
||||
/// 值
|
||||
/// </summary>
|
||||
public byte Value
|
||||
{
|
||||
get { return _Value; }
|
||||
set { _Value = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 寄存器原始数据
|
||||
/// </summary>
|
||||
public OperateResult<byte>? OperateResultSource { get; set; }
|
||||
public bool IsShow { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
using HslCommunication;
|
||||
using Prism.Mvvm;
|
||||
|
||||
namespace CapMachine.Wpf.Models.Tag
|
||||
{
|
||||
/// <summary>
|
||||
/// Short类型的寄存器数据
|
||||
/// </summary>
|
||||
public class DoubleTagValue : BindableBase, ITagValue<double>
|
||||
{
|
||||
private double _Value;
|
||||
/// <summary>
|
||||
/// 值
|
||||
/// </summary>
|
||||
public double Value
|
||||
{
|
||||
get { return _Value; }
|
||||
set { _Value = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否更新展示
|
||||
/// </summary>
|
||||
public bool IsShow { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 寄存器原始数据
|
||||
/// </summary>
|
||||
public OperateResult<double>? OperateResultSource { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
using HslCommunication;
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Wpf.Models.Tag
|
||||
{
|
||||
/// <summary>
|
||||
/// String类型的寄存器数据
|
||||
/// </summary>
|
||||
public class StringTagValue : BindableBase, ITagValue<string>
|
||||
{
|
||||
private string? _Value;
|
||||
/// <summary>
|
||||
/// 值
|
||||
/// </summary>
|
||||
public string? Value
|
||||
{
|
||||
get { return _Value; }
|
||||
set { _Value = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 寄存器原始数据
|
||||
/// </summary>
|
||||
public OperateResult<string>? OperateResultSource { get; set; }
|
||||
public bool IsShow { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user