Merge branch 'develop/SLM-PT50_genesisDirectDecode_special_3121_17969' into develop/SLM-PT50_genesisDirectDecode_special

# Conflicts:
#	TBF/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTest.cs
This commit is contained in:
Michal Buzik 2026-05-29 15:52:16 +02:00
commit 0b246b2ff5
3 changed files with 35 additions and 13 deletions

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.9.3121.1")]
[assembly: AssemblyFileVersion("3.9.3121.1")]
[assembly: AssemblyVersion("3.9.3121.3")]
[assembly: AssemblyFileVersion("3.9.3121.3")]

View File

@ -1800,6 +1800,10 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication
}
);
}
log.Debug($" Calib factor from Text1: {wm.WaterMeterData.Text1}");
log.Debug($" Calib factor from Text2: {wm.WaterMeterData.Text2}");
log.Debug($" Calib factor from Text3: {wm.WaterMeterData.Text3}");
}
}catch(Exception ex)
{
@ -1821,7 +1825,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication
log.Error($"PrepareQ3Calibration({genesisHead?.Name}) - Missing Test");
return "PrepareQ3Calibration - Missing Test";
}
return Task.Run(() => PrepareQ3Calibration_Async(genesisHead, cfg, test, wm))
.GetAwaiter()
.GetResult();
@ -1853,6 +1857,8 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication
return string.Empty;
}
Results.Entities.TestRslt tstRslt = null;
try
@ -1895,15 +1901,31 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication
byte valueLed = (ledMode == LedState.active) ? (byte)6 : (byte)0;
//TODO BUMI - implement variable values for Q3Channel
UInt16 valueSampleRate = 10;
log.Debug( $"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - Calib Factors from Dialog - Text1:{wm?.WaterMeterData?.Text1} Text2:{ wm?.WaterMeterData?.Text2}, Text3: {wm?.WaterMeterData?.Text3}");
// try get Calib factors directly from Process settings
if (!string.IsNullOrEmpty(wm?.WaterMeterData?.Text1) &&
!string.IsNullOrEmpty(wm?.WaterMeterData?.Text2) &&
!string.IsNullOrEmpty(wm?.WaterMeterData?.Text3))
{
int.TryParse(wm?.WaterMeterData?.Text1, out int calibFactor1);
int.TryParse(wm?.WaterMeterData?.Text2, out int calibFactor2);
int.TryParse(wm?.WaterMeterData?.Text3, out int calibFactor3);
genesisSmartReader?.SetQ3Calibration(new double[]{calibFactor1,calibFactor2,calibFactor3});
}
else
{
genesisSmartReader?.SetQ3Calibration(new double[]{15625.0d,15625.0d,15625.0d});
}
//TODO BUMI - implement variable values for Q3Channel - be shure is implemented in Head
string prepareMeterSizeAndCalibration = await PrepareMeterSizeAndCalibration(genesisSmartReader, cfg, gciBridge, tstRslt, token);
if (prepareMeterSizeAndCalibration != ResultOk)
{
log.Error($"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - prepareMeterSizeAndCalibration failed. Result: {prepareMeterSizeAndCalibration}");
return prepareMeterSizeAndCalibration;
}
//string prepareMeterSizeAndCalibration = await PrepareMeterSizeAndCalibration(genesisSmartReader, cfg, gciBridge, tstRslt, token);
// if (prepareMeterSizeAndCalibration != ResultOk)
// {
// log.Error($"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - prepareMeterSizeAndCalibration failed. Result: {prepareMeterSizeAndCalibration}");
// return prepareMeterSizeAndCalibration;
// }
ushort calibrationFactor1 = Convert.ToUInt16(genesisSmartReader?.Q3CalibValue[0]);
log.Debug( $"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - Start - Set CalFactor1: {calibrationFactor1}");
var CalFactor1AsyncResult = await gciBridge.WriteRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, RadioService.CalFactor1, calibrationFactor1, false, false, token);
@ -2015,7 +2037,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication
private static async Task<string> PrepareMeterSizeAndCalibration(GenesisSmartReader genesisSmartReader, TestMethodCfg cfg,
GciBridge gciBridge, Results.Entities.TestRslt tstRslt, CancellationToken token)
{
UInt16 valueCalibrate = 15625; //Predefined Calibration Value
UInt16 valueCalibrate = 17969; //Predefined Calibration Value
log.Debug( $"PrepareMeterSizeAndCalibration( Slot: {genesisSmartReader?.GetSlotNr}) - Start - predefined {valueCalibrate}");
try
{

View File

@ -3997,8 +3997,8 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations
return;
}
}
log.Debug($"Inputs: refVolume={refVolume}, refTime={refTime}, initCalibFactor={initCalibFactor}");
log.Debug($"Inputs: refVolume={refVolume}, refTime={refTime}, initCalibFactors={string.Join(",", initCalibFactor)}");
if (_rawStartEndByChannel == null)
{