Add detailed logging for Genesis operations in FlyingStartMassCollectionSeq and FlyingStartSeq.

- Introduce debug and info logs for Genesis initialization, calibration, measurement, and data storage.
- Ensure proper logging during Genesis operations' start and stop phases.
This commit is contained in:
Michal Buzik 2026-03-10 08:16:30 +01:00
parent 7a31cd85fb
commit 2dae8fa33d
3 changed files with 25 additions and 8 deletions

View File

@ -140,6 +140,7 @@ namespace TBF.Rig.TestMethods.FlyingStart
TestStartTime = DateTime.Now;
// Genesis switch
bool atleastOneGenesis = GenesisHeadBatch.Start(sensPath.RegisterReaders, Program.LocalSettings.LastSNTexts);
log.Info($"Genesis - atleastOneGenesis = {atleastOneGenesis}");
///
/// Optionally display prompt to emerge temperature meters to appropriate baths for heat meters test
@ -331,13 +332,16 @@ namespace TBF.Rig.TestMethods.FlyingStart
//TODO genesis - check with genesis switch
if (atleastOneGenesis)
{
log.Info($"Genesis - Starting... Test Name:{test.Name.ToLower()}.");
if (test.Name.ToLower().Contains("calib"))
{
log.Info("Genesis - Calibration starting.");
GenesisHeadBatch.BatchHolder.Value.MetersLogin();
GenesisHeadBatch.BatchHolder.Value.MetersInitCalibration();
} else if (test.Name.ToLower().Contains("Init"))
} else if (test.Name.ToLower().Contains("init"))
{
log.Info("Genesis - Init measurement starting.");
GenesisHeadBatch.BatchHolder.Value.MetersLogin();
GenesisHeadBatch.BatchHolder.Value.MetersInitMeasurement();
}
@ -456,10 +460,12 @@ namespace TBF.Rig.TestMethods.FlyingStart
{
if (test.Name.ToLower().Contains("calib"))
{
log.Info("Genesis - Calibration stopped.");
GenesisHeadBatch.BatchHolder.Value.MetersStopCalibration();
}
else if (test.Name.ToLower().Contains("Init"))
{
log.Info("Genesis - Init measurement stopped.");
GenesisHeadBatch.BatchHolder.Value.MetersStopMeasurement();
}
}

View File

@ -170,6 +170,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
bool atleastOneGenesis = false;
atleastOneGenesis = GenesisHeadBatch.Start(sensPath.RegisterReaders, Program.LocalSettings.LastSNTexts);
log.Info($"Genesis - atleastOneGenesis = {atleastOneGenesis}");
//------------------------------------------------
Bridge.OnActivity(this, Strings.Checking_tank_capacity);
@ -460,14 +461,17 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
if (atleastOneGenesis)
{
log.Info($"Genesis - Starting... Test Name:{test.Name.ToLower()}.");
if (test.Name.ToLower().Contains("calib"))
{
log.Info("Genesis - Calibration starting.");
GenesisHeadBatch.BatchHolder.Value.MetersLogin();
GenesisHeadBatch.BatchHolder.Value.MetersInitCalibration();
}
if (test.Name.ToLower().Contains("Init"))
if (test.Name.ToLower().Contains("init"))
{
log.Info("Genesis - init starting.");
GenesisHeadBatch.BatchHolder.Value.MetersLogin();
GenesisHeadBatch.BatchHolder.Value.MetersInitMeasurement();
}
@ -617,13 +621,18 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
/// Measurement loop end
StopRecordingStatistics();
if (test.Name.ToLower().Contains("calib"))
if (atleastOneGenesis)
{
GenesisHeadBatch.BatchHolder.Value.MetersStopCalibration();
}
else
{
GenesisHeadBatch.BatchHolder.Value.MetersStopMeasurement();
if (test.Name.ToLower().Contains("calib"))
{
log.Info("Genesis - Calibration stopped.");
GenesisHeadBatch.BatchHolder.Value.MetersStopCalibration();
}
else
{
log.Info("Genesis - Init measurement stopped.");
GenesisHeadBatch.BatchHolder.Value.MetersStopMeasurement();
}
}
///
@ -976,6 +985,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
//Genesis grab data to results
if (Genesis != null)
{
log.Debug("Genesis - store data on end!");
meterRslt.PulsesMaster = Convert.ToDouble(regReader.WMRefPulses); // missing in geenral genesis
Genesis.Stop(tstRslt.TestTime, tstRslt.VolumeCTV);
meterRslt.TimestampStart = Genesis.TimestampSecStart;

View File

@ -436,6 +436,7 @@ namespace TBF.Rig.TestMethods.GenesisCommunication.GenesisHead
public void Log(string text)
{
log.Debug(text);
if (DebugLevel == DebugMode.Normal)
{
if (myGenesis != null)