SensusTestInfo : LogType.JustA0_Q3Q2Q1 added, GetBestMatch( ) modified
This commit is contained in:
parent
75c97d99e8
commit
8ef21b3831
@ -15,6 +15,7 @@ namespace Results.Output
|
||||
Just_Q3Q2adjQ1_Alt, /// pNrs = -1,5,2,1
|
||||
JustA0A4_Q3Q2adjQ1, /// pNrs = -2,-1,3,2,1 (Australia 169 MHz, raw data pNrs: -2,-1,4,3,2,1)
|
||||
JustA0A4_Q3Q2Q1, /// pNrs = -2,-1,3,2,1 (Australia 169 MHz smart, raw data pNrs: -2,-1,3,2,1)
|
||||
JustA0_Q3Q2Q1, /// pNrs = -1,3,2,1 (Australia 169 MHz smart, raw data pNrs: -1,3,2,1)
|
||||
DEWA, /// Q4, Q3, Q2adj, Q2, Q1
|
||||
DEWA_wo_Q2, /// Q4, Q3, Q2adj, Q1
|
||||
Suez, /// Two directions, with Q2 and Q2ac
|
||||
@ -178,7 +179,7 @@ namespace Results.Output
|
||||
SensusTestInfo[] candidateTinfo = SensusTestInfo.GetTestInfos(lt);
|
||||
|
||||
if (AreCompatible(candidateTinfo, testNames) && AreCompatible(oracleTestInfo, candidateTinfo) &&
|
||||
((bestMatch == null) || (candidateTinfo.Length > bestMatchLen)))
|
||||
((bestMatch == null) || (candidateTinfo.Length < bestMatchLen)))
|
||||
{
|
||||
bestLT = lt;
|
||||
bestMatch = candidateTinfo;
|
||||
@ -292,6 +293,16 @@ namespace Results.Output
|
||||
new SensusTestInfo("Q2", 2, "Q2", 2, "02", 2, "Q2", Range.R100_110),
|
||||
new SensusTestInfo("Q1", 1, "Q1", 1, "01", 1, "Q1", Range.R100_110),
|
||||
};
|
||||
|
||||
case LogType.JustA0_Q3Q2Q1: /// Australia 169 MHz with default Q2 corrections and conditional update at the end of cycle
|
||||
return new SensusTestInfo[]
|
||||
{
|
||||
/// TBF Oracle DB Opto RAW LU logfiles
|
||||
new SensusTestInfo("Qjust_A0", -1, "Just", -1, "-1", -1, "Q-1", Range.R95_105),
|
||||
new SensusTestInfo("Q3", 3, "Q3", 3, "03", 3, "Q3", Range.R90_100),
|
||||
new SensusTestInfo("Q2", 2, "Q2", 2, "02", 2, "Q2", Range.R100_110),
|
||||
new SensusTestInfo("Q1", 1, "Q1", 1, "01", 1, "Q1", Range.R100_110),
|
||||
};
|
||||
|
||||
case LogType.DEWA: /// DEWA (with Q4 and Q2 after correction)
|
||||
return new SensusTestInfo[]
|
||||
|
||||
@ -456,9 +456,12 @@ namespace TBF.Rig.Output.DB.SensusOracle
|
||||
StringBuilder procedureSignatureSB = new StringBuilder();
|
||||
foreach (var mtr in wm.RegularMeterTestRslts())
|
||||
{
|
||||
wmTestNames.Add(mtr.Name());
|
||||
procedureSignatureSB.Append(mtr.Name());
|
||||
procedureSignatureSB.Append("~");
|
||||
if (mtr.Evaluate())
|
||||
{
|
||||
wmTestNames.Add(mtr.Name());
|
||||
procedureSignatureSB.Append(mtr.Name());
|
||||
procedureSignatureSB.Append("~");
|
||||
}
|
||||
}
|
||||
|
||||
if (oracleTestInfo == null || (wmTypeId == 0) || (wmTypeId != wm.WaterMeterData.WMTypeId) || (procedureSignature != procedureSignatureSB.ToString()))
|
||||
@ -811,9 +814,12 @@ namespace TBF.Rig.Output.DB.SensusOracle
|
||||
StringBuilder procedureSignatureSB = new StringBuilder();
|
||||
foreach (var tr in b.RegularTestRslts())
|
||||
{
|
||||
wmTestNames.Add(tr.Name());
|
||||
procedureSignatureSB.Append(tr.Name());
|
||||
procedureSignatureSB.Append("~");
|
||||
if (tr.Evaluate())
|
||||
{
|
||||
wmTestNames.Add(tr.Name());
|
||||
procedureSignatureSB.Append(tr.Name());
|
||||
procedureSignatureSB.Append("~");
|
||||
}
|
||||
}
|
||||
|
||||
if ((oracleTestInfo == null) || (wmTypeId != b.WaterMeters[0].WaterMeterData.WMTypeId) || (wmTypeRevision == 0) || (procedureSignature != procedureSignatureSB.ToString()))
|
||||
|
||||
@ -12,7 +12,6 @@ using Config.Entities;
|
||||
using Results.Entities;
|
||||
using TBF.Rig.Operations;
|
||||
using TBF.Rig.GenericDevices;
|
||||
using TBF.Boxes;
|
||||
using TBF.Resources;
|
||||
using TBF.UiBridge;
|
||||
|
||||
@ -328,6 +327,64 @@ namespace TBF.Rig.Sequences
|
||||
/// This is to load Procedure.Tests and test.MoreParams for each test
|
||||
int a = 0;
|
||||
foreach (var test in StateMachine.Procedure.Tests) a += test.MoreParams.Count;
|
||||
|
||||
#if false
|
||||
/// Debugging SensusTestInfo.GetBestMatch()
|
||||
|
||||
if (selection == Selection.Cycle && OracleDB != null && OracleDB.ProductionDB != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
OracleDB.ProductionDB.Open();
|
||||
|
||||
int wmTypeId = 170;
|
||||
|
||||
/// Prepare procedure signature
|
||||
IList<string> wmTestNames = new List<string>();
|
||||
StringBuilder procedureSignatureSB = new StringBuilder();
|
||||
foreach (var tr in BatchRslts.Batch.RegularTestRslts())
|
||||
{
|
||||
if (tr.Evaluate())
|
||||
{
|
||||
wmTestNames.Add(tr.Name());
|
||||
procedureSignatureSB.Append(tr.Name());
|
||||
procedureSignatureSB.Append("~");
|
||||
}
|
||||
}
|
||||
|
||||
int wmTypeRev = 0;
|
||||
string wzTypStr;
|
||||
string metroKlasse;
|
||||
string zulasszeichen;
|
||||
string materialNr;
|
||||
double q3 = 0;
|
||||
DateTime timeStamp;
|
||||
string remark;
|
||||
IList<Results.Output.SensusTestInfo> ti = OracleDB.GetOracleTestInfo(OracleDB.ProductionDB, wmTypeId,
|
||||
out wmTypeRev, out wzTypStr, out metroKlasse, out zulasszeichen, out materialNr, out q3, out timeStamp, out remark);
|
||||
|
||||
if (ti != null)
|
||||
{
|
||||
/// All 5 updated together
|
||||
string procedureSignature = procedureSignatureSB.ToString();
|
||||
var completeTestInfo = Results.Output.SensusTestInfo.GetBestMatch(ti, wmTestNames);
|
||||
|
||||
foreach (var cti in completeTestInfo)
|
||||
{
|
||||
log.WarnFormat("Selected test info : ID={0} Rev={1} Test={2} PrfNrDB={3} QBzDB={4} PrfNrOpto={5} QBzOpto={6} PrfNrLog={7} QBzLog={8} Range={9}",
|
||||
wmTypeId, wmTypeRev, cti.TestName, cti.PruefungsNrDB, cti.QBezeichnungDB, cti.PruefungsNrOpto,
|
||||
cti.QBezeichnungOpto, cti.PruefungsNrLog, cti.QBezeichnungLog, cti.Range);
|
||||
}
|
||||
}
|
||||
|
||||
OracleDB.ProductionDB.Close();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string msg = exc.Message;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -335,8 +392,9 @@ namespace TBF.Rig.Sequences
|
||||
StateMachine.Procedure = null;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception exc)
|
||||
{
|
||||
string msg = exc.Message;
|
||||
StateMachine.Procedure = null;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user