public void Start()
{
if (running)
{
throw new Exception("Stop the instance before starting");
}
// System is now running
running = true;
BuildSimulation();
// Execute the ISim Process
Logger.Instance.WriteVerbose("Starting ISim Process at '{0}'", currentResult.ExecutableFile);
isimProcess = new ISimProcess(currentWorkingDirectory, currentResult.ExecutableFile);
isimProcess.RunGraphicalUserInterface = UseGraphicalUserInterface;
isimProcess.Start();
// Current example process
while (isimProcess.Running)
{
// If using gui, dont run console prompt mode
if (!UseGraphicalUserInterface)
{
isimProcess.WaitForPrompt();
Console.Write("$ ");
string command = Console.ReadLine();
Console.WriteLine(isimProcess.InjectCommand(command));
}
else
{
Thread.Sleep(1000);
}
}
Logger.Instance.WriteVerbose("ISim terminated");
}