Info message when at least one of the components is in Simulation mode, version 1.5.98.
This commit is contained in:
@@ -252,11 +252,20 @@ namespace TBF.BenchControl
|
|||||||
ControlBoard.InitializeComponent(ctrlBrdComponent, valvesToInvert, tankCapacities);
|
ControlBoard.InitializeComponent(ctrlBrdComponent, valvesToInvert, tankCapacities);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void InitializeDevices()
|
public static string InitializeDevices()
|
||||||
{
|
{
|
||||||
|
bool anyComponentIsInSimulMode = false;
|
||||||
|
StringBuilder inSimulMode = new StringBuilder();
|
||||||
|
|
||||||
/// Add all devices to the state machine and initialize them
|
/// Add all devices to the state machine and initialize them
|
||||||
foreach (var cmpnt in components)
|
foreach (var cmpnt in components)
|
||||||
{
|
{
|
||||||
|
if (cmpnt.DebugLevel == Entities.DebugMode.Simulate)
|
||||||
|
{
|
||||||
|
inSimulMode.AppendFormat("{0}{1}", anyComponentIsInSimulMode ? ", " : "", cmpnt.Name);
|
||||||
|
anyComponentIsInSimulMode = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (cmpnt is IDevice)
|
if (cmpnt is IDevice)
|
||||||
{
|
{
|
||||||
AddDevice(cmpnt as IDevice);
|
AddDevice(cmpnt as IDevice);
|
||||||
@@ -276,6 +285,11 @@ namespace TBF.BenchControl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (anyComponentIsInSimulMode)
|
||||||
|
return inSimulMode.ToString();
|
||||||
|
else
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -140,7 +140,12 @@ namespace TBF
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
BenchControl.StateMachine.InitializeDevices();
|
string message = BenchControl.StateMachine.InitializeDevices();
|
||||||
|
if (message != null)
|
||||||
|
{
|
||||||
|
MessageBox.Show("The following components are in simulation mode: \r\n" + message,
|
||||||
|
"Warning", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
|
||||||
//emergencyStopModelessDlg = new TBF.Forms.EmergencyStopForm();
|
//emergencyStopModelessDlg = new TBF.Forms.EmergencyStopForm();
|
||||||
//emergencyStopModelessDlg.Show();
|
//emergencyStopModelessDlg.Show();
|
||||||
|
|||||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
[assembly: AssemblyVersion("1.5.97.1")]
|
[assembly: AssemblyVersion("1.5.98.1")]
|
||||||
[assembly: AssemblyFileVersion("1.5.97.1")]
|
[assembly: AssemblyFileVersion("1.5.98.1")]
|
||||||
|
|||||||
Reference in New Issue
Block a user