Compare commits

..
Author SHA1 Message Date
Milan Hanajik f7f0c2ce14 Reconfigured for SENTEC 2018-06-22 15:08:03 +02:00
68 changed files with 344 additions and 3673 deletions
+2 -2
View File
@@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;FUZHOU100</DefineConstants>
<DefineConstants>TRACE;DEBUG;SENTEC</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -28,7 +28,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;FUZHOU100</DefineConstants>
<DefineConstants>TRACE;SENTEC</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
+1 -13
View File
@@ -14,7 +14,7 @@ namespace Config
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 3;
#elif DN100 || BADGER_STREDNA_TRAT || BADGER_VELKA_TRAT || CEVAK_200
#elif DN100 || BADGER_STREDNA_TRAT || BADGER_VELKA_TRAT
public const int WMsCount = 3;
public const int LineSize = 3;
public const int CompoundWMsCount = 1;
@@ -26,18 +26,6 @@ namespace Config
public const int CompoundWMsCount = 3;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 3;
#elif DUBAJ_50
public const int WMsCount = 10;
public const int LineSize = 5;
public const int CompoundWMsCount = 0;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif FUZHOU100
public const int WMsCount = 10;
public const int LineSize = 10;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif TORINO50 || BADGER_MALA_TRAT || BERLIN
public const int WMsCount = 6;
public const int LineSize = 6;
+4 -6
View File
@@ -26,10 +26,8 @@ namespace Results.Entities
public virtual int FlowSetTime { get; set; } /// [s] Measurement time in seconds
public virtual double TestTime { get; set; } /// [s] Measurement time in seconds
public virtual double PulsesMaster { get; set; }
public virtual double ConstMasterRaw { get; set; } /// [l/pls] Liters per pulse of the master flow meter uncorrected.
public virtual double ConstMasterCorr { get; set; } /// [l/pls] Liters per pulse of the master flow meter corrected by a correction table.
public virtual double ConstMaster { get; set; } /// [l/pls] Liters per pulse of the master flow meter calculated from a mass measurement.
/// When mass measurement is not available, corrected by a correction table.
public virtual double ConstMasterRaw { get; set; } /// [l/pls] Liters per pulse of the master flow meter uncorrected
public virtual double ConstMaster { get; set; } /// [l/pls] Liters per pulse of the master flow meter
public virtual double MassStartRaw { get; set; } /// [kg]
public virtual double MassStart { get; set; } /// [kg]
public virtual double MassEndRaw { get; set; } /// [kg]
@@ -42,7 +40,7 @@ namespace Results.Entities
public virtual double FlowVolume { get; set; } /// [m3/h]
public virtual double VolumeCTV { get; set; } /// [l] Volume conventional true value
public virtual double VolumeMaster { get; set; } /// [l] Volume from the master flow meter
public virtual double ErrorMaster { get; set; } /// [%] Error of the master flow meter
public virtual double ErrorMaster { get; set; } /// [%]
public virtual float DiverterStart { get; set; } /// [s] Diverter switch time when test starts
public virtual float DivStart10 { get; set; } /// [s] Diverter switch time when test starts at level 10 (e.g. 10%) (not mapped to DB)
@@ -109,7 +107,7 @@ namespace Results.Entities
public virtual float FlowMean { get; set; } /// [m3/h] mean flow from the reference flowmeter
public virtual float FlowStart { get; set; } /// [m3/h] flow at the start of test from the reference flowmeter
public virtual float FlowEnd { get; set; } /// [m3/h] flow at the end of test from the reference flowmeter
public virtual float FlowMin { get; set; } /// [m3/h]
public virtual float FlowMin { get; set; } /// [m3/h] not mapped to DB
public virtual float FlowMax { get; set; } /// [m3/h]
public virtual float Custom1 { get; set; } /// [°C] T ref hi mean
-1
View File
@@ -251,7 +251,6 @@ namespace Results
Flow_ctv_start, /// 217
Flow_ctv_end, /// 218
ConstMasterRaw, /// 219 ConstMaster (like 194) uncorrected
Reference_error_corr, /// 220 Reference flow meter error after correction using correction curve
Count,
}
+1 -1
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
/// Copyright (c) 2015-2017 Sensus Metering Systems
///
using FluentNHibernate.Mapping;
using Results.Entities;
+2 -2
View File
@@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;FUZHOU100</DefineConstants>
<DefineConstants>TRACE;DEBUG;SENTEC</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
@@ -27,7 +27,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;FUZHOU100</DefineConstants>
<DefineConstants>TRACE;SENTEC</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
+1 -1
View File
@@ -56,7 +56,7 @@ namespace Results
{
#if PUCHONG_PT200
return (useRedGreenColor) ? (passed ? "OK|Green" : "NG|Red") : (passed ? "OK|White" : "NG|White");
#elif BAHRAIN_50 || DUBAJ_50
#elif BAHRAIN_50
return (useRedGreenColor) ? (passed ? "PASSED|Green" : "FAILED|Red") : (passed ? "PASSED|White" : "FAILED|White");
#elif LANG_PL
return (useRedGreenColor) ? (passed ? "+|Green" : "-|Red") : (passed ? "+|White" : "-|White");
-1
View File
@@ -307,7 +307,6 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Hi, Strings.ErrLimHi + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).ErrLimHi())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty, Strings.Uncertainty + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).Uncertainty())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_error, string.Format("{0} rel.ref. ()", Strings.VName_Error), Strings.Tooltip_E_rel_ref, Quantity.Error, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).ErrorMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_error_corr, string.Format("{0} ref.corr. ()", Strings.VName_Error), "Relative error of the reference flow meter after correction using correction curve", Quantity.Error, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", Config.Formulas.ErrorFromVolumes(w.GetTestRslt(t).ConstMasterCorr, w.GetTestRslt(t).ConstMaster))));
#if TURA_IPERL || TURA_SPECIAL
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, string.Format("{0} rel. ()", Strings.VName_Error), Strings.Tooltip_E_rel, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "0" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).Error)));
#else
+2 -2
View File
@@ -21,7 +21,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;FUZHOU100</DefineConstants>
<DefineConstants>TRACE;DEBUG;SENTEC</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -31,7 +31,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;FUZHOU100</DefineConstants>
<DefineConstants>TRACE;SENTEC</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
+1 -1
View File
@@ -19,7 +19,7 @@ namespace TBF.BenchControl.Elde
EnduranceCycleStop = 13,
}
#if FUZHOU300 || PT200IL || TORINO50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TURA_IPERL || TURA_SPECIAL || BADGER_VELKA_TRAT || PUCHONG_PT200 || SLM_50 || GENESIS || MALTA_WSD25 || SLM_END || WARSAW_END || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || SENTEC || FUZHOU100 || CEVAK_200 || DUBAJ_50
#if FUZHOU300 || PT200IL || TORINO50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TURA_IPERL || TURA_SPECIAL || BADGER_VELKA_TRAT || PUCHONG_PT200 || SLM_50 || GENESIS || MALTA_WSD25 || SLM_END || WARSAW_END || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || SENTEC
public enum StatusP : ulong
{
RefFlowMeterMask = 0x7, /// bits 0,1,2
+6 -5
View File
@@ -126,7 +126,7 @@ namespace TBF.BenchControl.Elde
public uint[] DiverterEdge; /// Created and initialized in this.Initialize()
// Array length is the reference flowmeters count plus one
#if DN100 || FUZHOU150 || FUZHOU300 || PT200IL || PUCHONG_PT200 || SLM_150 || SENTEC || CEVAK_200
#if DN100 || FUZHOU150 || FUZHOU300 || PT200IL || PUCHONG_PT200 || SLM_150 || SENTEC
public uint[,] RegValveCalib = new uint[8,2] {{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500}};
public byte[] MeretRS485Address = new byte[4];
public float[] EtCalib = new float[6] { 1, 1, 1, 1, 1, 1 };
@@ -137,7 +137,7 @@ namespace TBF.BenchControl.Elde
{100,500}, {100,500}, {100,500}, {100,500} };
public byte[] MeretRS485Address = new byte[4];
public float[] EtCalib = new float[7] { 1, 1, 1, 1, 1, 1, 1 };
#elif MUNICH || TORINO50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TORUN_PT50_2015 || CEVAK_PT40_272 || TURA_IPERL || TURA_SPECIAL || MURES_PT40 || FUZHOU_40 || SLM_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || FUZHOU100 || DUBAJ_50
#elif MUNICH || TORINO50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TORUN_PT50_2015 || CEVAK_PT40_272 || TURA_IPERL || TURA_SPECIAL || MURES_PT40 || FUZHOU_40 || SLM_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA
public uint[,] RegValveCalib = new uint[8,2] {{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500}};
public byte[] MeretRS485Address = new byte[4];
public float[] EtCalib = new float[5] { 1, 1, 1, 1, 1 };
@@ -280,7 +280,7 @@ namespace TBF.BenchControl.Elde
ControlComponent3Munich.UserControl1 ctrlBrdComponent,
#elif FUZHOU300
ControlComponent3F300.UserControl1 ctrlBrdComponent,
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200 || CEVAK_200
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200
ControlComponent_Izrael2014.UserControl1 ctrlBrdComponent,
#else /// all newer benches
ControlComponent_Torino2015.UserControl1 ctrlBrdComponent,
@@ -314,10 +314,11 @@ namespace TBF.BenchControl.Elde
{
int divertersCount = BenchControl.Elde.Diverter.Diverter.DivertersCount;
DiverterEdge = new uint[divertersCount];
DiverterEdge = new uint[divertersCount * 2];
for (int i = 0; i < divertersCount; i++)
{
DiverterEdge[i] = (uint)BenchControl.Elde.Diverter.Diverter.Diverters[i].ThresholdGate;
DiverterEdge[2 * i] = (uint)BenchControl.Elde.Diverter.Diverter.Diverters[i].ThresholdGate;
DiverterEdge[2 * i + 1] = (uint)BenchControl.Elde.Diverter.Diverter.Diverters[i].ThresholdGate;
controlCom.SetDivLimit(i, (uint)BenchControl.Elde.Diverter.Diverter.Diverters[i].ThresholdLo,
(uint)BenchControl.Elde.Diverter.Diverter.Diverters[i].ThresholdHi);
}
+11 -18
View File
@@ -35,7 +35,7 @@ namespace TBF.BenchControl.Elde
public int EtPulses(int wmNr1) { return (int)ctrlBrdComponent.etPulses[wmNr1]; }
#if GENESIS || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || SENTEC || FUZHOU100 || CEVAK_200 || DUBAJ_50
#if GENESIS || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || SENTEC
public int EtPulsesK { get { return (int)ctrlBrdComponent.etPulsesK; } }
#else
public int EtPulsesK { get { return 1; } }
@@ -53,7 +53,7 @@ namespace TBF.BenchControl.Elde
public UInt128 RRoute { get { return ctrlBrdComponent.rRoute; } }
#endif
#if GENESIS || KEMPNO_50 || KRAKOW_50 || BAHRAIN_50 || BADGER_STREDNA_TRAT || JUZNA_AFRIKA_50 || ZAMBIA || SENTEC || FUZHOU100 || DUBAJ_50
#if GENESIS || KEMPNO_50 || KRAKOW_50 || BAHRAIN_50 || BADGER_STREDNA_TRAT || JUZNA_AFRIKA_50 || ZAMBIA || SENTEC
public uint DivTime(int id) { return ctrlBrdComponent.divTime[id]; }
public void SetDivLimit(int divNo, uint limLoPct, uint limHiPct)
{
@@ -84,14 +84,7 @@ namespace TBF.BenchControl.Elde
//return ctrlBrdComponent.RValvePosition[rvNr1 - 1];
return ctrlBrdComponent.Analogy[rvNr1 - 1]; /// Fixes bug: RValvePosition returns 0 all the time
}
public float DivSamples(int time, int divIx0)
{
#if MUNICH
return ctrlBrdComponent.DIVSamples[time, 0];
#else
return ctrlBrdComponent.DIVSamples[time, divIx0];
#endif
} /// Time unit is 2 ms
public float DivSamples(int time, int divIx0) { return ctrlBrdComponent.DIVSamples[time, divIx0]; } /// Time unit is 2 ms
public int ScopeSamples(int i, int j, int k) { return ctrlBrdComponent.ScopeSamples[i, j, k]; }
public ulong DigitalInputs { get { return (ulong)ctrlBrdComponent.Vstupy; } }
public float AnalogInput(int adcNr0) { return ctrlBrdComponent.Analogy[adcNr0]; }
@@ -113,7 +106,7 @@ namespace TBF.BenchControl.Elde
public uint[] WMeterCont { get { return new uint[3]; } } /// Dummy
#endif
#if KEMPNO_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || FUZHOU100
#if KEMPNO_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA
public float ValveOpenCloseTime { get { return ctrlBrdComponent.ValveMoveTime[0]; } }
#else
public float ValveOpenCloseTime { get { return 0.001f; } }
@@ -149,7 +142,7 @@ namespace TBF.BenchControl.Elde
private ControlComponent3Munich.UserControl1 ctrlBrdComponent;
#elif FUZHOU300
private ControlComponent3F300.UserControl1 ctrlBrdComponent;
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200 || CEVAK_200
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200
private ControlComponent_Izrael2014.UserControl1 ctrlBrdComponent;
#else /// newer benches
private ControlComponent_Torino2015.UserControl1 ctrlBrdComponent;
@@ -165,7 +158,7 @@ namespace TBF.BenchControl.Elde
public ControlComWrap(ControlComponent3Munich.UserControl1 ctrlBrdComponent)
#elif FUZHOU300
public ControlComWrap(ControlComponent3F300.UserControl1 ctrlBrdComponent)
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200 || CEVAK_200
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200
public ControlComWrap(ControlComponent_Izrael2014.UserControl1 ctrlBrdComponent)
#else /// all newer benches
public ControlComWrap(ControlComponent_Torino2015.UserControl1 ctrlBrdComponent)
@@ -216,12 +209,12 @@ namespace TBF.BenchControl.Elde
log.FatalFormat("Component: {0}", ControlComponent3Munich.UserControl1.ProgVersion);
#elif FUZHOU300
log.FatalFormat("Component: {0}", ControlComponent3F300.UserControl1.ProgVersion);
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200 || CEVAK_200
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200
log.FatalFormat("Component: {0}", ControlComponent_Izrael2014.UserControl1.ProgVersion);
#else /// newer benches
log.FatalFormat("Component: {0}", ControlComponent_Torino2015.UserControl1.ProgVersion);
#endif
log.Fatal("SendCalibData(...)");
log.Fatal("SendCalibData(...)");
for (int i = 0; i < rvCalib.GetLength(0); i++)
for (int j = 0; j < rvCalib.GetLength(1); j++)
log.FatalFormat(" rvCalib[{0},{1}] = {2}", i, j, rvCalib[i,j]);
@@ -375,15 +368,15 @@ namespace TBF.BenchControl.Elde
#elif BADGER_MALA_TRAT || BADGER_VELKA_TRAT || FUZHOU_40 || FUZHOU150 || FUZHOU300 || PT200IL || PUCHONG_PT200 || TORINO50 || TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, (uint)totalRefPulses, (uint)testMethods,
Convert.ToSingle(filterConstants[0]), fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
#elif GENESIS || BERLIN || SLM_150 || PETERSBURG_200 || CEVAK_200
#elif GENESIS || BERLIN || SLM_150 || PETERSBURG_200
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)(route & (UInt128)0xFFFFFFFFFFFFFFFF), (ulong)(route >> 64), pulsesArr, (uint)testMethods,
Convert.ToSingle(filterConstants[0]), fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
#elif JUZNA_AFRIKA_50 || ZAMBIA || SENTEC || FUZHOU100
#elif JUZNA_AFRIKA_50 || ZAMBIA || SENTEC
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, pulsesArr, (uint)testMethods,
filterConstants, fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
#else /// if TURA_IPERL || TURA_SPECIAL || MALTA_WSD25 || SLM_50 || SLM_END || WARSAW_END || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || BADGER_STREDNA_TRAT || DUBAJ_50
#else /// if TURA_IPERL || TURA_SPECIAL || MALTA_WSD25 || SLM_50 || SLM_END || WARSAW_END || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || BADGER_STREDNA_TRAT
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, pulsesArr, (uint)testMethods,
Convert.ToSingle(filterConstants[0]), fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
+1 -5
View File
@@ -92,11 +92,7 @@ namespace TBF.BenchControl.Elde.Diverter
}
int divNrFromName;
if (!int.TryParse(Name.Substring(3), out divNrFromName))
{
divNrFromName = nextIdx;
}
int divNrFromName = int.Parse(Name.Substring(3));
#if GENESIS || PETERSBURG_50 || PETERSBURG_200 || FUZHOU_40 || FUZHOU150 || FUZHOU300
flowMtrNr4Cmd = divNrFromName + 1;
#elif BADGER_STREDNA_TRAT
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2017-2018 Sensus Slovensko a.s.
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -104,7 +104,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
this.finalReqFlowLo = requiredFlowLo;
this.finalReqFlowHi = requiredFlowHi;
this.reqFlowAve = (requiredFlowLo + requiredFlowHi) / 2;
this.reqFlowAve = (requiredFlowLo + requiredFlowHi) / 2.0f;
this.pidCoef = pidCoef;
this.measuredFlow = measuredFlow;
this.reTryCommands = reTryCmds;
@@ -193,14 +193,14 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
if (regulValve.RegulValveCfg.StoredPositionReuse && FetchTargetPosition(reqFlowAve, out targetPositionLo, out targetPositionHi))
{
log.WarnFormat("Start() rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3} FETCHED: posLo={4} posHi={5}",
log.InfoFormat("SetFlowOp:Start() rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3} FETCHED: posLo={4} posHi={5}",
regulValveNr, flowMeterNr, currentReqFlowLo, currentReqFlowHi, targetPositionLo, targetPositionHi);
opState = OpState.ValveMoveToPosition1;
}
else
{
log.WarnFormat("Start() rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3}",
log.InfoFormat("SetFlowOp:Start() rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3}",
regulValveNr, flowMeterNr, currentReqFlowLo, currentReqFlowHi);
opState = OpState.ValveMoveToFlow1;
@@ -234,7 +234,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
if (flow <= reqFlowAve) currentReqFlowHi = finalReqFlowHi;
}
log.InfoFormat("Run() rv#={0} pos={1}% freq={2} flow={3} curFlLo={4} curFlHi={5} state={6}",
log.InfoFormat("SetFlowOp:Run() rv#={0} pos={1}% freq={2} flow={3} curFlLo={4} curFlHi={5} state={6}",
regulValveNr, rvPosition.ToString("F1"), flowMtrFreq.ToString("F1"), flow.ToString("F3"), currentReqFlowLo.ToString("F3"), currentReqFlowHi.ToString("F3"), opState);
@@ -244,14 +244,14 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
if (regulValve.RegulValveCfg.StoredPositionReuse && FetchTargetPosition(reqFlowAve, out targetPositionLo, out targetPositionHi))
{
log.InfoFormat(" Run() rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3} FETCHED: posLo={4} posHi={5}",
log.InfoFormat(" Run(): rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3} FETCHED: posLo={4} posHi={5}",
regulValveNr, flowMeterNr, currentReqFlowLo.ToString("F3"), currentReqFlowHi.ToString("F3"), targetPositionLo, targetPositionHi);
opState = OpState.ValveMoveToPosition1;
}
else
{
log.InfoFormat(" Run() rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3}",
log.InfoFormat(" Run(): rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3}",
regulValveNr, flowMeterNr, currentReqFlowLo.ToString("F3"), currentReqFlowHi.ToString("F3"));
opState = OpState.ValveMoveToFlow1;
@@ -279,7 +279,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
{
/// Issues the appropriate ValveMove(...) command
controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetPosition,
new float[2] { (targetPositionLo + targetPositionHi) / 2, (targetPositionLo + targetPositionHi) / 2 },
new float[2] { targetPositionLo, targetPositionHi },
regulValve.StableTime);
opState = OpState.SettingPosition;
@@ -314,7 +314,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
new float[2] { (targetPositionLo + targetPositionHi) / 2, (targetPositionLo + targetPositionHi) / 2 },
regulValve.StableTime);
log.InfoFormat(" Run() ValveMove({0}, Position, {1}, {2}, {3})",
log.InfoFormat(" SetFlowOp: ValveMove({0}, Position, {1}, {2}, {3})",
regulValveNr, (targetPositionLo + targetPositionHi) / 2, (targetPositionLo + targetPositionHi) / 2, regulValve.StableTime);
opState = OpState.ValveMoveToPosition3;
@@ -355,15 +355,14 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
return Event.OpArgumentError;
}
log.InfoFormat(" Run(): rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3}",
regulValveNr, flowMeterNr, currentReqFlowLo.ToString("F3"), currentReqFlowHi.ToString("F3"));
float freqLo = 2000.0f * currentReqFlowLo / nominalFlow;
float freqHi = 2000.0f * currentReqFlowHi / nominalFlow;
controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetFrequency,
new float[2] { (freqLo + freqHi) / 2, (freqLo + freqHi) / 2 },
new float[2] { freqLo, freqHi },
regulValve.StableTime);
log.WarnFormat(" Run() ValveMove({0}, Freq., {1}, {2}, {3}) flowMtr#={4} TARGET: flowLo={5} flowHi={6}",
regulValveNr, (freqLo + freqHi) / 2, (freqLo + freqHi) / 2,
regulValve.StableTime,
flowMeterNr, currentReqFlowLo.ToString("F3"), currentReqFlowHi.ToString("F3"));
opState = OpState.ValveMoveToFlow3;
log.DebugFormat(" return Event.None");
@@ -390,13 +389,11 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
float freqLo = 2000.0f * currentReqFlowLo / nominalFlow;
float freqHi = 2000.0f * currentReqFlowHi / nominalFlow;
controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetFrequency,
new float[2] { (freqLo + freqHi) / 2, (freqLo + freqHi) / 2 },
new float[2] { (freqLo + freqHi) / 2.0f, (freqLo + freqHi) / 2.0f },
regulValve.StableTime);
log.WarnFormat(" Run() ValveMove({0}, Frequency, {1}, {2}, {3}) flowMtr#={4} TARGET: flowLo={5} flowHi={6}",
regulValveNr, (freqLo + freqHi) / 2, (freqLo + freqHi) / 2,
regulValve.StableTime,
flowMeterNr, currentReqFlowLo.ToString("F3"), currentReqFlowHi.ToString("F3"));
log.InfoFormat(" SetFlowOp: ValveMove({0}, Frequency, {1}, {2}, {3})",
regulValveNr, (freqLo + freqHi) / 2.0f, (freqLo + freqHi) / 2.0f, regulValve.StableTime);
opState = OpState.ValveMoveToFlow3;
log.DebugFormat(" return Event.None");
@@ -425,14 +422,14 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
{
/// update the stored valve position
StoreTargetPosition(reqFlowAve, (rvPosition + storedPosition) / 2.0f);
log.InfoFormat(" Run() rv#={0} reqFlow={1} pos={2}% stored={3} <--- Updating a stored position",
log.InfoFormat(" Run(): rv#={0} reqFlow={1} pos={2}% stored={3} <--- Updating a stored position",
regulValveNr, reqFlowAve, rvPosition.ToString("F1"), storedPosition);
}
else
{
/// store the valve position
StoreTargetPosition(reqFlowAve, rvPosition);
log.InfoFormat(" Run() rv#={0} reqFlow={1} pos={2}% <--- Storing a new position",
log.InfoFormat(" Run(): rv#={0} reqFlow={1} pos={2}% <--- Storing a new position",
regulValveNr, reqFlowAve, rvPosition.ToString("F1"));
}
}
@@ -484,8 +481,6 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
controlBoard.SendCommand(Command.Stop, flowMeterNr, controlBoard.Route,
50000, 50000, tm,
0.0f, (int)pidCoef, 0, sd);
log.WarnFormat("Stop() SendCommand(Stop, {0}, ...)", flowMeterNr);
}
}
}
+10 -19
View File
@@ -1,9 +1,8 @@
///
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using log4net;
using TBF.BenchControl.GenericDevices;
namespace TBF.BenchControl.Elde
{
@@ -14,13 +13,14 @@ namespace TBF.BenchControl.Elde
/// Set by the constructor
readonly ControlBoardDev controlBoard;
readonly IRegulValve regulValve;
readonly Elde.RegulValve.RegulValve regulValve;
readonly int regulValveNr;
readonly int regulValveStableTime;
readonly int flowMeterNr;
readonly float nominalFlow;
readonly float reqFlowLo;
readonly float reqFlowHi;
readonly float reqFlowAve;
readonly float pidCoef;
readonly int totalRefPulses; /// Number of reference pulses for a complete test
readonly int massRefPulses; /// Number of reference pulses for mass collection
@@ -79,20 +79,19 @@ namespace TBF.BenchControl.Elde
if (outputPath.FlowMeter == null) throw new ArgumentNullException("Flow meter is missing");
flowMeterNr = outputPath.FlowMeter.Idx1;
this.regulValve = outputPath.RegulValve;
if (regulValve is Elde.RegulValve.RegulValve)
if (outputPath.RegulValve is Elde.RegulValve.RegulValve)
{
Elde.RegulValve.RegulValve rv = outputPath.RegulValve as Elde.RegulValve.RegulValve;
regulValveNr = rv.Idx1;
regulValveStableTime = rv.StableTime;
}
else if (regulValve is Elde.RegulValveCoax.RegulValve)
else if (outputPath.RegulValve is Elde.RegulValveCoax.RegulValve)
{
Elde.RegulValveCoax.RegulValve rv = outputPath.RegulValve as Elde.RegulValveCoax.RegulValve;
regulValveNr = rv.Idx1;
regulValveStableTime = rv.StableTime;
}
else if (!(regulValve is Dummy.RegulValve.RegulValve))
else if (!(outputPath.RegulValve is Dummy.RegulValve.RegulValve))
{
throw new ArgumentNullException("Regulation valve is not compatible with Elde Control Board");
}
@@ -106,6 +105,7 @@ namespace TBF.BenchControl.Elde
this.reqFlowLo = requiredFlowLo;
this.reqFlowHi = requiredFlowHi;
this.reqFlowAve = (reqFlowLo + reqFlowHi) / 2.0f;
this.pidCoef = outputPath.PidCoef;
this.totalRefPulses = totalRefPulses;
@@ -189,18 +189,9 @@ namespace TBF.BenchControl.Elde
float freqLo = 2000.0f * reqFlowLo / nominalFlow;
float freqHi = 2000.0f * reqFlowHi / nominalFlow;
if (regulValve.IsCoax)
{
controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetFrequency,
new float[2] { (freqLo + freqHi) / 2, (freqLo + freqHi) / 2 },
regulValveStableTime);
}
else
{
controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetFrequency,
new float[2] { freqLo, freqHi },
regulValveStableTime);
}
controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetFrequency,
new float[2] { freqLo, freqHi },
regulValveStableTime);
opState = OpState.OpCompleted;
return Event.None;
@@ -31,9 +31,9 @@ namespace TBF.BenchControl.Modbus.CometAmbient
///
/// Measured values when MsrmntState == MsrmntState.Valid
///
float temperature; /// [°C]
float temperature; /// [deg C]
float pressure; /// [bar]
float humidity; /// [R%]
float humidity; /// [%]
/// <summary>Measurement time stamp when MsrmntState == MsrmntState.Valid</summary>
int msrmntTimeStamp;
+2 -1
View File
@@ -578,6 +578,7 @@ namespace TBF.BenchControl.Sequences
State.Create("SequenceBase.Transition() : Test stopped -> Stopping the pump")
.AddOperation(checkUiOp)
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
.AddOperation((inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOffOp() : null)
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, inPath.Pump))
.EnterState();
do
@@ -585,7 +586,7 @@ namespace TBF.BenchControl.Sequences
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) return Event.Error;
}
while (!e.Contains(Event.ValvesSet));
while (!e.Contains(Event.ValvesSet) || ((inPath.Pump is GenericDevices.IPumpFM) && !e.Contains(Event.TurnPumpOnOffDone)));
}
}
else if (context == TransitionContext.BeforeTest)
+8 -18
View File
@@ -164,41 +164,31 @@ namespace TBF.BenchControl.Sequences
/// <returns>true when 'fileterdValue' is valid</returns>
bool ApplyFilter(double value, out double filteredValue)
{
if (FilterSize == 0)
{
/// No filter => Pass the input value to the output
filteredValue = value;
return true;
}
filteredValue = value;
if (FilterSize == 0) return true; /// no filter -> input value is passed to output
/// Shift values in FIFO buffer, calculate the sum
/// Shift values in FIFO buffer, put the new value into fifo[0]
double sum = 0;
for (int i = FilterSize - 1; i > 0; i--)
{
fifo[i] = fifo[i - 1];
sorted[i] = fifo[i] = fifo[i - 1];
sum += fifo[i];
}
/// Insert the current value into FIFO, add it to the sum
fifo[0] = value;
sorted[0] = fifo[0] = value;
sum += value;
fifoCount++;
if (fifoCount < FilterSize)
{
/// FIFO not filled yet => Pass the input value to the output
filteredValue = value;
return false;
return false;
}
else
{
/// FIFO already filled => Apply filter
if (MedianFilter)
if (MedianFilter)
{
for (int i = 0; i < FilterSize; i++) sorted[i] = fifo[i];
Array.Sort(sorted);
#if false
filteredValue = sorted[FilterSize / 2];
+2 -5
View File
@@ -194,7 +194,7 @@ namespace TBF.BenchControl
public static void InitializeBoardEtc(ControlComponent3Munich.UserControl1 ctrlBrdComponent)
#elif FUZHOU300
public static void InitializeBoardEtc(ControlComponent3F300.UserControl1 ctrlBrdComponent)
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200 || CEVAK_200
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200
public static void InitializeBoardEtc(ControlComponent_Izrael2014.UserControl1 ctrlBrdComponent)
#else /// all newer benches
public static void InitializeBoardEtc(ControlComponent_Torino2015.UserControl1 ctrlBrdComponent)
@@ -226,10 +226,7 @@ namespace TBF.BenchControl
{
SequenceBase.RegulValves.Add(cmpnt as IRegulValve);
}
if (cmpnt is IPumpFM && !(cmpnt is Elde.PumpTandem.Pump))
{
SequenceBase.PumpsWithFM.Add(cmpnt as IPumpFM);
}
if (cmpnt is IPumpFM) SequenceBase.PumpsWithFM.Add(cmpnt as IPumpFM);
if (cmpnt is IWaterMeter) SequenceBase.WaterMeters.Add(cmpnt as IWaterMeter);
if (cmpnt is ICamera) SequenceBase.Cameras.Add(cmpnt as ICamera);
if (cmpnt is GenericDevices.IAmbient) Ambient = cmpnt as GenericDevices.IAmbient;
+1 -5
View File
@@ -74,7 +74,6 @@ namespace TBF.BenchControl
Factories.Add(new TestMethods.OuterLoop.Start.Factory());
Factories.Add(new TestMethods.OuterLoop.End.Factory());
Factories.Add(new TestMethods.PMaxTest.TestMethodFactory());
Factories.Add(new TestMethods.PulsesTest.Factory());
Factories.Add(new TestMethods.SensitivityTest.TestMethodFactory());
Factories.Add(new TestMethods.iPerlCommunication.TestMethodFactory()); /// iPerlCommunication
Factories.Add(new TestMethods.RoiDetection.RoiDetectionFactory());
@@ -171,10 +170,7 @@ namespace TBF.BenchControl
public static IComponentCfg CmpntCfgFromCmpntEntity(Component entity)
{
IComponentFactory cmpntFactory = CmpntFactoryFromClassName(entity.ClassName);
if (cmpntFactory == null) return null;
try { return cmpntFactory.CmpntCfgFromCmpntEntity(entity); }
catch { return null; }
return (cmpntFactory != null) ? cmpntFactory.CmpntCfgFromCmpntEntity(entity) : null;
}
@@ -380,12 +380,11 @@ namespace TBF.BenchControl.TestMethods.Adjustment
tstRslt.FlowMass = 0; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * cBrd.EtPulses(0) / tstRslt.TestTime; /// [m3/h]
tstRslt.Buoyancy = Config.Formulas.Buoyancy();
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = tstRslt.ConstMasterCorr; /// Corrected master pulses per liter
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0.0f; /// Cannot be determined without the collected water mass measurement
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMaster = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Calculate master flowmeter coefficient
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0.0f; /// Cannot be determined without the collected water mass measurement
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.IO;
@@ -21,8 +21,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
public float RelativeQto; /// Tested flow high range related to the detected flow
public float RateOfChange; /// Each step is calculated as (TargetQfrom - Qfrom) * RateOfChange, text form is displayed in % (*100)
public float DetectionThreshold; /// Drop of frequency for the detection, text form is displayed in % (*100)
public float OffsetPulsesFreq; /// Offset frequency of pulses of the small WM for the detection in Hz
public bool SupressTrills; /// Main meter readings are ignored during test (suitable for small flows)
public bool SupressTrills; /// Main meter readings are ignored during test (suitable for small flows)
public override void InitializeAll()
{
@@ -31,7 +30,6 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
RelativeQto = -0.2f;
RateOfChange = 0.05f;
DetectionThreshold = 0.25f;
OffsetPulsesFreq = 1.0f;
SupressTrills = false;
}
@@ -43,7 +41,6 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
Strings.RelativeQto,
Strings.RateOfChangePct,
Strings.DetectionThresholdPct,
"Offset pulses freq.",
Strings.SupressWMTrills,
};
public override string ParamName(int i) { return paramNames[i]; }
@@ -58,8 +55,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
case 2: return RelativeQto.ToString();
case 3: return (100.0f * RateOfChange).ToString();
case 4: return (100.0f * DetectionThreshold).ToString();
case 5: return OffsetPulsesFreq.ToString();
case 6: return (SupressTrills ? Strings.yes : Strings.no);
case 5: return (SupressTrills ? Strings.yes : Strings.no);
default: return string.Empty;
}
}
@@ -68,14 +64,13 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
{
switch (i)
{
case 0: TargetQ = Utils.ParseUFloat(strValue); return CfgUpdateFlags.None;
case 1: RelativeQfrom = Utils.ParseSFloat(strValue); return CfgUpdateFlags.None;
case 2: RelativeQto = Utils.ParseSFloat(strValue); return CfgUpdateFlags.None;
case 3: RateOfChange = Utils.ParseUFloat(strValue) / 100.0f; return CfgUpdateFlags.None;
case 4: DetectionThreshold = Utils.ParseUFloat(strValue) / 100.0f; return CfgUpdateFlags.None;
case 5: OffsetPulsesFreq = Utils.ParseUFloat(strValue); return CfgUpdateFlags.None;
case 6: SupressTrills = strValue.Equals(Strings.yes); return CfgUpdateFlags.None;
default: return CfgUpdateFlags.None;
case 0: TargetQ = Utils.ParseUFloat(strValue); return CfgUpdateFlags.None;
case 1: RelativeQfrom = Utils.ParseSFloat(strValue); return CfgUpdateFlags.None;
case 2: RelativeQto = Utils.ParseSFloat(strValue); return CfgUpdateFlags.None;
case 3: RateOfChange = Utils.ParseUFloat(strValue) / 100.0f; return CfgUpdateFlags.None;
case 4: DetectionThreshold = Utils.ParseUFloat(strValue) / 100.0f; return CfgUpdateFlags.None;
case 5: SupressTrills = strValue.Equals(Strings.yes); return CfgUpdateFlags.None;
default: return CfgUpdateFlags.None;
}
}
@@ -89,14 +84,13 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
case 0:
case 3:
case 4:
case 5:
if (Utils.TryParseUFloat(strValue, out dummy)) return true;
if (Utils.TryParseUFloat(strValue, out dummy)) return true;
break;
case 1:
case 2:
if (Utils.TryParseSFloat(strValue, out dummy)) return true;
break;
case 6:
case 5:
if (strValue.Equals(Strings.yes) || strValue.Equals(Strings.no)) return true;
break;
default:
@@ -115,8 +109,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
prms.RelativeQto = this.RelativeQto;
prms.RateOfChange = this.RateOfChange;
prms.DetectionThreshold = this.DetectionThreshold;
prms.OffsetPulsesFreq = this.OffsetPulsesFreq;
prms.SupressTrills = this.SupressTrills;
prms.SupressTrills = this.SupressTrills;
}
public IParamsProvider Clone()
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -31,9 +31,9 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
if (test.Part < 1 || test.Part > Config.Data.CompoundWMsCount)
{
UiBridge.Bridge.OnError(this, string.Format("Test 'Part' should be 1 .. {0}", Config.Data.CompoundWMsCount));
IList<Event> retv = new List<Event>(1);
retv.Add(Event.ConfigurationError);
return retv;
IList<Event> retval = new List<Event>(1);
retval.Add(Event.ConfigurationError);
return retval;
}
if (debugLevel == Config.Entities.DebugMode.Simulate)
@@ -73,14 +73,17 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
Bridge.OnActivity(this, string.Format("Simulating {0}", test.Name));
//------------------------------------------------
State.Create(string.Format("{0}({1}) : Simulating {1}", test.Method, test.Name))
State.Create(string.Format("CombinedWithDetection : Simulating {0}", test.Name))
.AddOperation(checkUiOp)
.EnterState();
e = StateMachine.WaitRunDevsRunOps();
Event retVal = Event.Done;
if (TestAndLogUiCmdStop(test, e)) retVal = Event.UiCmdStop;
/// Create a list with one item 'retVal' (default is Event.Done) and return it
IList<Event> retListSim = new List<Event>(1);
retListSim.Add(TestAndLogUiCmdStop(test, e) ? Event.UiCmdStop : Event.Done);
retListSim.Add(retVal);
return retListSim;
}
@@ -91,7 +94,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
int[] lastWMPulses = new int[2 * Config.Data.CompoundWMsCount];
//--------------------------------
State.Create(string.Format("{0}({1}) : Stop diverter gate etc", test.Method, test.Name))
State.Create("CombinedWithDetection : stopTest diverter gate etc")
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
@@ -109,31 +112,10 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter)
{
Elde.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Elde.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
goto stopTest;
}
}
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
/// Meters path is required for the following:
readRegistersOp = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders);
@@ -151,7 +133,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
if (!test.DoDraining) /// Do not skip emptying if test.Emptying==true
{
//--------------------------------
State.Create(string.Format("{0}({1}) : Mesuring mass of water in the tank", test.Method, test.Name))
State.Create("CombinedWithDetection : Mesuring mass of water in the tank")
.AddOperation(checkUiOp)
.AddOperation(outPath.Scale.ReadMassOp(ref Mass))
.EnterState();
@@ -170,7 +152,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
}
}
/// Empty the water tank
// Empty the water tank
switch (DrainTheTank(outPath.Scale.DrainValve, outPath.Scale))
{
case Event.Error: goto error;
@@ -218,10 +200,11 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
foreach (var camera in cameras) measureOperations.Add(camera.MeasurementOp());
//------------------------------------------------
Bridge.OnActivity(this, Strings.Switching_flow_detection);
//------------------------------------------------
State.Create(string.Format("{0}({1}) : Start the pump", test.Method, test.Name))
State.Create("CombinedWithDetection : Start the pump")
.AddOperation(checkUiOp)
.AddOperations(measureOperations)
.AddOperation((inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOnOp(test.PumpPower) : null)
@@ -236,8 +219,8 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
}
while (!e.Contains(Event.ValvesSet));
State.Create(string.Format("{0}({1}) : Set the initial flow", test.Method, test.Name))
//--------------------------------
State.Create("CombinedWithDetection : Set the initial flow")
.AddOperation(checkUiOp)
.AddOperations(measureOperations)
.AddOperation(outPath.RegulValve.SetFlowAndMeasureOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 600, (float)test.TolerRed)) /// timeout = 10 min.
@@ -251,28 +234,24 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
if (e.Contains(Event.RegulValveTimeOut))
{
Bridge.OnError(this, Strings.Flow_adjustment_failed);
goto stopTest;
goto error;
}
if (e.Contains(Event.Next)) goto init_flow_set;
}
}
while (!e.Contains(Event.FlowReached));
//--------------------------------
switch (ReadRegistersTempPressAmbient(measureOperations, false))
{
case Event.Error: goto error;
case Event.UiCmdStop: goto stopTest;
}
init_flow_set:
//====================================
// Find the switching flow
//====================================
//====================================
// Find the switching flow
//====================================
/// Allocate detection buffers
double[] flowsForDetection = new double[DetectionBufferSize]; /// in [m3/h]
double[] flowsForDetection = new double[DetectionBufferSize];
double[] pulseFreqsForDetection = new double[DetectionBufferSize];
/// Current values
@@ -282,9 +261,9 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
int lastTime = StateMachine.Time;
/// Detection parameters
float rvPulse = (testParams.TargetQ > (test.Qfrom + test.Qto) / 2.0f) ? 0.05f : -0.05f; /// rise(+) or fall(-)
float rvPulse = (testParams.TargetQ > (test.Qfrom + test.Qto) / 2.0f) ? 0.05f : -0.05f; // rise or fall?
rvPulse *= (100.0f * testParams.RateOfChange);
bool detected = false;
bool targetReached = false;
double detectedFlow = 0;
@@ -293,124 +272,109 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.SwitchingFlowDetection));
do
{
State.Create(string.Format("{0}({1}) : Change the RV position", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(measureOperations)
.AddOperation(outPath.RegulValve.ChangeRegulValvePositionOp(rvPulse))
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.SwitchingFlowDetection));
{
//--------------------------------
State.Create("CombinedWithDetection : Change the RV position")
.AddOperation(checkUiOp)
.AddOperations(measureOperations)
.AddOperation(outPath.RegulValve.ChangeRegulValvePositionOp(rvPulse))
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.SwitchingFlowDetection));
if (TestAndLogUiCmdStop(test, e)) goto stopTest;
}
if (TestAndLogUiCmdStop(test,e)) goto stopTest;
}
while (!e.Contains(Event.PositionReached));
// Last pulses are kept to calculate differences
for (int i = 0; i < 2 * Config.Data.CompoundWMsCount; i++) lastWMPulses[i] = RegisterReaders[i].WMPulses;
// Shift data in the detection buffers
for (int i = DetectionBufferSize - 2; i >= 0; i--)
{
///
/// Update FIFO buffers for the reference flow and the frequency of pulses
///
/// Last pulses are kept to calculate differences
for (int i = 0; i < 2 * Config.Data.CompoundWMsCount; i++) lastWMPulses[i] = RegisterReaders[i].WMPulses;
/// Shift data in the detection buffers
for (int i = DetectionBufferSize - 2; i >= 0; i--)
{
flowsForDetection[i + 1] = flowsForDetection[i];
pulseFreqsForDetection[i + 1] = pulseFreqsForDetection[i];
}
switch (ReadRegistersTempPressAmbient(measureOperations, false))
{
case Event.Error: goto error;
case Event.UiCmdStop: goto stopTest;
}
int diff = RegisterReaders[(test.Part - 1) * 2 + 1].WMPulses - lastWMPulses[(test.Part - 1) * 2 + 1];
flowsForDetection[0] = cBrd.ReferenceFreq * outPath.FlowMeter.NominalFlow / 2000.0;
pulseFreqsForDetection[0] = (double)diff / (double)(StateMachine.Time - lastTime);
lastTime = StateMachine.Time;
flowsForDetection[i+1] = flowsForDetection[i];
pulseFreqsForDetection[i+1] = pulseFreqsForDetection[i];
}
if ((StateMachine.Time - detectionStartTime > 15) && (flowsForDetection[0] > 0) && (flowsForDetection[DetectionBufferSize - 1] > 0))
{
///
/// Evaluate ref. flow and WM pulses frequency data in FIFO buffers.
/// Updpate 'detected' and 'targetReached' flags.
///
double[] flowBefore = new double[DetectionKernelSize];
double[] flowAfter = new double[DetectionKernelSize];
double[] freqBefore = new double[DetectionKernelSize];
double[] freqAfter = new double[DetectionKernelSize];
for (int i = 0; i < DetectionKernelSize; i++)
{
flowBefore[i] = flowsForDetection[DetectionBufferSize - DetectionKernelSize + i]; /// The oldest DetectionKernelSize samples
freqBefore[i] = pulseFreqsForDetection[DetectionBufferSize - DetectionKernelSize + i];
switch (ReadRegistersTempPressAmbient(measureOperations, false))
{
case Event.Error: goto error;
case Event.UiCmdStop: goto stopTest;
}
flowAfter[i] = flowsForDetection[i]; /// The newest DetectionKernelSize samples
freqAfter[i] = pulseFreqsForDetection[i];
}
int time = StateMachine.Time;
int diff = RegisterReaders[(test.Part - 1) * 2 + 1].WMPulses - lastWMPulses[(test.Part - 1) * 2 + 1];
flowsForDetection[0] = cBrd.ReferenceFreq * outPath.FlowMeter.NominalFlow / 2000.0f;
pulseFreqsForDetection[0] = (float)diff / (float)(time - lastTime);
lastTime = StateMachine.Time;
/// Skip the smallest and the largest flow
Array.Sort(flowBefore);
Array.Sort(flowAfter);
flowBefore[0] = 0;
flowAfter[0] = 0;
flowBefore[DetectionKernelSize - 1] = 0;
flowAfter[DetectionKernelSize - 1] = 0;
///
double aveFlowBefore = 0;
double aveFlowAfter = 0;
foreach (var f in flowBefore) aveFlowBefore += f;
foreach (var f in flowAfter) aveFlowAfter += f;
aveFlowBefore /= (double)(DetectionKernelSize - 2);
aveFlowAfter /= (double)(DetectionKernelSize - 2);
if (StateMachine.Time - detectionStartTime > 15)
{
if ((flowsForDetection[0] > 0) && (flowsForDetection[DetectionBufferSize - 1] > 0))
{
double[] flowBefore = new double[DetectionKernelSize];
double[] flowAfter = new double[DetectionKernelSize];
double[] freqBefore = new double[DetectionKernelSize];
double[] freqAfter = new double[DetectionKernelSize];
for (int i = 0; i < DetectionKernelSize; i++)
{
flowBefore[i] = flowsForDetection[DetectionBufferSize - DetectionKernelSize + i];
freqBefore[i] = pulseFreqsForDetection[DetectionBufferSize - DetectionKernelSize + i];
flowAfter[i] = flowsForDetection[i];
freqAfter[i] = pulseFreqsForDetection[i];
}
Array.Sort(flowBefore);
Array.Sort(flowAfter);
Array.Sort(freqBefore);
Array.Sort(freqAfter);
flowBefore[0] = 0;
flowAfter[0] = 0;
//freqBefore[0] = 0;
//freqAfter[0] = 0;
flowBefore[DetectionKernelSize - 1] = 0;
flowAfter[DetectionKernelSize - 1] = 0;
//freqBefore[DetectionKernelSize - 1] = 0;
//freqAfter[DetectionKernelSize - 1] = 0;
double aveFlowBefore = 0;
double aveFlowAfter = 0;
double aveFreqBefore = 0;
double aveFreqAfter = 0;
foreach (var f in flowBefore) aveFlowBefore += f;
foreach (var f in flowAfter) aveFlowAfter += f;
foreach (var f in freqBefore) aveFreqBefore += f;
foreach (var f in freqAfter) aveFreqAfter += f;
aveFlowBefore /= (double)(DetectionKernelSize - 2);
aveFlowAfter /= (double)(DetectionKernelSize - 2);
aveFreqBefore /= (double)(DetectionKernelSize);
aveFreqAfter /= (double)(DetectionKernelSize);
/// Do NOT skip the smallest and the largest flow
//Array.Sort(freqBefore);
//Array.Sort(freqAfter);
//freqBefore[0] = 0;
//freqAfter[0] = 0;
//freqBefore[DetectionKernelSize - 1] = 0;
//freqAfter[DetectionKernelSize - 1] = 0;
///
double aveFreqBefore = 0;
double aveFreqAfter = 0;
foreach (var f in freqBefore) aveFreqBefore += f;
foreach (var f in freqAfter) aveFreqAfter += f;
aveFreqBefore /= (double)DetectionKernelSize;
aveFreqAfter /= (double)DetectionKernelSize;
UiBridge.Bridge.OnLog(this, string.Format("time={0}, flow{1}, aveFlowB={2}, aveFlowA={3}, pulseFreq={4}, aveFreqB={5}, aveFreqA={6}\r\n",
time - startTime,
flowsForDetection[0].ToString("F2"),
aveFlowBefore.ToString("F2"),
aveFlowAfter.ToString("F2"),
pulseFreqsForDetection[0].ToString("F2"),
aveFreqBefore.ToString("F2"),
aveFreqAfter.ToString("F2")));
UiBridge.Bridge.OnLog(this, string.Format("time={0}, flow{1}, aveFlowB={2}, aveFlowA={3}, pulseFreq={4}, aveFreqB={5}, aveFreqA={6}\r\n",
StateMachine.Time - startTime,
flowsForDetection[0].ToString("F2"),
aveFlowBefore.ToString("F2"),
aveFlowAfter.ToString("F2"),
pulseFreqsForDetection[0].ToString("F2"),
aveFreqBefore.ToString("F2"),
aveFreqAfter.ToString("F2")));
//detectedFlow = (aveFlowBefore + aveFlowAfter) / 2.0f;
detectedFlow = aveFlowBefore;
//detectedFlow = (aveFlowBefore + aveFlowAfter) / 2.0f;
detectedFlow = aveFlowBefore;
if (rvPulse > 0)
{
/// rise
detected = (aveFreqAfter < aveFreqBefore * (1.0f - testParams.DetectionThreshold));
targetReached = ((aveFlowAfter + aveFlowBefore) / 2.0f) > testParams.TargetQ;
}
else
{
/// fall
detected = (aveFreqAfter > (aveFreqBefore + testParams.OffsetPulsesFreq) * (1.0f + testParams.DetectionThreshold));
targetReached = ((aveFlowAfter + aveFlowBefore) / 2.0f) < testParams.TargetQ;
}
}
}
if (rvPulse > 0)
{
detected = (aveFreqAfter < aveFreqBefore * (1.0f - testParams.DetectionThreshold));
targetReached = ((aveFlowAfter + aveFlowBefore) / 2.0f) > testParams.TargetQ;
}
else
{
detected = (aveFreqAfter > aveFreqBefore * (1.0f + testParams.DetectionThreshold));
targetReached = ((aveFlowAfter + aveFlowBefore) / 2.0f) < testParams.TargetQ;
}
}
}
}
while (!detected && !targetReached);
if (rvPulse > 0)
@@ -442,7 +406,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
if (goBackToInitFlow)
{
//--------------------------------
State.Create(string.Format("{0}({1}) : Switching flow detected, going back", test.Method, test.Name))
State.Create("CombinedWithDetection : Switching flow detected, going back")
.AddOperation(checkUiOp)
.AddOperations(measureOperations)
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 600)) /// timeout = 10 min.
@@ -457,14 +421,14 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
if (e.Contains(Event.RegulValveTimeOut))
{
Bridge.OnError(this, Strings.Flow_adjustment_failed);
goto stopTest;
goto error;
}
}
while (!e.Contains(Event.FlowReached));
}
//--------------------------------
State.Create(string.Format("{0}({1}) : Going to the test flow", test.Method, test.Name))
State.Create("CombinedWithDetection : Going to the test flow")
//State.Create("set_RV_position",
.AddOperation(checkUiOp)
.AddOperations(measureOperations)
@@ -656,10 +620,8 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
tstRslt.VolumeCTV = 1000.0 * tstRslt.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart) / density; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
@@ -767,7 +729,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
if (isLastRepetition)
{
/// Stop the pump
State.Create(string.Format("{0}({1}) : Test(s) completed -> Stopping the pump", test.Method, test.Name))
State.Create("CombinedWithDetection : Test(s) completed -> Stopping the pump")
.AddOperation(checkUiOp)
.AddOperation(cBrd.SetValvesOp(null, inPath.Pump))
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOffOp() : null)
@@ -788,7 +750,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
//====================================
stopTest:
State.Create(string.Format("{0}({1}) : User selected STOP -> Closing the valves", test.Method, test.Name))
State.Create("CombinedWithDetection : User selected STOP -> Closing the valves")
.AddOperation(checkUiOp)
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOffOp() : null)
.AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose))
@@ -361,15 +361,14 @@ namespace TBF.BenchControl.TestMethods.Endurance
tstRslt.MassStart = 0;
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.FlowMass = 0; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.FlowMass = 0; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.Buoyancy = Config.Formulas.Buoyancy();
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = tstRslt.ConstMasterCorr; /// Corrected master pulses per liter
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMaster = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0.0; /// Cannot be determined without a mass measurement
tstRslt.ErrorMaster = 0.0; /// Cannot be determined without a mass measurement
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
@@ -754,8 +754,8 @@ namespace TBF.BenchControl.TestMethods.FixedStart
double flowVolume = 3.6 * LtrPerRefPulse * Convert.ToDouble(endPulses - startPulses) / cBrd.TTime;
double constMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowVolume, rangeIx);
double volumeCTV = constMasterCorr * Convert.ToDouble(endPulses - startPulses);
double constMaster = outPath.FlowMeter.LtrPerPulseCorrected(flowVolume, rangeIx);
double volumeCTV = constMaster * Convert.ToDouble(endPulses - startPulses);
double refEnergy = Energy.Sum * volumeCTV / VolumeForEnergy.Sum; /// [J]=[J]*[l]/[l]
@@ -907,9 +907,8 @@ namespace TBF.BenchControl.TestMethods.FixedStart
tstRslt.FlowVolume = flowVolume; /// [m3/h]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.Buoyancy = Config.Formulas.Buoyancy();
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = constMasterCorr; /// Corrected master pulses per liter
tstRslt.ConstMaster = constMasterCorr; /// Corrected master pulses per liter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMaster = constMaster; /// Corrected master pulses per liter
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0;
@@ -45,28 +45,6 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter)
{
Elde.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Elde.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
retVal = Event.UiCmdStop;
goto stopTest;
}
}
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
//====================================
@@ -536,13 +514,11 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime;
tstRslt.Buoyancy = buoyancy;
tstRslt.VolumeCTV = volumeCTV; /// [kg] calculated before displaying 'End state' dialog
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.VolumeCTV = volumeCTV; /// [kg] calculated before displaying 'End state' dialog
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
@@ -68,28 +68,6 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter)
{
Elde.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Elde.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
retVal = Event.UiCmdStop;
goto stopTestWOTransitionAfter;
}
}
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, heatMetersTestParams != null);
@@ -967,12 +945,10 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.Buoyancy = buoyancy;
tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
@@ -47,28 +47,6 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter)
{
Elde.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Elde.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
retVal = Event.UiCmdStop;
goto stopTestWOTransitionAfter;
}
}
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, heatMetersTestParams != null);
@@ -995,12 +973,10 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.Buoyancy = buoyancy;
tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
@@ -530,10 +530,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
tstRslt.FlowMass = 0; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.Buoyancy = Config.Formulas.Buoyancy();
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = tstRslt.ConstMasterCorr;
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMaster = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0.0; /// Cannot be determined without a mass measurement
@@ -113,28 +113,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
goto stopTestWOStoppingDivGateEtc;
}
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter)
{
Elde.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Elde.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
retVal = Event.UiCmdStop;
goto stopTestWOStoppingDivGateEtc;
}
}
//====================================
loop:
@@ -816,10 +794,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
tstRslt.VolumeCTV = 1000.0 * tstRslt.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart) / density; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.DiverterStart = switchTimeStart.Val;
tstRslt.DivStart10 = 0;
@@ -845,8 +821,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.FlowMass = 0;
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMaster = tstResRepet1.ConstMaster; /// Master constant ( pulses per liter) from the first repetition (=against the scale)
tstRslt.VolumeMaster = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.VolumeCTV = tstRslt.VolumeMaster; /// [l] 1000.0f is because density is in [kg/m3]
@@ -125,28 +125,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
int targetTotalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int targetMassPulses = (int)(volumeToTank / LtrPerRefPulse + 0.5f);
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter)
{
Elde.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Elde.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
retVal = Event.UiCmdStop;
goto stopTestWOStoppingDivGateEtc;
}
}
//====================================
loop:
/// Start the test, initialize test results
@@ -814,10 +792,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
tstRslt.Buoyancy = Formulas.Buoyancy();
double density = Formulas.WaterDensityFromTemp((tstRslt.TempUpMean + tstRslt.TempDownMean) / 2.0, Program.LocalSettings.RealDensity, Program.LocalSettings.AtTemperature);
double collectedVoluemCTV = 1000.0 * tstRslt.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart) / density; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (massPulses == 0) ? tstRslt.ConstMasterCorr : (collectedVoluemCTV / massPulses);
/// Calculated master pulses per liter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMaster = collectedVoluemCTV / massPulses; /// Corrected master pulses per liter
tstRslt.VolumeCTV = tstRslt.ConstMaster * totalPulses;
tstRslt.VolumeMaster = LtrPerRefPulse * totalPulses; /// [l] volume from the master flow meter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
@@ -168,28 +168,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse;
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter)
{
Elde.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Elde.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
retVal = Event.UiCmdStop;
goto stopTestWOStoppingDivGateEtc;
}
}
if (test.Volume > outPath.Scale.Capacity * Constants.TankFullFactor)
{
Bridge.OnError(this, Strings.Test_volume_exceeds_the_scale_capacity);
@@ -863,9 +841,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
tstRslt.VolumeCTV = 1000.0 * tstRslt.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart) / density; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;
@@ -1,30 +0,0 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Configs.NameOnly;
namespace TBF.BenchControl.TestMethods.PulsesTest
{
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public void ResetStaticProperties() { TestMethod.ResetStaticProperties(); }
public IComponent DummyComponent() { return new TestMethod(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new TestMethod(cfg); }
public IComponentCfg DefaultConfig()
{
return new TestMethodCfg(this.GetType().Namespace.Substring(29), this);
}
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(TestMethodCfg.Serializer, component, this);
}
}
}
@@ -1,498 +0,0 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Text;
using log4net;
using Config.Entities;
using TBF.BenchControl;
using TBF.Boxes;
using TBF.Resources;
using TBF.UiBridge;
namespace TBF.BenchControl.TestMethods.PulsesTest
{
public class PulseOutputsTestSeq : Sequences.SequenceBase
{
private static readonly ILog log = LogManager.GetLogger(typeof(PulseOutputsTestSeq));
const double PulsesLimitLo = 5;
System.Windows.Forms.Form modelessDlg;
///
delegate void ErrorsFormDlgt(PulseOutputsTestSeq myRef, IList<GenericDevices.IWaterMeter> waterMeters);
///
void OpenWMErrorsForm(PulseOutputsTestSeq myRef, IList<GenericDevices.IWaterMeter> waterMeters)
{
#pragma warning disable 162 /// Disables 'Unreachable code detected' warning
if (Config.Data.WMsCount > 12)
{
myRef.modelessDlg = new WMPulsesForm24(waterMeters);
}
else if (Config.Data.WMsCount > 6)
{
myRef.modelessDlg = new WMPulsesForm12(waterMeters);
}
else
{
myRef.modelessDlg = new WMPulsesForm(waterMeters);
}
#pragma warning restore 162 /// Disables 'Unreachable code detected' warning
modelessDlg.Show();
}
/// <summary>
/// Adjustment method sequence
/// </summary>
/// <param name="test">Test entity</param>
/// <returns>
/// Event.Done . . . . . . . OK
/// Event.UiCmdStop . . . . Stopped by the user using the on-screen button STOP
/// Event.OpArgumentError . Target flow is out of range
/// Event.Error . . . . . . Unspecified error
/// </returns>
public IList<Event> Execute(Test test, int repetitionNr, bool isLastRepetition, DebugMode mode)
{
float simulatedError = 4.5f; /// %
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
IList<Event> e = new List<Event>(); /// Events from currently running operations
Event retVal = Event.Done;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
/// Notes:
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter)
{
Elde.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Elde.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
retVal = Event.UiCmdStop;
goto stopTestWOStoppingDivGateEtc;
}
}
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
/// Start the test, initialize test results
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
TestStartTime = DateTime.Now;
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
int flowSetTime0 = StateMachine.Time;
//------------------------------------------------
Bridge.OnActivity(this, Strings.Starting_the_pump);
//------------------------------------------------
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
///
State.Create("Adjustment : Starting the pump")
.AddOperation(checkUiOp)
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
// .AddOperation(new Operations.SetAllRegulValvesOp(inPath.RegulValves, inPath.RegulValvesPct, 60))
.AddOperation(inPath.Pump != null ? cBrd.SetValvesOp(inPath.Pump, null) : null)
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
}
while (e.Contains(Event.ValvesBusy) /* || !e.Contains(Event.AllPositionsReached)*/);
if (test.TimePump2StartV > 0)
{
State.Create(string.Format("{0}({1}) : Waiting after the pump started", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(new Operations.TimerOp(test.TimePump2StartV))
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.TimerExpired));
}
if (benchPath.StopBFValve != null)
{
State.Create(string.Format("{0}({1}) : Opening the stop backflow valve", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(StateMachine.ControlBoard.SetValvesOp(benchPath.StopBFValve, null))
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
}
while (!e.Contains(Event.ValvesSet));
}
if (test.TimeBeforeFlow > 0)
{
State.Create(string.Format("{0}({1}) : Waiting before flow setting process starts", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(new Operations.TimerOp(test.TimeBeforeFlow))
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.TimerExpired));
}
setting_flow:
//------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_the_flow);
//------------------------------------------------
State.Create("Adjustment : Setting the flow")
.AddOperation(checkUiOp)
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 600)) /// timeout = 10 min.
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (e.Contains(Event.RegulValveTimeOut))
{
Bridge.OnError(this, Strings.Flow_adjustment_failed);
retVal = Event.UiCmdStop;
goto stopTest;
}
if (e.Contains(Event.Next)) goto flow_set;
}
while (!e.Contains(Event.FlowReached));
flow_set:
int flowSetTime = StateMachine.Time - flowSetTime0;
if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);
//---------------------------------------------------
State.Create(string.Format("{0}({1}) : Wait until the water temperature is within limits", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(benchPath.TempMtrUp.ReadTempOp(ref TempUp))
.AddOperation(benchPath.TempMtrDown.ReadTempOp(ref TempDown))
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (e.Contains(Event.Next)) goto temperature_set;
if (TempUp.Val >= test.TempLimLo && TempUp.Val <= test.TempLimHi &&
TempDown.Val >= test.TempLimLo && TempDown.Val <= test.TempLimHi)
{
goto temperature_set;
}
}
while (true);
}
temperature_set:
/// Show the modeless dialog with error indication
Program.MainWnd.Invoke(new ErrorsFormDlgt(OpenWMErrorsForm), new object[] { this, WaterMeters });
loop:
int time = StateMachine.Time;
double currentFlow = RefFlow.Val;
///
/// Prepare cameras, ROI-s and measurementOperations
///
/// Find ROI-s
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
foreach (var rr in sensPath.RegisterReaders)
{
GenericDevices.IRoi roi = rr as GenericDevices.IRoi;
if (roi != null && roi.Detected)
{
rois.Add(roi);
}
}
/// Find cameras
IList<GenericDevices.ICamera> cameras = new List<GenericDevices.ICamera>();
foreach (var roi in rois)
{
if (roi.Camera != null && !cameras.Contains(roi.Camera))
{
roi.Camera.ClearRoiParams();
cameras.Add(roi.Camera);
}
}
/// Register ROI-parameters to cameras
foreach (var roi in rois) roi.RegisterRoiToCamera();
/// Prepare measurementOperations
IList<IOperation> measureOperations = new List<IOperation>();
foreach (var camera in cameras) measureOperations.Add(camera.MeasurementOp());
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress);
//------------------------------------------------
if (mode == Config.Entities.DebugMode.Simulate)
{
/// TODO: Reimplement
//tstRslt = MakeSimulated(test, 1, simulatedError);
simulatedError *= 0.6f;
State.Create("Adjustment : Simulating the test")
.AddOperation(checkUiOp)
.AddOperation(new Operations.TimerOp(5))
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.TimerExpired));
}
else
{
State.Create("Adjustment : Starting the test")
.AddOperation(checkUiOp)
.AddOperations(measureOperations)
.AddOperation(cBrd.StartMeasurementOp(outPath, Elde.TestMethods.Synchro,
test.Qfrom, test.Qto, totalPulses, (float)test.TolerRed))
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.MeasurementStarted));
/// Measurement loop - preparation
readRegistersOp = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders);
queryEnd1 = cBrd.QueryMeasurementEndOp();
queryEnd2 = cBrd.QueryMeasurementEndOp();
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr);
/// Measurement loop - begin
while (true)
{
//--------------------------------
switch (ReadRegistersTempPressAmbient(measureOperations, true))
{
case Event.Error: { retVal = Event.Error; goto stopTest; }
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
case Event.MeasurementCompleted: goto one_test_completed;
}
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
UpdateAllStatistics(StateMachine.Time);
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
}
/// Measurement loop - end
one_test_completed:
//------------------------------------------------
Bridge.OnActivity(this, Strings.Adjustment_in_progress);
//------------------------------------------------
TestEndTime = DateTime.Now;
/// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results
if (UIFlowControl.Stop == WaitBeginFormClosed()) goto stopTest;
///
/// Populate TestResult data entity with data
///
Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part);
if (tstRslt != null)
{
UpdateTempPressDensAmb(tstRslt);
/// Main results
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
tstRslt.MassStart = 0;
tstRslt.MassEnd = 0;
tstRslt.FlowMass = 0; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * cBrd.EtPulses(0) / tstRslt.TestTime; /// [m3/h]
tstRslt.Buoyancy = Config.Formulas.Buoyancy();
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = tstRslt.ConstMasterCorr; /// Corrected master pulses per liter
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0.0f; /// Cannot be determined without the collected water mass measurement
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
tstRslt.DiverterStart = 0;
tstRslt.DiverterEnd = 0;
tstRslt.ErrorFlagsMd = (ErrorFlagsComp != null) ? (sbyte)ErrorFlagsComp.Mode : (sbyte)0;
tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, false, 0, 0) : 0;
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.Single);
GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i];
if (meterRslt != null && regReader != null)
{
meterRslt.RegReaderType = (int)regReader.RegisterReaderType;
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
meterRslt.PulsesMeter = Convert.ToDouble(regReader.WMPulses);
meterRslt.PulsesMaster = Convert.ToDouble(regReader.WMRefPulses);
meterRslt.VolumeStart = 0; /// liter
meterRslt.VolumeEnd = 0; /// liter
meterRslt.VolumeMeter = meterRslt.PulsesMeter * regReader.LtrsPerPulse; /// liter
meterRslt.VolumeRef = meterRslt.PulsesMaster * tstRslt.ConstMaster; /// liter
meterRslt.TestTime = cBrd.ImpulseTime(i + 1);
meterRslt.Error = 0;
meterRslt.Passed = (meterRslt.PulsesMeter >= PulsesLimitLo);
meterRslt.TestDone = true;
tstRslt.TestDone = true;
}
}
tstRslt.Components = Results.Entities.Components
.UpdateList(BatchRslts.ComponentsList,
new Results.Entities.Components((BenchInfo != null) ? BenchInfo.TestBenchId : 1,
(BenchInfo != null) ? BenchInfo.TestBenchName : "testbench",
inPath.Pump != null ? inPath.Pump.Name : string.Empty,
outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty,
outPath.Scale != null ? outPath.Scale.Name : string.Empty,
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));
/// Update water meter error flags
if (ErrorFlagsComp != null)
{
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (BatchRslts.WaterMeters[i] != null)
{
BatchRslts.WaterMeters[i].ErrorFlags = ErrorFlagsComp.GetWMtrErrorFlags(BatchRslts.WaterMeters[i].MeterTestRslts);
}
}
}
/// Update results
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(testName, tstRslt));
}
/// Add data - end
}
/// Update modeless dialog error information
Bridge.OnPulsesTestInProgress(this, new PulsesTestInProgressEventArgs(testName, PulsesLimitLo));
/// Test 'Quit'
if ((modelessDlg is GenericDevices.IHasCompleted) && !(modelessDlg as GenericDevices.IHasCompleted).Completed)
{
goto loop; /// Modeless dilaog not closed, keep looping
}
modelessDlg = null; /// Modeless dialog is closed now
/// Append the results to the CSV-file
allResults.Info(TestResult2CsvLine(testName, test.Part));
stopTest:
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError
|| retVal == Event.Error || retVal == Event.ConfigurationError)
{
State.Create("Adjustment : Stopping diverter, gate, etc.")
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.PreviousStopped));
}
stopTestWOStoppingDivGateEtc:
/// Create a list with one item 'retVal' (default is Event.Done) and return it
IList<Event> retList = new List<Event>(1);
retList.Add(retVal);
return retList;
}
}
}
@@ -1,35 +0,0 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using log4net;
using Config.Entities;
using TBF.BenchControl;
namespace TBF.BenchControl.TestMethods.PulsesTest
{
public class TestMethod : ComponentBase, GenericDevices.ITestMethod
{
private static readonly ILog log = LogManager.GetLogger(typeof(TestMethod));
public override string ToString() { return string.Format("TestMethods.PulsesTest({0})", Cfg.ToString(1)); }
public bool CanTest(MetersKind meters) { return meters == MetersKind.Single; }
public bool DoTransitions() { return true; }
public TestMethod()
{
}
public TestMethod(Generic.IComponentCfg cfg)
: base(cfg)
{
log.Debug(this.ToString());
}
public IList<Event> Execute(Test test, int repetNr, bool isLastRepetition)
{
return (new PulseOutputsTestSeq()).Execute(test, repetNr, isLastRepetition, DebugLevel);
}
}
}
@@ -1,200 +0,0 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using log4net;
using Config.Entities;
using TBF.Resources;
namespace TBF.BenchControl.TestMethods.PulsesTest
{
public partial class WMPulsesForm : Form, GenericDevices.IHasCompleted
{
private static readonly ILog log = LogManager.GetLogger(typeof(WMPulsesForm));
///
/// Updated in constructor
///
readonly int waterMetersCount; /// Number of text boxes for serial numbers
readonly bool[] disabled;
Rectangle[] rects;
///
/// Updated in OnAdjustmentInProgress()
///
double[] pulsesCount; /// Created in constructor
double limitLo;
///
/// Set to 'true' when the form closes
///
public bool Completed { get { return completed; } }
bool completed;
/// <summary>
/// Constructor
/// </summary>
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public WMPulsesForm(IList<GenericDevices.IWaterMeter> waterMeters)
: this()
{
waterMetersCount = waterMeters.Count;
rects = new Rectangle[waterMetersCount];
for (int i = 0; i < waterMetersCount; i++) rects[i] = new Rectangle(385, 30 + 90 * i, 324, 57);
disabled = new bool[waterMetersCount];
for (int i = 0; i < waterMetersCount; i++) disabled[i] = waterMeters[i].Disabled;
pulsesCount = new double[waterMetersCount];
}
/// <summary> Parameterless constructor for 3 watermeters </summary>
public WMPulsesForm()
{
InitializeComponent();
ControlBox = false;
completed = false;
/// Attach to 'AdjustmentInProgress' handler
UiBridge.Bridge.PulsesTestInProgressHandler += delegate(object sender, UiBridge.PulsesTestInProgressEventArgs args)
{
if (InvokeRequired)
{
Invoke(new EventHandler<UiBridge.PulsesTestInProgressEventArgs>(OnPulsesTestInProgress), sender, args);
}
else OnPulsesTestInProgress(sender, args);
};
}
void Localize()
{
Text = Strings.Water_Meter_States;
groupBox1.Text = Strings.Water_Meter + " 1";
groupBox2.Text = Strings.Water_Meter + " 2";
groupBox3.Text = Strings.Water_Meter + " 3";
groupBox4.Text = Strings.Water_Meter + " 4";
groupBox5.Text = Strings.Water_Meter + " 5";
groupBox6.Text = Strings.Water_Meter + " 6";
wmPulsesCountLabel1.Text = Strings.Pulses_;
wmPulsesCountLabel2.Text = Strings.Pulses_;
wmPulsesCountLabel3.Text = Strings.Pulses_;
wmPulsesCountLabel4.Text = Strings.Pulses_;
wmPulsesCountLabel5.Text = Strings.Pulses_;
wmPulsesCountLabel6.Text = Strings.Pulses_;
okButton.Text = Strings.OkBtnText;
}
private void WMPulsesForm_Load(object sender, EventArgs e)
{
Localize();
Height = 50 + 90 * waterMetersCount;
if (waterMetersCount < 1 || disabled[0]) groupBox1.Visible = false;
if (waterMetersCount < 2 || disabled[1]) groupBox2.Visible = false;
if (waterMetersCount < 3 || disabled[2]) groupBox3.Visible = false;
if (waterMetersCount < 4 || disabled[3]) groupBox4.Visible = false;
if (waterMetersCount < 5 || disabled[4]) groupBox5.Visible = false;
if (waterMetersCount < 6 || disabled[5]) groupBox6.Visible = false;
wmPulsesCountTextBox1.Text = "---";
wmPulsesCountTextBox2.Text = "---";
wmPulsesCountTextBox3.Text = "---";
wmPulsesCountTextBox4.Text = "---";
wmPulsesCountTextBox5.Text = "---";
wmPulsesCountTextBox6.Text = "---";
}
private void okButton_Click(object sender, EventArgs e)
{
completed = true;
Close();
}
void OnPulsesTestInProgress(object sender, UiBridge.PulsesTestInProgressEventArgs args)
{
string testName = args.TestName;
limitLo = args.LimitLo;
Results.Entities.TestRslt tr = TBF.BenchControl.Sequences.ProcessData.BatchRslts.GetTestRslt(testName, 0);
int count = Math.Min(waterMetersCount, TBF.BenchControl.Sequences.ProcessData.BatchRslts.WMPositionsCount);
for (int i = 0; i < count; i++)
{
Results.Entities.MeterTestRslt mtr = TBF.BenchControl.Sequences.ProcessData.BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.Single);
if (mtr != null) pulsesCount[i] = mtr.PulsesMeter;
}
Redraw();
}
void Redraw()
{
if (waterMetersCount > 0 && !disabled[0]) wmPulsesCountTextBox1.Text = pulsesCount[0].ToString("F0");
if (waterMetersCount > 1 && !disabled[1]) wmPulsesCountTextBox2.Text = pulsesCount[1].ToString("F0");
if (waterMetersCount > 2 && !disabled[2]) wmPulsesCountTextBox3.Text = pulsesCount[2].ToString("F0");
if (waterMetersCount > 3 && !disabled[3]) wmPulsesCountTextBox4.Text = pulsesCount[3].ToString("F0");
if (waterMetersCount > 4 && !disabled[4]) wmPulsesCountTextBox5.Text = pulsesCount[4].ToString("F0");
if (waterMetersCount > 5 && !disabled[5]) wmPulsesCountTextBox6.Text = pulsesCount[5].ToString("F0");
for (int i = 0; i < waterMetersCount; i++) Invalidate(rects[i]);
}
private void WMPulsesForm_Paint(object sender, PaintEventArgs e)
{
System.Drawing.Graphics graphics = this.CreateGraphics();
for (int i = 0; i < waterMetersCount; i++)
{
if (!disabled[i])
{
PaintOne(graphics, rects[i], pulsesCount[i], limitLo);
}
}
}
void PaintOne(System.Drawing.Graphics g, Rectangle r, double value, double limLo)
{
Rectangle rect1 = new Rectangle(r.Left, r.Top, r.Width / 3, r.Height);
Rectangle rect2 = new Rectangle(r.Left + r.Width / 3, r.Top, r.Width / 3, r.Height);
Rectangle rect3 = new Rectangle(r.Left + 2 * (r.Width / 3), r.Top, r.Width / 3, r.Height);
Brush redBrush = new SolidBrush(Color.FromName("Salmon"));
Brush greenBrush = new SolidBrush(Color.FromName("LightGreen"));
Brush centBrush = new SolidBrush(Color.FromName("Green"));
if (value >= limLo)
{
g.FillRectangle(greenBrush, rect2);
}
else
{
g.FillRectangle(redBrush, rect2);
}
}
#region Forced close handling
public void StartForceCloseHandler()
{
UiBridge.Bridge.CloseModelessFormHandler += delegate(object sender, EventArgs args)
{
if (InvokeRequired) { Invoke(new EventHandler<EventArgs>(OnForceClose), sender, args); }
else OnForceClose(sender, args);
};
}
void OnForceClose(object sender, EventArgs args)
{
DialogResult = DialogResult.Cancel;
Close();
}
#endregion
}
}
@@ -1,312 +0,0 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
namespace TBF.BenchControl.TestMethods.PulsesTest
{
partial class WMPulsesForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.wmPulsesCountTextBox2 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel2 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.wmPulsesCountTextBox1 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel1 = new System.Windows.Forms.Label();
this.okButton = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.wmPulsesCountTextBox3 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel3 = new System.Windows.Forms.Label();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.wmPulsesCountTextBox4 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel4 = new System.Windows.Forms.Label();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.wmPulsesCountTextBox5 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel5 = new System.Windows.Forms.Label();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.wmPulsesCountTextBox6 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel6 = new System.Windows.Forms.Label();
this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox4.SuspendLayout();
this.groupBox5.SuspendLayout();
this.groupBox6.SuspendLayout();
this.SuspendLayout();
//
// groupBox2
//
this.groupBox2.Controls.Add(this.wmPulsesCountTextBox2);
this.groupBox2.Controls.Add(this.wmPulsesCountLabel2);
this.groupBox2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.groupBox2.ForeColor = System.Drawing.Color.Black;
this.groupBox2.Location = new System.Drawing.Point(25, 102);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(333, 81);
this.groupBox2.TabIndex = 2;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Water Meter 2";
//
// wmPulsesCountTextBox2
//
this.wmPulsesCountTextBox2.Font = new System.Drawing.Font("Verdana", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox2.Location = new System.Drawing.Point(183, 21);
this.wmPulsesCountTextBox2.Name = "wmPulsesCountTextBox2";
this.wmPulsesCountTextBox2.Size = new System.Drawing.Size(137, 52);
this.wmPulsesCountTextBox2.TabIndex = 1;
//
// wmPulsesCountLabel2
//
this.wmPulsesCountLabel2.AutoSize = true;
this.wmPulsesCountLabel2.Location = new System.Drawing.Point(18, 34);
this.wmPulsesCountLabel2.Name = "wmPulsesCountLabel2";
this.wmPulsesCountLabel2.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel2.TabIndex = 0;
this.wmPulsesCountLabel2.Text = "Pulses count";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.wmPulsesCountTextBox1);
this.groupBox1.Controls.Add(this.wmPulsesCountLabel1);
this.groupBox1.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.groupBox1.ForeColor = System.Drawing.Color.Black;
this.groupBox1.Location = new System.Drawing.Point(25, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(333, 81);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Water Meter 1";
//
// wmPulsesCountTextBox1
//
this.wmPulsesCountTextBox1.Font = new System.Drawing.Font("Verdana", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox1.Location = new System.Drawing.Point(183, 21);
this.wmPulsesCountTextBox1.Name = "wmPulsesCountTextBox1";
this.wmPulsesCountTextBox1.Size = new System.Drawing.Size(137, 52);
this.wmPulsesCountTextBox1.TabIndex = 1;
//
// wmPulsesCountLabel1
//
this.wmPulsesCountLabel1.AutoSize = true;
this.wmPulsesCountLabel1.Location = new System.Drawing.Point(18, 34);
this.wmPulsesCountLabel1.Name = "wmPulsesCountLabel1";
this.wmPulsesCountLabel1.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel1.TabIndex = 0;
this.wmPulsesCountLabel1.Text = "Pulses count";
//
// okButton
//
this.okButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.okButton.ForeColor = System.Drawing.Color.Black;
this.okButton.Location = new System.Drawing.Point(739, 26);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(98, 63);
this.okButton.TabIndex = 7;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// groupBox3
//
this.groupBox3.Controls.Add(this.wmPulsesCountTextBox3);
this.groupBox3.Controls.Add(this.wmPulsesCountLabel3);
this.groupBox3.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.groupBox3.ForeColor = System.Drawing.Color.Black;
this.groupBox3.Location = new System.Drawing.Point(25, 192);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(333, 81);
this.groupBox3.TabIndex = 3;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Water Meter 3";
//
// wmPulsesCountTextBox3
//
this.wmPulsesCountTextBox3.Font = new System.Drawing.Font("Verdana", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox3.Location = new System.Drawing.Point(183, 21);
this.wmPulsesCountTextBox3.Name = "wmPulsesCountTextBox3";
this.wmPulsesCountTextBox3.Size = new System.Drawing.Size(137, 52);
this.wmPulsesCountTextBox3.TabIndex = 1;
//
// wmPulsesCountLabel3
//
this.wmPulsesCountLabel3.AutoSize = true;
this.wmPulsesCountLabel3.Location = new System.Drawing.Point(18, 34);
this.wmPulsesCountLabel3.Name = "wmPulsesCountLabel3";
this.wmPulsesCountLabel3.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel3.TabIndex = 0;
this.wmPulsesCountLabel3.Text = "Pulses count";
//
// groupBox4
//
this.groupBox4.Controls.Add(this.wmPulsesCountTextBox4);
this.groupBox4.Controls.Add(this.wmPulsesCountLabel4);
this.groupBox4.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.groupBox4.ForeColor = System.Drawing.Color.Black;
this.groupBox4.Location = new System.Drawing.Point(25, 282);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(333, 81);
this.groupBox4.TabIndex = 4;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "Water Meter 4";
//
// wmPulsesCountTextBox4
//
this.wmPulsesCountTextBox4.Font = new System.Drawing.Font("Verdana", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox4.Location = new System.Drawing.Point(183, 21);
this.wmPulsesCountTextBox4.Name = "wmPulsesCountTextBox4";
this.wmPulsesCountTextBox4.Size = new System.Drawing.Size(137, 52);
this.wmPulsesCountTextBox4.TabIndex = 1;
//
// wmPulsesCountLabel4
//
this.wmPulsesCountLabel4.AutoSize = true;
this.wmPulsesCountLabel4.Location = new System.Drawing.Point(18, 34);
this.wmPulsesCountLabel4.Name = "wmPulsesCountLabel4";
this.wmPulsesCountLabel4.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel4.TabIndex = 0;
this.wmPulsesCountLabel4.Text = "Pulses count";
//
// groupBox5
//
this.groupBox5.Controls.Add(this.wmPulsesCountTextBox5);
this.groupBox5.Controls.Add(this.wmPulsesCountLabel5);
this.groupBox5.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.groupBox5.ForeColor = System.Drawing.Color.Black;
this.groupBox5.Location = new System.Drawing.Point(25, 372);
this.groupBox5.Name = "groupBox5";
this.groupBox5.Size = new System.Drawing.Size(333, 81);
this.groupBox5.TabIndex = 5;
this.groupBox5.TabStop = false;
this.groupBox5.Text = "Water Meter 5";
//
// wmPulsesCountTextBox5
//
this.wmPulsesCountTextBox5.Font = new System.Drawing.Font("Verdana", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox5.Location = new System.Drawing.Point(183, 21);
this.wmPulsesCountTextBox5.Name = "wmPulsesCountTextBox5";
this.wmPulsesCountTextBox5.Size = new System.Drawing.Size(137, 52);
this.wmPulsesCountTextBox5.TabIndex = 1;
//
// wmPulsesCountLabel5
//
this.wmPulsesCountLabel5.AutoSize = true;
this.wmPulsesCountLabel5.Location = new System.Drawing.Point(18, 34);
this.wmPulsesCountLabel5.Name = "wmPulsesCountLabel5";
this.wmPulsesCountLabel5.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel5.TabIndex = 0;
this.wmPulsesCountLabel5.Text = "Pulses count";
//
// groupBox6
//
this.groupBox6.Controls.Add(this.wmPulsesCountTextBox6);
this.groupBox6.Controls.Add(this.wmPulsesCountLabel6);
this.groupBox6.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.groupBox6.ForeColor = System.Drawing.Color.Black;
this.groupBox6.Location = new System.Drawing.Point(25, 462);
this.groupBox6.Name = "groupBox6";
this.groupBox6.Size = new System.Drawing.Size(333, 81);
this.groupBox6.TabIndex = 6;
this.groupBox6.TabStop = false;
this.groupBox6.Text = "Water Meter 6";
//
// wmPulsesCountTextBox6
//
this.wmPulsesCountTextBox6.Font = new System.Drawing.Font("Verdana", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox6.Location = new System.Drawing.Point(183, 21);
this.wmPulsesCountTextBox6.Name = "wmPulsesCountTextBox6";
this.wmPulsesCountTextBox6.Size = new System.Drawing.Size(137, 52);
this.wmPulsesCountTextBox6.TabIndex = 1;
//
// wmPulsesCountLabel6
//
this.wmPulsesCountLabel6.AutoSize = true;
this.wmPulsesCountLabel6.Location = new System.Drawing.Point(18, 34);
this.wmPulsesCountLabel6.Name = "wmPulsesCountLabel6";
this.wmPulsesCountLabel6.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel6.TabIndex = 0;
this.wmPulsesCountLabel6.Text = "Pulses count";
//
// WMPulsesForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.DarkGoldenrod;
this.ClientSize = new System.Drawing.Size(868, 565);
this.Controls.Add(this.groupBox6);
this.Controls.Add(this.groupBox5);
this.Controls.Add(this.groupBox4);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.okButton);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "WMPulsesForm";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Text = "Water Meter States";
this.TopMost = true;
this.Load += new System.EventHandler(this.WMPulsesForm_Load);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.WMPulsesForm_Paint);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.groupBox4.ResumeLayout(false);
this.groupBox4.PerformLayout();
this.groupBox5.ResumeLayout(false);
this.groupBox5.PerformLayout();
this.groupBox6.ResumeLayout(false);
this.groupBox6.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox wmPulsesCountTextBox2;
private System.Windows.Forms.Label wmPulsesCountLabel2;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox wmPulsesCountTextBox1;
private System.Windows.Forms.Label wmPulsesCountLabel1;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.TextBox wmPulsesCountTextBox3;
private System.Windows.Forms.Label wmPulsesCountLabel3;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.TextBox wmPulsesCountTextBox4;
private System.Windows.Forms.Label wmPulsesCountLabel4;
private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.TextBox wmPulsesCountTextBox5;
private System.Windows.Forms.Label wmPulsesCountLabel5;
private System.Windows.Forms.GroupBox groupBox6;
private System.Windows.Forms.TextBox wmPulsesCountTextBox6;
private System.Windows.Forms.Label wmPulsesCountLabel6;
}
}
@@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -1,238 +0,0 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using log4net;
using Config.Entities;
using TBF.Resources;
namespace TBF.BenchControl.TestMethods.PulsesTest
{
public partial class WMPulsesForm12 : Form, GenericDevices.IHasCompleted
{
private static readonly ILog log = LogManager.GetLogger(typeof(WMPulsesForm12));
const int MaxWMsCount = 12; /// Implementation limit of this form
///
/// Updated in constructor
///
readonly int waterMetersCount; /// Number of text boxes for serial numbers
readonly bool[] disabled;
int textBoxesCount;
Label[] labels;
TextBox[] pulsesCountTextBox;
Rectangle[] rects;
///
/// Updated in OnAdjustmentInProgress()
///
double[] pulsesCount; /// Created in constructor
double limitLo;
///
/// Set to 'true' when the form closes
///
public bool Completed { get { return completed; } }
bool completed;
/// <summary> Parameterless constructor for 3 watermeters </summary>
public WMPulsesForm12()
{
InitializeComponent();
ControlBox = false;
textBoxesCount = MaxWMsCount;
labels = new Label[MaxWMsCount]
{
wmPulsesCountLabel1, wmPulsesCountLabel2, wmPulsesCountLabel3, wmPulsesCountLabel4,
wmPulsesCountLabel5, wmPulsesCountLabel6, wmPulsesCountLabel7, wmPulsesCountLabel8,
wmPulsesCountLabel9, wmPulsesCountLabel10, wmPulsesCountLabel11, wmPulsesCountLabel12,
};
pulsesCountTextBox = new TextBox[MaxWMsCount]
{
wmPulsesCountTextBox1, wmPulsesCountTextBox2, wmPulsesCountTextBox3, wmPulsesCountTextBox4,
wmPulsesCountTextBox5, wmPulsesCountTextBox6, wmPulsesCountTextBox7, wmPulsesCountTextBox8,
wmPulsesCountTextBox9, wmPulsesCountTextBox10, wmPulsesCountTextBox11, wmPulsesCountTextBox12,
};
rects = new Rectangle[MaxWMsCount];
for (int i = 0; i < MaxWMsCount; i++)
{
int row = i % 12;
int col = i / 12;
rects[i] = new Rectangle(350 + col * 557, 25 + row * 47, 230, 37);
}
completed = false;
/// Attach to 'AdjustmentInProgress' handler
UiBridge.Bridge.PulsesTestInProgressHandler += delegate(object sender, UiBridge.PulsesTestInProgressEventArgs args)
{
if (InvokeRequired)
{
Invoke(new EventHandler<UiBridge.PulsesTestInProgressEventArgs>(OnPulsesTestInProgress), sender, args);
}
else OnPulsesTestInProgress(sender, args);
};
}
/// <summary>
/// Constructor
/// </summary>
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public WMPulsesForm12(IList<GenericDevices.IWaterMeter> waterMeters)
: this()
{
waterMetersCount = waterMeters.Count;
ShuffleTextBoxes(waterMetersCount, Config.Data.LineSize);
disabled = new bool[waterMetersCount];
for (int i = 0; i < waterMetersCount; i++) disabled[i] = waterMeters[i].Disabled;
pulsesCount = new double[waterMetersCount];
}
/// <summary>
/// Make sure the layout of labels/text boxes on the screen
/// corresponds to the layout of watermeters of the test bench.
/// </summary>
/// <param name="wmsCount">Number of watermeters</param>
/// <param name="lineSize">Number of watermeters in one line</param>
void ShuffleTextBoxes(int wmsCount, int lineSize)
{
if (wmsCount < textBoxesCount && lineSize > 0)
{
int nrLines = (wmsCount + lineSize - 1) / lineSize;
int gap = (textBoxesCount - wmsCount) / nrLines;
int dest = 0;
for (int l = 0; l < nrLines; l++)
{
for (int i = 0; i < lineSize; i++)
{
labels[dest] = labels[l * lineSize + l * gap + i];
pulsesCountTextBox[dest] = pulsesCountTextBox[l * lineSize + l * gap + i];
rects[dest] = rects[l * lineSize + l * gap + i];
dest++;
}
}
textBoxesCount = wmsCount;
}
}
void Localize()
{
Text = Strings.Water_Meter_States;
for (int i = 0; i < textBoxesCount; i++)
{
labels[i].Text = string.Format("WM{0} {1}", i + 1, Strings.Pulses_);
}
okButton.Text = Strings.OkBtnText;
}
private void WMPulsesForm12_Load(object sender, EventArgs e)
{
Localize();
//Height = 50 + 90 * WaterMetersCount;
for (int i = 0; i < textBoxesCount; i++)
{
labels[i].Visible = pulsesCountTextBox[i].Visible = (disabled == null || i >= disabled.Length || !disabled[i]);
pulsesCountTextBox[i].Text = "---";
}
}
private void okButton_Click(object sender, EventArgs e)
{
completed = true;
Close();
}
void OnPulsesTestInProgress(object sender, UiBridge.PulsesTestInProgressEventArgs args)
{
string testName = args.TestName;
limitLo = args.LimitLo;
Results.Entities.TestRslt tr = TBF.BenchControl.Sequences.ProcessData.BatchRslts.GetTestRslt(testName, 0);
int count = Math.Min(waterMetersCount, TBF.BenchControl.Sequences.ProcessData.BatchRslts.WMPositionsCount);
for (int i = 0; i < count; i++)
{
Results.Entities.MeterTestRslt mtr = TBF.BenchControl.Sequences.ProcessData.BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.Single);
if (mtr != null) pulsesCount[i] = mtr.PulsesMeter;
}
Redraw();
}
void Redraw()
{
for (int i = 0; i < textBoxesCount; i++)
{
pulsesCountTextBox[i].Text = pulsesCount[i].ToString("F0");
Invalidate(rects[i]);
}
}
private void WMPulsesForm12_Paint(object sender, PaintEventArgs e)
{
System.Drawing.Graphics graphics = this.CreateGraphics();
for (int i = 0; i < waterMetersCount; i++)
{
if (!disabled[i])
{
PaintOne(graphics, rects[i], pulsesCount[i], limitLo);
}
}
}
void PaintOne(System.Drawing.Graphics g, Rectangle r, double value, double limLo)
{
Rectangle rect1 = new Rectangle(r.Left, r.Top, r.Width / 3, r.Height);
Rectangle rect2 = new Rectangle(r.Left + r.Width / 3, r.Top, r.Width / 3, r.Height);
Rectangle rect3 = new Rectangle(r.Left + 2 * (r.Width / 3), r.Top, r.Width / 3, r.Height);
Brush redBrush = new SolidBrush(Color.FromName("Salmon"));
Brush greenBrush = new SolidBrush(Color.FromName("LightGreen"));
Brush centBrush = new SolidBrush(Color.FromName("Green"));
if (value >= limLo)
{
g.FillRectangle(greenBrush, rect2);
}
else
{
g.FillRectangle(redBrush, rect2);
}
}
#region Forced close handling
public void StartForceCloseHandler()
{
UiBridge.Bridge.CloseModelessFormHandler += delegate(object sender, EventArgs args)
{
if (InvokeRequired) { Invoke(new EventHandler<EventArgs>(OnForceClose), sender, args); }
else OnForceClose(sender, args);
};
}
void OnForceClose(object sender, EventArgs args)
{
DialogResult = DialogResult.Cancel;
Close();
}
#endregion
}
}
@@ -1,385 +0,0 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
namespace TBF.BenchControl.TestMethods.PulsesTest
{
partial class WMPulsesForm12
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.wmPulsesCountTextBox2 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel2 = new System.Windows.Forms.Label();
this.wmPulsesCountLabel1 = new System.Windows.Forms.Label();
this.okButton = new System.Windows.Forms.Button();
this.wmPulsesCountTextBox3 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel3 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox4 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel4 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox5 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel5 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox6 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel6 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox1 = new System.Windows.Forms.TextBox();
this.wmPulsesCountTextBox7 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel7 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox8 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel8 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox9 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel9 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox10 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel10 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox12 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel12 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox11 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel11 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// wmPulsesCountTextBox2
//
this.wmPulsesCountTextBox2.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox2.Location = new System.Drawing.Point(198, 74);
this.wmPulsesCountTextBox2.Name = "wmPulsesCountTextBox2";
this.wmPulsesCountTextBox2.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox2.TabIndex = 1;
this.wmPulsesCountTextBox2.Visible = false;
//
// wmPulsesCountLabel2
//
this.wmPulsesCountLabel2.AutoSize = true;
this.wmPulsesCountLabel2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel2.Location = new System.Drawing.Point(33, 85);
this.wmPulsesCountLabel2.Name = "wmPulsesCountLabel2";
this.wmPulsesCountLabel2.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel2.TabIndex = 0;
this.wmPulsesCountLabel2.Text = "Pulses count";
this.wmPulsesCountLabel2.Visible = false;
//
// wmPulsesCountLabel1
//
this.wmPulsesCountLabel1.AutoSize = true;
this.wmPulsesCountLabel1.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel1.Location = new System.Drawing.Point(33, 39);
this.wmPulsesCountLabel1.Name = "wmPulsesCountLabel1";
this.wmPulsesCountLabel1.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel1.TabIndex = 0;
this.wmPulsesCountLabel1.Text = "Pulses count";
this.wmPulsesCountLabel1.Visible = false;
//
// okButton
//
this.okButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.okButton.ForeColor = System.Drawing.Color.Black;
this.okButton.Location = new System.Drawing.Point(601, 28);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(98, 63);
this.okButton.TabIndex = 7;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// wmPulsesCountTextBox3
//
this.wmPulsesCountTextBox3.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox3.Location = new System.Drawing.Point(198, 120);
this.wmPulsesCountTextBox3.Name = "wmPulsesCountTextBox3";
this.wmPulsesCountTextBox3.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox3.TabIndex = 1;
this.wmPulsesCountTextBox3.Visible = false;
//
// wmPulsesCountLabel3
//
this.wmPulsesCountLabel3.AutoSize = true;
this.wmPulsesCountLabel3.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel3.Location = new System.Drawing.Point(33, 131);
this.wmPulsesCountLabel3.Name = "wmPulsesCountLabel3";
this.wmPulsesCountLabel3.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel3.TabIndex = 0;
this.wmPulsesCountLabel3.Text = "Pulses count";
this.wmPulsesCountLabel3.Visible = false;
//
// wmPulsesCountTextBox4
//
this.wmPulsesCountTextBox4.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox4.Location = new System.Drawing.Point(198, 166);
this.wmPulsesCountTextBox4.Name = "wmPulsesCountTextBox4";
this.wmPulsesCountTextBox4.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox4.TabIndex = 1;
this.wmPulsesCountTextBox4.Visible = false;
//
// wmPulsesCountLabel4
//
this.wmPulsesCountLabel4.AutoSize = true;
this.wmPulsesCountLabel4.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel4.Location = new System.Drawing.Point(33, 177);
this.wmPulsesCountLabel4.Name = "wmPulsesCountLabel4";
this.wmPulsesCountLabel4.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel4.TabIndex = 0;
this.wmPulsesCountLabel4.Text = "Pulses count";
this.wmPulsesCountLabel4.Visible = false;
//
// wmPulsesCountTextBox5
//
this.wmPulsesCountTextBox5.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox5.Location = new System.Drawing.Point(198, 213);
this.wmPulsesCountTextBox5.Name = "wmPulsesCountTextBox5";
this.wmPulsesCountTextBox5.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox5.TabIndex = 1;
this.wmPulsesCountTextBox5.Visible = false;
//
// wmPulsesCountLabel5
//
this.wmPulsesCountLabel5.AutoSize = true;
this.wmPulsesCountLabel5.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel5.Location = new System.Drawing.Point(33, 224);
this.wmPulsesCountLabel5.Name = "wmPulsesCountLabel5";
this.wmPulsesCountLabel5.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel5.TabIndex = 0;
this.wmPulsesCountLabel5.Text = "Pulses count";
this.wmPulsesCountLabel5.Visible = false;
//
// wmPulsesCountTextBox6
//
this.wmPulsesCountTextBox6.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox6.Location = new System.Drawing.Point(198, 259);
this.wmPulsesCountTextBox6.Name = "wmPulsesCountTextBox6";
this.wmPulsesCountTextBox6.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox6.TabIndex = 1;
this.wmPulsesCountTextBox6.Visible = false;
//
// wmPulsesCountLabel6
//
this.wmPulsesCountLabel6.AutoSize = true;
this.wmPulsesCountLabel6.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel6.Location = new System.Drawing.Point(33, 271);
this.wmPulsesCountLabel6.Name = "wmPulsesCountLabel6";
this.wmPulsesCountLabel6.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel6.TabIndex = 0;
this.wmPulsesCountLabel6.Text = "Pulses count";
this.wmPulsesCountLabel6.Visible = false;
//
// wmPulsesCountTextBox1
//
this.wmPulsesCountTextBox1.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox1.Location = new System.Drawing.Point(198, 28);
this.wmPulsesCountTextBox1.Name = "wmPulsesCountTextBox1";
this.wmPulsesCountTextBox1.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox1.TabIndex = 1;
this.wmPulsesCountTextBox1.Visible = false;
//
// wmPulsesCountTextBox7
//
this.wmPulsesCountTextBox7.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox7.Location = new System.Drawing.Point(198, 305);
this.wmPulsesCountTextBox7.Name = "wmPulsesCountTextBox7";
this.wmPulsesCountTextBox7.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox7.TabIndex = 9;
this.wmPulsesCountTextBox7.Visible = false;
//
// wmPulsesCountLabel7
//
this.wmPulsesCountLabel7.AutoSize = true;
this.wmPulsesCountLabel7.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel7.Location = new System.Drawing.Point(33, 317);
this.wmPulsesCountLabel7.Name = "wmPulsesCountLabel7";
this.wmPulsesCountLabel7.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel7.TabIndex = 8;
this.wmPulsesCountLabel7.Text = "Pulses count";
this.wmPulsesCountLabel7.Visible = false;
//
// wmPulsesCountTextBox8
//
this.wmPulsesCountTextBox8.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox8.Location = new System.Drawing.Point(198, 351);
this.wmPulsesCountTextBox8.Name = "wmPulsesCountTextBox8";
this.wmPulsesCountTextBox8.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox8.TabIndex = 11;
this.wmPulsesCountTextBox8.Visible = false;
//
// wmPulsesCountLabel8
//
this.wmPulsesCountLabel8.AutoSize = true;
this.wmPulsesCountLabel8.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel8.Location = new System.Drawing.Point(33, 363);
this.wmPulsesCountLabel8.Name = "wmPulsesCountLabel8";
this.wmPulsesCountLabel8.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel8.TabIndex = 10;
this.wmPulsesCountLabel8.Text = "Pulses count";
this.wmPulsesCountLabel8.Visible = false;
//
// wmPulsesCountTextBox9
//
this.wmPulsesCountTextBox9.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox9.Location = new System.Drawing.Point(198, 397);
this.wmPulsesCountTextBox9.Name = "wmPulsesCountTextBox9";
this.wmPulsesCountTextBox9.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox9.TabIndex = 13;
this.wmPulsesCountTextBox9.Visible = false;
//
// wmPulsesCountLabel9
//
this.wmPulsesCountLabel9.AutoSize = true;
this.wmPulsesCountLabel9.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel9.Location = new System.Drawing.Point(33, 408);
this.wmPulsesCountLabel9.Name = "wmPulsesCountLabel9";
this.wmPulsesCountLabel9.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel9.TabIndex = 12;
this.wmPulsesCountLabel9.Text = "Pulses count";
this.wmPulsesCountLabel9.Visible = false;
//
// wmPulsesCountTextBox10
//
this.wmPulsesCountTextBox10.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox10.Location = new System.Drawing.Point(198, 443);
this.wmPulsesCountTextBox10.Name = "wmPulsesCountTextBox10";
this.wmPulsesCountTextBox10.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox10.TabIndex = 15;
this.wmPulsesCountTextBox10.Visible = false;
//
// wmPulsesCountLabel10
//
this.wmPulsesCountLabel10.AutoSize = true;
this.wmPulsesCountLabel10.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel10.Location = new System.Drawing.Point(33, 454);
this.wmPulsesCountLabel10.Name = "wmPulsesCountLabel10";
this.wmPulsesCountLabel10.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel10.TabIndex = 14;
this.wmPulsesCountLabel10.Text = "Pulses count";
this.wmPulsesCountLabel10.Visible = false;
//
// wmPulsesCountTextBox12
//
this.wmPulsesCountTextBox12.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox12.Location = new System.Drawing.Point(198, 535);
this.wmPulsesCountTextBox12.Name = "wmPulsesCountTextBox12";
this.wmPulsesCountTextBox12.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox12.TabIndex = 19;
this.wmPulsesCountTextBox12.Visible = false;
//
// wmPulsesCountLabel12
//
this.wmPulsesCountLabel12.AutoSize = true;
this.wmPulsesCountLabel12.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel12.Location = new System.Drawing.Point(33, 546);
this.wmPulsesCountLabel12.Name = "wmPulsesCountLabel12";
this.wmPulsesCountLabel12.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel12.TabIndex = 18;
this.wmPulsesCountLabel12.Text = "Pulses count";
this.wmPulsesCountLabel12.Visible = false;
//
// wmPulsesCountTextBox11
//
this.wmPulsesCountTextBox11.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox11.Location = new System.Drawing.Point(198, 489);
this.wmPulsesCountTextBox11.Name = "wmPulsesCountTextBox11";
this.wmPulsesCountTextBox11.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox11.TabIndex = 17;
this.wmPulsesCountTextBox11.Visible = false;
//
// wmPulsesCountLabel11
//
this.wmPulsesCountLabel11.AutoSize = true;
this.wmPulsesCountLabel11.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel11.Location = new System.Drawing.Point(33, 500);
this.wmPulsesCountLabel11.Name = "wmPulsesCountLabel11";
this.wmPulsesCountLabel11.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel11.TabIndex = 16;
this.wmPulsesCountLabel11.Text = "Pulses count";
this.wmPulsesCountLabel11.Visible = false;
//
// WMPulsesForm12
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.DarkGoldenrod;
this.ClientSize = new System.Drawing.Size(731, 592);
this.Controls.Add(this.wmPulsesCountTextBox12);
this.Controls.Add(this.wmPulsesCountLabel12);
this.Controls.Add(this.wmPulsesCountTextBox11);
this.Controls.Add(this.wmPulsesCountLabel11);
this.Controls.Add(this.wmPulsesCountTextBox10);
this.Controls.Add(this.wmPulsesCountLabel10);
this.Controls.Add(this.wmPulsesCountTextBox9);
this.Controls.Add(this.wmPulsesCountLabel9);
this.Controls.Add(this.wmPulsesCountTextBox8);
this.Controls.Add(this.wmPulsesCountLabel8);
this.Controls.Add(this.wmPulsesCountTextBox7);
this.Controls.Add(this.wmPulsesCountLabel7);
this.Controls.Add(this.wmPulsesCountTextBox6);
this.Controls.Add(this.wmPulsesCountLabel6);
this.Controls.Add(this.wmPulsesCountTextBox5);
this.Controls.Add(this.wmPulsesCountLabel5);
this.Controls.Add(this.wmPulsesCountTextBox4);
this.Controls.Add(this.wmPulsesCountLabel4);
this.Controls.Add(this.wmPulsesCountTextBox3);
this.Controls.Add(this.wmPulsesCountLabel3);
this.Controls.Add(this.wmPulsesCountTextBox2);
this.Controls.Add(this.wmPulsesCountLabel2);
this.Controls.Add(this.wmPulsesCountTextBox1);
this.Controls.Add(this.wmPulsesCountLabel1);
this.Controls.Add(this.okButton);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "WMPulsesForm12";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Text = "Water Meter States";
this.TopMost = true;
this.Load += new System.EventHandler(this.WMPulsesForm12_Load);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.WMPulsesForm12_Paint);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox wmPulsesCountTextBox2;
private System.Windows.Forms.Label wmPulsesCountLabel2;
private System.Windows.Forms.Label wmPulsesCountLabel1;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.TextBox wmPulsesCountTextBox3;
private System.Windows.Forms.Label wmPulsesCountLabel3;
private System.Windows.Forms.TextBox wmPulsesCountTextBox4;
private System.Windows.Forms.Label wmPulsesCountLabel4;
private System.Windows.Forms.TextBox wmPulsesCountTextBox5;
private System.Windows.Forms.Label wmPulsesCountLabel5;
private System.Windows.Forms.TextBox wmPulsesCountTextBox6;
private System.Windows.Forms.Label wmPulsesCountLabel6;
private System.Windows.Forms.TextBox wmPulsesCountTextBox1;
private System.Windows.Forms.TextBox wmPulsesCountTextBox7;
private System.Windows.Forms.Label wmPulsesCountLabel7;
private System.Windows.Forms.TextBox wmPulsesCountTextBox8;
private System.Windows.Forms.Label wmPulsesCountLabel8;
private System.Windows.Forms.TextBox wmPulsesCountTextBox9;
private System.Windows.Forms.Label wmPulsesCountLabel9;
private System.Windows.Forms.TextBox wmPulsesCountTextBox10;
private System.Windows.Forms.Label wmPulsesCountLabel10;
private System.Windows.Forms.TextBox wmPulsesCountTextBox12;
private System.Windows.Forms.Label wmPulsesCountLabel12;
private System.Windows.Forms.TextBox wmPulsesCountTextBox11;
private System.Windows.Forms.Label wmPulsesCountLabel11;
}
}
@@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -1,252 +0,0 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using log4net;
using Config.Entities;
using TBF.Resources;
namespace TBF.BenchControl.TestMethods.PulsesTest
{
public partial class WMPulsesForm24 : Form, GenericDevices.IHasCompleted
{
private static readonly ILog log = LogManager.GetLogger(typeof(WMPulsesForm24));
const int MaxWMsCount = 24; /// Implementation limit of this form
///
/// Updated in constructor
///
readonly int waterMetersCount; /// Number of text boxes for serial numbers
readonly bool[] disabled;
int textBoxesCount;
Label[] labels;
TextBox[] pulsesCountTextBox;
Rectangle[] rects;
///
/// Updated in OnAdjustmentInProgress()
///
double[] pulsesCount; /// Created in constructor
double limitLo;
///
/// Set to 'true' when the form closes
///
public bool Completed { get { return completed; } }
bool completed;
/// <summary> Parameterless constructor for 3 watermeters </summary>
public WMPulsesForm24()
{
InitializeComponent();
ControlBox = false;
textBoxesCount = MaxWMsCount;
labels = new Label[MaxWMsCount]
{
wmPulsesCountLabel1, wmPulsesCountLabel2, wmPulsesCountLabel3, wmPulsesCountLabel4,
wmPulsesCountLabel5, wmPulsesCountLabel6, wmPulsesCountLabel7, wmPulsesCountLabel8,
wmPulsesCountLabel9, wmPulsesCountLabel10, wmPulsesCountLabel11, wmPulsesCountLabel12,
wmPulsesCountLabel13, wmPulsesCountLabel14, wmPulsesCountLabel15, wmPulsesCountLabel16,
wmPulsesCountLabel17, wmPulsesCountLabel18, wmPulsesCountLabel19, wmPulsesCountLabel20,
wmPulsesCountLabel21, wmPulsesCountLabel22, wmPulsesCountLabel23, wmPulsesCountLabel24,
};
pulsesCountTextBox = new TextBox[MaxWMsCount]
{
wmPulsesCountTextBox1, wmPulsesCountTextBox2, wmPulsesCountTextBox3, wmPulsesCountTextBox4,
wmPulsesCountTextBox5, wmPulsesCountTextBox6, wmPulsesCountTextBox7, wmPulsesCountTextBox8,
wmPulsesCountTextBox9, wmPulsesCountTextBox10, wmPulsesCountTextBox11, wmPulsesCountTextBox12,
wmPulsesCountTextBox13, wmPulsesCountTextBox14, wmPulsesCountTextBox15, wmPulsesCountTextBox16,
wmPulsesCountTextBox17, wmPulsesCountTextBox18, wmPulsesCountTextBox19, wmPulsesCountTextBox20,
wmPulsesCountTextBox21, wmPulsesCountTextBox22, wmPulsesCountTextBox23, wmPulsesCountTextBox24,
};
rects = new Rectangle[MaxWMsCount];
for (int i = 0; i < MaxWMsCount; i++)
{
int row = i % 12;
int col = i / 12;
rects[i] = new Rectangle(350 + col * 557, 25 + row * 47, 230, 37);
}
completed = false;
limitLo = 5;
/// Attach to 'AdjustmentInProgress' handler
UiBridge.Bridge.PulsesTestInProgressHandler += delegate(object sender, UiBridge.PulsesTestInProgressEventArgs args)
{
if (InvokeRequired)
{
Invoke(new EventHandler<UiBridge.PulsesTestInProgressEventArgs>(OnPulsesTestInProgress), sender, args);
}
else OnPulsesTestInProgress(sender, args);
};
}
/// <summary>
/// Constructor
/// </summary>
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public WMPulsesForm24(IList<GenericDevices.IWaterMeter> waterMeters)
: this()
{
waterMetersCount = waterMeters.Count;
ShuffleTextBoxes(waterMetersCount, Config.Data.LineSize);
disabled = new bool[waterMetersCount];
pulsesCount = new double[waterMetersCount];
///
for (int i = 0; i < waterMetersCount; i++)
{
disabled[i] = waterMeters[i].Disabled;
pulsesCount[i] = 0;
}
}
/// <summary>
/// Make sure the layout of labels/text boxes on the screen
/// corresponds to the layout of watermeters of the test bench.
/// </summary>
/// <param name="wmsCount">Number of watermeters</param>
/// <param name="lineSize">Number of watermeters in one line</param>
void ShuffleTextBoxes(int wmsCount, int lineSize)
{
if (wmsCount < textBoxesCount && lineSize > 0)
{
int nrLines = (wmsCount + lineSize - 1) / lineSize;
int gap = (textBoxesCount - wmsCount) / nrLines;
int dest = 0;
for (int l = 0; l < nrLines; l++)
{
for (int i = 0; i < lineSize; i++)
{
labels[dest] = labels[l * lineSize + l * gap + i];
pulsesCountTextBox[dest] = pulsesCountTextBox[l * lineSize + l * gap + i];
rects[dest] = rects[l * lineSize + l * gap + i];
dest++;
}
}
textBoxesCount = wmsCount;
}
}
void Localize()
{
Text = Strings.Water_Meter_States;
for (int i = 0; i < textBoxesCount; i++)
{
labels[i].Text = string.Format("WM{0} {1}", i + 1, Strings.Pulses_);
}
okButton.Text = Strings.OkBtnText;
}
private void WMPulsesForm24_Load(object sender, EventArgs e)
{
Localize();
//Height = 50 + 90 * WaterMetersCount;
for (int i = 0; i < textBoxesCount; i++)
{
labels[i].Visible = pulsesCountTextBox[i].Visible = (disabled == null || i >= disabled.Length || !disabled[i]);
}
Redraw();
for (int i = 0; i < textBoxesCount; i++) pulsesCountTextBox[i].Text = "---";
}
private void okButton_Click(object sender, EventArgs e)
{
completed = true;
Close();
}
void OnPulsesTestInProgress(object sender, UiBridge.PulsesTestInProgressEventArgs args)
{
string testName = args.TestName;
limitLo = args.LimitLo;
Results.Entities.TestRslt tr = TBF.BenchControl.Sequences.ProcessData.BatchRslts.GetTestRslt(testName, 0);
int count = Math.Min(waterMetersCount, TBF.BenchControl.Sequences.ProcessData.BatchRslts.WMPositionsCount);
for (int i = 0; i < count; i++)
{
Results.Entities.MeterTestRslt mtr = TBF.BenchControl.Sequences.ProcessData.BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.Single);
if (mtr != null) pulsesCount[i] = mtr.PulsesMeter;
}
Redraw();
}
void Redraw()
{
for (int i = 0; i < textBoxesCount; i++)
{
pulsesCountTextBox[i].Text = pulsesCount[i].ToString("F0");
Invalidate(rects[i]);
}
}
private void WMPulsesForm24_Paint(object sender, PaintEventArgs e)
{
System.Drawing.Graphics graphics = this.CreateGraphics();
for (int i = 0; i < waterMetersCount; i++)
{
if (!disabled[i])
{
PaintOne(graphics, rects[i], pulsesCount[i], limitLo);
}
}
}
void PaintOne(System.Drawing.Graphics g, Rectangle r, double value, double limLo)
{
Rectangle rect1 = new Rectangle(r.Left, r.Top, r.Width / 3, r.Height);
Rectangle rect2 = new Rectangle(r.Left + r.Width / 3, r.Top, r.Width / 3, r.Height);
Rectangle rect3 = new Rectangle(r.Left + 2 * (r.Width / 3), r.Top, r.Width / 3, r.Height);
Brush redBrush = new SolidBrush(Color.FromName("Salmon"));
Brush greenBrush = new SolidBrush(Color.FromName("LightGreen"));
Brush centBrush = new SolidBrush(Color.FromName("Green"));
if (value >= limLo)
{
g.FillRectangle(greenBrush, rect2);
}
else
{
g.FillRectangle(redBrush, rect2);
}
}
#region Forced close handling
public void StartForceCloseHandler()
{
UiBridge.Bridge.CloseModelessFormHandler += delegate(object sender, EventArgs args)
{
if (InvokeRequired) { Invoke(new EventHandler<EventArgs>(OnForceClose), sender, args); }
else OnForceClose(sender, args);
};
}
void OnForceClose(object sender, EventArgs args)
{
DialogResult = DialogResult.Cancel;
Close();
}
#endregion
}
}
@@ -1,697 +0,0 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
namespace TBF.BenchControl.TestMethods.PulsesTest
{
partial class WMPulsesForm24
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.wmPulsesCountTextBox2 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel2 = new System.Windows.Forms.Label();
this.wmPulsesCountLabel1 = new System.Windows.Forms.Label();
this.okButton = new System.Windows.Forms.Button();
this.wmPulsesCountTextBox3 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel3 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox4 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel4 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox5 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel5 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox6 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel6 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox1 = new System.Windows.Forms.TextBox();
this.wmPulsesCountTextBox7 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel7 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox8 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel8 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox9 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel9 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox10 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel10 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox12 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel12 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox11 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel11 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox24 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel24 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox23 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel23 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox22 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel22 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox21 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel21 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox20 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel20 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox19 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel19 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox18 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel18 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox17 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel17 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox16 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel16 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox15 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel15 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox14 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel14 = new System.Windows.Forms.Label();
this.wmPulsesCountTextBox13 = new System.Windows.Forms.TextBox();
this.wmPulsesCountLabel13 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// wmPulsesCountTextBox2
//
this.wmPulsesCountTextBox2.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox2.Location = new System.Drawing.Point(198, 74);
this.wmPulsesCountTextBox2.Name = "wmPulsesCountTextBox2";
this.wmPulsesCountTextBox2.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox2.TabIndex = 1;
this.wmPulsesCountTextBox2.Visible = false;
//
// wmPulsesCountLabel2
//
this.wmPulsesCountLabel2.AutoSize = true;
this.wmPulsesCountLabel2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel2.Location = new System.Drawing.Point(33, 85);
this.wmPulsesCountLabel2.Name = "wmPulsesCountLabel2";
this.wmPulsesCountLabel2.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel2.TabIndex = 0;
this.wmPulsesCountLabel2.Text = "Pulses count";
this.wmPulsesCountLabel2.Visible = false;
//
// wmPulsesCountLabel1
//
this.wmPulsesCountLabel1.AutoSize = true;
this.wmPulsesCountLabel1.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel1.Location = new System.Drawing.Point(33, 39);
this.wmPulsesCountLabel1.Name = "wmPulsesCountLabel1";
this.wmPulsesCountLabel1.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel1.TabIndex = 0;
this.wmPulsesCountLabel1.Text = "Pulses count";
this.wmPulsesCountLabel1.Visible = false;
//
// okButton
//
this.okButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.okButton.ForeColor = System.Drawing.Color.Black;
this.okButton.Location = new System.Drawing.Point(1157, 28);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(98, 63);
this.okButton.TabIndex = 7;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// wmPulsesCountTextBox3
//
this.wmPulsesCountTextBox3.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox3.Location = new System.Drawing.Point(198, 120);
this.wmPulsesCountTextBox3.Name = "wmPulsesCountTextBox3";
this.wmPulsesCountTextBox3.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox3.TabIndex = 1;
this.wmPulsesCountTextBox3.Visible = false;
//
// wmPulsesCountLabel3
//
this.wmPulsesCountLabel3.AutoSize = true;
this.wmPulsesCountLabel3.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel3.Location = new System.Drawing.Point(33, 131);
this.wmPulsesCountLabel3.Name = "wmPulsesCountLabel3";
this.wmPulsesCountLabel3.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel3.TabIndex = 0;
this.wmPulsesCountLabel3.Text = "Pulses count";
this.wmPulsesCountLabel3.Visible = false;
//
// wmPulsesCountTextBox4
//
this.wmPulsesCountTextBox4.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox4.Location = new System.Drawing.Point(198, 166);
this.wmPulsesCountTextBox4.Name = "wmPulsesCountTextBox4";
this.wmPulsesCountTextBox4.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox4.TabIndex = 1;
this.wmPulsesCountTextBox4.Visible = false;
//
// wmPulsesCountLabel4
//
this.wmPulsesCountLabel4.AutoSize = true;
this.wmPulsesCountLabel4.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel4.Location = new System.Drawing.Point(33, 177);
this.wmPulsesCountLabel4.Name = "wmPulsesCountLabel4";
this.wmPulsesCountLabel4.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel4.TabIndex = 0;
this.wmPulsesCountLabel4.Text = "Pulses count";
this.wmPulsesCountLabel4.Visible = false;
//
// wmPulsesCountTextBox5
//
this.wmPulsesCountTextBox5.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox5.Location = new System.Drawing.Point(198, 213);
this.wmPulsesCountTextBox5.Name = "wmPulsesCountTextBox5";
this.wmPulsesCountTextBox5.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox5.TabIndex = 1;
this.wmPulsesCountTextBox5.Visible = false;
//
// wmPulsesCountLabel5
//
this.wmPulsesCountLabel5.AutoSize = true;
this.wmPulsesCountLabel5.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel5.Location = new System.Drawing.Point(33, 224);
this.wmPulsesCountLabel5.Name = "wmPulsesCountLabel5";
this.wmPulsesCountLabel5.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel5.TabIndex = 0;
this.wmPulsesCountLabel5.Text = "Pulses count";
this.wmPulsesCountLabel5.Visible = false;
//
// wmPulsesCountTextBox6
//
this.wmPulsesCountTextBox6.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox6.Location = new System.Drawing.Point(198, 259);
this.wmPulsesCountTextBox6.Name = "wmPulsesCountTextBox6";
this.wmPulsesCountTextBox6.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox6.TabIndex = 1;
this.wmPulsesCountTextBox6.Visible = false;
//
// wmPulsesCountLabel6
//
this.wmPulsesCountLabel6.AutoSize = true;
this.wmPulsesCountLabel6.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel6.Location = new System.Drawing.Point(33, 271);
this.wmPulsesCountLabel6.Name = "wmPulsesCountLabel6";
this.wmPulsesCountLabel6.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel6.TabIndex = 0;
this.wmPulsesCountLabel6.Text = "Pulses count";
this.wmPulsesCountLabel6.Visible = false;
//
// wmPulsesCountTextBox1
//
this.wmPulsesCountTextBox1.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox1.Location = new System.Drawing.Point(198, 28);
this.wmPulsesCountTextBox1.Name = "wmPulsesCountTextBox1";
this.wmPulsesCountTextBox1.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox1.TabIndex = 1;
this.wmPulsesCountTextBox1.Visible = false;
//
// wmPulsesCountTextBox7
//
this.wmPulsesCountTextBox7.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox7.Location = new System.Drawing.Point(198, 305);
this.wmPulsesCountTextBox7.Name = "wmPulsesCountTextBox7";
this.wmPulsesCountTextBox7.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox7.TabIndex = 9;
this.wmPulsesCountTextBox7.Visible = false;
//
// wmPulsesCountLabel7
//
this.wmPulsesCountLabel7.AutoSize = true;
this.wmPulsesCountLabel7.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel7.Location = new System.Drawing.Point(33, 317);
this.wmPulsesCountLabel7.Name = "wmPulsesCountLabel7";
this.wmPulsesCountLabel7.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel7.TabIndex = 8;
this.wmPulsesCountLabel7.Text = "Pulses count";
this.wmPulsesCountLabel7.Visible = false;
//
// wmPulsesCountTextBox8
//
this.wmPulsesCountTextBox8.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox8.Location = new System.Drawing.Point(198, 351);
this.wmPulsesCountTextBox8.Name = "wmPulsesCountTextBox8";
this.wmPulsesCountTextBox8.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox8.TabIndex = 11;
this.wmPulsesCountTextBox8.Visible = false;
//
// wmPulsesCountLabel8
//
this.wmPulsesCountLabel8.AutoSize = true;
this.wmPulsesCountLabel8.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel8.Location = new System.Drawing.Point(33, 363);
this.wmPulsesCountLabel8.Name = "wmPulsesCountLabel8";
this.wmPulsesCountLabel8.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel8.TabIndex = 10;
this.wmPulsesCountLabel8.Text = "Pulses count";
this.wmPulsesCountLabel8.Visible = false;
//
// wmPulsesCountTextBox9
//
this.wmPulsesCountTextBox9.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox9.Location = new System.Drawing.Point(198, 397);
this.wmPulsesCountTextBox9.Name = "wmPulsesCountTextBox9";
this.wmPulsesCountTextBox9.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox9.TabIndex = 13;
this.wmPulsesCountTextBox9.Visible = false;
//
// wmPulsesCountLabel9
//
this.wmPulsesCountLabel9.AutoSize = true;
this.wmPulsesCountLabel9.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel9.Location = new System.Drawing.Point(33, 408);
this.wmPulsesCountLabel9.Name = "wmPulsesCountLabel9";
this.wmPulsesCountLabel9.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel9.TabIndex = 12;
this.wmPulsesCountLabel9.Text = "Pulses count";
this.wmPulsesCountLabel9.Visible = false;
//
// wmPulsesCountTextBox10
//
this.wmPulsesCountTextBox10.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox10.Location = new System.Drawing.Point(198, 443);
this.wmPulsesCountTextBox10.Name = "wmPulsesCountTextBox10";
this.wmPulsesCountTextBox10.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox10.TabIndex = 15;
this.wmPulsesCountTextBox10.Visible = false;
//
// wmPulsesCountLabel10
//
this.wmPulsesCountLabel10.AutoSize = true;
this.wmPulsesCountLabel10.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel10.Location = new System.Drawing.Point(33, 454);
this.wmPulsesCountLabel10.Name = "wmPulsesCountLabel10";
this.wmPulsesCountLabel10.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel10.TabIndex = 14;
this.wmPulsesCountLabel10.Text = "Pulses count";
this.wmPulsesCountLabel10.Visible = false;
//
// wmPulsesCountTextBox12
//
this.wmPulsesCountTextBox12.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox12.Location = new System.Drawing.Point(198, 535);
this.wmPulsesCountTextBox12.Name = "wmPulsesCountTextBox12";
this.wmPulsesCountTextBox12.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox12.TabIndex = 19;
this.wmPulsesCountTextBox12.Visible = false;
//
// wmPulsesCountLabel12
//
this.wmPulsesCountLabel12.AutoSize = true;
this.wmPulsesCountLabel12.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel12.Location = new System.Drawing.Point(33, 546);
this.wmPulsesCountLabel12.Name = "wmPulsesCountLabel12";
this.wmPulsesCountLabel12.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel12.TabIndex = 18;
this.wmPulsesCountLabel12.Text = "Pulses count";
this.wmPulsesCountLabel12.Visible = false;
//
// wmPulsesCountTextBox11
//
this.wmPulsesCountTextBox11.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox11.Location = new System.Drawing.Point(198, 489);
this.wmPulsesCountTextBox11.Name = "wmPulsesCountTextBox11";
this.wmPulsesCountTextBox11.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox11.TabIndex = 17;
this.wmPulsesCountTextBox11.Visible = false;
//
// wmPulsesCountLabel11
//
this.wmPulsesCountLabel11.AutoSize = true;
this.wmPulsesCountLabel11.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel11.Location = new System.Drawing.Point(33, 500);
this.wmPulsesCountLabel11.Name = "wmPulsesCountLabel11";
this.wmPulsesCountLabel11.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel11.TabIndex = 16;
this.wmPulsesCountLabel11.Text = "Pulses count";
this.wmPulsesCountLabel11.Visible = false;
//
// wmPulsesCountTextBox24
//
this.wmPulsesCountTextBox24.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox24.Location = new System.Drawing.Point(754, 535);
this.wmPulsesCountTextBox24.Name = "wmPulsesCountTextBox24";
this.wmPulsesCountTextBox24.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox24.TabIndex = 43;
this.wmPulsesCountTextBox24.Visible = false;
//
// wmPulsesCountLabel24
//
this.wmPulsesCountLabel24.AutoSize = true;
this.wmPulsesCountLabel24.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel24.Location = new System.Drawing.Point(589, 546);
this.wmPulsesCountLabel24.Name = "wmPulsesCountLabel24";
this.wmPulsesCountLabel24.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel24.TabIndex = 42;
this.wmPulsesCountLabel24.Text = "Pulses count";
this.wmPulsesCountLabel24.Visible = false;
//
// wmPulsesCountTextBox23
//
this.wmPulsesCountTextBox23.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox23.Location = new System.Drawing.Point(754, 489);
this.wmPulsesCountTextBox23.Name = "wmPulsesCountTextBox23";
this.wmPulsesCountTextBox23.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox23.TabIndex = 41;
this.wmPulsesCountTextBox23.Visible = false;
//
// wmPulsesCountLabel23
//
this.wmPulsesCountLabel23.AutoSize = true;
this.wmPulsesCountLabel23.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel23.Location = new System.Drawing.Point(589, 500);
this.wmPulsesCountLabel23.Name = "wmPulsesCountLabel23";
this.wmPulsesCountLabel23.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel23.TabIndex = 40;
this.wmPulsesCountLabel23.Text = "Pulses count";
this.wmPulsesCountLabel23.Visible = false;
//
// wmPulsesCountTextBox22
//
this.wmPulsesCountTextBox22.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox22.Location = new System.Drawing.Point(754, 443);
this.wmPulsesCountTextBox22.Name = "wmPulsesCountTextBox22";
this.wmPulsesCountTextBox22.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox22.TabIndex = 39;
this.wmPulsesCountTextBox22.Visible = false;
//
// wmPulsesCountLabel22
//
this.wmPulsesCountLabel22.AutoSize = true;
this.wmPulsesCountLabel22.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel22.Location = new System.Drawing.Point(589, 454);
this.wmPulsesCountLabel22.Name = "wmPulsesCountLabel22";
this.wmPulsesCountLabel22.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel22.TabIndex = 38;
this.wmPulsesCountLabel22.Text = "Pulses count";
this.wmPulsesCountLabel22.Visible = false;
//
// wmPulsesCountTextBox21
//
this.wmPulsesCountTextBox21.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox21.Location = new System.Drawing.Point(754, 397);
this.wmPulsesCountTextBox21.Name = "wmPulsesCountTextBox21";
this.wmPulsesCountTextBox21.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox21.TabIndex = 37;
this.wmPulsesCountTextBox21.Visible = false;
//
// wmPulsesCountLabel21
//
this.wmPulsesCountLabel21.AutoSize = true;
this.wmPulsesCountLabel21.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel21.Location = new System.Drawing.Point(589, 408);
this.wmPulsesCountLabel21.Name = "wmPulsesCountLabel21";
this.wmPulsesCountLabel21.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel21.TabIndex = 36;
this.wmPulsesCountLabel21.Text = "Pulses count";
this.wmPulsesCountLabel21.Visible = false;
//
// wmPulsesCountTextBox20
//
this.wmPulsesCountTextBox20.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox20.Location = new System.Drawing.Point(754, 351);
this.wmPulsesCountTextBox20.Name = "wmPulsesCountTextBox20";
this.wmPulsesCountTextBox20.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox20.TabIndex = 35;
this.wmPulsesCountTextBox20.Visible = false;
//
// wmPulsesCountLabel20
//
this.wmPulsesCountLabel20.AutoSize = true;
this.wmPulsesCountLabel20.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel20.Location = new System.Drawing.Point(589, 363);
this.wmPulsesCountLabel20.Name = "wmPulsesCountLabel20";
this.wmPulsesCountLabel20.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel20.TabIndex = 34;
this.wmPulsesCountLabel20.Text = "Pulses count";
this.wmPulsesCountLabel20.Visible = false;
//
// wmPulsesCountTextBox19
//
this.wmPulsesCountTextBox19.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox19.Location = new System.Drawing.Point(754, 305);
this.wmPulsesCountTextBox19.Name = "wmPulsesCountTextBox19";
this.wmPulsesCountTextBox19.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox19.TabIndex = 33;
this.wmPulsesCountTextBox19.Visible = false;
//
// wmPulsesCountLabel19
//
this.wmPulsesCountLabel19.AutoSize = true;
this.wmPulsesCountLabel19.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel19.Location = new System.Drawing.Point(589, 317);
this.wmPulsesCountLabel19.Name = "wmPulsesCountLabel19";
this.wmPulsesCountLabel19.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel19.TabIndex = 32;
this.wmPulsesCountLabel19.Text = "Pulses count";
this.wmPulsesCountLabel19.Visible = false;
//
// wmPulsesCountTextBox18
//
this.wmPulsesCountTextBox18.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox18.Location = new System.Drawing.Point(754, 259);
this.wmPulsesCountTextBox18.Name = "wmPulsesCountTextBox18";
this.wmPulsesCountTextBox18.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox18.TabIndex = 27;
this.wmPulsesCountTextBox18.Visible = false;
//
// wmPulsesCountLabel18
//
this.wmPulsesCountLabel18.AutoSize = true;
this.wmPulsesCountLabel18.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel18.Location = new System.Drawing.Point(589, 271);
this.wmPulsesCountLabel18.Name = "wmPulsesCountLabel18";
this.wmPulsesCountLabel18.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel18.TabIndex = 23;
this.wmPulsesCountLabel18.Text = "Pulses count";
this.wmPulsesCountLabel18.Visible = false;
//
// wmPulsesCountTextBox17
//
this.wmPulsesCountTextBox17.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox17.Location = new System.Drawing.Point(754, 213);
this.wmPulsesCountTextBox17.Name = "wmPulsesCountTextBox17";
this.wmPulsesCountTextBox17.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox17.TabIndex = 26;
this.wmPulsesCountTextBox17.Visible = false;
//
// wmPulsesCountLabel17
//
this.wmPulsesCountLabel17.AutoSize = true;
this.wmPulsesCountLabel17.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel17.Location = new System.Drawing.Point(589, 224);
this.wmPulsesCountLabel17.Name = "wmPulsesCountLabel17";
this.wmPulsesCountLabel17.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel17.TabIndex = 22;
this.wmPulsesCountLabel17.Text = "Pulses count";
this.wmPulsesCountLabel17.Visible = false;
//
// wmPulsesCountTextBox16
//
this.wmPulsesCountTextBox16.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox16.Location = new System.Drawing.Point(754, 166);
this.wmPulsesCountTextBox16.Name = "wmPulsesCountTextBox16";
this.wmPulsesCountTextBox16.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox16.TabIndex = 30;
this.wmPulsesCountTextBox16.Visible = false;
//
// wmPulsesCountLabel16
//
this.wmPulsesCountLabel16.AutoSize = true;
this.wmPulsesCountLabel16.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel16.Location = new System.Drawing.Point(589, 177);
this.wmPulsesCountLabel16.Name = "wmPulsesCountLabel16";
this.wmPulsesCountLabel16.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel16.TabIndex = 21;
this.wmPulsesCountLabel16.Text = "Pulses count";
this.wmPulsesCountLabel16.Visible = false;
//
// wmPulsesCountTextBox15
//
this.wmPulsesCountTextBox15.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox15.Location = new System.Drawing.Point(754, 120);
this.wmPulsesCountTextBox15.Name = "wmPulsesCountTextBox15";
this.wmPulsesCountTextBox15.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox15.TabIndex = 31;
this.wmPulsesCountTextBox15.Visible = false;
//
// wmPulsesCountLabel15
//
this.wmPulsesCountLabel15.AutoSize = true;
this.wmPulsesCountLabel15.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel15.Location = new System.Drawing.Point(589, 131);
this.wmPulsesCountLabel15.Name = "wmPulsesCountLabel15";
this.wmPulsesCountLabel15.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel15.TabIndex = 20;
this.wmPulsesCountLabel15.Text = "Pulses count";
this.wmPulsesCountLabel15.Visible = false;
//
// wmPulsesCountTextBox14
//
this.wmPulsesCountTextBox14.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox14.Location = new System.Drawing.Point(754, 74);
this.wmPulsesCountTextBox14.Name = "wmPulsesCountTextBox14";
this.wmPulsesCountTextBox14.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox14.TabIndex = 28;
this.wmPulsesCountTextBox14.Visible = false;
//
// wmPulsesCountLabel14
//
this.wmPulsesCountLabel14.AutoSize = true;
this.wmPulsesCountLabel14.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel14.Location = new System.Drawing.Point(589, 85);
this.wmPulsesCountLabel14.Name = "wmPulsesCountLabel14";
this.wmPulsesCountLabel14.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel14.TabIndex = 25;
this.wmPulsesCountLabel14.Text = "Pulses count";
this.wmPulsesCountLabel14.Visible = false;
//
// wmPulsesCountTextBox13
//
this.wmPulsesCountTextBox13.Font = new System.Drawing.Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountTextBox13.Location = new System.Drawing.Point(754, 28);
this.wmPulsesCountTextBox13.Name = "wmPulsesCountTextBox13";
this.wmPulsesCountTextBox13.Size = new System.Drawing.Size(137, 40);
this.wmPulsesCountTextBox13.TabIndex = 29;
this.wmPulsesCountTextBox13.Visible = false;
//
// wmPulsesCountLabel13
//
this.wmPulsesCountLabel13.AutoSize = true;
this.wmPulsesCountLabel13.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.wmPulsesCountLabel13.Location = new System.Drawing.Point(589, 39);
this.wmPulsesCountLabel13.Name = "wmPulsesCountLabel13";
this.wmPulsesCountLabel13.Size = new System.Drawing.Size(130, 23);
this.wmPulsesCountLabel13.TabIndex = 24;
this.wmPulsesCountLabel13.Text = "Pulses count";
this.wmPulsesCountLabel13.Visible = false;
//
// WMPulsesForm24
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.DarkGoldenrod;
this.ClientSize = new System.Drawing.Size(1267, 592);
this.Controls.Add(this.wmPulsesCountTextBox24);
this.Controls.Add(this.wmPulsesCountLabel24);
this.Controls.Add(this.wmPulsesCountTextBox23);
this.Controls.Add(this.wmPulsesCountLabel23);
this.Controls.Add(this.wmPulsesCountTextBox22);
this.Controls.Add(this.wmPulsesCountLabel22);
this.Controls.Add(this.wmPulsesCountTextBox21);
this.Controls.Add(this.wmPulsesCountLabel21);
this.Controls.Add(this.wmPulsesCountTextBox20);
this.Controls.Add(this.wmPulsesCountLabel20);
this.Controls.Add(this.wmPulsesCountTextBox19);
this.Controls.Add(this.wmPulsesCountLabel19);
this.Controls.Add(this.wmPulsesCountTextBox18);
this.Controls.Add(this.wmPulsesCountLabel18);
this.Controls.Add(this.wmPulsesCountTextBox17);
this.Controls.Add(this.wmPulsesCountLabel17);
this.Controls.Add(this.wmPulsesCountTextBox16);
this.Controls.Add(this.wmPulsesCountLabel16);
this.Controls.Add(this.wmPulsesCountTextBox15);
this.Controls.Add(this.wmPulsesCountLabel15);
this.Controls.Add(this.wmPulsesCountTextBox14);
this.Controls.Add(this.wmPulsesCountLabel14);
this.Controls.Add(this.wmPulsesCountTextBox13);
this.Controls.Add(this.wmPulsesCountLabel13);
this.Controls.Add(this.wmPulsesCountTextBox12);
this.Controls.Add(this.wmPulsesCountLabel12);
this.Controls.Add(this.wmPulsesCountTextBox11);
this.Controls.Add(this.wmPulsesCountLabel11);
this.Controls.Add(this.wmPulsesCountTextBox10);
this.Controls.Add(this.wmPulsesCountLabel10);
this.Controls.Add(this.wmPulsesCountTextBox9);
this.Controls.Add(this.wmPulsesCountLabel9);
this.Controls.Add(this.wmPulsesCountTextBox8);
this.Controls.Add(this.wmPulsesCountLabel8);
this.Controls.Add(this.wmPulsesCountTextBox7);
this.Controls.Add(this.wmPulsesCountLabel7);
this.Controls.Add(this.wmPulsesCountTextBox6);
this.Controls.Add(this.wmPulsesCountLabel6);
this.Controls.Add(this.wmPulsesCountTextBox5);
this.Controls.Add(this.wmPulsesCountLabel5);
this.Controls.Add(this.wmPulsesCountTextBox4);
this.Controls.Add(this.wmPulsesCountLabel4);
this.Controls.Add(this.wmPulsesCountTextBox3);
this.Controls.Add(this.wmPulsesCountLabel3);
this.Controls.Add(this.wmPulsesCountTextBox2);
this.Controls.Add(this.wmPulsesCountLabel2);
this.Controls.Add(this.wmPulsesCountTextBox1);
this.Controls.Add(this.wmPulsesCountLabel1);
this.Controls.Add(this.okButton);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "WMPulsesForm24";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Text = "Water Meter States";
this.TopMost = true;
this.Load += new System.EventHandler(this.WMPulsesForm24_Load);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.WMPulsesForm24_Paint);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox wmPulsesCountTextBox2;
private System.Windows.Forms.Label wmPulsesCountLabel2;
private System.Windows.Forms.Label wmPulsesCountLabel1;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.TextBox wmPulsesCountTextBox3;
private System.Windows.Forms.Label wmPulsesCountLabel3;
private System.Windows.Forms.TextBox wmPulsesCountTextBox4;
private System.Windows.Forms.Label wmPulsesCountLabel4;
private System.Windows.Forms.TextBox wmPulsesCountTextBox5;
private System.Windows.Forms.Label wmPulsesCountLabel5;
private System.Windows.Forms.TextBox wmPulsesCountTextBox6;
private System.Windows.Forms.Label wmPulsesCountLabel6;
private System.Windows.Forms.TextBox wmPulsesCountTextBox1;
private System.Windows.Forms.TextBox wmPulsesCountTextBox7;
private System.Windows.Forms.Label wmPulsesCountLabel7;
private System.Windows.Forms.TextBox wmPulsesCountTextBox8;
private System.Windows.Forms.Label wmPulsesCountLabel8;
private System.Windows.Forms.TextBox wmPulsesCountTextBox9;
private System.Windows.Forms.Label wmPulsesCountLabel9;
private System.Windows.Forms.TextBox wmPulsesCountTextBox10;
private System.Windows.Forms.Label wmPulsesCountLabel10;
private System.Windows.Forms.TextBox wmPulsesCountTextBox12;
private System.Windows.Forms.Label wmPulsesCountLabel12;
private System.Windows.Forms.TextBox wmPulsesCountTextBox11;
private System.Windows.Forms.Label wmPulsesCountLabel11;
private System.Windows.Forms.TextBox wmPulsesCountTextBox24;
private System.Windows.Forms.Label wmPulsesCountLabel24;
private System.Windows.Forms.TextBox wmPulsesCountTextBox23;
private System.Windows.Forms.Label wmPulsesCountLabel23;
private System.Windows.Forms.TextBox wmPulsesCountTextBox22;
private System.Windows.Forms.Label wmPulsesCountLabel22;
private System.Windows.Forms.TextBox wmPulsesCountTextBox21;
private System.Windows.Forms.Label wmPulsesCountLabel21;
private System.Windows.Forms.TextBox wmPulsesCountTextBox20;
private System.Windows.Forms.Label wmPulsesCountLabel20;
private System.Windows.Forms.TextBox wmPulsesCountTextBox19;
private System.Windows.Forms.Label wmPulsesCountLabel19;
private System.Windows.Forms.TextBox wmPulsesCountTextBox18;
private System.Windows.Forms.Label wmPulsesCountLabel18;
private System.Windows.Forms.TextBox wmPulsesCountTextBox17;
private System.Windows.Forms.Label wmPulsesCountLabel17;
private System.Windows.Forms.TextBox wmPulsesCountTextBox16;
private System.Windows.Forms.Label wmPulsesCountLabel16;
private System.Windows.Forms.TextBox wmPulsesCountTextBox15;
private System.Windows.Forms.Label wmPulsesCountLabel15;
private System.Windows.Forms.TextBox wmPulsesCountTextBox14;
private System.Windows.Forms.Label wmPulsesCountLabel14;
private System.Windows.Forms.TextBox wmPulsesCountTextBox13;
private System.Windows.Forms.Label wmPulsesCountLabel13;
}
}
@@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -1,8 +1,9 @@
///
/// Copyright (c) 2017-2018 Sensus Slovensko a.s.
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Text;
using log4net;
using Results.Entities;
using TBF.BenchControl.Sequences;
@@ -76,7 +77,7 @@ namespace TBF.BenchControl.Various.ErrorFlags
bool E10 = false;
if (diverter)
{
E9 = (Math.Abs(switchTimeStart - switchTimeEnd) > errorsCfg.TestParams.Coef_E9 * (switchTimeStart + switchTimeEnd) + errorsCfg.TestParams.Offset_E9);
E9 = (Math.Abs(switchTimeStart - switchTimeEnd) > errorsCfg.TestParams.Coef_E9 * (switchTimeStart + switchTimeEnd));
E10 = ((switchTimeStart + switchTimeEnd) > errorsCfg.TestParams.Coef_E10 * testRslt.TestTime);
}
@@ -85,7 +86,7 @@ namespace TBF.BenchControl.Various.ErrorFlags
if (startStopValve)
{
E11 = ((switchTimeStart + switchTimeEnd) > errorsCfg.TestParams.Coef_E11 * testRslt.TestTime);
E12 = (Math.Abs(switchTimeStart - switchTimeEnd) > errorsCfg.TestParams.Coef_E12 * (switchTimeStart + switchTimeEnd) + errorsCfg.TestParams.Offset_E12);
E12 = (Math.Abs(switchTimeStart - switchTimeEnd) > errorsCfg.TestParams.Coef_E12 * (switchTimeStart + switchTimeEnd));
}
/// Ambient temperature
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2017-2018 Sensus Slovensko a.s.
/// Copyright (c) 2017 Sensus Metering Systems
///
using System.IO;
using System.Xml.Serialization;
@@ -47,8 +47,6 @@ namespace TBF.BenchControl.Various.ErrorFlags
public float Coef_E10; /// Coefficient used in E10, default 0.04
public float Coef_E11; /// Coefficient used in E11, default 0.1
public float Coef_E12; /// Coefficient used in E12, default 1
public float Offset_E9; /// [s] default 0 (no offset)
public float Offset_E12; /// [s] default 0 (no offset)
public override void InitializeAll()
{
@@ -104,9 +102,7 @@ namespace TBF.BenchControl.Various.ErrorFlags
Coef_E10 = 0.04f;
Coef_E11 = 0.1f;
Coef_E12 = 1.0f;
Offset_E9 = 0; /// [s]
Offset_E12 = 0; /// [s]
}
}
string[] paramNames = new string[]
{
@@ -142,9 +138,7 @@ namespace TBF.BenchControl.Various.ErrorFlags
"Coef.E9",
"Coef.E10",
"Coef.E11",
"Coef.E12",
"Offset E9 [s]",
"Offset E12 [s]",
"Coef.E12"
};
public override string ParamName(int i) { return paramNames[i]; }
public override int ParamsCount() { return paramNames.Length; }
@@ -185,8 +179,6 @@ namespace TBF.BenchControl.Various.ErrorFlags
case 28: return Coef_E10.ToString();
case 29: return Coef_E11.ToString();
case 30: return Coef_E12.ToString();
case 31: return Offset_E9.ToString();
case 32: return Offset_E12.ToString();
default: return string.Empty;
}
@@ -238,8 +230,6 @@ namespace TBF.BenchControl.Various.ErrorFlags
case 28: Coef_E10 = Utils.ParseUFloat(strValue); return CfgUpdateFlags.None;
case 29: Coef_E11 = Utils.ParseUFloat(strValue); return CfgUpdateFlags.None;
case 30: Coef_E12 = Utils.ParseUFloat(strValue); return CfgUpdateFlags.None;
case 31: Offset_E9 = Utils.ParseUFloat(strValue); return CfgUpdateFlags.None;
case 32: Offset_E12 = Utils.ParseUFloat(strValue); return CfgUpdateFlags.None;
default: return CfgUpdateFlags.None;
}
@@ -293,8 +283,6 @@ namespace TBF.BenchControl.Various.ErrorFlags
case 28:
case 29:
case 30:
case 31:
case 32:
if (Utils.TryParseUFloat(strValue, out fdummy)) return true;
break;
@@ -341,9 +329,7 @@ namespace TBF.BenchControl.Various.ErrorFlags
prms.Coef_E10 = this.Coef_E10;
prms.Coef_E11 = this.Coef_E11;
prms.Coef_E12 = this.Coef_E12;
prms.Offset_E9 = this.Offset_E9;
prms.Offset_E12 = this.Offset_E12;
}
}
public IParamsProvider Clone()
{
+17 -10
View File
@@ -188,28 +188,35 @@ namespace TBF
void DrawOne(Component cmpnt)
{
ListViewItem lvi = new ListViewItem(cmpnt.Name);
lvi.Tag = cmpnt;
lvi.SubItems.Add(string.IsNullOrEmpty(cmpnt.ClassName) ? string.Empty : cmpnt.ClassName);
lvi.SubItems.Add(string.IsNullOrEmpty(cmpnt.ParentName) ? string.Empty : cmpnt.ParentName);
IComponentCfg cmpCfg = TbfComponents.CmpntCfgFromCmpntEntity(cmpnt);
IComponentCfg cmpCfg = TbfComponents.CmpntCfgFromCmpntEntity(cmpnt);
if (cmpCfg != null)
if (cmpCfg != null)
{
lvi.SubItems.Add(cmpCfg.DebugLevel.ToDescription());
ListViewItem lvi = new ListViewItem(cmpCfg.Name);
lvi.SubItems.Add(cmpCfg.Factory.ClassName);
lvi.SubItems.Add(cmpCfg.ParentName);
lvi.SubItems.Add(cmpCfg.DebugLevel.ToDescription());
lvi.SubItems.Add(cmpCfg.LogLevel.ToDescription());
lvi.SubItems.Add(cmpCfg.ToString(1));
lvi.Tag = cmpnt;
listViewEx.Items.Add(lvi);
}
else
{
ListViewItem lvi = new ListViewItem(cmpnt.Name);
lvi.SubItems.Add(string.IsNullOrEmpty(cmpnt.ClassName) ? string.Empty : cmpnt.ClassName);
lvi.SubItems.Add(string.IsNullOrEmpty(cmpnt.ParentName) ? string.Empty : cmpnt.ParentName);
lvi.SubItems.Add("---");
lvi.SubItems.Add("---");
lvi.SubItems.Add("Not a component");
}
listViewEx.Items.Add(lvi);
}
lvi.Tag = cmpnt;
listViewEx.Items.Add(lvi);
}
}
///
/// Save DB changes, return true when DB changes saved OK
+11 -11
View File
@@ -41,7 +41,7 @@
this.label2 = new System.Windows.Forms.Label();
this.pressureRepresentationButton = new System.Windows.Forms.Button();
this.upgradeDb_24_29_Button = new System.Windows.Forms.Button();
this.upgradeDb_218_220_Button = new System.Windows.Forms.Button();
this.upgradeDb_218_219_Button = new System.Windows.Forms.Button();
this.upgradeDb_NFC_button = new System.Windows.Forms.Button();
this.SuspendLayout();
//
@@ -172,15 +172,15 @@
this.upgradeDb_24_29_Button.UseVisualStyleBackColor = true;
this.upgradeDb_24_29_Button.Click += new System.EventHandler(this.upgradeDb_24_29_Button_Click);
//
// upgradeDb_218_220_Button
// upgradeDb_218_219_Button
//
this.upgradeDb_218_220_Button.Location = new System.Drawing.Point(12, 337);
this.upgradeDb_218_220_Button.Name = "upgradeDb_218_220_Button";
this.upgradeDb_218_220_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_218_220_Button.TabIndex = 9;
this.upgradeDb_218_220_Button.Text = "Upgrade database from ver. 2.18 to ver. 2.20";
this.upgradeDb_218_220_Button.UseVisualStyleBackColor = true;
this.upgradeDb_218_220_Button.Click += new System.EventHandler(this.upgradeDb_218_220_Button_Click);
this.upgradeDb_218_219_Button.Location = new System.Drawing.Point(12, 337);
this.upgradeDb_218_219_Button.Name = "upgradeDb_218_219_Button";
this.upgradeDb_218_219_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_218_219_Button.TabIndex = 9;
this.upgradeDb_218_219_Button.Text = "Upgrade database from ver. 2.18 to ver. 2.19";
this.upgradeDb_218_219_Button.UseVisualStyleBackColor = true;
this.upgradeDb_218_219_Button.Click += new System.EventHandler(this.upgradeDb_218_219_Button_Click);
//
// upgradeDb_NFC_button
//
@@ -198,7 +198,7 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 480);
this.Controls.Add(this.upgradeDb_NFC_button);
this.Controls.Add(this.upgradeDb_218_220_Button);
this.Controls.Add(this.upgradeDb_218_219_Button);
this.Controls.Add(this.upgradeDb_24_29_Button);
this.Controls.Add(this.pressureRepresentationButton);
this.Controls.Add(this.label2);
@@ -234,7 +234,7 @@
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button pressureRepresentationButton;
private System.Windows.Forms.Button upgradeDb_24_29_Button;
private System.Windows.Forms.Button upgradeDb_218_220_Button;
private System.Windows.Forms.Button upgradeDb_218_219_Button;
private System.Windows.Forms.Button upgradeDb_NFC_button;
}
+3 -3
View File
@@ -555,7 +555,7 @@ namespace TBF.Forms
}
///---------------------------------------------------------------------
private void upgradeDb_218_220_Button_Click(object sender, EventArgs e)
private void upgradeDb_218_219_Button_Click(object sender, EventArgs e)
{
if (!upgradeConfigDBCheckBox.Checked && !upgradeResultsDBCheckBox.Checked)
{
@@ -566,7 +566,7 @@ namespace TBF.Forms
string[] commands = new string[]
{
"ALTER TABLE `metertestrslt` ADD `RegReaderType` INT NOT NULL DEFAULT '0' AFTER `CompoundMeterId`;",
"ALTER TABLE `testrslt` ADD `MethodClass` VARCHAR(255) NULL DEFAULT NULL AFTER `RepetitionNr`, ADD `ConstMasterRaw` DOUBLE NOT NULL DEFAULT '1' AFTER `PulsesMaster`, ADD `ConstMasterCorr` DOUBLE NOT NULL DEFAULT '1' AFTER `ConstMasterRaw`;",
"ALTER TABLE `testrslt` ADD `MethodClass` VARCHAR(255) NULL DEFAULT NULL AFTER `RepetitionNr`, ADD `ConstMasterRaw` DOUBLE NOT NULL DEFAULT '1' AFTER `PulsesMaster`;",
"ALTER TABLE `watermeterdata` ADD `Medium` VARCHAR(255) NULL DEFAULT NULL AFTER `ApprovalInfoAux`;",
};
@@ -576,7 +576,7 @@ namespace TBF.Forms
{
ActivityEnd();
MessageBox.Show("DB succesfully upgraded", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
upgradeDb_218_220_Button.Enabled = false;
upgradeDb_218_219_Button.Enabled = false;
}
}
+3 -3
View File
@@ -56,7 +56,7 @@ namespace TBF
this.homeTabPage = new System.Windows.Forms.TabPage();
this.ctrlBrdComponent = new ControlComponent_Torino2015.UserControl1();
this.processTabPage = new System.Windows.Forms.TabPage();
this.processTabPageCtrl = new TBF.Screens.ProcessTabPageCtrl24();
this.processTabPageCtrl = new TBF.Screens.ProcessTabPageCtrl6();
this.insertTabPage = new System.Windows.Forms.TabPage();
this.resultsTabPage = new System.Windows.Forms.TabPage();
this.resultsTabPageCtrl = new TBF.Screens.ResultsTabPageCtrl();
@@ -672,13 +672,13 @@ namespace TBF
#elif FUZHOU300
private ControlComponent3F300.UserControl1 ctrlBrdComponent;
private TBF.Screens.ProcessTabPageCtrl6 processTabPageCtrl;
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200 || CEVAK_200
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200
private ControlComponent_Izrael2014.UserControl1 ctrlBrdComponent;
private TBF.Screens.ProcessTabPageCtrl6 processTabPageCtrl;
#elif TURA_SPECIAL || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || BADGER_VELKA_TRAT || SLM_END || WARSAW_END || RUM_MOB || SENTEC
private ControlComponent_Torino2015.UserControl1 ctrlBrdComponent;
private TBF.Screens.ProcessTabPageCtrl6 processTabPageCtrl;
#elif TORINO50 || TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40 || FUZHOU_40 || MALTA_WSD25 || SLM_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || FUZHOU100 || DUBAJ_50
#elif TORINO50 || TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40 || FUZHOU_40 || MALTA_WSD25 || SLM_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA
private ControlComponent_Torino2015.UserControl1 ctrlBrdComponent;
private TBF.Screens.ProcessTabPageCtrl24 processTabPageCtrl;
#elif TURA_IPERL
+1 -2
View File
@@ -344,7 +344,6 @@ namespace TBF
{
case ActivityEventArgs.Update.Activity:
activityLabel.Text = args.Activity;
if (string.IsNullOrEmpty(messageLabel.Text)) messageLabel.ForeColor = Color.Black;
break;
case ActivityEventArgs.Update.Message:
messageLabel.Text = args.Message;
@@ -621,7 +620,7 @@ namespace TBF
emergencyStopModelessDlg.Visible = false;
}
if (BenchControl.StateMachine.Running && (messageLabel.ForeColor != Color.Red) && CycleRunning)
if (BenchControl.StateMachine.Running && CycleRunning)
{
MessageBox.Show(Strings.Finish_the_session_please, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
if (e is FormClosingEventArgs)
+2 -2
View File
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.18.975.0")]
[assembly: AssemblyFileVersion("2.18.975.0")]
[assembly: AssemblyVersion("2.18.941.0")]
[assembly: AssemblyFileVersion("2.18.941.0")]
-3
View File
@@ -1443,7 +1443,4 @@
<data name="Pressure" xml:space="preserve">
<value>Druck</value>
</data>
<data name="Flow_adjustment_failed" xml:space="preserve">
<value>Durchfluss nicht erreicht</value>
</data>
</root>
+21 -7
View File
@@ -3,25 +3,31 @@
<Language>en</Language>
<TestBenches>
<DatabaseSettings>
<BenchName>Test Bench</BenchName>
<BenchName>SENTEC</BenchName>
<IsRealBench>true</IsRealBench>
<ProceduresDBSettings>
<DbType>MySql</DbType>
<ConnectionString>SERVER=localhost; DATABASE=testbench; UID=root; PASSWORD=; CHARSET=utf8;</ConnectionString>
<ConnectionString>SERVER=localhost; DATABASE=sentec; UID=root; PASSWORD=; CHARSET=utf8;</ConnectionString>
</ProceduresDBSettings>
<WaterMetersDBSettings>
<DbType>MySql</DbType>
<ConnectionString>SERVER=localhost; DATABASE=testbench-r; UID=root; PASSWORD=; CHARSET=utf8;</ConnectionString>
<ConnectionString>SERVER=localhost; DATABASE=sentec-r; UID=root; PASSWORD=; CHARSET=utf8;</ConnectionString>
</WaterMetersDBSettings>
<UsersDBSettings>
<DbType>MySql</DbType>
<ConnectionString />
</UsersDBSettings>
</DatabaseSettings>
</TestBenches>
<LastBench>Test Bench</LastBench>
<LoginMethod>UserName</LoginMethod>
<LastBench>SENTEC</LastBench>
<BatchNr>1</BatchNr>
<RealDensity>988.2008</RealDensity>
<RealDensity>998.2008</RealDensity>
<AtTemperature>20</AtTemperature>
<RightPaneHorizSplitterDistance>25</RightPaneHorizSplitterDistance>
<MainWndLeft>75</MainWndLeft>
<MainWndTop>5</MainWndTop>
<TopPaneVerticalSplitterDistance>596</TopPaneVerticalSplitterDistance>
<MainWndLeft>76</MainWndLeft>
<MainWndTop>21</MainWndTop>
<MainWndWidth>1250</MainWndWidth>
<MainWndHeight>750</MainWndHeight>
<ManiWndMaximized>false</ManiWndMaximized>
@@ -29,6 +35,10 @@
<ComponentsDlgTop>100</ComponentsDlgTop>
<ComponentsDlgWidth>850</ComponentsDlgWidth>
<ComponentsDlgHeight>500</ComponentsDlgHeight>
<PopupResultsLeft>0</PopupResultsLeft>
<PopupResultsTop>0</PopupResultsTop>
<PopupResultsWidth>0</PopupResultsWidth>
<PopupResultsHeight>0</PopupResultsHeight>
<PathsDlgLeft>0</PathsDlgLeft>
<PathsDlgTop>0</PathsDlgTop>
<PathsDlgWidth>0</PathsDlgWidth>
@@ -53,6 +63,10 @@
<OneProcedureDlgHeight>0</OneProcedureDlgHeight>
<PrintOrderLeft>0</PrintOrderLeft>
<PrintOrderTop>0</PrintOrderTop>
<EnduranceDlgLeft>0</EnduranceDlgLeft>
<EnduranceDlgTop>0</EnduranceDlgTop>
<EnduranceDlgWidth>0</EnduranceDlgWidth>
<EnduranceDlgHeight>0</EnduranceDlgHeight>
<PrintOrderOnlyGoodResult>false</PrintOrderOnlyGoodResult>
<PrintOrderOnlyLastResult>false</PrintOrderOnlyLastResult>
<ResultsConfigMeters>Vertically</ResultsConfigMeters>
+2 -1
View File
@@ -60,10 +60,11 @@
<logger name="NHibernate"> <level value="ERROR" /> </logger>
<logger name="TBF.BenchControl.StateMachine"> <level value="INFO" /> </logger>
<logger name="TBF.BenchControl.State"> <level value="WARN" /> </logger>
<logger name="TBF.BenchControl.Elde.ControlComdWrap"> <level value="WARN" /> </logger>
<logger name="TBF.BenchControl.Elde.ControlComWrap"> <level value="WARN" /> </logger>
<logger name="TBF.BenchControl.Elde.Pump"> <level value="WARN" /> </logger>
<logger name="TBF.BenchControl.Elde.PumpWithFM"> <level value="WARN" /> </logger>
<logger name="TBF.BenchControl.MettlerToledo"> <level value="WARN" /> </logger>
<logger name="TBF.BenchControl.Fomulas"> <level value="FATAL" /> </logger>
<logger name="TBF.BenchControl.Elde.StartMeasurementOp"> <level value="WARN" /> </logger>
<logger name="TBF.BenchControl.Modbus"> <level value="DEBUG" /> </logger>
</log4net>
+2 -2
View File
@@ -524,8 +524,8 @@ namespace TBF.Screens
tOutLabel.Text = tRes.TempDownMean.ToString("F2");
tDivLabel.Text = tRes.TempDivMean.ToString("F2");
prInLabel.Text = tRes.PressUpMean.ToString("F2");
prOutLabel.Text = tRes.PressDownMean.ToString("F2");
prInLabel.Text = tRes.PressUpMean.ToString("F1");
prOutLabel.Text = tRes.PressDownMean.ToString("F1");
massLabel.Text = ProcessData.Mass.ToString();
massDiffLabel.Text = (tRes.MassEnd - tRes.MassStart).ToString("F3");
+3 -3
View File
@@ -457,7 +457,7 @@ namespace TBF.Screens
tDivLabel.Text = ProcessData.TempDiv.ToString();
prInLabel.Text = ProcessData.PressUp.ToString();
prOutLabel.Text = ProcessData.PressDown.ToString();
prOutLabel.Text = ProcessData.PressDown.ToString();
massLabel.Text = ProcessData.Mass.ToString();
@@ -553,8 +553,8 @@ namespace TBF.Screens
tOutLabel.Text = tRes.TempDownMean.ToString("F2");
tDivLabel.Text = tRes.TempDivMean.ToString("F2");
prInLabel.Text = tRes.PressUpMean.ToString("F2");
prOutLabel.Text = tRes.PressDownMean.ToString("F2");
prInLabel.Text = tRes.PressUpMean.ToString("F1");
prOutLabel.Text = tRes.PressDownMean.ToString("F1");
massLabel.Text = ProcessData.Mass.ToString();
massDiffLabel.Text = (tRes.MassEnd - tRes.MassStart).ToString("F3");
+4 -4
View File
@@ -460,8 +460,8 @@ namespace TBF.Screens
tOutLabel.Text = ProcessData.TempDown.ToString();
tDivLabel.Text = ProcessData.TempDiv.ToString();
prUpLabel.Text = ProcessData.PressUp.ToString();
prDownLabel.Text = ProcessData.PressDown.ToString();
prUpLabel.Text = Config.Units.ConvertTo(Config.Unit.bar, ProcessData.PressUp.Val).ToString();
prDownLabel.Text = Config.Units.ConvertTo(Config.Unit.bar, ProcessData.PressDown.Val).ToString();
massLabel.Text = ProcessData.Mass.ToString();
@@ -557,8 +557,8 @@ namespace TBF.Screens
tOutLabel.Text = tRes.TempDownMean.ToString("F2");
tDivLabel.Text = tRes.TempDivMean.ToString("F2");
prUpLabel.Text = tRes.PressUpMean.ToString("F2");
prDownLabel.Text = tRes.PressDownMean.ToString("F2");
prUpLabel.Text = tRes.PressUpMean.ToString("F1");
prDownLabel.Text = tRes.PressDownMean.ToString("F1");
massLabel.Text = ProcessData.Mass.ToString();
massDiffLabel.Text = (tRes.MassEnd - tRes.MassStart).ToString("F3");
+5 -36
View File
@@ -39,7 +39,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;FUZHOU100;STABLE_MASS_EXTRAS</DefineConstants>
<DefineConstants>TRACE;DEBUG;SENTEC;STABLE_MASS_EXTRAS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -49,7 +49,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;FUZHOU100;STABLE_MASS_EXTRAS</DefineConstants>
<DefineConstants>TRACE;SENTEC;STABLE_MASS_EXTRAS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
@@ -58,7 +58,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;FUZHOU100;STABLE_MASS_EXTRAS</DefineConstants>
<DefineConstants>TRACE;DEBUG;SENTEC;STABLE_MASS_EXTRAS</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
@@ -67,7 +67,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;FUZHOU100;STABLE_MASS_EXTRAS</DefineConstants>
<DefineConstants>TRACE;SENTEC;STABLE_MASS_EXTRAS</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
@@ -98,7 +98,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="ControlComponent3U">
<HintPath>..\packages\ControlBoard\JuznaAfrika50\ControlComponent3U.dll</HintPath>
<HintPath>..\packages\ControlBoard\Sentec\ControlComponent3U.dll</HintPath>
</Reference>
<Reference Include="FluentNHibernate">
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
@@ -1153,27 +1153,6 @@
<Compile Include="BenchControl\TestMethods\OuterLoop\End\Factory.cs" />
<Compile Include="BenchControl\TestMethods\OuterLoop\Start\Component.cs" />
<Compile Include="BenchControl\TestMethods\OuterLoop\Start\Factory.cs" />
<Compile Include="BenchControl\TestMethods\PulsesTest\PulsesTestSeq.cs" />
<Compile Include="BenchControl\TestMethods\PulsesTest\Factory.cs" />
<Compile Include="BenchControl\TestMethods\PulsesTest\TestMethod.cs" />
<Compile Include="BenchControl\TestMethods\PulsesTest\WMPulsesForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="BenchControl\TestMethods\PulsesTest\WMPulsesForm.designer.cs">
<DependentUpon>WMPulsesForm.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\TestMethods\PulsesTest\WMPulsesForm12.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="BenchControl\TestMethods\PulsesTest\WMPulsesForm12.designer.cs">
<DependentUpon>WMPulsesForm12.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\TestMethods\PulsesTest\WMPulsesForm24.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="BenchControl\TestMethods\PulsesTest\WMPulsesForm24.designer.cs">
<DependentUpon>WMPulsesForm24.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\TestMethods\SensitivityTest\SensitivityTestSeq.cs" />
<Compile Include="BenchControl\TestMethods\SensitivityTest\SensitivityTestParams.cs" />
<Compile Include="BenchControl\TestMethods\SensitivityTest\TestMethod.cs" />
@@ -1900,7 +1879,6 @@
<Compile Include="UiBridge\ProcedureCompletedEventArgs.cs" />
<Compile Include="UiBridge\ProcedureSelectedEventArgs.cs" />
<Compile Include="UiBridge\ProcessDataEventArgs.cs" />
<Compile Include="UiBridge\PulsesTestInProgressEventArgs.cs" />
<Compile Include="UiBridge\StateChangedEventArgs.cs" />
<Compile Include="UiBridge\TestCompletedEventArgs.cs" />
<Compile Include="UiBridge\TestProgressEventArgs.cs" />
@@ -2465,15 +2443,6 @@
<EmbeddedResource Include="BenchControl\TestMethods\LiveStream\CfgCtrl.resx">
<DependentUpon>CfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\TestMethods\PulsesTest\WMPulsesForm.resx">
<DependentUpon>WMPulsesForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\TestMethods\PulsesTest\WMPulsesForm12.resx">
<DependentUpon>WMPulsesForm12.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\TestMethods\PulsesTest\WMPulsesForm24.resx">
<DependentUpon>WMPulsesForm24.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\TestMethods\RoiDetection\RoiDetectionCfgCtrl.resx">
<DependentUpon>RoiDetectionCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
-12
View File
@@ -113,18 +113,6 @@ namespace TBF.UiBridge
public static event EventHandler<AdjustmentInProgressEventArgs> AdjustmentInProgressHandler;
/// <summary>
/// Called from the state machine when one test of the pulses test process was completed and UI needs to be updated.
/// </summary>
public static void OnPulsesTestInProgress(object sender, PulsesTestInProgressEventArgs data)
{
if (PulsesTestInProgressHandler == null) return;
try { PulsesTestInProgressHandler(sender, data); }
catch (Exception e) { log.Error("PulsesTestInProgressHandler(...) failed", e); }
}
public static event EventHandler<PulsesTestInProgressEventArgs> PulsesTestInProgressHandler;
/// <summary>
/// Called from the state machine when the test is completed and UI needs to be updated.
/// </summary>
@@ -1,20 +0,0 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using Config.Entities;
namespace TBF.UiBridge
{
public class PulsesTestInProgressEventArgs : EventArgs
{
public string TestName;
public double LimitLo;
public PulsesTestInProgressEventArgs(string testName, double limitLo)
{
this.TestName = testName;
this.LimitLo = limitLo;
}
}
}
+3 -3
View File
@@ -248,7 +248,7 @@ namespace TBF.UiControls
private void emptyTank1Btn_Click(object sender, EventArgs e)
{
#if TURA_IPERL
#if TURA_IPERL || TURA_SPECIAL
/// Prevent 'Stop draining' by password
if (drain1Highlighted && !Users.GlobalData.CurrentUser.IsMemberOf(Users.Grp.GID.TestingSpecialists))
{
@@ -265,7 +265,7 @@ namespace TBF.UiControls
private void emptyTank2Btn_Click(object sender, EventArgs e)
{
#if TURA_IPERL
#if TURA_IPERL || TURA_SPECIAL
/// Prevent 'Stop draining' by password
if (drain1Highlighted && !Users.GlobalData.CurrentUser.IsMemberOf(Users.Grp.GID.TestingSpecialists))
{
@@ -282,7 +282,7 @@ namespace TBF.UiControls
private void emptyTank3Btn_Click(object sender, EventArgs e)
{
#if TURA_IPERL
#if TURA_IPERL || TURA_SPECIAL
/// Prevent 'Stop draining' by password
if (drain1Highlighted && !Users.GlobalData.CurrentUser.IsMemberOf(Users.Grp.GID.TestingSpecialists))
{
+1 -8
View File
@@ -152,14 +152,7 @@ namespace TBF.UiControls
{
(e.Item.Tag as IParamsProvider).UpdateParam(e.SubItem - nrFixedColumns, e.DisplayText);
}
else
{
MessageBox.Show(message);
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
e.Cancel = true;
return; /// NOK
}
}
}
public void RedrawAll()
+6 -13
View File
@@ -158,17 +158,10 @@ namespace TBF.UiControls
string message;
int itemNr = showTestsColumn ? (e.SubItem - 1) : e.SubItem;
if ((e.Item.Tag as IParamsProvider).ValidateParam(itemNr, e.DisplayText, out message))
{
(e.Item.Tag as IParamsProvider).UpdateParam(itemNr, e.DisplayText);
}
else
{
MessageBox.Show(message);
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
e.Cancel = true;
return; /// NOK
}
if ((e.Item.Tag as IParamsProvider).ValidateParam(itemNr, e.DisplayText, out message))
{
(e.Item.Tag as IParamsProvider).UpdateParam(itemNr, e.DisplayText);
}
}
public void RedrawAll()
@@ -210,11 +203,11 @@ namespace TBF.UiControls
{
if (test.Method == cmpnt.Cfg.Name)
{
IParamsProvider testParams = cmpnt.Cfg.CreateTestParamsProvider(); /// Load or create ComponentTest entity
IParamsProvider testParams = cmpnt.Cfg.CreateTestParamsProvider(); /// Load or create ComponentTest entity
if (testParams != null)
{
var writer = new System.IO.StringWriter();
testParams.GetSerializer().Serialize(writer, testParams); /// Serialize this class with parameters
testParams.GetSerializer().Serialize(writer, testParams); /// Serialize this class with parameters
ComponentTest entity = new ComponentTest(test.Method, writer.ToString(), test);
entity.SetParamsProvider(testParams);
Binary file not shown.