System.NullReferenceException fix.

This commit is contained in:
Jan Augustin 2024-09-26 09:31:14 +02:00
parent 74655e976f
commit a4d7dccde9

View File

@ -2064,14 +2064,24 @@ namespace TBF.Rig.Sequences
log.FatalFormat(" Feeding path: {0}", (inPath != null) ? inPath.ToString() : "none");
log.FatalFormat(" Bench path: {0}", (benchPath != null) ? benchPath.ToString() : "none");
log.FatalFormat(" Output path: {0}", (outPath != null) ? outPath.ToString() : "none");
if (inPath != null && inPath.Pump is IPump) log.FatalFormat(" Pump power: {0}%", (inPath.Pump as IPump).Power);
else if (inPath != null && inPath.Pump is IValve) log.FatalFormat(" Feeding valve: {0}", (inPath.Pump as IValve).State ? "open" : "close");
if (outPath.RegulValve is IRegValve) log.FatalFormat(" Regulation valve position: {0}%", outPath.RegulValve.Position);
log.FatalFormat(" Flow: {0}", RefFlow);
log.FatalFormat(" Mass: {0}", Mass);
log.FatalFormat(" Start mass: {0}", StartMass);
log.FatalFormat(" Liter/ref.pulse: {0}", LtrPerRefPulse);
log.FatalFormat(" Reference pulses: {0}", RefPulses);
try
{
if (inPath != null)
{
if (inPath.Pump is IPump) log.FatalFormat(" Pump power: {0}%", (inPath.Pump as IPump).Power);
else if (inPath.Pump is IValve) log.FatalFormat(" Feeding valve: {0}", (inPath.Pump as IValve).State ? "open" : "close");
}
if (outPath != null && outPath.RegulValve is IRegValve) log.FatalFormat(" Regulation valve position: {0}%", outPath.RegulValve.Position);
}
catch (Exception ex)
{
log.FatalFormat($" SequenceBase.TestAndLogUiCmdStop error: {ex.Message}");
}
}
return true;