diff --git a/Results/DB.cs b/Results/DB.cs index 1bc7a5d0f..3eee27365 100644 --- a/Results/DB.cs +++ b/Results/DB.cs @@ -11,6 +11,7 @@ using NHibernate.Cfg; using NHibernate.Tool.hbm2ddl; using Common; using Results.Entities; +using Results.Entities.helpers; namespace Results { @@ -267,9 +268,17 @@ namespace Results { log.Debug(tstRslt.ToString(1)); } - + + // Save batch, TestRslt, WaterMeter, MeterTestRslt, etc. session.SaveOrUpdate(batch); + // Important: after this, TestRslt.Id should be generated + session.Flush(); + + // Optional table support + SolveSaveCalibFactors(batch, session); + + //Commit - store results transaction.Commit(); } catch (Exception exc) @@ -290,6 +299,45 @@ namespace Results return true; } + private static void SolveSaveCalibFactors(Batch batch, ISession session) + { + bool hasCalibrationFactors = false; + + foreach (var tstRslt in batch.TestRslts) + { + if (tstRslt.CalibFactorResultsToSave != null && + tstRslt.CalibFactorResultsToSave.Count > 0) + { + hasCalibrationFactors = true; + break; + } + } + + if (hasCalibrationFactors) + { + TestRsltCalibFactorHelper.CreateTableIfNotExists(session); + + foreach (var tstRslt in batch.TestRslts) + { + if (tstRslt.CalibFactorResultsToSave == null || + tstRslt.CalibFactorResultsToSave.Count == 0) + { + continue; + } + + TestRsltCalibFactorHelper.DeleteByTestRsltIdNoTransaction(session, tstRslt.Id); + + foreach (var calib in tstRslt.CalibFactorResultsToSave) + { + calib.TestRslt = tstRslt; + calib.ErrorStr = TestRsltCalibFactorHelper.Truncate(calib.ErrorStr, 240); + + session.SaveOrUpdate(calib); + } + } + } + } + public static Batch LoadBatch(int batchNr) { @@ -316,6 +364,15 @@ namespace Results batch.WaterMeters = session.QueryOver() .Where(x => (x.Batch.Id == batch.Id)) .List(); + + TestRsltCalibFactorHelper.CreateTableIfNotExists(session); + + foreach (var tstRslt in batch.TestRslts) + { + tstRslt.CalibFactorResultsToSave = TestRsltCalibFactorHelper.GetByTestRsltId( session, tstRslt.Id); + } + + } return (batches.Count > 0) ? batches[0] : null; diff --git a/Results/Entities/MeterTestCalibFactorRslt.cs b/Results/Entities/MeterTestCalibFactorRslt.cs new file mode 100644 index 000000000..bd6e13e4e --- /dev/null +++ b/Results/Entities/MeterTestCalibFactorRslt.cs @@ -0,0 +1,37 @@ +namespace Results.Entities +{ + public class MeterTestCalibFactorRslt + { + public virtual int Id { get; protected set; } + + public virtual MeterTestRslt MeterTestRslt { get; set; } + + /// 1, 2, 3 - calculated calib factor index + public virtual int CalibFactorIndex { get; set; } + + /// Base calib factor originally set in meter + public virtual int BaseCalibFactor { get; set; } + + /// Newly calculated calib factor + public virtual int CalculatedCalibFactor { get; set; } + + /// true = calculated value was stored/written to meter + public virtual bool Stored { get; set; } + + public virtual string ErrorStr { get; set; } // max 240 chars + + public virtual double TimeStart { get; set; } + public virtual double TimeEnd { get; set; } + + public virtual double CalibRawStart { get; set; } + public virtual double CalibRawEnd { get; set; } + + public virtual double Error { get; set; } + + public MeterTestCalibFactorRslt() + { + Stored = false; + ErrorStr = string.Empty; + } + } +} \ No newline at end of file diff --git a/Results/Entities/TestRslt.cs b/Results/Entities/TestRslt.cs index 4f3e5afe4..d96816c72 100644 --- a/Results/Entities/TestRslt.cs +++ b/Results/Entities/TestRslt.cs @@ -151,6 +151,11 @@ namespace Results.Entities public virtual int Counter3 { get; set; } public virtual int Counter4 { get; set; } public virtual int Counter5 { get; set; } + + /// + /// Not maped table - exist only in Genesis DB !! + /// + public virtual IList CalibFactorResultsToSave { get; set; } /// Wrappers public virtual string Name() { return Common.Utils.GetTestName(TestData.Name, TestData.Repeats, RepetitionNr); } @@ -266,15 +271,27 @@ namespace Results.Entities MethodClass = string.Empty; Remark = string.Empty; + + CalibFactorResultsToSave = new List(); } - public TestRslt(Batch batch, TestData testData, int part, int repetitionNr) + public TestRslt( + Batch batch, + TestData testData, + int part, + int repetitionNr) + : this(batch, testData, part, repetitionNr, null) + { + } + + public TestRslt(Batch batch, TestData testData, int part, int repetitionNr, List calibFactor) : this() { Batch = batch; TestData = testData; Part = part; RepetitionNr = repetitionNr; + CalibFactorResultsToSave = calibFactor != null ? new List(calibFactor) : new List(); } public virtual void CopyContentFrom(TestRslt src) diff --git a/Results/Entities/TestRsltCalibFactor.cs b/Results/Entities/TestRsltCalibFactor.cs new file mode 100644 index 000000000..36c771422 --- /dev/null +++ b/Results/Entities/TestRsltCalibFactor.cs @@ -0,0 +1,34 @@ +namespace Results.Entities +{ + public class TestRsltCalibFactor + { + public virtual int Id { get; protected set; } + + public virtual TestRslt TestRslt { get; set; } + + public virtual int CalibFactorIndex { get; set; } // 1, 2, 3 + + public virtual int BaseCalibFactor { get; set; } + public virtual int CalculatedCalibFactor { get; set; } + + public virtual bool Stored { get; set; } + + public virtual string ErrorStr { get; set; } // varchar(240) + + public virtual double TimeStart { get; set; } + public virtual double TimeEnd { get; set; } + + public virtual double CalibRawStart { get; set; } + public virtual double CalibRawEnd { get; set; } + + public virtual double Error { get; set; } + public virtual double VolumeStart { get; set; } + public virtual double VolumeEnd { get; set; } + + public TestRsltCalibFactor() + { + Stored = false; + ErrorStr = string.Empty; + } + } +} \ No newline at end of file diff --git a/Results/Entities/helpers/TestRsltCalibFactorHelper.cs b/Results/Entities/helpers/TestRsltCalibFactorHelper.cs new file mode 100644 index 000000000..b0c6befa4 --- /dev/null +++ b/Results/Entities/helpers/TestRsltCalibFactorHelper.cs @@ -0,0 +1,109 @@ +using System.Collections.Generic; +using NHibernate; + +namespace Results.Entities.helpers +{ + public static class TestRsltCalibFactorHelper + { + public static bool TableExists(ISession session) + { + try + { + session.CreateSQLQuery( "SELECT 1 FROM TestRsltCalibFactor LIMIT 1") + .UniqueResult(); + + return true; + } + catch + { + return false; + } + } + + public static void DeleteByTestRsltIdNoTransaction( + ISession session, + int testRsltId) + { + session.CreateSQLQuery(@" DELETE FROM TestRsltCalibFactor WHERE TestRsltId = :testRsltId") + .SetParameter("testRsltId", testRsltId) + .ExecuteUpdate(); + } + + public static IList GetByTestRsltId( + ISession session, + int testRsltId) + { + return session.QueryOver() + .Where(x => x.TestRslt.Id == testRsltId) + .OrderBy(x => x.CalibFactorIndex).Asc + .List(); + } + + public static string Truncate(string value, int maxLength) + { + if (string.IsNullOrEmpty(value)) + return string.Empty; + + return value.Length <= maxLength + ? value + : value.Substring(0, maxLength); + } + + public static void CreateTableIfNotExists(ISession session) + { + if (TableExists(session)) + return; + + string sql; + + if (DB.DbType == Common.DBType.MySql) + { + sql = @" +CREATE TABLE IF NOT EXISTS TestRsltCalibFactor ( + Id INT NOT NULL AUTO_INCREMENT, + TestRsltId INT NOT NULL, + CalibFactorIndex INT NOT NULL, + BaseCalibFactor INT NOT NULL, + CalculatedCalibFactor INT NOT NULL, + Stored BIT NOT NULL, + ErrorStr VARCHAR(240) NULL, + TimeStart DOUBLE NOT NULL, + TimeEnd DOUBLE NOT NULL, + CalibRawStart DOUBLE NOT NULL, + CalibRawEnd DOUBLE NOT NULL, + Error DOUBLE NOT NULL, + VolumeStart DOUBLE NOT NULL, + VolumeEnd DOUBLE NOT NULL, + PRIMARY KEY (Id), + INDEX IX_TestRsltCalibFactor_TestRsltId (TestRsltId), + CONSTRAINT FK_TestRsltCalibFactor_TestRslt + FOREIGN KEY (TestRsltId) REFERENCES TestRslt(Id) + ON DELETE CASCADE +);"; + } + else + { + sql = @" +CREATE TABLE IF NOT EXISTS TestRsltCalibFactor ( + Id INTEGER PRIMARY KEY AUTOINCREMENT, + TestRsltId INTEGER NOT NULL, + CalibFactorIndex INTEGER NOT NULL, + BaseCalibFactor INTEGER NOT NULL, + CalculatedCalibFactor INTEGER NOT NULL, + Stored INTEGER NOT NULL, + ErrorStr VARCHAR(240) NULL, + TimeStart DOUBLE NOT NULL, + TimeEnd DOUBLE NOT NULL, + CalibRawStart DOUBLE NOT NULL, + CalibRawEnd DOUBLE NOT NULL, + Error DOUBLE NOT NULL, + VolumeStart DOUBLE NOT NULL, + VolumeEnd DOUBLE NOT NULL, + FOREIGN KEY (TestRsltId) REFERENCES TestRslt(Id) ON DELETE CASCADE +);"; + } + + session.CreateSQLQuery(sql).ExecuteUpdate(); + } + } +} \ No newline at end of file diff --git a/Results/Mappings/MeterTestCalibFactorRsltMap.cs b/Results/Mappings/MeterTestCalibFactorRsltMap.cs new file mode 100644 index 000000000..8c0d391b6 --- /dev/null +++ b/Results/Mappings/MeterTestCalibFactorRsltMap.cs @@ -0,0 +1,36 @@ +using FluentNHibernate.Mapping; +using Results.Entities; + +namespace Results.Mappings +{ + public class MeterTestCalibFactorRsltMap : ClassMap + { + public MeterTestCalibFactorRsltMap() + { + Id(x => x.Id); + + References(x => x.MeterTestRslt) + .Not.Nullable() + .Cascade.None(); + + Map(x => x.CalibFactorIndex).Not.Nullable(); + + Map(x => x.BaseCalibFactor).Not.Nullable(); + Map(x => x.CalculatedCalibFactor).Not.Nullable(); + + Map(x => x.Stored).Not.Nullable(); + + Map(x => x.ErrorStr) + .Length(240) + .Nullable(); + + Map(x => x.TimeStart).Not.Nullable(); + Map(x => x.TimeEnd).Not.Nullable(); + + Map(x => x.CalibRawStart).Not.Nullable(); + Map(x => x.CalibRawEnd).Not.Nullable(); + + Map(x => x.Error).Not.Nullable(); + } + } +} \ No newline at end of file diff --git a/Results/Mappings/TestRsltCalibFactorMap.cs b/Results/Mappings/TestRsltCalibFactorMap.cs new file mode 100644 index 000000000..5a0764afc --- /dev/null +++ b/Results/Mappings/TestRsltCalibFactorMap.cs @@ -0,0 +1,41 @@ +using FluentNHibernate.Mapping; +using Results.Entities; + +namespace Results.Mappings +{ + class TestRsltCalibFactorMap : ClassMap + { + public TestRsltCalibFactorMap() + { + Id(x => x.Id); + + References(x => x.TestRslt) + .Column("TestRsltId") + .Not.Nullable(); + + Map(x => x.CalibFactorIndex).Not.Nullable(); + + Map(x => x.BaseCalibFactor).Not.Nullable(); + Map(x => x.CalculatedCalibFactor).Not.Nullable(); + + Map(x => x.Stored).Not.Nullable(); + + Map(x => x.ErrorStr) + .Length(240) + .Nullable(); + + Map(x => x.TimeStart).Not.Nullable(); + Map(x => x.TimeEnd).Not.Nullable(); + + Map(x => x.CalibRawStart).Not.Nullable(); + Map(x => x.CalibRawEnd).Not.Nullable(); + + Map(x => x.Error).Not.Nullable(); + + Map(x => x.VolumeStart).Not.Nullable(); + Map(x => x.VolumeEnd).Not.Nullable(); + + + } + } +} \ No newline at end of file diff --git a/Results/Results.csproj b/Results/Results.csproj index c19b74969..f0dc793c6 100644 --- a/Results/Results.csproj +++ b/Results/Results.csproj @@ -69,12 +69,15 @@ + + + @@ -132,11 +135,13 @@ + + diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index 398ed7b03..8cca50798 100644 --- a/TBF/Properties/AssemblyInfo.cs +++ b/TBF/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("3.9.3104.1")] -[assembly: AssemblyFileVersion("3.9.3104.1")] +[assembly: AssemblyVersion("3.9.3109.1")] +[assembly: AssemblyFileVersion("3.9.3109.1")] diff --git a/TBF/Rig/RegisterReaders/CommonRR/IPerl/IiPerlTestMethodCfg.cs b/TBF/Rig/RegisterReaders/CommonRR/IPerl/IiPerlTestMethodCfg.cs index b6185464b..2a5c9ae66 100644 --- a/TBF/Rig/RegisterReaders/CommonRR/IPerl/IiPerlTestMethodCfg.cs +++ b/TBF/Rig/RegisterReaders/CommonRR/IPerl/IiPerlTestMethodCfg.cs @@ -16,18 +16,18 @@ namespace TBF.Rig.RegisterReaders.CommonRR.IPerl - public int DfltQ2c_15_rl { get; set; } - public int DfltQ2c_15_lr { get; set; } - public int DfltQ2c_20_rl { get; set; } - public int DfltQ2c_20_lr { get; set; } - public int DfltQ2c_25_63_rl { get; set; } - public int DfltQ2c_25_63_lr { get; set; } - public int DfltQ2c_25_10_rl { get; set; } - public int DfltQ2c_25_10_lr { get; set; } - public int DfltQ2c_32_rl { get; set; } - public int DfltQ2c_32_lr { get; set; } - public int DfltQ2c_40_rl { get; set; } - public int DfltQ2c_40_lr { get; set; } + public int CalibFactor1InchCh1 { get; set; } + public int CalibFactor1InchCh2 { get; set; } + public int CalibFactor2InchCh1 { get; set; } + public int CalibFactor2InchCh2 { get; set; } + public int CalibFactor3InchCh1 { get; set; } + public int CalibFactor3InchCh2 { get; set; } + public int CalibFactor4InchCh1 { get; set; } + public int CalibFactor4InchCh2 { get; set; } + public int CalibFactor6InchCh1 { get; set; } + public int CalibFactor6InchCh2 { get; set; } + public int CalibFactor6MoreInchCh1 { get; set; } + public int CalibFactor6MoreInchCh2 { get; set; } public bool UseWebService { get; set; } public string BaseUrl { get; set; } diff --git a/TBF/Rig/RegisterReaders/GenesisRegReader/communication/GciBridgeClient.cs b/TBF/Rig/RegisterReaders/GenesisRegReader/communication/GciBridgeClient.cs new file mode 100644 index 000000000..6b30084c8 --- /dev/null +++ b/TBF/Rig/RegisterReaders/GenesisRegReader/communication/GciBridgeClient.cs @@ -0,0 +1,49 @@ +using System.Threading; +using System.Threading.Tasks; +using GenesisCordonelInterface.API; +using GenesisCordonelInterface.Core.Threading; +using TBF.Rig.BridgeComponents.GciBridge; + + +namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication +{ + public class GciBridgeClient : IGciBridgeClient + { + private readonly GciBridge bridge; + + public GciBridgeClient(GciBridge bridge) + { + this.bridge = bridge; + } + + public Task> + ReadRegisterWithRetryAsync( + int slotId, + string registerName, + CancellationToken token = default) + { + return bridge.ReadRegisterWithRetryAsync( + slotId, + registerName, + token); + } + + public Task> + WriteRegisterWithRetryAsync( + int slotId, + string registerName, + ushort value, + bool verify, + bool throwOnError, + CancellationToken token = default) + { + return bridge.WriteRegisterWithRetryAsync( + slotId, + registerName, + value, + verify, + throwOnError, + token); + } + } +} \ No newline at end of file diff --git a/TBF/Rig/RegisterReaders/GenesisRegReader/communication/IGciBridgeClient.cs b/TBF/Rig/RegisterReaders/GenesisRegReader/communication/IGciBridgeClient.cs new file mode 100644 index 000000000..f94a88e2e --- /dev/null +++ b/TBF/Rig/RegisterReaders/GenesisRegReader/communication/IGciBridgeClient.cs @@ -0,0 +1,25 @@ +using System.Threading; +using System.Threading.Tasks; +using GenesisCordonelInterface.API; +using GenesisCordonelInterface.Core.Threading; + +namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication +{ + public interface IGciBridgeClient + { + Task> + ReadRegisterWithRetryAsync( + int slotId, + string registerName, + CancellationToken token = default); + + Task> + WriteRegisterWithRetryAsync( + int slotId, + string registerName, + ushort value, + bool verify, + bool throwOnError, + CancellationToken token = default); + } +} \ No newline at end of file diff --git a/TBF/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTest.cs b/TBF/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTest.cs index d0e3cd6b0..b56846ba7 100644 --- a/TBF/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTest.cs +++ b/TBF/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTest.cs @@ -2,11 +2,16 @@ using System; using System.Threading; using System.Threading.Tasks; using Common; +using Config.Entities; using GenesisCordonelInterface.API; using log4net; +using Results.Entities; +using Results.Entities.helpers; using TBF.Rig.BridgeComponents.GciBridge; using TBF.Rig.RegisterReaders.GenesisRegReader.communication.common; using TBF.Rig.RegisterReaders.GenesisRegReader.implementations; +using TBF.Rig.Sequences; +using TBF.Rig.TestMethods.GenesisCommunication; using TBF.Rig.TestMethods.iPerlCommunication.communication.C4.diagnosticLed; @@ -1468,7 +1473,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication if (gciBridge == null) return string.Empty; CancellationToken token = default; - + bool areInitialisedData = genesisSmartReader.CalculateQ3Calibration(); if (!areInitialisedData) { @@ -1565,20 +1570,23 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication } - public string PrepareQ3Calibration() + public string PrepareQ3Calibration(TestMethodCfg cfg, Test test) { if (genesisHead != null && genesisHead.DebugLevel == DebugMode.Simulate) { log.Debug("Connect() - Simulated response"); return ResultOk;//"Simulated Connect"; } - return Task.Run(() => PrepareQ3Calibration_Async(genesisHead)) + return Task.Run(() => PrepareQ3Calibration_Async(genesisHead, cfg, test)) .GetAwaiter() .GetResult(); } - private async Task PrepareQ3Calibration_Async(GenesisSmartReader genesisSmartReader) + private async Task PrepareQ3Calibration_Async( + GenesisSmartReader genesisSmartReader, + TestMethodCfg cfg, + Test test) { try { @@ -1588,32 +1596,51 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication if (string.IsNullOrEmpty(genesisHead.CommInterface)) return string.Empty; GciBridge gciBridge = genesisHead.CommInterfaceBridge; if (gciBridge == null) return string.Empty; + + if (test == null) return "Valid Test Missing!"; + Results.Entities.TestRslt tstRslt = ProcessData.BatchRslts.GetTestRslt(test.Name, test.Part); + log.Debug($"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - Test: {test.Name} - Part: {test.Part} - IsTestRslt: {(tstRslt==null?true:false)}"); + + if (tstRslt.CalibFactorResultsToSave.Count == 0) + { + for (int i = 0; i < genesisSmartReader.ChannelsCount; i++) + { + tstRslt.CalibFactorResultsToSave.Add(new TestRsltCalibFactor()); + } + } CancellationToken token = default; //Get Activity Status LedState ledMode = LedState.active; // swich on LED byte valueLed = (ledMode == LedState.active) ? (byte)6 : (byte)0; - UInt16 valueCalibrate = 15625; + //TODO BUMI - implement variable values for Q3Calibration UInt16 valueSampleRate = 10; + + //TODO BUMI - implement variable values for Q3Calibration - be shure is implemented in Head + string prepareMeterSizeAndCalibration = await PrepareMeterSizeAndCalibration(genesisSmartReader, cfg, gciBridge, token); + if (prepareMeterSizeAndCalibration != ResultOk) + { + log.Error($"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - prepareMeterSizeAndCalibration failed. Result: {prepareMeterSizeAndCalibration}"); + return prepareMeterSizeAndCalibration; + } log.Debug( $"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - Start - Set Led Mode: {valueLed}"); - - var CalFactor1AsyncResult = await gciBridge.WriteRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, RadioService.CalFactor1, valueCalibrate, false, false, token); + var CalFactor1AsyncResult = await gciBridge.WriteRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, RadioService.CalFactor1, genesisSmartReader.Q3CalibValue[0], false, false, token); if (CalFactor1AsyncResult == null || !CalFactor1AsyncResult.Success) { log.Error( $"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - CalFactor1AsyncResult failed. Result: {CalFactor1AsyncResult}"); return "Failed to disable Led Mode"; } - var CalFactor2AsyncResult = await gciBridge.WriteRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, RadioService.CalFactor2, valueCalibrate, false, false, token); + var CalFactor2AsyncResult = await gciBridge.WriteRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, RadioService.CalFactor2, genesisSmartReader.Q3CalibValue[1], false, false, token); if (CalFactor2AsyncResult == null || !CalFactor2AsyncResult.Success) { log.Error( $"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - CalFactor2AsyncResult failed. Result: {CalFactor2AsyncResult}"); return "Failed to disable Led Mode"; } - var CalFactor3AsyncResult = await gciBridge.WriteRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, RadioService.CalFactor3, valueCalibrate, false, false, token); + var CalFactor3AsyncResult = await gciBridge.WriteRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, RadioService.CalFactor3, genesisSmartReader.Q3CalibValue[2], false, false, token); if (CalFactor3AsyncResult == null || !CalFactor3AsyncResult.Success) { log.Error( $"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - CalFactor3AsyncResult failed. Result: {CalFactor3AsyncResult}"); @@ -1644,7 +1671,120 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication return ex.Message; } } + + private static async Task PrepareMeterSizeAndCalibration(GenesisSmartReader genesisSmartReader, TestMethodCfg cfg, + GciBridge gciBridge, CancellationToken token) + { + UInt16 valueCalibrate = 15625; //Predefined Calibration Value + try + { + if (cfg != null) + { + var MeterSizeAsyncResult = await gciBridge.ReadRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, + RadioService.MeterSize, token); + + if (MeterSizeAsyncResult == null || !MeterSizeAsyncResult.Success) + { + log.Error($"PrepareMeterSizeAndCalibration( Slot: {genesisSmartReader.GetSlotNr}) - Error reading MeterSize register. Result: {MeterSizeAsyncResult}"); + return "Error reading MeterSize register"; + } + + string rawHex = MeterSizeAsyncResult.Result?.RawHex; + if (string.IsNullOrWhiteSpace(rawHex)) + { + log.Error( + $"PrepareMeterSizeAndCalibration( Slot: {genesisSmartReader.GetSlotNr}) - MeterSize RawHex is empty"); + return "MeterSize RawHex is empty"; + } + + uint meterSizeRaw = ParseRawHexToUInt32(rawHex); + + // If register returns 4 bytes like "00 00 00 02", this gives 2. + // If it returns "02", this also gives 2. + if (meterSizeRaw > ushort.MaxValue) + { + log.Error( + $"PrepareMeterSizeAndCalibration( Slot: {genesisSmartReader.GetSlotNr}) - MeterSize too large. RawHex='{rawHex}', Value={meterSizeRaw}"); + return "MeterSize value too large"; + } + + ushort int16MeterSize = (ushort)meterSizeRaw; + + double[] dSize = cfg.GetQ3CalibrationBySizeDoubles(int16MeterSize); + if (dSize == null || dSize.Length != 3) + { + log.Info( + $"PrepareMeterSizeAndCalibration( Slot: {genesisSmartReader.GetSlotNr}) - Problem with Q3Calibration calculation. Size: {int16MeterSize}"); + return ResultNok; + } + + genesisSmartReader + .SetQ3Calibration(dSize); // new double[]{valueCalibrate,valueCalibrate,valueCalibrate} + log.Info( + $"PrepareMeterSizeAndCalibration( Slot: {genesisSmartReader.GetSlotNr}) - Based MeterSize: {int16MeterSize} Set Q3Calibration: CH1({dSize[0]}), CH2({dSize[1]}), CH3({dSize[2]})"); + } + else + { + genesisSmartReader.SetQ3Calibration(new double[] + { valueCalibrate, valueCalibrate, valueCalibrate }); + } + }catch(Exception ex) + { + log.Error($"PrepareMeterSizeAndCalibration( Slot: {genesisSmartReader.GetSlotNr}) - Error during Q3Calibration calculation: {ex.Message}"); + genesisSmartReader.SetQ3Calibration(new double[] + { valueCalibrate, valueCalibrate, valueCalibrate }); + return ResultNok; + } + + return ResultOk; + } + /// + /// Used for test only. + /// + /// + /// + /// + /// + private static string PrepareCalibrationFromMeterSizeRawHex( + GenesisSmartReader genesisSmartReader, + TestMethodCfg cfg, + string rawHex) + { + ushort valueCalibrate = 15625; + + if (cfg == null) + { + genesisSmartReader.SetQ3Calibration(new double[] + { + valueCalibrate, + valueCalibrate, + valueCalibrate + }); + + return ResultOk; + } + + if (string.IsNullOrWhiteSpace(rawHex)) + return "MeterSize RawHex is empty"; + + uint meterSizeRaw = ParseRawHexToUInt32(rawHex); + + if (meterSizeRaw > ushort.MaxValue) + return "MeterSize value too large"; + + ushort meterSize = (ushort)meterSizeRaw; + + double[] dSize = cfg.GetQ3CalibrationBySizeDoubles(meterSize); + + if (dSize == null || dSize.Length != 3) + return ResultNok; + + genesisSmartReader.SetQ3Calibration(dSize); + + return ResultOk; + } + public string CheckMeterPrepare() { if (genesisHead != null && genesisHead.DebugLevel == DebugMode.Simulate) @@ -1681,13 +1821,20 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication return "Failed to disable Led Mode"; } - ushort int16 = Convert.ToUInt16(TriggerIdleAsyncResult.RawHex, 16); - if (int16 == 0) + try { - log.Debug("Already set "); - return ResultOk; + UInt32 int32 = ParseRawHexToUInt32(TriggerIdleAsyncResult.RawHex); + if (int32 == 0) + { + log.Debug("Already set "); + return ResultOk; + } } - + catch (Exception ex) + { + log.Error( $"CheckMeterPrepare_Async( Slot: {genesisSmartReader.GetSlotNr}) - CheckMeterPrepare failed. Result: {TriggerIdleAsyncResult}"); + } + var CalFactor2AsyncResult = await gciBridge.WriteRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, RadioService.TriggerIdle, valueTrigerIdle, false, false, token); if (CalFactor2AsyncResult == null || !CalFactor2AsyncResult.Success) { @@ -1706,5 +1853,46 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication return ex.Message; } } + + private static uint ParseRawHexToUInt32(string rawHex, bool littleEndian = false) + { + if (string.IsNullOrWhiteSpace(rawHex)) + throw new FormatException("RawHex is empty."); + + // Remove spaces/tabs/newlines + string cleaned = rawHex.Replace(" ", "") + .Replace("\t", "") + .Replace("\r", "") + .Replace("\n", ""); + + // Must be even number of hex chars + if (cleaned.Length % 2 != 0) + throw new FormatException($"Invalid hex length: {cleaned.Length}"); + + // Max 4 bytes = 8 hex chars + if (cleaned.Length > 8) + throw new FormatException($"Too many bytes for UInt32: '{rawHex}'"); + + byte[] bytes = new byte[cleaned.Length / 2]; + + for (int i = 0; i < bytes.Length; i++) + { + bytes[i] = Convert.ToByte(cleaned.Substring(i * 2, 2), 16); + } + + if (littleEndian) + Array.Reverse(bytes); + + uint value = 0; + + foreach (byte b in bytes) + { + value = (value << 8) | b; + } + + return value; + } + + } } \ No newline at end of file diff --git a/TBF/Rig/RegisterReaders/GenesisRegReader/communication/RadioService.cs b/TBF/Rig/RegisterReaders/GenesisRegReader/communication/RadioService.cs index 9d408e0db..8f71a8951 100644 --- a/TBF/Rig/RegisterReaders/GenesisRegReader/communication/RadioService.cs +++ b/TBF/Rig/RegisterReaders/GenesisRegReader/communication/RadioService.cs @@ -400,6 +400,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication public static readonly String ForwardArrow = "GENESISFLOW_ForwardArrow"; public static readonly String StoreCalibration = "GENESISFLOW_StoreCalibration"; public static readonly String TriggerIdle = "GENESISFLOW_TriggerIdle"; + public static readonly String MeterSize = "GENESISFLOW_MeterSize"; public async Task GetActivityLedStatusMode_Async( GenesisSmartReader iHead, diff --git a/TBF/Rig/RegisterReaders/GenesisRegReader/implementations/GenesisSmartReader.cs b/TBF/Rig/RegisterReaders/GenesisRegReader/implementations/GenesisSmartReader.cs index 4395c6ff6..cceaa6379 100644 --- a/TBF/Rig/RegisterReaders/GenesisRegReader/implementations/GenesisSmartReader.cs +++ b/TBF/Rig/RegisterReaders/GenesisRegReader/implementations/GenesisSmartReader.cs @@ -215,6 +215,8 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations } + public int ChannelsCount { get => iChanelsCount; } + private static int iChanelsCount = 3; private int firstChanel; @@ -1340,8 +1342,8 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations PrepareCalculatedChannelData(); try { - log.DebugFormat("DataStreamPostProcessing() - harcoded call GetQ3Calibration(200.0, 120.0, 15625.0);"); - SetQ3Calibration(new double[]{15625.0,15625.0,15625.0 }); + log.DebugFormat("DataStreamPostProcessing() - harcoded call GetQ3Calibration(200.0, 120.0, 17969.0);"); + SetQ3Calibration(new double[]{17969.0,17969.0,17969.0 }); CalculateQ3Calibration(200.0, 120.0); } catch (Exception ex) @@ -3958,7 +3960,8 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations public int GetSlotNr { get => genesisHeadCfg?.SlotNr ?? -1; } - void SetQ3Calibration(double[] q3CalibInitial) { this.q3CalibInitial = q3CalibInitial; } + //TODO BUMI implement variable values for Q3Calibration! + public void SetQ3Calibration(double[] q3CalibInitial) { this.q3CalibInitial = q3CalibInitial; } private double refVolume = double.NaN; private double refTime = double.NaN; diff --git a/TBF/Rig/TestMethods/FlyingStart/FlyingStartSeq.cs b/TBF/Rig/TestMethods/FlyingStart/FlyingStartSeq.cs index 5f6930bde..29e0e9665 100644 --- a/TBF/Rig/TestMethods/FlyingStart/FlyingStartSeq.cs +++ b/TBF/Rig/TestMethods/FlyingStart/FlyingStartSeq.cs @@ -990,16 +990,52 @@ namespace TBF.Rig.TestMethods.FlyingStart { CalculateMeterResults(chanelXMeterRslt, genesisSmart, tstRslt, genesisSmart.TimestampSecStartRawCh1, genesisSmart.TimestampSecEndRawCh1, genesisSmart.VolumeLtrStartRawCh1, genesisSmart.VolumeLtrEndRawCh1); + + //store in table + TestRsltCalibFactor testRsltCalibFactor = new TestRsltCalibFactor() + { + TestRslt = chanelXMeterRslt.TestRslt, + + TimeStart = genesisSmart.TimestampSecStartRawCh1, + TimeEnd = genesisSmart.TimestampSecEndRawCh1, + VolumeStart = genesisSmart.VolumeLtrStartRawCh1, + VolumeEnd = genesisSmart.VolumeLtrEndRawCh1, + }; + tstRslt.CalibFactorResultsToSave.Add(testRsltCalibFactor); } else if (iCH == 1) { CalculateMeterResults(chanelXMeterRslt, genesisSmart, tstRslt, genesisSmart.TimestampSecStartRawCh2, genesisSmart.TimestampSecEndRawCh2, genesisSmart.VolumeLtrStartRawCh2, genesisSmart.VolumeLtrEndRawCh2); + + //store in table + TestRsltCalibFactor testRsltCalibFactor = new TestRsltCalibFactor() + { + TestRslt = chanelXMeterRslt.TestRslt, + + TimeStart = genesisSmart.TimestampSecStartRawCh2, + TimeEnd = genesisSmart.TimestampSecEndRawCh2, + VolumeStart = genesisSmart.VolumeLtrStartRawCh2, + VolumeEnd = genesisSmart.VolumeLtrEndRawCh2, + }; + tstRslt.CalibFactorResultsToSave.Add(testRsltCalibFactor); } else if (iCH == 2) { CalculateMeterResults(chanelXMeterRslt, genesisSmart, tstRslt, genesisSmart.TimestampSecStartRawCh3, genesisSmart.TimestampSecEndRawCh3, genesisSmart.VolumeLtrStartRawCh3, genesisSmart.VolumeLtrEndRawCh3); + + //store in table + TestRsltCalibFactor testRsltCalibFactor = new TestRsltCalibFactor() + { + TestRslt = chanelXMeterRslt.TestRslt, + + TimeStart = genesisSmart.TimestampSecStartRawCh3, + TimeEnd = genesisSmart.TimestampSecEndRawCh3, + VolumeStart = genesisSmart.VolumeLtrStartRawCh3, + VolumeEnd = genesisSmart.VolumeLtrEndRawCh3, + }; + tstRslt.CalibFactorResultsToSave.Add(testRsltCalibFactor); } if (!genesisSmart.EnableShowChanels) diff --git a/TBF/Rig/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs b/TBF/Rig/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs index 6cd888cb6..f6cd713b3 100644 --- a/TBF/Rig/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs +++ b/TBF/Rig/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs @@ -1398,6 +1398,18 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection { CalculateMeterResults(chanelXMeterRslt, genesisSmart, tstRslt, genesisSmart.TimestampSecStartRawCh1, genesisSmart.TimestampSecEndRawCh1, genesisSmart.VolumeLtrStartRawCh1, genesisSmart.VolumeLtrEndRawCh1); + + //store in table + TestRsltCalibFactor testRsltCalibFactor = new TestRsltCalibFactor() + { + TestRslt = chanelXMeterRslt.TestRslt, + + TimeStart = genesisSmart.TimestampSecStartRawCh1, + TimeEnd = genesisSmart.TimestampSecEndRawCh1, + VolumeStart = genesisSmart.VolumeLtrStartRawCh1, + VolumeEnd = genesisSmart.VolumeLtrEndRawCh1, + }; + tstRslt.CalibFactorResultsToSave.Add(testRsltCalibFactor); } else if (iCH == 1) { diff --git a/TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfg.cs b/TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfg.cs index 796fad9e2..2908744e3 100644 --- a/TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfg.cs +++ b/TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfg.cs @@ -2,8 +2,10 @@ /// Copyright (c) 2015-2021 Sensus Slovensko a.s. /// +using System; using System.Collections.Generic; using System.IO.Ports; +using System.Linq; using System.Xml.Serialization; using Common; using Config.Entities; @@ -74,18 +76,18 @@ namespace TBF.Rig.TestMethods.GenesisCommunication public int DataBits { get; set; } public Parity ParityBit { get; set; } public StopBits StopBits { get; set; } - public int DfltQ2c_15_rl { get; set; } - public int DfltQ2c_15_lr { get; set; } - public int DfltQ2c_20_rl { get; set; } - public int DfltQ2c_20_lr { get; set; } - public int DfltQ2c_25_63_rl { get; set; } - public int DfltQ2c_25_63_lr { get; set; } - public int DfltQ2c_25_10_rl { get; set; } - public int DfltQ2c_25_10_lr { get; set; } - public int DfltQ2c_32_rl { get; set; } - public int DfltQ2c_32_lr { get; set; } - public int DfltQ2c_40_rl { get; set; } - public int DfltQ2c_40_lr { get; set; } + public int CalibFactor1InchCh1 { get; set; } + public int CalibFactor1InchCh2 { get; set; } + public int CalibFactor2InchCh1 { get; set; } + public int CalibFactor2InchCh2 { get; set; } + public int CalibFactor3InchCh1 { get; set; } + public int CalibFactor3InchCh2 { get; set; } + public int CalibFactor4InchCh1 { get; set; } + public int CalibFactor4InchCh2 { get; set; } + public int CalibFactor6InchCh1 { get; set; } + public int CalibFactor6InchCh2 { get; set; } + public int CalibFactor6MoreInchCh1 { get; set; } + public int CalibFactor6MoreInchCh2 { get; set; } public bool UseWebService { get; set; } public string BaseUrl { get; set; } public string RelativeUrl { get; set; } @@ -93,5 +95,36 @@ namespace TBF.Rig.TestMethods.GenesisCommunication ///Remember to Ignore in XmlSerializer !! [XmlIgnore] public ITestParams TestParams { get; set; } + + public int CalibFactor1InchCh3 { get; set; } + public int CalibFactor2InchCh3 { get; set; } + public int CalibFactor3InchCh3 { get; set; } + public int CalibFactor4InchCh3 { get; set; } + public int CalibFactor6InchCh3 { get; set; } + public int CalibFactor6MoreInchCh3 { get; set; } + + public double[] GetQ3CalibrationBySizeDoubles(ushort int16MeterSize) + { + return GetQ3CalibrationBySizeInts(int16MeterSize).Select(i => (double)i).ToArray(); + } + + public int[] GetQ3CalibrationBySizeInts(ushort int16MeterSize) + { + switch (int16MeterSize) + { + case 0: + return new int[] { CalibFactor1InchCh1, CalibFactor1InchCh2, CalibFactor1InchCh3 }; + case 1: + return new int[] { CalibFactor2InchCh1, CalibFactor2InchCh2, CalibFactor2InchCh3 }; + case 2: + return new int[] { CalibFactor3InchCh1, CalibFactor3InchCh2, CalibFactor3InchCh3 }; + case 3: + return new int[] { CalibFactor4InchCh1, CalibFactor4InchCh2, CalibFactor4InchCh3 }; + case 4: + return new int[] { CalibFactor6InchCh1, CalibFactor6InchCh2, CalibFactor6InchCh3}; + default: + return new int[] { CalibFactor6MoreInchCh1, CalibFactor6MoreInchCh2, CalibFactor6MoreInchCh3}; + } + } } } diff --git a/TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfgCtrl.cs b/TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfgCtrl.cs index 5346ace98..404bc91eb 100644 --- a/TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfgCtrl.cs +++ b/TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfgCtrl.cs @@ -50,18 +50,24 @@ namespace TBF.Rig.TestMethods.GenesisCommunication nrThreadsTextBox.Text = config.NrThreads.ToString(); iperlCheckErrorsToStopTextBox.Text = config.IperlCheckErrorsToStop.ToString(); - textBox15rl.Text = config.DfltQ2c_15_rl.ToString(); - textBox15lr.Text = config.DfltQ2c_15_lr.ToString(); - textBox20rl.Text = config.DfltQ2c_20_rl.ToString(); - textBox20lr.Text = config.DfltQ2c_20_lr.ToString(); - textBox25_63rl.Text = config.DfltQ2c_25_63_rl.ToString(); - textBox25_63lr.Text = config.DfltQ2c_25_63_lr.ToString(); - textBox25_10rl.Text = config.DfltQ2c_25_10_rl.ToString(); - textBox25_10lr.Text = config.DfltQ2c_25_10_lr.ToString(); - textBox32rl.Text = config.DfltQ2c_32_rl.ToString(); - textBox32lr.Text = config.DfltQ2c_32_lr.ToString(); - textBox40rl.Text = config.DfltQ2c_40_rl.ToString(); - textBox40lr.Text = config.DfltQ2c_40_lr.ToString(); + textBoxCh1_15inch.Text = config.CalibFactor1InchCh1.ToString(); + textBoxCh2_15inch.Text = config.CalibFactor1InchCh2.ToString(); + textBoxCh3_15inch.Text = config.CalibFactor1InchCh3.ToString(); + textBoxCh1_2inch.Text = config.CalibFactor2InchCh1.ToString(); + textBoxCh2_2inch.Text = config.CalibFactor2InchCh2.ToString(); + textBoxCh3_2inch.Text = config.CalibFactor2InchCh3.ToString(); + textBoxCh1_3inch.Text = config.CalibFactor3InchCh1.ToString(); + textBoxCh2_3inch.Text = config.CalibFactor3InchCh2.ToString(); + textBoxCh3_3inch.Text = config.CalibFactor3InchCh3.ToString(); + textBoxCh1_4inch.Text = config.CalibFactor4InchCh1.ToString(); + textBoxCh2_4inch.Text = config.CalibFactor4InchCh2.ToString(); + textBoxCh3_4inch.Text = config.CalibFactor4InchCh3.ToString(); + textBoxCh1_6inch.Text = config.CalibFactor6InchCh1.ToString(); + textBoxCh2_6inch.Text = config.CalibFactor6InchCh2.ToString(); + textBoxCh3_6inch.Text = config.CalibFactor6InchCh3.ToString(); + textBoxCh1_6MoreInch.Text = config.CalibFactor6MoreInchCh1.ToString(); + textBoxCh2_6MoreInch.Text = config.CalibFactor6MoreInchCh2.ToString(); + textBoxCh3_6MoreInch.Text = config.CalibFactor6MoreInchCh3.ToString(); useWebServiceCheckBox.Checked = config.UseWebService; baseUrlTextBox.Text = config.BaseUrl; @@ -77,18 +83,24 @@ namespace TBF.Rig.TestMethods.GenesisCommunication nrThreadsTextBox.Enabled = true; iperlCheckErrorsToStopTextBox.Enabled = true; - textBox15rl.Enabled = true; - textBox15lr.Enabled = true; - textBox20rl.Enabled = true; - textBox20lr.Enabled = true; - textBox25_63rl.Enabled = true; - textBox25_63lr.Enabled = true; - textBox25_10rl.Enabled = true; - textBox25_10lr.Enabled = true; - textBox32rl.Enabled = true; - textBox32lr.Enabled = true; - textBox40rl.Enabled = true; - textBox40lr.Enabled = true; + textBoxCh1_15inch.Enabled = true; + textBoxCh2_15inch.Enabled = true; + textBoxCh3_15inch.Enabled = true; + textBoxCh1_2inch.Enabled = true; + textBoxCh2_2inch.Enabled = true; + textBoxCh3_2inch.Enabled = true; + textBoxCh1_3inch.Enabled = true; + textBoxCh2_3inch.Enabled = true; + textBoxCh3_3inch.Enabled = true; + textBoxCh1_4inch.Enabled = true; + textBoxCh2_4inch.Enabled = true; + textBoxCh3_4inch.Enabled = true; + textBoxCh1_6inch.Enabled = true; + textBoxCh2_6inch.Enabled = true; + textBoxCh3_6inch.Enabled = true; + textBoxCh1_6MoreInch.Enabled = true; + textBoxCh2_6MoreInch.Enabled = true; + textBoxCh3_6MoreInch.Enabled = true; useWebServiceCheckBox.Enabled = true; ManageCheckGroupBox(useWebServiceCheckBox, useWebServiceGroupBox); @@ -127,66 +139,42 @@ namespace TBF.Rig.TestMethods.GenesisCommunication message += Environment.NewLine + string.Format(Strings.Invalid_0, iperlCheckErrorsToStopLabel.Text); } - if (!int.TryParse(textBox15rl.Text, out dummy) || dummy < -50 || dummy > 50) - { - flags |= CfgUpdateFlags.Error; - message += Environment.NewLine + "Default Q2 correction factor DN15 RL should be in range -50 .. 50"; - } - if (!int.TryParse(textBox15lr.Text, out dummy) || dummy < -50 || dummy > 50) - { - flags |= CfgUpdateFlags.Error; - message += Environment.NewLine + "Default Q2 correction factor DN15 LR should be in range -50 .. 50"; - } - if (!int.TryParse(textBox20rl.Text, out dummy) || dummy < -50 || dummy > 50) - { - flags |= CfgUpdateFlags.Error; - message += Environment.NewLine + "Default Q2 correction factor DN20 RL should be in range -50 .. 50"; - } - if (!int.TryParse(textBox20lr.Text, out dummy) || dummy < -50 || dummy > 50) - { - flags |= CfgUpdateFlags.Error; - message += Environment.NewLine + "Default Q2 correction factor DN20 LR should be in range -50 .. 50"; - } - if (!int.TryParse(textBox25_63rl.Text, out dummy) || dummy < -50 || dummy > 50) - { - flags |= CfgUpdateFlags.Error; - message += Environment.NewLine + "Default Q2 correction factor DN25 Q3 6.3 RL should be in range -50 .. 50"; - } - if (!int.TryParse(textBox25_63lr.Text, out dummy) || dummy < -50 || dummy > 50) - { - flags |= CfgUpdateFlags.Error; - message += Environment.NewLine + "Default Q2 correction factor DN25 Q3 6.3 LR should be in range -50 .. 50"; - } - if (!int.TryParse(textBox25_10rl.Text, out dummy) || dummy < -50 || dummy > 50) - { - flags |= CfgUpdateFlags.Error; - message += Environment.NewLine + "Default Q2 correction factor DN25 Q3 10 RL should be in range -50 .. 50"; - } - if (!int.TryParse(textBox25_10lr.Text, out dummy) || dummy < -50 || dummy > 50) - { - flags |= CfgUpdateFlags.Error; - message += Environment.NewLine + "Default Q2 correction factor DN25 Q3 10 LR should be in range -50 .. 50"; - } - if (!int.TryParse(textBox32rl.Text, out dummy) || dummy < -50 || dummy > 50) - { - flags |= CfgUpdateFlags.Error; - message += Environment.NewLine + "Default Q2 correction factor DN32 RL should be in range -50 .. 50"; - } - if (!int.TryParse(textBox32lr.Text, out dummy) || dummy < -50 || dummy > 50) - { - flags |= CfgUpdateFlags.Error; - message += Environment.NewLine + "Default Q2 correction factor DN32 LR should be in range -50 .. 50"; - } - if (!int.TryParse(textBox40rl.Text, out dummy) || dummy < -50 || dummy > 50) - { - flags |= CfgUpdateFlags.Error; - message += Environment.NewLine + "Default Q2 correction factor DN40 RL should be in range -50 .. 50"; - } - if (!int.TryParse(textBox40lr.Text, out dummy) || dummy < -50 || dummy > 50) - { - flags |= CfgUpdateFlags.Error; - message += Environment.NewLine + "Default Q2 correction factor DN40 LR should be in range -50 .. 50"; - } + flags = CfgUpdateFlagsQ3(textBoxCh1_15inch.Text,"1.5 inch", ref message, flags, 1); + flags = CfgUpdateFlagsQ3(textBoxCh2_15inch.Text,"1.5 inch", ref message, flags, 2); + flags = CfgUpdateFlagsQ3(textBoxCh3_15inch.Text,"1.5 inch", ref message, flags, 3); + + flags = CfgUpdateFlagsQ3(textBoxCh1_2inch.Text,"2 inch", ref message, flags, 1); + flags = CfgUpdateFlagsQ3(textBoxCh2_2inch.Text,"2 inch", ref message, flags, 2); + flags = CfgUpdateFlagsQ3(textBoxCh3_2inch.Text,"2 inch", ref message, flags, 3); + + flags = CfgUpdateFlagsQ3(textBoxCh1_3inch.Text,"3 inch", ref message, flags, 1); + flags = CfgUpdateFlagsQ3(textBoxCh2_3inch.Text,"3 inch", ref message, flags, 2); + flags = CfgUpdateFlagsQ3(textBoxCh3_3inch.Text,"3 inch", ref message, flags, 3); + + flags = CfgUpdateFlagsQ3(textBoxCh1_4inch.Text,"4 inch", ref message, flags, 1); + flags = CfgUpdateFlagsQ3(textBoxCh2_4inch.Text,"4 inch", ref message, flags, 2); + flags = CfgUpdateFlagsQ3(textBoxCh3_4inch.Text,"4 inch", ref message, flags, 3); + + flags = CfgUpdateFlagsQ3(textBoxCh1_6inch.Text,"6 inch", ref message, flags, 1); + flags = CfgUpdateFlagsQ3(textBoxCh2_6inch.Text,"6 inch", ref message, flags, 2); + flags = CfgUpdateFlagsQ3(textBoxCh3_6inch.Text,"6 inch", ref message, flags, 3); + + flags = CfgUpdateFlagsQ3(textBoxCh1_6MoreInch.Text,">6 inch", ref message, flags, 1); + flags = CfgUpdateFlagsQ3(textBoxCh1_6MoreInch.Text,">6 inch", ref message, flags, 2); + flags = CfgUpdateFlagsQ3(textBoxCh1_6MoreInch.Text,">6 inch", ref message, flags, 3); + + + return flags; + } + + private CfgUpdateFlags CfgUpdateFlagsQ3(string ValueText, string DN, ref string message, CfgUpdateFlags flags, int ch, int minRange = 0, int maxRange = 25000) + { + int dummy; + if (!int.TryParse(ValueText, out dummy) || dummy < minRange || dummy > maxRange) + { + flags |= CfgUpdateFlags.Error; + message += Environment.NewLine + $"Default Q3 correction factor DN({DN}) CH{ch} should be in range {minRange} .. {maxRange}"; + } return flags; } @@ -208,18 +196,25 @@ namespace TBF.Rig.TestMethods.GenesisCommunication var DelayBetweenRetries = config.DelayBetweenRetries; var NrThreads = config.NrThreads; var IperlCheckErrorsToStop = config.IperlCheckErrorsToStop; - var DfltQ2c_15_rl = config.DfltQ2c_15_rl; - var DfltQ2c_15_lr = config.DfltQ2c_15_lr; - var DfltQ2c_20_rl = config.DfltQ2c_20_rl; - var DfltQ2c_20_lr = config.DfltQ2c_20_lr; - var DfltQ2c_25_63_rl = config.DfltQ2c_25_63_rl; - var DfltQ2c_25_63_lr = config.DfltQ2c_25_63_lr; - var DfltQ2c_25_10_rl = config.DfltQ2c_25_10_rl; - var DfltQ2c_25_10_lr = config.DfltQ2c_25_10_lr; - var DfltQ2c_32_rl = config.DfltQ2c_32_rl; - var DfltQ2c_32_lr = config.DfltQ2c_32_lr; - var DfltQ2c_40_rl = config.DfltQ2c_40_rl; - var DfltQ2c_40_lr = config.DfltQ2c_40_lr; + var calFactor1Ch1 = config.CalibFactor1InchCh1; + var calFactor1Ch2 = config.CalibFactor1InchCh2; + var calFactor1Ch3 = config.CalibFactor1InchCh3; + var calFactor2Ch1 = config.CalibFactor2InchCh1; + var calFactor2Ch2 = config.CalibFactor2InchCh2; + var calFactor2Ch3 = config.CalibFactor2InchCh3; + var calFactor3Ch1 = config.CalibFactor3InchCh1; + var calFactor3Ch2 = config.CalibFactor3InchCh2; + var calFactor3Ch3 = config.CalibFactor3InchCh3; + var calFactor4Ch1 = config.CalibFactor4InchCh1; + var calFactor4Ch2 = config.CalibFactor4InchCh2; + var calFactor4Ch3 = config.CalibFactor4InchCh3; + var calFactor6Ch1 = config.CalibFactor6InchCh1; + var calFactor6Ch2 = config.CalibFactor6InchCh2; + var calFactor6Ch3 = config.CalibFactor6InchCh3; + var calFactor6MCh1 = config.CalibFactor6MoreInchCh1; + var calFactor6MCh2 = config.CalibFactor6MoreInchCh2; + var calFactor6MCh3 = config.CalibFactor6MoreInchCh3; + var UseWebService = config.UseWebService; var BaseUrl = config.BaseUrl; var RelativeUrl = config.RelativeUrl; @@ -230,18 +225,24 @@ namespace TBF.Rig.TestMethods.GenesisCommunication flags |= UpdateDifferent(ref NrThreads, nrThreadsTextBox.Text, CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange); flags |= UpdateDifferent(ref IperlCheckErrorsToStop, iperlCheckErrorsToStopTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); - flags |= UpdateDifferent(ref DfltQ2c_15_rl, textBox15rl.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); - flags |= UpdateDifferent(ref DfltQ2c_15_lr, textBox15lr.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); - flags |= UpdateDifferent(ref DfltQ2c_20_rl, textBox20rl.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); - flags |= UpdateDifferent(ref DfltQ2c_20_lr, textBox20lr.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); - flags |= UpdateDifferent(ref DfltQ2c_25_63_rl, textBox25_63rl.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); - flags |= UpdateDifferent(ref DfltQ2c_25_63_lr, textBox25_63lr.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); - flags |= UpdateDifferent(ref DfltQ2c_25_10_rl, textBox25_10rl.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); - flags |= UpdateDifferent(ref DfltQ2c_25_10_lr, textBox25_10lr.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); - flags |= UpdateDifferent(ref DfltQ2c_32_rl, textBox32rl.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); - flags |= UpdateDifferent(ref DfltQ2c_32_lr, textBox32lr.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); - flags |= UpdateDifferent(ref DfltQ2c_40_rl, textBox40rl.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); - flags |= UpdateDifferent(ref DfltQ2c_40_lr, textBox40lr.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); + flags |= UpdateDifferent(ref calFactor1Ch1, textBoxCh1_15inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); + flags |= UpdateDifferent(ref calFactor1Ch2, textBoxCh2_15inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); + flags |= UpdateDifferent(ref calFactor1Ch3, textBoxCh3_15inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); + flags |= UpdateDifferent(ref calFactor2Ch1, textBoxCh1_2inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); + flags |= UpdateDifferent(ref calFactor2Ch2, textBoxCh2_2inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); + flags |= UpdateDifferent(ref calFactor2Ch3, textBoxCh3_2inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); + flags |= UpdateDifferent(ref calFactor3Ch1, textBoxCh1_3inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); + flags |= UpdateDifferent(ref calFactor3Ch2, textBoxCh2_3inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); + flags |= UpdateDifferent(ref calFactor3Ch3, textBoxCh3_3inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); + flags |= UpdateDifferent(ref calFactor4Ch1, textBoxCh1_4inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); + flags |= UpdateDifferent(ref calFactor4Ch2, textBoxCh2_4inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); + flags |= UpdateDifferent(ref calFactor4Ch3, textBoxCh3_4inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); + flags |= UpdateDifferent(ref calFactor6Ch1, textBoxCh1_6inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); + flags |= UpdateDifferent(ref calFactor6Ch2, textBoxCh2_6inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); + flags |= UpdateDifferent(ref calFactor6Ch3, textBoxCh3_6inch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); + flags |= UpdateDifferent(ref calFactor6MCh1, textBoxCh1_6MoreInch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); + flags |= UpdateDifferent(ref calFactor6MCh2, textBoxCh2_6MoreInch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); + flags |= UpdateDifferent(ref calFactor6MCh3, textBoxCh3_6MoreInch.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); flags |= UpdateDifferent(ref UseWebService, useWebServiceCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); flags |= UpdateDifferent(ref BaseUrl, baseUrlTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); @@ -253,18 +254,24 @@ namespace TBF.Rig.TestMethods.GenesisCommunication config.DelayBetweenRetries = DelayBetweenRetries; config.NrThreads = NrThreads; config.IperlCheckErrorsToStop = IperlCheckErrorsToStop; - config.DfltQ2c_15_rl = DfltQ2c_15_rl; - config.DfltQ2c_15_lr = DfltQ2c_15_lr; - config.DfltQ2c_20_rl = DfltQ2c_20_rl; - config.DfltQ2c_20_lr = DfltQ2c_20_lr; - config.DfltQ2c_25_63_rl = DfltQ2c_25_63_rl; - config.DfltQ2c_25_63_lr = DfltQ2c_25_63_lr; - config.DfltQ2c_25_10_rl = DfltQ2c_25_10_rl; - config.DfltQ2c_25_10_lr = DfltQ2c_25_10_lr; - config.DfltQ2c_32_rl = DfltQ2c_32_rl; - config.DfltQ2c_32_lr = DfltQ2c_32_lr; - config.DfltQ2c_40_rl = DfltQ2c_40_rl; - config.DfltQ2c_40_lr = DfltQ2c_40_lr; + config.CalibFactor1InchCh1 = calFactor1Ch1; + config.CalibFactor1InchCh2 = calFactor1Ch2; + config.CalibFactor1InchCh3 = calFactor1Ch3; + config.CalibFactor2InchCh1 = calFactor2Ch1; + config.CalibFactor2InchCh2 = calFactor2Ch2; + config.CalibFactor2InchCh3 = calFactor2Ch3; + config.CalibFactor3InchCh1 = calFactor3Ch1; + config.CalibFactor3InchCh2 = calFactor3Ch2; + config.CalibFactor3InchCh3 = calFactor3Ch3; + config.CalibFactor4InchCh1 = calFactor4Ch1; + config.CalibFactor4InchCh2 = calFactor4Ch2; + config.CalibFactor4InchCh3 = calFactor4Ch3; + config.CalibFactor6InchCh1 = calFactor6Ch1; + config.CalibFactor6InchCh2 = calFactor6Ch2; + config.CalibFactor6InchCh3 = calFactor6Ch3; + config.CalibFactor6MoreInchCh1 = calFactor6MCh1; + config.CalibFactor6MoreInchCh2 = calFactor6MCh2; + config.CalibFactor6MoreInchCh3 = calFactor6MCh3; config.UseWebService = UseWebService; config.BaseUrl = BaseUrl; config.RelativeUrl = RelativeUrl; diff --git a/TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfgCtrl.designer.cs b/TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfgCtrl.designer.cs index 593e92fe7..964644394 100644 --- a/TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfgCtrl.designer.cs +++ b/TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfgCtrl.designer.cs @@ -26,454 +26,582 @@ namespace TBF.Rig.TestMethods.GenesisCommunication #region Component Designer generated code - /// - /// Required method for Designer support - do not modify + /// + /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { - this.nameTextBox = new System.Windows.Forms.TextBox(); - this.nameLabel = new System.Windows.Forms.Label(); - this.classNameLabel = new System.Windows.Forms.Label(); - this.commTimeoutTextBox = new System.Windows.Forms.TextBox(); - this.commTimeoutLabel = new System.Windows.Forms.Label(); - this.maxCommRetriesTextBox = new System.Windows.Forms.TextBox(); - this.maxNrRetriesLabel = new System.Windows.Forms.Label(); - this.nrThreadsTextBox = new System.Windows.Forms.TextBox(); - this.nrThreadsLabel = new System.Windows.Forms.Label(); - this.iperlCheckErrorsToStopTextBox = new System.Windows.Forms.TextBox(); - this.iperlCheckErrorsToStopLabel = new System.Windows.Forms.Label(); - this.delayBetweenRetriesTextBox = new System.Windows.Forms.TextBox(); - this.delayBetweenRetriesLabel = new System.Windows.Forms.Label(); - this.relativeUrlTextBox = new System.Windows.Forms.TextBox(); - this.relativeUrlLabel = new System.Windows.Forms.Label(); - this.baseUrlTextBox = new System.Windows.Forms.TextBox(); - this.baseUrlLabel = new System.Windows.Forms.Label(); - this.useWebServiceCheckBox = new System.Windows.Forms.CheckBox(); - this.useWebServiceGroupBox = new System.Windows.Forms.GroupBox(); - this.dfltQ2corrFactorsGroupBox = new System.Windows.Forms.GroupBox(); - this.label8 = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); - this.label6 = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.textBox40lr = new System.Windows.Forms.TextBox(); - this.textBox32lr = new System.Windows.Forms.TextBox(); - this.textBox25_10lr = new System.Windows.Forms.TextBox(); - this.textBox25_63lr = new System.Windows.Forms.TextBox(); - this.textBox20lr = new System.Windows.Forms.TextBox(); - this.textBox15lr = new System.Windows.Forms.TextBox(); - this.textBox40rl = new System.Windows.Forms.TextBox(); - this.textBox32rl = new System.Windows.Forms.TextBox(); - this.textBox25_10rl = new System.Windows.Forms.TextBox(); - this.textBox25_63rl = new System.Windows.Forms.TextBox(); - this.textBox20rl = new System.Windows.Forms.TextBox(); - this.textBox15rl = new System.Windows.Forms.TextBox(); - this.useWebServiceGroupBox.SuspendLayout(); - this.dfltQ2corrFactorsGroupBox.SuspendLayout(); - this.SuspendLayout(); - // - // nameTextBox - // - this.nameTextBox.Enabled = false; - this.nameTextBox.Location = new System.Drawing.Point(237, 31); - this.nameTextBox.Name = "nameTextBox"; - this.nameTextBox.Size = new System.Drawing.Size(130, 20); - this.nameTextBox.TabIndex = 2; - // - // nameLabel - // - this.nameLabel.AutoSize = true; - this.nameLabel.Location = new System.Drawing.Point(23, 34); - this.nameLabel.Name = "nameLabel"; - this.nameLabel.Size = new System.Drawing.Size(35, 13); - this.nameLabel.TabIndex = 1; - this.nameLabel.Text = "Name"; - // - // classNameLabel - // - this.classNameLabel.AutoSize = true; - this.classNameLabel.Location = new System.Drawing.Point(234, 11); - this.classNameLabel.Name = "classNameLabel"; - this.classNameLabel.Size = new System.Drawing.Size(83, 13); - this.classNameLabel.TabIndex = 0; - this.classNameLabel.Text = "ComonentName"; - // - // commTimeoutTextBox - // - this.commTimeoutTextBox.Enabled = false; - this.commTimeoutTextBox.Location = new System.Drawing.Point(237, 53); - this.commTimeoutTextBox.Name = "commTimeoutTextBox"; - this.commTimeoutTextBox.Size = new System.Drawing.Size(45, 20); - this.commTimeoutTextBox.TabIndex = 4; - // - // commTimeoutLabel - // - this.commTimeoutLabel.AutoSize = true; - this.commTimeoutLabel.Location = new System.Drawing.Point(23, 56); - this.commTimeoutLabel.Name = "commTimeoutLabel"; - this.commTimeoutLabel.Size = new System.Drawing.Size(98, 13); - this.commTimeoutLabel.TabIndex = 3; - this.commTimeoutLabel.Text = "Comm. timeout [ms]"; - // - // maxCommRetriesTextBox - // - this.maxCommRetriesTextBox.Enabled = false; - this.maxCommRetriesTextBox.Location = new System.Drawing.Point(237, 75); - this.maxCommRetriesTextBox.Name = "maxCommRetriesTextBox"; - this.maxCommRetriesTextBox.Size = new System.Drawing.Size(45, 20); - this.maxCommRetriesTextBox.TabIndex = 6; - // - // maxNrRetriesLabel - // - this.maxNrRetriesLabel.AutoSize = true; - this.maxNrRetriesLabel.Location = new System.Drawing.Point(23, 78); - this.maxNrRetriesLabel.Name = "maxNrRetriesLabel"; - this.maxNrRetriesLabel.Size = new System.Drawing.Size(61, 13); - this.maxNrRetriesLabel.TabIndex = 5; - this.maxNrRetriesLabel.Text = "Max. retries"; - // - // nrThreadsTextBox - // - this.nrThreadsTextBox.Enabled = false; - this.nrThreadsTextBox.Location = new System.Drawing.Point(237, 119); - this.nrThreadsTextBox.Name = "nrThreadsTextBox"; - this.nrThreadsTextBox.Size = new System.Drawing.Size(45, 20); - this.nrThreadsTextBox.TabIndex = 10; - // - // nrThreadsLabel - // - this.nrThreadsLabel.AutoSize = true; - this.nrThreadsLabel.Location = new System.Drawing.Point(23, 122); - this.nrThreadsLabel.Name = "nrThreadsLabel"; - this.nrThreadsLabel.Size = new System.Drawing.Size(59, 13); - this.nrThreadsLabel.TabIndex = 9; - this.nrThreadsLabel.Text = "Nr. threads"; - // - // iperlCheckErrorsToStopTextBox - // - this.iperlCheckErrorsToStopTextBox.Enabled = false; - this.iperlCheckErrorsToStopTextBox.Location = new System.Drawing.Point(237, 141); - this.iperlCheckErrorsToStopTextBox.Name = "iperlCheckErrorsToStopTextBox"; - this.iperlCheckErrorsToStopTextBox.Size = new System.Drawing.Size(45, 20); - this.iperlCheckErrorsToStopTextBox.TabIndex = 13; - // - // iperlCheckErrorsToStopLabel - // - this.iperlCheckErrorsToStopLabel.AutoSize = true; - this.iperlCheckErrorsToStopLabel.Location = new System.Drawing.Point(23, 144); - this.iperlCheckErrorsToStopLabel.Name = "iperlCheckErrorsToStopLabel"; - this.iperlCheckErrorsToStopLabel.Size = new System.Drawing.Size(202, 13); - this.iperlCheckErrorsToStopLabel.TabIndex = 12; - this.iperlCheckErrorsToStopLabel.Text = "iperl_check errors count to stop the cycle"; - // - // delayBetweenRetriesTextBox - // - this.delayBetweenRetriesTextBox.Enabled = false; - this.delayBetweenRetriesTextBox.Location = new System.Drawing.Point(237, 97); - this.delayBetweenRetriesTextBox.Name = "delayBetweenRetriesTextBox"; - this.delayBetweenRetriesTextBox.Size = new System.Drawing.Size(45, 20); - this.delayBetweenRetriesTextBox.TabIndex = 8; - // - // delayBetweenRetriesLabel - // - this.delayBetweenRetriesLabel.AutoSize = true; - this.delayBetweenRetriesLabel.Location = new System.Drawing.Point(23, 100); - this.delayBetweenRetriesLabel.Name = "delayBetweenRetriesLabel"; - this.delayBetweenRetriesLabel.Size = new System.Drawing.Size(131, 13); - this.delayBetweenRetriesLabel.TabIndex = 7; - this.delayBetweenRetriesLabel.Text = "Delay between retries [ms]"; - // - // relativeUrlTextBox - // - this.relativeUrlTextBox.Enabled = false; - this.relativeUrlTextBox.Location = new System.Drawing.Point(89, 50); - this.relativeUrlTextBox.Name = "relativeUrlTextBox"; - this.relativeUrlTextBox.Size = new System.Drawing.Size(298, 20); - this.relativeUrlTextBox.TabIndex = 18; - // - // relativeUrlLabel - // - this.relativeUrlLabel.AutoSize = true; - this.relativeUrlLabel.Location = new System.Drawing.Point(13, 53); - this.relativeUrlLabel.Name = "relativeUrlLabel"; - this.relativeUrlLabel.Size = new System.Drawing.Size(71, 13); - this.relativeUrlLabel.TabIndex = 17; - this.relativeUrlLabel.Text = "Relative URL"; - // - // baseUrlTextBox - // - this.baseUrlTextBox.Enabled = false; - this.baseUrlTextBox.Location = new System.Drawing.Point(89, 24); - this.baseUrlTextBox.Name = "baseUrlTextBox"; - this.baseUrlTextBox.Size = new System.Drawing.Size(298, 20); - this.baseUrlTextBox.TabIndex = 16; - // - // baseUrlLabel - // - this.baseUrlLabel.AutoSize = true; - this.baseUrlLabel.Location = new System.Drawing.Point(13, 27); - this.baseUrlLabel.Name = "baseUrlLabel"; - this.baseUrlLabel.Size = new System.Drawing.Size(56, 13); - this.baseUrlLabel.TabIndex = 15; - this.baseUrlLabel.Text = "Base URL"; - // - // useWebServiceCheckBox - // - this.useWebServiceCheckBox.AutoSize = true; - this.useWebServiceCheckBox.Enabled = false; - this.useWebServiceCheckBox.Location = new System.Drawing.Point(15, 0); - this.useWebServiceCheckBox.Name = "useWebServiceCheckBox"; - this.useWebServiceCheckBox.Size = new System.Drawing.Size(189, 17); - this.useWebServiceCheckBox.TabIndex = 14; - this.useWebServiceCheckBox.Text = "Use web service for default values"; - this.useWebServiceCheckBox.UseVisualStyleBackColor = true; - this.useWebServiceCheckBox.CheckedChanged += new System.EventHandler(this.useWebServiceCheckBox_CheckedChanged); - // - // useWebServiceGroupBox - // - this.useWebServiceGroupBox.Controls.Add(this.baseUrlTextBox); - this.useWebServiceGroupBox.Controls.Add(this.useWebServiceCheckBox); - this.useWebServiceGroupBox.Controls.Add(this.relativeUrlTextBox); - this.useWebServiceGroupBox.Controls.Add(this.relativeUrlLabel); - this.useWebServiceGroupBox.Controls.Add(this.baseUrlLabel); - this.useWebServiceGroupBox.Location = new System.Drawing.Point(11, 266); - this.useWebServiceGroupBox.Name = "useWebServiceGroupBox"; - this.useWebServiceGroupBox.Size = new System.Drawing.Size(404, 83); - this.useWebServiceGroupBox.TabIndex = 0; - this.useWebServiceGroupBox.TabStop = false; - // - // dfltQ2corrFactorsGroupBox - // - this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label8); - this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label7); - this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label6); - this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label5); - this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label4); - this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label3); - this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label2); - this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label1); - this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox40lr); - this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox32lr); - this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox25_10lr); - this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox25_63lr); - this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox20lr); - this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox15lr); - this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox40rl); - this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox32rl); - this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox25_10rl); - this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox25_63rl); - this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox20rl); - this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox15rl); - this.dfltQ2corrFactorsGroupBox.Location = new System.Drawing.Point(11, 175); - this.dfltQ2corrFactorsGroupBox.Name = "dfltQ2corrFactorsGroupBox"; - this.dfltQ2corrFactorsGroupBox.Size = new System.Drawing.Size(404, 85); - this.dfltQ2corrFactorsGroupBox.TabIndex = 14; - this.dfltQ2corrFactorsGroupBox.TabStop = false; - this.dfltQ2corrFactorsGroupBox.Text = "Default Q2 correction factors"; - // - // label8 - // - this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(344, 17); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(35, 13); - this.label8.TabIndex = 19; - this.label8.Text = "DN40"; - // - // label7 - // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(289, 17); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(35, 13); - this.label7.TabIndex = 18; - this.label7.Text = "DN32"; - // - // label6 - // - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(233, 17); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(45, 13); - this.label6.TabIndex = 17; - this.label6.Text = "...Q3 10"; - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(163, 17); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(70, 13); - this.label5.TabIndex = 16; - this.label5.Text = "DN25 Q3 6.3"; - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(121, 17); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(35, 13); - this.label4.TabIndex = 15; - this.label4.Text = "DN20"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(65, 17); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(35, 13); - this.label3.TabIndex = 14; - this.label3.Text = "DN15"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(22, 57); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(24, 13); - this.label2.TabIndex = 13; - this.label2.Text = "L-R"; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(22, 34); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(24, 13); - this.label1.TabIndex = 12; - this.label1.Text = "R-L"; - // - // textBox40lr - // - this.textBox40lr.Enabled = false; - this.textBox40lr.Location = new System.Drawing.Point(337, 54); - this.textBox40lr.Name = "textBox40lr"; - this.textBox40lr.Size = new System.Drawing.Size(50, 20); - this.textBox40lr.TabIndex = 11; - // - // textBox32lr - // - this.textBox32lr.Enabled = false; - this.textBox32lr.Location = new System.Drawing.Point(281, 54); - this.textBox32lr.Name = "textBox32lr"; - this.textBox32lr.Size = new System.Drawing.Size(50, 20); - this.textBox32lr.TabIndex = 10; - // - // textBox25_10lr - // - this.textBox25_10lr.Enabled = false; - this.textBox25_10lr.Location = new System.Drawing.Point(225, 54); - this.textBox25_10lr.Name = "textBox25_10lr"; - this.textBox25_10lr.Size = new System.Drawing.Size(50, 20); - this.textBox25_10lr.TabIndex = 9; - // - // textBox25_63lr - // - this.textBox25_63lr.Enabled = false; - this.textBox25_63lr.Location = new System.Drawing.Point(169, 54); - this.textBox25_63lr.Name = "textBox25_63lr"; - this.textBox25_63lr.Size = new System.Drawing.Size(50, 20); - this.textBox25_63lr.TabIndex = 8; - // - // textBox20lr - // - this.textBox20lr.Enabled = false; - this.textBox20lr.Location = new System.Drawing.Point(113, 54); - this.textBox20lr.Name = "textBox20lr"; - this.textBox20lr.Size = new System.Drawing.Size(50, 20); - this.textBox20lr.TabIndex = 7; - // - // textBox15lr - // - this.textBox15lr.Enabled = false; - this.textBox15lr.Location = new System.Drawing.Point(57, 54); - this.textBox15lr.Name = "textBox15lr"; - this.textBox15lr.Size = new System.Drawing.Size(50, 20); - this.textBox15lr.TabIndex = 6; - // - // textBox40rl - // - this.textBox40rl.Enabled = false; - this.textBox40rl.Location = new System.Drawing.Point(337, 31); - this.textBox40rl.Name = "textBox40rl"; - this.textBox40rl.Size = new System.Drawing.Size(50, 20); - this.textBox40rl.TabIndex = 5; - // - // textBox32rl - // - this.textBox32rl.Enabled = false; - this.textBox32rl.Location = new System.Drawing.Point(281, 31); - this.textBox32rl.Name = "textBox32rl"; - this.textBox32rl.Size = new System.Drawing.Size(50, 20); - this.textBox32rl.TabIndex = 4; - // - // textBox25_10rl - // - this.textBox25_10rl.Enabled = false; - this.textBox25_10rl.Location = new System.Drawing.Point(225, 31); - this.textBox25_10rl.Name = "textBox25_10rl"; - this.textBox25_10rl.Size = new System.Drawing.Size(50, 20); - this.textBox25_10rl.TabIndex = 3; - // - // textBox25_63rl - // - this.textBox25_63rl.Enabled = false; - this.textBox25_63rl.Location = new System.Drawing.Point(169, 31); - this.textBox25_63rl.Name = "textBox25_63rl"; - this.textBox25_63rl.Size = new System.Drawing.Size(50, 20); - this.textBox25_63rl.TabIndex = 2; - // - // textBox20rl - // - this.textBox20rl.Enabled = false; - this.textBox20rl.Location = new System.Drawing.Point(113, 31); - this.textBox20rl.Name = "textBox20rl"; - this.textBox20rl.Size = new System.Drawing.Size(50, 20); - this.textBox20rl.TabIndex = 1; - // - // textBox15rl - // - this.textBox15rl.Enabled = false; - this.textBox15rl.Location = new System.Drawing.Point(57, 31); - this.textBox15rl.Name = "textBox15rl"; - this.textBox15rl.Size = new System.Drawing.Size(50, 20); - this.textBox15rl.TabIndex = 0; - // - // TestMethodCfgCtrl - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.dfltQ2corrFactorsGroupBox); - this.Controls.Add(this.useWebServiceGroupBox); - this.Controls.Add(this.delayBetweenRetriesTextBox); - this.Controls.Add(this.delayBetweenRetriesLabel); - this.Controls.Add(this.iperlCheckErrorsToStopTextBox); - this.Controls.Add(this.iperlCheckErrorsToStopLabel); - this.Controls.Add(this.nrThreadsTextBox); - this.Controls.Add(this.nrThreadsLabel); - this.Controls.Add(this.maxCommRetriesTextBox); - this.Controls.Add(this.maxNrRetriesLabel); - this.Controls.Add(this.commTimeoutTextBox); - this.Controls.Add(this.commTimeoutLabel); - this.Controls.Add(this.nameTextBox); - this.Controls.Add(this.nameLabel); - this.Controls.Add(this.classNameLabel); - this.Name = "TestMethodCfgCtrl"; - this.Size = new System.Drawing.Size(427, 363); - this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load); - this.useWebServiceGroupBox.ResumeLayout(false); - this.useWebServiceGroupBox.PerformLayout(); - this.dfltQ2corrFactorsGroupBox.ResumeLayout(false); - this.dfltQ2corrFactorsGroupBox.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); - + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.commTimeoutTextBox = new System.Windows.Forms.TextBox(); + this.commTimeoutLabel = new System.Windows.Forms.Label(); + this.maxCommRetriesTextBox = new System.Windows.Forms.TextBox(); + this.maxNrRetriesLabel = new System.Windows.Forms.Label(); + this.nrThreadsTextBox = new System.Windows.Forms.TextBox(); + this.nrThreadsLabel = new System.Windows.Forms.Label(); + this.iperlCheckErrorsToStopTextBox = new System.Windows.Forms.TextBox(); + this.iperlCheckErrorsToStopLabel = new System.Windows.Forms.Label(); + this.delayBetweenRetriesTextBox = new System.Windows.Forms.TextBox(); + this.delayBetweenRetriesLabel = new System.Windows.Forms.Label(); + this.relativeUrlTextBox = new System.Windows.Forms.TextBox(); + this.relativeUrlLabel = new System.Windows.Forms.Label(); + this.baseUrlTextBox = new System.Windows.Forms.TextBox(); + this.baseUrlLabel = new System.Windows.Forms.Label(); + this.useWebServiceCheckBox = new System.Windows.Forms.CheckBox(); + this.useWebServiceGroupBox = new System.Windows.Forms.GroupBox(); + this.dfltQ2corrFactorsGroupBox = new System.Windows.Forms.GroupBox(); + this.label9 = new System.Windows.Forms.Label(); + this.textBoxCh3_6MoreInch = new System.Windows.Forms.TextBox(); + this.textBoxCh3_6inch = new System.Windows.Forms.TextBox(); + this.textBoxCh3_4inch = new System.Windows.Forms.TextBox(); + this.textBoxCh3_3inch = new System.Windows.Forms.TextBox(); + this.textBoxCh3_2inch = new System.Windows.Forms.TextBox(); + this.textBoxCh3_15inch = new System.Windows.Forms.TextBox(); + this.label8 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.textBoxCh2_6MoreInch = new System.Windows.Forms.TextBox(); + this.textBoxCh2_6inch = new System.Windows.Forms.TextBox(); + this.textBoxCh2_4inch = new System.Windows.Forms.TextBox(); + this.textBoxCh2_3inch = new System.Windows.Forms.TextBox(); + this.textBoxCh2_2inch = new System.Windows.Forms.TextBox(); + this.textBoxCh2_15inch = new System.Windows.Forms.TextBox(); + this.textBoxCh1_6MoreInch = new System.Windows.Forms.TextBox(); + this.textBoxCh1_6inch = new System.Windows.Forms.TextBox(); + this.textBoxCh1_4inch = new System.Windows.Forms.TextBox(); + this.textBoxCh1_3inch = new System.Windows.Forms.TextBox(); + this.textBoxCh1_2inch = new System.Windows.Forms.TextBox(); + this.textBoxCh1_15inch = new System.Windows.Forms.TextBox(); + this.useWebServiceGroupBox.SuspendLayout(); + this.dfltQ2corrFactorsGroupBox.SuspendLayout(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(356, 48); + this.nameTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(193, 26); + this.nameTextBox.TabIndex = 2; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(34, 52); + this.nameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(51, 20); + this.nameLabel.TabIndex = 1; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(351, 17); + this.classNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(125, 20); + this.classNameLabel.TabIndex = 0; + this.classNameLabel.Text = "ComonentName"; + // + // commTimeoutTextBox + // + this.commTimeoutTextBox.Enabled = false; + this.commTimeoutTextBox.Location = new System.Drawing.Point(356, 82); + this.commTimeoutTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.commTimeoutTextBox.Name = "commTimeoutTextBox"; + this.commTimeoutTextBox.Size = new System.Drawing.Size(66, 26); + this.commTimeoutTextBox.TabIndex = 4; + // + // commTimeoutLabel + // + this.commTimeoutLabel.AutoSize = true; + this.commTimeoutLabel.Location = new System.Drawing.Point(34, 86); + this.commTimeoutLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.commTimeoutLabel.Name = "commTimeoutLabel"; + this.commTimeoutLabel.Size = new System.Drawing.Size(149, 20); + this.commTimeoutLabel.TabIndex = 3; + this.commTimeoutLabel.Text = "Comm. timeout [ms]"; + // + // maxCommRetriesTextBox + // + this.maxCommRetriesTextBox.Enabled = false; + this.maxCommRetriesTextBox.Location = new System.Drawing.Point(356, 115); + this.maxCommRetriesTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.maxCommRetriesTextBox.Name = "maxCommRetriesTextBox"; + this.maxCommRetriesTextBox.Size = new System.Drawing.Size(66, 26); + this.maxCommRetriesTextBox.TabIndex = 6; + // + // maxNrRetriesLabel + // + this.maxNrRetriesLabel.AutoSize = true; + this.maxNrRetriesLabel.Location = new System.Drawing.Point(34, 120); + this.maxNrRetriesLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.maxNrRetriesLabel.Name = "maxNrRetriesLabel"; + this.maxNrRetriesLabel.Size = new System.Drawing.Size(90, 20); + this.maxNrRetriesLabel.TabIndex = 5; + this.maxNrRetriesLabel.Text = "Max. retries"; + // + // nrThreadsTextBox + // + this.nrThreadsTextBox.Enabled = false; + this.nrThreadsTextBox.Location = new System.Drawing.Point(356, 183); + this.nrThreadsTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.nrThreadsTextBox.Name = "nrThreadsTextBox"; + this.nrThreadsTextBox.Size = new System.Drawing.Size(66, 26); + this.nrThreadsTextBox.TabIndex = 10; + // + // nrThreadsLabel + // + this.nrThreadsLabel.AutoSize = true; + this.nrThreadsLabel.Location = new System.Drawing.Point(34, 188); + this.nrThreadsLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.nrThreadsLabel.Name = "nrThreadsLabel"; + this.nrThreadsLabel.Size = new System.Drawing.Size(87, 20); + this.nrThreadsLabel.TabIndex = 9; + this.nrThreadsLabel.Text = "Nr. threads"; + // + // iperlCheckErrorsToStopTextBox + // + this.iperlCheckErrorsToStopTextBox.Enabled = false; + this.iperlCheckErrorsToStopTextBox.Location = new System.Drawing.Point(356, 217); + this.iperlCheckErrorsToStopTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.iperlCheckErrorsToStopTextBox.Name = "iperlCheckErrorsToStopTextBox"; + this.iperlCheckErrorsToStopTextBox.Size = new System.Drawing.Size(66, 26); + this.iperlCheckErrorsToStopTextBox.TabIndex = 13; + // + // iperlCheckErrorsToStopLabel + // + this.iperlCheckErrorsToStopLabel.AutoSize = true; + this.iperlCheckErrorsToStopLabel.Location = new System.Drawing.Point(34, 222); + this.iperlCheckErrorsToStopLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.iperlCheckErrorsToStopLabel.Name = "iperlCheckErrorsToStopLabel"; + this.iperlCheckErrorsToStopLabel.Size = new System.Drawing.Size(297, 20); + this.iperlCheckErrorsToStopLabel.TabIndex = 12; + this.iperlCheckErrorsToStopLabel.Text = "iperl_check errors count to stop the cycle"; + // + // delayBetweenRetriesTextBox + // + this.delayBetweenRetriesTextBox.Enabled = false; + this.delayBetweenRetriesTextBox.Location = new System.Drawing.Point(356, 149); + this.delayBetweenRetriesTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.delayBetweenRetriesTextBox.Name = "delayBetweenRetriesTextBox"; + this.delayBetweenRetriesTextBox.Size = new System.Drawing.Size(66, 26); + this.delayBetweenRetriesTextBox.TabIndex = 8; + // + // delayBetweenRetriesLabel + // + this.delayBetweenRetriesLabel.AutoSize = true; + this.delayBetweenRetriesLabel.Location = new System.Drawing.Point(34, 154); + this.delayBetweenRetriesLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.delayBetweenRetriesLabel.Name = "delayBetweenRetriesLabel"; + this.delayBetweenRetriesLabel.Size = new System.Drawing.Size(195, 20); + this.delayBetweenRetriesLabel.TabIndex = 7; + this.delayBetweenRetriesLabel.Text = "Delay between retries [ms]"; + // + // relativeUrlTextBox + // + this.relativeUrlTextBox.Enabled = false; + this.relativeUrlTextBox.Location = new System.Drawing.Point(134, 77); + this.relativeUrlTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.relativeUrlTextBox.Name = "relativeUrlTextBox"; + this.relativeUrlTextBox.Size = new System.Drawing.Size(445, 26); + this.relativeUrlTextBox.TabIndex = 18; + // + // relativeUrlLabel + // + this.relativeUrlLabel.AutoSize = true; + this.relativeUrlLabel.Location = new System.Drawing.Point(20, 82); + this.relativeUrlLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.relativeUrlLabel.Name = "relativeUrlLabel"; + this.relativeUrlLabel.Size = new System.Drawing.Size(103, 20); + this.relativeUrlLabel.TabIndex = 17; + this.relativeUrlLabel.Text = "Relative URL"; + // + // baseUrlTextBox + // + this.baseUrlTextBox.Enabled = false; + this.baseUrlTextBox.Location = new System.Drawing.Point(134, 37); + this.baseUrlTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.baseUrlTextBox.Name = "baseUrlTextBox"; + this.baseUrlTextBox.Size = new System.Drawing.Size(445, 26); + this.baseUrlTextBox.TabIndex = 16; + // + // baseUrlLabel + // + this.baseUrlLabel.AutoSize = true; + this.baseUrlLabel.Location = new System.Drawing.Point(20, 42); + this.baseUrlLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.baseUrlLabel.Name = "baseUrlLabel"; + this.baseUrlLabel.Size = new System.Drawing.Size(83, 20); + this.baseUrlLabel.TabIndex = 15; + this.baseUrlLabel.Text = "Base URL"; + // + // useWebServiceCheckBox + // + this.useWebServiceCheckBox.AutoSize = true; + this.useWebServiceCheckBox.Enabled = false; + this.useWebServiceCheckBox.Location = new System.Drawing.Point(22, 0); + this.useWebServiceCheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.useWebServiceCheckBox.Name = "useWebServiceCheckBox"; + this.useWebServiceCheckBox.Size = new System.Drawing.Size(268, 24); + this.useWebServiceCheckBox.TabIndex = 14; + this.useWebServiceCheckBox.Text = "Use web service for default values"; + this.useWebServiceCheckBox.UseVisualStyleBackColor = true; + this.useWebServiceCheckBox.CheckedChanged += new System.EventHandler(this.useWebServiceCheckBox_CheckedChanged); + // + // useWebServiceGroupBox + // + this.useWebServiceGroupBox.Controls.Add(this.baseUrlTextBox); + this.useWebServiceGroupBox.Controls.Add(this.useWebServiceCheckBox); + this.useWebServiceGroupBox.Controls.Add(this.relativeUrlTextBox); + this.useWebServiceGroupBox.Controls.Add(this.relativeUrlLabel); + this.useWebServiceGroupBox.Controls.Add(this.baseUrlLabel); + this.useWebServiceGroupBox.Location = new System.Drawing.Point(16, 449); + this.useWebServiceGroupBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.useWebServiceGroupBox.Name = "useWebServiceGroupBox"; + this.useWebServiceGroupBox.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.useWebServiceGroupBox.Size = new System.Drawing.Size(606, 128); + this.useWebServiceGroupBox.TabIndex = 0; + this.useWebServiceGroupBox.TabStop = false; + // + // dfltQ2corrFactorsGroupBox + // + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label9); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBoxCh3_6MoreInch); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBoxCh3_6inch); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBoxCh3_4inch); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBoxCh3_3inch); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBoxCh3_2inch); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBoxCh3_15inch); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label8); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label7); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label6); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label5); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label4); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label3); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label2); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label1); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBoxCh2_6MoreInch); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBoxCh2_6inch); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBoxCh2_4inch); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBoxCh2_3inch); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBoxCh2_2inch); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBoxCh2_15inch); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBoxCh1_6MoreInch); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBoxCh1_6inch); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBoxCh1_4inch); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBoxCh1_3inch); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBoxCh1_2inch); + this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBoxCh1_15inch); + this.dfltQ2corrFactorsGroupBox.Location = new System.Drawing.Point(16, 269); + this.dfltQ2corrFactorsGroupBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.dfltQ2corrFactorsGroupBox.Name = "dfltQ2corrFactorsGroupBox"; + this.dfltQ2corrFactorsGroupBox.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.dfltQ2corrFactorsGroupBox.Size = new System.Drawing.Size(606, 170); + this.dfltQ2corrFactorsGroupBox.TabIndex = 14; + this.dfltQ2corrFactorsGroupBox.TabStop = false; + this.dfltQ2corrFactorsGroupBox.Text = "Default Q2 correction factors"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(33, 124); + this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(38, 20); + this.label9.TabIndex = 26; + this.label9.Text = "Ch3"; + // + // textBoxCh3_6MoreInch + // + this.textBoxCh3_6MoreInch.Enabled = false; + this.textBoxCh3_6MoreInch.Location = new System.Drawing.Point(506, 119); + this.textBoxCh3_6MoreInch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.textBoxCh3_6MoreInch.Name = "textBoxCh3_6MoreInch"; + this.textBoxCh3_6MoreInch.Size = new System.Drawing.Size(73, 26); + this.textBoxCh3_6MoreInch.TabIndex = 25; + // + // textBoxCh3_6inch + // + this.textBoxCh3_6inch.Enabled = false; + this.textBoxCh3_6inch.Location = new System.Drawing.Point(422, 119); + this.textBoxCh3_6inch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.textBoxCh3_6inch.Name = "textBoxCh3_6inch"; + this.textBoxCh3_6inch.Size = new System.Drawing.Size(73, 26); + this.textBoxCh3_6inch.TabIndex = 24; + // + // textBoxCh3_4inch + // + this.textBoxCh3_4inch.Enabled = false; + this.textBoxCh3_4inch.Location = new System.Drawing.Point(338, 119); + this.textBoxCh3_4inch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.textBoxCh3_4inch.Name = "textBoxCh3_4inch"; + this.textBoxCh3_4inch.Size = new System.Drawing.Size(73, 26); + this.textBoxCh3_4inch.TabIndex = 23; + // + // textBoxCh3_3inch + // + this.textBoxCh3_3inch.Enabled = false; + this.textBoxCh3_3inch.Location = new System.Drawing.Point(254, 119); + this.textBoxCh3_3inch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.textBoxCh3_3inch.Name = "textBoxCh3_3inch"; + this.textBoxCh3_3inch.Size = new System.Drawing.Size(73, 26); + this.textBoxCh3_3inch.TabIndex = 22; + // + // textBoxCh3_2inch + // + this.textBoxCh3_2inch.Enabled = false; + this.textBoxCh3_2inch.Location = new System.Drawing.Point(170, 119); + this.textBoxCh3_2inch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.textBoxCh3_2inch.Name = "textBoxCh3_2inch"; + this.textBoxCh3_2inch.Size = new System.Drawing.Size(73, 26); + this.textBoxCh3_2inch.TabIndex = 21; + // + // textBoxCh3_15inch + // + this.textBoxCh3_15inch.Enabled = false; + this.textBoxCh3_15inch.Location = new System.Drawing.Point(86, 119); + this.textBoxCh3_15inch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.textBoxCh3_15inch.Name = "textBoxCh3_15inch"; + this.textBoxCh3_15inch.Size = new System.Drawing.Size(73, 26); + this.textBoxCh3_15inch.TabIndex = 20; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(516, 26); + this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(56, 20); + this.label8.TabIndex = 19; + this.label8.Text = ">6inch"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(434, 26); + this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(47, 20); + this.label7.TabIndex = 18; + this.label7.Text = "6inch"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(350, 26); + this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(47, 20); + this.label6.TabIndex = 17; + this.label6.Text = "4inch"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(268, 24); + this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(47, 20); + this.label5.TabIndex = 16; + this.label5.Text = "3inch"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(182, 26); + this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(47, 20); + this.label4.TabIndex = 15; + this.label4.Text = "2inch"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(98, 26); + this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(60, 20); + this.label3.TabIndex = 14; + this.label3.Text = "1.5inch"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(33, 88); + this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(38, 20); + this.label2.TabIndex = 13; + this.label2.Text = "Ch2"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(33, 52); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(38, 20); + this.label1.TabIndex = 12; + this.label1.Text = "Ch1"; + // + // textBoxCh2_6MoreInch + // + this.textBoxCh2_6MoreInch.Enabled = false; + this.textBoxCh2_6MoreInch.Location = new System.Drawing.Point(506, 83); + this.textBoxCh2_6MoreInch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.textBoxCh2_6MoreInch.Name = "textBoxCh2_6MoreInch"; + this.textBoxCh2_6MoreInch.Size = new System.Drawing.Size(73, 26); + this.textBoxCh2_6MoreInch.TabIndex = 11; + // + // textBoxCh2_6inch + // + this.textBoxCh2_6inch.Enabled = false; + this.textBoxCh2_6inch.Location = new System.Drawing.Point(422, 83); + this.textBoxCh2_6inch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.textBoxCh2_6inch.Name = "textBoxCh2_6inch"; + this.textBoxCh2_6inch.Size = new System.Drawing.Size(73, 26); + this.textBoxCh2_6inch.TabIndex = 10; + // + // textBoxCh2_4inch + // + this.textBoxCh2_4inch.Enabled = false; + this.textBoxCh2_4inch.Location = new System.Drawing.Point(338, 83); + this.textBoxCh2_4inch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.textBoxCh2_4inch.Name = "textBoxCh2_4inch"; + this.textBoxCh2_4inch.Size = new System.Drawing.Size(73, 26); + this.textBoxCh2_4inch.TabIndex = 9; + // + // textBoxCh2_3inch + // + this.textBoxCh2_3inch.Enabled = false; + this.textBoxCh2_3inch.Location = new System.Drawing.Point(254, 83); + this.textBoxCh2_3inch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.textBoxCh2_3inch.Name = "textBoxCh2_3inch"; + this.textBoxCh2_3inch.Size = new System.Drawing.Size(73, 26); + this.textBoxCh2_3inch.TabIndex = 8; + // + // textBoxCh2_2inch + // + this.textBoxCh2_2inch.Enabled = false; + this.textBoxCh2_2inch.Location = new System.Drawing.Point(170, 83); + this.textBoxCh2_2inch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.textBoxCh2_2inch.Name = "textBoxCh2_2inch"; + this.textBoxCh2_2inch.Size = new System.Drawing.Size(73, 26); + this.textBoxCh2_2inch.TabIndex = 7; + // + // textBoxCh2_15inch + // + this.textBoxCh2_15inch.Enabled = false; + this.textBoxCh2_15inch.Location = new System.Drawing.Point(86, 83); + this.textBoxCh2_15inch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.textBoxCh2_15inch.Name = "textBoxCh2_15inch"; + this.textBoxCh2_15inch.Size = new System.Drawing.Size(73, 26); + this.textBoxCh2_15inch.TabIndex = 6; + // + // textBoxCh1_6MoreInch + // + this.textBoxCh1_6MoreInch.Enabled = false; + this.textBoxCh1_6MoreInch.Location = new System.Drawing.Point(506, 48); + this.textBoxCh1_6MoreInch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.textBoxCh1_6MoreInch.Name = "textBoxCh1_6MoreInch"; + this.textBoxCh1_6MoreInch.Size = new System.Drawing.Size(73, 26); + this.textBoxCh1_6MoreInch.TabIndex = 5; + // + // textBoxCh1_6inch + // + this.textBoxCh1_6inch.Enabled = false; + this.textBoxCh1_6inch.Location = new System.Drawing.Point(422, 48); + this.textBoxCh1_6inch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.textBoxCh1_6inch.Name = "textBoxCh1_6inch"; + this.textBoxCh1_6inch.Size = new System.Drawing.Size(73, 26); + this.textBoxCh1_6inch.TabIndex = 4; + // + // textBoxCh1_4inch + // + this.textBoxCh1_4inch.Enabled = false; + this.textBoxCh1_4inch.Location = new System.Drawing.Point(338, 48); + this.textBoxCh1_4inch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.textBoxCh1_4inch.Name = "textBoxCh1_4inch"; + this.textBoxCh1_4inch.Size = new System.Drawing.Size(73, 26); + this.textBoxCh1_4inch.TabIndex = 3; + // + // textBoxCh1_3inch + // + this.textBoxCh1_3inch.Enabled = false; + this.textBoxCh1_3inch.Location = new System.Drawing.Point(254, 48); + this.textBoxCh1_3inch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.textBoxCh1_3inch.Name = "textBoxCh1_3inch"; + this.textBoxCh1_3inch.Size = new System.Drawing.Size(73, 26); + this.textBoxCh1_3inch.TabIndex = 2; + // + // textBoxCh1_2inch + // + this.textBoxCh1_2inch.Enabled = false; + this.textBoxCh1_2inch.Location = new System.Drawing.Point(170, 48); + this.textBoxCh1_2inch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.textBoxCh1_2inch.Name = "textBoxCh1_2inch"; + this.textBoxCh1_2inch.Size = new System.Drawing.Size(73, 26); + this.textBoxCh1_2inch.TabIndex = 1; + // + // textBoxCh1_15inch + // + this.textBoxCh1_15inch.Enabled = false; + this.textBoxCh1_15inch.Location = new System.Drawing.Point(86, 49); + this.textBoxCh1_15inch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.textBoxCh1_15inch.Name = "textBoxCh1_15inch"; + this.textBoxCh1_15inch.Size = new System.Drawing.Size(73, 26); + this.textBoxCh1_15inch.TabIndex = 0; + // + // TestMethodCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.dfltQ2corrFactorsGroupBox); + this.Controls.Add(this.useWebServiceGroupBox); + this.Controls.Add(this.delayBetweenRetriesTextBox); + this.Controls.Add(this.delayBetweenRetriesLabel); + this.Controls.Add(this.iperlCheckErrorsToStopTextBox); + this.Controls.Add(this.iperlCheckErrorsToStopLabel); + this.Controls.Add(this.nrThreadsTextBox); + this.Controls.Add(this.nrThreadsLabel); + this.Controls.Add(this.maxCommRetriesTextBox); + this.Controls.Add(this.maxNrRetriesLabel); + this.Controls.Add(this.commTimeoutTextBox); + this.Controls.Add(this.commTimeoutLabel); + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.Name = "TestMethodCfgCtrl"; + this.Size = new System.Drawing.Size(640, 580); + this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load); + this.useWebServiceGroupBox.ResumeLayout(false); + this.useWebServiceGroupBox.PerformLayout(); + this.dfltQ2corrFactorsGroupBox.ResumeLayout(false); + this.dfltQ2corrFactorsGroupBox.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); } + private System.Windows.Forms.Label label9; + private System.Windows.Forms.TextBox textBoxCh3_6MoreInch; + private System.Windows.Forms.TextBox textBoxCh3_6inch; + private System.Windows.Forms.TextBox textBoxCh3_4inch; + private System.Windows.Forms.TextBox textBoxCh3_3inch; + private System.Windows.Forms.TextBox textBoxCh3_2inch; + private System.Windows.Forms.TextBox textBoxCh3_15inch; + #endregion private System.Windows.Forms.TextBox nameTextBox; @@ -504,17 +632,17 @@ namespace TBF.Rig.TestMethods.GenesisCommunication private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label1; - private System.Windows.Forms.TextBox textBox40lr; - private System.Windows.Forms.TextBox textBox32lr; - private System.Windows.Forms.TextBox textBox25_10lr; - private System.Windows.Forms.TextBox textBox25_63lr; - private System.Windows.Forms.TextBox textBox20lr; - private System.Windows.Forms.TextBox textBox15lr; - private System.Windows.Forms.TextBox textBox40rl; - private System.Windows.Forms.TextBox textBox32rl; - private System.Windows.Forms.TextBox textBox25_10rl; - private System.Windows.Forms.TextBox textBox25_63rl; - private System.Windows.Forms.TextBox textBox20rl; - private System.Windows.Forms.TextBox textBox15rl; + private System.Windows.Forms.TextBox textBoxCh2_6MoreInch; + private System.Windows.Forms.TextBox textBoxCh2_6inch; + private System.Windows.Forms.TextBox textBoxCh2_4inch; + private System.Windows.Forms.TextBox textBoxCh2_3inch; + private System.Windows.Forms.TextBox textBoxCh2_2inch; + private System.Windows.Forms.TextBox textBoxCh2_15inch; + private System.Windows.Forms.TextBox textBoxCh1_6MoreInch; + private System.Windows.Forms.TextBox textBoxCh1_6inch; + private System.Windows.Forms.TextBox textBoxCh1_4inch; + private System.Windows.Forms.TextBox textBoxCh1_3inch; + private System.Windows.Forms.TextBox textBoxCh1_2inch; + private System.Windows.Forms.TextBox textBoxCh1_15inch; } } diff --git a/TBF/Rig/TestMethods/GenesisCommunication/iPerlCommunicationParams.cs b/TBF/Rig/TestMethods/GenesisCommunication/iPerlCommunicationParams.cs index 9bbb443d6..bf36352c2 100644 --- a/TBF/Rig/TestMethods/GenesisCommunication/iPerlCommunicationParams.cs +++ b/TBF/Rig/TestMethods/GenesisCommunication/iPerlCommunicationParams.cs @@ -63,6 +63,7 @@ namespace TBF.Rig.TestMethods.GenesisCommunication retVal.Add(iPerlCommunicationForm.SlotDisconnectStr); retVal.Add(iPerlCommunicationForm.PrepareSlotQ3CalibrationStr); retVal.Add(iPerlCommunicationForm.WriteSlotQ3CalibrationStr); + retVal.Add(iPerlCommunicationForm.CheckMeterPrepareStr); retVal.Add(iPerlCommunicationForm.HoldSlotStr); diff --git a/TBF/Rig/TestMethods/SmartMeterFlyingStartMassCollection/TestMethodCfg.cs b/TBF/Rig/TestMethods/SmartMeterFlyingStartMassCollection/TestMethodCfg.cs index 8c6bb82c2..9149db013 100644 --- a/TBF/Rig/TestMethods/SmartMeterFlyingStartMassCollection/TestMethodCfg.cs +++ b/TBF/Rig/TestMethods/SmartMeterFlyingStartMassCollection/TestMethodCfg.cs @@ -73,18 +73,18 @@ namespace TBF.Rig.TestMethods.SmartMeterFlyingStartMassCollection public int DataBits { get; set; } public Parity ParityBit { get; set; } public StopBits StopBits { get; set; } - public int DfltQ2c_15_rl { get; set; } - public int DfltQ2c_15_lr { get; set; } - public int DfltQ2c_20_rl { get; set; } - public int DfltQ2c_20_lr { get; set; } - public int DfltQ2c_25_63_rl { get; set; } - public int DfltQ2c_25_63_lr { get; set; } - public int DfltQ2c_25_10_rl { get; set; } - public int DfltQ2c_25_10_lr { get; set; } - public int DfltQ2c_32_rl { get; set; } - public int DfltQ2c_32_lr { get; set; } - public int DfltQ2c_40_rl { get; set; } - public int DfltQ2c_40_lr { get; set; } + public int CalibFactor1InchCh1 { get; set; } + public int CalibFactor1InchCh2 { get; set; } + public int CalibFactor2InchCh1 { get; set; } + public int CalibFactor2InchCh2 { get; set; } + public int CalibFactor3InchCh1 { get; set; } + public int CalibFactor3InchCh2 { get; set; } + public int CalibFactor4InchCh1 { get; set; } + public int CalibFactor4InchCh2 { get; set; } + public int CalibFactor6InchCh1 { get; set; } + public int CalibFactor6InchCh2 { get; set; } + public int CalibFactor6MoreInchCh1 { get; set; } + public int CalibFactor6MoreInchCh2 { get; set; } public bool UseWebService { get; set; } public string BaseUrl { get; set; } public string RelativeUrl { get; set; } diff --git a/TBF/Rig/TestMethods/SmartMeterFlyingStartMassCollection/TestMethodCfgCtrl.cs b/TBF/Rig/TestMethods/SmartMeterFlyingStartMassCollection/TestMethodCfgCtrl.cs index 5faf49883..a572ba281 100644 --- a/TBF/Rig/TestMethods/SmartMeterFlyingStartMassCollection/TestMethodCfgCtrl.cs +++ b/TBF/Rig/TestMethods/SmartMeterFlyingStartMassCollection/TestMethodCfgCtrl.cs @@ -51,18 +51,18 @@ namespace TBF.Rig.TestMethods.SmartMeterFlyingStartMassCollection nrThreadsTextBox.Text = config.NrThreads.ToString(); iperlCheckErrorsToStopTextBox.Text = config.IperlCheckErrorsToStop.ToString(); - textBox15rl.Text = config.DfltQ2c_15_rl.ToString(); - textBox15lr.Text = config.DfltQ2c_15_lr.ToString(); - textBox20rl.Text = config.DfltQ2c_20_rl.ToString(); - textBox20lr.Text = config.DfltQ2c_20_lr.ToString(); - textBox25_63rl.Text = config.DfltQ2c_25_63_rl.ToString(); - textBox25_63lr.Text = config.DfltQ2c_25_63_lr.ToString(); - textBox25_10rl.Text = config.DfltQ2c_25_10_rl.ToString(); - textBox25_10lr.Text = config.DfltQ2c_25_10_lr.ToString(); - textBox32rl.Text = config.DfltQ2c_32_rl.ToString(); - textBox32lr.Text = config.DfltQ2c_32_lr.ToString(); - textBox40rl.Text = config.DfltQ2c_40_rl.ToString(); - textBox40lr.Text = config.DfltQ2c_40_lr.ToString(); + textBox15rl.Text = config.CalibFactor1InchCh1.ToString(); + textBox15lr.Text = config.CalibFactor1InchCh2.ToString(); + textBox20rl.Text = config.CalibFactor2InchCh1.ToString(); + textBox20lr.Text = config.CalibFactor2InchCh2.ToString(); + textBox25_63rl.Text = config.CalibFactor3InchCh1.ToString(); + textBox25_63lr.Text = config.CalibFactor3InchCh2.ToString(); + textBox25_10rl.Text = config.CalibFactor4InchCh1.ToString(); + textBox25_10lr.Text = config.CalibFactor4InchCh2.ToString(); + textBox32rl.Text = config.CalibFactor6InchCh1.ToString(); + textBox32lr.Text = config.CalibFactor6InchCh2.ToString(); + textBox40rl.Text = config.CalibFactor6MoreInchCh1.ToString(); + textBox40lr.Text = config.CalibFactor6MoreInchCh2.ToString(); useWebServiceCheckBox.Checked = config.UseWebService; baseUrlTextBox.Text = config.BaseUrl; @@ -209,18 +209,18 @@ namespace TBF.Rig.TestMethods.SmartMeterFlyingStartMassCollection var DelayBetweenRetries = config.DelayBetweenRetries; var NrThreads = config.NrThreads; var IperlCheckErrorsToStop = config.IperlCheckErrorsToStop; - var DfltQ2c_15_rl = config.DfltQ2c_15_rl; - var DfltQ2c_15_lr = config.DfltQ2c_15_lr; - var DfltQ2c_20_rl = config.DfltQ2c_20_rl; - var DfltQ2c_20_lr = config.DfltQ2c_20_lr; - var DfltQ2c_25_63_rl = config.DfltQ2c_25_63_rl; - var DfltQ2c_25_63_lr = config.DfltQ2c_25_63_lr; - var DfltQ2c_25_10_rl = config.DfltQ2c_25_10_rl; - var DfltQ2c_25_10_lr = config.DfltQ2c_25_10_lr; - var DfltQ2c_32_rl = config.DfltQ2c_32_rl; - var DfltQ2c_32_lr = config.DfltQ2c_32_lr; - var DfltQ2c_40_rl = config.DfltQ2c_40_rl; - var DfltQ2c_40_lr = config.DfltQ2c_40_lr; + var DfltQ2c_15_rl = config.CalibFactor1InchCh1; + var DfltQ2c_15_lr = config.CalibFactor1InchCh2; + var DfltQ2c_20_rl = config.CalibFactor2InchCh1; + var DfltQ2c_20_lr = config.CalibFactor2InchCh2; + var DfltQ2c_25_63_rl = config.CalibFactor3InchCh1; + var DfltQ2c_25_63_lr = config.CalibFactor3InchCh2; + var DfltQ2c_25_10_rl = config.CalibFactor4InchCh1; + var DfltQ2c_25_10_lr = config.CalibFactor4InchCh2; + var DfltQ2c_32_rl = config.CalibFactor6InchCh1; + var DfltQ2c_32_lr = config.CalibFactor6InchCh2; + var DfltQ2c_40_rl = config.CalibFactor6MoreInchCh1; + var DfltQ2c_40_lr = config.CalibFactor6MoreInchCh2; var UseWebService = config.UseWebService; var BaseUrl = config.BaseUrl; var RelativeUrl = config.RelativeUrl; @@ -254,18 +254,18 @@ namespace TBF.Rig.TestMethods.SmartMeterFlyingStartMassCollection config.DelayBetweenRetries = DelayBetweenRetries; config.NrThreads = NrThreads; config.IperlCheckErrorsToStop = IperlCheckErrorsToStop; - config.DfltQ2c_15_rl = DfltQ2c_15_rl; - config.DfltQ2c_15_lr = DfltQ2c_15_lr; - config.DfltQ2c_20_rl = DfltQ2c_20_rl; - config.DfltQ2c_20_lr = DfltQ2c_20_lr; - config.DfltQ2c_25_63_rl = DfltQ2c_25_63_rl; - config.DfltQ2c_25_63_lr = DfltQ2c_25_63_lr; - config.DfltQ2c_25_10_rl = DfltQ2c_25_10_rl; - config.DfltQ2c_25_10_lr = DfltQ2c_25_10_lr; - config.DfltQ2c_32_rl = DfltQ2c_32_rl; - config.DfltQ2c_32_lr = DfltQ2c_32_lr; - config.DfltQ2c_40_rl = DfltQ2c_40_rl; - config.DfltQ2c_40_lr = DfltQ2c_40_lr; + config.CalibFactor1InchCh1 = DfltQ2c_15_rl; + config.CalibFactor1InchCh2 = DfltQ2c_15_lr; + config.CalibFactor2InchCh1 = DfltQ2c_20_rl; + config.CalibFactor2InchCh2 = DfltQ2c_20_lr; + config.CalibFactor3InchCh1 = DfltQ2c_25_63_rl; + config.CalibFactor3InchCh2 = DfltQ2c_25_63_lr; + config.CalibFactor4InchCh1 = DfltQ2c_25_10_rl; + config.CalibFactor4InchCh2 = DfltQ2c_25_10_lr; + config.CalibFactor6InchCh1 = DfltQ2c_32_rl; + config.CalibFactor6InchCh2 = DfltQ2c_32_lr; + config.CalibFactor6MoreInchCh1 = DfltQ2c_40_rl; + config.CalibFactor6MoreInchCh2 = DfltQ2c_40_lr; config.UseWebService = UseWebService; config.BaseUrl = BaseUrl; config.RelativeUrl = RelativeUrl; diff --git a/TBF/Rig/TestMethods/SmartTest/TestMethodCfgCtrl.cs b/TBF/Rig/TestMethods/SmartTest/TestMethodCfgCtrl.cs index 6ab45c336..9cbb44dd3 100644 --- a/TBF/Rig/TestMethods/SmartTest/TestMethodCfgCtrl.cs +++ b/TBF/Rig/TestMethods/SmartTest/TestMethodCfgCtrl.cs @@ -55,18 +55,18 @@ namespace TBF.Rig.TestMethods.SmartTest if (config is IiPerlTestMethodCfg cfg) { iperlCheckErrorsToStopTextBox.Text = cfg.IperlCheckErrorsToStop.ToString(); - textBox15rl.Text = cfg.DfltQ2c_15_rl.ToString(); - textBox15lr.Text = cfg.DfltQ2c_15_lr.ToString(); - textBox20rl.Text = cfg.DfltQ2c_20_rl.ToString(); - textBox20lr.Text = cfg.DfltQ2c_20_lr.ToString(); - textBox25_63rl.Text = cfg.DfltQ2c_25_63_rl.ToString(); - textBox25_63lr.Text = cfg.DfltQ2c_25_63_lr.ToString(); - textBox25_10rl.Text = cfg.DfltQ2c_25_10_rl.ToString(); - textBox25_10lr.Text = cfg.DfltQ2c_25_10_lr.ToString(); - textBox32rl.Text = cfg.DfltQ2c_32_rl.ToString(); - textBox32lr.Text = cfg.DfltQ2c_32_lr.ToString(); - textBox40rl.Text = cfg.DfltQ2c_40_rl.ToString(); - textBox40lr.Text = cfg.DfltQ2c_40_lr.ToString(); + textBox15rl.Text = cfg.CalibFactor1InchCh1.ToString(); + textBox15lr.Text = cfg.CalibFactor1InchCh2.ToString(); + textBox20rl.Text = cfg.CalibFactor2InchCh1.ToString(); + textBox20lr.Text = cfg.CalibFactor2InchCh2.ToString(); + textBox25_63rl.Text = cfg.CalibFactor3InchCh1.ToString(); + textBox25_63lr.Text = cfg.CalibFactor3InchCh2.ToString(); + textBox25_10rl.Text = cfg.CalibFactor4InchCh1.ToString(); + textBox25_10lr.Text = cfg.CalibFactor4InchCh2.ToString(); + textBox32rl.Text = cfg.CalibFactor6InchCh1.ToString(); + textBox32lr.Text = cfg.CalibFactor6InchCh2.ToString(); + textBox40rl.Text = cfg.CalibFactor6MoreInchCh1.ToString(); + textBox40lr.Text = cfg.CalibFactor6MoreInchCh2.ToString(); } useWebServiceCheckBox.Checked = config.UseWebService; @@ -225,18 +225,18 @@ namespace TBF.Rig.TestMethods.SmartTest { var IperlCheckErrorsToStop = cfg.IperlCheckErrorsToStop; - var DfltQ2c_15_rl = cfg.DfltQ2c_15_rl; - var DfltQ2c_15_lr = cfg.DfltQ2c_15_lr; - var DfltQ2c_20_rl = cfg.DfltQ2c_20_rl; - var DfltQ2c_20_lr = cfg.DfltQ2c_20_lr; - var DfltQ2c_25_63_rl = cfg.DfltQ2c_25_63_rl; - var DfltQ2c_25_63_lr = cfg.DfltQ2c_25_63_lr; - var DfltQ2c_25_10_rl = cfg.DfltQ2c_25_10_rl; - var DfltQ2c_25_10_lr = cfg.DfltQ2c_25_10_lr; - var DfltQ2c_32_rl = cfg.DfltQ2c_32_rl; - var DfltQ2c_32_lr = cfg.DfltQ2c_32_lr; - var DfltQ2c_40_rl = cfg.DfltQ2c_40_rl; - var DfltQ2c_40_lr = cfg.DfltQ2c_40_lr; + var DfltQ2c_15_rl = cfg.CalibFactor1InchCh1; + var DfltQ2c_15_lr = cfg.CalibFactor1InchCh2; + var DfltQ2c_20_rl = cfg.CalibFactor2InchCh1; + var DfltQ2c_20_lr = cfg.CalibFactor2InchCh2; + var DfltQ2c_25_63_rl = cfg.CalibFactor3InchCh1; + var DfltQ2c_25_63_lr = cfg.CalibFactor3InchCh2; + var DfltQ2c_25_10_rl = cfg.CalibFactor4InchCh1; + var DfltQ2c_25_10_lr = cfg.CalibFactor4InchCh2; + var DfltQ2c_32_rl = cfg.CalibFactor6InchCh1; + var DfltQ2c_32_lr = cfg.CalibFactor6InchCh2; + var DfltQ2c_40_rl = cfg.CalibFactor6MoreInchCh1; + var DfltQ2c_40_lr = cfg.CalibFactor6MoreInchCh2; flags |= UpdateDifferent(ref IperlCheckErrorsToStop, iperlCheckErrorsToStopTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); flags |= UpdateDifferent(ref DfltQ2c_15_rl, textBox15rl.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); @@ -253,18 +253,18 @@ namespace TBF.Rig.TestMethods.SmartTest flags |= UpdateDifferent(ref DfltQ2c_40_lr, textBox40lr.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); cfg.IperlCheckErrorsToStop = IperlCheckErrorsToStop; - cfg.DfltQ2c_15_rl = DfltQ2c_15_rl; - cfg.DfltQ2c_15_lr = DfltQ2c_15_lr; - cfg.DfltQ2c_20_rl = DfltQ2c_20_rl; - cfg.DfltQ2c_20_lr = DfltQ2c_20_lr; - cfg.DfltQ2c_25_63_rl = DfltQ2c_25_63_rl; - cfg.DfltQ2c_25_63_lr = DfltQ2c_25_63_lr; - cfg.DfltQ2c_25_10_rl = DfltQ2c_25_10_rl; - cfg.DfltQ2c_25_10_lr = DfltQ2c_25_10_lr; - cfg.DfltQ2c_32_rl = DfltQ2c_32_rl; - cfg.DfltQ2c_32_lr = DfltQ2c_32_lr; - cfg.DfltQ2c_40_rl = DfltQ2c_40_rl; - cfg.DfltQ2c_40_lr = DfltQ2c_40_lr; + cfg.CalibFactor1InchCh1 = DfltQ2c_15_rl; + cfg.CalibFactor1InchCh2 = DfltQ2c_15_lr; + cfg.CalibFactor2InchCh1 = DfltQ2c_20_rl; + cfg.CalibFactor2InchCh2 = DfltQ2c_20_lr; + cfg.CalibFactor3InchCh1 = DfltQ2c_25_63_rl; + cfg.CalibFactor3InchCh2 = DfltQ2c_25_63_lr; + cfg.CalibFactor4InchCh1 = DfltQ2c_25_10_rl; + cfg.CalibFactor4InchCh2 = DfltQ2c_25_10_lr; + cfg.CalibFactor6InchCh1 = DfltQ2c_32_rl; + cfg.CalibFactor6InchCh2 = DfltQ2c_32_lr; + cfg.CalibFactor6MoreInchCh1 = DfltQ2c_40_rl; + cfg.CalibFactor6MoreInchCh2 = DfltQ2c_40_lr; } flags |= UpdateDifferent(ref UseWebService, useWebServiceCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); flags |= UpdateDifferent(ref BaseUrl, baseUrlTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); diff --git a/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs b/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs index a11b4d061..ecf9ed721 100644 --- a/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs +++ b/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs @@ -812,14 +812,14 @@ namespace TBF.Rig.TestMethods.iPerlCommunication else if (currentActivity.ToLower().Equals(SlotConnectStr.ToLower())) error = SlotConnect(threadID, ihead, ref resultStr); else if (currentActivity.ToLower().Equals(SlotPCBSlotStr.ToLower())) error = SlotPCBSlot(threadID, ihead, ref resultStr); else if (currentActivity.ToLower().Equals(SlotSetPasswordStr.ToLower())) error = SlotSetPassword(threadID, ihead, ref resultStr); - else if (currentActivity.ToLower().Equals(SlotLoginStr.ToLower())) error = SlotLogin(threadID, ihead, ref resultStr); - else if (currentActivity.ToLower().Equals(SlotGroupedLoginStr.ToLower())) error = SlotGroupedLogin(threadID, ihead, ref resultStr); + else if (currentActivity.ToLower().Equals(SlotLoginStr.ToLower())) error = SlotLogin(threadID, ihead, ref resultStr); + else if (currentActivity.ToLower().Equals(SlotGroupedLoginStr.ToLower())) error = SlotGroupedLogin(threadID, ihead, ref resultStr); else if (currentActivity.ToLower().Equals(SlotSetTestModeStr.ToLower())) error = SlotSetTestMode(threadID, ihead, ref resultStr); - else if (currentActivity.ToLower().Equals(SlotSetActiveModeStr.ToLower())) error = SlotSetActiveMode(threadID, ihead, ref resultStr); - else if (currentActivity.ToLower().Equals(SlotDisconnectStr.ToLower())) error = SlotDisconnect(threadID, ihead, ref resultStr); - else if (currentActivity.ToLower().Equals(PrepareSlotQ3CalibrationStr.ToLower())) error = PrepareSlotQ3Calibration(threadID, ihead, ref resultStr); + else if (currentActivity.ToLower().Equals(SlotSetActiveModeStr.ToLower()))error = SlotSetActiveMode(threadID, ihead, ref resultStr); + else if (currentActivity.ToLower().Equals(SlotDisconnectStr.ToLower())) error = SlotDisconnect(threadID, ihead, ref resultStr); + else if (currentActivity.ToLower().Equals(PrepareSlotQ3CalibrationStr.ToLower())) error = PrepareSlotQ3Calibration(threadID, ihead,wm, currentTest, tests , ref resultStr); else if (currentActivity.ToLower().Equals(WriteSlotQ3CalibrationStr.ToLower())) error = WriteSlotQ3Calibration(threadID, ihead, ref resultStr); - else if (currentActivity.ToLower().Equals(CheckMeterPrepareStr.ToLower())) error = CheckMeterPrepare(threadID, ihead, ref resultStr); + else if (currentActivity.ToLower().Equals(CheckMeterPrepareStr.ToLower())) error = CheckMeterPrepare(threadID, ihead, ref resultStr); else if (currentActivity.ToLower().Contains(ReadSerialNrStr.ToLower())) error = ReadSerialNr(threadID, ihead, ref resultStr); else if (currentActivity.ToLower().Contains(SetTestModeStr.ToLower())) error = SetTestMode(threadID, ihead, ref resultStr); @@ -1021,10 +1021,30 @@ namespace TBF.Rig.TestMethods.iPerlCommunication return error; } - private CommErr PrepareSlotQ3Calibration(int threadId, GenesisSmartReader iHead, ref string resultStr) + private CommErr PrepareSlotQ3Calibration(int threadId, GenesisSmartReader iHead, WaterMeter wm, + Test currentTest, IList tests, ref string resultStr) { CommErr error = CommErr.FailedLogin; - var gciFullLoginResult = iHead.OptoHeadTest.PrepareQ3Calibration(); + //TODO BUMI get Next test method + + Test NextTest = null; + bool bNextChatch = false; + foreach (Test test in tests) + { + if (test.Equals(currentTest)) + { + bNextChatch = true; + continue; + } + + if (bNextChatch) + { + NextTest = test; + break; + } + } + + var gciFullLoginResult = iHead.OptoHeadTest.PrepareQ3Calibration(cfg,NextTest); if (!string.IsNullOrEmpty(resultStr) && resultStr.Equals(TBF.Rig.RegisterReaders.GenesisRegReader.communication.OptoHeadTest.ResultOk)) { log.Debug("SlotLogin successful"); diff --git a/TBF/Rig/Uni/SharedDialogs/SmartMetersCommunication/implementations/IPerlASICCorrections.cs b/TBF/Rig/Uni/SharedDialogs/SmartMetersCommunication/implementations/IPerlASICCorrections.cs index ff275c244..7192d0201 100644 --- a/TBF/Rig/Uni/SharedDialogs/SmartMetersCommunication/implementations/IPerlASICCorrections.cs +++ b/TBF/Rig/Uni/SharedDialogs/SmartMetersCommunication/implementations/IPerlASICCorrections.cs @@ -1724,28 +1724,28 @@ namespace TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication.implementations switch (ihead.MeterType) { case MeterType.DN15: - q2corrRL = cfgIPerl.DfltQ2c_15_rl; - q2corrLR = cfgIPerl.DfltQ2c_15_lr; + q2corrRL = cfgIPerl.CalibFactor1InchCh1; + q2corrLR = cfgIPerl.CalibFactor1InchCh2; break; case MeterType.DN20: - q2corrRL = cfgIPerl.DfltQ2c_20_rl; - q2corrLR = cfgIPerl.DfltQ2c_20_lr; + q2corrRL = cfgIPerl.CalibFactor2InchCh1; + q2corrLR = cfgIPerl.CalibFactor2InchCh2; break; case MeterType.DN25: - q2corrRL = cfgIPerl.DfltQ2c_25_63_rl; - q2corrLR = cfgIPerl.DfltQ2c_25_63_lr; + q2corrRL = cfgIPerl.CalibFactor3InchCh1; + q2corrLR = cfgIPerl.CalibFactor3InchCh2; break; case MeterType.DN25_Q3_10: - q2corrRL = cfgIPerl.DfltQ2c_25_10_rl; - q2corrLR = cfgIPerl.DfltQ2c_25_10_lr; + q2corrRL = cfgIPerl.CalibFactor4InchCh1; + q2corrLR = cfgIPerl.CalibFactor4InchCh2; break; case MeterType.DN32: - q2corrRL = cfgIPerl.DfltQ2c_32_rl; - q2corrLR = cfgIPerl.DfltQ2c_32_lr; + q2corrRL = cfgIPerl.CalibFactor6InchCh1; + q2corrLR = cfgIPerl.CalibFactor6InchCh2; break; case MeterType.DN40: - q2corrRL = cfgIPerl.DfltQ2c_40_rl; - q2corrLR = cfgIPerl.DfltQ2c_40_lr; + q2corrRL = cfgIPerl.CalibFactor6MoreInchCh1; + q2corrLR = cfgIPerl.CalibFactor6MoreInchCh2; break; default: q2corrRL = 0; @@ -1832,28 +1832,28 @@ namespace TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication.implementations switch (ihead.MeterType) { case MeterType.DN15: - q2corrRL = cfgIPerl.DfltQ2c_15_rl; - q2corrLR = cfgIPerl.DfltQ2c_15_lr; + q2corrRL = cfgIPerl.CalibFactor1InchCh1; + q2corrLR = cfgIPerl.CalibFactor1InchCh2; break; case MeterType.DN20: - q2corrRL = cfgIPerl.DfltQ2c_20_rl; - q2corrLR = cfgIPerl.DfltQ2c_20_lr; + q2corrRL = cfgIPerl.CalibFactor2InchCh1; + q2corrLR = cfgIPerl.CalibFactor2InchCh2; break; case MeterType.DN25: - q2corrRL = cfgIPerl.DfltQ2c_25_63_rl; - q2corrLR = cfgIPerl.DfltQ2c_25_63_lr; + q2corrRL = cfgIPerl.CalibFactor3InchCh1; + q2corrLR = cfgIPerl.CalibFactor3InchCh2; break; case MeterType.DN25_Q3_10: - q2corrRL = cfgIPerl.DfltQ2c_25_10_rl; - q2corrLR = cfgIPerl.DfltQ2c_25_10_lr; + q2corrRL = cfgIPerl.CalibFactor4InchCh1; + q2corrLR = cfgIPerl.CalibFactor4InchCh2; break; case MeterType.DN32: - q2corrRL = cfgIPerl.DfltQ2c_32_rl; - q2corrLR = cfgIPerl.DfltQ2c_32_lr; + q2corrRL = cfgIPerl.CalibFactor6InchCh1; + q2corrLR = cfgIPerl.CalibFactor6InchCh2; break; case MeterType.DN40: - q2corrRL = cfgIPerl.DfltQ2c_40_rl; - q2corrLR = cfgIPerl.DfltQ2c_40_lr; + q2corrRL = cfgIPerl.CalibFactor6MoreInchCh1; + q2corrLR = cfgIPerl.CalibFactor6MoreInchCh2; break; default: q2corrRL = 0; diff --git a/TBF/Rig/Uni/SharedDialogs/SmartMetersCommunication/implementations/IPerlCorrections.cs b/TBF/Rig/Uni/SharedDialogs/SmartMetersCommunication/implementations/IPerlCorrections.cs index 844a1db13..c7389b238 100644 --- a/TBF/Rig/Uni/SharedDialogs/SmartMetersCommunication/implementations/IPerlCorrections.cs +++ b/TBF/Rig/Uni/SharedDialogs/SmartMetersCommunication/implementations/IPerlCorrections.cs @@ -1724,28 +1724,28 @@ namespace TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication.implementations switch (ihead.MeterType) { case MeterType.DN15: - q2corrRL = cfgIPerl.DfltQ2c_15_rl; - q2corrLR = cfgIPerl.DfltQ2c_15_lr; + q2corrRL = cfgIPerl.CalibFactor1InchCh1; + q2corrLR = cfgIPerl.CalibFactor1InchCh2; break; case MeterType.DN20: - q2corrRL = cfgIPerl.DfltQ2c_20_rl; - q2corrLR = cfgIPerl.DfltQ2c_20_lr; + q2corrRL = cfgIPerl.CalibFactor2InchCh1; + q2corrLR = cfgIPerl.CalibFactor2InchCh2; break; case MeterType.DN25: - q2corrRL = cfgIPerl.DfltQ2c_25_63_rl; - q2corrLR = cfgIPerl.DfltQ2c_25_63_lr; + q2corrRL = cfgIPerl.CalibFactor3InchCh1; + q2corrLR = cfgIPerl.CalibFactor3InchCh2; break; case MeterType.DN25_Q3_10: - q2corrRL = cfgIPerl.DfltQ2c_25_10_rl; - q2corrLR = cfgIPerl.DfltQ2c_25_10_lr; + q2corrRL = cfgIPerl.CalibFactor4InchCh1; + q2corrLR = cfgIPerl.CalibFactor4InchCh2; break; case MeterType.DN32: - q2corrRL = cfgIPerl.DfltQ2c_32_rl; - q2corrLR = cfgIPerl.DfltQ2c_32_lr; + q2corrRL = cfgIPerl.CalibFactor6InchCh1; + q2corrLR = cfgIPerl.CalibFactor6InchCh2; break; case MeterType.DN40: - q2corrRL = cfgIPerl.DfltQ2c_40_rl; - q2corrLR = cfgIPerl.DfltQ2c_40_lr; + q2corrRL = cfgIPerl.CalibFactor6MoreInchCh1; + q2corrLR = cfgIPerl.CalibFactor6MoreInchCh2; break; default: q2corrRL = 0; @@ -1832,28 +1832,28 @@ namespace TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication.implementations switch (ihead.MeterType) { case MeterType.DN15: - q2corrRL = cfgIPerl.DfltQ2c_15_rl; - q2corrLR = cfgIPerl.DfltQ2c_15_lr; + q2corrRL = cfgIPerl.CalibFactor1InchCh1; + q2corrLR = cfgIPerl.CalibFactor1InchCh2; break; case MeterType.DN20: - q2corrRL = cfgIPerl.DfltQ2c_20_rl; - q2corrLR = cfgIPerl.DfltQ2c_20_lr; + q2corrRL = cfgIPerl.CalibFactor2InchCh1; + q2corrLR = cfgIPerl.CalibFactor2InchCh2; break; case MeterType.DN25: - q2corrRL = cfgIPerl.DfltQ2c_25_63_rl; - q2corrLR = cfgIPerl.DfltQ2c_25_63_lr; + q2corrRL = cfgIPerl.CalibFactor3InchCh1; + q2corrLR = cfgIPerl.CalibFactor3InchCh2; break; case MeterType.DN25_Q3_10: - q2corrRL = cfgIPerl.DfltQ2c_25_10_rl; - q2corrLR = cfgIPerl.DfltQ2c_25_10_lr; + q2corrRL = cfgIPerl.CalibFactor4InchCh1; + q2corrLR = cfgIPerl.CalibFactor4InchCh2; break; case MeterType.DN32: - q2corrRL = cfgIPerl.DfltQ2c_32_rl; - q2corrLR = cfgIPerl.DfltQ2c_32_lr; + q2corrRL = cfgIPerl.CalibFactor6InchCh1; + q2corrLR = cfgIPerl.CalibFactor6InchCh2; break; case MeterType.DN40: - q2corrRL = cfgIPerl.DfltQ2c_40_rl; - q2corrLR = cfgIPerl.DfltQ2c_40_lr; + q2corrRL = cfgIPerl.CalibFactor6MoreInchCh1; + q2corrLR = cfgIPerl.CalibFactor6MoreInchCh2; break; default: q2corrRL = 0; diff --git a/TBF/TBF.csproj b/TBF/TBF.csproj index 176ff6c4d..e444e0a50 100644 --- a/TBF/TBF.csproj +++ b/TBF/TBF.csproj @@ -1425,6 +1425,7 @@ + @@ -1511,6 +1512,7 @@ + diff --git a/TBF/UI/Shared/LoginDlgWithBenchSelection.cs b/TBF/UI/Shared/LoginDlgWithBenchSelection.cs index a85d167c1..b48030266 100644 --- a/TBF/UI/Shared/LoginDlgWithBenchSelection.cs +++ b/TBF/UI/Shared/LoginDlgWithBenchSelection.cs @@ -89,8 +89,8 @@ namespace TBF.UI.Shared { Localize(); #if DEBUG - userNameTextBox.Text = "Sensus Developers"; - passwordTextBox.Text = "5fbg12gf5hn8nhy1fr"; + userNameTextBox.Text = "bumi"; + passwordTextBox.Text = "70630"; #endif Array.Sort(Program.LocalSettings.TestBenches); for (int i = 0; i < Program.LocalSettings.BenchesCount; i++) diff --git a/TBFTests/DBTest.cs b/TBFTests/DBTest.cs new file mode 100644 index 000000000..e5f6596b7 --- /dev/null +++ b/TBFTests/DBTest.cs @@ -0,0 +1,149 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Common; +using JetBrains.Annotations; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Results; +using Results.Entities; + + +namespace TBFTests +{ + [TestClass] + [TestSubject(typeof(DB))] + public class DBTests + { + private string _dbFile; + private string _dbName; + + [TestInitialize] + public void Setup() + { + DB.DbType = DBType.MySql; + DB.ConnectionString = + "SERVER=localhost; DATABASE=tbf_test; UID=root; PASSWORD=; CHARSET=utf8;"; + + DB.SessionFactory = null; + + Assert.IsTrue(DB.CreateEmptyDB()); + } + + [TestCleanup] + public void Cleanup() + { + DB.SessionFactory?.Dispose(); + DB.SessionFactory = null; + + if (File.Exists(_dbFile)) + File.Delete(_dbFile); + } + + [TestMethod] + public void LoadBatch_ExistingBatchNr_ReturnsBatch() + { + // ARRANGE + Batch batch = new Batch + { + BatchNr = 1234 + }; + + bool saved = DB.SaveNewBatch(batch); + Assert.IsTrue(saved); + + // ACT + Batch loaded = DB.LoadBatch(1234); + + // ASSERT + Assert.IsNotNull(loaded); + Assert.AreEqual(1234, loaded.BatchNr); + } + + [TestMethod] + public void LoadBatch_NotExistingBatchNr_ReturnsNull() + { + // ACT + Batch loaded = DB.LoadBatch(999999); + + // ASSERT + Assert.IsNull(loaded); + } + + + + [TestMethod] + public void LoadBatch_LoadsTestRsltCalibFactorResults() + { + Batch batch = new Batch + { + BatchNr = 2222, + TestRslts = new List(), + WaterMeters = new List() + }; + + TestData testData = new TestData + { + Name = "Q3Calibration", + Repeats = 1, + Method = "SmartCommunication" + }; + + Components components = new Components(); + + TestRslt testRslt = new TestRslt + { + Batch = batch, + TestData = testData, + Components = components, + Part = 1, + RepetitionNr = 1, + StartTime = DateTime.Now, + EndTime = DateTime.Now, + TestDone = true, + CalibFactorResultsToSave = new List + { + new TestRsltCalibFactor + { + CalibFactorIndex = 1, + BaseCalibFactor = 15625, + CalculatedCalibFactor = 17969, + Stored = true, + ErrorStr = "OK", + TimeStart = 1.1, + TimeEnd = 2.2, + CalibRawStart = 100, + CalibRawEnd = 200, + Error = 0.12, + VolumeStart = 10, + VolumeEnd = 20 + } + } + }; + + batch.TestRslts.Add(testRslt); + + bool saved = DB.SaveNewBatch(batch); + Assert.IsTrue(saved); + + Batch loaded = DB.LoadBatch(2222); + + Assert.IsNotNull(loaded); + Assert.IsNotNull(loaded.TestRslts); + Assert.AreEqual(1, loaded.TestRslts.Count); + + TestRslt loadedTestRslt = loaded.TestRslts[0]; + + Assert.IsNotNull(loadedTestRslt.CalibFactorResultsToSave); + Assert.AreEqual(1, loadedTestRslt.CalibFactorResultsToSave.Count); + + TestRsltCalibFactor loadedCalib = + loadedTestRslt.CalibFactorResultsToSave[0]; + + Assert.AreEqual(1, loadedCalib.CalibFactorIndex); + Assert.AreEqual(15625, loadedCalib.BaseCalibFactor); + Assert.AreEqual(17969, loadedCalib.CalculatedCalibFactor); + Assert.IsTrue(loadedCalib.Stored); + Assert.AreEqual("OK", loadedCalib.ErrorStr); + } + } +} \ No newline at end of file diff --git a/TBFTests/Rig/RegisterReaders/GenesisRegReader/communication/FakeGciBridgeClient.cs b/TBFTests/Rig/RegisterReaders/GenesisRegReader/communication/FakeGciBridgeClient.cs new file mode 100644 index 000000000..c2799ae78 --- /dev/null +++ b/TBFTests/Rig/RegisterReaders/GenesisRegReader/communication/FakeGciBridgeClient.cs @@ -0,0 +1,54 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using GenesisCordonelInterface.API; +using GenesisCordonelInterface.Core.Threading; +using TBF.Rig.RegisterReaders.GenesisRegReader.communication; + +namespace TBFTests.Rig.RegisterReaders.GenesisRegReader.communication +{ + public class FakeGciBridgeClient : IGciBridgeClient + { + public List<(string Register, ushort Value)> Writes = new List<(string Register, ushort Value)>(); + + public Task> + ReadRegisterWithRetryAsync( + int slotId, + string registerName, + CancellationToken token = default) + { + return Task.FromResult( + new RetryResult + { + Success = true, + Result = new PublicModels.RegisterReadResult + { + Success = true, + RawHex = "0014" + } + }); + } + + public Task> + WriteRegisterWithRetryAsync( + int slotId, + string registerName, + ushort value, + bool verify, + bool throwOnError, + CancellationToken token = default) + { + Writes.Add((registerName, value)); + + return Task.FromResult( + new RetryResult + { + Success = true, + Result = new PublicModels.RegisterWriteResult + { + Success = true + } + }); + } + } +} \ No newline at end of file diff --git a/TBFTests/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTestImpelementations.cs b/TBFTests/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTestImpelementations.cs new file mode 100644 index 000000000..fd5c9e4c9 --- /dev/null +++ b/TBFTests/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTestImpelementations.cs @@ -0,0 +1,124 @@ +using System.Reflection; +using System.Threading; +using System.Threading.Tasks; +using Config.Entities; +using GenesisCordonelInterface.API; +using JetBrains.Annotations; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using TBF.Rig.BridgeComponents.GciBridge; +using TBF.Rig.RegisterReaders.GenesisRegReader.communication; +using TBF.Rig.RegisterReaders.GenesisRegReader.implementations; +using TBF.Rig.Sequences; +using TBF.Rig.TestMethods.GenesisCommunication; + +namespace TBFTests.Rig.RegisterReaders.GenesisRegReader.communication +{ + + [TestClass] + [TestSubject(typeof(OptoHeadTest))] + public class OptoHeadTestImpelementations + { + [TestMethod] + public void PrepareMeterSizeAndCalibration_CfgNull_SetsDefaultCalibration() + { + GenesisSmartReader reader = new GenesisSmartReader(); + + MethodInfo method = typeof(OptoHeadTest).GetMethod( + "PrepareMeterSizeAndCalibration", + BindingFlags.NonPublic | BindingFlags.Static); + + Assert.IsNotNull(method); + + var task = (Task)method.Invoke( + null, + new object[] + { + reader, + null, + null, + CancellationToken.None + }); + + string result = task.GetAwaiter().GetResult(); + + Assert.AreEqual(OptoHeadTest.ResultOk, result); + Assert.IsNotNull(reader.Q3CalibValue); + Assert.AreEqual(3, reader.Q3CalibValue.Length); + + Assert.AreEqual(15625, reader.Q3CalibValue[0]); + Assert.AreEqual(15625, reader.Q3CalibValue[1]); + Assert.AreEqual(15625, reader.Q3CalibValue[2]); + } + + + + [TestMethod] + public void PrepareMeterSizeAndCalibration_MeterSize4_TakesCalibrationFromConfiguration() + { + GenesisSmartReader reader = new GenesisSmartReader(); + + TestMethodCfg cfg = new TestMethodCfg(null) + { + CalibFactor6InchCh1 = 17969, + CalibFactor6InchCh2 = 17969, + CalibFactor6InchCh3 = 17969 + }; + + MethodInfo method = typeof(OptoHeadTest).GetMethod( + "PrepareCalibrationFromMeterSizeRawHex", + BindingFlags.NonPublic | BindingFlags.Static); + + Assert.IsNotNull(method); + + string result = (string)method.Invoke( + null, + new object[] + { + reader, + cfg, + "04" + }); + + Assert.AreEqual(OptoHeadTest.ResultOk, result); + Assert.IsNotNull(reader.Q3CalibValue); + Assert.AreEqual(3, reader.Q3CalibValue.Length); + + Assert.AreEqual(17969, reader.Q3CalibValue[0]); + Assert.AreEqual(17969, reader.Q3CalibValue[1]); + Assert.AreEqual(17969, reader.Q3CalibValue[2]); + } + + [TestMethod] + public void PrepareQ3Calibration_SimulateMode_ReturnsOk() + { + // ARRANGE + GenesisSmartReader reader = new GenesisSmartReader + { + DebugLevel = Common.DebugMode.Simulate + }; + + OptoHeadTest optoHeadTest = new OptoHeadTest(reader); + + TestMethodCfg cfg = new TestMethodCfg(null) + { + CalibFactor6InchCh1 = 17969, + CalibFactor6InchCh2 = 17969, + CalibFactor6InchCh3 = 17969 + }; + + Test test = new Test + { + Name = "Q3Calibration", + Part = 1 + }; + + // ACT + string result = optoHeadTest.PrepareQ3Calibration(cfg, test); + + // ASSERT + Assert.AreEqual(OptoHeadTest.ResultOk, result); + } + + + } +} \ No newline at end of file diff --git a/TBFTests/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTestTestParseIntAnswer.cs b/TBFTests/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTestTestParseIntAnswer.cs new file mode 100644 index 000000000..c717d57d4 --- /dev/null +++ b/TBFTests/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTestTestParseIntAnswer.cs @@ -0,0 +1,84 @@ +using JetBrains.Annotations; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using TBF.Rig.RegisterReaders.GenesisRegReader.communication; +using System; + +namespace TBFTests.Rig.RegisterReaders.GenesisRegReader.communication +{ + [TestClass] + [TestSubject(typeof(OptoHeadTest))] + public class OptoHeadTestTestParseIntAnswer + { + private static uint InvokeParseRawHexToUInt32(string rawHex, bool littleEndian = false) + { + var method = typeof(OptoHeadTest).GetMethod( + "ParseRawHexToUInt32", + System.Reflection.BindingFlags.NonPublic | + System.Reflection.BindingFlags.Static); + + Assert.IsNotNull(method, "Private method ParseRawHexToUInt32 was not found."); + + return (uint)method.Invoke(null, new object[] { rawHex, littleEndian }); + } + + [TestMethod] + public void ParseRawHexToUInt32_OneByte_ReturnsValue() + { + uint result = InvokeParseRawHexToUInt32("33"); + + Assert.AreEqual(0x33u, result); + } + + [TestMethod] + public void ParseRawHexToUInt32_TwoBytes_ReturnsValue() + { + uint result = InvokeParseRawHexToUInt32("33 33"); + + Assert.AreEqual(0x3333u, result); + } + + [TestMethod] + public void ParseRawHexToUInt32_FourBytes_ReturnsValue() + { + uint result = InvokeParseRawHexToUInt32("33 33 00 00"); + + Assert.AreEqual(0x33330000u, result); + } + + [TestMethod] + public void ParseRawHexToUInt32_FourBytesLittleEndian_ReturnsValue() + { + uint result = InvokeParseRawHexToUInt32("33 33 00 00", true); + + Assert.AreEqual(0x00003333u, result); + } + + [TestMethod] + public void ParseRawHexToUInt32_Empty_ThrowsFormatException() + { + var ex = Assert.ThrowsException(() => + InvokeParseRawHexToUInt32("")); + + Assert.IsInstanceOfType(ex.InnerException, typeof(FormatException)); + } + + [TestMethod] + public void ParseRawHexToUInt32_InvalidHex_ThrowsFormatException() + { + var ex = Assert.ThrowsException(() => + InvokeParseRawHexToUInt32("GG")); + + Assert.IsInstanceOfType(ex.InnerException, typeof(FormatException)); + } + + [TestMethod] + public void ParseRawHexToUInt32_TooManyBytes_ThrowsFormatException() + { + var ex = Assert.ThrowsException(() => + InvokeParseRawHexToUInt32("01 02 03 04 05")); + + Assert.IsInstanceOfType(ex.InnerException, typeof(FormatException)); + } + + } +} \ No newline at end of file diff --git a/TBFTests/TBFTests.csproj b/TBFTests/TBFTests.csproj index 4f1b3a087..7c6970cc6 100644 --- a/TBFTests/TBFTests.csproj +++ b/TBFTests/TBFTests.csproj @@ -9,7 +9,7 @@ Properties TBFTests TBFTests - v4.7.2 + v4.8 512 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10.0 @@ -19,6 +19,7 @@ UnitTest + 8 true @@ -41,6 +42,9 @@ ..\packages\Castle.Core.5.1.1\lib\net462\Castle.Core.dll + + ..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll + ..\packages\JetBrains.Annotations.2023.3.0\lib\net20\JetBrains.Annotations.dll @@ -62,11 +66,18 @@ ..\packages\Moq.4.20.70\lib\net462\Moq.dll + + ..\packages\NHibernate.4.0.4.4000\lib\net40\NHibernate.dll + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + ..\packages\System.Data.SQLite.2.0.3\lib\net471\System.Data.SQLite.dll + ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll @@ -81,6 +92,7 @@ ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll + ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll @@ -100,6 +112,7 @@ + @@ -107,6 +120,9 @@ + + + @@ -151,6 +167,10 @@ {743df7db-c7b6-42eb-986d-0f485e5588e4} Config + + {c955d8ac-76b8-42d8-a83f-8aeb56cf2567} + GenesisCordonelInterface + {9d0dcc88-dc81-47eb-9fdd-4c3907871bfb} Results @@ -160,7 +180,7 @@ SchematicDrawing - {8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48} + {8648fd92-cda1-4c3a-b5f9-fe547ce1fa48} TBF @@ -190,8 +210,10 @@ + +