using System.Collections.Generic;
|
|
namespace IStation.DataProvider
|
{
|
/// <summary>
|
/// 泵站 数据生成器
|
/// </summary>
|
public class StationGenerator
|
{
|
|
public Dictionary<long, string> MapperDict = new Dictionary<long, string>();
|
|
|
/// <summary>
|
/// 生成
|
/// </summary>
|
public static bool Creater()
|
{
|
var signalTypes = new List<Model.SignalType>();
|
var products = new List<Model.Product>();
|
var monitorPointGroups = new List<Model.MonitorPointGroup>();
|
var monitorPointExSignalExMappings = new List<Model.MonitorPointExSignalExMapping>();
|
|
#region signalTypes
|
var signalType_瞬时流量 = new Model.SignalType
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
Name = "瞬时流量",
|
Identifier = "瞬时流量",
|
UnitType = Unit.eUnitType.流量,
|
UnitValue = "1",
|
FormatType = Model.eFormatType.Numeric,
|
FormatParas = "",
|
SortCode = 1,
|
Description = ""
|
}; signalTypes.Add(signalType_瞬时流量);
|
var signalType_累积流量 = new Model.SignalType
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
Name = "累积流量",
|
Identifier = "累积流量",
|
UnitType = Unit.eUnitType.体积,
|
UnitValue = "1",
|
FormatType = Model.eFormatType.Numeric,
|
FormatParas = "",
|
SortCode = 2,
|
Description = ""
|
}; signalTypes.Add(signalType_累积流量);
|
var signalType_压力 = new Model.SignalType
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
Name = "压力",
|
Identifier = "压力",
|
UnitType = Unit.eUnitType.压力,
|
UnitValue = "1",
|
FormatType = Model.eFormatType.Numeric,
|
FormatParas = "",
|
SortCode = 3,
|
Description = ""
|
}; signalTypes.Add(signalType_压力);
|
var signalType_水位 = new Model.SignalType
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
Name = "水位",
|
Identifier = "水位",
|
UnitType = Unit.eUnitType.长度,
|
UnitValue = "0",
|
FormatType = Model.eFormatType.Numeric,
|
FormatParas = "",
|
SortCode = 4,
|
Description = ""
|
}; signalTypes.Add(signalType_水位);
|
var signalType_扬程 = new Model.SignalType
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
Name = "扬程",
|
Identifier = "扬程",
|
UnitType = Unit.eUnitType.扬程,
|
UnitValue = "0",
|
FormatType = Model.eFormatType.Numeric,
|
FormatParas = "",
|
SortCode = 33,
|
Description = ""
|
}; signalTypes.Add(signalType_扬程);
|
var signalType_有功功率 = new Model.SignalType
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
Name = "有功功率",
|
Identifier = "有功功率",
|
UnitType = Unit.eUnitType.有功功率,
|
UnitValue = "1",
|
FormatType = Model.eFormatType.Numeric,
|
FormatParas = "",
|
SortCode = 6,
|
Description = ""
|
}; signalTypes.Add(signalType_有功功率);
|
var signalType_频率 = new Model.SignalType
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
|
Name = "频率",
|
Identifier = "频率",
|
UnitType = Unit.eUnitType.频率,
|
UnitValue = "0",
|
FormatType = Model.eFormatType.Numeric,
|
FormatParas = "",
|
SortCode = 9,
|
Description = ""
|
}; signalTypes.Add(signalType_频率);
|
var signalType_转速 = new Model.SignalType
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
|
Name = "转速",
|
Identifier = "转速",
|
UnitType = Unit.eUnitType.转速,
|
UnitValue = "0",
|
FormatType = Model.eFormatType.Numeric,
|
FormatParas = "",
|
SortCode = 10,
|
Description = ""
|
}; signalTypes.Add(signalType_转速);
|
var signalType_有功电度 = new Model.SignalType
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
|
Name = "有功电度",
|
Identifier = "有功电度",
|
UnitType = Unit.eUnitType.有功电度,
|
UnitValue = "0",
|
FormatType = Model.eFormatType.Numeric,
|
FormatParas = "",
|
SortCode = 11,
|
Description = ""
|
}; signalTypes.Add(signalType_有功电度);
|
var valueSettings_设备 = new Dictionary<int, string>
|
{
|
{ -2, "未知" },
|
{ -1, "故障" },
|
{ 0, "停机" },
|
{ 1, "开机" },
|
{ 2, "工频" },
|
{ 3, "变频" }
|
};
|
var signalType_运行状态 = new Model.SignalType
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
|
Name = "运行状态",
|
Identifier = "运行状态",
|
UnitType = (0),
|
UnitValue = "",
|
FormatType = Model.eFormatType.Enum,
|
FormatParas = JsonHelper.Object2Json(valueSettings_设备),
|
SortCode = 13,
|
Description = ""
|
}; signalTypes.Add(signalType_运行状态);
|
var signalType_电流 = new Model.SignalType
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
|
Name = "电流",
|
Identifier = "电流",
|
UnitType = Unit.eUnitType.电流,
|
UnitValue = "0",
|
FormatType = Model.eFormatType.Numeric,
|
FormatParas = "",
|
SortCode = 16,
|
Description = ""
|
}; signalTypes.Add(signalType_电流);
|
var signalType_电压 = new Model.SignalType
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
Name = "电压",
|
Identifier = "电压",
|
UnitType = Unit.eUnitType.电压,
|
UnitValue = "0",
|
FormatType = Model.eFormatType.Numeric,
|
FormatParas = "",
|
SortCode = 17,
|
Description = ""
|
}; signalTypes.Add(signalType_电压);
|
var signalType_温度 = new Model.SignalType
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
GroupID = 9,
|
Name = "温度",
|
Identifier = "温度",
|
UnitType = Unit.eUnitType.温度,
|
UnitValue = "0",
|
FormatType = Model.eFormatType.Numeric,
|
FormatParas = "",
|
SortCode = 22,
|
Description = ""
|
}; signalTypes.Add(signalType_温度);
|
var signalType_浊度 = new Model.SignalType
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
GroupID = 9,
|
Name = "浊度",
|
Identifier = "浊度",
|
UnitType = Unit.eUnitType.浊度,
|
UnitValue = "0",
|
FormatType = Model.eFormatType.Numeric,
|
FormatParas = "",
|
SortCode = 23,
|
Description = ""
|
}; signalTypes.Add(signalType_浊度);
|
var signalType_余氯 = new Model.SignalType
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
GroupID = 9,
|
Name = "余氯",
|
Identifier = "余氯",
|
UnitType = Unit.eUnitType.浓度,
|
UnitValue = "0",
|
FormatType = Model.eFormatType.Numeric,
|
FormatParas = "",
|
SortCode = 24,
|
Description = ""
|
}; signalTypes.Add(signalType_余氯);
|
var signalType_湿度 = new Model.SignalType
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
GroupID = 9,
|
Name = "湿度",
|
Identifier = "湿度",
|
UnitType = Unit.eUnitType.湿度,
|
UnitValue = "0",
|
FormatType = Model.eFormatType.Numeric,
|
FormatParas = "",
|
SortCode = 25,
|
Description = ""
|
}; signalTypes.Add(signalType_湿度);
|
var signalType_PH = new Model.SignalType
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
GroupID = 9,
|
Name = "PH",
|
Identifier = "PH",
|
UnitType = Unit.eUnitType.自定义,
|
UnitValue = "",
|
FormatType = Model.eFormatType.Numeric,
|
FormatParas = "",
|
SortCode = 26,
|
Description = ""
|
}; signalTypes.Add(signalType_PH);
|
var signalType_溶解氧 = new Model.SignalType
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
GroupID = 9,
|
Name = "溶解氧",
|
Identifier = "溶解氧",
|
UnitType = Unit.eUnitType.浓度,
|
UnitValue = "0",
|
FormatType = Model.eFormatType.Numeric,
|
FormatParas = "",
|
SortCode = 27,
|
Description = ""
|
}; signalTypes.Add(signalType_溶解氧);
|
var signalType_音量 = new Model.SignalType
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
GroupID = 9,
|
Name = "音量",
|
Identifier = "音量",
|
UnitType = Unit.eUnitType.音量,
|
UnitValue = "0",
|
FormatType = Model.eFormatType.Numeric,
|
FormatParas = "",
|
SortCode = 28,
|
Description = ""
|
}; signalTypes.Add(signalType_音量);
|
var valueSettings_阀门 = new Dictionary<int, string>
|
{
|
{ 0, "关" },
|
{ 1, "开" },
|
{ 2, "中间" }
|
};
|
var signalType_阀门状态 = new Model.SignalType
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
|
Name = "阀门状态",
|
Identifier = "阀门状态",
|
UnitType = (0),
|
UnitValue = "",
|
FormatType = Model.eFormatType.Enum,
|
FormatParas = JsonHelper.Object2Json(valueSettings_阀门),
|
SortCode = 29,
|
Description = ""
|
}; signalTypes.Add(signalType_阀门状态);
|
var signalType_阀门开度 = new Model.SignalType
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
|
Name = "阀门开度",
|
Identifier = "阀门开度",
|
UnitType = Unit.eUnitType.自定义,
|
UnitValue = "",
|
FormatType = Model.eFormatType.Numeric,
|
FormatParas = "",
|
SortCode = 30,
|
Description = ""
|
}; signalTypes.Add(signalType_阀门开度);
|
#endregion
|
|
var station = new Model.Station()
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
Name = "陈行二取水",
|
SortCode = 1,
|
};
|
|
var monitor_长江液位 = new Model.MonitorPointExSignalExMapping
|
{
|
MonitorPointID = SnowflakeIdHelper.NextId(),
|
SignalID = SnowflakeIdHelper.NextId(),
|
Name = "长江液位",
|
|
BelongType = IStation.ObjectType.Station,
|
BelongID = station.ID,
|
SourceType = Model.eSourceType.Docking,
|
SourceParas = string.Empty,
|
Flags = new List<string>() { IStation.Flags.进口 },
|
TagName = "_0402010205002020001",
|
UseStatus = Model.MonitorPoint.eUseStatus.Enable,
|
SortCode = 1,
|
|
SignalTypeID = signalType_水位.ID,
|
MeasureParas = string.Empty,
|
SignalSourceParas = string.Empty,
|
|
MappingSelfID = SnowflakeIdHelper.NextId(),
|
MappingType = IStation.ObjectType.Station,
|
MappingID = station.ID
|
}; monitorPointExSignalExMappings.Add(monitor_长江液位);
|
|
var monitor_取水口液位 = new Model.MonitorPointExSignalExMapping
|
{
|
MonitorPointID = SnowflakeIdHelper.NextId(),
|
SignalID = SnowflakeIdHelper.NextId(),
|
Name = "取水口液位",
|
|
BelongType = IStation.ObjectType.Station,
|
BelongID = station.ID,
|
SourceType = Model.eSourceType.Docking,
|
SourceParas = string.Empty,
|
Flags = new List<string>() { IStation.Flags.进口 },
|
TagName = "_0402010204089903001",
|
UseStatus = Model.MonitorPoint.eUseStatus.Enable,
|
SortCode = 1,
|
|
SignalTypeID = signalType_水位.ID,
|
MeasureParas = string.Empty,
|
SignalSourceParas = string.Empty,
|
|
MappingSelfID = SnowflakeIdHelper.NextId(),
|
MappingType = IStation.ObjectType.Station,
|
MappingID = station.ID
|
}; monitorPointExSignalExMappings.Add(monitor_取水口液位);
|
|
var monitor_水库水位 = new Model.MonitorPointExSignalExMapping
|
{
|
MonitorPointID = SnowflakeIdHelper.NextId(),
|
SignalID = SnowflakeIdHelper.NextId(),
|
Name = "水库水位",
|
|
BelongType = IStation.ObjectType.Station,
|
BelongID = station.ID,
|
SourceType = Model.eSourceType.Docking,
|
SourceParas = string.Empty,
|
Flags = new List<string>() { IStation.Flags.出口 },
|
TagName = "_0402010201030103006",
|
UseStatus = Model.MonitorPoint.eUseStatus.Enable,
|
SortCode = 1,
|
|
SignalTypeID = signalType_水位.ID,
|
MeasureParas = string.Empty,
|
SignalSourceParas = string.Empty,
|
|
MappingSelfID = SnowflakeIdHelper.NextId(),
|
MappingType = IStation.ObjectType.Station,
|
MappingID = station.ID
|
}; monitorPointExSignalExMappings.Add(monitor_水库水位);
|
|
var monitor_前池液位 = new Model.MonitorPointExSignalExMapping
|
{
|
MonitorPointID = SnowflakeIdHelper.NextId(),
|
SignalID = SnowflakeIdHelper.NextId(),
|
Name = "前池液位",
|
|
BelongType = IStation.ObjectType.Station,
|
BelongID = station.ID,
|
SourceType = Model.eSourceType.Docking,
|
SourceParas = string.Empty,
|
Flags = new List<string>() { IStation.Flags.进口 },
|
TagName = "_0402010204089904009",
|
UseStatus = Model.MonitorPoint.eUseStatus.Enable,
|
SortCode = 1,
|
|
SignalTypeID = signalType_水位.ID,
|
MeasureParas = string.Empty,
|
SignalSourceParas = string.Empty,
|
|
MappingSelfID = SnowflakeIdHelper.NextId(),
|
MappingType = IStation.ObjectType.Station,
|
MappingID = station.ID
|
}; monitorPointExSignalExMappings.Add(monitor_前池液位);
|
|
var monitor_1号进线累计有功电能 = new Model.MonitorPointExSignalExMapping
|
{
|
MonitorPointID = SnowflakeIdHelper.NextId(),
|
SignalID = SnowflakeIdHelper.NextId(),
|
Name = "1号进线累计有功电能",
|
|
BelongType = IStation.ObjectType.Station,
|
BelongID = station.ID,
|
SourceType = Model.eSourceType.Docking,
|
SourceParas = string.Empty,
|
Flags = new List<string>(),
|
TagName = "_0402010204040193043",
|
UseStatus = Model.MonitorPoint.eUseStatus.Enable,
|
SortCode = 1,
|
|
SignalTypeID = signalType_有功电度.ID,
|
MeasureParas = string.Empty,
|
SignalSourceParas = string.Empty,
|
|
MappingSelfID = SnowflakeIdHelper.NextId(),
|
MappingType = IStation.ObjectType.Station,
|
MappingID = station.ID
|
}; monitorPointExSignalExMappings.Add(monitor_1号进线累计有功电能);
|
|
var monitor_2号进线累计有功电能 = new Model.MonitorPointExSignalExMapping
|
{
|
MonitorPointID = SnowflakeIdHelper.NextId(),
|
SignalID = SnowflakeIdHelper.NextId(),
|
Name = "2号进线累计有功电能",
|
|
BelongType = IStation.ObjectType.Station,
|
BelongID = station.ID,
|
SourceType = Model.eSourceType.Docking,
|
SourceParas = string.Empty,
|
Flags = new List<string>(),
|
TagName = "_0402010204040293027",
|
UseStatus = Model.MonitorPoint.eUseStatus.Enable,
|
SortCode = 1,
|
|
SignalTypeID = signalType_有功电度.ID,
|
MeasureParas = string.Empty,
|
SignalSourceParas = string.Empty,
|
|
MappingSelfID = SnowflakeIdHelper.NextId(),
|
MappingType = IStation.ObjectType.Station,
|
MappingID = station.ID
|
}; monitorPointExSignalExMappings.Add(monitor_2号进线累计有功电能);
|
|
|
for (int i = 1; i <= 5; i++)
|
{
|
#region products
|
var enginePump = new Model.Product
|
{
|
ID = 100 + i,
|
BelongType = IStation.ObjectType.Station,
|
BelongID = station.ID,
|
Catalog = IStation.Product.EnginePump,
|
GroupID = 0,
|
Supplier = "湖南长沙水泵",
|
ParentIds = new List<long>(),
|
NO = "新" + i + " #",
|
Name = i + " #机组",
|
ModelType = "96LKXA-8.2",
|
Specification = string.Empty,
|
RatedParas = new Model.EnginePump().ToJson(),
|
UnitName = string.Empty,
|
Quantity = 1,
|
Flags = new List<string>(),
|
TagName = "",
|
UseStatus = Model.Product.eUseStatus.Enable,
|
SortCode = i,
|
Description = string.Empty
|
};
|
|
var pump = new Model.Product
|
{
|
ID = i,
|
BelongType = IStation.ObjectType.Station,
|
BelongID = station.ID,
|
Catalog = IStation.Product.Pump,
|
GroupID = 0,
|
Supplier = "湖南长沙水泵",
|
ParentIds = new List<long>() { enginePump.ID },
|
NO = "新" + i + " #",
|
Name = i + " #泵",
|
ModelType = "96LKXA-8.2",
|
Specification = string.Empty,
|
RatedParas = new Model.Pump()
|
{
|
Qr = 46260,
|
Hr = 8.2,
|
Nr = 245,
|
Pr = 1177.3,
|
Er = 87.8,
|
NPSHr = 0,
|
StNumr = 1,
|
Ic = null,
|
Oc = 2400,
|
IOd = null,
|
IsBp = false,
|
IsSxp = false
|
}.ToJson(),
|
UnitName = "台",
|
Quantity = 1,
|
Flags = new List<string>(),
|
TagName = "",
|
UseStatus = Model.Product.eUseStatus.Enable,
|
SortCode = 1,
|
Description = string.Empty
|
};
|
|
var motor = new Model.Product
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
BelongType = IStation.ObjectType.Station,
|
BelongID = station.ID,
|
Catalog = IStation.Product.Motor,
|
GroupID = 0,
|
Supplier = "湖南长沙水泵",
|
ParentIds = new List<long>() { enginePump.ID },
|
NO = "新" + i + " #",
|
Name = i + " #电机",
|
ModelType = "96LKXA-8.2",
|
Specification = string.Empty,
|
RatedParas = new Model.Motor()
|
{
|
Er = 0,
|
Ir = 0,
|
Nr = 0,
|
Pr = 0
|
}.ToJson(),
|
UnitName = "台",
|
Quantity = 1,
|
Flags = new List<string>(),
|
TagName = "",
|
UseStatus = Model.Product.eUseStatus.Enable,
|
SortCode = 1,
|
Description = string.Empty
|
};
|
|
products.Add(enginePump);
|
products.Add(pump);
|
products.Add(motor);
|
#endregion
|
|
var monitorPointGroup = new Model.MonitorPointGroup
|
{
|
ID = SnowflakeIdHelper.NextId(),
|
BelongType = IStation.ObjectType.Station,
|
BelongID = station.ID,
|
ParentIds = new List<long>(),
|
Name = i + "#机组",
|
Flags = null,
|
TagName = string.Empty,
|
SortCode = i,
|
Description = string.Empty
|
};
|
monitorPointGroups.Add(monitorPointGroup);
|
|
#region monitorPointExSignalExMappings
|
var monitor_运行状态 = new Model.MonitorPointExSignalExMapping
|
{
|
MonitorPointID = SnowflakeIdHelper.NextId(),
|
SignalID = SnowflakeIdHelper.NextId(),
|
Name = "运行状态",
|
|
GroupID = monitorPointGroup.ID,
|
BelongType = IStation.ObjectType.Station,
|
BelongID = station.ID,
|
SourceType = Model.eSourceType.Docking,
|
SourceParas = string.Empty,
|
Flags = new List<string>(),
|
TagName = $"_0402010204012{i}01001",
|
UseStatus = Model.MonitorPoint.eUseStatus.Enable,
|
SortCode = 1,
|
|
SignalTypeID = signalType_运行状态.ID,
|
MeasureParas = string.Empty,
|
SignalSourceParas = string.Empty,
|
|
MappingSelfID = SnowflakeIdHelper.NextId(),
|
MappingType = IStation.ObjectType.Product,
|
MappingID = enginePump.ID
|
}; monitorPointExSignalExMappings.Add(monitor_运行状态);
|
|
var monitor_出口压力 = new Model.MonitorPointExSignalExMapping
|
{
|
MonitorPointID = SnowflakeIdHelper.NextId(),
|
SignalID = SnowflakeIdHelper.NextId(),
|
Name = "出口压力",
|
|
GroupID = monitorPointGroup.ID,
|
BelongType = IStation.ObjectType.Station,
|
BelongID = station.ID,
|
SourceType = Model.eSourceType.Docking,
|
SourceParas = string.Empty,
|
Flags = new List<string>() { IStation.Flags.出口 },
|
TagName = $"_0402010204012{i}05001",
|
UseStatus = Model.MonitorPoint.eUseStatus.Enable,
|
SortCode = 1,
|
|
SignalTypeID = signalType_压力.ID,
|
MeasureParas = string.Empty,
|
SignalSourceParas = string.Empty,
|
|
MappingSelfID = SnowflakeIdHelper.NextId(),
|
MappingType = IStation.ObjectType.Product,
|
MappingID = enginePump.ID
|
}; monitorPointExSignalExMappings.Add(monitor_出口压力);
|
|
var monitor_出水累计流量 = new Model.MonitorPointExSignalExMapping
|
{
|
MonitorPointID = SnowflakeIdHelper.NextId(),
|
SignalID = SnowflakeIdHelper.NextId(),
|
Name = "出水累计流量",
|
|
GroupID = monitorPointGroup.ID,
|
BelongType = IStation.ObjectType.Station,
|
BelongID = station.ID,
|
SourceType = Model.eSourceType.Docking,
|
SourceParas = string.Empty,
|
Flags = new List<string>(),
|
TagName = $"_0402010204012{i}03002",
|
UseStatus = Model.MonitorPoint.eUseStatus.Enable,
|
SortCode = 1,
|
|
SignalTypeID = signalType_累积流量.ID,
|
MeasureParas = string.Empty,
|
SignalSourceParas = string.Empty,
|
|
MappingSelfID = SnowflakeIdHelper.NextId(),
|
MappingType = IStation.ObjectType.Product,
|
MappingID = enginePump.ID
|
}; monitorPointExSignalExMappings.Add(monitor_出水累计流量);
|
|
var monitor_出水瞬时流量 = new Model.MonitorPointExSignalExMapping
|
{
|
MonitorPointID = SnowflakeIdHelper.NextId(),
|
SignalID = SnowflakeIdHelper.NextId(),
|
Name = "出水瞬时流量",
|
|
GroupID = monitorPointGroup.ID,
|
BelongType = IStation.ObjectType.Station,
|
BelongID = station.ID,
|
SourceType = Model.eSourceType.Docking,
|
SourceParas = string.Empty,
|
Flags = new List<string>(),
|
TagName = $"_0402010204012{i}03001",
|
UseStatus = Model.MonitorPoint.eUseStatus.Enable,
|
SortCode = 1,
|
|
SignalTypeID = signalType_瞬时流量.ID,
|
MeasureParas = string.Empty,
|
SignalSourceParas = string.Empty,
|
|
MappingSelfID = SnowflakeIdHelper.NextId(),
|
MappingType = IStation.ObjectType.Product,
|
MappingID = enginePump.ID
|
}; monitorPointExSignalExMappings.Add(monitor_出水瞬时流量);
|
|
var monitor_瞬时功率 = new Model.MonitorPointExSignalExMapping
|
{
|
MonitorPointID = SnowflakeIdHelper.NextId(),
|
SignalID = SnowflakeIdHelper.NextId(),
|
Name = "瞬时功率",
|
|
GroupID = monitorPointGroup.ID,
|
BelongType = IStation.ObjectType.Station,
|
BelongID = station.ID,
|
SourceType = Model.eSourceType.Docking,
|
SourceParas = string.Empty,
|
Flags = new List<string>(),
|
TagName = $"_0402010204012{i}08008",
|
UseStatus = Model.MonitorPoint.eUseStatus.Enable,
|
SortCode = 1,
|
|
SignalTypeID = signalType_有功功率.ID,
|
MeasureParas = string.Empty,
|
SignalSourceParas = string.Empty,
|
|
MappingSelfID = SnowflakeIdHelper.NextId(),
|
MappingType = IStation.ObjectType.Product,
|
MappingID = enginePump.ID
|
}; monitorPointExSignalExMappings.Add(monitor_瞬时功率);
|
|
var monitor_累计总电能 = new Model.MonitorPointExSignalExMapping
|
{
|
MonitorPointID = SnowflakeIdHelper.NextId(),
|
SignalID = SnowflakeIdHelper.NextId(),
|
Name = "累计总电能",
|
|
GroupID = monitorPointGroup.ID,
|
BelongType = IStation.ObjectType.Station,
|
BelongID = station.ID,
|
SourceType = Model.eSourceType.Docking,
|
SourceParas = string.Empty,
|
Flags = new List<string>(),
|
TagName = $"_0402010204012{i}08007",
|
UseStatus = Model.MonitorPoint.eUseStatus.Enable,
|
SortCode = 1,
|
|
SignalTypeID = signalType_有功电度.ID,
|
MeasureParas = string.Empty,
|
SignalSourceParas = string.Empty,
|
|
MappingSelfID = SnowflakeIdHelper.NextId(),
|
MappingType = IStation.ObjectType.Product,
|
MappingID = enginePump.ID
|
}; monitorPointExSignalExMappings.Add(monitor_累计总电能);
|
|
if (i == 1)
|
{
|
monitor_瞬时功率.TagName = "_0402010204040193004";
|
monitor_累计总电能.TagName = "_0402010204040193046";
|
}
|
else if (i == 2)
|
{
|
monitor_累计总电能.TagName = "_0402010204040193047";
|
}
|
|
|
var monitor_进口压力 = new Model.MonitorPointExSignalExMapping
|
{
|
MonitorPointID = SnowflakeIdHelper.NextId(),
|
SignalID = SnowflakeIdHelper.NextId(),
|
Name = "进口压力(分析)",
|
|
GroupID = monitorPointGroup.ID,
|
BelongType = IStation.ObjectType.Station,
|
BelongID = station.ID,
|
SourceType = Model.eSourceType.Analyse,
|
SourceParas = string.Empty,
|
Flags = new List<string>() { IStation.Flags.进口 },
|
TagName = $"{monitor_前池液位.TagName}",
|
UseStatus = Model.MonitorPoint.eUseStatus.Enable,
|
SortCode = 1,
|
|
SignalTypeID = signalType_压力.ID,
|
MeasureParas = string.Empty,
|
SignalSourceParas = string.Empty,
|
|
MappingSelfID = SnowflakeIdHelper.NextId(),
|
MappingType = IStation.ObjectType.Product,
|
MappingID = enginePump.ID
|
}; monitorPointExSignalExMappings.Add(monitor_进口压力);
|
#endregion
|
}
|
|
if (!new BLL.SignalType().Covers(signalTypes))
|
{
|
return false;
|
};
|
if (!new BLL.Station().Covers(new List<Model.Station>() { station }))
|
{
|
return false;
|
};
|
if (!new BLL.Product().Covers(products))
|
{
|
return false;
|
};
|
|
if (!new BLL.MonitorPointGroup().Covers(monitorPointGroups))
|
{
|
return false;
|
};
|
|
if (!new BLL.MonitorPoint().CoverEx(monitorPointExSignalExMappings))
|
{
|
return false;
|
};
|
return true;
|
}
|
|
|
|
}
|
}
|