Bug fix in StateMachine.InitializeDevices( ), Modbus.RegTelegramsPerSecond = 3, MaxTelegramsPerSecond = 5, ver. 3.1.1601

This commit is contained in:
Milan Hanajik
2021-04-06 10:24:42 +02:00
parent dd24c8b073
commit 6d9a7e2385
4 changed files with 14 additions and 20 deletions
+3 -2
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015-2021 Sensus Metering Systems
/// Copyright (c) 2015-2021 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -22,7 +22,8 @@ namespace TBF.Rig.Modbus.Common
public override string ToString() { return string.Format("Modbus({0})", Cfg.ToString(-1)); }
const int MaxTelegramsPerSecond = 5; /// Max. number of telegrams to be sent per second (100 ms for each telegram)
const int RegTelegramsPerSecond = 2; /// Number of registered polling telegrams per second
const int RegTelegramsPerSecond = 3; /// Number of registered polling telegrams per second
const int MinTelegramLen = 4;
private readonly ModbusCfg modbusCfg;
+8 -15
View File
@@ -294,12 +294,10 @@ namespace TBF.Rig
}
public static string CurrentlyInitializedDeviceName;
public static string CurrentlyInitializedComponentName;
///
public static string InitializeDevices()
{
CurrentlyInitializedDeviceName = "-";
bool anyComponentIsInSimulMode = false;
StringBuilder inSimulMode = new StringBuilder();
@@ -312,22 +310,17 @@ namespace TBF.Rig
anyComponentIsInSimulMode = true;
}
IDevice device = cmpnt as IDevice;
if (device != null)
if (cmpnt is IDevice)
{
CurrentlyInitializedDeviceName = device.Name;
UiBridge.Bridge.OnActivity(null, device.Name); /// Info
device.Initialize();
devices.Add(device); /// Only components that were initialized are added
}
else
{
CurrentlyInitializedDeviceName = device.Name;
cmpnt.Initialize();
devices.Add(cmpnt as IDevice); /// Only components that were initialized are added
UiBridge.Bridge.OnActivity(null, cmpnt.Name); /// Info
}
CurrentlyInitializedComponentName = cmpnt.Name;
cmpnt.Initialize();
}
CurrentlyInitializedDeviceName = "---";
CurrentlyInitializedComponentName = "---";
///
/// (1) Propagate debug levels from parents to children when necessary