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>