Bug fix in StateMachine.InitializeDevices( ), Modbus.RegTelegramsPerSecond = 3, MaxTelegramsPerSecond = 5, ver. 3.1.1601
This commit is contained in:
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
[assembly: AssemblyVersion("3.1.1600.0")]
|
[assembly: AssemblyVersion("3.1.1601.0")]
|
||||||
[assembly: AssemblyFileVersion("3.1.1600.0")]
|
[assembly: AssemblyFileVersion("3.1.1601.0")]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2015-2021 Sensus Metering Systems
|
/// Copyright (c) 2015-2021 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
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)); }
|
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 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;
|
const int MinTelegramLen = 4;
|
||||||
|
|
||||||
private readonly ModbusCfg modbusCfg;
|
private readonly ModbusCfg modbusCfg;
|
||||||
|
|||||||
+9
-16
@@ -294,12 +294,10 @@ namespace TBF.Rig
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static string CurrentlyInitializedDeviceName;
|
public static string CurrentlyInitializedComponentName;
|
||||||
///
|
///
|
||||||
public static string InitializeDevices()
|
public static string InitializeDevices()
|
||||||
{
|
{
|
||||||
CurrentlyInitializedDeviceName = "-";
|
|
||||||
|
|
||||||
bool anyComponentIsInSimulMode = false;
|
bool anyComponentIsInSimulMode = false;
|
||||||
StringBuilder inSimulMode = new StringBuilder();
|
StringBuilder inSimulMode = new StringBuilder();
|
||||||
|
|
||||||
@@ -312,22 +310,17 @@ namespace TBF.Rig
|
|||||||
anyComponentIsInSimulMode = true;
|
anyComponentIsInSimulMode = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
IDevice device = cmpnt as IDevice;
|
if (cmpnt is IDevice)
|
||||||
if (device != null)
|
|
||||||
{
|
{
|
||||||
CurrentlyInitializedDeviceName = device.Name;
|
devices.Add(cmpnt as IDevice); /// Only components that were initialized are added
|
||||||
UiBridge.Bridge.OnActivity(null, device.Name); /// Info
|
UiBridge.Bridge.OnActivity(null, cmpnt.Name); /// Info
|
||||||
device.Initialize();
|
|
||||||
devices.Add(device); /// Only components that were initialized are added
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
CurrentlyInitializedDeviceName = device.Name;
|
|
||||||
cmpnt.Initialize();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CurrentlyInitializedDeviceName = "---";
|
CurrentlyInitializedComponentName = cmpnt.Name;
|
||||||
|
cmpnt.Initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
CurrentlyInitializedComponentName = "---";
|
||||||
|
|
||||||
///
|
///
|
||||||
/// (1) Propagate debug levels from parents to children when necessary
|
/// (1) Propagate debug levels from parents to children when necessary
|
||||||
|
|||||||
+1
-1
@@ -295,7 +295,7 @@ namespace TBF.UI
|
|||||||
formThread.Join();
|
formThread.Join();
|
||||||
|
|
||||||
string errMsg = string.Format(Strings.Failed_to_initialize_device_0_1_2,
|
string errMsg = string.Format(Strings.Failed_to_initialize_device_0_1_2,
|
||||||
Rig.StateMachine.CurrentlyInitializedDeviceName,
|
Rig.StateMachine.CurrentlyInitializedComponentName,
|
||||||
Environment.NewLine,
|
Environment.NewLine,
|
||||||
exc.Message);
|
exc.Message);
|
||||||
log.Fatal(errMsg);
|
log.Fatal(errMsg);
|
||||||
|
|||||||
Reference in New Issue
Block a user