Config.Entities.Test : Support for tests using multiple (but not all) lines (Israel PT50, 4 lines).

This commit is contained in:
Milan Hanajik 2019-01-14 15:32:26 +02:00
parent f180af692f
commit f5926259a7
26 changed files with 96 additions and 47 deletions

View File

@ -358,6 +358,40 @@ namespace Config.Entities
}
}
public virtual bool IsPartCompatible(int waterMeterPartNr)
{
if ((this.Part == 0) || (waterMeterPartNr == 0)) return true;
if ((this.Part % 10) == waterMeterPartNr) return true;
if (((this.Part / 10) % 10) == waterMeterPartNr) return true;
if (((this.Part / 100) % 10) == waterMeterPartNr) return true;
if (((this.Part / 1000) % 10) == waterMeterPartNr) return true;
return false;
}
/// <summary>
/// Determines whether tests part number is OK.
/// Examples of correct part number are:
/// 1, 2, 12, 21 in case of max. part nr.== 2
/// 1, 2, 3, 4, 12, 13, 14, 23, 24, 34, 123, 124, 134, 234, 1234 in case of max. part nr.== 4
/// </summary>
/// <param name="partNr">Tests par tnumber</param>
/// <returns>true when Part number is OK</returns>
public static bool IsGoodPartNr(int partNr)
{
bool firstDigitIsOK = ((partNr % 10) > 0) && ((partNr % 10) <= Config.Data.MaxPartNr);
bool secondDigitIsOK = (((partNr/10) % 10) > 0) && (((partNr/10) % 10) <= Config.Data.MaxPartNr);
bool thirdDigitIsOK = (((partNr/100) % 10) > 0) && (((partNr/100) % 10) <= Config.Data.MaxPartNr);
bool fourthDigitIsOK = (((partNr/1000) % 10) > 0) && (((partNr/1000) % 10) <= Config.Data.MaxPartNr);
if (firstDigitIsOK && (partNr / 10 == 0)) return true;
if (firstDigitIsOK && secondDigitIsOK && (partNr / 100 == 0)) return true;
if (firstDigitIsOK && secondDigitIsOK && thirdDigitIsOK && (partNr / 1000 == 0)) return true;
if (firstDigitIsOK && secondDigitIsOK && thirdDigitIsOK && fourthDigitIsOK && (partNr / 10000 == 0)) return true;
return false;
}
public override string ToString()
{

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.18.1102.0")]
[assembly: AssemblyFileVersion("2.18.1102.0")]
[assembly: AssemblyVersion("2.18.1110.0")]
[assembly: AssemblyFileVersion("2.18.1110.0")]

View File

@ -96,7 +96,7 @@ namespace Results
{
if (d.WaterMeters[i] == null) continue;
if (t.Part != 0 && waterMeterParts[i] != 0 && t.Part != waterMeterParts[i]) continue;
if (!t.IsPartCompatible(waterMeterParts[i])) continue;
///
/// Create empty watermeter test results and add them to the list and to dictionaries

View File

@ -319,6 +319,18 @@ namespace Results.Entities
#endif
}
public virtual bool IsPartCompatible(int waterMeterPartNr)
{
if ((this.Part == 0) || (waterMeterPartNr == 0)) return true;
if ((this.Part % 10) == waterMeterPartNr) return true;
if (((this.Part / 10) % 10) == waterMeterPartNr) return true;
if (((this.Part / 100) % 10) == waterMeterPartNr) return true;
if (((this.Part / 1000) % 10) == waterMeterPartNr) return true;
return false;
}
public override string ToString()
{
return string.Format("batch={0}, procedure={1}, test={2}, {3} {4}", Batch.BatchNr, Batch.ProcedureName, Name(), StartTime.ToShortDateString(), StartTime.ToShortTimeString());

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.18.1109.0")]
[assembly: AssemblyFileVersion("2.18.1109.0")]
[assembly: AssemblyVersion("2.18.1110.0")]
[assembly: AssemblyFileVersion("2.18.1110.0")]

View File

@ -403,7 +403,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.Single);
GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i];

View File

@ -644,7 +644,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux);

View File

@ -393,7 +393,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
///
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);
GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i];

View File

@ -930,7 +930,7 @@ namespace TBF.BenchControl.TestMethods.FixedStart
///
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux);
@ -993,7 +993,7 @@ namespace TBF.BenchControl.TestMethods.FixedStart
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt volumeRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterVolume);
Results.Entities.MeterTestRslt energyRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterEnergy);
@ -1050,7 +1050,7 @@ namespace TBF.BenchControl.TestMethods.FixedStart
///
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);
GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i];

View File

@ -571,7 +571,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);
GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i];

View File

@ -1094,7 +1094,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation
///
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(data.TestName, i, Config.Entities.CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(data.TestName, i, Config.Entities.CompoundMeterId.CompoundAux);
@ -1144,7 +1144,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation
///
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(data.TestName, i, Config.Entities.CompoundMeterId.Single);
GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i];

View File

@ -1019,7 +1019,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
///
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux);
@ -1082,7 +1082,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt volumeRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterVolume);
Results.Entities.MeterTestRslt energyRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterEnergy);
@ -1139,7 +1139,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
///
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);
GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i];

View File

@ -748,7 +748,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection
///
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux);
@ -798,7 +798,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection
///
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);
GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i];

View File

@ -565,7 +565,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt volumeRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterVolume);
Results.Entities.MeterTestRslt energyRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterEnergy);
@ -623,7 +623,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
///
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);
GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i];

View File

@ -829,7 +829,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
///
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux);
@ -901,7 +901,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt volumeRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterVolume);
Results.Entities.MeterTestRslt energyRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterEnergy);
@ -959,7 +959,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
///
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);
GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i];

View File

@ -903,7 +903,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative
///
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux);
@ -975,7 +975,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt volumeRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterVolume);
Results.Entities.MeterTestRslt energyRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterEnergy);
@ -1033,7 +1033,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative
///
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
/// MetersKind.Single meters
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);

View File

@ -797,7 +797,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
///
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux);
@ -869,7 +869,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt volumeRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterVolume);
Results.Entities.MeterTestRslt energyRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterEnergy);
@ -927,7 +927,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
///
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
/// MetersKind.Single meters
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);

View File

@ -788,7 +788,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
///
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux);
@ -860,7 +860,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt volumeRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterVolume);
Results.Entities.MeterTestRslt energyRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterEnergy);
@ -918,7 +918,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
///
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
/// MetersKind.Single meters
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);

View File

@ -535,7 +535,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection
///
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux);
@ -594,7 +594,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection
///
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
/// MetersKind.Single meters
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);

View File

@ -301,7 +301,7 @@ namespace TBF.BenchControl.TestMethods.LeakTest
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
if (StateMachine.Procedure.MetersKind == MetersKind.Single)
{

View File

@ -212,7 +212,7 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
if (StateMachine.Procedure.MetersKind == MetersKind.Single)
{

View File

@ -403,7 +403,7 @@ namespace TBF.BenchControl.TestMethods.PulsesTest
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.Single);
GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i];

View File

@ -403,7 +403,7 @@ namespace TBF.BenchControl.TestMethods.PulsesTestManual
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.Single);
GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i];

View File

@ -242,7 +242,10 @@ namespace TBF.BenchControl.TestMethods.SensitivityTest
}
int time = StateMachine.Time;
/// TODO: !!! The following can only be done for compound meters
int diff = RegisterReaders[(test.Part - 1) * 2 + 1].WMPulses - lastWMPulses[(test.Part - 1) * 2 + 1];
flowsForDetection[0] = cBrd.ReferenceFreq * outPath.FlowMeter.NominalFlow / 2000.0f;
pulseFreqsForDetection[0] = (float)diff / (float)(time - lastTime);
lastTime = StateMachine.Time;

View File

@ -809,7 +809,7 @@ namespace TBF
if (e.SubItem == (int)MtrlgyClmn.Part)
{
if (e.DisplayText.Equals("-")) return; /// OK
if (!int.TryParse(e.DisplayText, out dummy) || dummy < 1 || dummy > Config.Data.MaxPartNr)
if (!int.TryParse(e.DisplayText, out dummy) || !Test.IsGoodPartNr(dummy))
{
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
e.Cancel = true;
@ -1114,7 +1114,7 @@ namespace TBF
if (e.SubItem == (int)Mtrlgy2Clmn.Part)
{
if (e.DisplayText.Equals("-")) return; /// OK
if (!int.TryParse(e.DisplayText, out dummy) || dummy < 1 || dummy > Config.Data.MaxPartNr)
if (!int.TryParse(e.DisplayText, out dummy) || !Test.IsGoodPartNr(dummy))
{
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
e.Cancel = true;
@ -1357,8 +1357,8 @@ namespace TBF
if (e.SubItem == (int)ProcessClmn.Part)
{
if (e.DisplayText.Equals("-")) return; /// OK
if (!int.TryParse(e.DisplayText, out dummy) || dummy < 1 || dummy > 3)
{
if (!int.TryParse(e.DisplayText, out dummy) || !Test.IsGoodPartNr(dummy))
{
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
e.Cancel = true;
return; /// NOK
@ -1596,8 +1596,8 @@ namespace TBF
if (e.SubItem == (int)ParametersClmn.Part)
{
if (e.DisplayText.Equals("-")) return; /// OK
if (!int.TryParse(e.DisplayText, out dummy) || dummy < 1 || dummy > 3)
{
if (!int.TryParse(e.DisplayText, out dummy) || !Test.IsGoodPartNr(dummy))
{
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
e.Cancel = true;
return; /// NOK

View File

@ -261,8 +261,8 @@ namespace TBF
if (combined) return wmNr1;
int wmPartSize = 1 + (wmNr1 - 1) / Config.Data.LineSize;
return wmPartSize;
int wmPartNr = 1 + (wmNr1 - 1) / Config.Data.LineSize;
return wmPartNr;
}
/// <summary>