暂存代码
This commit is contained in:
parent
7a7a68b326
commit
6bc3b31f81
@ -31,7 +31,7 @@ namespace JiShe.CollectBus.Protocol.T1882018
|
||||
T188ControlHandlers = Telemetry1882018PacketBuilder.T1882018ControlHandlers;
|
||||
}
|
||||
|
||||
public sealed override ProtocolInfo Info => new(nameof(T1882018ProtocolPlugin), "376.1/188-2018", "TCP", "376.1/188-2018协议", "HJ-LXS-15 DN15");
|
||||
public sealed override ProtocolInfo Info => new(nameof(T1882018ProtocolPlugin), "376.1/188-2018", "TCP", "376.1/188-2018协议", "云集");
|
||||
|
||||
public override async Task<T> AnalyzeAsync<T>(ITcpSessionClient client, string messageReceived, Action<T>? sendAction = null)
|
||||
{
|
||||
|
||||
@ -230,9 +230,7 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
||||
{
|
||||
_logger.LogInformation($"{nameof(CreateToBeIssueTasks)} 不是自动校时、采集终端信息等时间,继续处理其他");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//检查任务时间节点,由于定时任务10秒钟运行一次,需要判定当前时间是否在任务时间节点内,不在则跳过
|
||||
var currentTaskTime = tasksToBeIssueModel.LastTaskTime.CalculateNextCollectionTime(timeDensity);//程序启动缓存电表的时候,NextTaskTime需要格式化到下一个采集点时间。
|
||||
if (!IsTaskTime(currentTaskTime, timeDensity))//todo 如果时间超过两个采集频率周期,就一直处理,直到追加到下一个采集频率周期。
|
||||
@ -242,9 +240,7 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
||||
}
|
||||
|
||||
var meterTypes = EnumExtensions.ToEnumDictionary<MeterTypeEnum>();
|
||||
|
||||
//tasksToBeIssueModel.NextTaskTime;
|
||||
|
||||
|
||||
if (meteryType == MeterTypeEnum.Ammeter.ToString())
|
||||
{
|
||||
_ = CreateMeterPublishTask<DeviceInfo>(
|
||||
@ -256,7 +252,7 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
||||
var tempTask = await AmmerterCreatePublishTaskAction(timeDensity, data, groupIndex, timestamps);
|
||||
if (tempTask == null || tempTask.Count <= 0)
|
||||
{
|
||||
//_logger.LogWarning($"电表 {data.Name} 任务数据构建失败:{data.Serialize()}");
|
||||
_logger.LogWarning($"电表 {data.Name} 任务数据构建失败:{data.Serialize()}");
|
||||
return;
|
||||
}
|
||||
_ = _dataChannelManage.ScheduledMeterTaskWriterAsync(DataChannelManage.TaskDataChannel.Writer, (ProtocolConst.AmmeterSubscriberWorkerFifteenMinuteIssuedEventName, tempTask));
|
||||
@ -1280,14 +1276,14 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
||||
{
|
||||
timeDensity = watermeter.TimeDensity;//水表默认为60分钟
|
||||
typeName = watermeter.LinkType;
|
||||
if (watermeter.MeterBrand.Contains("泉高阀门") || watermeter.MeterBrand.Equals("LXSY-山水翔"))
|
||||
if (watermeter.BrandType.Contains("泉高阀门") || watermeter.BrandType.Equals("LXSY-山水翔"))
|
||||
{
|
||||
typeName = watermeter.MeterBrand;
|
||||
typeName = watermeter.BrandType;
|
||||
}
|
||||
}
|
||||
else if (watermeter.MeterType == MeterTypeEnum.WaterMeterFlowmeter)
|
||||
{
|
||||
typeName = watermeter.MeterBrand;
|
||||
typeName = watermeter.BrandType;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -560,7 +560,39 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
||||
{
|
||||
try
|
||||
{
|
||||
string sql = $@"SELECT
|
||||
#if DEBUG
|
||||
var redisCacheDeviceInfoHashKeyTemp = $"CollectBus:Energy:JiSheCollectBus109:DeviceInfo";
|
||||
|
||||
List<DeviceInfo> deviceInfos = FreeRedisProvider.Instance.Get<List<DeviceInfo>>(redisCacheDeviceInfoHashKeyTemp);
|
||||
|
||||
if (deviceInfos == null || deviceInfos.Count <= 0)
|
||||
{
|
||||
deviceInfos = new List<DeviceInfo>();
|
||||
deviceInfos.Add(new DeviceInfo()
|
||||
{
|
||||
Baudrate = 2400,
|
||||
FocusAddress = "322011149",
|
||||
Name = "LXSY-25E 保利",
|
||||
FocusId = 57675,
|
||||
DatabaseBusiID = 1,
|
||||
MeteringCode = 0,
|
||||
MeterAddress = "341587000473",
|
||||
MeterId = 1025,
|
||||
TypeName = 1,
|
||||
TimeDensity = 60,
|
||||
BrandType = "云集",
|
||||
MeterType = MeterTypeEnum.WaterMeter,
|
||||
ProjectID = 1,
|
||||
MeteringPort = MeteringPortConst.MeteringPortTwo,
|
||||
Password = "000000",
|
||||
LinkType = "RS-485",
|
||||
TimesRate = 1.0000m,
|
||||
});
|
||||
}
|
||||
|
||||
return deviceInfos;
|
||||
#else
|
||||
string sql = $@"SELECT
|
||||
A.ID as MeterId,
|
||||
A.Name,
|
||||
A.FocusID as FocusId,
|
||||
@ -575,7 +607,7 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
||||
A.LinkType,
|
||||
A.HaveValve,
|
||||
A.MeterType AS MeterTypeName,
|
||||
A.MeterBrand,
|
||||
A.MeterBrand AS BrandType,
|
||||
A.TimesRate,
|
||||
A.TimeDensity,
|
||||
A.TripState,
|
||||
@ -602,6 +634,7 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
||||
return await SqlProvider.Instance.Change(DbEnum.EnergyDB)
|
||||
.Ado
|
||||
.QueryAsync<DeviceInfo>(sql);
|
||||
#endif
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
@ -46,14 +46,7 @@ namespace JiShe.CollectBus.IotSystems.Devices
|
||||
/// 设备类型: 水表\气表、流量计
|
||||
/// </summary>
|
||||
public string MeterTypeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备品牌;
|
||||
/// (当 MeterType = 水表, 如 威铭、捷先 等)
|
||||
/// (当 MeterType = 流量计, 如 西恩超声波流量计、西恩电磁流量计、涡街流量计 等)
|
||||
/// </summary>
|
||||
public string MeterBrand { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 倍率
|
||||
/// </summary>
|
||||
@ -75,7 +68,7 @@ namespace JiShe.CollectBus.IotSystems.Devices
|
||||
public string AreaCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 电表类别 (1单相、2三相三线、3三相四线),
|
||||
/// 仅当MeterType为电表时,电表类别 (1单相、2三相三线、3三相四线),
|
||||
/// 07协议: 开合闸指令(1A开闸断电,1C单相表合闸,1B多相表合闸) 645 2007 表
|
||||
/// 97协议://true(合闸);false(跳闸) 545 1997 没有单相多相 之分 "true" ? "9966" : "3355"
|
||||
/// </summary>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user