Info message when at least one of the components is in Simulation mode, version 1.5.98.

This commit is contained in:
Milan Hanajik
2015-08-24 16:04:31 +02:00
parent da01b1fe61
commit 08aed03cef
3 changed files with 23 additions and 4 deletions
@@ -252,11 +252,20 @@ namespace TBF.BenchControl
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
foreach (var cmpnt in components)
{
if (cmpnt.DebugLevel == Entities.DebugMode.Simulate)
{
inSimulMode.AppendFormat("{0}{1}", anyComponentIsInSimulMode ? ", " : "", cmpnt.Name);
anyComponentIsInSimulMode = true;
}
if (cmpnt is IDevice)
{
AddDevice(cmpnt as IDevice);
@@ -276,6 +285,11 @@ namespace TBF.BenchControl
}
}
}
if (anyComponentIsInSimulMode)
return inSimulMode.ToString();
else
return null;
}
/// <summary>
+6 -1
View File
@@ -140,7 +140,12 @@ namespace TBF
{
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.Show();
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.5.97.1")]
[assembly: AssemblyFileVersion("1.5.97.1")]
[assembly: AssemblyVersion("1.5.98.1")]
[assembly: AssemblyFileVersion("1.5.98.1")]