2025-04-23 09:42:09 +08:00

164 lines
5.1 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using FreeSql.DataAnnotations;
using JiShe.CollectBus.Common.Enums;
using JiShe.CollectBus.Common.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JiShe.CollectBus.IotSystems.Watermeter
{
/// <summary>
/// 水表信息
/// </summary>
public class WatermeterInfo: DeviceCacheBasicModel
{
/// <summary>
/// 关系映射标识用于ZSet的Member字段和Set的Value字段具体值可以根据不同业务场景进行定义
/// </summary>
[Column(IsIgnore = true)]
public override string MemberId => $"{FocusAddress}:{MeteringCode}";
/// <summary>
/// ZSet排序索引分数值具体值可以根据不同业务场景进行定义例如时间戳
/// </summary>
[Column(IsIgnore = true)]
public override long ScoreValue => ((long)FocusId << 32) | (uint)DateTime.Now.Ticks;
/// <summary>
/// 水表名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 表密码
/// </summary>
public string Password { get; set; }
/// <summary>
/// 一个集中器下的[MeteringCode]必须唯一。 PN
/// </summary>
public int MeteringCode { get; set; }
/// <summary>
/// 波特率 default(2400)
/// </summary>
public int Baudrate { get; set; }
/// <summary>
/// MeteringPort 端口就几个可以枚举。
/// </summary>
public int MeteringPort { get; set; }
/// <summary>
/// 水表通信地址 (当protocol=32时Address为14位字符否则12位字符)
/// </summary>
public string MeterAddress { get; set; }
/// <summary>
/// 水表类别 (水表类型改成“公称口径”)
/// </summary>
public string TypeName { get; set; }
/// <summary>
/// 规约 -电表default(30) 197协议3007协议,32:CJ/T 188—2018协议
/// </summary>
public int? Protocol { get; set; }
public string Code { get; set; }
/// <summary>
/// 通讯方案:
/// NB-IOT常德水表、NB-IOT泽联电表、GPRS华立水表、
/// RS-485、无线、载波
/// </summary>
public string LinkType { get; set; }
/// <summary>
/// HaveValve: 是否带阀 0 不带阀, 1 带阀)
/// 注意NULL表示未设置
/// </summary>
public int? HaveValve { get; set; }
/// <summary>
/// 设备类型: 水表\气表、流量计
/// </summary>
public string MeterTypeName { get; set; }
/// <summary>
/// 表计类型
//// 电表= 1,水表= 2,燃气表= 3,热能表= 4,水表流量计=5燃气表流量计=6,特殊电表=7
/// </summary>
public MeterTypeEnum MeterType { get; set; }
/// <summary>
/// 设备品牌;
/// (当 MeterType = 水表, 如 威铭、捷先 等)
/// (当 MeterType = 流量计, 如 西恩超声波流量计、西恩电磁流量计、涡街流量计 等)
/// </summary>
public string MeterBrand { get; set; }
/// <summary>
/// 倍率
/// </summary>
public decimal TimesRate { get; set; }
/// <summary>
/// 集中器地址
/// </summary>
public string Address { get; set; }
/// <summary>
/// 网关地址
/// </summary>
public string GateAddress { get; set; }
/// <summary>
/// 集中器区域
/// </summary>
public string AreaCode { get; set; }
/// <summary>
/// 通讯状态
/// 水表TripState 0 合闸-开阀, 1 关阀);开阀关阀
/// </summary>
public int TripState { get; set; }
/// <summary>
/// 是否自动采集
/// </summary>
public int AutomaticReport { get; set; }
/// <summary>
/// State表状态:
/// 0新装未下发1运行(档案下发成功时设置状态值1) 2暂停, 100销表销表后是否重新启用
/// 特定State -1 已删除
/// </summary>
public int State { get; set; }
/// <summary>
/// 采集时间间隔(分钟如15)
/// </summary>
public int TimeDensity { get; set; }
/// <summary>
/// 采集器编号
/// </summary>
public string GatherCode { get; set; }
/// <summary>
/// 项目ID
/// </summary>
public int ProjectID { get; set; }
/// <summary>
/// 数据库业务ID
/// </summary>
public int DatabaseBusiID { get; set; }
/// <summary>
/// 是否异常集中器 0:正常1异常
/// </summary>
public int AbnormalState { get; set; }
/// <summary>
/// 集中器最后在线时间
/// </summary>
public DateTime LastTime { get; set; }
}
}