Invalid configuration checked in StateMachine.GetPaths(...). More logging of mass display.

This commit is contained in:
Milan Hanajik
2015-05-20 16:18:54 +02:00
parent 18ee69f0db
commit ceb3de90bf
3 changed files with 49 additions and 10 deletions
@@ -386,8 +386,13 @@ namespace TBF.BenchControl
/// <param name="pmtrs"></param>
/// <returns>true when all four paths are defined (non null)</returns>
public static bool GetPaths(Entities.Test test,
out FeedingPath pfeed, out BenchPath pben, out OutputPath pout, out MetersPath pmtrs,
out Entities.TransitionSequence transitionStart, out Entities.TransitionSequence transitionEnd)
out FeedingPath pfeed,
out BenchPath pben,
out OutputPath pout,
out MetersPath pmtrs,
out Entities.TransitionSequence transitionStart,
out Entities.TransitionSequence transitionEnd,
out string errorMsg)
{
pfeed = null;
pben = null;
@@ -434,7 +439,26 @@ namespace TBF.BenchControl
if (transition.Name == test.TransitionEnd) transitionEnd = transition;
}
return (pfeed != null) && (pben != null) && (pout != null) && (pmtrs != null);
if ((pfeed == null) || (pben == null) || (pout == null) || (pmtrs == null))
{
errorMsg = "Cannot load paths";
return false;
}
if (pout.Balance == null)
{
errorMsg = string.Format("No balance specified in path {0}", test.OutputPath);
return false;
}
if (Program.LocalSettings.RealDensity < 500.0f || Program.LocalSettings.RealDensity > 2000.0f)
{
errorMsg = string.Format("Density was not specified");
return false;
}
errorMsg = string.Empty;
return true;
}
/// <summary>