添加项目文件。
This commit is contained in:
126
OrpaonEMS.App/Models/DataCell.cs
Normal file
126
OrpaonEMS.App/Models/DataCell.cs
Normal file
@@ -0,0 +1,126 @@
|
||||
using OrpaonEMS.Core.Enums;
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrpaonEMS.App.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 布尔类型数据单元
|
||||
/// </summary>
|
||||
public class DataCell : BindableBase
|
||||
{
|
||||
|
||||
private short _SrRtValue;
|
||||
/// <summary>
|
||||
/// 标签原始的实时值
|
||||
/// </summary>
|
||||
public short SrRtValue
|
||||
{
|
||||
set
|
||||
{
|
||||
if (_SrRtValue != value)
|
||||
{
|
||||
_SrRtValue = value;
|
||||
RtValue = (value + Offset);
|
||||
}
|
||||
|
||||
//LastUpdateTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private double _RtValue;
|
||||
/// <summary>
|
||||
/// 标签实时值
|
||||
/// </summary>
|
||||
public double RtValue
|
||||
{
|
||||
get { return _RtValue; }
|
||||
set
|
||||
{
|
||||
_RtValue = value;
|
||||
if (IsUI)
|
||||
{
|
||||
RaisePropertyChanged();
|
||||
}
|
||||
//if (PopValue != null)
|
||||
//{
|
||||
// PopValue(Name, value);
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 偏移值
|
||||
/// </summary>
|
||||
public int Offset { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 分辨率
|
||||
/// </summary>
|
||||
public double Ratio { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 读写类型
|
||||
/// </summary>
|
||||
public IOType IoTypeInfo { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Index 连续区域的位置
|
||||
/// </summary>
|
||||
public int Index { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Index 连续区域的位置基础基数
|
||||
/// </summary>
|
||||
public int Base { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 值长度
|
||||
/// </summary>
|
||||
public int Lengh { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址标签
|
||||
/// </summary>
|
||||
public string? Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标签名称
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位
|
||||
/// </summary>
|
||||
public string? Unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否关注这个数据,比如关注后,那么就在界面上展示,此时RaisePropertyChanged()就会被使能,单独在界面上展示否则就可以在表格里面展示
|
||||
/// </summary>
|
||||
public bool IsUI { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 当前数据的范围
|
||||
/// </summary>
|
||||
public ValueRange? ValueRangeInfo { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// Tag状态
|
||||
///// </summary>
|
||||
//public bool TagLinkState { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 上次更新时间信息
|
||||
///// </summary>
|
||||
//public DateTime LastUpdateTime { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user