From 8229c5eb6378885d4f2ff2c20dc30cf57c663a9a Mon Sep 17 00:00:00 2001 From: Michal Buzik Date: Tue, 3 Mar 2026 12:19:03 +0100 Subject: [PATCH] Improve logging and error handling in FlyingStart and FlyingStartMassCollection sequences. --- TBF/Rig/TestMethods/FlyingStart/FlyingStartSeq.cs | 5 +++++ .../FlyingStartMassCollectionSeq.cs | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/TBF/Rig/TestMethods/FlyingStart/FlyingStartSeq.cs b/TBF/Rig/TestMethods/FlyingStart/FlyingStartSeq.cs index fdc65f6b9..12ca00e72 100644 --- a/TBF/Rig/TestMethods/FlyingStart/FlyingStartSeq.cs +++ b/TBF/Rig/TestMethods/FlyingStart/FlyingStartSeq.cs @@ -607,6 +607,11 @@ namespace TBF.Rig.TestMethods.FlyingStart meterRslt.VolumeRef = tstRslt.VolumeCTV * meterRslt.TestTime / tstRslt.TestTime; meterRslt.PulsesMaster = tstRslt.PulsesMaster * meterRslt.TestTime / tstRslt.TestTime; + log.Debug($"TEST TIME meterRslt.TimestampStart:{meterRslt.TimestampStart}, meterRslt.TimestampEnd:{meterRslt.TimestampEnd}, meterRslt.TestTime:{meterRslt.TestTime}"); + log.Debug($"TEST VOLUME meterRslt.VolumeStart:{meterRslt.VolumeStart}, meterRslt.VolumeEnd:{meterRslt.VolumeEnd}, meterRslt.VolumeMeter:{meterRslt.VolumeMeter}"); + log.Debug($"TEST modified by time: meterRslt.VolumeRef:{meterRslt.VolumeRef}, meterRslt.PulsesMaster:{meterRslt.PulsesMaster}"); + + if (iPerl != null) { if (iPerl.ResultCode != 0 && (meterRslt.WaterMeter.ResultCode & (int)Results.Entities.ResultCode.OptoErrorCodeMask) == 0) diff --git a/TBF/Rig/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs b/TBF/Rig/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs index 4667286e4..b53a2d84f 100644 --- a/TBF/Rig/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs +++ b/TBF/Rig/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs @@ -635,7 +635,18 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection while (!e.Contains(Event.ScaleDone) && !e.Contains(Event.Next)); /// tMass2 = StateMachine.Time; - log.WarnFormat("End mass = {0}kg", EndMass); + try + { + if (EndMass != null) + { + log.WarnFormat("End mass = {0}kg", EndMass.Val); + } + } + catch (Exception ex) + { + log.ErrorFormat("Error while logging end mass: {0}", ex.Message); + } + TestEndTime = DateTime.Now; if (test.DoDrainingAfter)