天津投入产出系统后端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

178 lines
4.5 KiB

using System;
using QMAPP.Entity;
using QMFrameWork.Data.Attributes;
using System.Data;
namespace QMAPP.FJC.Entity.EnergyManage
{
[DBTable(TableName = "T_EM_METER")]
public class Meter : BaseEntity
{
///<summary>
///主键
///</summary>
[DBColumn(ColumnName = "PID", DataType = DbType.String, IsKey = true)]
public string PID { get; set; }
///<summary>
///能源表编码
///</summary>
[DBColumn(ColumnName = "METER_CODE", DataType = DbType.String)]
public string METER_CODE { get; set; }
///<summary>
///能源表名称
/// 临时存设备名
///</summary>
[DBColumn(ColumnName = "METER_NAME", DataType = DbType.String)]
public string METER_NAME { get; set; }
///<summary>
///能源表类型
///</summary>
[DBColumn(ColumnName = "METER_TYPE", DataType = DbType.String)]
public string METER_TYPE { get; set; }
public string METER_TYPE_TXT { get; set; }
///<summary>
///能源表网络地址
///</summary>
[DBColumn(ColumnName = "NET_ADDR", DataType = DbType.String)]
public string NET_ADDR { get; set; }
///<summary>
///能源表网络标识
///</summary>
[DBColumn(ColumnName = "NET_ID", DataType = DbType.String)]
public string NET_ID { get; set; }
///<summary>
///获取方式 1 自动 2 手动
///</summary>
[DBColumn(ColumnName = "STATE", DataType = DbType.String)]
public string STATE { get; set; }
public string STATE_TXT { get; set; }
///<summary>
///工厂编码
///</summary>
[DBColumn(ColumnName = "FACTORY_CODE", DataType = DbType.String)]
public string FACTORY_CODE { get; set; }
///<summary>
///设备编码
///</summary>
[DBColumn(ColumnName = "EQPT_CODE", DataType = DbType.String)]
public string EQPT_CODE { get; set; }
public string MACHINENAME { get; set; }
///<summary>
///互感器倍率
///</summary>
[DBColumn(ColumnName = "RATIO", DataType = DbType.String)]
public Double RATIO { get; set; }
public string CONSUME { get; set; }
public string WORKCENTER_CODE { get; set; }
public DateTime ONLINETIMESTART;
public DateTime ONLINETIMEEND;
public string EQPT_NAME { get; set; }
#region 电表扩展属性
/// <summary>
/// 电表系统号
/// </summary>
public Int16 SysNum
{
get
{
if (NET_ID != null)
{
string[] MeterAddr = NET_ID.Split(',');
if (MeterAddr.Length > 0)
return Int16.Parse(MeterAddr[0]);
}
return 0;
}
}
/// <summary>
/// 电表号
/// </summary>
public Int16 MeterNum
{
get
{
if (NET_ID != null)
{
string[] MeterAddr = NET_ID.Split(',');
if (MeterAddr.Length > 1)
return Int16.Parse(MeterAddr[1]);
}
return 0;
}
}
/// <summary>
/// 用户号
/// </summary>
public byte UserNum
{
get
{
if (NET_ID != null)
{
string[] MeterAddr = NET_ID.Split(',');
if (MeterAddr.Length > 2)
return byte.Parse(MeterAddr[2]);
}
return 0;
}
}
/// <summary>
/// IP地址
/// </summary>
public string IPAddr
{
get
{
if (NET_ADDR!=null)
{
string[] NET_ADDRArray = NET_ADDR.Split(':');
if (NET_ADDRArray.Length > 0)
return NET_ADDRArray[0];
}
return "0";
}
}
/// <summary>
/// 端口号
/// </summary>
public int Port
{
get
{
if (NET_ADDR != null)
{
string[] NET_ADDRArray = NET_ADDR.Split(':');
if (NET_ADDRArray.Length > 1)
return int.Parse(NET_ADDRArray[1]);
}
return 0;
}
}
#endregion
}
}