SensusTestInfo related : Synchronization with branch 2.28

This commit is contained in:
Milan Hanajik
2022-05-31 09:32:34 +02:00
parent 285facc3fd
commit c00f90ed8a
2 changed files with 27 additions and 21 deletions
@@ -1,9 +1,11 @@
///
/// Copyright (c) 2015-2021 Sensus Slovensko a.s.
/// Copyright (c) 2015-2022 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Ports;
using System.Linq;
using log4net;
using Common;
using Common.Iperl;
@@ -398,11 +400,11 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
: base(cfg)
{
iperlHeadCfg = cfg as IperlHeadCfg;
x = new float[FeatureVectorSize];
}
public override void Initialize()
{
x = new float[FeatureVectorSize];
flowDirectionDetection = new FlowDirectionDetection();
/// Allocate memory for opto-data from iPerl
@@ -748,20 +750,10 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
/// Select or create appropriate 'qBezeichnung'
///
string fullTestName = Results.Utils.GetTestName(testName, testRepeats, repetitionNr);
string qBezeichnungOpto = null; /// To be determined from TestInfo-s (if there are any)
foreach (var ti in testInfos)
{
if ((ti.PruefungsNrOpto != 0) && (ti.TestName == fullTestName))
{
qBezeichnungOpto = string.IsNullOrEmpty(ti.QBezeichnungOpto) ? ti.PruefungsNrOpto.ToString("D2") : ti.QBezeichnungOpto;
break;
}
}
if (qBezeichnungOpto == null)
{
qBezeichnungOpto = fullTestName; /// No appropriate TestInfo found => set default opto data file name
}
var ti = testInfos.FirstOrDefault(x => x.PruefungsNrOpto != 0 && x.TestName == fullTestName);
string qBezeichnung = (ti == null) ? fullTestName /// No appropriate TestInfo found => set default opto data file name
: string.IsNullOrEmpty(ti.QBezeichnungOpto) ? ti.PruefungsNrOpto.ToString("D2")
: ti.QBezeichnungOpto;
///
/// Get other required pieces of information
///
@@ -773,7 +765,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
///
/// Return the file name
///
return string.Format("{0}_{1}_{2}_{3}.txt", pcbNr, wmPosition, qBezeichnungOpto, cycleStartTime);
return string.Format("{0}_{1}_{2}_{3}.txt", pcbNr, wmPosition, qBezeichnung, cycleStartTime);
}