三相表断闸合闸
This commit is contained in:
parent
e02a0953e9
commit
e0c7ceab32
@ -104,11 +104,14 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
//[Route($"ammeter/list")]
|
//[Route($"ammeter/list")]
|
||||||
public override async Task<List<DeviceInfo>> GetAmmeterInfoList(string gatherCode = "V4-Gather-8890")
|
public override async Task<List<DeviceInfo>> GetAmmeterInfoList(string gatherCode = "V4-Gather-8890")
|
||||||
{
|
{
|
||||||
//442400040
|
#if DEBUG
|
||||||
//442400039
|
var redisCacheDeviceInfoHashKeyTemp = $"CollectBus:Energy:JiSheCollectBus109:DeviceInfo";
|
||||||
|
|
||||||
List<DeviceInfo> ammeterInfos = new List<DeviceInfo>();
|
List<DeviceInfo> ammeterInfos = FreeRedisProvider.Instance.Get<List<DeviceInfo>>(redisCacheDeviceInfoHashKeyTemp);
|
||||||
|
|
||||||
|
if (ammeterInfos == null || ammeterInfos.Count <= 0)
|
||||||
|
{
|
||||||
|
ammeterInfos = new List<DeviceInfo>();
|
||||||
ammeterInfos.Add(new DeviceInfo()
|
ammeterInfos.Add(new DeviceInfo()
|
||||||
{
|
{
|
||||||
Baudrate = 2400,
|
Baudrate = 2400,
|
||||||
@ -116,11 +119,11 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
Name = "保利单箱电表1",
|
Name = "保利单箱电表1",
|
||||||
FocusId = 95780,
|
FocusId = 95780,
|
||||||
DatabaseBusiID = 1,
|
DatabaseBusiID = 1,
|
||||||
MeteringCode = 1,
|
MeteringCode = 0,
|
||||||
MeterAddress = "442405000040",
|
MeterAddress = "442405000040",
|
||||||
MeterId = 127035,
|
MeterId = 127035,
|
||||||
TypeName = 1,
|
TypeName = 1,
|
||||||
DataTypes = "449,503,581,582,583,584,585,586,587,588,589,590,591,592,593,594,597,598,599,600,601,602,603,604,605,606,607,608,661,663,677,679",
|
DataTypes = "581,589,592,597,601",
|
||||||
TimeDensity = 15,
|
TimeDensity = 15,
|
||||||
BrandType = "DTS1980",
|
BrandType = "DTS1980",
|
||||||
MeterType = MeterTypeEnum.Ammeter,
|
MeterType = MeterTypeEnum.Ammeter,
|
||||||
@ -136,11 +139,11 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
Name = "保利单箱电表2",
|
Name = "保利单箱电表2",
|
||||||
FocusId = 69280,
|
FocusId = 69280,
|
||||||
DatabaseBusiID = 1,
|
DatabaseBusiID = 1,
|
||||||
MeteringCode = 1,
|
MeteringCode = 0,
|
||||||
MeterAddress = "442405000039",
|
MeterAddress = "442405000039",
|
||||||
MeterId = 95594,
|
MeterId = 95594,
|
||||||
TypeName = 1,
|
TypeName = 1,
|
||||||
DataTypes = "449,503,581,582,583,584,585,586,587,588,589,590,591,592,593,594,597,598,599,600,601,602,603,604,605,606,607,608,661,663,677,679",
|
DataTypes = "581,589,592,597,601",
|
||||||
TimeDensity = 15,
|
TimeDensity = 15,
|
||||||
BrandType = "DTS1980",
|
BrandType = "DTS1980",
|
||||||
MeterType = MeterTypeEnum.Ammeter,
|
MeterType = MeterTypeEnum.Ammeter,
|
||||||
@ -149,39 +152,32 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
Password = "000000",
|
Password = "000000",
|
||||||
});
|
});
|
||||||
|
|
||||||
//ammeterInfos.Add(new DeviceInfo()
|
ammeterInfos.Add(new DeviceInfo()
|
||||||
//{
|
{
|
||||||
// Baudrate = 2400,
|
Baudrate = 2400,
|
||||||
// FocusAddress = "402440506",
|
FocusAddress = "402440506",
|
||||||
// Name = "张家祠工务(三相电表)",
|
Name = "中环半导体9#冷却泵-220KW(三相电表)",
|
||||||
// FocusId = 95780,
|
FocusId = 106857,
|
||||||
// DatabaseBusiID = 1,
|
DatabaseBusiID = 1,
|
||||||
// MeteringCode = 1,
|
MeteringCode = 0,
|
||||||
// MeterAddress = "402410040506",
|
MeterAddress = "402410040506",
|
||||||
// MeterId = 127035,
|
MeterId = 139059,
|
||||||
// TypeName = 3,
|
TypeName = 3,
|
||||||
// DataTypes = "449,503,581,582,583,584,585,586,587,588,589,590,591,592,593,594,597,598,599,600,601,602,603,604,605,606,607,608,661,663,677,679",
|
DataTypes = "449,503,581,582,583,584,585,586,587,588,589,590,591,592,593,594,597,598,599,600,601,602,603,604,605,606,607,608,661,663,677,679",
|
||||||
// TimeDensity = 15,
|
TimeDensity = 15,
|
||||||
// BrandType = "DDS1980",
|
BrandType = "DTS1980",
|
||||||
//});
|
Password = "000000",
|
||||||
|
ProjectID = 1,
|
||||||
|
MeterType = MeterTypeEnum.Ammeter,
|
||||||
|
MeteringPort = MeteringPortConst.MeteringPortTwo,
|
||||||
|
});
|
||||||
|
|
||||||
//ammeterInfos.Add(new DeviceInfo()
|
|
||||||
//{
|
FreeRedisProvider.Instance.Set(redisCacheDeviceInfoHashKeyTemp,ammeterInfos);
|
||||||
// Baudrate = 2400,
|
}
|
||||||
// FocusAddress = "542400504",
|
|
||||||
// Name = "五号配(长芦二所四排)(单相电表)",
|
|
||||||
// FocusId = 69280,
|
|
||||||
// DatabaseBusiID = 1,
|
|
||||||
// MeteringCode = 2,
|
|
||||||
// MeterAddress = "542410000504",
|
|
||||||
// MeterId = 95594,
|
|
||||||
// TypeName = 1,
|
|
||||||
// DataTypes = "581,589,592,597,601",
|
|
||||||
// TimeDensity = 15,
|
|
||||||
// BrandType = "DDS1980",
|
|
||||||
//});
|
|
||||||
|
|
||||||
return ammeterInfos;
|
return ammeterInfos;
|
||||||
|
#else
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -232,6 +228,8 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
{
|
{
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -288,40 +286,55 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
if (settingInfos == null || settingInfos.Count <= 0)
|
if (settingInfos == null || settingInfos.Count <= 0)
|
||||||
{
|
{
|
||||||
settingInfos = new List<AmmeterAutoValveControlSetting>();
|
settingInfos = new List<AmmeterAutoValveControlSetting>();
|
||||||
settingInfos.Add(new AmmeterAutoValveControlSetting()
|
//settingInfos.Add(new AmmeterAutoValveControlSetting()
|
||||||
{
|
//{
|
||||||
MeterType = MeterTypeEnum.Ammeter,
|
// MeterType = MeterTypeEnum.Ammeter,
|
||||||
AmmerterAddress = "442405000040",
|
// AmmerterAddress = "442405000040",
|
||||||
FocusAddress = "442400040",
|
// FocusAddress = "442400040",
|
||||||
FocusId = 95780,
|
// FocusId = 95780,
|
||||||
ProjectID = 1,
|
// ProjectID = 1,
|
||||||
TripType = "on",
|
// TripType = "on",
|
||||||
TripTime = $"{DateTime.Now:HH:mm}",
|
// TripTime = $"{DateTime.Now:HH:mm}",
|
||||||
MeterId = 127035,
|
// MeterId = 127035,
|
||||||
LoopType = "EachDay",
|
// LoopType = "EachDay",
|
||||||
EachDayWithout = "周六,周日",
|
// EachDayWithout = "周六,周日",
|
||||||
TimeDensity = 15,
|
// TimeDensity = 15,
|
||||||
});
|
//});
|
||||||
settingInfos.Add(new AmmeterAutoValveControlSetting()
|
//settingInfos.Add(new AmmeterAutoValveControlSetting()
|
||||||
{
|
//{
|
||||||
MeterType = MeterTypeEnum.Ammeter,
|
// MeterType = MeterTypeEnum.Ammeter,
|
||||||
AmmerterAddress = "442405000039",
|
// AmmerterAddress = "442405000039",
|
||||||
FocusAddress = "442400039",
|
// FocusAddress = "442400039",
|
||||||
FocusId = 69280,
|
// FocusId = 69280,
|
||||||
ProjectID = 1,
|
// ProjectID = 1,
|
||||||
TripType = "on",
|
// TripType = "on",
|
||||||
TripTime = $"{DateTime.Now:HH:mm}",
|
// TripTime = $"{DateTime.Now:HH:mm}",
|
||||||
MeterId = 95594,
|
// MeterId = 95594,
|
||||||
LoopType = "EachDay",
|
// LoopType = "EachDay",
|
||||||
EachDayWithout = "周六,周日",
|
// EachDayWithout = "周六,周日",
|
||||||
TimeDensity = 15,
|
// TimeDensity = 15,
|
||||||
});
|
//});
|
||||||
|
|
||||||
|
|
||||||
|
settingInfos.Add(new AmmeterAutoValveControlSetting()
|
||||||
|
{
|
||||||
|
MeterType = MeterTypeEnum.Ammeter,
|
||||||
|
AmmerterAddress = "402410040506",
|
||||||
|
FocusAddress = "402440506",
|
||||||
|
FocusId = 106857,
|
||||||
|
ProjectID = 1,
|
||||||
|
TripType = "on",
|
||||||
|
TripTime = $"{DateTime.Now:HH:mm}",
|
||||||
|
MeterId = 139059,
|
||||||
|
LoopType = "EachDay",
|
||||||
|
EachDayWithout = "周六,周日",
|
||||||
|
TimeDensity = 15,
|
||||||
|
});
|
||||||
|
|
||||||
FreeRedisProvider.Instance.Set(redisCacheDeviceSettingInfoHashKey, settingInfos);
|
FreeRedisProvider.Instance.Set(redisCacheDeviceSettingInfoHashKey, settingInfos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<DeviceInfo> meterInfos =await GetAmmeterInfoList();
|
||||||
#else
|
#else
|
||||||
//获取电表阀控配置
|
//获取电表阀控配置
|
||||||
var settingInfos = await GetAmmeterAutoValveControlSetting(currentTimeStr);
|
var settingInfos = await GetAmmeterAutoValveControlSetting(currentTimeStr);
|
||||||
@ -330,8 +343,6 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
_logger.LogError($"{nameof(AmmeterScheduledAutoValveControl)} 电表自动阀控时,阀控数据为空, -101");
|
_logger.LogError($"{nameof(AmmeterScheduledAutoValveControl)} 电表自动阀控时,阀控数据为空, -101");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
//设备hash缓存key
|
//设备hash缓存key
|
||||||
string redisCacheDeviceInfoHashKey = $"{string.Format(RedisConst.CacheDeviceInfoHashKey, SystemType, ServerTagName)}";
|
string redisCacheDeviceInfoHashKey = $"{string.Format(RedisConst.CacheDeviceInfoHashKey, SystemType, ServerTagName)}";
|
||||||
@ -350,6 +361,10 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<MeterReadingTelemetryPacketInfo> taskList = new List<MeterReadingTelemetryPacketInfo>();
|
List<MeterReadingTelemetryPacketInfo> taskList = new List<MeterReadingTelemetryPacketInfo>();
|
||||||
|
|
||||||
foreach (var settingInfo in settingInfos)
|
foreach (var settingInfo in settingInfos)
|
||||||
@ -392,7 +407,7 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
|||||||
ammeterInfo.TripState = 0;
|
ammeterInfo.TripState = 0;
|
||||||
tripStateResult = true;
|
tripStateResult = true;
|
||||||
subItemCode = T6452007PacketItemCodeConst.C1C011C;
|
subItemCode = T6452007PacketItemCodeConst.C1C011C;
|
||||||
if (ammeterInfo.TypeName != 1)
|
if (ammeterInfo.TypeName > 3)
|
||||||
{
|
{
|
||||||
subItemCode = T6452007PacketItemCodeConst.C1C011B;
|
subItemCode = T6452007PacketItemCodeConst.C1C011B;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,12 +19,12 @@ namespace JiShe.CollectBus.Common.Consts
|
|||||||
public const string C1C011A = "1C_01_1A";
|
public const string C1C011A = "1C_01_1A";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单相合闸
|
/// 合闸允许
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string C1C011B = "1C_01_1B";
|
public const string C1C011B = "1C_01_1B";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 三相合闸
|
/// 合闸
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string C1C011C = "1C_01_1C";
|
public const string C1C011C = "1C_01_1C";
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user