Compare commits
47
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca576e3448 | ||
|
|
3a55002027 | ||
|
|
bbadacf7d3 | ||
|
|
2ff7b02e72 | ||
|
|
65c441d929 | ||
|
|
9390dc95c2 | ||
|
|
97c612e49b | ||
|
|
4a185ed35b | ||
|
|
2718c4021c | ||
|
|
ebb2950e84 | ||
|
|
67a53909f8 | ||
|
|
fbfbbecca4 | ||
|
|
e8db0f46c3 | ||
|
|
c1705713df | ||
|
|
0fd1d9e141 | ||
|
|
5ee66205a9 | ||
|
|
03e8108704 | ||
|
|
ed4179be5f | ||
|
|
bedbecbcc3 | ||
|
|
e81de2267b | ||
|
|
3dfff4ad70 | ||
|
|
7a640621ac | ||
|
|
807daf2bcd | ||
|
|
ede1773b4f | ||
|
|
e3ae1b24f1 | ||
|
|
f6dc9d74fc | ||
|
|
51f3a6e6c2 | ||
|
|
f81d5111a9 | ||
|
|
b24ec4ea2d | ||
|
|
f3ed9a64f7 | ||
|
|
866939abbd | ||
|
|
248f51fa69 | ||
|
|
b4dc83e7fa | ||
|
|
0bb6a2cd8c | ||
|
|
c3d3a8c987 | ||
|
|
825230d9e9 | ||
|
|
cb13e3f108 | ||
|
|
2552949c59 | ||
|
|
317e0f16cb | ||
|
|
8e046046cd | ||
|
|
e440981068 | ||
|
|
299f3ecb68 | ||
|
|
39aa02f9ab | ||
|
|
d502873d17 | ||
|
|
da192a207c | ||
|
|
23560f1702 | ||
|
|
36a6fba408 |
@@ -125,6 +125,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="Resources\Strings.cs.resx" />
|
<EmbeddedResource Include="Resources\Strings.cs.resx" />
|
||||||
<EmbeddedResource Include="Resources\Strings.de.resx" />
|
<EmbeddedResource Include="Resources\Strings.de.resx" />
|
||||||
|
<EmbeddedResource Include="Resources\Strings.fr.resx" />
|
||||||
<EmbeddedResource Include="Resources\Strings.it.resx" />
|
<EmbeddedResource Include="Resources\Strings.it.resx" />
|
||||||
<EmbeddedResource Include="Resources\Strings.pl.resx" />
|
<EmbeddedResource Include="Resources\Strings.pl.resx" />
|
||||||
<EmbeddedResource Include="Resources\Strings.resx">
|
<EmbeddedResource Include="Resources\Strings.resx">
|
||||||
|
|||||||
+1
-1
@@ -62,7 +62,7 @@ namespace Config
|
|||||||
public const int CompoundWMsCount = 1;
|
public const int CompoundWMsCount = 1;
|
||||||
public const int HeatMetersCount = 0;
|
public const int HeatMetersCount = 0;
|
||||||
public const int MaxPartNr = 1;
|
public const int MaxPartNr = 1;
|
||||||
#elif TORUN_50 || CEVAK_40 || MURES_40 || FUZHOU_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50
|
#elif TORUN_50 || CEVAK_40 || MURES_40 || FUZHOU_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || ALZIR_25
|
||||||
public const int WMsCount = 20;
|
public const int WMsCount = 20;
|
||||||
public const int LineSize = 10;
|
public const int LineSize = 10;
|
||||||
public const int CompoundWMsCount = 1;
|
public const int CompoundWMsCount = 1;
|
||||||
|
|||||||
@@ -90,6 +90,10 @@ namespace Config.Entities
|
|||||||
[Description("Wasserzähler")] Single,
|
[Description("Wasserzähler")] Single,
|
||||||
[Description("Verbundwasserzähler")] Combined,
|
[Description("Verbundwasserzähler")] Combined,
|
||||||
[Description("Wärmezähler")] HeatMeter,
|
[Description("Wärmezähler")] HeatMeter,
|
||||||
|
#elif LANG_FR
|
||||||
|
[Description("Compteurs eau")] Single,
|
||||||
|
[Description("Mètres composés")] Combined,
|
||||||
|
[Description("Thermomètres")] HeatMeter,
|
||||||
#elif LANG_CS
|
#elif LANG_CS
|
||||||
[Description("Vodoměry")] Single,
|
[Description("Vodoměry")] Single,
|
||||||
[Description("Kombinované vodoměry")] Combined,
|
[Description("Kombinované vodoměry")] Combined,
|
||||||
@@ -125,6 +129,9 @@ namespace Config.Entities
|
|||||||
#elif LANG_IT
|
#elif LANG_IT
|
||||||
[Description("freddo")] ColdWater,
|
[Description("freddo")] ColdWater,
|
||||||
[Description("caldo")] HotWater,
|
[Description("caldo")] HotWater,
|
||||||
|
#elif LANG_FR
|
||||||
|
[Description("eau froide")] ColdWater,
|
||||||
|
[Description("eau chaude")] HotWater,
|
||||||
#else
|
#else
|
||||||
[Description("cold")] ColdWater,
|
[Description("cold")] ColdWater,
|
||||||
[Description("hot")] HotWater,
|
[Description("hot")] HotWater,
|
||||||
@@ -240,6 +247,11 @@ namespace Config.Entities
|
|||||||
[Description("immer")] Always = 1,
|
[Description("immer")] Always = 1,
|
||||||
[Description("Bildschirm")] OnScreen = 2,
|
[Description("Bildschirm")] OnScreen = 2,
|
||||||
[Description("intern")] Internal = 3,
|
[Description("intern")] Internal = 3,
|
||||||
|
#elif LANG_FR
|
||||||
|
[Description("jamais")] Never = 0,
|
||||||
|
[Description("toujours")] Always = 1,
|
||||||
|
[Description("À l'écran")] OnScreen = 2,
|
||||||
|
[Description("interne")] Internal = 3,
|
||||||
#elif LANG_CS
|
#elif LANG_CS
|
||||||
/// czech
|
/// czech
|
||||||
[Description("nikdy")] Never = 0,
|
[Description("nikdy")] Never = 0,
|
||||||
@@ -281,6 +293,10 @@ namespace Config.Entities
|
|||||||
[Description("Waage")] Scale,
|
[Description("Waage")] Scale,
|
||||||
[Description("Spanne")] Spread,
|
[Description("Spanne")] Spread,
|
||||||
[Description("Standardabw.")] StdDev,
|
[Description("Standardabw.")] StdDev,
|
||||||
|
#elif LANG_FR
|
||||||
|
[Description("Balance")] Scale,
|
||||||
|
[Description("Envergure")] Spread,
|
||||||
|
[Description("Déviation std.")] StdDev,
|
||||||
#elif LANG_CS
|
#elif LANG_CS
|
||||||
/// cesky
|
/// cesky
|
||||||
[Description("váhou")] Scale,
|
[Description("váhou")] Scale,
|
||||||
@@ -345,6 +361,14 @@ namespace Config.Entities
|
|||||||
[Description("Prüfpunktergebnisse")] TestResult,
|
[Description("Prüfpunktergebnisse")] TestResult,
|
||||||
[Description("Wasserzelledaten")] MeterData,
|
[Description("Wasserzelledaten")] MeterData,
|
||||||
[Description("Wasserzelleergebnisse")] MeterResult,
|
[Description("Wasserzelleergebnisse")] MeterResult,
|
||||||
|
#elif LANG_FR
|
||||||
|
[Description("Autres")] Other,
|
||||||
|
[Description("Données de banc")] BenchData,
|
||||||
|
[Description("Résultats du banc")] BenchResult,
|
||||||
|
[Description("Données de test")] TestData,
|
||||||
|
[Description("Résultats de test")] TestResult,
|
||||||
|
[Description("Données du compteur d'eau")] MeterData,
|
||||||
|
[Description("Résultats du compteur d'eau")] MeterResult,
|
||||||
#else
|
#else
|
||||||
[Description("Other")] Other,
|
[Description("Other")] Other,
|
||||||
[Description("Bench data")] BenchData,
|
[Description("Bench data")] BenchData,
|
||||||
@@ -371,6 +395,17 @@ namespace Config.Entities
|
|||||||
[Description("Reply")] Reply,
|
[Description("Reply")] Reply,
|
||||||
[Description("Simuliert")] Simulate, /// Test bench simulation, this mode does not require any hardware
|
[Description("Simuliert")] Simulate, /// Test bench simulation, this mode does not require any hardware
|
||||||
[Description("Geerbt")] Inherit,
|
[Description("Geerbt")] Inherit,
|
||||||
|
#elif LANG_FR
|
||||||
|
[Description("Détection automatique: Éteindre")] DetectedOff = -2,
|
||||||
|
[Description("Détection automatique: Allumé")] DetectedOn = -1,
|
||||||
|
[Description("Ordinaire")] Normal = 0,
|
||||||
|
[Description("Détection automatique")] AutoDetect,
|
||||||
|
[Description("Erreur d'exécution")] FailureDuringOperation,
|
||||||
|
[Description("Éteindre")] Off,
|
||||||
|
[Description("Record")] Record,
|
||||||
|
[Description("Répondre")] Reply,
|
||||||
|
[Description("Simuler")] Simulate,
|
||||||
|
[Description("Hériter")] Inherit,
|
||||||
#else
|
#else
|
||||||
[Description("Detected off")] DetectedOff = -2,
|
[Description("Detected off")] DetectedOff = -2,
|
||||||
[Description("Detected on")] DetectedOn = -1,
|
[Description("Detected on")] DetectedOn = -1,
|
||||||
@@ -430,6 +465,11 @@ namespace Config.Entities
|
|||||||
[Description("zentriert")] Center,
|
[Description("zentriert")] Center,
|
||||||
[Description("rechts")] Right,
|
[Description("rechts")] Right,
|
||||||
[Description("angepasst")] Justified,
|
[Description("angepasst")] Justified,
|
||||||
|
#elif LANG_FR
|
||||||
|
[Description("gauche")] Left,
|
||||||
|
[Description("centré")] Center,
|
||||||
|
[Description("droit")] Right,
|
||||||
|
[Description("justifié")] Justified,
|
||||||
#else
|
#else
|
||||||
[Description("Left")] Left,
|
[Description("Left")] Left,
|
||||||
[Description("Center")] Center,
|
[Description("Center")] Center,
|
||||||
@@ -479,6 +519,10 @@ namespace Config.Entities
|
|||||||
[Description("aus")] Off,
|
[Description("aus")] Off,
|
||||||
[Description("info")] Info,
|
[Description("info")] Info,
|
||||||
[Description("ein")] On,
|
[Description("ein")] On,
|
||||||
|
#elif LANG_FR
|
||||||
|
[Description("éteindre")] Off,
|
||||||
|
[Description("info")] Info,
|
||||||
|
[Description("allumé")] On,
|
||||||
#elif LANG_CS
|
#elif LANG_CS
|
||||||
[Description("vypnuto")] Off,
|
[Description("vypnuto")] Off,
|
||||||
[Description("info")] Info,
|
[Description("info")] Info,
|
||||||
|
|||||||
@@ -234,6 +234,42 @@ namespace Config.Entities
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Processes the selection done by the bench control panel in the main sequence.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="selection">Selection.Q1, .Q2, .Q3 or .Test</param>
|
||||||
|
/// <returns>The selected test or null</returns>
|
||||||
|
public virtual Test GetTest(string expandedTestName, out int testIx, out int repetNr)
|
||||||
|
{
|
||||||
|
for (int ix = 0; ix < Tests.Count; ix++)
|
||||||
|
{
|
||||||
|
Test test = Tests[ix];
|
||||||
|
if (test.Name.Equals(expandedTestName))
|
||||||
|
{
|
||||||
|
/// Name is not expanded => Repeats==1
|
||||||
|
testIx = ix;
|
||||||
|
repetNr = 1;
|
||||||
|
return test;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int r = 1; r <= test.Repeats; r++)
|
||||||
|
{
|
||||||
|
if (test.GetExpandedTestName(r).Equals(expandedTestName))
|
||||||
|
{
|
||||||
|
testIx = ix;
|
||||||
|
repetNr = r;
|
||||||
|
return test;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
testIx = 0;
|
||||||
|
repetNr = 1;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return string.Format("{0}, rev.{1}", Name, Revision);
|
return string.Format("{0}, rev.{1}", Name, Revision);
|
||||||
|
|||||||
+33
-6
@@ -30,7 +30,7 @@ namespace Config.Entities
|
|||||||
public virtual float Uncertainty { get; set; } /// int [%] makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
|
public virtual float Uncertainty { get; set; } /// int [%] makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
|
||||||
public virtual int Repeats { get; set; }
|
public virtual int Repeats { get; set; }
|
||||||
public virtual bool DoDraining { get; set; }
|
public virtual bool DoDraining { get; set; }
|
||||||
public virtual bool DoZeroing { get; set; }
|
public virtual bool DoDrainingAfter { get; set; }
|
||||||
public virtual bool DoControlWaterTemp { get; set; }
|
public virtual bool DoControlWaterTemp { get; set; }
|
||||||
public virtual float TempLimLo { get; set; } /// Lower limit for the controlled temperature
|
public virtual float TempLimLo { get; set; } /// Lower limit for the controlled temperature
|
||||||
public virtual float TempLimHi { get; set; } /// Upper limit for the controlled temperature
|
public virtual float TempLimHi { get; set; } /// Upper limit for the controlled temperature
|
||||||
@@ -76,7 +76,7 @@ namespace Config.Entities
|
|||||||
DoEvaluate = true;
|
DoEvaluate = true;
|
||||||
Repeats = 1;
|
Repeats = 1;
|
||||||
DoDraining = false;
|
DoDraining = false;
|
||||||
DoZeroing = false;
|
DoDrainingAfter = false;
|
||||||
DoControlWaterTemp = false;
|
DoControlWaterTemp = false;
|
||||||
TempLimLo = 15.0f;
|
TempLimLo = 15.0f;
|
||||||
TempLimHi = 25.0f;
|
TempLimHi = 25.0f;
|
||||||
@@ -124,7 +124,7 @@ namespace Config.Entities
|
|||||||
result.Uncertainty = Uncertainty;
|
result.Uncertainty = Uncertainty;
|
||||||
result.Repeats = Repeats;
|
result.Repeats = Repeats;
|
||||||
result.DoDraining = DoDraining;
|
result.DoDraining = DoDraining;
|
||||||
result.DoZeroing = DoZeroing;
|
result.DoDrainingAfter = DoDrainingAfter;
|
||||||
result.DoControlWaterTemp = DoControlWaterTemp;
|
result.DoControlWaterTemp = DoControlWaterTemp;
|
||||||
result.TempLimLo = TempLimLo;
|
result.TempLimLo = TempLimLo;
|
||||||
result.TempLimHi = TempLimHi;
|
result.TempLimHi = TempLimHi;
|
||||||
@@ -172,7 +172,7 @@ namespace Config.Entities
|
|||||||
output.WriteLine(Uncertainty.ToString(ci));
|
output.WriteLine(Uncertainty.ToString(ci));
|
||||||
output.WriteLine(Repeats.ToString(ci));
|
output.WriteLine(Repeats.ToString(ci));
|
||||||
output.WriteLine(DoDraining.ToString());
|
output.WriteLine(DoDraining.ToString());
|
||||||
output.WriteLine(DoZeroing.ToString());
|
output.WriteLine(DoDrainingAfter.ToString());
|
||||||
output.WriteLine(DoControlWaterTemp.ToString());
|
output.WriteLine(DoControlWaterTemp.ToString());
|
||||||
output.WriteLine(TempLimLo.ToString(ci));
|
output.WriteLine(TempLimLo.ToString(ci));
|
||||||
output.WriteLine(TempLimHi.ToString(ci));
|
output.WriteLine(TempLimHi.ToString(ci));
|
||||||
@@ -222,7 +222,7 @@ namespace Config.Entities
|
|||||||
tst.Uncertainty = float.Parse(input.ReadLine(), ci);
|
tst.Uncertainty = float.Parse(input.ReadLine(), ci);
|
||||||
tst.Repeats = int.Parse(input.ReadLine(), ci);
|
tst.Repeats = int.Parse(input.ReadLine(), ci);
|
||||||
tst.DoDraining = bool.Parse(input.ReadLine());
|
tst.DoDraining = bool.Parse(input.ReadLine());
|
||||||
tst.DoZeroing = bool.Parse(input.ReadLine());
|
tst.DoDrainingAfter = bool.Parse(input.ReadLine());
|
||||||
tst.DoControlWaterTemp = bool.Parse(input.ReadLine());
|
tst.DoControlWaterTemp = bool.Parse(input.ReadLine());
|
||||||
tst.TempLimLo = float.Parse(input.ReadLine(), ci);
|
tst.TempLimLo = float.Parse(input.ReadLine(), ci);
|
||||||
tst.TempLimHi = float.Parse(input.ReadLine(), ci);
|
tst.TempLimHi = float.Parse(input.ReadLine(), ci);
|
||||||
@@ -280,7 +280,7 @@ namespace Config.Entities
|
|||||||
ln = inp.ReadLine(); if (ln != Uncertainty.ToString(ci)) { diff.AppendFormat(fmt, "Uncertainty", Uncertainty.ToString(ci), ln); };
|
ln = inp.ReadLine(); if (ln != Uncertainty.ToString(ci)) { diff.AppendFormat(fmt, "Uncertainty", Uncertainty.ToString(ci), ln); };
|
||||||
ln = inp.ReadLine(); if (ln != Repeats.ToString(ci)) { diff.AppendFormat(fmt, "Repeats", Repeats.ToString(ci), ln); };
|
ln = inp.ReadLine(); if (ln != Repeats.ToString(ci)) { diff.AppendFormat(fmt, "Repeats", Repeats.ToString(ci), ln); };
|
||||||
ln = inp.ReadLine(); if (ln != DoDraining.ToString(ci)) { diff.AppendFormat(fmt, "Draining", DoDraining.ToString(ci), ln); };
|
ln = inp.ReadLine(); if (ln != DoDraining.ToString(ci)) { diff.AppendFormat(fmt, "Draining", DoDraining.ToString(ci), ln); };
|
||||||
ln = inp.ReadLine(); if (ln != DoZeroing.ToString(ci)) { diff.AppendFormat(fmt, "Zeroing", DoZeroing.ToString(ci), ln); };
|
ln = inp.ReadLine(); if (ln != DoDrainingAfter.ToString(ci)) { diff.AppendFormat(fmt, "Zeroing", DoDrainingAfter.ToString(ci), ln); };
|
||||||
ln = inp.ReadLine(); if (ln != DoControlWaterTemp.ToString()) { diff.AppendFormat(fmt, "DoControlWaterTemp", DoControlWaterTemp.ToString(ci), ln); };
|
ln = inp.ReadLine(); if (ln != DoControlWaterTemp.ToString()) { diff.AppendFormat(fmt, "DoControlWaterTemp", DoControlWaterTemp.ToString(ci), ln); };
|
||||||
ln = inp.ReadLine(); if (ln != TempLimLo.ToString(ci)) { diff.AppendFormat(fmt, "TempLimLo", TempLimLo.ToString(ci), ln); };
|
ln = inp.ReadLine(); if (ln != TempLimLo.ToString(ci)) { diff.AppendFormat(fmt, "TempLimLo", TempLimLo.ToString(ci), ln); };
|
||||||
ln = inp.ReadLine(); if (ln != TempLimHi.ToString(ci)) { diff.AppendFormat(fmt, "TempLimHi", TempLimHi.ToString(ci), ln); };
|
ln = inp.ReadLine(); if (ln != TempLimHi.ToString(ci)) { diff.AppendFormat(fmt, "TempLimHi", TempLimHi.ToString(ci), ln); };
|
||||||
@@ -313,6 +313,33 @@ namespace Config.Entities
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return test title for a this test and a given repetition number
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repetitonNr">1 .. Nr. repetitions</param>
|
||||||
|
/// <returns>Test title (string)</returns>
|
||||||
|
public virtual string GetExpandedTestName(int repetitionNr)
|
||||||
|
{
|
||||||
|
if (Repeats == 1)
|
||||||
|
{
|
||||||
|
if (Part == 0)
|
||||||
|
{
|
||||||
|
/// Single test
|
||||||
|
return Name;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/// A part of a single test
|
||||||
|
return string.Format("{0} ({1})", Name, Part);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/// More test repetitions
|
||||||
|
return string.Format("{0} ({1}/{2})", Name, repetitionNr, Repeats);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public virtual double GetErrLimLo(double volumeCTV, double testTime)
|
public virtual double GetErrLimLo(double volumeCTV, double testTime)
|
||||||
{
|
{
|
||||||
if (ErrLimLo <= ErrLimHi)
|
if (ErrLimLo <= ErrLimHi)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace Config.Mappings
|
|||||||
Map(x => x.Repeats);
|
Map(x => x.Repeats);
|
||||||
Map(x => x.DoDraining)
|
Map(x => x.DoDraining)
|
||||||
.Column("Emptying");
|
.Column("Emptying");
|
||||||
Map(x => x.DoZeroing)
|
Map(x => x.DoDrainingAfter)
|
||||||
.Column("Zeroing");
|
.Column("Zeroing");
|
||||||
Map(x => x.DoControlWaterTemp);
|
Map(x => x.DoControlWaterTemp);
|
||||||
Map(x => x.TempLimLo);
|
Map(x => x.TempLimLo);
|
||||||
|
|||||||
@@ -0,0 +1,153 @@
|
|||||||
|
<?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>
|
||||||
|
<data name="Administrator" xml:space="preserve">
|
||||||
|
<value>Administrateur</value>
|
||||||
|
</data>
|
||||||
|
<data name="Calibration_Specialist" xml:space="preserve">
|
||||||
|
<value>Spécialiste en calibration</value>
|
||||||
|
</data>
|
||||||
|
<data name="Head_of_Lab" xml:space="preserve">
|
||||||
|
<value>Chef de laboratoire</value>
|
||||||
|
</data>
|
||||||
|
<data name="Maintenance_Specialist" xml:space="preserve">
|
||||||
|
<value>Spécialiste en maintenance</value>
|
||||||
|
</data>
|
||||||
|
<data name="Metrologist" xml:space="preserve">
|
||||||
|
<value>Métrologue</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tester" xml:space="preserve">
|
||||||
|
<value>Testeur</value>
|
||||||
|
</data>
|
||||||
|
<data name="Testing_Specialist" xml:space="preserve">
|
||||||
|
<value>Spécialiste d'essais</value>
|
||||||
|
</data>
|
||||||
|
<data name="Failed" xml:space="preserve">
|
||||||
|
<value>Échoué</value>
|
||||||
|
</data>
|
||||||
|
<data name="Passed" xml:space="preserve">
|
||||||
|
<value>Passé</value>
|
||||||
|
</data>
|
||||||
|
<data name="Cannot_open_DB_Cause_0" xml:space="preserve">
|
||||||
|
<value>Impossible d'ouvrir la base de données Cause\\r\\n{0}</value>
|
||||||
|
</data>
|
||||||
|
<data name="Error" xml:space="preserve">
|
||||||
|
<value>Erreur</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
+11
-5
@@ -130,13 +130,19 @@ namespace Results
|
|||||||
|
|
||||||
public static BatchResults FromBatch(Batch batch)
|
public static BatchResults FromBatch(Batch batch)
|
||||||
{
|
{
|
||||||
int wmCount = batch.WaterMeters.Count;
|
if (batch.WaterMeters == null || batch.WaterMeters.Count == 0) return null;
|
||||||
if (wmCount == 0) return null;
|
|
||||||
|
|
||||||
BatchResults batchResults = new BatchResults(wmCount);
|
int wmPosMax = 0;
|
||||||
|
foreach (var wm in batch.WaterMeters) if (wm.WMPosition > wmPosMax) wmPosMax = wm.WMPosition;
|
||||||
|
|
||||||
|
BatchResults batchResults = new BatchResults(wmPosMax);
|
||||||
batchResults.Batch = batch;
|
batchResults.Batch = batch;
|
||||||
batchResults.WaterMeters = new WaterMeter[wmCount];
|
batchResults.WaterMeters = new WaterMeter[wmPosMax];
|
||||||
for (int i = 0; i < wmCount; i++) batchResults.WaterMeters[i] = batch.WaterMeters[i];
|
for (int i = 0; i < batch.WaterMeters.Count; i++)
|
||||||
|
{
|
||||||
|
WaterMeter wm = batch.WaterMeters[i];
|
||||||
|
batchResults.WaterMeters[wm.WMPosition - 1] = wm;
|
||||||
|
}
|
||||||
|
|
||||||
return batchResults;
|
return batchResults;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ namespace Results.Entities
|
|||||||
public virtual object CompleteTestInfos { get; set; } /// SensusTestInfo[] obtained as a best match at the beginning of the cycle, not mapped to DB !!!
|
public virtual object CompleteTestInfos { get; set; } /// SensusTestInfo[] obtained as a best match at the beginning of the cycle, not mapped to DB !!!
|
||||||
#endif
|
#endif
|
||||||
public virtual int ProcessId { get; set; } /// Not mapped to DB !!! Tracing DB Process ID
|
public virtual int ProcessId { get; set; } /// Not mapped to DB !!! Tracing DB Process ID
|
||||||
|
public virtual int SessionId { get; set; } /// Not mapped to DB !!! 1 (regular tracing DB session) or 2 (alternative tracing DB session)
|
||||||
public virtual bool LastRecordIsNok { get; set; } /// Not mapped to DB !!! Previous record verification result
|
public virtual bool LastRecordIsNok { get; set; } /// Not mapped to DB !!! Previous record verification result
|
||||||
|
|
||||||
public virtual WaterMeterData WaterMeterData { get; set; }
|
public virtual WaterMeterData WaterMeterData { get; set; }
|
||||||
@@ -359,6 +360,7 @@ namespace Results.Entities
|
|||||||
CompleteTestInfos = null;
|
CompleteTestInfos = null;
|
||||||
#endif
|
#endif
|
||||||
ProcessId = 0;
|
ProcessId = 0;
|
||||||
|
SessionId = 0;
|
||||||
ErrorFlags = 0;
|
ErrorFlags = 0;
|
||||||
LastRecordIsNok = false;
|
LastRecordIsNok = false;
|
||||||
}
|
}
|
||||||
@@ -419,6 +421,7 @@ namespace Results.Entities
|
|||||||
CompleteTestInfos = src.CompleteTestInfos;
|
CompleteTestInfos = src.CompleteTestInfos;
|
||||||
#endif
|
#endif
|
||||||
ProcessId = src.ProcessId;
|
ProcessId = src.ProcessId;
|
||||||
|
SessionId = src.SessionId;
|
||||||
LastRecordIsNok = src.LastRecordIsNok;
|
LastRecordIsNok = src.LastRecordIsNok;
|
||||||
|
|
||||||
foreach (var mtr in MeterTestRslts)
|
foreach (var mtr in MeterTestRslts)
|
||||||
|
|||||||
@@ -126,14 +126,11 @@ namespace Results.Forms
|
|||||||
int displayedControlsCount = 0;
|
int displayedControlsCount = 0;
|
||||||
for (int i = 0; i < results.WaterMeters.Length; i++)
|
for (int i = 0; i < results.WaterMeters.Length; i++)
|
||||||
{
|
{
|
||||||
if (results.WaterMeters[i] != null)
|
if (((results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled) || ShowDisabledPositions)
|
||||||
{
|
|
||||||
if (ShowDisabledPositions || !results.WaterMeters[i].Disabled)
|
|
||||||
{
|
{
|
||||||
displayedControlsCount++;
|
displayedControlsCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Calculate geometry
|
/// Calculate geometry
|
||||||
@@ -170,9 +167,7 @@ namespace Results.Forms
|
|||||||
firstEnabledControl = null;
|
firstEnabledControl = null;
|
||||||
for (int i = 0; i < results.WaterMeters.Length; i++)
|
for (int i = 0; i < results.WaterMeters.Length; i++)
|
||||||
{
|
{
|
||||||
if (results.WaterMeters[i] != null)
|
if (((results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled) || ShowDisabledPositions)
|
||||||
{
|
|
||||||
if (!results.WaterMeters[i].Disabled || ShowDisabledPositions)
|
|
||||||
{
|
{
|
||||||
/// Create one water meter position / control
|
/// Create one water meter position / control
|
||||||
wmRsltsCtrl[ix] = (TestsArrangement == TestsArrangement.Rows)
|
wmRsltsCtrl[ix] = (TestsArrangement == TestsArrangement.Rows)
|
||||||
@@ -180,6 +175,15 @@ namespace Results.Forms
|
|||||||
: new OneWMResultsColumnsCtrl() as IOneWMResultsCtrl;
|
: new OneWMResultsColumnsCtrl() as IOneWMResultsCtrl;
|
||||||
wmRsltsCtrl[ix].Width = oneWidth;
|
wmRsltsCtrl[ix].Width = oneWidth;
|
||||||
wmRsltsCtrl[ix].Height = oneHeight;
|
wmRsltsCtrl[ix].Height = oneHeight;
|
||||||
|
|
||||||
|
if ((results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled)
|
||||||
|
{
|
||||||
|
if ((firstEnabledControl == null) && (results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled)
|
||||||
|
{
|
||||||
|
firstEnabledControl = wmRsltsCtrl[ix];
|
||||||
|
}
|
||||||
|
|
||||||
|
//wmRsltsCtrl[ix].Update(results.WaterMeters[i].WMPosition);
|
||||||
wmRsltsCtrl[ix].Update(Items);
|
wmRsltsCtrl[ix].Update(Items);
|
||||||
wmRsltsCtrl[ix].WMResultsClickedHandler += delegate(object s, Results.Forms.WaterMeterEventArgs args)
|
wmRsltsCtrl[ix].WMResultsClickedHandler += delegate(object s, Results.Forms.WaterMeterEventArgs args)
|
||||||
{
|
{
|
||||||
@@ -192,13 +196,12 @@ namespace Results.Forms
|
|||||||
OnDoubleClick(s, args);
|
OnDoubleClick(s, args);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
flowLayoutPanel.Controls.Add(wmRsltsCtrl[ix] as UserControl);
|
flowLayoutPanel.Controls.Add(wmRsltsCtrl[ix] as UserControl);
|
||||||
if ((firstEnabledControl == null) && !results.WaterMeters[i].Disabled) firstEnabledControl = wmRsltsCtrl[ix];
|
|
||||||
ix++;
|
ix++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
flowLayoutPanel.ResumeLayout();
|
flowLayoutPanel.ResumeLayout();
|
||||||
|
|
||||||
@@ -206,16 +209,16 @@ namespace Results.Forms
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void UpdateResults(Results.BatchResults batchResults)
|
void UpdateResults(Results.BatchResults results)
|
||||||
{
|
{
|
||||||
if ((batchResults != null) && (batchResults.WaterMeters != null))
|
if ((results != null) && (results.WaterMeters != null))
|
||||||
{
|
{
|
||||||
int ctrlIx = 0;
|
int ctrlIx = 0;
|
||||||
for (int i = 0; i < batchResults.WaterMeters.Length; i++)
|
for (int i = 0; i < results.WaterMeters.Length; i++)
|
||||||
{
|
{
|
||||||
if (!batchResults.WaterMeters[i].Disabled || ShowDisabledPositions)
|
if (((results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled) || ShowDisabledPositions)
|
||||||
{
|
{
|
||||||
if (ctrlIx < wmRsltsCtrl.Length) wmRsltsCtrl[ctrlIx++].Update(batchResults.WaterMeters[i]);
|
if (ctrlIx < wmRsltsCtrl.Length) wmRsltsCtrl[ctrlIx++].Update(results.WaterMeters[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,11 +90,11 @@ namespace Results.Forms
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// Header
|
/// Header
|
||||||
lView.Columns.Add(wmPosition.ToString(), (columnWidths.Length > 0) ? columnWidths[0] : 40);
|
lView.Columns.Add(wmPosition.ToString(), (columnWidths != null && columnWidths.Length > 0) ? columnWidths[0] : 40);
|
||||||
int col = 1;
|
int col = 1;
|
||||||
foreach (var str in wMtr.GetAllDecoratedTestNames())
|
foreach (var str in wMtr.GetAllDecoratedTestNames())
|
||||||
{
|
{
|
||||||
lView.Columns.Add(str, (columnWidths.Length > col) ? columnWidths[col] : 70);
|
lView.Columns.Add(str, (columnWidths != null && columnWidths.Length > col) ? columnWidths[col] : 70);
|
||||||
col++;
|
col++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,13 +67,13 @@ namespace Results.Forms
|
|||||||
|
|
||||||
/// Always draw ListView header
|
/// Always draw ListView header
|
||||||
lView.Columns.Clear();
|
lView.Columns.Clear();
|
||||||
lView.Columns.Add(wmPosition.ToString(), (columnWidths.Length > 0) ? columnWidths[0] : 40);
|
lView.Columns.Add(wmPosition.ToString(), (columnWidths != null && columnWidths.Length > 0) ? columnWidths[0] : 40);
|
||||||
|
|
||||||
if (items == null || items.Count == 0) return;
|
if (items == null || items.Count == 0) return;
|
||||||
int col = 1;
|
int col = 1;
|
||||||
foreach (var item in items)
|
foreach (var item in items)
|
||||||
{
|
{
|
||||||
lView.Columns.Add(item.Caption, (columnWidths.Length > col) ? columnWidths[col] : 70);
|
lView.Columns.Add(item.Caption, (columnWidths != null && columnWidths.Length > col) ? columnWidths[col] : 70);
|
||||||
col++;
|
col++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.Drawing.Drawing2D;
|
||||||
using System.Drawing.Printing;
|
using System.Drawing.Printing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using Gma.QrCodeNet.Encoding;
|
||||||
using Config.Entities;
|
using Config.Entities;
|
||||||
using Results.Resources;
|
using Results.Resources;
|
||||||
|
|
||||||
@@ -13,6 +15,8 @@ namespace Results.Output.Printers.Label
|
|||||||
{
|
{
|
||||||
public class LabelPrintDocument : PrintersCommon
|
public class LabelPrintDocument : PrintersCommon
|
||||||
{
|
{
|
||||||
|
static QrEncoder encoder = new QrEncoder();
|
||||||
|
|
||||||
/// Size of the printed area without margins, after taking into account 'pageOrientation'
|
/// Size of the printed area without margins, after taking into account 'pageOrientation'
|
||||||
readonly int printHeight;
|
readonly int printHeight;
|
||||||
readonly int printWidth;
|
readonly int printWidth;
|
||||||
@@ -93,6 +97,44 @@ namespace Results.Output.Printers.Label
|
|||||||
e.Graphics.DrawString(item.Print(wm), this.font, Brushes.Black, printArea);
|
e.Graphics.DrawString(item.Print(wm), this.font, Brushes.Black, printArea);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cfg.DrawSNasBarcode)
|
||||||
|
{
|
||||||
|
if (cfg.IsQR)
|
||||||
|
{
|
||||||
|
QrCode qrCode = encoder.Encode(wm.SerialNr);
|
||||||
|
DrawQR(e.Graphics, qrCode, cfg.BarcodeLeft, cfg.BarcodeTop, cfg.BarcodeWidth, cfg.BarcodeHeight);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/// TODO
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void DrawQR(Graphics g, QrCode qrCode, float left, float top, float width, float height)
|
||||||
|
{
|
||||||
|
/// Assuming 100 dpi (printer)
|
||||||
|
g.SmoothingMode = SmoothingMode.AntiAlias;
|
||||||
|
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||||
|
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
|
||||||
|
|
||||||
|
float qrPixWidth = width / qrCode.Matrix.Width;
|
||||||
|
float qrPixHeight = height / qrCode.Matrix.Height;
|
||||||
|
for (int i = 0; i < qrCode.Matrix.Height; i++)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < qrCode.Matrix.Width; j++)
|
||||||
|
{
|
||||||
|
if (qrCode.Matrix[j, i])
|
||||||
|
{
|
||||||
|
g.FillRectangle(Brushes.Black, new RectangleF(left + j * qrPixWidth,
|
||||||
|
top + i * qrPixHeight,
|
||||||
|
qrPixWidth,
|
||||||
|
qrPixHeight));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2018 Sensus Slovensko a.s.
|
/// Copyright (c) 2018-2020 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
|
|
||||||
namespace Results.Output.Printers.Label
|
namespace Results.Output.Printers.Label
|
||||||
@@ -17,5 +17,11 @@ namespace Results.Output.Printers.Label
|
|||||||
public System.Globalization.CultureInfo CultureInfo;
|
public System.Globalization.CultureInfo CultureInfo;
|
||||||
public bool GoodOnly;
|
public bool GoodOnly;
|
||||||
public bool SupressPrinting; /// true = Bypass printing
|
public bool SupressPrinting; /// true = Bypass printing
|
||||||
|
public bool DrawSNasBarcode;
|
||||||
|
public bool IsQR;
|
||||||
|
public int BarcodeLeft;
|
||||||
|
public int BarcodeTop;
|
||||||
|
public int BarcodeWidth;
|
||||||
|
public int BarcodeHeight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,17 +13,25 @@ namespace Results.Output
|
|||||||
{
|
{
|
||||||
public static Chart GetChart(WaterMeter wm, bool isPrinter)
|
public static Chart GetChart(WaterMeter wm, bool isPrinter)
|
||||||
{
|
{
|
||||||
return GetChart(wm, isPrinter, Config.Unit.lph, false);
|
return GetChart(wm, isPrinter, Config.Unit.lph);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Chart GetChart(WaterMeter wm, bool isPrinter, Config.Unit flowUnit, bool isQ4)
|
public static Chart GetChart(WaterMeter wm, bool isPrinter, Config.Unit flowUnit)
|
||||||
{
|
{
|
||||||
|
double maxFlow_m3h = 0;
|
||||||
IList<PointF> unsortedPoints = new List<PointF>();
|
IList<PointF> unsortedPoints = new List<PointF>();
|
||||||
foreach (var mtr in wm.MeterTestRslts)
|
foreach (var mtr in wm.MeterTestRslts)
|
||||||
{
|
{
|
||||||
if (mtr.IsPilotRslt() && mtr.TestRslt.TestData.Evaluate && (mtr.TestRslt.TestTime > 0) && (mtr.TestRslt.PulsesMaster > 0))
|
if (mtr.IsPilotRslt() && mtr.TestRslt.TestData.Evaluate && (mtr.TestRslt.TestTime > 0) && (mtr.TestRslt.PulsesMaster > 0))
|
||||||
{
|
{
|
||||||
double flow = Config.Units.ConvertTo(flowUnit, 3.6 * mtr.TestRslt.VolumeCTV / mtr.TestRslt.TestTime);
|
double flow_m3h = (mtr.TestTime != 0)
|
||||||
|
? (3.6 * mtr.TestRslt.VolumeCTV / mtr.TestTime * mtr.PulsesMaster / mtr.TestRslt.PulsesMaster)
|
||||||
|
: (3.6 * mtr.TestRslt.VolumeCTV / mtr.TestRslt.TestTime);
|
||||||
|
|
||||||
|
if (flow_m3h > maxFlow_m3h) maxFlow_m3h = flow_m3h;
|
||||||
|
|
||||||
|
double flow = Config.Units.ConvertTo(flowUnit, flow_m3h); /// Convert to specified units
|
||||||
|
|
||||||
if (flow > 0)
|
if (flow > 0)
|
||||||
{
|
{
|
||||||
unsortedPoints.Add(new PointF((float)flow, (float)mtr.Error));
|
unsortedPoints.Add(new PointF((float)flow, (float)mtr.Error));
|
||||||
@@ -32,6 +40,8 @@ namespace Results.Output
|
|||||||
}
|
}
|
||||||
IEnumerable<PointF> sortedPoints = unsortedPoints.OrderBy(x => x.X);
|
IEnumerable<PointF> sortedPoints = unsortedPoints.OrderBy(x => x.X);
|
||||||
|
|
||||||
|
bool isQ4 = (maxFlow_m3h > 1.1 * wm.WaterMeterData.Q3_Qn);
|
||||||
|
|
||||||
Chart chart = new Chart
|
Chart chart = new Chart
|
||||||
{
|
{
|
||||||
Name = "chart",
|
Name = "chart",
|
||||||
|
|||||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("2.18.1290.0")]
|
[assembly: AssemblyVersion("2.18.1340.0")]
|
||||||
[assembly: AssemblyFileVersion("2.18.1290.0")]
|
[assembly: AssemblyFileVersion("2.18.1340.0")]
|
||||||
|
|||||||
@@ -0,0 +1,807 @@
|
|||||||
|
<?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>
|
||||||
|
<data name="Add" xml:space="preserve">
|
||||||
|
<value>Ajouter ></value>
|
||||||
|
</data>
|
||||||
|
<data name="Alignment" xml:space="preserve">
|
||||||
|
<value>Alignement</value>
|
||||||
|
</data>
|
||||||
|
<data name="Approval" xml:space="preserve">
|
||||||
|
<value>Approbation</value>
|
||||||
|
</data>
|
||||||
|
<data name="Available_results" xml:space="preserve">
|
||||||
|
<value>Résultats disponibles</value>
|
||||||
|
</data>
|
||||||
|
<data name="Batch_nr" xml:space="preserve">
|
||||||
|
<value>Numéro de lot</value>
|
||||||
|
</data>
|
||||||
|
<data name="Bench" xml:space="preserve">
|
||||||
|
<value>Banc</value>
|
||||||
|
</data>
|
||||||
|
<data name="CancelBtnText" xml:space="preserve">
|
||||||
|
<value>Annuler</value>
|
||||||
|
</data>
|
||||||
|
<data name="Caption" xml:space="preserve">
|
||||||
|
<value>Légende</value>
|
||||||
|
</data>
|
||||||
|
<data name="Configuration" xml:space="preserve">
|
||||||
|
<value>Configuration</value>
|
||||||
|
</data>
|
||||||
|
<data name="Density" xml:space="preserve">
|
||||||
|
<value>Densité</value>
|
||||||
|
</data>
|
||||||
|
<data name="DownBtnText" xml:space="preserve">
|
||||||
|
<value>Vers le bas</value>
|
||||||
|
</data>
|
||||||
|
<data name="End" xml:space="preserve">
|
||||||
|
<value>Fin</value>
|
||||||
|
</data>
|
||||||
|
<data name="EndState_aux" xml:space="preserve">
|
||||||
|
<value>État final aux</value>
|
||||||
|
</data>
|
||||||
|
<data name="EndState_main" xml:space="preserve">
|
||||||
|
<value>État final principal</value>
|
||||||
|
</data>
|
||||||
|
<data name="End_state" xml:space="preserve">
|
||||||
|
<value>État final</value>
|
||||||
|
</data>
|
||||||
|
<data name="ErrLimHi" xml:space="preserve">
|
||||||
|
<value>Err LimHi</value>
|
||||||
|
</data>
|
||||||
|
<data name="ErrLimLo" xml:space="preserve">
|
||||||
|
<value>Err LimLo</value>
|
||||||
|
</data>
|
||||||
|
<data name="Error" xml:space="preserve">
|
||||||
|
<value>Erreur</value>
|
||||||
|
</data>
|
||||||
|
<data name="ErrRef" xml:space="preserve">
|
||||||
|
<value>Err Ref</value>
|
||||||
|
</data>
|
||||||
|
<data name="Err_aux" xml:space="preserve">
|
||||||
|
<value>Err aux</value>
|
||||||
|
</data>
|
||||||
|
<data name="Err_main" xml:space="preserve">
|
||||||
|
<value>Err principale</value>
|
||||||
|
</data>
|
||||||
|
<data name="Flow" xml:space="preserve">
|
||||||
|
<value>Couler</value>
|
||||||
|
</data>
|
||||||
|
<data name="Format" xml:space="preserve">
|
||||||
|
<value>Format</value>
|
||||||
|
</data>
|
||||||
|
<data name="H_amb" xml:space="preserve">
|
||||||
|
<value>Hamb</value>
|
||||||
|
</data>
|
||||||
|
<data name="Item" xml:space="preserve">
|
||||||
|
<value>Article</value>
|
||||||
|
</data>
|
||||||
|
<data name="MClass" xml:space="preserve">
|
||||||
|
<value>MClass</value>
|
||||||
|
</data>
|
||||||
|
<data name="OkBtnText" xml:space="preserve">
|
||||||
|
<value>Oui</value>
|
||||||
|
</data>
|
||||||
|
<data name="PO" xml:space="preserve">
|
||||||
|
<value>Commande</value>
|
||||||
|
</data>
|
||||||
|
<data name="Pos" xml:space="preserve">
|
||||||
|
<value>Pos.</value>
|
||||||
|
</data>
|
||||||
|
<data name="Precision" xml:space="preserve">
|
||||||
|
<value>Précision</value>
|
||||||
|
</data>
|
||||||
|
<data name="Procedure" xml:space="preserve">
|
||||||
|
<value>Procédure</value>
|
||||||
|
</data>
|
||||||
|
<data name="Producer" xml:space="preserve">
|
||||||
|
<value>Producteur</value>
|
||||||
|
</data>
|
||||||
|
<data name="Protocol" xml:space="preserve">
|
||||||
|
<value>Protocole</value>
|
||||||
|
</data>
|
||||||
|
<data name="Pulses" xml:space="preserve">
|
||||||
|
<value>Impulsion</value>
|
||||||
|
</data>
|
||||||
|
<data name="PulsesLiter" xml:space="preserve">
|
||||||
|
<value>Impulsion/litre</value>
|
||||||
|
</data>
|
||||||
|
<data name="P_amb" xml:space="preserve">
|
||||||
|
<value>P amb</value>
|
||||||
|
</data>
|
||||||
|
<data name="P_dn_end" xml:space="preserve">
|
||||||
|
<value>P dn fin</value>
|
||||||
|
</data>
|
||||||
|
<data name="P_dn" xml:space="preserve">
|
||||||
|
<value>P dn</value>
|
||||||
|
</data>
|
||||||
|
<data name="P_dn_start" xml:space="preserve">
|
||||||
|
<value>P dn début</value>
|
||||||
|
</data>
|
||||||
|
<data name="P_up_end" xml:space="preserve">
|
||||||
|
<value>P up fin</value>
|
||||||
|
</data>
|
||||||
|
<data name="P_up" xml:space="preserve">
|
||||||
|
<value>P up</value>
|
||||||
|
</data>
|
||||||
|
<data name="P_up_start" xml:space="preserve">
|
||||||
|
<value>P up début</value>
|
||||||
|
</data>
|
||||||
|
<data name="Q_fall" xml:space="preserve">
|
||||||
|
<value>Q tomber</value>
|
||||||
|
</data>
|
||||||
|
<data name="Q_from" xml:space="preserve">
|
||||||
|
<value>Q de</value>
|
||||||
|
</data>
|
||||||
|
<data name="Q_rise" xml:space="preserve">
|
||||||
|
<value>Q monter</value>
|
||||||
|
</data>
|
||||||
|
<data name="Q_to" xml:space="preserve">
|
||||||
|
<value>Q à</value>
|
||||||
|
</data>
|
||||||
|
<data name="RefPulses" xml:space="preserve">
|
||||||
|
<value>Ref Puls</value>
|
||||||
|
</data>
|
||||||
|
<data name="Remove" xml:space="preserve">
|
||||||
|
<value>< Retirer</value>
|
||||||
|
</data>
|
||||||
|
<data name="Remove_all" xml:space="preserve">
|
||||||
|
<value>Enlever tout</value>
|
||||||
|
</data>
|
||||||
|
<data name="Result" xml:space="preserve">
|
||||||
|
<value>Résultat</value>
|
||||||
|
</data>
|
||||||
|
<data name="Selected_results" xml:space="preserve">
|
||||||
|
<value>Résultats sélectionnés</value>
|
||||||
|
</data>
|
||||||
|
<data name="sn" xml:space="preserve">
|
||||||
|
<value>s/n</value>
|
||||||
|
</data>
|
||||||
|
<data name="sn_aux" xml:space="preserve">
|
||||||
|
<value>s/n aux</value>
|
||||||
|
</data>
|
||||||
|
<data name="sn_main" xml:space="preserve">
|
||||||
|
<value>s/n principale</value>
|
||||||
|
</data>
|
||||||
|
<data name="Start" xml:space="preserve">
|
||||||
|
<value>Début</value>
|
||||||
|
</data>
|
||||||
|
<data name="Test" xml:space="preserve">
|
||||||
|
<value>Test</value>
|
||||||
|
</data>
|
||||||
|
<data name="Test_ID" xml:space="preserve">
|
||||||
|
<value>Test ID</value>
|
||||||
|
</data>
|
||||||
|
<data name="Test_method" xml:space="preserve">
|
||||||
|
<value>Méthode d'essai</value>
|
||||||
|
</data>
|
||||||
|
<data name="Test_vol" xml:space="preserve">
|
||||||
|
<value>Test vol</value>
|
||||||
|
</data>
|
||||||
|
<data name="T_amb" xml:space="preserve">
|
||||||
|
<value>T amb</value>
|
||||||
|
</data>
|
||||||
|
<data name="T_div" xml:space="preserve">
|
||||||
|
<value>T div</value>
|
||||||
|
</data>
|
||||||
|
<data name="T_end" xml:space="preserve">
|
||||||
|
<value>T fin</value>
|
||||||
|
</data>
|
||||||
|
<data name="T_in" xml:space="preserve">
|
||||||
|
<value>T dans</value>
|
||||||
|
</data>
|
||||||
|
<data name="T_out" xml:space="preserve">
|
||||||
|
<value>T en dehors</value>
|
||||||
|
</data>
|
||||||
|
<data name="T_s" xml:space="preserve">
|
||||||
|
<value>T [s]</value>
|
||||||
|
</data>
|
||||||
|
<data name="T_start" xml:space="preserve">
|
||||||
|
<value>T début</value>
|
||||||
|
</data>
|
||||||
|
<data name="Uncertainty" xml:space="preserve">
|
||||||
|
<value>Incertitude</value>
|
||||||
|
</data>
|
||||||
|
<data name="Units" xml:space="preserve">
|
||||||
|
<value>Unités</value>
|
||||||
|
</data>
|
||||||
|
<data name="UpBtnText" xml:space="preserve">
|
||||||
|
<value>En haut</value>
|
||||||
|
</data>
|
||||||
|
<data name="User" xml:space="preserve">
|
||||||
|
<value>Utilisateur</value>
|
||||||
|
</data>
|
||||||
|
<data name="User_nr" xml:space="preserve">
|
||||||
|
<value>N° Utilisateur</value>
|
||||||
|
</data>
|
||||||
|
<data name="Ver" xml:space="preserve">
|
||||||
|
<value>Ver.</value>
|
||||||
|
</data>
|
||||||
|
<data name="VolRef" xml:space="preserve">
|
||||||
|
<value>Vol ref.</value>
|
||||||
|
</data>
|
||||||
|
<data name="Volume" xml:space="preserve">
|
||||||
|
<value>Le volume</value>
|
||||||
|
</data>
|
||||||
|
<data name="Width" xml:space="preserve">
|
||||||
|
<value>Largeur</value>
|
||||||
|
</data>
|
||||||
|
<data name="WMs" xml:space="preserve">
|
||||||
|
<value>CEs</value>
|
||||||
|
</data>
|
||||||
|
<data name="WM_Type" xml:space="preserve">
|
||||||
|
<value>CE Type</value>
|
||||||
|
</data>
|
||||||
|
<data name="Year" xml:space="preserve">
|
||||||
|
<value>Année</value>
|
||||||
|
</data>
|
||||||
|
<data name="Results" xml:space="preserve">
|
||||||
|
<value>Résultats</value>
|
||||||
|
</data>
|
||||||
|
<data name="Remark" xml:space="preserve">
|
||||||
|
<value>Remarque</value>
|
||||||
|
</data>
|
||||||
|
<data name="Result_code" xml:space="preserve">
|
||||||
|
<value>Code de résultat</value>
|
||||||
|
</data>
|
||||||
|
<data name="Mounting" xml:space="preserve">
|
||||||
|
<value>Montage</value>
|
||||||
|
</data>
|
||||||
|
<data name="Energy" xml:space="preserve">
|
||||||
|
<value>Énergie</value>
|
||||||
|
</data>
|
||||||
|
<data name="Energy_ref" xml:space="preserve">
|
||||||
|
<value>Énergie ref</value>
|
||||||
|
</data>
|
||||||
|
<data name="P_delta" xml:space="preserve">
|
||||||
|
<value>P delta</value>
|
||||||
|
</data>
|
||||||
|
<data name="P_delta_end" xml:space="preserve">
|
||||||
|
<value>P delta fin</value>
|
||||||
|
</data>
|
||||||
|
<data name="P_delta_mean" xml:space="preserve">
|
||||||
|
<value>P delta moyenne</value>
|
||||||
|
</data>
|
||||||
|
<data name="P_delta_start" xml:space="preserve">
|
||||||
|
<value>P delta début</value>
|
||||||
|
</data>
|
||||||
|
<data name="Meter_type" xml:space="preserve">
|
||||||
|
<value>Type de compteur</value>
|
||||||
|
</data>
|
||||||
|
<data name="Compound" xml:space="preserve">
|
||||||
|
<value>Composé</value>
|
||||||
|
</data>
|
||||||
|
<data name="Heat_meter" xml:space="preserve">
|
||||||
|
<value>Thermomètre</value>
|
||||||
|
</data>
|
||||||
|
<data name="Single" xml:space="preserve">
|
||||||
|
<value>Unique</value>
|
||||||
|
</data>
|
||||||
|
<data name="Page" xml:space="preserve">
|
||||||
|
<value>Page</value>
|
||||||
|
</data>
|
||||||
|
<data name="End_volume" xml:space="preserve">
|
||||||
|
<value>Volume fin</value>
|
||||||
|
</data>
|
||||||
|
<data name="Start_volume" xml:space="preserve">
|
||||||
|
<value>Volume début</value>
|
||||||
|
</data>
|
||||||
|
<data name="End_volume_aux" xml:space="preserve">
|
||||||
|
<value>Fin volume aux</value>
|
||||||
|
</data>
|
||||||
|
<data name="End_volume_main" xml:space="preserve">
|
||||||
|
<value>Fin volume principale</value>
|
||||||
|
</data>
|
||||||
|
<data name="Start_volume_aux" xml:space="preserve">
|
||||||
|
<value>Début volume aux</value>
|
||||||
|
</data>
|
||||||
|
<data name="Start_volume_main" xml:space="preserve">
|
||||||
|
<value>Début volume principale</value>
|
||||||
|
</data>
|
||||||
|
<data name="Volume_aux" xml:space="preserve">
|
||||||
|
<value>Volume aux</value>
|
||||||
|
</data>
|
||||||
|
<data name="Volume_main" xml:space="preserve">
|
||||||
|
<value>Volume principale</value>
|
||||||
|
</data>
|
||||||
|
<data name="End_mass" xml:space="preserve">
|
||||||
|
<value>Fin masse</value>
|
||||||
|
</data>
|
||||||
|
<data name="Start_mass" xml:space="preserve">
|
||||||
|
<value>Début masse</value>
|
||||||
|
</data>
|
||||||
|
<data name="Category" xml:space="preserve">
|
||||||
|
<value>Catégorie</value>
|
||||||
|
</data>
|
||||||
|
<data name="Quantity" xml:space="preserve">
|
||||||
|
<value>Quantité</value>
|
||||||
|
</data>
|
||||||
|
<data name="Water_Meter" xml:space="preserve">
|
||||||
|
<value>Compteur d'eau</value>
|
||||||
|
</data>
|
||||||
|
<data name="VName_Flow" xml:space="preserve">
|
||||||
|
<value>Q</value>
|
||||||
|
</data>
|
||||||
|
<data name="VName_Press" xml:space="preserve">
|
||||||
|
<value>Press.</value>
|
||||||
|
</data>
|
||||||
|
<data name="VName_Temp" xml:space="preserve">
|
||||||
|
<value>Temp.</value>
|
||||||
|
</data>
|
||||||
|
<data name="VName_Dens" xml:space="preserve">
|
||||||
|
<value>Ro</value>
|
||||||
|
</data>
|
||||||
|
<data name="VName_Humi" xml:space="preserve">
|
||||||
|
<value>Hu.</value>
|
||||||
|
</data>
|
||||||
|
<data name="VName_Mass" xml:space="preserve">
|
||||||
|
<value>Masse</value>
|
||||||
|
</data>
|
||||||
|
<data name="VName_TstTime" xml:space="preserve">
|
||||||
|
<value>Tau</value>
|
||||||
|
</data>
|
||||||
|
<data name="VName_Vol" xml:space="preserve">
|
||||||
|
<value>Vol.</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_P_de_ac" xml:space="preserve">
|
||||||
|
<value>Différence de pression mesurée par delta P mètre - réelle</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_P_de_avg" xml:space="preserve">
|
||||||
|
<value>Différence de pression mesurée par delta P mètre - moyenne</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_P_de_en" xml:space="preserve">
|
||||||
|
<value>Différence de pression mesurée par delta P mètre - à la fin de l'essai</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_P_de_me" xml:space="preserve">
|
||||||
|
<value>Différence de pression mesurée par delta P mètre - moyenne</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_P_de_st" xml:space="preserve">
|
||||||
|
<value>Différence de pression mesurée par delta P mètre - au début de l'essai</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_P_dw_ac" xml:space="preserve">
|
||||||
|
<value>Pression à la sortie réelle</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_P_dw_avg" xml:space="preserve">
|
||||||
|
<value>Pression moyenne à la sortie</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_P_dw_en" xml:space="preserve">
|
||||||
|
<value>Pression à la sortie à la fin du test</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_P_dw_me" xml:space="preserve">
|
||||||
|
<value>Pression moyenne à la sortie</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_P_dw_st" xml:space="preserve">
|
||||||
|
<value>Pression à la sortie au début du test</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_P_up_ac" xml:space="preserve">
|
||||||
|
<value>Pression à l'entrée réelle</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_P_up_avg" xml:space="preserve">
|
||||||
|
<value>Pression moyenne à l'entrée</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_P_up_en" xml:space="preserve">
|
||||||
|
<value>Pression à l'entrée à la fin de l'essai</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_P_up_me" xml:space="preserve">
|
||||||
|
<value>Pression moyenne à l'entrée</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_P_up_st" xml:space="preserve">
|
||||||
|
<value>Pression à l'entrée au début de l'essai</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_Q_m_r" xml:space="preserve">
|
||||||
|
<value>Débit calculé à partir de la masse vraie et du temps conventionnels</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_Q_riac" xml:space="preserve">
|
||||||
|
<value>Débit obtenu à partir du compteur principal - réel</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_Q_rim" xml:space="preserve">
|
||||||
|
<value>Débit obtenu à partir du compteur principal - moyenne</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_Q_v_r" xml:space="preserve">
|
||||||
|
<value>Débit mesuré par le débitmètre de référence</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_di_ac" xml:space="preserve">
|
||||||
|
<value>Température réelle au déviateur</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_di_avg" xml:space="preserve">
|
||||||
|
<value>Température moyenne au déviateur</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_di_en" xml:space="preserve">
|
||||||
|
<value>Température au déviateur à la fin du test - 4 dernières mesures avant la fin</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_di_me" xml:space="preserve">
|
||||||
|
<value>Température moyenne au déviateur</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_di_st" xml:space="preserve">
|
||||||
|
<value>Température au déviateur au début du test - 4 premières mesures après le début</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_dw_ac" xml:space="preserve">
|
||||||
|
<value>Température réelle à la sortie</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_dw_avg" xml:space="preserve">
|
||||||
|
<value>Température moyenne à la sortie</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_dw_en" xml:space="preserve">
|
||||||
|
<value>Température à la sortie à la fin du test - 4 dernières mesures avant la fin</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_dw_me" xml:space="preserve">
|
||||||
|
<value>Température moyenne à la sortie</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_dw_st" xml:space="preserve">
|
||||||
|
<value>Température à la sortie au début du test - 4 premières mesures après le début</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_up_ac" xml:space="preserve">
|
||||||
|
<value>Température réelle à l'entrée</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_up_avg" xml:space="preserve">
|
||||||
|
<value>Température moyenne à l'entrée lors d'un test</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_up_en" xml:space="preserve">
|
||||||
|
<value>Température à l'entrée à la fin de l'essai - 4 dernières mesures avant la fin</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_up_me" xml:space="preserve">
|
||||||
|
<value>Température moyenne à l'entrée lors d'un test</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_up_st" xml:space="preserve">
|
||||||
|
<value>Température d'entrée au début du test - 4 premières mesures après le début</value>
|
||||||
|
</data>
|
||||||
|
<data name="aux" xml:space="preserve">
|
||||||
|
<value>aux.</value>
|
||||||
|
</data>
|
||||||
|
<data name="main" xml:space="preserve">
|
||||||
|
<value>principale</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_E_rel" xml:space="preserve">
|
||||||
|
<value>Erreur relative d'un compteur</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_E_rel_ref" xml:space="preserve">
|
||||||
|
<value>Erreur relative du compteur maître</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_sn" xml:space="preserve">
|
||||||
|
<value>Numéro de série du compteur</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_sn_aux" xml:space="preserve">
|
||||||
|
<value>Numéro de série du compteur auxiliaire d'un compteur d'eau composé</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_sn_main" xml:space="preserve">
|
||||||
|
<value>Numéro de série du compteur principal d'un compteur d'eau composé</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_Vol_Mt" xml:space="preserve">
|
||||||
|
<value>Volume mesuré par le compteur testé</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_Vol_rm" xml:space="preserve">
|
||||||
|
<value>Volume de référence pour compteur testé</value>
|
||||||
|
</data>
|
||||||
|
<data name="VName_Error" xml:space="preserve">
|
||||||
|
<value>E</value>
|
||||||
|
</data>
|
||||||
|
<data name="fall" xml:space="preserve">
|
||||||
|
<value>tomber</value>
|
||||||
|
</data>
|
||||||
|
<data name="from" xml:space="preserve">
|
||||||
|
<value>de</value>
|
||||||
|
</data>
|
||||||
|
<data name="rise" xml:space="preserve">
|
||||||
|
<value>monter</value>
|
||||||
|
</data>
|
||||||
|
<data name="to" xml:space="preserve">
|
||||||
|
<value>à</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_Hu_Amb_M" xml:space="preserve">
|
||||||
|
<value>Humidité ambiante pendant le test</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_P_Amb_M" xml:space="preserve">
|
||||||
|
<value>Pression ambiante pendant le test</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_Amb_M" xml:space="preserve">
|
||||||
|
<value>Température ambiante pendant le test</value>
|
||||||
|
</data>
|
||||||
|
<data name="Test_done" xml:space="preserve">
|
||||||
|
<value>Test fait</value>
|
||||||
|
</data>
|
||||||
|
<data name="Test_passed" xml:space="preserve">
|
||||||
|
<value>Test réussi</value>
|
||||||
|
</data>
|
||||||
|
<data name="No" xml:space="preserve">
|
||||||
|
<value>Non</value>
|
||||||
|
</data>
|
||||||
|
<data name="Yes" xml:space="preserve">
|
||||||
|
<value>Oui</value>
|
||||||
|
</data>
|
||||||
|
<data name="Density_correction" xml:space="preserve">
|
||||||
|
<value>Correction densité</value>
|
||||||
|
</data>
|
||||||
|
<data name="Error_flags" xml:space="preserve">
|
||||||
|
<value>Drapeaux erreur</value>
|
||||||
|
</data>
|
||||||
|
<data name="Legalizator" xml:space="preserve">
|
||||||
|
<value>Légalisateur</value>
|
||||||
|
</data>
|
||||||
|
<data name="User_description" xml:space="preserve">
|
||||||
|
<value>Description utilisateur</value>
|
||||||
|
</data>
|
||||||
|
<data name="Failed_meters_count" xml:space="preserve">
|
||||||
|
<value>Compteur échoué</value>
|
||||||
|
</data>
|
||||||
|
<data name="Passed_meters_count" xml:space="preserve">
|
||||||
|
<value>Mètres passés</value>
|
||||||
|
</data>
|
||||||
|
<data name="sensitivity" xml:space="preserve">
|
||||||
|
<value>sensibilité</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_Q_end" xml:space="preserve">
|
||||||
|
<value>Débit obtenu à partir du compteur principal - fin</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_Q_max" xml:space="preserve">
|
||||||
|
<value>Débit obtenu à partir du compteur principal - max.</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_Q_min" xml:space="preserve">
|
||||||
|
<value>Débit obtenu à partir du compteur principal - min</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_Q_start" xml:space="preserve">
|
||||||
|
<value>Débit obtenu à partir du compteur principal - départ</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_P_dw_max" xml:space="preserve">
|
||||||
|
<value>Pression maximale à la sortie pendant le test</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_P_dw_min" xml:space="preserve">
|
||||||
|
<value>Pression minimale à la sortie pendant le test</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_P_up_max" xml:space="preserve">
|
||||||
|
<value>Pression maximale à l'entrée pendant l'essai</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_P_up_min" xml:space="preserve">
|
||||||
|
<value>Pression minimale à l'entrée lors de l'essai</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_di_max" xml:space="preserve">
|
||||||
|
<value>Température maximale au déviateur pendant le test</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_di_min" xml:space="preserve">
|
||||||
|
<value>Température minimale au déviateur pendant le test</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_dw_max" xml:space="preserve">
|
||||||
|
<value>Température maximale à la sortie pendant le test</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_dw_min" xml:space="preserve">
|
||||||
|
<value>Température minimale à la sortie pendant le test</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_up_max" xml:space="preserve">
|
||||||
|
<value>Température maximale à l'entrée pendant le test</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_up_min" xml:space="preserve">
|
||||||
|
<value>Température minimale à l'entrée pendant l'essai</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_P_de_max" xml:space="preserve">
|
||||||
|
<value>Différence de pression mesurée par delta P mètre - maximum pendant le test</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_P_de_min" xml:space="preserve">
|
||||||
|
<value>Différence de pression mesurée par delta P mètre - minimum pendant l'essai</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_Rho_Wa_calc" xml:space="preserve">
|
||||||
|
<value>Densité calculée de l'eau à partir d'une table ou d'une formule à la température d'étalonnage de la densité de l'eau (r)</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_rho_0" xml:space="preserve">
|
||||||
|
<value>Température de l'échantillon d'eau lors de l'étalonnage de la densité de l'eau</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_ln_ac" xml:space="preserve">
|
||||||
|
<value>Température réelle dans la ligne</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_ln_avg" xml:space="preserve">
|
||||||
|
<value>Température moyenne dans la ligne pendant un test</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_ln_en" xml:space="preserve">
|
||||||
|
<value>Température dans la ligne à la fin du test - 4 dernières mesures avant la fin</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_ln_max" xml:space="preserve">
|
||||||
|
<value>Température maximale dans la ligne pendant le test</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_ln_me" xml:space="preserve">
|
||||||
|
<value>Température moyenne dans la ligne pendant un test</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_ln_min" xml:space="preserve">
|
||||||
|
<value>Température minimale dans la ligne pendant le test</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_T_ln_st" xml:space="preserve">
|
||||||
|
<value>Température dans la ligne au début du test - 4 premières mesures après le début</value>
|
||||||
|
</data>
|
||||||
|
<data name="Unit" xml:space="preserve">
|
||||||
|
<value>Unité</value>
|
||||||
|
</data>
|
||||||
|
<data name="Procedure_description" xml:space="preserve">
|
||||||
|
<value>Description procédure</value>
|
||||||
|
</data>
|
||||||
|
<data name="Bench_ID" xml:space="preserve">
|
||||||
|
<value>ID banc</value>
|
||||||
|
</data>
|
||||||
|
<data name="Bench_name" xml:space="preserve">
|
||||||
|
<value>Nom banc</value>
|
||||||
|
</data>
|
||||||
|
<data name="Address" xml:space="preserve">
|
||||||
|
<value>Adresse</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_E_rel_last" xml:space="preserve">
|
||||||
|
<value>Erreur relative d'un compteur dans un test précédent / en production</value>
|
||||||
|
</data>
|
||||||
|
<data name="Batch" xml:space="preserve">
|
||||||
|
<value>Lot</value>
|
||||||
|
</data>
|
||||||
|
<data name="repetition" xml:space="preserve">
|
||||||
|
<value>répétition</value>
|
||||||
|
</data>
|
||||||
|
<data name="Invalid_Q2_correction_factors" xml:space="preserve">
|
||||||
|
<value>Facteurs correction Q2 non valides</value>
|
||||||
|
</data>
|
||||||
|
<data name="Previous_step_is_missing_or_NOK" xml:space="preserve">
|
||||||
|
<value>L'étape précédente est manquante ou NOK</value>
|
||||||
|
</data>
|
||||||
|
<data name="Test_repetition_count_exceeded_upper_limit" xml:space="preserve">
|
||||||
|
<value>nombre répétitions test dépasse limite supérieure</value>
|
||||||
|
</data>
|
||||||
|
<data name="Wrong_iPerl_counting_direction" xml:space="preserve">
|
||||||
|
<value>Mauvais sens comptage iPerl</value>
|
||||||
|
</data>
|
||||||
|
<data name="Failed" xml:space="preserve">
|
||||||
|
<value>Échoué</value>
|
||||||
|
</data>
|
||||||
|
<data name="Passed" xml:space="preserve">
|
||||||
|
<value>Passé</value>
|
||||||
|
</data>
|
||||||
|
<data name="Test_in_progress" xml:space="preserve">
|
||||||
|
<value>Test en cours</value>
|
||||||
|
</data>
|
||||||
|
<data name="Counter_0" xml:space="preserve">
|
||||||
|
<value>Compteur {0}</value>
|
||||||
|
</data>
|
||||||
|
<data name="Date_and_time" xml:space="preserve">
|
||||||
|
<value>Date et heure</value>
|
||||||
|
</data>
|
||||||
|
<data name="Name" xml:space="preserve">
|
||||||
|
<value>Prénom</value>
|
||||||
|
</data>
|
||||||
|
<data name="Step" xml:space="preserve">
|
||||||
|
<value>Étape</value>
|
||||||
|
</data>
|
||||||
|
<data name="Workplace" xml:space="preserve">
|
||||||
|
<value>Lieu travail</value>
|
||||||
|
</data>
|
||||||
|
<data name="Workflow" xml:space="preserve">
|
||||||
|
<value>Flux travail</value>
|
||||||
|
</data>
|
||||||
|
<data name="Production_tracing_results" xml:space="preserve">
|
||||||
|
<value>Résultats production</value>
|
||||||
|
</data>
|
||||||
|
<data name="Code" xml:space="preserve">
|
||||||
|
<value>Code</value>
|
||||||
|
</data>
|
||||||
|
<data name="Part" xml:space="preserve">
|
||||||
|
<value>Partie</value>
|
||||||
|
</data>
|
||||||
|
<data name="All_results" xml:space="preserve">
|
||||||
|
<value>Tous résultats</value>
|
||||||
|
</data>
|
||||||
|
<data name="Graphs" xml:space="preserve">
|
||||||
|
<value>Graphiques</value>
|
||||||
|
</data>
|
||||||
|
<data name="No_water_meter" xml:space="preserve">
|
||||||
|
<value>Pas de compteur</value>
|
||||||
|
</data>
|
||||||
|
<data name="Serial_number_is_missing" xml:space="preserve">
|
||||||
|
<value>Numérotation en série</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
@@ -35,6 +35,9 @@
|
|||||||
<Reference Include="FluentNHibernate">
|
<Reference Include="FluentNHibernate">
|
||||||
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
|
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="Gma.QrCodeNet.Encoding">
|
||||||
|
<HintPath>..\packages\QrCode.Net.0.4.0.0\net40\Gma.QrCodeNet.Encoding.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Iesi.Collections">
|
<Reference Include="Iesi.Collections">
|
||||||
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@@ -217,6 +220,7 @@
|
|||||||
<EmbeddedResource Include="Resources\Strings.de.resx">
|
<EmbeddedResource Include="Resources\Strings.de.resx">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Resources\Strings.fr.resx" />
|
||||||
<EmbeddedResource Include="Resources\Strings.it.resx" />
|
<EmbeddedResource Include="Resources\Strings.it.resx" />
|
||||||
<EmbeddedResource Include="Resources\Strings.pl.resx" />
|
<EmbeddedResource Include="Resources\Strings.pl.resx" />
|
||||||
<EmbeddedResource Include="Resources\Strings.resx">
|
<EmbeddedResource Include="Resources\Strings.resx">
|
||||||
|
|||||||
+5
-1
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2016-2018 Sensus Slovensko a.s.
|
/// Copyright (c) 2016-2019 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -30,6 +30,8 @@ namespace Results
|
|||||||
case 10: return 38; /// WR14
|
case 10: return 38; /// WR14
|
||||||
case 11: return 39; /// WR18
|
case 11: return 39; /// WR18
|
||||||
case 12: return 40; /// WR19
|
case 12: return 40; /// WR19
|
||||||
|
case 13: return 41; /// WR20
|
||||||
|
case 14: return 42; /// WR21
|
||||||
default: return 0;
|
default: return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -47,6 +49,8 @@ namespace Results
|
|||||||
case 10: return "WR14";
|
case 10: return "WR14";
|
||||||
case 11: return "WR18";
|
case 11: return "WR18";
|
||||||
case 12: return "WR19";
|
case 12: return "WR19";
|
||||||
|
case 13: return "WR20";
|
||||||
|
case 14: return "WR21";
|
||||||
default: return string.Empty;
|
default: return string.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,306 @@
|
|||||||
|
<?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>
|
||||||
|
<data name="Error" xml:space="preserve">
|
||||||
|
<value>Erreur</value>
|
||||||
|
</data>
|
||||||
|
<data name="Test_bench" xml:space="preserve">
|
||||||
|
<value>Banc essai</value>
|
||||||
|
</data>
|
||||||
|
<data name="Name" xml:space="preserve">
|
||||||
|
<value>Prénom</value>
|
||||||
|
</data>
|
||||||
|
<data name="CancelBtnText" xml:space="preserve">
|
||||||
|
<value>Annuler</value>
|
||||||
|
</data>
|
||||||
|
<data name="OkBtnText" xml:space="preserve">
|
||||||
|
<value>Ok</value>
|
||||||
|
</data>
|
||||||
|
<data name="ConfigureDatabaseText" xml:space="preserve">
|
||||||
|
<value>Configurer les bancs d'essai (mot de passe requis)</value>
|
||||||
|
</data>
|
||||||
|
<data name="ExitBtnText" xml:space="preserve">
|
||||||
|
<value>Quitter </value>
|
||||||
|
</data>
|
||||||
|
<data name="Procedure" xml:space="preserve">
|
||||||
|
<value>Procédure</value>
|
||||||
|
</data>
|
||||||
|
<data name="Test" xml:space="preserve">
|
||||||
|
<value>Tester</value>
|
||||||
|
</data>
|
||||||
|
<data name="Component" xml:space="preserve">
|
||||||
|
<value>Composant</value>
|
||||||
|
</data>
|
||||||
|
<data name="Configure" xml:space="preserve">
|
||||||
|
<value>Configurer</value>
|
||||||
|
</data>
|
||||||
|
<data name="Printer" xml:space="preserve">
|
||||||
|
<value>Imprimante</value>
|
||||||
|
</data>
|
||||||
|
<data name="Question" xml:space="preserve">
|
||||||
|
<value>Question</value>
|
||||||
|
</data>
|
||||||
|
<data name="Connection_string" xml:space="preserve">
|
||||||
|
<value>Chaîne connexion</value>
|
||||||
|
</data>
|
||||||
|
<data name="Add" xml:space="preserve">
|
||||||
|
<value>&Ajouter ></value>
|
||||||
|
</data>
|
||||||
|
<data name="Message" xml:space="preserve">
|
||||||
|
<value>Message</value>
|
||||||
|
</data>
|
||||||
|
<data name="Data" xml:space="preserve">
|
||||||
|
<value>Données</value>
|
||||||
|
</data>
|
||||||
|
<data name="Protocol" xml:space="preserve">
|
||||||
|
<value>Protocole</value>
|
||||||
|
</data>
|
||||||
|
<data name="Serial_Number" xml:space="preserve">
|
||||||
|
<value>Numéro série</value>
|
||||||
|
</data>
|
||||||
|
<data name="Language" xml:space="preserve">
|
||||||
|
<value>Langue</value>
|
||||||
|
</data>
|
||||||
|
<data name="Add_filter" xml:space="preserve">
|
||||||
|
<value>Ajouter filtre</value>
|
||||||
|
</data>
|
||||||
|
<data name="Clear_filters" xml:space="preserve">
|
||||||
|
<value>Effacer filtres</value>
|
||||||
|
</data>
|
||||||
|
<data name="Execute_query" xml:space="preserve">
|
||||||
|
<value>Exécuter ordre</value>
|
||||||
|
</data>
|
||||||
|
<data name="Export_query_results" xml:space="preserve">
|
||||||
|
<value>Résultats exportation</value>
|
||||||
|
</data>
|
||||||
|
<data name="Filters" xml:space="preserve">
|
||||||
|
<value>Filtres</value>
|
||||||
|
</data>
|
||||||
|
<data name="Format_of_results" xml:space="preserve">
|
||||||
|
<value>Configurer la sortie</value>
|
||||||
|
</data>
|
||||||
|
<data name="Load_filters" xml:space="preserve">
|
||||||
|
<value>charge filters</value>
|
||||||
|
</data>
|
||||||
|
<data name="Print_query_results" xml:space="preserve">
|
||||||
|
<value>Résultats impression</value>
|
||||||
|
</data>
|
||||||
|
<data name="Query_results" xml:space="preserve">
|
||||||
|
<value>Résultats requête</value>
|
||||||
|
</data>
|
||||||
|
<data name="Results_Browser" xml:space="preserve">
|
||||||
|
<value>Résultats Browser</value>
|
||||||
|
</data>
|
||||||
|
<data name="Save_filters" xml:space="preserve">
|
||||||
|
<value>Enregistrer filtres</value>
|
||||||
|
</data>
|
||||||
|
<data name="Settings" xml:space="preserve">
|
||||||
|
<value>Réglages</value>
|
||||||
|
</data>
|
||||||
|
<data name="Test_benches" xml:space="preserve">
|
||||||
|
<value>Bancs essai</value>
|
||||||
|
</data>
|
||||||
|
<data name="RetryDatabaseText" xml:space="preserve">
|
||||||
|
<value>Recommencez</value>
|
||||||
|
</data>
|
||||||
|
<data name="Date" xml:space="preserve">
|
||||||
|
<value>Date</value>
|
||||||
|
</data>
|
||||||
|
<data name="From" xml:space="preserve">
|
||||||
|
<value>De</value>
|
||||||
|
</data>
|
||||||
|
<data name="To" xml:space="preserve">
|
||||||
|
<value>À</value>
|
||||||
|
</data>
|
||||||
|
<data name="Statistics" xml:space="preserve">
|
||||||
|
<value>Statistiques</value>
|
||||||
|
</data>
|
||||||
|
<data name="Columns" xml:space="preserve">
|
||||||
|
<value>colonnes</value>
|
||||||
|
</data>
|
||||||
|
<data name="Rows" xml:space="preserve">
|
||||||
|
<value>Lignes</value>
|
||||||
|
</data>
|
||||||
|
<data name="Select_a_filter" xml:space="preserve">
|
||||||
|
<value>Sélectionnez filtre</value>
|
||||||
|
</data>
|
||||||
|
<data name="Error_displaying_results" xml:space="preserve">
|
||||||
|
<value>Erreur affichage résultats</value>
|
||||||
|
</data>
|
||||||
|
<data name="All_files" xml:space="preserve">
|
||||||
|
<value>Tous fichiers</value>
|
||||||
|
</data>
|
||||||
|
<data name="Error_saving_file" xml:space="preserve">
|
||||||
|
<value>Fichier sauvegarde erreurs</value>
|
||||||
|
</data>
|
||||||
|
<data name="Error_serializing_filters" xml:space="preserve">
|
||||||
|
<value>Erreurs sérialisation filtres</value>
|
||||||
|
</data>
|
||||||
|
<data name="Query_files" xml:space="preserve">
|
||||||
|
<value>Fichiers requête</value>
|
||||||
|
</data>
|
||||||
|
<data name="No_program_settings_found" xml:space="preserve">
|
||||||
|
<value>Aucun paramètre programme trouvé</value>
|
||||||
|
</data>
|
||||||
|
<data name="Using_default_settings" xml:space="preserve">
|
||||||
|
<value>Utilisation valeurs par défaut</value>
|
||||||
|
</data>
|
||||||
|
<data name="Selected_language_not_supported" xml:space="preserve">
|
||||||
|
<value>Langue sélectionnée non prise en charge</value>
|
||||||
|
</data>
|
||||||
|
<data name="Using_English" xml:space="preserve">
|
||||||
|
<value>Utilisation anglais</value>
|
||||||
|
</data>
|
||||||
|
<data name="Warning" xml:space="preserve">
|
||||||
|
<value>Attention</value>
|
||||||
|
</data>
|
||||||
|
<data name="Count" xml:space="preserve">
|
||||||
|
<value>Compter</value>
|
||||||
|
</data>
|
||||||
|
<data name="Format" xml:space="preserve">
|
||||||
|
<value>Format</value>
|
||||||
|
</data>
|
||||||
|
<data name="Page_orientation" xml:space="preserve">
|
||||||
|
<value>Page orientation</value>
|
||||||
|
</data>
|
||||||
|
<data name="Yes_Portrait_No_Landscape" xml:space="preserve">
|
||||||
|
<value>Oui portrait non paysage</value>
|
||||||
|
</data>
|
||||||
|
<data name="Print" xml:space="preserve">
|
||||||
|
<value>Impression</value>
|
||||||
|
</data>
|
||||||
|
<data name="Configure_printer" xml:space="preserve">
|
||||||
|
<value>Configurer impréssion</value>
|
||||||
|
</data>
|
||||||
|
<data name="No_printer_defined" xml:space="preserve">
|
||||||
|
<value>Aucune imprimante définie</value>
|
||||||
|
</data>
|
||||||
|
<data name="Printing_failed" xml:space="preserve">
|
||||||
|
<value>Impression échouée</value>
|
||||||
|
</data>
|
||||||
|
<data name="Printing_completed" xml:space="preserve">
|
||||||
|
<value>Impression terminée</value>
|
||||||
|
</data>
|
||||||
|
<data name="Error_exporting_results" xml:space="preserve">
|
||||||
|
<value>Erreur exportation résultats</value>
|
||||||
|
</data>
|
||||||
|
<data name="Histograms" xml:space="preserve">
|
||||||
|
<value>histogrammes</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
@@ -254,6 +254,7 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<EmbeddedResource Include="Resources\Strings.cs.resx" />
|
<EmbeddedResource Include="Resources\Strings.cs.resx" />
|
||||||
<EmbeddedResource Include="Resources\Strings.de.resx" />
|
<EmbeddedResource Include="Resources\Strings.de.resx" />
|
||||||
|
<EmbeddedResource Include="Resources\Strings.fr.resx" />
|
||||||
<EmbeddedResource Include="Resources\Strings.it.resx" />
|
<EmbeddedResource Include="Resources\Strings.it.resx" />
|
||||||
<EmbeddedResource Include="Resources\Strings.pl.resx">
|
<EmbeddedResource Include="Resources\Strings.pl.resx">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio 2010
|
# Visual Studio 2012
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TBF", "TBF\TBF.csproj", "{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TBF", "TBF\TBF.csproj", "{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
{EFEC8A31-3022-4DA7-A8F6-16D30A94C3FF} = {EFEC8A31-3022-4DA7-A8F6-16D30A94C3FF}
|
{EFEC8A31-3022-4DA7-A8F6-16D30A94C3FF} = {EFEC8A31-3022-4DA7-A8F6-16D30A94C3FF}
|
||||||
{0C0A1F4D-1363-4544-A7C5-196C76D26CCA} = {0C0A1F4D-1363-4544-A7C5-196C76D26CCA}
|
{0C0A1F4D-1363-4544-A7C5-196C76D26CCA} = {0C0A1F4D-1363-4544-A7C5-196C76D26CCA}
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "TBFSetup", "TBFSetup\TBFSetup.vdproj", "{4890DE5C-9F68-40D7-B075-92C8EAB79833}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Results", "Results\Results.csproj", "{9D0DCC88-DC81-47EB-9FDD-4C3907871BFB}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Results", "Results\Results.csproj", "{9D0DCC88-DC81-47EB-9FDD-4C3907871BFB}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Config", "Config\Config.csproj", "{743DF7DB-C7B6-42EB-986D-0F485E5588E4}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Config", "Config\Config.csproj", "{743DF7DB-C7B6-42EB-986D-0F485E5588E4}"
|
||||||
@@ -74,12 +72,6 @@ Global
|
|||||||
{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}.Release|Mixed Platforms.Build.0 = Release|x86
|
{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||||
{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}.Release|x86.ActiveCfg = Release|x86
|
{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}.Release|x86.ActiveCfg = Release|x86
|
||||||
{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}.Release|x86.Build.0 = Release|x86
|
{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}.Release|x86.Build.0 = Release|x86
|
||||||
{4890DE5C-9F68-40D7-B075-92C8EAB79833}.Debug|Any CPU.ActiveCfg = Debug
|
|
||||||
{4890DE5C-9F68-40D7-B075-92C8EAB79833}.Debug|Mixed Platforms.ActiveCfg = Debug
|
|
||||||
{4890DE5C-9F68-40D7-B075-92C8EAB79833}.Debug|x86.ActiveCfg = Debug
|
|
||||||
{4890DE5C-9F68-40D7-B075-92C8EAB79833}.Release|Any CPU.ActiveCfg = Release
|
|
||||||
{4890DE5C-9F68-40D7-B075-92C8EAB79833}.Release|Mixed Platforms.ActiveCfg = Release
|
|
||||||
{4890DE5C-9F68-40D7-B075-92C8EAB79833}.Release|x86.ActiveCfg = Release
|
|
||||||
{9D0DCC88-DC81-47EB-9FDD-4C3907871BFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{9D0DCC88-DC81-47EB-9FDD-4C3907871BFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{9D0DCC88-DC81-47EB-9FDD-4C3907871BFB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
{9D0DCC88-DC81-47EB-9FDD-4C3907871BFB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||||
{9D0DCC88-DC81-47EB-9FDD-4C3907871BFB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
{9D0DCC88-DC81-47EB-9FDD-4C3907871BFB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||||
|
|||||||
@@ -470,19 +470,22 @@ namespace TBF.BenchControl.DataEntry.StandardCamera
|
|||||||
private void endTextBox24_TextChanged(object sender, EventArgs e) { UpdateExclamation(23); }
|
private void endTextBox24_TextChanged(object sender, EventArgs e) { UpdateExclamation(23); }
|
||||||
///
|
///
|
||||||
void UpdateExclamation(int uiCtrlPos) /// uiCtrlPos = 0 .. TextBoxesCount-1
|
void UpdateExclamation(int uiCtrlPos) /// uiCtrlPos = 0 .. TextBoxesCount-1
|
||||||
|
{
|
||||||
|
if ((mode == Tst.End) || (mode == Tst.Both))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
double startVolumeLtr = Utils.ParseUDouble(startTextBoxes[uiCtrlPos].Text) * regReaders[phys2wm[uiCtrlPos] - 1].LtrsPerPulse;
|
double startVolumeLtr = Utils.ParseUDouble(startTextBoxes[uiCtrlPos].Text) * regReaders[phys2wm[uiCtrlPos] - 1].LtrsPerPulse;
|
||||||
double endVolumeLtr = Utils.ParseUDouble(endTextBoxes[uiCtrlPos].Text) * regReaders[phys2wm[uiCtrlPos] - 1].LtrsPerPulse;
|
double endVolumeLtr = Utils.ParseUDouble(endTextBoxes[uiCtrlPos].Text) * regReaders[phys2wm[uiCtrlPos] - 1].LtrsPerPulse;
|
||||||
double err = 100.0 * (endVolumeLtr - startVolumeLtr - refVolume) / refVolume;
|
double err = 100.0 * (endVolumeLtr - startVolumeLtr - refVolume) / refVolume;
|
||||||
exclamations[uiCtrlPos].Visible = (err < warningLimLo) || (err > warningLimHi);
|
exclamations[uiCtrlPos].Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
exclamations[uiCtrlPos].Visible = false;
|
exclamations[uiCtrlPos].Visible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void startTextBox1_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox1); }
|
private void startTextBox1_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox1); }
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace TBF.BenchControl.Elde
|
|||||||
EnduranceCycleStop = 13,
|
EnduranceCycleStop = 13,
|
||||||
}
|
}
|
||||||
|
|
||||||
#if FUZHOU_300 || IZRAEL_200 || TORINO_50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TURA_IPERL || TURA_IPERL_NEW || TURA_SPECIAL || BADGER_VELKA_TRAT || PUCHONG_200 || SLM_50 || GENESIS || MALTA_WSD25 || SLM_END || WARSAW_END || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || DEWA_300 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || SENTEC || FUZHOU_100 || CEVAK_200 || IZRAEL_50
|
#if FUZHOU_300 || IZRAEL_200 || TORINO_50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TURA_IPERL || TURA_IPERL_NEW || TURA_SPECIAL || BADGER_VELKA_TRAT || PUCHONG_200 || SLM_50 || GENESIS || MALTA_WSD25 || SLM_END || WARSAW_END || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || DEWA_300 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || SENTEC || FUZHOU_100 || CEVAK_200 || IZRAEL_50 || ALZIR_25
|
||||||
public enum StatusP : ulong
|
public enum StatusP : ulong
|
||||||
{
|
{
|
||||||
RefFlowMeterMask = 0x7, /// bits 0,1,2
|
RefFlowMeterMask = 0x7, /// bits 0,1,2
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -18,6 +18,8 @@ namespace TBF.BenchControl.Elde
|
|||||||
private static readonly ILog log = LogManager.GetLogger(typeof(ControlBoardDev));
|
private static readonly ILog log = LogManager.GetLogger(typeof(ControlBoardDev));
|
||||||
public override string ToString() { return string.Format("ControlBoard({0})", Cfg.ToString(1)); }
|
public override string ToString() { return string.Format("ControlBoard({0})", Cfg.ToString(1)); }
|
||||||
|
|
||||||
|
const int FiltersCount = 8;
|
||||||
|
|
||||||
readonly ControlBoardCfg controlBoardCfg;
|
readonly ControlBoardCfg controlBoardCfg;
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -43,6 +45,8 @@ namespace TBF.BenchControl.Elde
|
|||||||
public StatusP StatusP { get { return controlCom.StatusP; } }
|
public StatusP StatusP { get { return controlCom.StatusP; } }
|
||||||
public int EtPulses(int wmNr1) { return controlCom.EtPulses(wmNr1); }
|
public int EtPulses(int wmNr1) { return controlCom.EtPulses(wmNr1); }
|
||||||
public int EtPulsesK { get { return controlCom.EtPulsesK; } }
|
public int EtPulsesK { get { return controlCom.EtPulsesK; } }
|
||||||
|
public int EtPulses2 { get { return controlCom.EtPulses2; } } /// DEWA_300: pulses from I12
|
||||||
|
public int EtPulses3 { get { return controlCom.EtPulses3; } } /// DEWA_300: pulses from I13
|
||||||
public UInt16 WMeterPulses(int wmNr1) { return controlCom.WMeterPulses(wmNr1); }
|
public UInt16 WMeterPulses(int wmNr1) { return controlCom.WMeterPulses(wmNr1); }
|
||||||
public int WMeterReference(int wmNr0) { return controlCom.WMeterReference(wmNr0); }
|
public int WMeterReference(int wmNr0) { return controlCom.WMeterReference(wmNr0); }
|
||||||
public uint RegulValveDAC(int rvNr0) { return controlCom.RegulValveDAC(rvNr0); }
|
public uint RegulValveDAC(int rvNr0) { return controlCom.RegulValveDAC(rvNr0); }
|
||||||
@@ -77,47 +81,21 @@ namespace TBF.BenchControl.Elde
|
|||||||
bool previousEmergencyStop;
|
bool previousEmergencyStop;
|
||||||
|
|
||||||
|
|
||||||
|
public void DiverterToTank(int flowMtrNr)
|
||||||
private int flowmeterNr4DiverterTest;
|
|
||||||
private bool scheduleDiverterToTank;
|
|
||||||
private bool scheduleDiverterToSink;
|
|
||||||
private bool scheduleReadDiverterTransition;
|
|
||||||
private bool pumpPowerChanged;
|
|
||||||
///
|
|
||||||
public void DiverterToTank(int flowmeterNr)
|
|
||||||
{
|
{
|
||||||
if (!scheduleDiverterToSink && !scheduleReadDiverterTransition && !emergencyStop)
|
cbCommandQueue.Enqueue(new SendCommandArgs(Command.Start, flowMtrNr, int.MaxValue, int.MaxValue, TestMethods.Diverter | TestMethods.Synchro, StopDevs.None));
|
||||||
{
|
|
||||||
flowmeterNr4DiverterTest = flowmeterNr;
|
|
||||||
scheduleDiverterToTank = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
///
|
///
|
||||||
public void DiverterToSink(int flowmeterNr)
|
public void DiverterToSink(int flowMtrNr)
|
||||||
{
|
{
|
||||||
if (!scheduleDiverterToTank && !scheduleReadDiverterTransition && !emergencyStop)
|
cbCommandQueue.Enqueue(new SendCommandArgs(Command.Stop, 0, 0, 0, TestMethods.Diverter,
|
||||||
{
|
StopDevs.Diverter | StopDevs.GatePulse | StopDevs.Reference | StopDevs.RegValveRegulation));
|
||||||
flowmeterNr4DiverterTest = flowmeterNr;
|
|
||||||
scheduleDiverterToSink = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
///
|
///
|
||||||
public void ReadDiverterTransition(int flowmeterNr)
|
public void ReadDiverterTransition(int flowMtrNr)
|
||||||
{
|
{
|
||||||
if (!scheduleDiverterToTank && !scheduleDiverterToSink && !emergencyStop)
|
cbCommandQueue.Enqueue(new SendCommandArgs(Command.ReadDivTransition, flowMtrNr, 0, 0, TestMethods.Diverter, 0));
|
||||||
{
|
|
||||||
flowmeterNr4DiverterTest = flowmeterNr;
|
|
||||||
scheduleReadDiverterTransition = true;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary> State of valves sent out - buffered by the last SendCommand() </summary>
|
|
||||||
public UInt128 Route { get { return benchModelRoute; } }
|
|
||||||
|
|
||||||
UInt128 valvesToInvert; /// Route = valesToInvert ^ RequiredRouteWithoutInvertedVlaves
|
|
||||||
readonly UInt128 routeMask; /// This mask masks out virtual valves, routeMask is set in the constructor
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Initialization data updated by constructors of children components
|
/// Initialization data updated by constructors of children components
|
||||||
@@ -150,7 +128,7 @@ namespace TBF.BenchControl.Elde
|
|||||||
{100,500}, {100,500}, {100,500}, {100,500} };
|
{100,500}, {100,500}, {100,500}, {100,500} };
|
||||||
public byte[] MeretRS485Address = new byte[4];
|
public byte[] MeretRS485Address = new byte[4];
|
||||||
public float[] EtCalib = new float[8] { 1, 1, 1, 1, 1, 1, 1, 1 };
|
public float[] EtCalib = new float[8] { 1, 1, 1, 1, 1, 1, 1, 1 };
|
||||||
#elif MUNICH || TORINO_50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TORUN_50 || CEVAK_40 || TURA_IPERL || TURA_IPERL_NEW || TURA_SPECIAL || MURES_40 || FUZHOU_50 || SLM_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || FUZHOU_100
|
#elif MUNICH || TORINO_50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TORUN_50 || CEVAK_40 || TURA_IPERL || TURA_IPERL_NEW || TURA_SPECIAL || MURES_40 || FUZHOU_50 || SLM_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || FUZHOU_100 || ALZIR_25
|
||||||
public uint[,] RegValveCalib = new uint[8,2] {{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500}};
|
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 byte[] MeretRS485Address = new byte[4];
|
||||||
public float[] EtCalib = new float[5] { 1, 1, 1, 1, 1 };
|
public float[] EtCalib = new float[5] { 1, 1, 1, 1, 1 };
|
||||||
@@ -175,21 +153,22 @@ namespace TBF.BenchControl.Elde
|
|||||||
public uint[] BalanceRange = new uint[2];
|
public uint[] BalanceRange = new uint[2];
|
||||||
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Private values sent by the last SendCommand()
|
Queue<SendCommandArgs> cbCommandQueue;
|
||||||
///
|
|
||||||
bool sendCommandFlag;
|
/// <summary>
|
||||||
Command cmd;
|
/// Route: 128-bit word representing the current state of all valves and pumps
|
||||||
int refNr;
|
/// </summary>
|
||||||
|
public UInt128 Route { get { return benchModelRoute; } }
|
||||||
UInt128 benchModelRoute;
|
UInt128 benchModelRoute;
|
||||||
int totalRefPulses;
|
UInt128 valvesToInvert; /// Route = valesToInvert ^ RequiredRouteWithoutInvertedVlaves
|
||||||
int massRefPulses;
|
readonly UInt128 routeMask; /// This mask masks out virtual valves, routeMask is set in the constructor
|
||||||
TestMethods testMethods;
|
|
||||||
int[] filters;
|
int[] filters;
|
||||||
float[] FMFreq;
|
float[] FMFreq;
|
||||||
int regConst;
|
int regConst;
|
||||||
int shortImp;
|
int shortImp;
|
||||||
StopDevs stopDevs;
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -212,6 +191,8 @@ namespace TBF.BenchControl.Elde
|
|||||||
/// <param name="power">Power (0.0f .. 100.0f)</param>
|
/// <param name="power">Power (0.0f .. 100.0f)</param>
|
||||||
public void SetFMFreq(int index, float power)
|
public void SetFMFreq(int index, float power)
|
||||||
{
|
{
|
||||||
|
bool pumpPowerChanged = false;
|
||||||
|
|
||||||
#if DN100 || MUNICH || FUZHOU_150
|
#if DN100 || MUNICH || FUZHOU_150
|
||||||
if ((FMFreq == null) || (FMFreq.Length != 2))
|
if ((FMFreq == null) || (FMFreq.Length != 2))
|
||||||
{
|
{
|
||||||
@@ -232,19 +213,26 @@ namespace TBF.BenchControl.Elde
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (index >= 0 && index < FMFreq.Length && FMFreq[index] != power)
|
if (index >= 0 && index < FMFreq.Length)
|
||||||
|
{
|
||||||
|
if (FMFreq[index] != power)
|
||||||
{
|
{
|
||||||
FMFreq[index] = power;
|
FMFreq[index] = power;
|
||||||
|
|
||||||
pumpPowerChanged = true; /// Forces sending a command using Command.None
|
pumpPowerChanged = true; /// Forces sending a command using Command.None
|
||||||
|
|
||||||
log.DebugFormat("FMFreq=[{0}{1}{2}{3}{4}{5}]",
|
string s = string.Format("FMFreq=[{0}{1}{2}{3}{4}{5}]", FMFreq[0].ToString(),
|
||||||
FMFreq[0].ToString(),
|
|
||||||
(FMFreq.Length > 1) ? ("," + FMFreq[1].ToString()) : "",
|
(FMFreq.Length > 1) ? ("," + FMFreq[1].ToString()) : "",
|
||||||
(FMFreq.Length > 2) ? ("," + FMFreq[2].ToString()) : "",
|
(FMFreq.Length > 2) ? ("," + FMFreq[2].ToString()) : "",
|
||||||
(FMFreq.Length > 3) ? ("," + FMFreq[3].ToString()) : "",
|
(FMFreq.Length > 3) ? ("," + FMFreq[3].ToString()) : "",
|
||||||
(FMFreq.Length > 4) ? ("," + FMFreq[4].ToString()) : "",
|
(FMFreq.Length > 4) ? ("," + FMFreq[4].ToString()) : "",
|
||||||
(FMFreq.Length > 5) ? ("," + FMFreq[5].ToString()) : "");
|
(FMFreq.Length > 5) ? ("," + FMFreq[5].ToString()) : "");
|
||||||
|
log.Warn(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
log.ErrorFormat("Wrong FM pump: index = {0}, power = {1}", index, power);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,6 +278,9 @@ namespace TBF.BenchControl.Elde
|
|||||||
{
|
{
|
||||||
controlBoardCfg = cfg as ControlBoardCfg;
|
controlBoardCfg = cfg as ControlBoardCfg;
|
||||||
|
|
||||||
|
cbCommandQueue = new Queue<SendCommandArgs>();
|
||||||
|
lastSentFilters = new uint[FiltersCount];
|
||||||
|
|
||||||
#if DN100 || MUNICH || FUZHOU_150
|
#if DN100 || MUNICH || FUZHOU_150
|
||||||
FMFreq = new float[2] { 0, 0 }; /// Nr. of pumps: Fuzhou150=2, Fuzhou300=6, newer=6
|
FMFreq = new float[2] { 0, 0 }; /// Nr. of pumps: Fuzhou150=2, Fuzhou300=6, newer=6
|
||||||
#elif SLM_END || WARSAW_END
|
#elif SLM_END || WARSAW_END
|
||||||
@@ -377,7 +368,9 @@ namespace TBF.BenchControl.Elde
|
|||||||
log.FatalFormat("Successfully initialized device {0}", ToString());
|
log.FatalFormat("Successfully initialized device {0}", ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Run this device</summary>
|
/// <summary>
|
||||||
|
/// Run this device
|
||||||
|
/// </summary>
|
||||||
public void RunDeviceBefore()
|
public void RunDeviceBefore()
|
||||||
{
|
{
|
||||||
if (DebugLevel == DebugMode.Simulate) return;
|
if (DebugLevel == DebugMode.Simulate) return;
|
||||||
@@ -398,95 +391,99 @@ namespace TBF.BenchControl.Elde
|
|||||||
{
|
{
|
||||||
UiBridge.Bridge.OnEmergencyStopChanged(this,UiBridge.EmergencyStopEventArgs.State.CloseForm);
|
UiBridge.Bridge.OnEmergencyStopChanged(this,UiBridge.EmergencyStopEventArgs.State.CloseForm);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (emergencyStop)
|
|
||||||
{
|
|
||||||
/// SendCommand() arguments to clear the emergency stop state
|
|
||||||
sendCommandFlag = true;
|
|
||||||
this.refNr = 0;
|
|
||||||
this.totalRefPulses = 0;
|
|
||||||
this.massRefPulses = 0;
|
|
||||||
this.cmd = Command.Stop;
|
|
||||||
this.testMethods = 0;
|
|
||||||
this.stopDevs = StopDevs.All;
|
|
||||||
}
|
|
||||||
else if (scheduleDiverterToTank)
|
|
||||||
{
|
|
||||||
/// Reset all SendCommand() arguments
|
|
||||||
sendCommandFlag = true;
|
|
||||||
this.cmd = Command.Start;
|
|
||||||
this.refNr = flowmeterNr4DiverterTest;
|
|
||||||
this.totalRefPulses = int.MaxValue;
|
|
||||||
this.massRefPulses = int.MaxValue;
|
|
||||||
this.testMethods = TestMethods.Diverter;
|
|
||||||
this.stopDevs = 0;
|
|
||||||
scheduleDiverterToTank = false;
|
|
||||||
}
|
|
||||||
else if (scheduleDiverterToSink)
|
|
||||||
{
|
|
||||||
/// Reset all SendCommand() arguments
|
|
||||||
sendCommandFlag = true;
|
|
||||||
this.cmd = Command.Stop;
|
|
||||||
this.refNr = flowmeterNr4DiverterTest;
|
|
||||||
this.totalRefPulses = 0;
|
|
||||||
this.massRefPulses = 0;
|
|
||||||
this.testMethods = TestMethods.Diverter;
|
|
||||||
this.stopDevs = StopDevs.Diverter;
|
|
||||||
scheduleDiverterToSink = false;
|
|
||||||
}
|
|
||||||
else if (scheduleReadDiverterTransition)
|
|
||||||
{
|
|
||||||
/// Reset all SendCommand() arguments
|
|
||||||
sendCommandFlag = true;
|
|
||||||
this.cmd = Command.ReadDivTransition;
|
|
||||||
this.refNr = flowmeterNr4DiverterTest;
|
|
||||||
this.totalRefPulses = 0;
|
|
||||||
this.massRefPulses = 0;
|
|
||||||
this.testMethods = TestMethods.Diverter;
|
|
||||||
this.stopDevs = 0;
|
|
||||||
scheduleReadDiverterTransition = false;
|
|
||||||
}
|
|
||||||
else if (pumpPowerChanged)
|
|
||||||
{
|
|
||||||
/// Reset all SendCommand() arguments
|
|
||||||
sendCommandFlag = true;
|
|
||||||
this.cmd = Command.None;
|
|
||||||
pumpPowerChanged = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/// Reset all SendCommand() arguments
|
|
||||||
sendCommandFlag = false;
|
|
||||||
this.cmd = Command.None;
|
|
||||||
this.refNr = 0;
|
|
||||||
this.totalRefPulses = 0;
|
|
||||||
this.massRefPulses = 0;
|
|
||||||
this.testMethods = 0;
|
|
||||||
this.stopDevs = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.filters == null) this.filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, };
|
///
|
||||||
}
|
/// Used in RunDeviceAfter() when sending commands
|
||||||
|
///
|
||||||
|
UInt128 lastSentRoute;
|
||||||
|
uint[] lastSentFilters;
|
||||||
|
float[] lastSentFMFreq;
|
||||||
|
int lastsentRegConst;
|
||||||
|
int lastSentShortImp;
|
||||||
|
|
||||||
/// <summary>Run this device</summary>
|
/// <summary>
|
||||||
|
/// Run this device
|
||||||
|
/// </summary>
|
||||||
public void RunDeviceAfter()
|
public void RunDeviceAfter()
|
||||||
{
|
{
|
||||||
if (DebugLevel == DebugMode.Simulate) return;
|
if (DebugLevel == DebugMode.Simulate) return;
|
||||||
|
|
||||||
UpdateWeights();
|
UpdateWeights();
|
||||||
|
|
||||||
uint[] uintFilters = new uint[8];
|
/// Modify queue in case of emergency stop
|
||||||
for (int i = 0; i < 8; i++)
|
if (emergencyStop && !previousEmergencyStop)
|
||||||
{
|
{
|
||||||
uintFilters[i] = (filters.Length > i) ? (uint)filters[i] : uintFilters[i - 1];
|
/// SendCommand() arguments to clear the emergency stop state
|
||||||
|
cbCommandQueue.Clear();
|
||||||
|
cbCommandQueue.Enqueue(new SendCommandArgs(Command.Stop, 0, 0, 0, 0, StopDevs.All));
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
/// Prepare uintFilters array and evaluate changes
|
||||||
if (sendCommandFlag)
|
uint[] uintFilters = new uint[FiltersCount];
|
||||||
|
uintFilters[0] = (filters != null && filters.Length > 0) ? (uint)filters[0] : 0;
|
||||||
|
bool filtersAreDifferent = (uintFilters[0] != lastSentFilters[0]);
|
||||||
|
for (int i = 1; i < FiltersCount; i++)
|
||||||
{
|
{
|
||||||
controlCom.SendCommand(cmd, refNr, (benchModelRoute & routeMask),
|
uintFilters[i] = (filters != null && filters.Length > i) ? (uint)filters[i] : uintFilters[i - 1];
|
||||||
totalRefPulses, massRefPulses, testMethods,
|
filtersAreDifferent |= (uintFilters[i] != lastSentFilters[i]);
|
||||||
uintFilters, FMFreq, regConst, shortImp, stopDevs);
|
}
|
||||||
|
|
||||||
|
/// Evaluate FMFreq changes
|
||||||
|
bool fmFreqsAreDifferent = false;
|
||||||
|
if ((FMFreq == null) || (lastSentFMFreq == null) || (FMFreq.Length != lastSentFMFreq.Length))
|
||||||
|
{
|
||||||
|
fmFreqsAreDifferent = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (int i = 0; i < FMFreq.Length; i++)
|
||||||
|
{
|
||||||
|
if (FMFreq[i] != lastSentFMFreq[i])
|
||||||
|
{
|
||||||
|
fmFreqsAreDifferent = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cbCommandQueue.Count > 0)
|
||||||
|
{
|
||||||
|
///
|
||||||
|
/// There is a command in the queue
|
||||||
|
///
|
||||||
|
controlCom.SendCommand(cbCommandQueue.Dequeue(), (benchModelRoute & routeMask), uintFilters, FMFreq, regConst, shortImp);
|
||||||
|
|
||||||
|
lastSentRoute = (benchModelRoute & routeMask);
|
||||||
|
lastsentRegConst = regConst;
|
||||||
|
lastSentShortImp = shortImp;
|
||||||
|
|
||||||
|
/// Deep copy of arrays lastSentFilters and lastSentFMFreq
|
||||||
|
if ((lastSentFilters == null) || (lastSentFilters.Length != uintFilters.Length)) lastSentFilters = new uint[(uintFilters == null) ? 0 : uintFilters.Length];
|
||||||
|
for (int i = 0; i < lastSentFilters.Length; i++) lastSentFilters[i] = uintFilters[i];
|
||||||
|
if ((lastSentFMFreq == null) || (lastSentFMFreq.Length != FMFreq.Length)) lastSentFMFreq = new float[(FMFreq == null) ? 0 : FMFreq.Length];
|
||||||
|
for (int i = 0; i < lastSentFMFreq.Length; i++) lastSentFMFreq[i] = FMFreq[i];
|
||||||
|
}
|
||||||
|
else if (((benchModelRoute & routeMask) != lastSentRoute) ||
|
||||||
|
filtersAreDifferent ||
|
||||||
|
fmFreqsAreDifferent ||
|
||||||
|
(lastsentRegConst != regConst) ||
|
||||||
|
(lastSentShortImp != shortImp))
|
||||||
|
{
|
||||||
|
///
|
||||||
|
/// Command queue is mepty, but 'route', pump frequency, PID coef., filters or shortImp have changed
|
||||||
|
///
|
||||||
|
controlCom.SendCommand(new SendCommandArgs(Command.None, 0, 0, 0, 0, 0), (benchModelRoute & routeMask), uintFilters, FMFreq, regConst, shortImp);
|
||||||
|
|
||||||
|
lastSentRoute = (benchModelRoute & routeMask);
|
||||||
|
lastsentRegConst = regConst;
|
||||||
|
lastSentShortImp = shortImp;
|
||||||
|
|
||||||
|
/// Deep copy of arrays lastSentFilters and lastSentFMFreq
|
||||||
|
if ((lastSentFilters == null) || (lastSentFilters.Length != uintFilters.Length)) lastSentFilters = new uint[(uintFilters == null) ? 0 : uintFilters.Length];
|
||||||
|
for (int i = 0; i < lastSentFilters.Length; i++) lastSentFilters[i] = uintFilters[i];
|
||||||
|
if ((lastSentFMFreq == null) || (lastSentFMFreq.Length != FMFreq.Length)) lastSentFMFreq = new float[(FMFreq == null) ? 0 : FMFreq.Length];
|
||||||
|
for (int i = 0; i < lastSentFMFreq.Length; i++) lastSentFMFreq[i] = FMFreq[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
controlCom.RunDeviceAfter();
|
controlCom.RunDeviceAfter();
|
||||||
@@ -510,25 +507,17 @@ namespace TBF.BenchControl.Elde
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="cmd">See ControlBoard.Command enum</param>
|
/// <param name="cmd">See ControlBoard.Command enum</param>
|
||||||
/// <param name="refFlowmtrNr">Number of the etalon/reference (1..5)</param>
|
/// <param name="refFlowmtrNr">Number of the etalon/reference (1..5)</param>
|
||||||
/// <param name="route">Route: 64-bit installation specific number</param>
|
/// <param name="route">State of valves, 128-bit word</param>
|
||||||
/// <param name="totalRefPulses">kolko impulzov ma trvat skuska</param>
|
/// <param name="totalRefPulses">kolko impulzov ma trvat skuska</param>
|
||||||
/// <param name="testMethods">See ControlBoard.TestMethods enum</param>
|
/// <param name="testMethods">See ControlBoard.TestMethods enum</param>
|
||||||
/// <param name="filterConstant">0 = No filtering (0..255)</param>
|
/// <param name="filterConstant">0 = No filtering (0..255)</param>
|
||||||
/// <param name="regConst">Coefficient used to control reg. valves (1..100)</param>
|
/// <param name="regConst">Coefficient used to control reg. valves (1..100)</param>
|
||||||
/// <param name="shortImp">0 = default value, 1 = spec. processing of very short pulses</param>
|
/// <param name="shortImp">0 = default value, 1 = spec. processing of very short pulses</param>
|
||||||
/// <param name="stopDevs">What to stop</param>
|
/// <param name="stopDevs">What to stop</param>
|
||||||
public void SendCommand(Command cmd, int refFlowmtrNr, UInt128 route,
|
public void SendCommand(Command cmd, int refFlowmtrNr, int totalRefPulses, int massRefPulses,
|
||||||
int totalRefPulses, int massRefPulses, TestMethods testMethods, StopDevs stopDevs)
|
TestMethods testMethods, StopDevs stopDevs)
|
||||||
{
|
{
|
||||||
this.cmd = cmd;
|
cbCommandQueue.Enqueue(new SendCommandArgs(cmd, refFlowmtrNr, totalRefPulses, massRefPulses, testMethods, stopDevs));
|
||||||
this.refNr = refFlowmtrNr;
|
|
||||||
this.benchModelRoute = route;
|
|
||||||
this.totalRefPulses = totalRefPulses;
|
|
||||||
this.massRefPulses = massRefPulses;
|
|
||||||
this.testMethods = testMethods;
|
|
||||||
this.stopDevs = stopDevs;
|
|
||||||
|
|
||||||
sendCommandFlag = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -543,7 +532,6 @@ namespace TBF.BenchControl.Elde
|
|||||||
benchModelRoute = (((benchModelRoute ^ valvesToInvert) | valvesToOpen) & (~valvesToClose)) ^ valvesToInvert;
|
benchModelRoute = (((benchModelRoute ^ valvesToInvert) | valvesToOpen) & (~valvesToClose)) ^ valvesToInvert;
|
||||||
foreach (var extV in extendedValves) extV.UpdateRoute(ref benchModelRoute);
|
foreach (var extV in extendedValves) extV.UpdateRoute(ref benchModelRoute);
|
||||||
log.DebugFormat("SetValves(x,x), new route = {0}", Utils.RouteToStr(benchModelRoute));
|
log.DebugFormat("SetValves(x,x), new route = {0}", Utils.RouteToStr(benchModelRoute));
|
||||||
sendCommandFlag = true;
|
|
||||||
return oldRoute ^ benchModelRoute;
|
return oldRoute ^ benchModelRoute;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -28,6 +28,8 @@ namespace TBF.BenchControl.Elde
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int EtPulsesK { get { return 1; } }
|
public int EtPulsesK { get { return 1; } }
|
||||||
|
public int EtPulses2 { get { return 0; } }
|
||||||
|
public int EtPulses3 { get { return 0; } }
|
||||||
|
|
||||||
double[] errFactor = new double[Config.Data.WMsCount + 1]; /// Internal
|
double[] errFactor = new double[Config.Data.WMsCount + 1]; /// Internal
|
||||||
double[] wMeterPulsesF = new double[Config.Data.WMsCount + 1]; /// Internal
|
double[] wMeterPulsesF = new double[Config.Data.WMsCount + 1]; /// Internal
|
||||||
@@ -167,7 +169,7 @@ namespace TBF.BenchControl.Elde
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="cmd">See ControlBoard.Command enum</param>
|
/// <param name="cmd">See ControlBoard.Command enum</param>
|
||||||
/// <param name="refFlowmtrNr">Number of the etalon/reference (1..5)</param>
|
/// <param name="refFlowmtrNr">Number of the etalon/reference (1..5)</param>
|
||||||
/// <param name="route">Route: 64-bit installation specific number</param>
|
/// <param name="route">State of valves, 128-bit word</param>
|
||||||
/// <param name="refPulses">kolko impulzov ma trvat skuska</param>
|
/// <param name="refPulses">kolko impulzov ma trvat skuska</param>
|
||||||
/// <param name="testMethods">See ControlBoard.TestMethods enum</param>
|
/// <param name="testMethods">See ControlBoard.TestMethods enum</param>
|
||||||
/// <param name="filterConstant">0 = No filtering (0..255)</param>
|
/// <param name="filterConstant">0 = No filtering (0..255)</param>
|
||||||
@@ -175,12 +177,10 @@ namespace TBF.BenchControl.Elde
|
|||||||
/// <param name="regConst">Coefficient used to control reg. valves (1..100)</param>
|
/// <param name="regConst">Coefficient used to control reg. valves (1..100)</param>
|
||||||
/// <param name="shortImp">0 = default value, 1 = spec. processing of very short pulses</param>
|
/// <param name="shortImp">0 = default value, 1 = spec. processing of very short pulses</param>
|
||||||
/// <param name="stopDevs">What to stop</param>
|
/// <param name="stopDevs">What to stop</param>
|
||||||
public void SendCommand(Command cmd, int refFlowmtrNr, UInt128 route,
|
public void SendCommand(SendCommandArgs sendCommandArgs, UInt128 route, uint[] filterConstants, float[] fmFreq, int regConst, int shortImp)
|
||||||
int totalRefPulses, int massRefPulses, TestMethods testMethods,
|
|
||||||
uint[] filterConstants, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs)
|
|
||||||
{
|
{
|
||||||
log.InfoFormat("SendCommand(Cmd={0},Ref#={1},Route={2} {3} {4} {5},TotalPls={6},MassPls={7},TstM={8},filt={9},FM=[{10}{11}{12}{13}{14}{15}],Reg={16},ShrtImp={17},Stop={18})",
|
log.InfoFormat("SendCommand(Cmd={0},Ref#={1},Route={2} {3} {4} {5},TotalPls={6},MassPls={7},TstM={8},filt={9},FM=[{10}{11}{12}{13}{14}{15}],Reg={16},ShrtImp={17},Stop={18})",
|
||||||
cmd, refFlowmtrNr, /// 0, 1
|
sendCommandArgs.Cmd, sendCommandArgs.RefFlowmtrNr, /// 0, 1
|
||||||
((route >> 48) & 0xFFFF).ToString("X4"), /// 2
|
((route >> 48) & 0xFFFF).ToString("X4"), /// 2
|
||||||
((route >> 32) & 0xFFFF).ToString("X4"), /// 3
|
((route >> 32) & 0xFFFF).ToString("X4"), /// 3
|
||||||
((route >> 16) & 0xFFFF).ToString("X4"), /// 4
|
((route >> 16) & 0xFFFF).ToString("X4"), /// 4
|
||||||
@@ -197,8 +197,8 @@ namespace TBF.BenchControl.Elde
|
|||||||
/// Simulation
|
/// Simulation
|
||||||
///
|
///
|
||||||
Command lastCmd = this.cmd;
|
Command lastCmd = this.cmd;
|
||||||
this.cmd = cmd;
|
this.cmd = sendCommandArgs.Cmd;
|
||||||
this.refFlowmtrNr = refFlowmtrNr;
|
this.refFlowmtrNr = sendCommandArgs.RefFlowmtrNr;
|
||||||
|
|
||||||
#if FUZHOU_300
|
#if FUZHOU_300
|
||||||
///
|
///
|
||||||
@@ -212,14 +212,14 @@ namespace TBF.BenchControl.Elde
|
|||||||
log.DebugFormat("SendCommand route = {0}", Utils.RouteToStr(route));
|
log.DebugFormat("SendCommand route = {0}", Utils.RouteToStr(route));
|
||||||
#endif
|
#endif
|
||||||
TestBenchSim.SimRoute = this.simRoute = route;
|
TestBenchSim.SimRoute = this.simRoute = route;
|
||||||
this.totalRefPulses = totalRefPulses;
|
this.totalRefPulses = sendCommandArgs.TotalRefPulses;
|
||||||
this.massRefPulses = massRefPulses;
|
this.massRefPulses = sendCommandArgs.MassRefPulses;
|
||||||
this.testMethods = testMethods;
|
this.testMethods = sendCommandArgs.TestMethods;
|
||||||
|
this.stopDevs = sendCommandArgs.StopDevs;
|
||||||
this.filterConstants = filterConstants;
|
this.filterConstants = filterConstants;
|
||||||
this.FMFreq = fmFreq;
|
this.FMFreq = fmFreq;
|
||||||
this.regConst = regConst;
|
this.regConst = regConst;
|
||||||
this.shortImp = shortImp;
|
this.shortImp = shortImp;
|
||||||
this.stopDevs = stopDevs;
|
|
||||||
|
|
||||||
#pragma warning disable
|
#pragma warning disable
|
||||||
statusP = (StatusP)(((ulong)statusP & (ulong)0xFFFFFFFFFFFFFFF8L) | (ulong)refFlowmtrNr);
|
statusP = (StatusP)(((ulong)statusP & (ulong)0xFFFFFFFFFFFFFFF8L) | (ulong)refFlowmtrNr);
|
||||||
|
|||||||
@@ -20,25 +20,24 @@ namespace TBF.BenchControl.Elde
|
|||||||
public StatusP StatusP { get { return (StatusP)ctrlBrdComponent.StatusP; } }
|
public StatusP StatusP { get { return (StatusP)ctrlBrdComponent.StatusP; } }
|
||||||
|
|
||||||
#if DN100 || MUNICH || FUZHOU_150
|
#if DN100 || MUNICH || FUZHOU_150
|
||||||
public double ReferenceFreq { get { return 1000.0f * ctrlBrdComponent.referenceFreq; } } /// In [Hz] 0..2500, nom.=2000
|
public double ReferenceFreq { get { return 1000.0f * ctrlBrdComponent.referenceFreq; } } /// Returns in [Hz] 0..2500, nom.=2000
|
||||||
public double ReferenceFreqs(int i) { return 0; }
|
public double ReferenceFreqs(int i) { return 0; }
|
||||||
#else /// all newer benches
|
#else
|
||||||
|
/// All newer benches
|
||||||
|
public double ReferenceFreq { get { return 1000.0 * ctrlBrdComponent.referenceFreq[0]; } } /// Returns in [Hz] 0..2500, nom.=2000
|
||||||
|
///
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// In case of I11, I12
|
/// In case of I11, I12
|
||||||
/// referenceFreq[0] = I11 + I12
|
/// cBrd.referenceFreq[0] = I11 + I12
|
||||||
/// referenceFreq[1] = I11
|
/// cBrd.referenceFreq[1] = I11
|
||||||
/// referenceFreq[2] = I12
|
/// cBrd.referenceFreq[2] = I12
|
||||||
/// otherwise
|
/// otherwise
|
||||||
/// referenceFreq[0] = I2 or I3 or I4
|
/// cBrd.referenceFreq[0] = I2 or I3 or I4
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double ReferenceFreq { get { return 1000.0 * ctrlBrdComponent.referenceFreq[0]; } } /// In [Hz] 0..2500, nom.=2000 ///
|
/// <returns>Reference frequency in Hz</returns>
|
||||||
public double ReferenceFreqs(int i)
|
public double ReferenceFreqs(int i)
|
||||||
{
|
{
|
||||||
if ((i >= 0) && (i < ctrlBrdComponent.referenceFreq.Length))
|
return ((i >= 0) && (i < ctrlBrdComponent.referenceFreq.Length)) ? (1000.0 * ctrlBrdComponent.referenceFreq[i]) : 0;
|
||||||
{
|
|
||||||
return 1000.0 * ctrlBrdComponent.referenceFreq[0]; /// In [Hz] 0..2500, nom.=2000
|
|
||||||
}
|
|
||||||
else return 0;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -50,6 +49,13 @@ namespace TBF.BenchControl.Elde
|
|||||||
public int EtPulsesK { get { return (int)ctrlBrdComponent.etPulsesK; } }
|
public int EtPulsesK { get { return (int)ctrlBrdComponent.etPulsesK; } }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if DEWA_300
|
||||||
|
public int EtPulses2 { get { return (int)ctrlBrdComponent.EtPulses2; } }
|
||||||
|
public int EtPulses3 { get { return (int)ctrlBrdComponent.EtPulses3; } }
|
||||||
|
#else
|
||||||
|
public int EtPulses2 { get { return 0; } }
|
||||||
|
public int EtPulses3 { get { return 0; } }
|
||||||
|
#endif
|
||||||
public UInt16 WMeterPulses(int wmNr1) { return (UInt16)ctrlBrdComponent.wMeterPuls[wmNr1]; }
|
public UInt16 WMeterPulses(int wmNr1) { return (UInt16)ctrlBrdComponent.wMeterPuls[wmNr1]; }
|
||||||
public int WMeterReference(int wmNr0) { return (int)ctrlBrdComponent.wMeterReference[wmNr0]; }
|
public int WMeterReference(int wmNr0) { return (int)ctrlBrdComponent.wMeterReference[wmNr0]; }
|
||||||
|
|
||||||
@@ -63,7 +69,7 @@ namespace TBF.BenchControl.Elde
|
|||||||
}
|
}
|
||||||
|
|
||||||
public float Pressure(int prsNr0) { return ctrlBrdComponent.pressure[prsNr0]; }
|
public float Pressure(int prsNr0) { return ctrlBrdComponent.pressure[prsNr0]; }
|
||||||
public float Temperature(int tmpNr0) { return ctrlBrdComponent.temperature[tmpNr0]; }
|
public float Temperature(int tmpNr0) { return (tmpNr0 >= 0 && tmpNr0 < ctrlBrdComponent.temperature.Length) ? ctrlBrdComponent.temperature[tmpNr0] : 0; }
|
||||||
public RegulValveState RegulValveState(int rvNr1) { return (RegulValveState)ctrlBrdComponent.rValveStatus[rvNr1 - 1]; }
|
public RegulValveState RegulValveState(int rvNr1) { return (RegulValveState)ctrlBrdComponent.rValveStatus[rvNr1 - 1]; }
|
||||||
#if GENESIS || BERLIN || PETERSBURG_200 || DEWA_300
|
#if GENESIS || BERLIN || PETERSBURG_200 || DEWA_300
|
||||||
public UInt128 RRoute { get { return ((UInt128)ctrlBrdComponent.rRouteH << 64) | (UInt128)ctrlBrdComponent.rRoute; } }
|
public UInt128 RRoute { get { return ((UInt128)ctrlBrdComponent.rRouteH << 64) | (UInt128)ctrlBrdComponent.rRoute; } }
|
||||||
@@ -71,7 +77,7 @@ namespace TBF.BenchControl.Elde
|
|||||||
public UInt128 RRoute { get { return ctrlBrdComponent.rRoute; } }
|
public UInt128 RRoute { get { return ctrlBrdComponent.rRoute; } }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if GENESIS || KEMPNO_50 || KRAKOW_50 || BAHRAIN_50 || BADGER_STREDNA_TRAT || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || SENTEC || FUZHOU_100 || CEVAK_200 || IZRAEL_50 || DEWA_300 || PUCHONG_200 || TURA_IPERL_NEW
|
#if GENESIS || KEMPNO_50 || KRAKOW_50 || BAHRAIN_50 || BADGER_STREDNA_TRAT || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || SENTEC || FUZHOU_100 || CEVAK_200 || IZRAEL_50 || DEWA_300 || PUCHONG_200 || TURA_IPERL_NEW || ALZIR_25
|
||||||
public uint DivTime(int id) { return ctrlBrdComponent.divTime[id]; }
|
public uint DivTime(int id) { return ctrlBrdComponent.divTime[id]; }
|
||||||
public void SetDivLimit(int divNo, uint limLoPct, uint limHiPct)
|
public void SetDivLimit(int divNo, uint limLoPct, uint limHiPct)
|
||||||
{
|
{
|
||||||
@@ -131,7 +137,7 @@ namespace TBF.BenchControl.Elde
|
|||||||
public uint[] WMeterCont { get { return new uint[3]; } } /// Dummy
|
public uint[] WMeterCont { get { return new uint[3]; } } /// Dummy
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if KEMPNO_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || FUZHOU_100 || CEVAK_200 || IZRAEL_50
|
#if KEMPNO_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || FUZHOU_100 || CEVAK_200 || IZRAEL_50 || ALZIR_25
|
||||||
public float ValveOpenCloseTime { get { return ctrlBrdComponent.ValveMoveTime[0]; } }
|
public float ValveOpenCloseTime { get { return ctrlBrdComponent.ValveMoveTime[0]; } }
|
||||||
#else
|
#else
|
||||||
public float ValveOpenCloseTime { get { return 0.001f; } }
|
public float ValveOpenCloseTime { get { return 0.001f; } }
|
||||||
@@ -254,7 +260,7 @@ namespace TBF.BenchControl.Elde
|
|||||||
|
|
||||||
ctrlBrdComponent.ExternalCom = true;
|
ctrlBrdComponent.ExternalCom = true;
|
||||||
|
|
||||||
#if SENTEC || CEVAK_200 || FUZHOU_100 || IZRAEL_25
|
#if SENTEC || CEVAK_200 || FUZHOU_100 || IZRAEL_25 || ALZIR_25
|
||||||
ctrlBrdComponent.SendCalibData(rvCalib, meretA, (byte)usedCom, tempCalib, etCalib, divEdge, balanceRange, meretProtocol);
|
ctrlBrdComponent.SendCalibData(rvCalib, meretA, (byte)usedCom, tempCalib, etCalib, divEdge, balanceRange, meretProtocol);
|
||||||
#else
|
#else
|
||||||
ctrlBrdComponent.SendCalibData(rvCalib, meretA, (byte)usedCom, tempCalib, etCalib, divEdge, balanceRange);
|
ctrlBrdComponent.SendCalibData(rvCalib, meretA, (byte)usedCom, tempCalib, etCalib, divEdge, balanceRange);
|
||||||
@@ -301,63 +307,35 @@ namespace TBF.BenchControl.Elde
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sends a command to the control board.
|
/// Sends a command to the control board.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="cmd">See ControlBoard.Command enum</param>
|
/// <param name="sendCommandArgs">Arguments</param>
|
||||||
/// <param name="refFlowMeterNr">Reference flow meter number (1..5)</param>
|
/// <param name="route">State of valves, 128-bit word</param>
|
||||||
/// <param name="route">Route: 64-bit installation specific number</param>
|
/// <param name="filterConstants">Array with length=8 of filter costants (0..255, 0 = no filtering)</param>
|
||||||
/// <param name="refPulses">Test duration as a number of reference flow meter pulses</param>
|
/// <param name="fmFreq">Freq.inverter control (not applicable in DT100, Munich)</param>
|
||||||
/// <param name="testMethods">See ControlBoard.TestMethods enum</param>
|
/// <param name="regConst">PID coefficient for flow control</param>
|
||||||
/// <param name="filterConstants">0 = No filtering (0..255)</param>
|
|
||||||
/// <param name="FMFreq">Freq.inverter control (not applicable in DT100, Munich)</param>
|
|
||||||
/// <param name="regConst">Coefficient used to control the regulation valve (1..100)</param>
|
|
||||||
/// <param name="shortImp">0 = default value, 1 = spec. processing of very short pulses</param>
|
/// <param name="shortImp">0 = default value, 1 = spec. processing of very short pulses</param>
|
||||||
/// <param name="stopDevs">What to stop</param>
|
public void SendCommand(SendCommandArgs sendCommandArgs, UInt128 route, uint[] filterConstants, float[] fmFreq, int regConst, int shortImp)
|
||||||
public void SendCommand(Command cmd, int refFlowMeterNr, UInt128 route,
|
|
||||||
int totalRefPulses, int massRefPulses, TestMethods testMethods,
|
|
||||||
uint[] filterConstants, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs)
|
|
||||||
{
|
{
|
||||||
if (Program.MainWnd.InvokeRequired)
|
if (Program.MainWnd.InvokeRequired)
|
||||||
{
|
{
|
||||||
/// When SendCommand(...) called from the worker thread
|
/// From another thread ... use Invoke()
|
||||||
object[] args = new object[] { cmd, refFlowMeterNr, route, totalRefPulses, massRefPulses,
|
Program.MainWnd.Invoke((SendCommandDlgt)DoSendCommand, new object[] { sendCommandArgs, route, filterConstants, fmFreq, regConst, shortImp });
|
||||||
testMethods, filterConstants, fmFreq, regConst, shortImp, stopDevs };
|
|
||||||
Program.MainWnd.Invoke((SendCommandDlgt)DoSendCommand, args); /// Component was created in UI thread - use Invoke()
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/// When SendCommand(...) called from the UI thread
|
/// Call DoSendCommand() directly
|
||||||
DoSendCommand(cmd, refFlowMeterNr, route, totalRefPulses, massRefPulses, testMethods,
|
DoSendCommand(sendCommandArgs, route, filterConstants, fmFreq, regConst, shortImp);
|
||||||
filterConstants, fmFreq, regConst, shortImp, stopDevs);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
///
|
///
|
||||||
delegate void SendCommandDlgt(Command cmd, int refFlowmtrNr, UInt128 route,
|
delegate void SendCommandDlgt(SendCommandArgs sendCommandArgs, UInt128 route, uint[] filterConstants, float[] fmFreq, int regConst, int shortImp);
|
||||||
int totalRefPulses, int massRefPulses, TestMethods testMethods,
|
|
||||||
uint[] filterConstants, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs);
|
|
||||||
///
|
///
|
||||||
private void DoSendCommand(Command cmd, int refFlowMeterNr, UInt128 route,
|
private void DoSendCommand(SendCommandArgs sendCommandArgs, UInt128 route, uint[] filterConstants, float[] fmFreq, int regConst, int shortImp)
|
||||||
int totalRefPulses, int massRefPulses, TestMethods testMethods,
|
|
||||||
uint[] filterConstants, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs)
|
|
||||||
{
|
{
|
||||||
//TBF.UiBridge.Bridge.OnLog(this, string.Format("{0} SendCommand({1}, {2}, {3}, {4}, {5}, {6}, [{7},{8}], {9}, {10}, {11})\r\n",
|
|
||||||
// DateTime.Now.ToLongTimeString(),
|
|
||||||
// cmd,
|
|
||||||
// refFlowMeterNr,
|
|
||||||
// route.ToString("X"),
|
|
||||||
// totalRefPulses,
|
|
||||||
// testMethods,
|
|
||||||
// filterConstant,
|
|
||||||
// fmFreq[0],
|
|
||||||
// fmFreq[1],
|
|
||||||
// regConst,
|
|
||||||
// shortImp,
|
|
||||||
// stopDevs));
|
|
||||||
|
|
||||||
|
|
||||||
#if FUZHOU_300
|
#if FUZHOU_300
|
||||||
///
|
///
|
||||||
/// The following code deals with the situation that all FM controlled pumps share bit #39.
|
/// The following code deals with the situation that all FM controlled pumps share bit #39.
|
||||||
/// In settings the bits of pumps should be sent as follows: P1=50, P2=51, P3=52, P4=53, P5=54 and P7=55
|
/// In settings the bits of pumps should be sent as follows: P1=50, P2=51, P3=52, P4=53, P5=54 and P7=55
|
||||||
/// (in FUZHOU_300 the FM pump bit should be set set to value FMIndex+50).
|
/// (in FUZHOU_300 the FM pump bit should be set to value FMIndex+50).
|
||||||
///
|
///
|
||||||
bool bit39 = (route & 0x00FC000000000000) != 0; /// true if any of bits 50 through 55 is set
|
bool bit39 = (route & 0x00FC000000000000) != 0; /// true if any of bits 50 through 55 is set
|
||||||
route = route & 0xFF03FFFFFFFFFFFF;
|
route = route & 0xFF03FFFFFFFFFFFF;
|
||||||
@@ -375,40 +353,91 @@ namespace TBF.BenchControl.Elde
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
log.InfoFormat("DoSendCommand(Cmd={0},Ref#={1},Route={2},TotalPls={3},MassPls={4},TM={5},filt={6},FM=[{7}{8}{9}{10}{11}{12}],Reg={13},ShrtImp={14},Stop={15})",
|
log.InfoFormat("DoSendCommand(Cmd={0},Ref#={1},Route={2},TotalPls={3},MassPls={4},TM={5},filt={6},FM=[{7}{8}{9}{10}{11}{12}],Reg={13},ShrtImp={14},Stop={15})",
|
||||||
cmd, /// 0
|
sendCommandArgs.Cmd, /// 0
|
||||||
refFlowMeterNr, /// 1
|
sendCommandArgs.RefFlowmtrNr, /// 1
|
||||||
Utils.RouteToStr(route), /// 2
|
Utils.RouteToStr(route), /// 2
|
||||||
totalRefPulses, massRefPulses, testMethods, filterConstants, /// 3, 4, 5, 6
|
sendCommandArgs.TotalRefPulses,
|
||||||
|
sendCommandArgs.MassRefPulses,
|
||||||
|
sendCommandArgs.TestMethods,
|
||||||
|
filterConstants, /// 3, 4, 5, 6
|
||||||
fmFreq[0].ToString(), /// 7
|
fmFreq[0].ToString(), /// 7
|
||||||
(fmFreq.Length > 1) ? ("," + fmFreq[1].ToString()) : "", /// 8
|
(fmFreq.Length > 1) ? ("," + fmFreq[1].ToString()) : "", /// 8
|
||||||
(fmFreq.Length > 2) ? ("," + fmFreq[2].ToString()) : "", /// 9
|
(fmFreq.Length > 2) ? ("," + fmFreq[2].ToString()) : "", /// 9
|
||||||
(fmFreq.Length > 3) ? ("," + fmFreq[3].ToString()) : "", /// 10
|
(fmFreq.Length > 3) ? ("," + fmFreq[3].ToString()) : "", /// 10
|
||||||
(fmFreq.Length > 4) ? ("," + fmFreq[4].ToString()) : "", /// 11
|
(fmFreq.Length > 4) ? ("," + fmFreq[4].ToString()) : "", /// 11
|
||||||
(fmFreq.Length > 5) ? ("," + fmFreq[5].ToString()) : "", /// 12
|
(fmFreq.Length > 5) ? ("," + fmFreq[5].ToString()) : "", /// 12
|
||||||
regConst, shortImp, stopDevs); /// 13, 14, 15
|
regConst, /// 13
|
||||||
|
shortImp, /// 14
|
||||||
|
sendCommandArgs.StopDevs); /// 15
|
||||||
|
|
||||||
#if DN100 || MUNICH
|
#if DN100 || MUNICH
|
||||||
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, (uint)totalRefPulses, (uint)testMethods,
|
ctrlBrdComponent.SendCommand((uint)sendCommandArgs.Cmd,
|
||||||
Convert.ToSingle(filterConstants[0]), fmFreq[0], (uint)regConst, (uint)shortImp, (uint)stopDevs);
|
(byte)sendCommandArgs.RefFlowmtrNr,
|
||||||
|
(ulong)route,
|
||||||
|
(uint)sendCommandArgs.TotalRefPulses,
|
||||||
|
(uint)sendCommandArgs.TestMethods,
|
||||||
|
Convert.ToSingle(filterConstants[0]),
|
||||||
|
fmFreq[0],
|
||||||
|
(uint)regConst,
|
||||||
|
(uint)shortImp,
|
||||||
|
(uint)sendCommandArgs.StopDevs);
|
||||||
#elif BADGER_MALA_TRAT || BADGER_VELKA_TRAT || FUZHOU_50 || FUZHOU_150 || FUZHOU_300 || IZRAEL_200 || TORINO_50 || TORUN_50 || CEVAK_40 || MURES_40
|
#elif BADGER_MALA_TRAT || BADGER_VELKA_TRAT || FUZHOU_50 || FUZHOU_150 || FUZHOU_300 || IZRAEL_200 || TORINO_50 || TORUN_50 || CEVAK_40 || MURES_40
|
||||||
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, (uint)totalRefPulses, (uint)testMethods,
|
ctrlBrdComponent.SendCommand((uint)sendCommandArgs.Cmd,
|
||||||
Convert.ToSingle(filterConstants[0]), fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
|
(byte)sendCommandArgs.RefFlowmtrNr,
|
||||||
|
(ulong)route,
|
||||||
|
(uint)sendCommandArgs.TotalRefPulses,
|
||||||
|
(uint)sendCommandArgs.TestMethods,
|
||||||
|
Convert.ToSingle(filterConstants[0]),
|
||||||
|
fmFreq,
|
||||||
|
(uint)regConst,
|
||||||
|
(uint)shortImp,
|
||||||
|
(uint)sendCommandArgs.StopDevs);
|
||||||
#elif BERLIN || SLM_150 || PETERSBURG_200
|
#elif BERLIN || SLM_150 || PETERSBURG_200
|
||||||
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
|
ctrlBrdComponent.SendCommand((uint)sendCommandArgs.Cmd,
|
||||||
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)(route & (UInt128)0xFFFFFFFFFFFFFFFF), (ulong)(route >> 64), pulsesArr, (uint)testMethods,
|
(byte)sendCommandArgs.RefFlowmtrNr,
|
||||||
Convert.ToSingle(filterConstants[0]), fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
|
(ulong)(route & (UInt128)0xFFFFFFFFFFFFFFFF),
|
||||||
|
(ulong)(route >> 64),
|
||||||
|
new uint[] { (uint)sendCommandArgs.TotalRefPulses, (uint)sendCommandArgs.MassRefPulses },
|
||||||
|
(uint)sendCommandArgs.TestMethods,
|
||||||
|
Convert.ToSingle(filterConstants[0]),
|
||||||
|
fmFreq,
|
||||||
|
(uint)regConst,
|
||||||
|
(uint)shortImp,
|
||||||
|
(uint)sendCommandArgs.StopDevs);
|
||||||
#elif GENESIS || DEWA_300
|
#elif GENESIS || DEWA_300
|
||||||
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
|
ctrlBrdComponent.SendCommand((uint)sendCommandArgs.Cmd,
|
||||||
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)(route & (UInt128)0xFFFFFFFFFFFFFFFF), (ulong)(route >> 64), pulsesArr, (uint)testMethods,
|
(byte)sendCommandArgs.RefFlowmtrNr,
|
||||||
filterConstants, fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
|
(ulong)(route & (UInt128)0xFFFFFFFFFFFFFFFF),
|
||||||
#elif JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || SENTEC || FUZHOU_100 || CEVAK_200 || IZRAEL_50
|
(ulong)(route >> 64),
|
||||||
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
|
new uint[] { (uint)sendCommandArgs.TotalRefPulses, (uint)sendCommandArgs.MassRefPulses },
|
||||||
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, pulsesArr, (uint)testMethods,
|
(uint)sendCommandArgs.TestMethods,
|
||||||
filterConstants, fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
|
filterConstants,
|
||||||
|
fmFreq,
|
||||||
|
(uint)regConst,
|
||||||
|
(uint)shortImp,
|
||||||
|
(uint)sendCommandArgs.StopDevs);
|
||||||
|
#elif JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || SENTEC || FUZHOU_100 || CEVAK_200 || IZRAEL_50 || ALZIR_25
|
||||||
|
ctrlBrdComponent.SendCommand((uint)sendCommandArgs.Cmd,
|
||||||
|
(byte)sendCommandArgs.RefFlowmtrNr,
|
||||||
|
(ulong)route,
|
||||||
|
new uint[] { (uint)sendCommandArgs.TotalRefPulses, (uint)sendCommandArgs.MassRefPulses },
|
||||||
|
(uint)sendCommandArgs.TestMethods,
|
||||||
|
filterConstants,
|
||||||
|
fmFreq,
|
||||||
|
(uint)regConst,
|
||||||
|
(uint)shortImp,
|
||||||
|
(uint)sendCommandArgs.StopDevs);
|
||||||
#else /// if TURA_IPERL || TURA_IPERL_NEW || TURA_SPECIAL || MALTA_WSD25 || SLM_50 || SLM_END || WARSAW_END || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || BADGER_STREDNA_TRAT || PUCHONG_200
|
#else /// if TURA_IPERL || TURA_IPERL_NEW || TURA_SPECIAL || MALTA_WSD25 || SLM_50 || SLM_END || WARSAW_END || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || BADGER_STREDNA_TRAT || PUCHONG_200
|
||||||
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
|
ctrlBrdComponent.SendCommand((uint)sendCommandArgs.Cmd,
|
||||||
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, pulsesArr, (uint)testMethods,
|
(byte)sendCommandArgs.RefFlowmtrNr,
|
||||||
Convert.ToSingle(filterConstants[0]), fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
|
(ulong)route,
|
||||||
|
new uint[] { (uint)sendCommandArgs.TotalRefPulses, (uint)sendCommandArgs.MassRefPulses },
|
||||||
|
(uint)sendCommandArgs.TestMethods,
|
||||||
|
Convert.ToSingle(filterConstants[0]),
|
||||||
|
fmFreq,
|
||||||
|
(uint)regConst,
|
||||||
|
(uint)shortImp,
|
||||||
|
(uint)sendCommandArgs.StopDevs);
|
||||||
#endif
|
#endif
|
||||||
log.DebugFormat("DoSendCommand() Route = {0}", Utils.RouteToStr(route));
|
log.DebugFormat("DoSendCommand() Route = {0}", Utils.RouteToStr(route));
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ namespace TBF.BenchControl.Elde
|
|||||||
public void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
controlBoard.SyncRoute();
|
controlBoard.SyncRoute();
|
||||||
controlBoard.SendCommand(commandOnStartOp, 0, controlBoard.Route, 0, 0, testMethod, StopDevs.None);
|
controlBoard.SendCommand(commandOnStartOp, 0, 0, 0, testMethod, StopDevs.None);
|
||||||
opState = OpState.StartingCommand;
|
opState = OpState.StartingCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ namespace TBF.BenchControl.Elde
|
|||||||
if (commandOnStopOp != Command.None)
|
if (commandOnStopOp != Command.None)
|
||||||
{
|
{
|
||||||
controlBoard.SyncRoute();
|
controlBoard.SyncRoute();
|
||||||
controlBoard.SendCommand(commandOnStopOp, 0, controlBoard.Route, 0, 0, testMethod, StopDevs.None);
|
controlBoard.SendCommand(commandOnStopOp, 0, 0, 0, testMethod, StopDevs.None);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,15 @@ namespace TBF.BenchControl.Elde.FixedStartRegisterReader
|
|||||||
readonly ControlBoardDev controlBoard;
|
readonly ControlBoardDev controlBoard;
|
||||||
|
|
||||||
|
|
||||||
|
public int Position
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
int firstDigitPos = Name.IndexOfAny(new char[] { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' });
|
||||||
|
int position;
|
||||||
|
return (firstDigitPos < 0) ? 0 : (int.TryParse(Name.Substring(firstDigitPos), out position) ? position : 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
public Config.Entities.RegisterReaderType RegisterReaderType { get { return Config.Entities.RegisterReaderType.Manual; } }
|
public Config.Entities.RegisterReaderType RegisterReaderType { get { return Config.Entities.RegisterReaderType.Manual; } }
|
||||||
public double PulsesPerLtr { get { return registerReaderCfg.ProcParams.PulsesPerLtr; } }
|
public double PulsesPerLtr { get { return registerReaderCfg.ProcParams.PulsesPerLtr; } }
|
||||||
public double LtrsPerPulse { get { return (PulsesPerLtr <= float.Epsilon) ? 1.0 : (1 / PulsesPerLtr); } }
|
public double LtrsPerPulse { get { return (PulsesPerLtr <= float.Epsilon) ? 1.0 : (1 / PulsesPerLtr); } }
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ namespace TBF.BenchControl.Elde.FlowMeter
|
|||||||
|
|
||||||
public double LtrPerPulseCorrected(double flow, int rangeIx)
|
public double LtrPerPulseCorrected(double flow, int rangeIx)
|
||||||
{
|
{
|
||||||
if (flow < 0.1 * NominalFlow) return LtrPerPulse; /// No correction for small flow
|
|
||||||
|
|
||||||
/// Apply correction
|
/// Apply correction
|
||||||
var rangeCorrections = new List<Config.Entities.MeasurementCorrection>();
|
var rangeCorrections = new List<Config.Entities.MeasurementCorrection>();
|
||||||
foreach (var corr in Corrections)
|
foreach (var corr in Corrections)
|
||||||
|
|||||||
@@ -28,22 +28,67 @@ namespace TBF.BenchControl.Elde.FlowMeterDewa
|
|||||||
public double NominalFlow { get { return nominalFlow; } }
|
public double NominalFlow { get { return nominalFlow; } }
|
||||||
public double LtrPerPulse { get { return ltrPerPulse; } }
|
public double LtrPerPulse { get { return ltrPerPulse; } }
|
||||||
|
|
||||||
double[] refFreq;
|
double[] refFreq; /// 0..sum, 1..I11, 2..I12, 3..I13
|
||||||
|
int[] refPulses;
|
||||||
|
|
||||||
public double LtrPerPulseCorrected(double flow, int rangeIx)
|
public double LtrPerPulseCorrected(double flow, int rangeIx)
|
||||||
{
|
{
|
||||||
if (flow < 0.1 * NominalFlow) return LtrPerPulse; /// No correction for small flow
|
log.DebugFormat("LtrPerPulseCorrected({0}, {1}) started", flow, rangeIx);
|
||||||
|
|
||||||
refFreq[0] = controlBoard.ReferenceFreqs(0);
|
refFreq[0] = controlBoard.ReferenceFreqs(0);
|
||||||
|
refFreq[1] = controlBoard.ReferenceFreqs(1);
|
||||||
refFreq[2] = controlBoard.ReferenceFreqs(2);
|
refFreq[2] = controlBoard.ReferenceFreqs(2);
|
||||||
refFreq[3] = controlBoard.ReferenceFreqs(3);
|
refFreq[3] = controlBoard.ReferenceFreqs(3);
|
||||||
|
log.DebugFormat("refFreq[] = ({0}, {1}, {2}, {3})", refFreq[0], refFreq[1], refFreq[2], refFreq[3]);
|
||||||
|
|
||||||
refFreq[1] = refFreq[0] - refFreq[2] - refFreq[3];
|
refFreq[1] = refFreq[0] - refFreq[2] - refFreq[3];
|
||||||
|
|
||||||
|
refPulses[0] = controlBoard.EtPulses(0);
|
||||||
|
refPulses[2] = controlBoard.EtPulses2;
|
||||||
|
refPulses[3] = controlBoard.EtPulses3;
|
||||||
|
refPulses[1] = refPulses[0] - refPulses[2] - refPulses[3];
|
||||||
|
|
||||||
|
log.DebugFormat("refPulses[] = ({0}, {1}, {2}, {3})", refPulses[0], refPulses[1], refPulses[2], refPulses[3]);
|
||||||
|
|
||||||
|
double flow1, flow2, flow3;
|
||||||
|
double contribution1, contribution2, contribution3;
|
||||||
|
if (refPulses[0] != 0)
|
||||||
|
{
|
||||||
|
/// Division by zero prevented inside this 'if'
|
||||||
double ltrPerPulseCorrected = 0;
|
double ltrPerPulseCorrected = 0;
|
||||||
if (flowMeter1 != null) ltrPerPulseCorrected += refFreq[1] * flowMeter1.LtrPerPulseCorrected(flow * refFreq[1] / refFreq[0], rangeIx);
|
if (flowMeter1 != null)
|
||||||
if (flowMeter2 != null) ltrPerPulseCorrected += refFreq[2] * flowMeter2.LtrPerPulseCorrected(flow * refFreq[2] / refFreq[0], rangeIx);
|
{
|
||||||
if (flowMeter3 != null) ltrPerPulseCorrected += refFreq[3] * flowMeter3.LtrPerPulseCorrected(flow * refFreq[3] / refFreq[0], rangeIx);
|
double ratio = (double)refPulses[flowMeter1.Idx1] / (double)refPulses[0];
|
||||||
return ltrPerPulseCorrected / refFreq[0];
|
flow1 = flow * ratio;
|
||||||
|
contribution1 = flowMeter1.LtrPerPulseCorrected(flow1, rangeIx) * ratio;
|
||||||
|
ltrPerPulseCorrected += contribution1;
|
||||||
|
log.DebugFormat("flowmeter1 = {0}, flow1 = {1}, contribution1 = {2}", flowMeter1.Name, flow1, contribution1);
|
||||||
|
}
|
||||||
|
if (flowMeter2 != null)
|
||||||
|
{
|
||||||
|
double ratio = (double)refPulses[flowMeter2.Idx1] / (double)refPulses[0];
|
||||||
|
flow2 = flow * ratio;
|
||||||
|
contribution2 = flowMeter2.LtrPerPulseCorrected(flow2, rangeIx) * ratio;
|
||||||
|
ltrPerPulseCorrected += contribution2;
|
||||||
|
log.DebugFormat("flowmeter2 = {0}, flow2 = {1}, contribution2 = {2}", flowMeter2.Name, flow2, contribution2);
|
||||||
|
}
|
||||||
|
if (flowMeter3 != null)
|
||||||
|
{
|
||||||
|
double ratio = (double)refPulses[flowMeter3.Idx1] / (double)refPulses[0];
|
||||||
|
flow3 = flow * ratio;
|
||||||
|
contribution3 = flowMeter3.LtrPerPulseCorrected(flow3, rangeIx) * ratio;
|
||||||
|
ltrPerPulseCorrected += contribution3;
|
||||||
|
log.DebugFormat("flowmeter3 = {0}, flow3 = {1}, contribution3 = {2}", flowMeter3.Name, flow3, contribution3);
|
||||||
|
}
|
||||||
|
|
||||||
|
log.DebugFormat("LtrPerPulseCorrected() returns {0}", ltrPerPulseCorrected);
|
||||||
|
return ltrPerPulseCorrected;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
log.DebugFormat("LtrPerPulseCorrected() returns 1");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -56,6 +101,8 @@ namespace TBF.BenchControl.Elde.FlowMeterDewa
|
|||||||
|
|
||||||
public FlowMeter()
|
public FlowMeter()
|
||||||
{
|
{
|
||||||
|
refFreq = new double[4];
|
||||||
|
refPulses = new int[4];
|
||||||
}
|
}
|
||||||
|
|
||||||
public FlowMeter(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
|
public FlowMeter(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
|
||||||
@@ -80,6 +127,7 @@ namespace TBF.BenchControl.Elde.FlowMeterDewa
|
|||||||
ltrPerPulse = nominalFlow / (flowMetersCount * 7200.0); /// Nominal freq. is flowMetersCount * 2000 Hz (2000, 4000 or 6000 Hz)
|
ltrPerPulse = nominalFlow / (flowMetersCount * 7200.0); /// Nominal freq. is flowMetersCount * 2000 Hz (2000, 4000 or 6000 Hz)
|
||||||
|
|
||||||
refFreq = new double[4];
|
refFreq = new double[4];
|
||||||
|
refPulses = new int[4];
|
||||||
|
|
||||||
log.Debug(this.ToString());
|
log.Debug(this.ToString());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ namespace TBF.BenchControl.Elde.FlowMeterTriplet
|
|||||||
|
|
||||||
public double LtrPerPulseCorrected(double flow, int rangeIx)
|
public double LtrPerPulseCorrected(double flow, int rangeIx)
|
||||||
{
|
{
|
||||||
if (flow < 0.1 * NominalFlow) return LtrPerPulse; /// No correction for small flow
|
|
||||||
|
|
||||||
/// Apply correction
|
/// Apply correction
|
||||||
double correctedFlow = Config.Formulas.CorrectedValue(flow, Corrections);
|
double correctedFlow = Config.Formulas.CorrectedValue(flow, Corrections);
|
||||||
return (LtrPerPulse * correctedFlow / flow);
|
return (LtrPerPulse * correctedFlow / flow);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using Dirichlet.Numerics;
|
using Dirichlet.Numerics;
|
||||||
@@ -11,6 +11,8 @@ namespace TBF.BenchControl.Elde
|
|||||||
StatusP StatusP { get; }
|
StatusP StatusP { get; }
|
||||||
int EtPulses(int wmNr1);
|
int EtPulses(int wmNr1);
|
||||||
int EtPulsesK { get; }
|
int EtPulsesK { get; }
|
||||||
|
int EtPulses2 { get; }
|
||||||
|
int EtPulses3 { get; }
|
||||||
UInt16 WMeterPulses(int wmNr1);
|
UInt16 WMeterPulses(int wmNr1);
|
||||||
int WMeterReference(int wmNr0);
|
int WMeterReference(int wmNr0);
|
||||||
uint RegulValveDAC(int rvNr0);
|
uint RegulValveDAC(int rvNr0);
|
||||||
@@ -59,19 +61,13 @@ namespace TBF.BenchControl.Elde
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates a command that is regularly sent to the control board by SendCommand.
|
/// Updates a command that is regularly sent to the control board by SendCommand.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="cmd">See ControlBoard.Command enum</param>
|
/// <param name="sendCommandArgs">Arguments, see SendCommandArgs class</param>
|
||||||
/// <param name="refNr">Number of the etalon/reference (1..5)</param>
|
/// <param name="route">State of valves, 128-bit word</param>
|
||||||
/// <param name="route">Route: 64-bit installation specific number</param>
|
/// <param name="filterConstants">Array with length=8 of filter costants (0..255, 0 = no filtering)</param>
|
||||||
/// <param name="totalRefPulses">Kolko impulzov ma trvat skuska</param>
|
/// <param name="fmFreq">Freq.inverter control (not applicable in DT100, Munich)</param>
|
||||||
/// <param name="massRefPulses">Pri 'MassAndContinue' metode kolko impulzov ma trvat mass measurement</param>
|
/// <param name="regConst">PID coefficient for flow control</param>
|
||||||
/// <param name="testMethods">See ControlBoard.TestMethods enum</param>
|
|
||||||
/// <param name="filterConstant">0 = No filtering (0..255)</param>
|
|
||||||
/// <param name="FMFreq">Freq.inverter control (not applicable in DT100, Munich)</param>
|
|
||||||
/// <param name="regConst">Coefficient used to control reg. valves (1..100)</param>
|
|
||||||
/// <param name="shortImp">0 = default value, 1 = spec. processing of very short pulses</param>
|
/// <param name="shortImp">0 = default value, 1 = spec. processing of very short pulses</param>
|
||||||
/// <param name="stopDevs">What to stop</param>
|
void SendCommand(SendCommandArgs sendCommandArgs, UInt128 route, uint[] filterConstants, float[] fmFreq, int regConst, int shortImp);
|
||||||
void SendCommand(Command cmd, int refNr, UInt128 route, int totalRefPulses, int massRefPulses, TestMethods testMethods,
|
|
||||||
uint[] filterConstants, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Control of regulating valves.
|
/// Control of regulating valves.
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ namespace TBF.BenchControl.Elde
|
|||||||
void SendCommand()
|
void SendCommand()
|
||||||
{
|
{
|
||||||
controlBoard.SyncRoute();
|
controlBoard.SyncRoute();
|
||||||
controlBoard.SendCommand(Command.ReadDivTransition, 0, controlBoard.Route, 0, 0, 0, StopDevs.None);
|
controlBoard.SendCommand(Command.ReadDivTransition, 0, 0, 0, 0, StopDevs.None);
|
||||||
cmdSent = true;
|
cmdSent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -110,13 +110,12 @@ namespace TBF.BenchControl.Elde.RegisterReader
|
|||||||
wmPulses = lastPulses;
|
wmPulses = lastPulses;
|
||||||
wmRefPulses = (int)controlBoard.EtPulses(Position);
|
wmRefPulses = (int)controlBoard.EtPulses(Position);
|
||||||
|
|
||||||
log.DebugFormat("{0}:ReadPulses() completed, wmPulses={1} wmRefPulses={2} cb.EtPulses(0)={3}", Name, wmPulses, wmRefPulses, (int)controlBoard.EtPulses(0));
|
log.DebugFormat("{0}:ReadPulses() completed, wmPulses={1} wmRefPulses={2}", Name, wmPulses, wmRefPulses);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Start this operation</summary>
|
/// <summary>Start this operation</summary>
|
||||||
public void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
log.DebugFormat("{0}:Start()", Name);
|
|
||||||
lastPulsesValid = false;
|
lastPulsesValid = false;
|
||||||
ReadPulses();
|
ReadPulses();
|
||||||
}
|
}
|
||||||
@@ -125,7 +124,6 @@ namespace TBF.BenchControl.Elde.RegisterReader
|
|||||||
/// <returns>eventDone</returns>
|
/// <returns>eventDone</returns>
|
||||||
public Event Run()
|
public Event Run()
|
||||||
{
|
{
|
||||||
log.DebugFormat("{0}:Run()", Name);
|
|
||||||
ReadPulses();
|
ReadPulses();
|
||||||
return Event.ReadRegisterDone;
|
return Event.ReadRegisterDone;
|
||||||
}
|
}
|
||||||
@@ -133,7 +131,6 @@ namespace TBF.BenchControl.Elde.RegisterReader
|
|||||||
/// <summary>Stop this operation</summary>
|
/// <summary>Stop this operation</summary>
|
||||||
public void Stop()
|
public void Stop()
|
||||||
{
|
{
|
||||||
log.DebugFormat("{0}:Stop()", Name);
|
|
||||||
ReadPulses();
|
ReadPulses();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,13 +109,8 @@ namespace TBF.BenchControl.Elde.RegulValve
|
|||||||
|
|
||||||
if (Idx1 < ControlBoard.RegValveCalib.GetLength(0))
|
if (Idx1 < ControlBoard.RegValveCalib.GetLength(0))
|
||||||
{
|
{
|
||||||
#if IZRAEL_25
|
|
||||||
this.ControlBoard.RegValveCalib[adcChannel, 0] = (uint)DacValueClosed;
|
this.ControlBoard.RegValveCalib[adcChannel, 0] = (uint)DacValueClosed;
|
||||||
this.ControlBoard.RegValveCalib[adcChannel, 1] = (uint)DacValueOpen;
|
this.ControlBoard.RegValveCalib[adcChannel, 1] = (uint)DacValueOpen;
|
||||||
#else
|
|
||||||
this.ControlBoard.RegValveCalib[Idx1 - 1, 0] = (uint)DacValueClosed;
|
|
||||||
this.ControlBoard.RegValveCalib[Idx1 - 1, 1] = (uint)DacValueOpen;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -198,16 +198,17 @@ namespace TBF.BenchControl.Elde.RegulValve
|
|||||||
opState = OpState.ValveMoveToFlow1;
|
opState = OpState.ValveMoveToFlow1;
|
||||||
}
|
}
|
||||||
|
|
||||||
TestMethods tm = 0;
|
/// Start flow measurement
|
||||||
StopDevs sd = 0;
|
controlBoard.SendCommand(Command.Start, flowMeter.Idx1, int.MaxValue, int.MaxValue, 0, 0); /// TestMethods=0, StopDevs=0
|
||||||
// '_regulValve.RegulValveCfg.PidCoef' replaced by a casted operation parameter 'pidCoef'
|
|
||||||
controlBoard.SendCommand(Command.Start, flowMeter.Idx1, controlBoard.Route,
|
|
||||||
int.MaxValue, int.MaxValue, tm, sd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Run this operation</summary>
|
/// <summary>Run this operation</summary>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// Event.None, Event.FlowReached, Event.RegulValveTimeOut, Event.OpArgumentError
|
/// Event.OpArgumentError
|
||||||
|
/// Event.Starting
|
||||||
|
/// Event.Busy
|
||||||
|
/// Event.FlowReached
|
||||||
|
/// Event.RegulValveTimeOut
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public Event Run()
|
public Event Run()
|
||||||
{
|
{
|
||||||
@@ -246,17 +247,14 @@ namespace TBF.BenchControl.Elde.RegulValve
|
|||||||
opState = OpState.ValveMoveToFlow1;
|
opState = OpState.ValveMoveToFlow1;
|
||||||
}
|
}
|
||||||
|
|
||||||
TestMethods tm = 0;
|
/// Start flow measurement
|
||||||
StopDevs sd = 0;
|
controlBoard.SendCommand(Command.Start, flowMeter.Idx1, int.MaxValue, int.MaxValue, 0, 0); /// TestMethods=0, StopDevs=0
|
||||||
// '_regulValve.RegulValveCfg.PidCoef' replaced by a casted operation parameter 'pidCoef'
|
return Event.Starting;
|
||||||
controlBoard.SendCommand(Command.Start, flowMeter.Idx1, controlBoard.Route,
|
|
||||||
int.MaxValue, int.MaxValue, tm, sd);
|
|
||||||
return Event.None;
|
|
||||||
}
|
}
|
||||||
else if (opState == OpState.ValveMoveToPosition1)
|
else if (opState == OpState.ValveMoveToPosition1)
|
||||||
{
|
{
|
||||||
opState = OpState.ValveMoveToPosition2;
|
opState = OpState.ValveMoveToPosition2;
|
||||||
return Event.None;
|
return Event.Starting;
|
||||||
}
|
}
|
||||||
else if (opState == OpState.ValveMoveToPosition2) /// Move to position
|
else if (opState == OpState.ValveMoveToPosition2) /// Move to position
|
||||||
{
|
{
|
||||||
@@ -266,7 +264,7 @@ namespace TBF.BenchControl.Elde.RegulValve
|
|||||||
regulValve.StableTime);
|
regulValve.StableTime);
|
||||||
|
|
||||||
opState = OpState.SettingPosition;
|
opState = OpState.SettingPosition;
|
||||||
return Event.None;
|
return Event.Starting;
|
||||||
}
|
}
|
||||||
else if (opState == OpState.ValveMoveToPosition3)
|
else if (opState == OpState.ValveMoveToPosition3)
|
||||||
{
|
{
|
||||||
@@ -278,14 +276,14 @@ namespace TBF.BenchControl.Elde.RegulValve
|
|||||||
{
|
{
|
||||||
opState = OpState.SettingPosition;
|
opState = OpState.SettingPosition;
|
||||||
}
|
}
|
||||||
return Event.None;
|
return Event.Starting;
|
||||||
}
|
}
|
||||||
else if (opState == OpState.CheckStatePosition) /// Verify
|
else if (opState == OpState.CheckStatePosition) /// Verify
|
||||||
{
|
{
|
||||||
if (((ulong)controlBoard.StatusP & (ulong)StatusP.RefPulsesMsrmnt) == 0)
|
if (((ulong)controlBoard.StatusP & (ulong)StatusP.RefPulsesMsrmnt) == 0)
|
||||||
{
|
{
|
||||||
opState = OpState.SendCommandAgain;
|
opState = OpState.SendCommandAgain;
|
||||||
return Event.None;
|
return Event.Starting;
|
||||||
}
|
}
|
||||||
else if (controlBoard.RegulValveState(regulValveNr) != RegulValveState.DacValueRegul)
|
else if (controlBoard.RegulValveState(regulValveNr) != RegulValveState.DacValueRegul)
|
||||||
{
|
{
|
||||||
@@ -298,12 +296,12 @@ namespace TBF.BenchControl.Elde.RegulValve
|
|||||||
regulValveNr, targetPositionLo, targetPositionHi, regulValve.StableTime);
|
regulValveNr, targetPositionLo, targetPositionHi, regulValve.StableTime);
|
||||||
|
|
||||||
opState = OpState.ValveMoveToPosition3;
|
opState = OpState.ValveMoveToPosition3;
|
||||||
return Event.None;
|
return Event.Starting;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
opState = OpState.SettingPosition;
|
opState = OpState.SettingPosition;
|
||||||
return Event.None;
|
return Event.Starting;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (opState == OpState.SettingPosition)
|
else if (opState == OpState.SettingPosition)
|
||||||
@@ -313,12 +311,12 @@ namespace TBF.BenchControl.Elde.RegulValve
|
|||||||
{
|
{
|
||||||
opState = OpState.ValveMoveToFlow1;
|
opState = OpState.ValveMoveToFlow1;
|
||||||
}
|
}
|
||||||
return Event.None;
|
return Event.Starting;
|
||||||
}
|
}
|
||||||
else if (opState == OpState.ValveMoveToFlow1)
|
else if (opState == OpState.ValveMoveToFlow1)
|
||||||
{
|
{
|
||||||
opState = OpState.ValveMoveToFlow2;
|
opState = OpState.ValveMoveToFlow2;
|
||||||
return Event.None;
|
return Event.Starting;
|
||||||
}
|
}
|
||||||
else if (opState == OpState.ValveMoveToFlow2) /// Move to flow
|
else if (opState == OpState.ValveMoveToFlow2) /// Move to flow
|
||||||
{
|
{
|
||||||
@@ -340,7 +338,7 @@ namespace TBF.BenchControl.Elde.RegulValve
|
|||||||
regulValve.StableTime);
|
regulValve.StableTime);
|
||||||
|
|
||||||
opState = OpState.ValveMoveToFlow3;
|
opState = OpState.ValveMoveToFlow3;
|
||||||
return Event.None;
|
return Event.Starting;
|
||||||
}
|
}
|
||||||
else if (opState == OpState.ValveMoveToFlow3)
|
else if (opState == OpState.ValveMoveToFlow3)
|
||||||
{
|
{
|
||||||
@@ -352,7 +350,7 @@ namespace TBF.BenchControl.Elde.RegulValve
|
|||||||
{
|
{
|
||||||
opState = OpState.SettingFlow;
|
opState = OpState.SettingFlow;
|
||||||
}
|
}
|
||||||
return Event.None;
|
return Event.Starting;
|
||||||
}
|
}
|
||||||
else if (opState == OpState.CheckStateFlow) /// Verify the flow setting
|
else if (opState == OpState.CheckStateFlow) /// Verify the flow setting
|
||||||
{
|
{
|
||||||
@@ -360,7 +358,7 @@ namespace TBF.BenchControl.Elde.RegulValve
|
|||||||
(controlBoard.RegulValveState(regulValveNr) & RegulValveState.PwOrFreqRegul) != RegulValveState.PwOrFreqRegul)
|
(controlBoard.RegulValveState(regulValveNr) & RegulValveState.PwOrFreqRegul) != RegulValveState.PwOrFreqRegul)
|
||||||
{
|
{
|
||||||
opState = OpState.SendCommandAgain;
|
opState = OpState.SendCommandAgain;
|
||||||
return Event.None;
|
return Event.Starting;
|
||||||
}
|
}
|
||||||
else if (controlBoard.RegulValveState(regulValveNr) != RegulValveState.PwOrFreqRegul)
|
else if (controlBoard.RegulValveState(regulValveNr) != RegulValveState.PwOrFreqRegul)
|
||||||
{
|
{
|
||||||
@@ -375,12 +373,12 @@ namespace TBF.BenchControl.Elde.RegulValve
|
|||||||
regulValveNr, freqLo, freqHi, regulValve.StableTime);
|
regulValveNr, freqLo, freqHi, regulValve.StableTime);
|
||||||
|
|
||||||
opState = OpState.ValveMoveToFlow3;
|
opState = OpState.ValveMoveToFlow3;
|
||||||
return Event.None;
|
return Event.Starting;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
opState = OpState.SettingFlow;
|
opState = OpState.SettingFlow;
|
||||||
return Event.None;
|
return Event.Busy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (opState == OpState.SettingFlow)
|
else if (opState == OpState.SettingFlow)
|
||||||
@@ -423,7 +421,7 @@ namespace TBF.BenchControl.Elde.RegulValve
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
log.InfoFormat("flow = {0} m3/h (lo={1}, hi={2}, FLOW_OK_TIMER={3}s)", flow, currentReqFlowLo, currentReqFlowHi, flowWithinBoundsTime);
|
log.InfoFormat("flow = {0} m3/h (lo={1}, hi={2}, FLOW_OK_TIMER={3}s)", flow, currentReqFlowLo, currentReqFlowHi, flowWithinBoundsTime);
|
||||||
return Event.None;
|
return Event.Busy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (StateMachine.Time > expireTime)
|
else if (StateMachine.Time > expireTime)
|
||||||
@@ -434,7 +432,7 @@ namespace TBF.BenchControl.Elde.RegulValve
|
|||||||
{
|
{
|
||||||
log.InfoFormat("flow = {0} m3/h (lo={1}, hi={2})", flow, currentReqFlowLo, currentReqFlowHi);
|
log.InfoFormat("flow = {0} m3/h (lo={1}, hi={2})", flow, currentReqFlowLo, currentReqFlowHi);
|
||||||
flowWithinBoundsTime = 0;
|
flowWithinBoundsTime = 0;
|
||||||
return Event.None;
|
return Event.Busy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else /// opState == OpState.FlowReached
|
else /// opState == OpState.FlowReached
|
||||||
@@ -447,14 +445,13 @@ namespace TBF.BenchControl.Elde.RegulValve
|
|||||||
/// <summary>Start this operation</summary>
|
/// <summary>Start this operation</summary>
|
||||||
public void Stop()
|
public void Stop()
|
||||||
{
|
{
|
||||||
opState = OpState.Idle;
|
if (!leaveMeasurementRunning)
|
||||||
|
{
|
||||||
if (leaveMeasurementRunning) return;
|
|
||||||
|
|
||||||
/// Stop measurement
|
/// Stop measurement
|
||||||
TestMethods tm = 0;
|
controlBoard.SendCommand(Command.Stop, flowMeter.Idx1, 50000, 50000, 0, StopDevs.RegValveRegulation); /// TestMethods=0
|
||||||
StopDevs sd = StopDevs.RegValveRegulation;
|
}
|
||||||
controlBoard.SendCommand(Command.Stop, flowMeter.Idx1, controlBoard.Route, 50000, 50000, tm, sd);
|
|
||||||
|
opState = OpState.Idle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -212,8 +212,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
|
|||||||
TestMethods tm = 0;
|
TestMethods tm = 0;
|
||||||
StopDevs sd = 0;
|
StopDevs sd = 0;
|
||||||
// '_regulValve.RegulValveCfg.PidCoef' replaced by a casted operation parameter 'pidCoef'
|
// '_regulValve.RegulValveCfg.PidCoef' replaced by a casted operation parameter 'pidCoef'
|
||||||
controlBoard.SendCommand(Command.Start, flowMeterNr, controlBoard.Route,
|
controlBoard.SendCommand(Command.Start, flowMeterNr, int.MaxValue, int.MaxValue, tm, sd);
|
||||||
int.MaxValue, int.MaxValue, tm, sd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Run this operation</summary>
|
/// <summary>Run this operation</summary>
|
||||||
@@ -262,8 +261,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
|
|||||||
TestMethods tm = 0;
|
TestMethods tm = 0;
|
||||||
StopDevs sd = 0;
|
StopDevs sd = 0;
|
||||||
// '_regulValve.RegulValveCfg.PidCoef' replaced by a casted operation parameter 'pidCoef'
|
// '_regulValve.RegulValveCfg.PidCoef' replaced by a casted operation parameter 'pidCoef'
|
||||||
controlBoard.SendCommand(Command.Start, flowMeterNr, controlBoard.Route,
|
controlBoard.SendCommand(Command.Start, flowMeterNr, int.MaxValue, int.MaxValue, tm, sd);
|
||||||
int.MaxValue, int.MaxValue, tm, sd);
|
|
||||||
log.DebugFormat(" return Event.None");
|
log.DebugFormat(" return Event.None");
|
||||||
return Event.None;
|
return Event.None;
|
||||||
}
|
}
|
||||||
@@ -479,7 +477,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
|
|||||||
/// Stop measurement
|
/// Stop measurement
|
||||||
TestMethods tm = 0;
|
TestMethods tm = 0;
|
||||||
StopDevs sd = StopDevs.RegValveRegulation;
|
StopDevs sd = StopDevs.RegValveRegulation;
|
||||||
controlBoard.SendCommand(Command.Stop, flowMeterNr, controlBoard.Route, 50000, 50000, tm, sd);
|
controlBoard.SendCommand(Command.Stop, flowMeterNr, 50000, 50000, tm, sd);
|
||||||
|
|
||||||
log.WarnFormat("Stop() SendCommand(Stop, {0}, ...)", flowMeterNr);
|
log.WarnFormat("Stop() SendCommand(Stop, {0}, ...)", flowMeterNr);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -217,8 +217,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
|
|||||||
TestMethods tm = 0;
|
TestMethods tm = 0;
|
||||||
StopDevs sd = 0;
|
StopDevs sd = 0;
|
||||||
// '_regulValve.RegulValveTandemCfg.PidCoef' replaced by a casted operation parameter 'pidCoef'
|
// '_regulValve.RegulValveTandemCfg.PidCoef' replaced by a casted operation parameter 'pidCoef'
|
||||||
controlBoard.SendCommand(Command.Start, flowMeterNr, controlBoard.Route,
|
controlBoard.SendCommand(Command.Start, flowMeterNr, int.MaxValue, int.MaxValue, tm, sd);
|
||||||
int.MaxValue, int.MaxValue, tm, sd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Run this operation</summary>
|
/// <summary>Run this operation</summary>
|
||||||
@@ -371,7 +370,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
|
|||||||
/// Stop measurement
|
/// Stop measurement
|
||||||
TestMethods tm = 0;
|
TestMethods tm = 0;
|
||||||
StopDevs sd = StopDevs.RegValveRegulation;
|
StopDevs sd = StopDevs.RegValveRegulation;
|
||||||
controlBoard.SendCommand(Command.Stop, flowMeterNr, controlBoard.Route, 50000, 50000, tm, sd);
|
controlBoard.SendCommand(Command.Stop, flowMeterNr, 50000, 50000, tm, sd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
///
|
||||||
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System;
|
||||||
|
using Dirichlet.Numerics;
|
||||||
|
|
||||||
|
namespace TBF.BenchControl.Elde
|
||||||
|
{
|
||||||
|
public class SendCommandArgs
|
||||||
|
{
|
||||||
|
public Command Cmd;
|
||||||
|
public int RefFlowmtrNr;
|
||||||
|
public int TotalRefPulses;
|
||||||
|
public int MassRefPulses;
|
||||||
|
public TestMethods TestMethods;
|
||||||
|
public StopDevs StopDevs;
|
||||||
|
|
||||||
|
public SendCommandArgs()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendCommandArgs(Command cmd, int refFlowmtrNr, int totalRefPulses, int massRefPulses,
|
||||||
|
TestMethods testMethods, StopDevs stopDevs)
|
||||||
|
{
|
||||||
|
Cmd = cmd;
|
||||||
|
RefFlowmtrNr = refFlowmtrNr;
|
||||||
|
TotalRefPulses = totalRefPulses;
|
||||||
|
MassRefPulses = massRefPulses;
|
||||||
|
TestMethods = testMethods;
|
||||||
|
StopDevs = stopDevs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -125,8 +125,7 @@ namespace TBF.BenchControl.Elde
|
|||||||
log.InfoFormat("Start() : SendCommand(Cmd.Start, {0}, route, {1}, {1}, {2}, Stop.None)",
|
log.InfoFormat("Start() : SendCommand(Cmd.Start, {0}, route, {1}, {1}, {2}, Stop.None)",
|
||||||
flowMeterIdxAndDiv, totalRefPulses, testMethod);
|
flowMeterIdxAndDiv, totalRefPulses, testMethod);
|
||||||
|
|
||||||
controlBoard.SendCommand(Command.Start, flowMeterIdxAndDiv, controlBoard.Route,
|
controlBoard.SendCommand(Command.Start, flowMeterIdxAndDiv, totalRefPulses, massRefPulses, testMethod, StopDevs.None);
|
||||||
totalRefPulses, massRefPulses, testMethod, StopDevs.None);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Start this operation</summary>
|
/// <summary>Start this operation</summary>
|
||||||
|
|||||||
@@ -35,12 +35,7 @@ namespace TBF.BenchControl.Elde
|
|||||||
void SendStopFlowRegulationCommand()
|
void SendStopFlowRegulationCommand()
|
||||||
{
|
{
|
||||||
controlBoard.SyncRoute();
|
controlBoard.SyncRoute();
|
||||||
controlBoard.SendCommand(Command.Stop,
|
controlBoard.SendCommand(Command.Stop, flowMeterNr, 0, 0, 0, StopDevs.RegValveRegulation);
|
||||||
flowMeterNr, /// ref. flowmeter number
|
|
||||||
controlBoard.Route, /// route
|
|
||||||
0, 0, /// ref. pulses
|
|
||||||
0,
|
|
||||||
StopDevs.RegValveRegulation);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -43,11 +43,7 @@ namespace TBF.BenchControl.Elde
|
|||||||
void SendStopCommand()
|
void SendStopCommand()
|
||||||
{
|
{
|
||||||
controlBoard.SyncRoute();
|
controlBoard.SyncRoute();
|
||||||
controlBoard.SendCommand(Command.Stop,
|
controlBoard.SendCommand(Command.Stop, 0, 0, 0, TestMethods.Diverter,
|
||||||
0, /// ref. flowmeter number
|
|
||||||
controlBoard.Route, /// route
|
|
||||||
0, 0, /// ref. pulses
|
|
||||||
TestMethods.Diverter,
|
|
||||||
StopDevs.Diverter | StopDevs.GatePulse | StopDevs.Reference | StopDevs.RegValveRegulation);
|
StopDevs.Diverter | StopDevs.GatePulse | StopDevs.Reference | StopDevs.RegValveRegulation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ namespace TBF.BenchControl
|
|||||||
public enum Event
|
public enum Event
|
||||||
{
|
{
|
||||||
None = 0,
|
None = 0,
|
||||||
|
Starting, /// During initial phase of some process, sending a command to a device, etc.
|
||||||
Busy, /// Useful when waiting in state until at least one is busy (all are done)
|
Busy, /// Useful when waiting in state until at least one is busy (all are done)
|
||||||
Done, /// Useful when waiting in state until the first is done, the rest miht still be busy
|
Done, /// Useful when waiting in state until the first is done, the rest miht still be busy
|
||||||
MakeSecondPass, /// Test completed OK but 2nd pass (evaluation) is required
|
MakeSecondPass, /// Test completed OK but 2nd pass (evaluation) is required
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using TBF.BenchControl.Generic;
|
using TBF.BenchControl.Generic;
|
||||||
using TBF.Boxes;
|
using TBF.Boxes;
|
||||||
@@ -10,6 +10,7 @@ namespace TBF.BenchControl.GenericDevices
|
|||||||
{
|
{
|
||||||
Config.Entities.RegisterReaderType RegisterReaderType { get; }
|
Config.Entities.RegisterReaderType RegisterReaderType { get; }
|
||||||
|
|
||||||
|
int Position { get; }
|
||||||
double PulsesPerLtr { get; } /// [imp/l] ... water meter or volume measurement part of a heat meter
|
double PulsesPerLtr { get; } /// [imp/l] ... water meter or volume measurement part of a heat meter
|
||||||
double LtrsPerPulse { get; } /// [l/imp]
|
double LtrsPerPulse { get; } /// [l/imp]
|
||||||
|
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
|||||||
this.GetType().Namespace.Substring(17),
|
this.GetType().Namespace.Substring(17),
|
||||||
CameraCfg.Name,
|
CameraCfg.Name,
|
||||||
CameraCfg.HardwareAddress,
|
CameraCfg.HardwareAddress,
|
||||||
ipAddress == null ? "not detected" : ipAddress.ToString(),
|
CameraCfg.DebugLevel == DebugMode.Simulate ? "simulated" : ((ipAddress == null) ? "not detected" : ipAddress.ToString()),
|
||||||
string.IsNullOrEmpty(cpuSerialNr) ? "not detected" : cpuSerialNr,
|
CameraCfg.DebugLevel == DebugMode.Simulate ? "simulated" : (string.IsNullOrEmpty(cpuSerialNr) ? "not detected" : cpuSerialNr),
|
||||||
string.IsNullOrEmpty(sdCardVer) ? "not detected" : sdCardVer);
|
CameraCfg.DebugLevel == DebugMode.Simulate ? "simulated" : (string.IsNullOrEmpty(sdCardVer) ? "not detected" : sdCardVer));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -161,13 +161,16 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
|||||||
{
|
{
|
||||||
cameraIdx = GetCameraIdx();
|
cameraIdx = GetCameraIdx();
|
||||||
|
|
||||||
if (CameraCfg.DebugLevel == DebugMode.Simulate) return;
|
if (CameraCfg.DebugLevel == DebugMode.Simulate)
|
||||||
|
{
|
||||||
|
UiBridge.Bridge.OnCameraInfo(this.cameraIdx, string.Format("{0} s/n {1} si simulated", Name, CameraCfg.HardwareAddress));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/// Detect a camera
|
/// Detect a camera
|
||||||
bool cameraDetected = DetectCamera(CameraCfg.HardwareAddress % 100, ref ipAddress, true,
|
bool cameraDetected = DetectCamera(CameraCfg.HardwareAddress % 100, ref ipAddress, true,
|
||||||
out cpuHardware, out cpuRevision, out cpuSerialNr, out sdCardVer);
|
out cpuHardware, out cpuRevision, out cpuSerialNr, out sdCardVer);
|
||||||
|
|
||||||
|
|
||||||
if (CameraCfg.DebugLevel == DebugMode.AutoDetect)
|
if (CameraCfg.DebugLevel == DebugMode.AutoDetect)
|
||||||
{
|
{
|
||||||
CameraCfg.DebugLevel = cameraDetected ? DebugMode.DetectedOn : DebugMode.DetectedOff;
|
CameraCfg.DebugLevel = cameraDetected ? DebugMode.DetectedOn : DebugMode.DetectedOff;
|
||||||
@@ -218,6 +221,8 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void StopDevice()
|
public void StopDevice()
|
||||||
|
{
|
||||||
|
if ((CameraCfg.DebugLevel != DebugMode.Simulate) && (CameraCfg.DebugLevel != DebugMode.DetectedOff))
|
||||||
{
|
{
|
||||||
running = false;
|
running = false;
|
||||||
|
|
||||||
@@ -230,9 +235,12 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
|||||||
Telnet.Dispose();
|
Telnet.Dispose();
|
||||||
Telnet = null;
|
Telnet = null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StopDevice2()
|
public void StopDevice2()
|
||||||
|
{
|
||||||
|
if ((CameraCfg.DebugLevel != DebugMode.Simulate) && (CameraCfg.DebugLevel != DebugMode.DetectedOff))
|
||||||
{
|
{
|
||||||
if (scpThread != null) scpThread.Join(50);
|
if (scpThread != null) scpThread.Join(50);
|
||||||
if (rtpListenerThread != null) rtpListenerThread.Join(50);
|
if (rtpListenerThread != null) rtpListenerThread.Join(50);
|
||||||
@@ -249,9 +257,12 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
|||||||
msrmntUdpClient.Close();
|
msrmntUdpClient.Close();
|
||||||
msrmntUdpClient = null;
|
msrmntUdpClient = null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RunDeviceBefore()
|
public void RunDeviceBefore()
|
||||||
|
{
|
||||||
|
if ((CameraCfg.DebugLevel != DebugMode.Simulate) && (CameraCfg.DebugLevel != DebugMode.DetectedOff))
|
||||||
{
|
{
|
||||||
if (sha1sumResponse != null && !sha1sumResponseProcessed)
|
if (sha1sumResponse != null && !sha1sumResponseProcessed)
|
||||||
{
|
{
|
||||||
@@ -260,6 +271,7 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
|||||||
|
|
||||||
sha1sumResponseProcessed = true;
|
sha1sumResponseProcessed = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public void RunDeviceAfter() { }
|
public void RunDeviceAfter() { }
|
||||||
|
|
||||||
|
|||||||
@@ -50,10 +50,13 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
|||||||
grabImageCommandSent = false;
|
grabImageCommandSent = false;
|
||||||
transferringGrabbedImage = false;
|
transferringGrabbedImage = false;
|
||||||
|
|
||||||
|
if (camera.DebugLevel == DebugMode.Normal || camera.DebugLevel == DebugMode.DetectedOn)
|
||||||
|
{
|
||||||
telnet.promptReceivedHandler += delegate(object sndr, PromptReceivedEventArgs a)
|
telnet.promptReceivedHandler += delegate(object sndr, PromptReceivedEventArgs a)
|
||||||
{
|
{
|
||||||
OnPromptReceived(sndr, a);
|
OnPromptReceived(sndr, a);
|
||||||
};
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnPromptReceived(object sndr, PromptReceivedEventArgs a)
|
void OnPromptReceived(object sndr, PromptReceivedEventArgs a)
|
||||||
@@ -65,33 +68,58 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
|||||||
|
|
||||||
public void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
if (camera.CameraCfg.DebugLevel == Config.Entities.DebugMode.Simulate) return;
|
|
||||||
|
|
||||||
grabImageCommandSent = false;
|
grabImageCommandSent = false;
|
||||||
transferringGrabbedImage = false;
|
transferringGrabbedImage = false;
|
||||||
if (File.Exists(imgFileNames[0])) File.Delete(imgFileNames[0]);
|
|
||||||
|
if ((imgFileNames != null) && (imgFileNames.Length > 0) && File.Exists(imgFileNames[0]))
|
||||||
|
{
|
||||||
|
///
|
||||||
|
/// An image specified, (1) delete previous image, (2) check if this is a simulation
|
||||||
|
///
|
||||||
|
File.Delete(imgFileNames[0]);
|
||||||
|
|
||||||
|
if (camera.CameraCfg.DebugLevel == Config.Entities.DebugMode.Simulate || camera.CameraCfg.DebugLevel == Config.Entities.DebugMode.DetectedOff)
|
||||||
|
{
|
||||||
|
///
|
||||||
|
/// Camera is in simulation mode => create a simulated image
|
||||||
|
///
|
||||||
|
File.Copy(string.Format("{0}\\Pictures\\sample.jpg", Program.ExecutableDir), imgFileNames[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Event Run()
|
public Event Run()
|
||||||
{
|
{
|
||||||
if (camera.CameraCfg.DebugLevel == Config.Entities.DebugMode.Simulate) return Event.None;
|
if ((imgFileNames == null) || (imgFileNames.Length < 1) || (imgFileNames[0] == null))
|
||||||
|
|
||||||
if (imgFileNames.Length < 1 || imgFileNames[0] == null)
|
|
||||||
{
|
{
|
||||||
|
///
|
||||||
|
/// No images to be grabbed => Done
|
||||||
|
///
|
||||||
|
return Event.GrabPassed;
|
||||||
|
}
|
||||||
|
else if (camera.CameraCfg.DebugLevel == Config.Entities.DebugMode.Simulate ||
|
||||||
|
camera.CameraCfg.DebugLevel == Config.Entities.DebugMode.DetectedOff)
|
||||||
|
{
|
||||||
|
///
|
||||||
|
/// Camera is in simulation mode => create a simulated image and complete
|
||||||
|
///
|
||||||
return Event.GrabPassed;
|
return Event.GrabPassed;
|
||||||
}
|
}
|
||||||
else if (!grabImageCommandSent)
|
else if (!grabImageCommandSent)
|
||||||
{
|
{
|
||||||
|
///
|
||||||
|
/// Normal operation, no command sent yet => (1) wait until telnet state = Inactive, (2) send a command
|
||||||
|
///
|
||||||
if (camera.Running && (telnet.State == TelnetClient.TelnetState.Inactive))
|
if (camera.Running && (telnet.State == TelnetClient.TelnetState.Inactive))
|
||||||
{
|
{
|
||||||
//
|
///
|
||||||
// State variables
|
/// State variables
|
||||||
//
|
///
|
||||||
response = null;
|
response = null;
|
||||||
|
|
||||||
//
|
///
|
||||||
// Prepare command
|
/// Prepare a command
|
||||||
//
|
///
|
||||||
int rotation = 0;
|
int rotation = 0;
|
||||||
if (imageRotation == ImageRotation.Deg90)
|
if (imageRotation == ImageRotation.Deg90)
|
||||||
rotation = 90;
|
rotation = 90;
|
||||||
@@ -119,6 +147,9 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
|||||||
}
|
}
|
||||||
else if (grabPassed)
|
else if (grabPassed)
|
||||||
{
|
{
|
||||||
|
///
|
||||||
|
/// Normal operation, grab passed => transfer/transferring the image
|
||||||
|
///
|
||||||
if (transferringGrabbedImage)
|
if (transferringGrabbedImage)
|
||||||
{
|
{
|
||||||
/// Grab passed and image transfer is in progress
|
/// Grab passed and image transfer is in progress
|
||||||
@@ -138,11 +169,16 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
|
|||||||
}
|
}
|
||||||
else if (grabFailed)
|
else if (grabFailed)
|
||||||
{
|
{
|
||||||
/// Grab failed, there in no image to transfer
|
///
|
||||||
|
/// Normal operation, grab failed => there in no image to transfer
|
||||||
|
///
|
||||||
return Event.GrabFailed;
|
return Event.GrabFailed;
|
||||||
}
|
}
|
||||||
else if (response != null)
|
else if (response != null)
|
||||||
{
|
{
|
||||||
|
///
|
||||||
|
/// Normal operation
|
||||||
|
///
|
||||||
if (response.Contains("completed"))
|
if (response.Contains("completed"))
|
||||||
{
|
{
|
||||||
grabPassed = true;
|
grabPassed = true;
|
||||||
|
|||||||
@@ -33,6 +33,15 @@ namespace TBF.BenchControl.Network.Camera.Roi
|
|||||||
///
|
///
|
||||||
public GenericDevices.ICamera Camera { get { return NetCamera as GenericDevices.ICamera; } }
|
public GenericDevices.ICamera Camera { get { return NetCamera as GenericDevices.ICamera; } }
|
||||||
|
|
||||||
|
public int Position
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
int firstDigitPos = Name.IndexOfAny(new char[] { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' });
|
||||||
|
int position;
|
||||||
|
return (firstDigitPos < 0) ? 0 : (int.TryParse(Name.Substring(firstDigitPos), out position) ? position : 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
public Config.Entities.RegisterReaderType RegisterReaderType { get { return Config.Entities.RegisterReaderType.Camera; } }
|
public Config.Entities.RegisterReaderType RegisterReaderType { get { return Config.Entities.RegisterReaderType.Camera; } }
|
||||||
public double PulsesPerLtr { get { return RoiCfg.ProcParams.PulsesPerLtr; } }
|
public double PulsesPerLtr { get { return RoiCfg.ProcParams.PulsesPerLtr; } }
|
||||||
public double LtrsPerPulse { get { return (PulsesPerLtr <= float.Epsilon) ? 1.0 : (1 / PulsesPerLtr); } }
|
public double LtrsPerPulse { get { return (PulsesPerLtr <= float.Epsilon) ? 1.0 : (1 / PulsesPerLtr); } }
|
||||||
|
|||||||
@@ -30,6 +30,15 @@ namespace TBF.BenchControl.Network.Camera.RoiForFixedStart
|
|||||||
public readonly CLP1611.Camera NetCamera;
|
public readonly CLP1611.Camera NetCamera;
|
||||||
public GenericDevices.ICamera Camera { get { return NetCamera as GenericDevices.ICamera; } }
|
public GenericDevices.ICamera Camera { get { return NetCamera as GenericDevices.ICamera; } }
|
||||||
|
|
||||||
|
public int Position
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
int firstDigitPos = Name.IndexOfAny(new char[] { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' });
|
||||||
|
int position;
|
||||||
|
return (firstDigitPos < 0) ? 0 : (int.TryParse(Name.Substring(firstDigitPos), out position) ? position : 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
public Config.Entities.RegisterReaderType RegisterReaderType { get { return Config.Entities.RegisterReaderType.Manual; } }
|
public Config.Entities.RegisterReaderType RegisterReaderType { get { return Config.Entities.RegisterReaderType.Manual; } }
|
||||||
public double PulsesPerLtr { get { return roiCfg.ProcParams.PulsesPerLtr; } }
|
public double PulsesPerLtr { get { return roiCfg.ProcParams.PulsesPerLtr; } }
|
||||||
public double LtrsPerPulse { get { return (PulsesPerLtr <= float.Epsilon) ? 1.0 : (1 / PulsesPerLtr); } }
|
public double LtrsPerPulse { get { return (PulsesPerLtr <= float.Epsilon) ? 1.0 : (1 / PulsesPerLtr); } }
|
||||||
@@ -127,17 +136,11 @@ namespace TBF.BenchControl.Network.Camera.RoiForFixedStart
|
|||||||
|
|
||||||
public IOperation GrabImageOp(string imageFileName)
|
public IOperation GrabImageOp(string imageFileName)
|
||||||
{
|
{
|
||||||
if (NetCamera != null)
|
return GrabImageOp(imageFileName, roiCfg.BlackAndWhite, roiCfg.LowResolution, roiCfg.ImageRotation);
|
||||||
{
|
|
||||||
/// TODO: Implement support for sharing one camera by multiple ROI-s
|
|
||||||
return NetCamera.GrabImagesOp(new string[] { imageFileName }, roiCfg.BlackAndWhite, roiCfg.LowResolution, roiCfg.ImageRotation);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IOperation GrabImageOp(string imageFileName, bool blackAndWhite,
|
public IOperation GrabImageOp(string imageFileName,
|
||||||
bool lowResolution, Config.Entities.ImageRotation imageRotation)
|
bool blackAndWhite, bool lowResolution, Config.Entities.ImageRotation imageRotation)
|
||||||
{
|
{
|
||||||
if (NetCamera != null)
|
if (NetCamera != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
|||||||
public IComponentCfgCtrl GetControl() { return new TracingCfgCtrl(); }
|
public IComponentCfgCtrl GetControl() { return new TracingCfgCtrl(); }
|
||||||
|
|
||||||
|
|
||||||
public string Workplace;
|
|
||||||
public string ConnStr;
|
public string ConnStr;
|
||||||
|
public string ConnStr2;
|
||||||
public string NetAdapter;
|
public string NetAdapter;
|
||||||
public bool CheckPreviousRecords;
|
public bool CheckPreviousRecords;
|
||||||
public bool SaveTracingRecords;
|
public bool SaveTracingRecords;
|
||||||
@@ -28,9 +28,9 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
|||||||
MonitoringCfg()
|
MonitoringCfg()
|
||||||
{
|
{
|
||||||
ParentName = string.Empty;
|
ParentName = string.Empty;
|
||||||
Workplace = "WR10";
|
|
||||||
NetAdapter = string.Empty;
|
NetAdapter = string.Empty;
|
||||||
ConnStr = "SERVER=10.42.128.16; DATABASE=sledovanie2019; UID=vyroba2019; PASSWORD=qwerty; CHARSET=utf8;";
|
ConnStr = "server=10.42.128.16; database=sledovanie2020; uid=vyroba2020; pwd=qwerty; charset=utf8;";
|
||||||
|
ConnStr2 = "server=10.42.128.16; database=sledovanie2019; uid=vyroba2019; pwd=qwerty; charset=utf8;";
|
||||||
CheckPreviousRecords = true;
|
CheckPreviousRecords = true;
|
||||||
SaveTracingRecords = true;
|
SaveTracingRecords = true;
|
||||||
}
|
}
|
||||||
@@ -44,12 +44,12 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
|||||||
|
|
||||||
public string ToString(int i)
|
public string ToString(int i)
|
||||||
{
|
{
|
||||||
return string.Format("Name={0}, Workplace={1}, CheckPreviousRecords={2}, SaveTracingRecords={3}, ConnStr={4}",
|
return string.Format("Name={0}, CheckPrev.={1}, SaveRecords={2}, ConnStr={3}, , ConnStr2={4}",
|
||||||
Name,
|
Name,
|
||||||
Workplace,
|
|
||||||
CheckPreviousRecords,
|
CheckPreviousRecords,
|
||||||
SaveTracingRecords,
|
SaveTracingRecords,
|
||||||
ConnStr);
|
ConnStr,
|
||||||
|
ConnStr2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,14 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
|||||||
public const string WorkstepName = "Test_bench";
|
public const string WorkstepName = "Test_bench";
|
||||||
|
|
||||||
MonitoringCfg tracingCfg;
|
MonitoringCfg tracingCfg;
|
||||||
string workplace { get { return tracingCfg.Workplace; } }
|
string workplace
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
TBF.BenchControl.GenericDevices.IBenchInfo benchInfo = TBF.BenchControl.Sequences.ProcessData.BenchInfo;
|
||||||
|
return (benchInfo != null) ? benchInfo.TestBenchName : "TestBench";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
readonly IPAddress ipAddress;
|
readonly IPAddress ipAddress;
|
||||||
readonly IPAddress netMask;
|
readonly IPAddress netMask;
|
||||||
@@ -74,6 +81,11 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
|||||||
Dictionary<int, Process> processDictionary;
|
Dictionary<int, Process> processDictionary;
|
||||||
Dictionary<int, IList<Workstep>> workstepsDictionary;
|
Dictionary<int, IList<Workstep>> workstepsDictionary;
|
||||||
|
|
||||||
|
ISessionFactory sessionFactory2; /// Factory to create database sessions that is initialized in the constructor
|
||||||
|
IList<Process> processes2;
|
||||||
|
Dictionary<int, Process> processDictionary2;
|
||||||
|
Dictionary<int, IList<Workstep>> workstepsDictionary2;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Previous workstep verification info
|
/// Previous workstep verification info
|
||||||
///
|
///
|
||||||
@@ -118,6 +130,19 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
|||||||
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<TracingDB.Entities.Process>())
|
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<TracingDB.Entities.Process>())
|
||||||
.ExposeConfiguration(TracingDB.DB.BuildSchema)
|
.ExposeConfiguration(TracingDB.DB.BuildSchema)
|
||||||
.BuildSessionFactory();
|
.BuildSessionFactory();
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Session factory 2 is used to create the 2nd database sessions
|
||||||
|
///
|
||||||
|
if (!string.IsNullOrEmpty(tracingCfg.ConnStr2))
|
||||||
|
{
|
||||||
|
sessionFactory2 = FluentNHibernate.Cfg.Fluently.Configure()
|
||||||
|
.Database(FluentNHibernate.Cfg.Db.MySQLConfiguration.Standard.ConnectionString(tracingCfg.ConnStr2))
|
||||||
|
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<TracingDB.Entities.Process>())
|
||||||
|
.ExposeConfiguration(TracingDB.DB.BuildSchema)
|
||||||
|
.BuildSessionFactory();
|
||||||
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Register this test bench in the tracing DB for approx. 2 weeks
|
/// Register this test bench in the tracing DB for approx. 2 weeks
|
||||||
///
|
///
|
||||||
@@ -283,6 +308,7 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
|||||||
{
|
{
|
||||||
Retv retVal = Retv.Error;
|
Retv retVal = Retv.Error;
|
||||||
|
|
||||||
|
bool isAtLeastOneNOK = false;
|
||||||
using (ISession session = sessionFactory.OpenSession())
|
using (ISession session = sessionFactory.OpenSession())
|
||||||
{
|
{
|
||||||
for (int i = 0; i < waterMeters.Length; i++)
|
for (int i = 0; i < waterMeters.Length; i++)
|
||||||
@@ -291,22 +317,45 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
|||||||
|
|
||||||
if ((wm != null) && !wm.Disabled)
|
if ((wm != null) && !wm.Disabled)
|
||||||
{
|
{
|
||||||
CheckPreviousRecordOfSingleWM(session, wm);
|
CheckPreviousRecordOfSingleWM(session, wm, 1);
|
||||||
|
if (wm.LastRecordIsNok)
|
||||||
|
{
|
||||||
|
isAtLeastOneNOK = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
retVal = Retv.OK;
|
retVal = Retv.OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isAtLeastOneNOK && (sessionFactory2 != null))
|
||||||
|
{
|
||||||
|
using (ISession session2 = sessionFactory2.OpenSession())
|
||||||
|
{
|
||||||
|
for (int i = 0; i < waterMeters.Length; i++)
|
||||||
|
{
|
||||||
|
Results.Entities.WaterMeter wm = waterMeters[i];
|
||||||
|
|
||||||
|
if ((wm != null) && !wm.Disabled && wm.LastRecordIsNok)
|
||||||
|
{
|
||||||
|
CheckPreviousRecordOfSingleWM(session2, wm, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
retVal = Retv.OK;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
Retv CheckPreviousRecordOfSingleWM(ISession session, Results.Entities.WaterMeter wm)
|
Retv CheckPreviousRecordOfSingleWM(ISession session, Results.Entities.WaterMeter wm, int sessionId)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(wm.SerialNr))
|
if (string.IsNullOrEmpty(wm.SerialNr))
|
||||||
{
|
{
|
||||||
/// S/N is missing
|
/// S/N is missing
|
||||||
wm.ProcessId = 0;
|
wm.ProcessId = 0;
|
||||||
|
wm.SessionId = 0;
|
||||||
wm.LastRecordIsNok = false; /// OK, this is an RFID comm. error, not a production tracing error
|
wm.LastRecordIsNok = false; /// OK, this is an RFID comm. error, not a production tracing error
|
||||||
return Retv.OK;
|
return Retv.OK;
|
||||||
}
|
}
|
||||||
@@ -338,6 +387,7 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
|||||||
{
|
{
|
||||||
/// No records found
|
/// No records found
|
||||||
wm.ProcessId = 0;
|
wm.ProcessId = 0;
|
||||||
|
wm.SessionId = sessionId;
|
||||||
wm.LastRecordIsNok = true; /// NOK
|
wm.LastRecordIsNok = true; /// NOK
|
||||||
///
|
///
|
||||||
return Retv.OK;
|
return Retv.OK;
|
||||||
@@ -396,6 +446,7 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
|||||||
|
|
||||||
|
|
||||||
wm.ProcessId = currentProcess.Id;
|
wm.ProcessId = currentProcess.Id;
|
||||||
|
wm.SessionId = sessionId;
|
||||||
wm.LastRecordIsNok = true; /// NOK (=default if no matching record found)
|
wm.LastRecordIsNok = true; /// NOK (=default if no matching record found)
|
||||||
foreach (var rslt in results)
|
foreach (var rslt in results)
|
||||||
{
|
{
|
||||||
@@ -420,6 +471,10 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
|||||||
{
|
{
|
||||||
ITransaction transaction = null;
|
ITransaction transaction = null;
|
||||||
ISession session = null;
|
ISession session = null;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Save to regular tracing DB
|
||||||
|
///
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
session = sessionFactory.OpenSession();
|
session = sessionFactory.OpenSession();
|
||||||
@@ -427,16 +482,17 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
|||||||
|
|
||||||
int writtenRecordsCount = 0;
|
int writtenRecordsCount = 0;
|
||||||
foreach (var wMtr in batch.WaterMeters)
|
foreach (var wMtr in batch.WaterMeters)
|
||||||
|
{
|
||||||
|
if (wMtr.SessionId == 1)
|
||||||
{
|
{
|
||||||
writtenRecordsCount += SaveSingleWM2DB(session, wMtr);
|
writtenRecordsCount += SaveSingleWM2DB(session, wMtr);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
transaction.Commit();
|
transaction.Commit();
|
||||||
session.Flush();
|
session.Flush();
|
||||||
|
|
||||||
log.ErrorFormat("Batch {0}: {1} of {2} watermeters written to production tracing DB",
|
log.ErrorFormat("Batch {0}: {1} of {2} watermeters written to the regular production tracing DB",
|
||||||
batch.BatchNr, writtenRecordsCount, batch.WaterMeters.Count);
|
batch.BatchNr, writtenRecordsCount, batch.WaterMeters.Count);
|
||||||
|
|
||||||
return Retv.OK;
|
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
@@ -455,6 +511,53 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
|||||||
session.Dispose();
|
session.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sessionFactory2 != null)
|
||||||
|
{
|
||||||
|
///
|
||||||
|
/// Save to alternative tracing DB
|
||||||
|
///
|
||||||
|
transaction = null;
|
||||||
|
session = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
session = sessionFactory2.OpenSession();
|
||||||
|
transaction = session.BeginTransaction();
|
||||||
|
|
||||||
|
int writtenRecordsCount = 0;
|
||||||
|
foreach (var wMtr in batch.WaterMeters)
|
||||||
|
{
|
||||||
|
if (wMtr.SessionId == 2)
|
||||||
|
{
|
||||||
|
writtenRecordsCount += SaveSingleWM2DB(session, wMtr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
transaction.Commit();
|
||||||
|
session.Flush();
|
||||||
|
|
||||||
|
log.ErrorFormat("Batch {0}: {1} of {2} watermeters written to the alternative production tracing DB",
|
||||||
|
batch.BatchNr, writtenRecordsCount, batch.WaterMeters.Count);
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
if (transaction != null && !transaction.WasCommitted) transaction.Rollback();
|
||||||
|
|
||||||
|
log.WarnFormat("Failed to write results of batch {0} to production tracing DB: {1}",
|
||||||
|
batch.BatchNr, exc.Message);
|
||||||
|
|
||||||
|
return Retv.Error;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (session != null)
|
||||||
|
{
|
||||||
|
session.Close();
|
||||||
|
session.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Retv.OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2018 Sensus Slovensko a.s.
|
/// Copyright (c) 2018-2019 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
@@ -46,8 +46,8 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
|||||||
|
|
||||||
classNameLabel.Text = config.Factory.ClassName;
|
classNameLabel.Text = config.Factory.ClassName;
|
||||||
nameTextBox.Text = config.Name;
|
nameTextBox.Text = config.Name;
|
||||||
workplaceTextBox.Text = config.Workplace;
|
|
||||||
connStrTextBox.Text = config.ConnStr;
|
connStrTextBox.Text = config.ConnStr;
|
||||||
|
connStr2TextBox.Text = config.ConnStr2;
|
||||||
checkPreviousRecordsCheckBox.Checked = config.CheckPreviousRecords;
|
checkPreviousRecordsCheckBox.Checked = config.CheckPreviousRecords;
|
||||||
saveTracingRecordsCheckBox.Checked = config.SaveTracingRecords;
|
saveTracingRecordsCheckBox.Checked = config.SaveTracingRecords;
|
||||||
|
|
||||||
@@ -102,8 +102,8 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
|||||||
public void Unlock()
|
public void Unlock()
|
||||||
{
|
{
|
||||||
nameTextBox.Enabled = true;
|
nameTextBox.Enabled = true;
|
||||||
workplaceTextBox.Enabled = true;
|
|
||||||
connStrTextBox.Enabled = true;
|
connStrTextBox.Enabled = true;
|
||||||
|
connStr2TextBox.Enabled = true;
|
||||||
netAdapterComboBox.Enabled = true;
|
netAdapterComboBox.Enabled = true;
|
||||||
checkPreviousRecordsCheckBox.Enabled = true;
|
checkPreviousRecordsCheckBox.Enabled = true;
|
||||||
saveTracingRecordsCheckBox.Enabled = true;
|
saveTracingRecordsCheckBox.Enabled = true;
|
||||||
@@ -126,8 +126,8 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
|||||||
flags |= (CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
|
flags |= (CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
|
||||||
}
|
}
|
||||||
|
|
||||||
flags |= UpdateDifferent(ref config.Workplace, workplaceTextBox.Text, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
|
|
||||||
flags |= UpdateDifferent(ref config.ConnStr, connStrTextBox.Text, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
|
flags |= UpdateDifferent(ref config.ConnStr, connStrTextBox.Text, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
|
||||||
|
flags |= UpdateDifferent(ref config.ConnStr2, connStr2TextBox.Text, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
|
||||||
flags |= UpdateDifferent(ref config.CheckPreviousRecords, checkPreviousRecordsCheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
|
flags |= UpdateDifferent(ref config.CheckPreviousRecords, checkPreviousRecordsCheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
|
||||||
flags |= UpdateDifferent(ref config.SaveTracingRecords, saveTracingRecordsCheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
|
flags |= UpdateDifferent(ref config.SaveTracingRecords, saveTracingRecordsCheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
|
||||||
|
|
||||||
|
|||||||
@@ -34,81 +34,64 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
|||||||
this.nameTextBox = new System.Windows.Forms.TextBox();
|
this.nameTextBox = new System.Windows.Forms.TextBox();
|
||||||
this.nameLabel = new System.Windows.Forms.Label();
|
this.nameLabel = new System.Windows.Forms.Label();
|
||||||
this.classNameLabel = new System.Windows.Forms.Label();
|
this.classNameLabel = new System.Windows.Forms.Label();
|
||||||
this.workplaceTextBox = new System.Windows.Forms.TextBox();
|
|
||||||
this.workplaceLabel = new System.Windows.Forms.Label();
|
|
||||||
this.connStrTextBox = new System.Windows.Forms.TextBox();
|
this.connStrTextBox = new System.Windows.Forms.TextBox();
|
||||||
this.connStrLabel = new System.Windows.Forms.Label();
|
this.connStrLabel = new System.Windows.Forms.Label();
|
||||||
this.saveTracingRecordsCheckBox = new System.Windows.Forms.CheckBox();
|
this.saveTracingRecordsCheckBox = new System.Windows.Forms.CheckBox();
|
||||||
this.checkPreviousRecordsCheckBox = new System.Windows.Forms.CheckBox();
|
this.checkPreviousRecordsCheckBox = new System.Windows.Forms.CheckBox();
|
||||||
this.netAdapterLabel = new System.Windows.Forms.Label();
|
this.netAdapterLabel = new System.Windows.Forms.Label();
|
||||||
this.netAdapterComboBox = new System.Windows.Forms.ComboBox();
|
this.netAdapterComboBox = new System.Windows.Forms.ComboBox();
|
||||||
|
this.connStr2TextBox = new System.Windows.Forms.TextBox();
|
||||||
|
this.connStr2Label = new System.Windows.Forms.Label();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// nameTextBox
|
// nameTextBox
|
||||||
//
|
//
|
||||||
this.nameTextBox.Enabled = false;
|
this.nameTextBox.Enabled = false;
|
||||||
this.nameTextBox.Location = new System.Drawing.Point(110, 41);
|
this.nameTextBox.Location = new System.Drawing.Point(117, 32);
|
||||||
this.nameTextBox.Name = "nameTextBox";
|
this.nameTextBox.Name = "nameTextBox";
|
||||||
this.nameTextBox.Size = new System.Drawing.Size(146, 20);
|
this.nameTextBox.Size = new System.Drawing.Size(326, 20);
|
||||||
this.nameTextBox.TabIndex = 2;
|
this.nameTextBox.TabIndex = 2;
|
||||||
//
|
//
|
||||||
// nameLabel
|
// nameLabel
|
||||||
//
|
//
|
||||||
this.nameLabel.AutoSize = true;
|
this.nameLabel.AutoSize = true;
|
||||||
this.nameLabel.Location = new System.Drawing.Point(15, 44);
|
this.nameLabel.Location = new System.Drawing.Point(5, 35);
|
||||||
this.nameLabel.Name = "nameLabel";
|
this.nameLabel.Name = "nameLabel";
|
||||||
this.nameLabel.Size = new System.Drawing.Size(35, 13);
|
this.nameLabel.Size = new System.Drawing.Size(38, 13);
|
||||||
this.nameLabel.TabIndex = 1;
|
this.nameLabel.TabIndex = 1;
|
||||||
this.nameLabel.Text = "Name";
|
this.nameLabel.Text = "Name:";
|
||||||
//
|
//
|
||||||
// classNameLabel
|
// classNameLabel
|
||||||
//
|
//
|
||||||
this.classNameLabel.AutoSize = true;
|
this.classNameLabel.AutoSize = true;
|
||||||
this.classNameLabel.Location = new System.Drawing.Point(107, 19);
|
this.classNameLabel.Location = new System.Drawing.Point(114, 10);
|
||||||
this.classNameLabel.Name = "classNameLabel";
|
this.classNameLabel.Name = "classNameLabel";
|
||||||
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
|
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
|
||||||
this.classNameLabel.TabIndex = 0;
|
this.classNameLabel.TabIndex = 0;
|
||||||
this.classNameLabel.Text = "ComonentName";
|
this.classNameLabel.Text = "ComonentName";
|
||||||
//
|
//
|
||||||
// workplaceTextBox
|
|
||||||
//
|
|
||||||
this.workplaceTextBox.Enabled = false;
|
|
||||||
this.workplaceTextBox.Location = new System.Drawing.Point(110, 67);
|
|
||||||
this.workplaceTextBox.Name = "workplaceTextBox";
|
|
||||||
this.workplaceTextBox.Size = new System.Drawing.Size(146, 20);
|
|
||||||
this.workplaceTextBox.TabIndex = 4;
|
|
||||||
//
|
|
||||||
// workplaceLabel
|
|
||||||
//
|
|
||||||
this.workplaceLabel.AutoSize = true;
|
|
||||||
this.workplaceLabel.Location = new System.Drawing.Point(15, 70);
|
|
||||||
this.workplaceLabel.Name = "workplaceLabel";
|
|
||||||
this.workplaceLabel.Size = new System.Drawing.Size(59, 13);
|
|
||||||
this.workplaceLabel.TabIndex = 3;
|
|
||||||
this.workplaceLabel.Text = "Workplace";
|
|
||||||
//
|
|
||||||
// connStrTextBox
|
// connStrTextBox
|
||||||
//
|
//
|
||||||
this.connStrTextBox.Enabled = false;
|
this.connStrTextBox.Enabled = false;
|
||||||
this.connStrTextBox.Location = new System.Drawing.Point(110, 93);
|
this.connStrTextBox.Location = new System.Drawing.Point(8, 74);
|
||||||
this.connStrTextBox.Name = "connStrTextBox";
|
this.connStrTextBox.Name = "connStrTextBox";
|
||||||
this.connStrTextBox.Size = new System.Drawing.Size(327, 20);
|
this.connStrTextBox.Size = new System.Drawing.Size(435, 20);
|
||||||
this.connStrTextBox.TabIndex = 6;
|
this.connStrTextBox.TabIndex = 4;
|
||||||
//
|
//
|
||||||
// connStrLabel
|
// connStrLabel
|
||||||
//
|
//
|
||||||
this.connStrLabel.AutoSize = true;
|
this.connStrLabel.AutoSize = true;
|
||||||
this.connStrLabel.Location = new System.Drawing.Point(15, 96);
|
this.connStrLabel.Location = new System.Drawing.Point(5, 58);
|
||||||
this.connStrLabel.Name = "connStrLabel";
|
this.connStrLabel.Name = "connStrLabel";
|
||||||
this.connStrLabel.Size = new System.Drawing.Size(89, 13);
|
this.connStrLabel.Size = new System.Drawing.Size(92, 13);
|
||||||
this.connStrLabel.TabIndex = 5;
|
this.connStrLabel.TabIndex = 3;
|
||||||
this.connStrLabel.Text = "Connection string";
|
this.connStrLabel.Text = "Connection string:";
|
||||||
//
|
//
|
||||||
// saveTracingRecordsCheckBox
|
// saveTracingRecordsCheckBox
|
||||||
//
|
//
|
||||||
this.saveTracingRecordsCheckBox.AutoSize = true;
|
this.saveTracingRecordsCheckBox.AutoSize = true;
|
||||||
this.saveTracingRecordsCheckBox.Enabled = false;
|
this.saveTracingRecordsCheckBox.Enabled = false;
|
||||||
this.saveTracingRecordsCheckBox.Location = new System.Drawing.Point(110, 177);
|
this.saveTracingRecordsCheckBox.Location = new System.Drawing.Point(117, 221);
|
||||||
this.saveTracingRecordsCheckBox.Name = "saveTracingRecordsCheckBox";
|
this.saveTracingRecordsCheckBox.Name = "saveTracingRecordsCheckBox";
|
||||||
this.saveTracingRecordsCheckBox.Size = new System.Drawing.Size(177, 17);
|
this.saveTracingRecordsCheckBox.Size = new System.Drawing.Size(177, 17);
|
||||||
this.saveTracingRecordsCheckBox.TabIndex = 10;
|
this.saveTracingRecordsCheckBox.TabIndex = 10;
|
||||||
@@ -119,7 +102,7 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
|||||||
//
|
//
|
||||||
this.checkPreviousRecordsCheckBox.AutoSize = true;
|
this.checkPreviousRecordsCheckBox.AutoSize = true;
|
||||||
this.checkPreviousRecordsCheckBox.Enabled = false;
|
this.checkPreviousRecordsCheckBox.Enabled = false;
|
||||||
this.checkPreviousRecordsCheckBox.Location = new System.Drawing.Point(110, 154);
|
this.checkPreviousRecordsCheckBox.Location = new System.Drawing.Point(117, 199);
|
||||||
this.checkPreviousRecordsCheckBox.Name = "checkPreviousRecordsCheckBox";
|
this.checkPreviousRecordsCheckBox.Name = "checkPreviousRecordsCheckBox";
|
||||||
this.checkPreviousRecordsCheckBox.Size = new System.Drawing.Size(138, 17);
|
this.checkPreviousRecordsCheckBox.Size = new System.Drawing.Size(138, 17);
|
||||||
this.checkPreviousRecordsCheckBox.TabIndex = 9;
|
this.checkPreviousRecordsCheckBox.TabIndex = 9;
|
||||||
@@ -129,37 +112,55 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
|||||||
// netAdapterLabel
|
// netAdapterLabel
|
||||||
//
|
//
|
||||||
this.netAdapterLabel.AutoSize = true;
|
this.netAdapterLabel.AutoSize = true;
|
||||||
this.netAdapterLabel.Location = new System.Drawing.Point(15, 122);
|
this.netAdapterLabel.Location = new System.Drawing.Point(5, 147);
|
||||||
this.netAdapterLabel.Name = "netAdapterLabel";
|
this.netAdapterLabel.Name = "netAdapterLabel";
|
||||||
this.netAdapterLabel.Size = new System.Drawing.Size(86, 13);
|
this.netAdapterLabel.Size = new System.Drawing.Size(89, 13);
|
||||||
this.netAdapterLabel.TabIndex = 7;
|
this.netAdapterLabel.TabIndex = 7;
|
||||||
this.netAdapterLabel.Text = "Network adapter";
|
this.netAdapterLabel.Text = "Network adapter:";
|
||||||
//
|
//
|
||||||
// netAdapterComboBox
|
// netAdapterComboBox
|
||||||
//
|
//
|
||||||
|
this.netAdapterComboBox.Enabled = false;
|
||||||
this.netAdapterComboBox.FormattingEnabled = true;
|
this.netAdapterComboBox.FormattingEnabled = true;
|
||||||
this.netAdapterComboBox.Location = new System.Drawing.Point(110, 119);
|
this.netAdapterComboBox.Location = new System.Drawing.Point(8, 163);
|
||||||
this.netAdapterComboBox.Name = "netAdapterComboBox";
|
this.netAdapterComboBox.Name = "netAdapterComboBox";
|
||||||
this.netAdapterComboBox.Size = new System.Drawing.Size(327, 21);
|
this.netAdapterComboBox.Size = new System.Drawing.Size(435, 21);
|
||||||
this.netAdapterComboBox.TabIndex = 11;
|
this.netAdapterComboBox.TabIndex = 8;
|
||||||
|
//
|
||||||
|
// connStr2TextBox
|
||||||
|
//
|
||||||
|
this.connStr2TextBox.Enabled = false;
|
||||||
|
this.connStr2TextBox.Location = new System.Drawing.Point(8, 118);
|
||||||
|
this.connStr2TextBox.Name = "connStr2TextBox";
|
||||||
|
this.connStr2TextBox.Size = new System.Drawing.Size(434, 20);
|
||||||
|
this.connStr2TextBox.TabIndex = 6;
|
||||||
|
//
|
||||||
|
// connStr2Label
|
||||||
|
//
|
||||||
|
this.connStr2Label.AutoSize = true;
|
||||||
|
this.connStr2Label.Location = new System.Drawing.Point(5, 102);
|
||||||
|
this.connStr2Label.Name = "connStr2Label";
|
||||||
|
this.connStr2Label.Size = new System.Drawing.Size(101, 13);
|
||||||
|
this.connStr2Label.TabIndex = 5;
|
||||||
|
this.connStr2Label.Text = "Connection string 2:";
|
||||||
//
|
//
|
||||||
// TracingCfgCtrl
|
// TracingCfgCtrl
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.Controls.Add(this.connStr2TextBox);
|
||||||
|
this.Controls.Add(this.connStr2Label);
|
||||||
this.Controls.Add(this.netAdapterComboBox);
|
this.Controls.Add(this.netAdapterComboBox);
|
||||||
this.Controls.Add(this.netAdapterLabel);
|
this.Controls.Add(this.netAdapterLabel);
|
||||||
this.Controls.Add(this.saveTracingRecordsCheckBox);
|
this.Controls.Add(this.saveTracingRecordsCheckBox);
|
||||||
this.Controls.Add(this.checkPreviousRecordsCheckBox);
|
this.Controls.Add(this.checkPreviousRecordsCheckBox);
|
||||||
this.Controls.Add(this.connStrTextBox);
|
this.Controls.Add(this.connStrTextBox);
|
||||||
this.Controls.Add(this.connStrLabel);
|
this.Controls.Add(this.connStrLabel);
|
||||||
this.Controls.Add(this.workplaceTextBox);
|
|
||||||
this.Controls.Add(this.workplaceLabel);
|
|
||||||
this.Controls.Add(this.nameTextBox);
|
this.Controls.Add(this.nameTextBox);
|
||||||
this.Controls.Add(this.nameLabel);
|
this.Controls.Add(this.nameLabel);
|
||||||
this.Controls.Add(this.classNameLabel);
|
this.Controls.Add(this.classNameLabel);
|
||||||
this.Name = "TracingCfgCtrl";
|
this.Name = "TracingCfgCtrl";
|
||||||
this.Size = new System.Drawing.Size(450, 230);
|
this.Size = new System.Drawing.Size(450, 250);
|
||||||
this.Load += new System.EventHandler(this.WriterCfgCtrl_Load);
|
this.Load += new System.EventHandler(this.WriterCfgCtrl_Load);
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
this.PerformLayout();
|
this.PerformLayout();
|
||||||
@@ -171,13 +172,13 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
|||||||
private System.Windows.Forms.TextBox nameTextBox;
|
private System.Windows.Forms.TextBox nameTextBox;
|
||||||
private System.Windows.Forms.Label nameLabel;
|
private System.Windows.Forms.Label nameLabel;
|
||||||
private System.Windows.Forms.Label classNameLabel;
|
private System.Windows.Forms.Label classNameLabel;
|
||||||
private System.Windows.Forms.TextBox workplaceTextBox;
|
|
||||||
private System.Windows.Forms.Label workplaceLabel;
|
|
||||||
private System.Windows.Forms.TextBox connStrTextBox;
|
private System.Windows.Forms.TextBox connStrTextBox;
|
||||||
private System.Windows.Forms.Label connStrLabel;
|
private System.Windows.Forms.Label connStrLabel;
|
||||||
private System.Windows.Forms.CheckBox saveTracingRecordsCheckBox;
|
private System.Windows.Forms.CheckBox saveTracingRecordsCheckBox;
|
||||||
private System.Windows.Forms.CheckBox checkPreviousRecordsCheckBox;
|
private System.Windows.Forms.CheckBox checkPreviousRecordsCheckBox;
|
||||||
private System.Windows.Forms.Label netAdapterLabel;
|
private System.Windows.Forms.Label netAdapterLabel;
|
||||||
private System.Windows.Forms.ComboBox netAdapterComboBox;
|
private System.Windows.Forms.ComboBox netAdapterComboBox;
|
||||||
|
private System.Windows.Forms.TextBox connStr2TextBox;
|
||||||
|
private System.Windows.Forms.Label connStr2Label;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
/// <param name="wmTypeId">Water meter type Id</param>
|
/// <param name="wmTypeId">Water meter type Id</param>
|
||||||
/// <param name="wmTypeRevision">Water meter type revision</param>
|
/// <param name="wmTypeRevision">Water meter type revision</param>
|
||||||
/// <returns>SensusTestInfos array</returns>
|
/// <returns>SensusTestInfos array</returns>
|
||||||
IList<SensusTestInfo> GetOracleTestInfo(OracleConnection conn, int wmTypeId, out int wmTypeRevision)
|
public static IList<SensusTestInfo> GetOracleTestInfo(OracleConnection conn, int wmTypeId, out int wmTypeRevision, out string wzTyp, out string metrolKlasse, out string zulasszeichen, out string materialNr, out double q3, out DateTime timeStamp, out string remark)
|
||||||
{
|
{
|
||||||
///
|
///
|
||||||
/// Read 'incomplete' TestInfo from Oracle database containing only flowId-s ad qBezeichnung-s
|
/// Read 'incomplete' TestInfo from Oracle database containing only flowId-s ad qBezeichnung-s
|
||||||
@@ -147,7 +147,15 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
/// For a given 'wmTypeId' find the most recent active 'wmTypeRevision'
|
/// For a given 'wmTypeId' find the most recent active 'wmTypeRevision'
|
||||||
///
|
///
|
||||||
wmTypeRevision = -1;
|
wmTypeRevision = -1;
|
||||||
OracleCommand cmd = new OracleCommand("select REV_WZTYP from VT_WZTYP_SD where ANBID=4 and ID_WZTyp=:1 and AKTIV=:2", conn);
|
wzTyp = string.Empty;
|
||||||
|
metrolKlasse = string.Empty;
|
||||||
|
zulasszeichen = string.Empty;
|
||||||
|
materialNr = string.Empty;
|
||||||
|
q3 = 0;
|
||||||
|
timeStamp = DateTime.MinValue;
|
||||||
|
remark = string.Empty;
|
||||||
|
|
||||||
|
OracleCommand cmd = new OracleCommand("select REV_WZTYP, WZTYP, METROLKLASSE, ZULASSZEICHEN, MATERIALNR, QMAX, AENDERUNGSDATUM, BEMERKUNG from VT_WZTYP_SD where ANBID=4 and ID_WZTyp=:1 and AKTIV=:2", conn);
|
||||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wmTypeId }); ///:1
|
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wmTypeId }); ///:1
|
||||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = 1 }); ///:2
|
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = 1 }); ///:2
|
||||||
///
|
///
|
||||||
@@ -155,12 +163,19 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
while (dr.Read())
|
while (dr.Read())
|
||||||
{
|
{
|
||||||
wmTypeRevision = dr.GetInt32(0);
|
wmTypeRevision = dr.GetInt32(0);
|
||||||
|
wzTyp = dr.GetString(1);
|
||||||
|
metrolKlasse = dr.GetString(2);
|
||||||
|
zulasszeichen = dr.GetString(3);
|
||||||
|
materialNr = dr.GetString(4);
|
||||||
|
q3 = dr.GetDouble(5);
|
||||||
|
timeStamp = dr.GetDateTime(6);
|
||||||
|
remark = dr.GetString(7);
|
||||||
}
|
}
|
||||||
dr.Close();
|
dr.Close();
|
||||||
|
|
||||||
if (wmTypeRevision == -1) return null; /// No 'wmTypeRevision' found
|
if (wmTypeRevision == -1) return null; /// No 'wmTypeRevision' found
|
||||||
|
|
||||||
cmd = new OracleCommand("select PruefungsNr, PosFehlerKalt, QBezeichnung from VT_PRUEFPUNKT_SOLL_SD where ANBID=4 and ID_WZTyp=:1 and Rev_WZTyp=:2", conn);
|
cmd = new OracleCommand("select PRUEFUNGSNR, Q_SOLL, PRUEFZEIT, POSFEHLERKALT, NEGFEHLERKALT, PRUEFBEREICHMIN, PRUEFBEREICHMAX, QBEZEICHNUNG from VT_PRUEFPUNKT_SOLL_SD where ANBID=4 and ID_WZTyp=:1 and Rev_WZTyp=:2", conn);
|
||||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wmTypeId }); ///:1
|
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wmTypeId }); ///:1
|
||||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wmTypeRevision }); ///:2
|
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wmTypeRevision }); ///:2
|
||||||
///
|
///
|
||||||
@@ -168,9 +183,19 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
while (dr.Read())
|
while (dr.Read())
|
||||||
{
|
{
|
||||||
int pruefungsNr = dr.GetInt32(0);
|
int pruefungsNr = dr.GetInt32(0);
|
||||||
double errLimHi = dr.GetDouble(1);
|
double flow = Config.Units.ConvertFrom(Unit.lph, dr.GetDouble(1));
|
||||||
string qBezeichnung = dr.GetString(2);
|
int testTime = dr.GetInt32(2);
|
||||||
oraDbTinfos.Add(new SensusTestInfo(null, pruefungsNr, qBezeichnung, 0, null, 0, null, Range.Undefined));
|
double errLimHi = dr.GetDouble(3);
|
||||||
|
double errLimLo = dr.GetDouble(4);
|
||||||
|
int flowRangeMin = dr.GetInt32(5);
|
||||||
|
int flowRangeMax = dr.GetInt32(6);
|
||||||
|
string qBezeichnung = dr.GetString(7);
|
||||||
|
|
||||||
|
Range rng = (flowRangeMin == 90 && flowRangeMax == 100) ? Range.R90_100 :
|
||||||
|
((flowRangeMin == 95 && flowRangeMax == 105) ? Range.R95_105 :
|
||||||
|
((flowRangeMin == 100 && flowRangeMax == 110) ? Range.R100_110 : Range.Undefined));
|
||||||
|
|
||||||
|
oraDbTinfos.Add(new SensusTestInfo(pruefungsNr, qBezeichnung, flow, testTime, errLimLo, errLimHi, rng));
|
||||||
}
|
}
|
||||||
dr.Close();
|
dr.Close();
|
||||||
|
|
||||||
@@ -356,7 +381,14 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
/// Currnet test info. is not walid => Get a new one from Oracle and SensusTestInfo table
|
/// Currnet test info. is not walid => Get a new one from Oracle and SensusTestInfo table
|
||||||
///
|
///
|
||||||
int wmTR;
|
int wmTR;
|
||||||
IList<SensusTestInfo> rti = GetOracleTestInfo(conn, wm.WaterMeterData.WMTypeId, out wmTR);
|
string wzTypStr;
|
||||||
|
string metroKlasse;
|
||||||
|
string zulasszeichen;
|
||||||
|
string materialNr;
|
||||||
|
double q3 = 0;
|
||||||
|
DateTime timeStamp;
|
||||||
|
string remark;
|
||||||
|
IList<SensusTestInfo> rti = GetOracleTestInfo(conn, wm.WaterMeterData.WMTypeId, out wmTR, out wzTypStr, out metroKlasse, out zulasszeichen, out materialNr, out q3, out timeStamp, out remark);
|
||||||
|
|
||||||
if (rti != null)
|
if (rti != null)
|
||||||
{
|
{
|
||||||
@@ -629,8 +661,9 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
|
|
||||||
int maxpruefindexLowPart = ReadMaxPruefindex(conn, wm);
|
int maxpruefindexLowPart = ReadMaxPruefindex(conn, wm);
|
||||||
|
|
||||||
int MAX_Pruefindex = 100 * dbCfg.TestBenchId + maxpruefindexLowPart + 1;
|
TBF.BenchControl.GenericDevices.IBenchInfo benchInfo = TBF.BenchControl.Sequences.ProcessData.BenchInfo;
|
||||||
|
int testBenchID = (benchInfo != null) ? benchInfo.TestBenchId : 1;
|
||||||
|
int MAX_Pruefindex = 100 * testBenchID + maxpruefindexLowPart + 1;
|
||||||
|
|
||||||
int Hydr_Pruefung;
|
int Hydr_Pruefung;
|
||||||
if (wm.Passed)
|
if (wm.Passed)
|
||||||
@@ -721,7 +754,14 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
if ((oracleTestInfo == null) || (wmTypeId != b.WaterMeters[0].WaterMeterData.WMTypeId) || (wmTypeRevision == 0) || (procedureSignature != procedureSignatureSB.ToString()))
|
if ((oracleTestInfo == null) || (wmTypeId != b.WaterMeters[0].WaterMeterData.WMTypeId) || (wmTypeRevision == 0) || (procedureSignature != procedureSignatureSB.ToString()))
|
||||||
{
|
{
|
||||||
int wmTR = 0;
|
int wmTR = 0;
|
||||||
IList<SensusTestInfo> ti = GetOracleTestInfo(conn, b.WaterMeters[0].WaterMeterData.WMTypeId, out wmTR);
|
string wzTypStr;
|
||||||
|
string metroKlasse;
|
||||||
|
string zulasszeichen;
|
||||||
|
string materialNr;
|
||||||
|
double q3 = 0;
|
||||||
|
DateTime timeStamp;
|
||||||
|
string remark;
|
||||||
|
IList<SensusTestInfo> ti = GetOracleTestInfo(conn, b.WaterMeters[0].WaterMeterData.WMTypeId, out wmTR, out wzTypStr, out metroKlasse, out zulasszeichen, out materialNr, out q3, out timeStamp, out remark);
|
||||||
|
|
||||||
if (ti != null)
|
if (ti != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
public IComponentCfgCtrl GetControl() { return new DatabaseCfgCtrl(); }
|
public IComponentCfgCtrl GetControl() { return new DatabaseCfgCtrl(); }
|
||||||
|
|
||||||
|
|
||||||
public int TestBenchId;
|
|
||||||
public DBUsed DBUsed;
|
public DBUsed DBUsed;
|
||||||
public int Baujahr; /// Written to the database
|
public int Baujahr; /// Written to the database
|
||||||
public bool ReadStartInfo;
|
public bool ReadStartInfo;
|
||||||
@@ -48,7 +47,6 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
{
|
{
|
||||||
Name = "Sensus-Oracle-DB";
|
Name = "Sensus-Oracle-DB";
|
||||||
ParentName = string.Empty;
|
ParentName = string.Empty;
|
||||||
TestBenchId = 1;
|
|
||||||
DBUsed = DBUsed.Test;
|
DBUsed = DBUsed.Test;
|
||||||
Baujahr = 2015;
|
Baujahr = 2015;
|
||||||
ReadStartInfo = true;
|
ReadStartInfo = true;
|
||||||
@@ -65,9 +63,8 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
|
|
||||||
public string ToString(int i)
|
public string ToString(int i)
|
||||||
{
|
{
|
||||||
return string.Format("Name={0}, BenchId={1}, DB={2}, Bjahr={3}, RdStartInfo={4}, SaveRslts={5}, StartInfoRqrd={6}, TestMode={7}",
|
return string.Format("Name={0}, DB={1}, Bjahr={2}, RdStartInfo={3}, SaveRslts={4}, StartInfoRqrd={5}, TestMode={6}",
|
||||||
Name,
|
Name,
|
||||||
TestBenchId,
|
|
||||||
DBUsed,
|
DBUsed,
|
||||||
Baujahr,
|
Baujahr,
|
||||||
ReadStartInfo,
|
ReadStartInfo,
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
if (config == null) return; /// Control was not loaded, settings were not changed
|
if (config == null) return; /// Control was not loaded, settings were not changed
|
||||||
classNameLabel.Text = config.Factory.ClassName;
|
classNameLabel.Text = config.Factory.ClassName;
|
||||||
nameTextBox.Text = config.Name;
|
nameTextBox.Text = config.Name;
|
||||||
benchIdTextBox.Text = config.TestBenchId.ToString();
|
|
||||||
dbUsedComboBox.Text = config.DBUsed.ToString();
|
dbUsedComboBox.Text = config.DBUsed.ToString();
|
||||||
baujahrTextBox.Text = config.Baujahr.ToString();
|
baujahrTextBox.Text = config.Baujahr.ToString();
|
||||||
readStartInfoCheckBox.Checked = config.ReadStartInfo;
|
readStartInfoCheckBox.Checked = config.ReadStartInfo;
|
||||||
@@ -59,7 +58,6 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
public void Unlock()
|
public void Unlock()
|
||||||
{
|
{
|
||||||
nameTextBox.Enabled = true;
|
nameTextBox.Enabled = true;
|
||||||
benchIdTextBox.Enabled = true;
|
|
||||||
dbUsedComboBox.Enabled = true;
|
dbUsedComboBox.Enabled = true;
|
||||||
baujahrTextBox.Enabled = true;
|
baujahrTextBox.Enabled = true;
|
||||||
readStartInfoCheckBox.Enabled = true;
|
readStartInfoCheckBox.Enabled = true;
|
||||||
@@ -73,12 +71,6 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
||||||
|
|
||||||
int tmp;
|
int tmp;
|
||||||
if (!int.TryParse(benchIdTextBox.Text, out tmp) || tmp <= 0)
|
|
||||||
{
|
|
||||||
flags |= CfgUpdateFlags.Error;
|
|
||||||
message += Environment.NewLine + "Invalid 'Test bench ID'";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!int.TryParse(baujahrTextBox.Text, out tmp) || tmp < 2015 || tmp > 2099)
|
if (!int.TryParse(baujahrTextBox.Text, out tmp) || tmp < 2015 || tmp > 2099)
|
||||||
{
|
{
|
||||||
flags |= CfgUpdateFlags.Error;
|
flags |= CfgUpdateFlags.Error;
|
||||||
@@ -105,13 +97,6 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
flags |= CfgUpdateFlags.RestartRqrd;
|
flags |= CfgUpdateFlags.RestartRqrd;
|
||||||
}
|
}
|
||||||
|
|
||||||
int benchId = int.Parse(benchIdTextBox.Text);
|
|
||||||
if (config.TestBenchId != benchId)
|
|
||||||
{
|
|
||||||
config.TestBenchId = benchId;
|
|
||||||
flags |= CfgUpdateFlags.RestartRqrd;
|
|
||||||
}
|
|
||||||
|
|
||||||
int baujahr = int.Parse(baujahrTextBox.Text);
|
int baujahr = int.Parse(baujahrTextBox.Text);
|
||||||
if (config.Baujahr != baujahr)
|
if (config.Baujahr != baujahr)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,8 +36,6 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
this.classNameLabel = new System.Windows.Forms.Label();
|
this.classNameLabel = new System.Windows.Forms.Label();
|
||||||
this.readStartInfoCheckBox = new System.Windows.Forms.CheckBox();
|
this.readStartInfoCheckBox = new System.Windows.Forms.CheckBox();
|
||||||
this.saveResultsCheckBox = new System.Windows.Forms.CheckBox();
|
this.saveResultsCheckBox = new System.Windows.Forms.CheckBox();
|
||||||
this.benchIdTextBox = new System.Windows.Forms.TextBox();
|
|
||||||
this.benchIdLabel = new System.Windows.Forms.Label();
|
|
||||||
this.dbUsedComboBox = new System.Windows.Forms.ComboBox();
|
this.dbUsedComboBox = new System.Windows.Forms.ComboBox();
|
||||||
this.dbUsedLabel = new System.Windows.Forms.Label();
|
this.dbUsedLabel = new System.Windows.Forms.Label();
|
||||||
this.baujahrTextBox = new System.Windows.Forms.TextBox();
|
this.baujahrTextBox = new System.Windows.Forms.TextBox();
|
||||||
@@ -49,7 +47,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
// nameTextBox
|
// nameTextBox
|
||||||
//
|
//
|
||||||
this.nameTextBox.Enabled = false;
|
this.nameTextBox.Enabled = false;
|
||||||
this.nameTextBox.Location = new System.Drawing.Point(110, 30);
|
this.nameTextBox.Location = new System.Drawing.Point(110, 55);
|
||||||
this.nameTextBox.Name = "nameTextBox";
|
this.nameTextBox.Name = "nameTextBox";
|
||||||
this.nameTextBox.Size = new System.Drawing.Size(146, 20);
|
this.nameTextBox.Size = new System.Drawing.Size(146, 20);
|
||||||
this.nameTextBox.TabIndex = 2;
|
this.nameTextBox.TabIndex = 2;
|
||||||
@@ -57,7 +55,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
// nameLabel
|
// nameLabel
|
||||||
//
|
//
|
||||||
this.nameLabel.AutoSize = true;
|
this.nameLabel.AutoSize = true;
|
||||||
this.nameLabel.Location = new System.Drawing.Point(19, 33);
|
this.nameLabel.Location = new System.Drawing.Point(19, 58);
|
||||||
this.nameLabel.Name = "nameLabel";
|
this.nameLabel.Name = "nameLabel";
|
||||||
this.nameLabel.Size = new System.Drawing.Size(35, 13);
|
this.nameLabel.Size = new System.Drawing.Size(35, 13);
|
||||||
this.nameLabel.TabIndex = 1;
|
this.nameLabel.TabIndex = 1;
|
||||||
@@ -66,7 +64,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
// classNameLabel
|
// classNameLabel
|
||||||
//
|
//
|
||||||
this.classNameLabel.AutoSize = true;
|
this.classNameLabel.AutoSize = true;
|
||||||
this.classNameLabel.Location = new System.Drawing.Point(107, 8);
|
this.classNameLabel.Location = new System.Drawing.Point(107, 27);
|
||||||
this.classNameLabel.Name = "classNameLabel";
|
this.classNameLabel.Name = "classNameLabel";
|
||||||
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
|
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
|
||||||
this.classNameLabel.TabIndex = 0;
|
this.classNameLabel.TabIndex = 0;
|
||||||
@@ -94,28 +92,11 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
this.saveResultsCheckBox.Text = "Save results";
|
this.saveResultsCheckBox.Text = "Save results";
|
||||||
this.saveResultsCheckBox.UseVisualStyleBackColor = true;
|
this.saveResultsCheckBox.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// benchIdTextBox
|
|
||||||
//
|
|
||||||
this.benchIdTextBox.Enabled = false;
|
|
||||||
this.benchIdTextBox.Location = new System.Drawing.Point(110, 53);
|
|
||||||
this.benchIdTextBox.Name = "benchIdTextBox";
|
|
||||||
this.benchIdTextBox.Size = new System.Drawing.Size(57, 20);
|
|
||||||
this.benchIdTextBox.TabIndex = 4;
|
|
||||||
//
|
|
||||||
// benchIdLabel
|
|
||||||
//
|
|
||||||
this.benchIdLabel.AutoSize = true;
|
|
||||||
this.benchIdLabel.Location = new System.Drawing.Point(19, 56);
|
|
||||||
this.benchIdLabel.Name = "benchIdLabel";
|
|
||||||
this.benchIdLabel.Size = new System.Drawing.Size(76, 13);
|
|
||||||
this.benchIdLabel.TabIndex = 3;
|
|
||||||
this.benchIdLabel.Text = "Test Bench ID";
|
|
||||||
//
|
|
||||||
// dbUsedComboBox
|
// dbUsedComboBox
|
||||||
//
|
//
|
||||||
this.dbUsedComboBox.Enabled = false;
|
this.dbUsedComboBox.Enabled = false;
|
||||||
this.dbUsedComboBox.FormattingEnabled = true;
|
this.dbUsedComboBox.FormattingEnabled = true;
|
||||||
this.dbUsedComboBox.Location = new System.Drawing.Point(110, 76);
|
this.dbUsedComboBox.Location = new System.Drawing.Point(110, 79);
|
||||||
this.dbUsedComboBox.Name = "dbUsedComboBox";
|
this.dbUsedComboBox.Name = "dbUsedComboBox";
|
||||||
this.dbUsedComboBox.Size = new System.Drawing.Size(145, 21);
|
this.dbUsedComboBox.Size = new System.Drawing.Size(145, 21);
|
||||||
this.dbUsedComboBox.TabIndex = 6;
|
this.dbUsedComboBox.TabIndex = 6;
|
||||||
@@ -123,7 +104,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
// dbUsedLabel
|
// dbUsedLabel
|
||||||
//
|
//
|
||||||
this.dbUsedLabel.AutoSize = true;
|
this.dbUsedLabel.AutoSize = true;
|
||||||
this.dbUsedLabel.Location = new System.Drawing.Point(19, 78);
|
this.dbUsedLabel.Location = new System.Drawing.Point(19, 81);
|
||||||
this.dbUsedLabel.Name = "dbUsedLabel";
|
this.dbUsedLabel.Name = "dbUsedLabel";
|
||||||
this.dbUsedLabel.Size = new System.Drawing.Size(79, 13);
|
this.dbUsedLabel.Size = new System.Drawing.Size(79, 13);
|
||||||
this.dbUsedLabel.TabIndex = 5;
|
this.dbUsedLabel.TabIndex = 5;
|
||||||
@@ -132,7 +113,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
// baujahrTextBox
|
// baujahrTextBox
|
||||||
//
|
//
|
||||||
this.baujahrTextBox.Enabled = false;
|
this.baujahrTextBox.Enabled = false;
|
||||||
this.baujahrTextBox.Location = new System.Drawing.Point(110, 100);
|
this.baujahrTextBox.Location = new System.Drawing.Point(110, 104);
|
||||||
this.baujahrTextBox.Name = "baujahrTextBox";
|
this.baujahrTextBox.Name = "baujahrTextBox";
|
||||||
this.baujahrTextBox.Size = new System.Drawing.Size(57, 20);
|
this.baujahrTextBox.Size = new System.Drawing.Size(57, 20);
|
||||||
this.baujahrTextBox.TabIndex = 8;
|
this.baujahrTextBox.TabIndex = 8;
|
||||||
@@ -140,7 +121,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
// baujahrLabel
|
// baujahrLabel
|
||||||
//
|
//
|
||||||
this.baujahrLabel.AutoSize = true;
|
this.baujahrLabel.AutoSize = true;
|
||||||
this.baujahrLabel.Location = new System.Drawing.Point(19, 103);
|
this.baujahrLabel.Location = new System.Drawing.Point(19, 107);
|
||||||
this.baujahrLabel.Name = "baujahrLabel";
|
this.baujahrLabel.Name = "baujahrLabel";
|
||||||
this.baujahrLabel.Size = new System.Drawing.Size(43, 13);
|
this.baujahrLabel.Size = new System.Drawing.Size(43, 13);
|
||||||
this.baujahrLabel.TabIndex = 7;
|
this.baujahrLabel.TabIndex = 7;
|
||||||
@@ -178,8 +159,6 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
this.Controls.Add(this.baujahrLabel);
|
this.Controls.Add(this.baujahrLabel);
|
||||||
this.Controls.Add(this.dbUsedComboBox);
|
this.Controls.Add(this.dbUsedComboBox);
|
||||||
this.Controls.Add(this.dbUsedLabel);
|
this.Controls.Add(this.dbUsedLabel);
|
||||||
this.Controls.Add(this.benchIdTextBox);
|
|
||||||
this.Controls.Add(this.benchIdLabel);
|
|
||||||
this.Controls.Add(this.saveResultsCheckBox);
|
this.Controls.Add(this.saveResultsCheckBox);
|
||||||
this.Controls.Add(this.readStartInfoCheckBox);
|
this.Controls.Add(this.readStartInfoCheckBox);
|
||||||
this.Controls.Add(this.nameTextBox);
|
this.Controls.Add(this.nameTextBox);
|
||||||
@@ -200,8 +179,6 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
|||||||
private System.Windows.Forms.Label classNameLabel;
|
private System.Windows.Forms.Label classNameLabel;
|
||||||
private System.Windows.Forms.CheckBox readStartInfoCheckBox;
|
private System.Windows.Forms.CheckBox readStartInfoCheckBox;
|
||||||
private System.Windows.Forms.CheckBox saveResultsCheckBox;
|
private System.Windows.Forms.CheckBox saveResultsCheckBox;
|
||||||
private System.Windows.Forms.TextBox benchIdTextBox;
|
|
||||||
private System.Windows.Forms.Label benchIdLabel;
|
|
||||||
private System.Windows.Forms.ComboBox dbUsedComboBox;
|
private System.Windows.Forms.ComboBox dbUsedComboBox;
|
||||||
private System.Windows.Forms.Label dbUsedLabel;
|
private System.Windows.Forms.Label dbUsedLabel;
|
||||||
private System.Windows.Forms.TextBox baujahrTextBox;
|
private System.Windows.Forms.TextBox baujahrTextBox;
|
||||||
|
|||||||
@@ -177,11 +177,12 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
|
|||||||
|
|
||||||
/// Obtain one representative water meter data
|
/// Obtain one representative water meter data
|
||||||
Results.Entities.WaterMeter wm0 = null;
|
Results.Entities.WaterMeter wm0 = null;
|
||||||
foreach (var m in batch.WaterMeters)
|
foreach (var wm in batch.WaterMeters)
|
||||||
{
|
{
|
||||||
if (m != null)
|
if ((wm != null) && (wm.CompleteTestInfos != null) && (wm.WaterMeterData != null))
|
||||||
|
//if ((wm != null) && wm.PassedFromTests())
|
||||||
{
|
{
|
||||||
wm0 = m;
|
wm0 = wm;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,193 +0,0 @@
|
|||||||
///
|
|
||||||
/// Copyright (c) 2015 Sensus Metering Systems
|
|
||||||
///
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Drawing.Printing;
|
|
||||||
using System.IO;
|
|
||||||
using Config.Entities;
|
|
||||||
using TBF.Resources;
|
|
||||||
|
|
||||||
namespace TBF.BenchControl.Output.Printers.Label
|
|
||||||
{
|
|
||||||
public class PrintLabelDocument : PrintDocument
|
|
||||||
{
|
|
||||||
const int FontSize = 9;
|
|
||||||
const string FontFamilyName = "Arial"; //"Times New Roman";
|
|
||||||
|
|
||||||
readonly int paperWidth;
|
|
||||||
readonly int paperHeight;
|
|
||||||
readonly string templateFile;
|
|
||||||
|
|
||||||
/// <summary> Property variable for the Font the user wishes to use </summary>
|
|
||||||
Font font;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Data to print
|
|
||||||
///
|
|
||||||
Results.Entities.Batch batch;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Layout and status
|
|
||||||
///
|
|
||||||
int nextWMNr; /// nr. of watermeter to be printed as the first one on the next page
|
|
||||||
int nrPages;
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Constructor
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="textToPrint">Text to be printed</param>
|
|
||||||
public PrintLabelDocument(Results.Entities.Batch batch,
|
|
||||||
PageOrientation pageOrientation,
|
|
||||||
int paperWidth,
|
|
||||||
int paperHeight,
|
|
||||||
string templateFile)
|
|
||||||
{
|
|
||||||
this.batch = batch;
|
|
||||||
this.paperWidth = paperWidth;
|
|
||||||
this.paperHeight = paperHeight;
|
|
||||||
this.templateFile = templateFile;
|
|
||||||
|
|
||||||
DefaultPageSettings.Landscape = (pageOrientation == PageOrientation.Landscape);
|
|
||||||
|
|
||||||
/// Set print area size and margins (in dots using 80 dpi)
|
|
||||||
int printHeight = base.DefaultPageSettings.PaperSize.Height - base.DefaultPageSettings.Margins.Top - base.DefaultPageSettings.Margins.Bottom;
|
|
||||||
int printWidth = base.DefaultPageSettings.PaperSize.Width - base.DefaultPageSettings.Margins.Left - base.DefaultPageSettings.Margins.Right;
|
|
||||||
int leftMargin = base.DefaultPageSettings.Margins.Left; /// X
|
|
||||||
int topMargin = base.DefaultPageSettings.Margins.Top; /// Y
|
|
||||||
|
|
||||||
/// Check if the user selected to print in Landscape mode
|
|
||||||
/// if they did then we need to swap height/width parameters
|
|
||||||
if (DefaultPageSettings.Landscape)
|
|
||||||
{
|
|
||||||
int tmp = printHeight;
|
|
||||||
printHeight = printWidth;
|
|
||||||
printWidth = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// One watermeter per label/page
|
|
||||||
nrPages = batch.WaterMeters.Count;
|
|
||||||
|
|
||||||
nextWMNr = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Override the default onbeginPrint method of the PrintDocument Object
|
|
||||||
/// </summary>
|
|
||||||
/// <param name=e></param>
|
|
||||||
/// <remarks></remarks>
|
|
||||||
protected override void OnBeginPrint(System.Drawing.Printing.PrintEventArgs e)
|
|
||||||
{
|
|
||||||
base.OnBeginPrint(e);
|
|
||||||
|
|
||||||
if (font == null) { font = new Font(FontFamilyName, FontSize, FontStyle.Regular); }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Override the default OnPrintPage method of the PrintDocument.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name=e></param>
|
|
||||||
/// <remarks>This provides the print logic for our document</remarks>
|
|
||||||
protected override void OnPrintPage(System.Drawing.Printing.PrintPageEventArgs e)
|
|
||||||
{
|
|
||||||
/// Run base code
|
|
||||||
base.OnPrintPage(e);
|
|
||||||
|
|
||||||
if (File.Exists(templateFile))
|
|
||||||
{
|
|
||||||
Image img = Image.FromFile(templateFile);
|
|
||||||
e.Graphics.DrawImage(new Bitmap(img), new Rectangle(0, 0, paperWidth, paperHeight));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Set print area size and margins (in dots using 80 dpi)
|
|
||||||
int printHeight = base.DefaultPageSettings.PaperSize.Height - base.DefaultPageSettings.Margins.Top - base.DefaultPageSettings.Margins.Bottom;
|
|
||||||
int printWidth = base.DefaultPageSettings.PaperSize.Width - base.DefaultPageSettings.Margins.Left - base.DefaultPageSettings.Margins.Right;
|
|
||||||
int leftMargin = base.DefaultPageSettings.Margins.Left; /// X
|
|
||||||
int topMargin = base.DefaultPageSettings.Margins.Top; /// Y
|
|
||||||
|
|
||||||
/// Check if the user selected to print in Landscape mode
|
|
||||||
/// if they did then we need to swap height/width parameters
|
|
||||||
if (base.DefaultPageSettings.Landscape)
|
|
||||||
{
|
|
||||||
int tmp = printHeight;
|
|
||||||
printHeight = printWidth;
|
|
||||||
printWidth = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
int x = leftMargin;
|
|
||||||
int y = topMargin;
|
|
||||||
|
|
||||||
/// Use the StringFormat class for the text layout of our document
|
|
||||||
StringFormat format = new StringFormat(StringFormatFlags.LineLimit);
|
|
||||||
|
|
||||||
|
|
||||||
///--------
|
|
||||||
/// Body
|
|
||||||
///--------
|
|
||||||
|
|
||||||
PrintWM(e, nextWMNr);
|
|
||||||
nextWMNr++;
|
|
||||||
e.HasMorePages = (nextWMNr < batch.WaterMeters.Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Print one water meter results
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="wmNr">Water meter number (0-based)</param>
|
|
||||||
void PrintWM(System.Drawing.Printing.PrintPageEventArgs e, int wmNr)
|
|
||||||
{
|
|
||||||
if (wmNr >= batch.WaterMeters.Count) return;
|
|
||||||
|
|
||||||
Results.Entities.WaterMeter wm = batch.WaterMeters[wmNr];
|
|
||||||
|
|
||||||
if (wm == null) return;
|
|
||||||
|
|
||||||
|
|
||||||
/// Serial number
|
|
||||||
if (!string.IsNullOrEmpty(wm.SerialNr)) PrintAt(e, 20, 62, string.Format("S/N: {0}", wm.SerialNr));
|
|
||||||
|
|
||||||
/// Watermeter type
|
|
||||||
PrintAt(e, 20, 74, batch.ProtocolTitle);
|
|
||||||
|
|
||||||
/// Date
|
|
||||||
PrintAt(e, 135, 74, string.Format("{0:dd/MM/yy", batch.EndTime));
|
|
||||||
|
|
||||||
Results.WMeterRsltItemSpec item1 = Results.WMeterRsltItemSpec.GetItem(Results.ItemID.Test_name);
|
|
||||||
|
|
||||||
Results.WMeterRsltItemSpec item2 = Results.WMeterRsltItemSpec.GetItem(Results.ItemID.Error);
|
|
||||||
item2.Units = Config.Unit.Pct;
|
|
||||||
item2.Precision = "F2";
|
|
||||||
item2.Format = "{0}%";
|
|
||||||
|
|
||||||
int printPosition = 1;
|
|
||||||
foreach (var mtr in wm.MeterTestRslts)
|
|
||||||
{
|
|
||||||
item1.TestID = mtr.Name();
|
|
||||||
item2.TestID = mtr.Name();
|
|
||||||
|
|
||||||
PrintAt(e, 20, 6 + 14 * printPosition, item1.Print(wm));
|
|
||||||
PrintAt(e, 78, 6 + 14 * printPosition, item2.Print(wm));
|
|
||||||
|
|
||||||
printPosition++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text)
|
|
||||||
{
|
|
||||||
PrintAt(e, p.X, p.Y, text);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
|
|
||||||
{
|
|
||||||
RectangleF printArea = new RectangleF(x, y, 667, 18);
|
|
||||||
e.Graphics.DrawString(text, this.font, Brushes.Black, printArea);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -76,6 +76,12 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
printerCfg.NrOfCopies = newCfg.NrOfCopies;
|
printerCfg.NrOfCopies = newCfg.NrOfCopies;
|
||||||
printerCfg.GoodOnly = newCfg.GoodOnly;
|
printerCfg.GoodOnly = newCfg.GoodOnly;
|
||||||
printerCfg.SupressPrinting = newCfg.SupressPrinting;
|
printerCfg.SupressPrinting = newCfg.SupressPrinting;
|
||||||
|
printerCfg.DrawSNasBarcode = newCfg.DrawSNasBarcode;
|
||||||
|
printerCfg.IsQR = newCfg.IsQR;
|
||||||
|
printerCfg.BarcodeLeft = newCfg.BarcodeLeft;
|
||||||
|
printerCfg.BarcodeTop = newCfg.BarcodeTop;
|
||||||
|
printerCfg.BarcodeWidth = newCfg.BarcodeWidth;
|
||||||
|
printerCfg.BarcodeHeight = newCfg.BarcodeHeight;
|
||||||
|
|
||||||
ApplyConfig();
|
ApplyConfig();
|
||||||
}
|
}
|
||||||
@@ -131,7 +137,6 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void PrintResults(Results.Entities.Batch batch, Results.Entities.WaterMeter wm, string documentName)
|
void PrintResults(Results.Entities.Batch batch, Results.Entities.WaterMeter wm, string documentName)
|
||||||
{
|
{
|
||||||
LabelPrinterCfg cfg = new LabelPrinterCfg
|
LabelPrinterCfg cfg = new LabelPrinterCfg
|
||||||
@@ -147,6 +152,12 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
CultureInfo = (printerCfg.Culture == Culture.system) ? Thread.CurrentThread.CurrentCulture : new CultureInfo(printerCfg.Culture.ToString()),
|
CultureInfo = (printerCfg.Culture == Culture.system) ? Thread.CurrentThread.CurrentCulture : new CultureInfo(printerCfg.Culture.ToString()),
|
||||||
GoodOnly = printerCfg.GoodOnly,
|
GoodOnly = printerCfg.GoodOnly,
|
||||||
SupressPrinting = printerCfg.SupressPrinting,
|
SupressPrinting = printerCfg.SupressPrinting,
|
||||||
|
DrawSNasBarcode = printerCfg.DrawSNasBarcode,
|
||||||
|
IsQR = printerCfg.IsQR,
|
||||||
|
BarcodeLeft = printerCfg.BarcodeLeft,
|
||||||
|
BarcodeTop = printerCfg.BarcodeTop,
|
||||||
|
BarcodeWidth = printerCfg.BarcodeWidth,
|
||||||
|
BarcodeHeight = printerCfg.BarcodeHeight,
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int i = 1; i <= printerCfg.NrOfCopies; i++)
|
for (int i = 1; i <= printerCfg.NrOfCopies; i++)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
|
/// Copyright (c) 2015-2020 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -33,6 +33,14 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
public bool GoodOnly;
|
public bool GoodOnly;
|
||||||
public bool SupressPrinting; /// true = Bypass printing
|
public bool SupressPrinting; /// true = Bypass printing
|
||||||
|
|
||||||
|
public bool DrawSNasBarcode;
|
||||||
|
public bool IsQR;
|
||||||
|
public int BarcodeLeft;
|
||||||
|
public int BarcodeTop;
|
||||||
|
public int BarcodeWidth;
|
||||||
|
public int BarcodeHeight;
|
||||||
|
|
||||||
|
|
||||||
/// Private parameterless constructor invoked by all other (public) constructors
|
/// Private parameterless constructor invoked by all other (public) constructors
|
||||||
PrinterCfg()
|
PrinterCfg()
|
||||||
{
|
{
|
||||||
@@ -55,18 +63,20 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
NrOfCopies = 1;
|
NrOfCopies = 1;
|
||||||
GoodOnly = false;
|
GoodOnly = false;
|
||||||
SupressPrinting = false;
|
SupressPrinting = false;
|
||||||
|
DrawSNasBarcode = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ToString(int i)
|
public string ToString(int i)
|
||||||
{
|
{
|
||||||
return string.Format("Name={0}, Orientation={1}, PaperWidth={2}, PaperHeight={3}, TemplateFile={4}, GoodOnly={5}, SupressPrinting={6}",
|
return string.Format("Name={0}, Orientation={1}, PaperWidth={2}, PaperHeight={3}, TemplateFile={4}, GoodOnly={5}, SupressPrinting={6}, Barcode={7}",
|
||||||
Name,
|
Name,
|
||||||
PageOrientation,
|
PageOrientation,
|
||||||
PaperWidth,
|
PaperWidth,
|
||||||
PaperHeight,
|
PaperHeight,
|
||||||
Template,
|
Template,
|
||||||
GoodOnly ? "yes" : "no",
|
GoodOnly ? "yes" : "no",
|
||||||
SupressPrinting ? "yes" : "no"
|
SupressPrinting ? "yes" : "no",
|
||||||
|
DrawSNasBarcode ? "yes" : "no"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+160
-39
@@ -42,7 +42,6 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
this.paperWidthTextBox = new System.Windows.Forms.TextBox();
|
this.paperWidthTextBox = new System.Windows.Forms.TextBox();
|
||||||
this.paperWidthLabel = new System.Windows.Forms.Label();
|
this.paperWidthLabel = new System.Windows.Forms.Label();
|
||||||
this.paperHeightTextBox = new System.Windows.Forms.TextBox();
|
this.paperHeightTextBox = new System.Windows.Forms.TextBox();
|
||||||
this.paperHeightLabel = new System.Windows.Forms.Label();
|
|
||||||
this.italicCheckBox = new System.Windows.Forms.CheckBox();
|
this.italicCheckBox = new System.Windows.Forms.CheckBox();
|
||||||
this.boldCheckBox = new System.Windows.Forms.CheckBox();
|
this.boldCheckBox = new System.Windows.Forms.CheckBox();
|
||||||
this.fontSizeTextBox = new System.Windows.Forms.TextBox();
|
this.fontSizeTextBox = new System.Windows.Forms.TextBox();
|
||||||
@@ -56,6 +55,18 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
this.cultureComboBox = new System.Windows.Forms.ComboBox();
|
this.cultureComboBox = new System.Windows.Forms.ComboBox();
|
||||||
this.cultureLabel = new System.Windows.Forms.Label();
|
this.cultureLabel = new System.Windows.Forms.Label();
|
||||||
this.goodOnlyCheckBox = new System.Windows.Forms.CheckBox();
|
this.goodOnlyCheckBox = new System.Windows.Forms.CheckBox();
|
||||||
|
this.snBarcodeGroupBox = new System.Windows.Forms.GroupBox();
|
||||||
|
this.barcodeHeightLabel = new System.Windows.Forms.Label();
|
||||||
|
this.barcodeHeightTextBox = new System.Windows.Forms.TextBox();
|
||||||
|
this.isQrCheckBox = new System.Windows.Forms.CheckBox();
|
||||||
|
this.barcodeWidthLabel = new System.Windows.Forms.Label();
|
||||||
|
this.barcodeWidthTextBox = new System.Windows.Forms.TextBox();
|
||||||
|
this.barcodeTopLabel = new System.Windows.Forms.Label();
|
||||||
|
this.barcodeTopTextBox = new System.Windows.Forms.TextBox();
|
||||||
|
this.barcodeLeftTextBox = new System.Windows.Forms.TextBox();
|
||||||
|
this.barcodeLeftLabel = new System.Windows.Forms.Label();
|
||||||
|
this.snBarcodeCheckBox = new System.Windows.Forms.CheckBox();
|
||||||
|
this.snBarcodeGroupBox.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// nameTextBox
|
// nameTextBox
|
||||||
@@ -88,7 +99,7 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
//
|
//
|
||||||
this.supressPrintingCheckBox.AutoSize = true;
|
this.supressPrintingCheckBox.AutoSize = true;
|
||||||
this.supressPrintingCheckBox.Enabled = false;
|
this.supressPrintingCheckBox.Enabled = false;
|
||||||
this.supressPrintingCheckBox.Location = new System.Drawing.Point(122, 283);
|
this.supressPrintingCheckBox.Location = new System.Drawing.Point(245, 200);
|
||||||
this.supressPrintingCheckBox.Name = "supressPrintingCheckBox";
|
this.supressPrintingCheckBox.Name = "supressPrintingCheckBox";
|
||||||
this.supressPrintingCheckBox.Size = new System.Drawing.Size(101, 17);
|
this.supressPrintingCheckBox.Size = new System.Drawing.Size(101, 17);
|
||||||
this.supressPrintingCheckBox.TabIndex = 11;
|
this.supressPrintingCheckBox.TabIndex = 11;
|
||||||
@@ -143,68 +154,59 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
this.paperWidthLabel.AutoSize = true;
|
this.paperWidthLabel.AutoSize = true;
|
||||||
this.paperWidthLabel.Location = new System.Drawing.Point(8, 108);
|
this.paperWidthLabel.Location = new System.Drawing.Point(8, 108);
|
||||||
this.paperWidthLabel.Name = "paperWidthLabel";
|
this.paperWidthLabel.Name = "paperWidthLabel";
|
||||||
this.paperWidthLabel.Size = new System.Drawing.Size(63, 13);
|
this.paperWidthLabel.Size = new System.Drawing.Size(103, 13);
|
||||||
this.paperWidthLabel.TabIndex = 5;
|
this.paperWidthLabel.TabIndex = 5;
|
||||||
this.paperWidthLabel.Text = "Paper width";
|
this.paperWidthLabel.Text = "Paper width / height";
|
||||||
//
|
//
|
||||||
// paperHeightTextBox
|
// paperHeightTextBox
|
||||||
//
|
//
|
||||||
this.paperHeightTextBox.Enabled = false;
|
this.paperHeightTextBox.Enabled = false;
|
||||||
this.paperHeightTextBox.Location = new System.Drawing.Point(122, 128);
|
this.paperHeightTextBox.Location = new System.Drawing.Point(176, 105);
|
||||||
this.paperHeightTextBox.Name = "paperHeightTextBox";
|
this.paperHeightTextBox.Name = "paperHeightTextBox";
|
||||||
this.paperHeightTextBox.Size = new System.Drawing.Size(51, 20);
|
this.paperHeightTextBox.Size = new System.Drawing.Size(51, 20);
|
||||||
this.paperHeightTextBox.TabIndex = 8;
|
this.paperHeightTextBox.TabIndex = 8;
|
||||||
//
|
//
|
||||||
// paperHeightLabel
|
// italicCheckBox
|
||||||
//
|
|
||||||
this.paperHeightLabel.AutoSize = true;
|
|
||||||
this.paperHeightLabel.Location = new System.Drawing.Point(8, 131);
|
|
||||||
this.paperHeightLabel.Name = "paperHeightLabel";
|
|
||||||
this.paperHeightLabel.Size = new System.Drawing.Size(67, 13);
|
|
||||||
this.paperHeightLabel.TabIndex = 7;
|
|
||||||
this.paperHeightLabel.Text = "Paper height";
|
|
||||||
//
|
|
||||||
// bodyItalicCheckBox
|
|
||||||
//
|
//
|
||||||
this.italicCheckBox.AutoSize = true;
|
this.italicCheckBox.AutoSize = true;
|
||||||
this.italicCheckBox.Enabled = false;
|
this.italicCheckBox.Enabled = false;
|
||||||
this.italicCheckBox.Location = new System.Drawing.Point(335, 190);
|
this.italicCheckBox.Location = new System.Drawing.Point(335, 134);
|
||||||
this.italicCheckBox.Name = "bodyItalicCheckBox";
|
this.italicCheckBox.Name = "italicCheckBox";
|
||||||
this.italicCheckBox.Size = new System.Drawing.Size(15, 14);
|
this.italicCheckBox.Size = new System.Drawing.Size(15, 14);
|
||||||
this.italicCheckBox.TabIndex = 47;
|
this.italicCheckBox.TabIndex = 47;
|
||||||
this.italicCheckBox.UseVisualStyleBackColor = true;
|
this.italicCheckBox.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// bodyBoldCheckBox
|
// boldCheckBox
|
||||||
//
|
//
|
||||||
this.boldCheckBox.AutoSize = true;
|
this.boldCheckBox.AutoSize = true;
|
||||||
this.boldCheckBox.Enabled = false;
|
this.boldCheckBox.Enabled = false;
|
||||||
this.boldCheckBox.Location = new System.Drawing.Point(307, 190);
|
this.boldCheckBox.Location = new System.Drawing.Point(307, 134);
|
||||||
this.boldCheckBox.Name = "bodyBoldCheckBox";
|
this.boldCheckBox.Name = "boldCheckBox";
|
||||||
this.boldCheckBox.Size = new System.Drawing.Size(15, 14);
|
this.boldCheckBox.Size = new System.Drawing.Size(15, 14);
|
||||||
this.boldCheckBox.TabIndex = 46;
|
this.boldCheckBox.TabIndex = 46;
|
||||||
this.boldCheckBox.UseVisualStyleBackColor = true;
|
this.boldCheckBox.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// bodyFontSizeTextBox
|
// fontSizeTextBox
|
||||||
//
|
//
|
||||||
this.fontSizeTextBox.Enabled = false;
|
this.fontSizeTextBox.Enabled = false;
|
||||||
this.fontSizeTextBox.Location = new System.Drawing.Point(259, 184);
|
this.fontSizeTextBox.Location = new System.Drawing.Point(259, 128);
|
||||||
this.fontSizeTextBox.Name = "bodyFontSizeTextBox";
|
this.fontSizeTextBox.Name = "fontSizeTextBox";
|
||||||
this.fontSizeTextBox.Size = new System.Drawing.Size(29, 20);
|
this.fontSizeTextBox.Size = new System.Drawing.Size(29, 20);
|
||||||
this.fontSizeTextBox.TabIndex = 45;
|
this.fontSizeTextBox.TabIndex = 45;
|
||||||
//
|
//
|
||||||
// bodyFontFamilyComboBox
|
// fontFamilyComboBox
|
||||||
//
|
//
|
||||||
this.fontFamilyComboBox.Enabled = false;
|
this.fontFamilyComboBox.Enabled = false;
|
||||||
this.fontFamilyComboBox.FormattingEnabled = true;
|
this.fontFamilyComboBox.FormattingEnabled = true;
|
||||||
this.fontFamilyComboBox.Location = new System.Drawing.Point(122, 184);
|
this.fontFamilyComboBox.Location = new System.Drawing.Point(122, 128);
|
||||||
this.fontFamilyComboBox.Name = "bodyFontFamilyComboBox";
|
this.fontFamilyComboBox.Name = "fontFamilyComboBox";
|
||||||
this.fontFamilyComboBox.Size = new System.Drawing.Size(130, 21);
|
this.fontFamilyComboBox.Size = new System.Drawing.Size(130, 21);
|
||||||
this.fontFamilyComboBox.TabIndex = 44;
|
this.fontFamilyComboBox.TabIndex = 44;
|
||||||
//
|
//
|
||||||
// bodyFontLabel
|
// bodyFontLabel
|
||||||
//
|
//
|
||||||
this.bodyFontLabel.AutoSize = true;
|
this.bodyFontLabel.AutoSize = true;
|
||||||
this.bodyFontLabel.Location = new System.Drawing.Point(8, 187);
|
this.bodyFontLabel.Location = new System.Drawing.Point(8, 131);
|
||||||
this.bodyFontLabel.Name = "bodyFontLabel";
|
this.bodyFontLabel.Name = "bodyFontLabel";
|
||||||
this.bodyFontLabel.Size = new System.Drawing.Size(106, 13);
|
this.bodyFontLabel.Size = new System.Drawing.Size(106, 13);
|
||||||
this.bodyFontLabel.TabIndex = 43;
|
this.bodyFontLabel.TabIndex = 43;
|
||||||
@@ -214,7 +216,7 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
//
|
//
|
||||||
this.label2.AutoSize = true;
|
this.label2.AutoSize = true;
|
||||||
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||||
this.label2.Location = new System.Drawing.Point(331, 175);
|
this.label2.Location = new System.Drawing.Point(331, 119);
|
||||||
this.label2.Name = "label2";
|
this.label2.Name = "label2";
|
||||||
this.label2.Size = new System.Drawing.Size(24, 13);
|
this.label2.Size = new System.Drawing.Size(24, 13);
|
||||||
this.label2.TabIndex = 49;
|
this.label2.TabIndex = 49;
|
||||||
@@ -224,7 +226,7 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
//
|
//
|
||||||
this.label1.AutoSize = true;
|
this.label1.AutoSize = true;
|
||||||
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||||
this.label1.Location = new System.Drawing.Point(297, 175);
|
this.label1.Location = new System.Drawing.Point(297, 119);
|
||||||
this.label1.Name = "label1";
|
this.label1.Name = "label1";
|
||||||
this.label1.Size = new System.Drawing.Size(32, 13);
|
this.label1.Size = new System.Drawing.Size(32, 13);
|
||||||
this.label1.TabIndex = 48;
|
this.label1.TabIndex = 48;
|
||||||
@@ -233,9 +235,9 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
// itemsToPrintButton
|
// itemsToPrintButton
|
||||||
//
|
//
|
||||||
this.itemsToPrintButton.Enabled = false;
|
this.itemsToPrintButton.Enabled = false;
|
||||||
this.itemsToPrintButton.Location = new System.Drawing.Point(121, 154);
|
this.itemsToPrintButton.Location = new System.Drawing.Point(259, 85);
|
||||||
this.itemsToPrintButton.Name = "itemsToPrintButton";
|
this.itemsToPrintButton.Name = "itemsToPrintButton";
|
||||||
this.itemsToPrintButton.Size = new System.Drawing.Size(132, 23);
|
this.itemsToPrintButton.Size = new System.Drawing.Size(91, 30);
|
||||||
this.itemsToPrintButton.TabIndex = 50;
|
this.itemsToPrintButton.TabIndex = 50;
|
||||||
this.itemsToPrintButton.Text = "Items to print";
|
this.itemsToPrintButton.Text = "Items to print";
|
||||||
this.itemsToPrintButton.UseVisualStyleBackColor = true;
|
this.itemsToPrintButton.UseVisualStyleBackColor = true;
|
||||||
@@ -244,7 +246,7 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
// nrOfCopiesLabel
|
// nrOfCopiesLabel
|
||||||
//
|
//
|
||||||
this.nrOfCopiesLabel.AutoSize = true;
|
this.nrOfCopiesLabel.AutoSize = true;
|
||||||
this.nrOfCopiesLabel.Location = new System.Drawing.Point(8, 235);
|
this.nrOfCopiesLabel.Location = new System.Drawing.Point(8, 179);
|
||||||
this.nrOfCopiesLabel.Name = "nrOfCopiesLabel";
|
this.nrOfCopiesLabel.Name = "nrOfCopiesLabel";
|
||||||
this.nrOfCopiesLabel.Size = new System.Drawing.Size(90, 13);
|
this.nrOfCopiesLabel.Size = new System.Drawing.Size(90, 13);
|
||||||
this.nrOfCopiesLabel.TabIndex = 52;
|
this.nrOfCopiesLabel.TabIndex = 52;
|
||||||
@@ -253,7 +255,7 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
// nrOfCopiesTextBox
|
// nrOfCopiesTextBox
|
||||||
//
|
//
|
||||||
this.nrOfCopiesTextBox.Enabled = false;
|
this.nrOfCopiesTextBox.Enabled = false;
|
||||||
this.nrOfCopiesTextBox.Location = new System.Drawing.Point(122, 232);
|
this.nrOfCopiesTextBox.Location = new System.Drawing.Point(122, 176);
|
||||||
this.nrOfCopiesTextBox.Name = "nrOfCopiesTextBox";
|
this.nrOfCopiesTextBox.Name = "nrOfCopiesTextBox";
|
||||||
this.nrOfCopiesTextBox.Size = new System.Drawing.Size(51, 20);
|
this.nrOfCopiesTextBox.Size = new System.Drawing.Size(51, 20);
|
||||||
this.nrOfCopiesTextBox.TabIndex = 51;
|
this.nrOfCopiesTextBox.TabIndex = 51;
|
||||||
@@ -262,15 +264,15 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
//
|
//
|
||||||
this.cultureComboBox.Enabled = false;
|
this.cultureComboBox.Enabled = false;
|
||||||
this.cultureComboBox.FormattingEnabled = true;
|
this.cultureComboBox.FormattingEnabled = true;
|
||||||
this.cultureComboBox.Location = new System.Drawing.Point(122, 208);
|
this.cultureComboBox.Location = new System.Drawing.Point(122, 152);
|
||||||
this.cultureComboBox.Name = "cultureComboBox";
|
this.cultureComboBox.Name = "cultureComboBox";
|
||||||
this.cultureComboBox.Size = new System.Drawing.Size(218, 21);
|
this.cultureComboBox.Size = new System.Drawing.Size(228, 21);
|
||||||
this.cultureComboBox.TabIndex = 54;
|
this.cultureComboBox.TabIndex = 54;
|
||||||
//
|
//
|
||||||
// cultureLabel
|
// cultureLabel
|
||||||
//
|
//
|
||||||
this.cultureLabel.AutoSize = true;
|
this.cultureLabel.AutoSize = true;
|
||||||
this.cultureLabel.Location = new System.Drawing.Point(8, 211);
|
this.cultureLabel.Location = new System.Drawing.Point(8, 155);
|
||||||
this.cultureLabel.Name = "cultureLabel";
|
this.cultureLabel.Name = "cultureLabel";
|
||||||
this.cultureLabel.Size = new System.Drawing.Size(42, 13);
|
this.cultureLabel.Size = new System.Drawing.Size(42, 13);
|
||||||
this.cultureLabel.TabIndex = 53;
|
this.cultureLabel.TabIndex = 53;
|
||||||
@@ -280,17 +282,125 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
//
|
//
|
||||||
this.goodOnlyCheckBox.AutoSize = true;
|
this.goodOnlyCheckBox.AutoSize = true;
|
||||||
this.goodOnlyCheckBox.Enabled = false;
|
this.goodOnlyCheckBox.Enabled = false;
|
||||||
this.goodOnlyCheckBox.Location = new System.Drawing.Point(122, 262);
|
this.goodOnlyCheckBox.Location = new System.Drawing.Point(245, 179);
|
||||||
this.goodOnlyCheckBox.Name = "goodOnlyCheckBox";
|
this.goodOnlyCheckBox.Name = "goodOnlyCheckBox";
|
||||||
this.goodOnlyCheckBox.Size = new System.Drawing.Size(74, 17);
|
this.goodOnlyCheckBox.Size = new System.Drawing.Size(74, 17);
|
||||||
this.goodOnlyCheckBox.TabIndex = 55;
|
this.goodOnlyCheckBox.TabIndex = 55;
|
||||||
this.goodOnlyCheckBox.Text = "Good only";
|
this.goodOnlyCheckBox.Text = "Good only";
|
||||||
this.goodOnlyCheckBox.UseVisualStyleBackColor = true;
|
this.goodOnlyCheckBox.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
|
// snBarcodeGroupBox
|
||||||
|
//
|
||||||
|
this.snBarcodeGroupBox.Controls.Add(this.barcodeHeightLabel);
|
||||||
|
this.snBarcodeGroupBox.Controls.Add(this.barcodeHeightTextBox);
|
||||||
|
this.snBarcodeGroupBox.Controls.Add(this.isQrCheckBox);
|
||||||
|
this.snBarcodeGroupBox.Controls.Add(this.barcodeWidthLabel);
|
||||||
|
this.snBarcodeGroupBox.Controls.Add(this.barcodeWidthTextBox);
|
||||||
|
this.snBarcodeGroupBox.Controls.Add(this.barcodeTopLabel);
|
||||||
|
this.snBarcodeGroupBox.Controls.Add(this.barcodeTopTextBox);
|
||||||
|
this.snBarcodeGroupBox.Controls.Add(this.barcodeLeftTextBox);
|
||||||
|
this.snBarcodeGroupBox.Controls.Add(this.barcodeLeftLabel);
|
||||||
|
this.snBarcodeGroupBox.Controls.Add(this.snBarcodeCheckBox);
|
||||||
|
this.snBarcodeGroupBox.Location = new System.Drawing.Point(11, 227);
|
||||||
|
this.snBarcodeGroupBox.Name = "snBarcodeGroupBox";
|
||||||
|
this.snBarcodeGroupBox.Size = new System.Drawing.Size(339, 59);
|
||||||
|
this.snBarcodeGroupBox.TabIndex = 56;
|
||||||
|
this.snBarcodeGroupBox.TabStop = false;
|
||||||
|
//
|
||||||
|
// barcodeHeightLabel
|
||||||
|
//
|
||||||
|
this.barcodeHeightLabel.AutoSize = true;
|
||||||
|
this.barcodeHeightLabel.Location = new System.Drawing.Point(207, 29);
|
||||||
|
this.barcodeHeightLabel.Name = "barcodeHeightLabel";
|
||||||
|
this.barcodeHeightLabel.Size = new System.Drawing.Size(38, 13);
|
||||||
|
this.barcodeHeightLabel.TabIndex = 18;
|
||||||
|
this.barcodeHeightLabel.Text = "Height";
|
||||||
|
//
|
||||||
|
// barcodeHeightTextBox
|
||||||
|
//
|
||||||
|
this.barcodeHeightTextBox.Enabled = false;
|
||||||
|
this.barcodeHeightTextBox.Location = new System.Drawing.Point(247, 25);
|
||||||
|
this.barcodeHeightTextBox.Name = "barcodeHeightTextBox";
|
||||||
|
this.barcodeHeightTextBox.Size = new System.Drawing.Size(32, 20);
|
||||||
|
this.barcodeHeightTextBox.TabIndex = 17;
|
||||||
|
//
|
||||||
|
// isQrCheckBox
|
||||||
|
//
|
||||||
|
this.isQrCheckBox.AutoSize = true;
|
||||||
|
this.isQrCheckBox.Location = new System.Drawing.Point(293, 27);
|
||||||
|
this.isQrCheckBox.Name = "isQrCheckBox";
|
||||||
|
this.isQrCheckBox.Size = new System.Drawing.Size(42, 17);
|
||||||
|
this.isQrCheckBox.TabIndex = 16;
|
||||||
|
this.isQrCheckBox.Text = "QR";
|
||||||
|
this.isQrCheckBox.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// barcodeWidthLabel
|
||||||
|
//
|
||||||
|
this.barcodeWidthLabel.AutoSize = true;
|
||||||
|
this.barcodeWidthLabel.Location = new System.Drawing.Point(135, 29);
|
||||||
|
this.barcodeWidthLabel.Name = "barcodeWidthLabel";
|
||||||
|
this.barcodeWidthLabel.Size = new System.Drawing.Size(35, 13);
|
||||||
|
this.barcodeWidthLabel.TabIndex = 15;
|
||||||
|
this.barcodeWidthLabel.Text = "Width";
|
||||||
|
//
|
||||||
|
// barcodeWidthTextBox
|
||||||
|
//
|
||||||
|
this.barcodeWidthTextBox.Enabled = false;
|
||||||
|
this.barcodeWidthTextBox.Location = new System.Drawing.Point(171, 25);
|
||||||
|
this.barcodeWidthTextBox.Name = "barcodeWidthTextBox";
|
||||||
|
this.barcodeWidthTextBox.Size = new System.Drawing.Size(32, 20);
|
||||||
|
this.barcodeWidthTextBox.TabIndex = 14;
|
||||||
|
//
|
||||||
|
// barcodeTopLabel
|
||||||
|
//
|
||||||
|
this.barcodeTopLabel.AutoSize = true;
|
||||||
|
this.barcodeTopLabel.Location = new System.Drawing.Point(71, 29);
|
||||||
|
this.barcodeTopLabel.Name = "barcodeTopLabel";
|
||||||
|
this.barcodeTopLabel.Size = new System.Drawing.Size(26, 13);
|
||||||
|
this.barcodeTopLabel.TabIndex = 13;
|
||||||
|
this.barcodeTopLabel.Text = "Top";
|
||||||
|
//
|
||||||
|
// barcodeTopTextBox
|
||||||
|
//
|
||||||
|
this.barcodeTopTextBox.Enabled = false;
|
||||||
|
this.barcodeTopTextBox.Location = new System.Drawing.Point(99, 25);
|
||||||
|
this.barcodeTopTextBox.Name = "barcodeTopTextBox";
|
||||||
|
this.barcodeTopTextBox.Size = new System.Drawing.Size(32, 20);
|
||||||
|
this.barcodeTopTextBox.TabIndex = 11;
|
||||||
|
//
|
||||||
|
// barcodeLeftTextBox
|
||||||
|
//
|
||||||
|
this.barcodeLeftTextBox.Enabled = false;
|
||||||
|
this.barcodeLeftTextBox.Location = new System.Drawing.Point(35, 25);
|
||||||
|
this.barcodeLeftTextBox.Name = "barcodeLeftTextBox";
|
||||||
|
this.barcodeLeftTextBox.Size = new System.Drawing.Size(32, 20);
|
||||||
|
this.barcodeLeftTextBox.TabIndex = 10;
|
||||||
|
//
|
||||||
|
// barcodeLeftLabel
|
||||||
|
//
|
||||||
|
this.barcodeLeftLabel.AutoSize = true;
|
||||||
|
this.barcodeLeftLabel.Location = new System.Drawing.Point(8, 29);
|
||||||
|
this.barcodeLeftLabel.Name = "barcodeLeftLabel";
|
||||||
|
this.barcodeLeftLabel.Size = new System.Drawing.Size(25, 13);
|
||||||
|
this.barcodeLeftLabel.TabIndex = 9;
|
||||||
|
this.barcodeLeftLabel.Text = "Left";
|
||||||
|
//
|
||||||
|
// snBarcodeCheckBox
|
||||||
|
//
|
||||||
|
this.snBarcodeCheckBox.AutoSize = true;
|
||||||
|
this.snBarcodeCheckBox.Location = new System.Drawing.Point(10, 0);
|
||||||
|
this.snBarcodeCheckBox.Name = "snBarcodeCheckBox";
|
||||||
|
this.snBarcodeCheckBox.Size = new System.Drawing.Size(176, 17);
|
||||||
|
this.snBarcodeCheckBox.TabIndex = 0;
|
||||||
|
this.snBarcodeCheckBox.Text = "Print barcode with serial number";
|
||||||
|
this.snBarcodeCheckBox.UseVisualStyleBackColor = true;
|
||||||
|
this.snBarcodeCheckBox.CheckedChanged += new System.EventHandler(this.snBarcodeCheckBox_CheckedChanged);
|
||||||
|
//
|
||||||
// PrinterCfgCtrl
|
// PrinterCfgCtrl
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.Controls.Add(this.snBarcodeGroupBox);
|
||||||
this.Controls.Add(this.goodOnlyCheckBox);
|
this.Controls.Add(this.goodOnlyCheckBox);
|
||||||
this.Controls.Add(this.cultureComboBox);
|
this.Controls.Add(this.cultureComboBox);
|
||||||
this.Controls.Add(this.cultureLabel);
|
this.Controls.Add(this.cultureLabel);
|
||||||
@@ -305,7 +415,6 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
this.Controls.Add(this.label2);
|
this.Controls.Add(this.label2);
|
||||||
this.Controls.Add(this.label1);
|
this.Controls.Add(this.label1);
|
||||||
this.Controls.Add(this.paperHeightTextBox);
|
this.Controls.Add(this.paperHeightTextBox);
|
||||||
this.Controls.Add(this.paperHeightLabel);
|
|
||||||
this.Controls.Add(this.paperWidthTextBox);
|
this.Controls.Add(this.paperWidthTextBox);
|
||||||
this.Controls.Add(this.paperWidthLabel);
|
this.Controls.Add(this.paperWidthLabel);
|
||||||
this.Controls.Add(this.templateTextBox);
|
this.Controls.Add(this.templateTextBox);
|
||||||
@@ -319,6 +428,8 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
this.Name = "PrinterCfgCtrl";
|
this.Name = "PrinterCfgCtrl";
|
||||||
this.Size = new System.Drawing.Size(372, 327);
|
this.Size = new System.Drawing.Size(372, 327);
|
||||||
this.Load += new System.EventHandler(this.PrinterCfgCtrl_Load);
|
this.Load += new System.EventHandler(this.PrinterCfgCtrl_Load);
|
||||||
|
this.snBarcodeGroupBox.ResumeLayout(false);
|
||||||
|
this.snBarcodeGroupBox.PerformLayout();
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
this.PerformLayout();
|
this.PerformLayout();
|
||||||
|
|
||||||
@@ -337,7 +448,6 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
private System.Windows.Forms.TextBox paperWidthTextBox;
|
private System.Windows.Forms.TextBox paperWidthTextBox;
|
||||||
private System.Windows.Forms.Label paperWidthLabel;
|
private System.Windows.Forms.Label paperWidthLabel;
|
||||||
private System.Windows.Forms.TextBox paperHeightTextBox;
|
private System.Windows.Forms.TextBox paperHeightTextBox;
|
||||||
private System.Windows.Forms.Label paperHeightLabel;
|
|
||||||
private System.Windows.Forms.CheckBox italicCheckBox;
|
private System.Windows.Forms.CheckBox italicCheckBox;
|
||||||
private System.Windows.Forms.CheckBox boldCheckBox;
|
private System.Windows.Forms.CheckBox boldCheckBox;
|
||||||
private System.Windows.Forms.TextBox fontSizeTextBox;
|
private System.Windows.Forms.TextBox fontSizeTextBox;
|
||||||
@@ -351,5 +461,16 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
private System.Windows.Forms.ComboBox cultureComboBox;
|
private System.Windows.Forms.ComboBox cultureComboBox;
|
||||||
private System.Windows.Forms.Label cultureLabel;
|
private System.Windows.Forms.Label cultureLabel;
|
||||||
private System.Windows.Forms.CheckBox goodOnlyCheckBox;
|
private System.Windows.Forms.CheckBox goodOnlyCheckBox;
|
||||||
|
private System.Windows.Forms.GroupBox snBarcodeGroupBox;
|
||||||
|
private System.Windows.Forms.TextBox barcodeTopTextBox;
|
||||||
|
private System.Windows.Forms.TextBox barcodeLeftTextBox;
|
||||||
|
private System.Windows.Forms.Label barcodeLeftLabel;
|
||||||
|
private System.Windows.Forms.CheckBox snBarcodeCheckBox;
|
||||||
|
private System.Windows.Forms.Label barcodeWidthLabel;
|
||||||
|
private System.Windows.Forms.TextBox barcodeWidthTextBox;
|
||||||
|
private System.Windows.Forms.Label barcodeTopLabel;
|
||||||
|
private System.Windows.Forms.CheckBox isQrCheckBox;
|
||||||
|
private System.Windows.Forms.Label barcodeHeightLabel;
|
||||||
|
private System.Windows.Forms.TextBox barcodeHeightTextBox;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
|
/// Copyright (c) 2015-2020 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using log4net;
|
using log4net;
|
||||||
@@ -42,6 +43,8 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
{
|
{
|
||||||
fontFamilyComboBox.Items.Add(ff.Name);
|
fontFamilyComboBox.Items.Add(ff.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ManageCheckGroupBox(snBarcodeCheckBox, snBarcodeGroupBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PrinterCfgCtrl_Load(object sender, EventArgs e)
|
private void PrinterCfgCtrl_Load(object sender, EventArgs e)
|
||||||
@@ -80,6 +83,13 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
nrOfCopiesTextBox.Text = config.NrOfCopies.ToString();
|
nrOfCopiesTextBox.Text = config.NrOfCopies.ToString();
|
||||||
goodOnlyCheckBox.Checked = config.GoodOnly;
|
goodOnlyCheckBox.Checked = config.GoodOnly;
|
||||||
supressPrintingCheckBox.Checked = config.SupressPrinting;
|
supressPrintingCheckBox.Checked = config.SupressPrinting;
|
||||||
|
|
||||||
|
snBarcodeCheckBox.Checked = config.DrawSNasBarcode;
|
||||||
|
isQrCheckBox.Checked = config.IsQR;
|
||||||
|
barcodeLeftTextBox.Text = config.BarcodeLeft.ToString();
|
||||||
|
barcodeTopTextBox.Text = config.BarcodeTop.ToString();
|
||||||
|
barcodeWidthTextBox.Text = config.BarcodeWidth.ToString();
|
||||||
|
barcodeHeightTextBox.Text = config.BarcodeHeight.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unlock()
|
public void Unlock()
|
||||||
@@ -98,6 +108,19 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
nrOfCopiesTextBox.Enabled = true;
|
nrOfCopiesTextBox.Enabled = true;
|
||||||
goodOnlyCheckBox.Enabled = true;
|
goodOnlyCheckBox.Enabled = true;
|
||||||
supressPrintingCheckBox.Enabled = true;
|
supressPrintingCheckBox.Enabled = true;
|
||||||
|
|
||||||
|
snBarcodeCheckBox.Enabled = true;
|
||||||
|
ManageCheckGroupBox(snBarcodeCheckBox, snBarcodeGroupBox);
|
||||||
|
isQrCheckBox.Enabled = true;
|
||||||
|
barcodeLeftTextBox.Enabled = true;
|
||||||
|
barcodeTopTextBox.Enabled = true;
|
||||||
|
barcodeWidthTextBox.Enabled = true;
|
||||||
|
barcodeHeightTextBox.Enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void snBarcodeCheckBox_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ManageCheckGroupBox(snBarcodeCheckBox, snBarcodeGroupBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
public CfgUpdateFlags VerifyCfg(ref string message)
|
||||||
@@ -142,6 +165,26 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
message += Environment.NewLine + "'Number of copies' should be between 0 and 9";
|
message += Environment.NewLine + "'Number of copies' should be between 0 and 9";
|
||||||
flags |= CfgUpdateFlags.Error;
|
flags |= CfgUpdateFlags.Error;
|
||||||
}
|
}
|
||||||
|
if (!int.TryParse(barcodeLeftTextBox.Text, out dummy) || dummy < 0 || dummy > 2000)
|
||||||
|
{
|
||||||
|
message += Environment.NewLine + "Barcode 'Left' should be between 0 and 2000";
|
||||||
|
flags |= CfgUpdateFlags.Error;
|
||||||
|
}
|
||||||
|
if (!int.TryParse(barcodeTopTextBox.Text, out dummy) || dummy < 0 || dummy > 2000)
|
||||||
|
{
|
||||||
|
message += Environment.NewLine + "Barcode 'Top' should be between 0 and 2000";
|
||||||
|
flags |= CfgUpdateFlags.Error;
|
||||||
|
}
|
||||||
|
if (!int.TryParse(barcodeWidthTextBox.Text, out dummy) || dummy < 0 || dummy > 200)
|
||||||
|
{
|
||||||
|
message += Environment.NewLine + "Barcode 'Width' should be between 0 and 200";
|
||||||
|
flags |= CfgUpdateFlags.Error;
|
||||||
|
}
|
||||||
|
if (!int.TryParse(barcodeHeightTextBox.Text, out dummy) || dummy < 0 || dummy > 200)
|
||||||
|
{
|
||||||
|
message += Environment.NewLine + "Barcode 'Height' should be between 0 and 200";
|
||||||
|
flags |= CfgUpdateFlags.Error;
|
||||||
|
}
|
||||||
|
|
||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
@@ -193,6 +236,13 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
flags |= UpdateDifferent(ref config.GoodOnly, goodOnlyCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
flags |= UpdateDifferent(ref config.GoodOnly, goodOnlyCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||||
flags |= UpdateDifferent(ref config.SupressPrinting, supressPrintingCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
flags |= UpdateDifferent(ref config.SupressPrinting, supressPrintingCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||||
|
|
||||||
|
flags |= UpdateDifferent(ref config.DrawSNasBarcode, snBarcodeCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||||
|
flags |= UpdateDifferent(ref config.IsQR, isQrCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||||
|
flags |= UpdateDifferent(ref config.BarcodeLeft, barcodeLeftTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||||
|
flags |= UpdateDifferent(ref config.BarcodeTop, barcodeTopTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||||
|
flags |= UpdateDifferent(ref config.BarcodeWidth, barcodeWidthTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||||
|
flags |= UpdateDifferent(ref config.BarcodeHeight, barcodeHeightTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||||
|
|
||||||
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
|
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
|
||||||
{
|
{
|
||||||
Printer.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
|
Printer.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
|
||||||
@@ -214,6 +264,20 @@ namespace TBF.BenchControl.Output.Printers.Label
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ManageCheckGroupBox(CheckBox chk, GroupBox grp)
|
||||||
|
{
|
||||||
|
/// Make sure the CheckBox isn't in the GroupBox. This will only happen the first time.
|
||||||
|
if (chk.Parent == grp)
|
||||||
|
{
|
||||||
|
grp.Parent.Controls.Add(chk); /// Reparent the CheckBox so it's not in the GroupBox.
|
||||||
|
chk.Location = new Point(chk.Left + grp.Left, chk.Top + grp.Top); /// Adjust the CheckBox's location.
|
||||||
|
chk.BringToFront(); /// Move the CheckBox to the top of the stacking order.
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Enable or disable the GroupBox.
|
||||||
|
grp.Enabled = chk.Checked;
|
||||||
|
}
|
||||||
|
|
||||||
#region Configuration Change Handling
|
#region Configuration Change Handling
|
||||||
|
|
||||||
public static void OnCmdResponse(object sender, CmdResponseArgs args)
|
public static void OnCmdResponse(object sender, CmdResponseArgs args)
|
||||||
|
|||||||
@@ -49,6 +49,13 @@ namespace TBF.BenchControl.Output
|
|||||||
public string QBezeichnungLog; /// Flow name in Oracle database
|
public string QBezeichnungLog; /// Flow name in Oracle database
|
||||||
public Range Range; /// Range.R90_100 or Range.R100_110 (flow range in % of a target flow)
|
public Range Range; /// Range.R90_100 or Range.R100_110 (flow range in % of a target flow)
|
||||||
|
|
||||||
|
public double Flow;
|
||||||
|
public int TestTime;
|
||||||
|
public double ErrLimLoFromDB;
|
||||||
|
public double ErrLimHiFromDB;
|
||||||
|
public double Uncertainty;
|
||||||
|
public string TestMethod;
|
||||||
|
|
||||||
public SensusTestInfo(string tstName, int pnDB, string qbDB, int pnOpto, string qbOpto, int pnLog, string qbLog, Range range)
|
public SensusTestInfo(string tstName, int pnDB, string qbDB, int pnOpto, string qbOpto, int pnLog, string qbLog, Range range)
|
||||||
{
|
{
|
||||||
TestName = tstName;
|
TestName = tstName;
|
||||||
@@ -59,6 +66,30 @@ namespace TBF.BenchControl.Output
|
|||||||
PruefungsNrLog = pnLog;
|
PruefungsNrLog = pnLog;
|
||||||
QBezeichnungLog = qbLog;
|
QBezeichnungLog = qbLog;
|
||||||
Range = range;
|
Range = range;
|
||||||
|
Flow = 0;
|
||||||
|
TestTime = 0;
|
||||||
|
ErrLimLoFromDB = 0;
|
||||||
|
ErrLimHiFromDB = 0;
|
||||||
|
Uncertainty = 0;
|
||||||
|
TestMethod = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SensusTestInfo(int pnDB, string qbDB, double flow, int testTime, double errLimLo, double errLimHi, Range range)
|
||||||
|
{
|
||||||
|
TestName = null;
|
||||||
|
PruefungsNrDB = pnDB;
|
||||||
|
QBezeichnungDB = qbDB;
|
||||||
|
PruefungsNrOpto = 0;
|
||||||
|
QBezeichnungOpto = null;
|
||||||
|
PruefungsNrLog = 0;
|
||||||
|
QBezeichnungLog = null;
|
||||||
|
Range = range;
|
||||||
|
Flow = flow;
|
||||||
|
TestTime = testTime;
|
||||||
|
ErrLimLoFromDB = errLimLo;
|
||||||
|
ErrLimHiFromDB = errLimHi;
|
||||||
|
Uncertainty = 0;
|
||||||
|
TestMethod = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -18,6 +18,15 @@ namespace TBF.BenchControl.RegisterReaders.KPackE.RegisterReader
|
|||||||
readonly TBF.BenchControl.Elde.ControlBoardDev controlBoard;
|
readonly TBF.BenchControl.Elde.ControlBoardDev controlBoard;
|
||||||
|
|
||||||
|
|
||||||
|
public int Position
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
int firstDigitPos = Name.IndexOfAny(new char[] { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' });
|
||||||
|
int position;
|
||||||
|
return (firstDigitPos < 0) ? 0 : (int.TryParse(Name.Substring(firstDigitPos), out position) ? position : 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
public Config.Entities.RegisterReaderType RegisterReaderType { get { return Config.Entities.RegisterReaderType.Manual; } }
|
public Config.Entities.RegisterReaderType RegisterReaderType { get { return Config.Entities.RegisterReaderType.Manual; } }
|
||||||
public double PulsesPerLtr { get { return registerReaderCfg.ProcParams.PulsesPerLtr; } }
|
public double PulsesPerLtr { get { return registerReaderCfg.ProcParams.PulsesPerLtr; } }
|
||||||
public double LtrsPerPulse { get { return (PulsesPerLtr <= float.Epsilon) ? 1.0 : (1 / PulsesPerLtr); } }
|
public double LtrsPerPulse { get { return (PulsesPerLtr <= float.Epsilon) ? 1.0 : (1 / PulsesPerLtr); } }
|
||||||
|
|||||||
@@ -21,6 +21,15 @@ namespace TBF.BenchControl.RegisterReaders.SerialStream
|
|||||||
|
|
||||||
readonly SerialStreamCfg myCfg;
|
readonly SerialStreamCfg myCfg;
|
||||||
|
|
||||||
|
public int Position
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
int firstDigitPos = Name.IndexOfAny(new char[] { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' });
|
||||||
|
int position;
|
||||||
|
return (firstDigitPos < 0) ? 0 : (int.TryParse(Name.Substring(firstDigitPos), out position) ? position : 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
public Config.Entities.RegisterReaderType RegisterReaderType { get { return Config.Entities.RegisterReaderType.DataStream; } }
|
public Config.Entities.RegisterReaderType RegisterReaderType { get { return Config.Entities.RegisterReaderType.DataStream; } }
|
||||||
public double PulsesPerLtr { get { return 1000.0; } }
|
public double PulsesPerLtr { get { return 1000.0; } }
|
||||||
public double LtrsPerPulse { get { return 1 / PulsesPerLtr; } }
|
public double LtrsPerPulse { get { return 1 / PulsesPerLtr; } }
|
||||||
|
|||||||
@@ -488,7 +488,10 @@ namespace TBF.BenchControl.Sequences
|
|||||||
Debug.WriteLine(string.Format("Procedure {0}", NHibernateUtil.IsInitialized(StateMachine.Procedure) ? "initialized" : "NOT initialized"));
|
Debug.WriteLine(string.Format("Procedure {0}", NHibernateUtil.IsInitialized(StateMachine.Procedure) ? "initialized" : "NOT initialized"));
|
||||||
Debug.WriteLine(string.Format("Procedure.MoreParams {0}", NHibernateUtil.IsInitialized(StateMachine.Procedure.MoreParams) ? "initialized" : "NOT initialized"));
|
Debug.WriteLine(string.Format("Procedure.MoreParams {0}", NHibernateUtil.IsInitialized(StateMachine.Procedure.MoreParams) ? "initialized" : "NOT initialized"));
|
||||||
Debug.WriteLine(string.Format("Procedure.Tests {0}", NHibernateUtil.IsInitialized(StateMachine.Procedure.Tests) ? "initialized" : "NOT initialized"));
|
Debug.WriteLine(string.Format("Procedure.Tests {0}", NHibernateUtil.IsInitialized(StateMachine.Procedure.Tests) ? "initialized" : "NOT initialized"));
|
||||||
|
if (StateMachine.Procedure.Tests.Count > 0)
|
||||||
|
{
|
||||||
Debug.WriteLine(string.Format("Procedure.Tests[0].MoreParams {0}", NHibernateUtil.IsInitialized(StateMachine.Procedure.Tests[0].MoreParams) ? "initialized" : "NOT initialized"));
|
Debug.WriteLine(string.Format("Procedure.Tests[0].MoreParams {0}", NHibernateUtil.IsInitialized(StateMachine.Procedure.Tests[0].MoreParams) ? "initialized" : "NOT initialized"));
|
||||||
|
}
|
||||||
|
|
||||||
UiBridge.Bridge.OnError(this, string.Empty); /// Clear an error message (if any)
|
UiBridge.Bridge.OnError(this, string.Empty); /// Clear an error message (if any)
|
||||||
|
|
||||||
@@ -520,11 +523,36 @@ namespace TBF.BenchControl.Sequences
|
|||||||
for (int i = 0; i < BatchRslts.WaterMeters.Length; i++)
|
for (int i = 0; i < BatchRslts.WaterMeters.Length; i++)
|
||||||
{
|
{
|
||||||
WaterMeter wm = BatchRslts.WaterMeters[i];
|
WaterMeter wm = BatchRslts.WaterMeters[i];
|
||||||
if (wm != null && wm.Passed)
|
if (wm != null)
|
||||||
|
{
|
||||||
|
if (wm.Passed)
|
||||||
{
|
{
|
||||||
/// Water meter passed and was already saved to Oracle, do not reload & fix it now
|
/// Water meter passed and was already saved to Oracle, do not reload & fix it now
|
||||||
wm.Disabled = true;
|
wm.Disabled = true;
|
||||||
}
|
}
|
||||||
|
else if ((wm.ErrorFlags & (int)ErrorFlagMask.E28) == 0)
|
||||||
|
{
|
||||||
|
/// Water meter failed but the failure is not an assembly error
|
||||||
|
wm.Disabled = true;
|
||||||
|
}
|
||||||
|
else if (!wm.Disabled && (Users.GlobalData.GetCurrentUserName() == "milan" ||
|
||||||
|
Users.GlobalData.GetCurrentUserName() == "augustin" ||
|
||||||
|
Users.GlobalData.GetCurrentUserName() == "michal" ||
|
||||||
|
Users.GlobalData.GetCurrentUserName() == "michal2"))
|
||||||
|
{
|
||||||
|
/// Water meter failed, is not disabled, there is an assembly error and user is one of above
|
||||||
|
/// ... => reset flag E28
|
||||||
|
wm.ErrorFlags = wm.ErrorFlags & (~(int)ErrorFlagMask.E28);
|
||||||
|
foreach (var mtr in wm.MeterTestRslts)
|
||||||
|
{
|
||||||
|
if (mtr.TestData().Evaluate && (mtr.TestData().Name == "Kontrola montaze") && (mtr.TestData().Method == "iPerlCommunication"))
|
||||||
|
{
|
||||||
|
mtr.TestDone = true;
|
||||||
|
mtr.Passed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -694,7 +722,7 @@ namespace TBF.BenchControl.Sequences
|
|||||||
log.ErrorFormat("StartInfoReader failed to read data from the database");
|
log.ErrorFormat("StartInfoReader failed to read data from the database");
|
||||||
/// TODO: Message for an operator? Error?
|
/// TODO: Message for an operator? Error?
|
||||||
}
|
}
|
||||||
else if (selection == Selection.RestoreAndFixBatch)
|
else if ((selection == Selection.RestoreAndFixBatch) && (Users.GlobalData.GetCurrentUserName() != "milan"))
|
||||||
{
|
{
|
||||||
/// Restore and fix a batch - part 2
|
/// Restore and fix a batch - part 2
|
||||||
for (int i = 0; i < BatchRslts.WaterMeters.Length; i++)
|
for (int i = 0; i < BatchRslts.WaterMeters.Length; i++)
|
||||||
@@ -829,23 +857,14 @@ namespace TBF.BenchControl.Sequences
|
|||||||
///
|
///
|
||||||
if (selection == Selection.RestOfCycle) /// ... otherwise
|
if (selection == Selection.RestOfCycle) /// ... otherwise
|
||||||
{
|
{
|
||||||
Test slctdTest = TBF.BenchControl.StateMachine.GetTest(selectedTestName, out repetNr);
|
Test slctdTest = TBF.BenchControl.StateMachine.Procedure.GetTest(selectedTestName, out selsctedTestIx, out repetNr);
|
||||||
if (slctdTest == null)
|
if (slctdTest == null || (selsctedTestIx < simultWithPurgingCount)
|
||||||
|
|| (selsctedTestIx >= StateMachine.Tests.Count - simultWithEvacuationCount))
|
||||||
{
|
{
|
||||||
|
/// Invalid test selection
|
||||||
UiBridge.Bridge.OnError(this, string.Format("No test specified"));
|
UiBridge.Bridge.OnError(this, string.Format("No test specified"));
|
||||||
goto select_cycle_or_test;
|
goto select_cycle_or_test;
|
||||||
}
|
}
|
||||||
|
|
||||||
selsctedTestIx = -1;
|
|
||||||
for (int i = simultWithPurgingCount; i < StateMachine.Tests.Count - simultWithEvacuationCount; i++)
|
|
||||||
{
|
|
||||||
if (slctdTest == StateMachine.Tests[i])
|
|
||||||
{
|
|
||||||
selsctedTestIx = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (selsctedTestIx == -1) goto select_cycle_or_test; /// goto ... when selection is not valid
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -859,8 +878,8 @@ namespace TBF.BenchControl.Sequences
|
|||||||
|
|
||||||
/// Try to fetch all test paths and transitions
|
/// Try to fetch all test paths and transitions
|
||||||
/// to detect configuration errors as early as possible.
|
/// to detect configuration errors as early as possible.
|
||||||
string errorMsg;
|
|
||||||
TBF.BenchControl.Generic.IComponent testMethodComp = TbfComponents.FindComponent(test.Method);
|
TBF.BenchControl.Generic.IComponent testMethodComp = TbfComponents.FindComponent(test.Method);
|
||||||
|
string errorMsg;
|
||||||
if (!(testMethodComp is TBF.BenchControl.TestMethods.OuterLoop.Start.Component) &&
|
if (!(testMethodComp is TBF.BenchControl.TestMethods.OuterLoop.Start.Component) &&
|
||||||
!(testMethodComp is TBF.BenchControl.TestMethods.OuterLoop.End.Component) &&
|
!(testMethodComp is TBF.BenchControl.TestMethods.OuterLoop.End.Component) &&
|
||||||
!StateMachine.GetPaths(test, (StateMachine.Procedure.MetersKind == MetersKind.HeatMeter),
|
!StateMachine.GetPaths(test, (StateMachine.Procedure.MetersKind == MetersKind.HeatMeter),
|
||||||
@@ -880,14 +899,64 @@ namespace TBF.BenchControl.Sequences
|
|||||||
int outerLoopRepeats = 0;
|
int outerLoopRepeats = 0;
|
||||||
while (currentTestIx < StateMachine.Tests.Count - simultWithEvacuationCount)
|
while (currentTestIx < StateMachine.Tests.Count - simultWithEvacuationCount)
|
||||||
{
|
{
|
||||||
Test test = StateMachine.Tests[currentTestIx];
|
|
||||||
Test nextTest = (currentTestIx + 1 < StateMachine.Tests.Count - simultWithEvacuationCount)
|
Test nextTest = (currentTestIx + 1 < StateMachine.Tests.Count - simultWithEvacuationCount)
|
||||||
? StateMachine.Tests[currentTestIx + 1]
|
? StateMachine.Tests[currentTestIx + 1]
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
/// Fetch the test paths and transitions
|
Test nextHydroTest = null;
|
||||||
string errorMsg;
|
for (int i = currentTestIx + 1; i < StateMachine.Tests.Count - simultWithEvacuationCount; i++)
|
||||||
|
{
|
||||||
|
Test tst = StateMachine.Tests[i];
|
||||||
|
if (tst != null)
|
||||||
|
{
|
||||||
|
ITestMethod tm = TbfComponents.FindComponent(tst.Method) as ITestMethod;
|
||||||
|
if (tm != null && tm.DoTransitions())
|
||||||
|
{
|
||||||
|
nextHydroTest = tst;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nextHydroTest != null)
|
||||||
|
{
|
||||||
|
/// Fetch paths and 'transition before' of the next test
|
||||||
|
TBF.BenchControl.Generic.IComponent nextTestMethodComp = TbfComponents.FindComponent(nextHydroTest.Method);
|
||||||
|
TransitionSequence dummy2, dummy3;
|
||||||
|
string errorMsg2;
|
||||||
|
if (!(nextTestMethodComp is TBF.BenchControl.TestMethods.OuterLoop.Start.Component) &&
|
||||||
|
!(nextTestMethodComp is TBF.BenchControl.TestMethods.OuterLoop.End.Component) &&
|
||||||
|
!StateMachine.GetPaths(nextHydroTest, (StateMachine.Procedure.MetersKind == MetersKind.HeatMeter),
|
||||||
|
out nextInPath, out nextBenchPath, out nextOutPath, out nextSensPath,
|
||||||
|
out nextHeatMetersPath,
|
||||||
|
out nextTransitionBefore, out dummy2, out dummy3,
|
||||||
|
out errorMsg2))
|
||||||
|
{
|
||||||
|
UiBridge.Bridge.OnError(this, errorMsg2);
|
||||||
|
goto select_cycle_or_test;
|
||||||
|
}
|
||||||
|
|
||||||
|
nextQfrom = nextHydroTest.Qfrom;
|
||||||
|
nextQto = nextHydroTest.Qto;
|
||||||
|
nextPumpPower = nextHydroTest.PumpPower;
|
||||||
|
nextTolerRed = nextHydroTest.TolerRed;
|
||||||
|
nextPidCoef = (nextOutPath != null) ? nextOutPath.PidCoef : 1.0F;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/// Clear paths and 'transition before' of the next test it does not exist
|
||||||
|
nextInPath = null;
|
||||||
|
nextBenchPath = null;
|
||||||
|
nextOutPath = null;
|
||||||
|
nextSensPath = null;
|
||||||
|
nextHeatMetersPath = null;
|
||||||
|
nextTransitionBefore = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Fetch paths and transitions of this test
|
||||||
|
Test test = StateMachine.Tests[currentTestIx];
|
||||||
TBF.BenchControl.Generic.IComponent testMethodComp = TbfComponents.FindComponent(test.Method);
|
TBF.BenchControl.Generic.IComponent testMethodComp = TbfComponents.FindComponent(test.Method);
|
||||||
|
string errorMsg;
|
||||||
if (!(testMethodComp is TBF.BenchControl.TestMethods.OuterLoop.Start.Component) &&
|
if (!(testMethodComp is TBF.BenchControl.TestMethods.OuterLoop.Start.Component) &&
|
||||||
!(testMethodComp is TBF.BenchControl.TestMethods.OuterLoop.End.Component) &&
|
!(testMethodComp is TBF.BenchControl.TestMethods.OuterLoop.End.Component) &&
|
||||||
!StateMachine.GetPaths(test, (StateMachine.Procedure.MetersKind == MetersKind.HeatMeter),
|
!StateMachine.GetPaths(test, (StateMachine.Procedure.MetersKind == MetersKind.HeatMeter),
|
||||||
@@ -901,9 +970,12 @@ namespace TBF.BenchControl.Sequences
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Update format for the water mass
|
/// Update format for the water mass
|
||||||
|
if (outPath != null && outPath.Scale != null && !string.IsNullOrEmpty(outPath.Scale.Format))
|
||||||
|
{
|
||||||
Mass.Format = outPath.Scale.Format;
|
Mass.Format = outPath.Scale.Format;
|
||||||
StartMass.Format = outPath.Scale.Format;
|
StartMass.Format = outPath.Scale.Format;
|
||||||
EndMass.Format = outPath.Scale.Format;
|
EndMass.Format = outPath.Scale.Format;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ITestMethod testMethod = testMethodComp as ITestMethod;
|
ITestMethod testMethod = testMethodComp as ITestMethod;
|
||||||
@@ -915,6 +987,9 @@ namespace TBF.BenchControl.Sequences
|
|||||||
}
|
}
|
||||||
|
|
||||||
StateMachine.LoadTestParams(test);
|
StateMachine.LoadTestParams(test);
|
||||||
|
|
||||||
|
if ((sensPath != null) && (sensPath.RegisterReaders != null))
|
||||||
|
{
|
||||||
ProcessData.RegisterReaders = sensPath.RegisterReaders;
|
ProcessData.RegisterReaders = sensPath.RegisterReaders;
|
||||||
foreach (var rr in sensPath.RegisterReaders)
|
foreach (var rr in sensPath.RegisterReaders)
|
||||||
{
|
{
|
||||||
@@ -923,6 +998,11 @@ namespace TBF.BenchControl.Sequences
|
|||||||
(rr as TestMethods.iPerlCommunication.iPerlHead.IperlHead).BenchName = BenchInfo.TestBenchName;
|
(rr as TestMethods.iPerlCommunication.iPerlHead.IperlHead).BenchName = BenchInfo.TestBenchName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ProcessData.RegisterReaders = null;
|
||||||
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Execute one test (single repetition of a repeated test)
|
/// Execute one test (single repetition of a repeated test)
|
||||||
@@ -989,7 +1069,10 @@ namespace TBF.BenchControl.Sequences
|
|||||||
if (testMethod.DoTransitions() && !e.Contains(Event.RecoverableError))
|
if (testMethod.DoTransitions() && !e.Contains(Event.RecoverableError))
|
||||||
{
|
{
|
||||||
/// Make a transition after the last test repetition
|
/// Make a transition after the last test repetition
|
||||||
TransitionContext endContext = currentTestFinished ? TransitionContext.AfterTest : TransitionContext.Stop;
|
TransitionContext endContext =
|
||||||
|
!currentTestFinished ? TransitionContext.Stop
|
||||||
|
: ((nextTransitionBefore != null) && (nextTransitionBefore.Name.ToLower().Contains("fastflow"))) ? TransitionContext.AfterTestWithOverlap
|
||||||
|
: TransitionContext.AfterTest;
|
||||||
rsltTransAfter = Transition(transitionAfter, endContext); /// Transition or SetRoute - end of test
|
rsltTransAfter = Transition(transitionAfter, endContext); /// Transition or SetRoute - end of test
|
||||||
log.InfoFormat("Test {0}: Transition({1}, {2}) returned {3}", test.Name, (transitionAfter == null ? "null" : transitionAfter.Name), endContext, rsltTransAfter);
|
log.InfoFormat("Test {0}: Transition({1}, {2}) returned {3}", test.Name, (transitionAfter == null ? "null" : transitionAfter.Name), endContext, rsltTransAfter);
|
||||||
}
|
}
|
||||||
@@ -1070,14 +1153,21 @@ namespace TBF.BenchControl.Sequences
|
|||||||
if (testMethod != null && testMethod.CanTest(StateMachine.Procedure.MetersKind))
|
if (testMethod != null && testMethod.CanTest(StateMachine.Procedure.MetersKind))
|
||||||
{
|
{
|
||||||
StateMachine.LoadTestParams(dfrrdData.Test);
|
StateMachine.LoadTestParams(dfrrdData.Test);
|
||||||
ProcessData.RegisterReaders = sensPath.RegisterReaders;
|
|
||||||
|
|
||||||
|
if ((sensPath != null) && (sensPath.RegisterReaders != null))
|
||||||
|
{
|
||||||
|
ProcessData.RegisterReaders = sensPath.RegisterReaders;
|
||||||
foreach (var rr in sensPath.RegisterReaders)
|
foreach (var rr in sensPath.RegisterReaders)
|
||||||
{
|
{
|
||||||
if ((rr is TestMethods.iPerlCommunication.iPerlHead.IperlHead) && (BenchInfo != null))
|
if ((rr is TestMethods.iPerlCommunication.iPerlHead.IperlHead) && (BenchInfo != null))
|
||||||
{
|
{
|
||||||
(rr as TestMethods.iPerlCommunication.iPerlHead.IperlHead).BenchName = BenchInfo.TestBenchName;
|
(rr as TestMethods.iPerlCommunication.iPerlHead.IperlHead).BenchName = BenchInfo.TestBenchName;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ProcessData.RegisterReaders = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
e = testMethod.Execute2ndPass(dfrrdData.Test, dfrrdData.RepetNr, dfrrdData.IntermediateData);
|
e = testMethod.Execute2ndPass(dfrrdData.Test, dfrrdData.RepetNr, dfrrdData.IntermediateData);
|
||||||
@@ -1097,7 +1187,8 @@ namespace TBF.BenchControl.Sequences
|
|||||||
/// Single test will be executed
|
/// Single test will be executed
|
||||||
|
|
||||||
int repetNr;
|
int repetNr;
|
||||||
Test test = TBF.BenchControl.StateMachine.GetTest(selectedTestName, out repetNr);
|
int testIx;
|
||||||
|
Test test = TBF.BenchControl.StateMachine.Procedure.GetTest(selectedTestName, out testIx, out repetNr);
|
||||||
if (test == null)
|
if (test == null)
|
||||||
{
|
{
|
||||||
UiBridge.Bridge.OnError(this, string.Format("No test specified"));
|
UiBridge.Bridge.OnError(this, string.Format("No test specified"));
|
||||||
@@ -1128,8 +1219,10 @@ namespace TBF.BenchControl.Sequences
|
|||||||
if (testMethod != null && testMethod.CanTest(StateMachine.Procedure.MetersKind))
|
if (testMethod != null && testMethod.CanTest(StateMachine.Procedure.MetersKind))
|
||||||
{
|
{
|
||||||
StateMachine.LoadTestParams(test);
|
StateMachine.LoadTestParams(test);
|
||||||
ProcessData.RegisterReaders = sensPath.RegisterReaders;
|
|
||||||
|
|
||||||
|
if ((sensPath != null) && (sensPath.RegisterReaders != null))
|
||||||
|
{
|
||||||
|
ProcessData.RegisterReaders = sensPath.RegisterReaders;
|
||||||
foreach (var rr in sensPath.RegisterReaders)
|
foreach (var rr in sensPath.RegisterReaders)
|
||||||
{
|
{
|
||||||
if ((rr is TestMethods.iPerlCommunication.iPerlHead.IperlHead) && (BenchInfo != null))
|
if ((rr is TestMethods.iPerlCommunication.iPerlHead.IperlHead) && (BenchInfo != null))
|
||||||
@@ -1137,6 +1230,11 @@ namespace TBF.BenchControl.Sequences
|
|||||||
(rr as TestMethods.iPerlCommunication.iPerlHead.IperlHead).BenchName = BenchInfo.TestBenchName;
|
(rr as TestMethods.iPerlCommunication.iPerlHead.IperlHead).BenchName = BenchInfo.TestBenchName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ProcessData.RegisterReaders = null;
|
||||||
|
}
|
||||||
|
|
||||||
Event rsltTransBefore = Event.Done;
|
Event rsltTransBefore = Event.Done;
|
||||||
Event rsltTransAfter = Event.Done;
|
Event rsltTransAfter = Event.Done;
|
||||||
|
|||||||
@@ -68,6 +68,21 @@ namespace TBF.BenchControl.Sequences
|
|||||||
protected static TransitionSequence transitionBetween;
|
protected static TransitionSequence transitionBetween;
|
||||||
protected static TransitionSequence transitionAfter;
|
protected static TransitionSequence transitionAfter;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Advanced information about the next test
|
||||||
|
/// </summary>
|
||||||
|
protected static BenchControl.FeedingPath nextInPath;
|
||||||
|
protected static BenchControl.BenchPath nextBenchPath;
|
||||||
|
protected static BenchControl.OutputPath nextOutPath;
|
||||||
|
protected static BenchControl.MetersPath nextSensPath;
|
||||||
|
protected static BenchControl.HeatMetersPath nextHeatMetersPath;
|
||||||
|
protected static TransitionSequence nextTransitionBefore;
|
||||||
|
protected static float nextQfrom;
|
||||||
|
protected static float nextQto;
|
||||||
|
protected static float nextPumpPower;
|
||||||
|
protected static float nextPidCoef;
|
||||||
|
protected static double nextTolerRed;
|
||||||
|
|
||||||
|
|
||||||
protected IOperation readRegistersOp;
|
protected IOperation readRegistersOp;
|
||||||
protected IOperation queryEnd1;
|
protected IOperation queryEnd1;
|
||||||
@@ -439,9 +454,10 @@ namespace TBF.BenchControl.Sequences
|
|||||||
public enum TransitionContext
|
public enum TransitionContext
|
||||||
{
|
{
|
||||||
PurgeBegin,
|
PurgeBegin,
|
||||||
BeforeTest,
|
BeforeTest, /// Before starting a test, paths are always applied aftr this sequence
|
||||||
BetweenTests,
|
BetweenTests, /// Between two repetitions of the same test
|
||||||
AfterTest,
|
AfterTest, /// After completing a test
|
||||||
|
AfterTestWithOverlap, /// After completing transition sequence paths of the next test are selected and flow setting starts
|
||||||
PurgeEnd,
|
PurgeEnd,
|
||||||
Stop,
|
Stop,
|
||||||
}
|
}
|
||||||
@@ -482,7 +498,12 @@ namespace TBF.BenchControl.Sequences
|
|||||||
case TransitionContext.PurgeBegin: message = Strings.Purging_i_n; break;
|
case TransitionContext.PurgeBegin: message = Strings.Purging_i_n; break;
|
||||||
case TransitionContext.BeforeTest: message = Strings.Test_start_sequence_i_n; break;
|
case TransitionContext.BeforeTest: message = Strings.Test_start_sequence_i_n; break;
|
||||||
case TransitionContext.BetweenTests: message = Strings.Between_tests_sequence_i_n; break;
|
case TransitionContext.BetweenTests: message = Strings.Between_tests_sequence_i_n; break;
|
||||||
case TransitionContext.AfterTest: message = Strings.Test_stop_sequence_i_n; break;
|
|
||||||
|
case TransitionContext.AfterTestWithOverlap:
|
||||||
|
case TransitionContext.AfterTest:
|
||||||
|
message = Strings.Test_stop_sequence_i_n;
|
||||||
|
break;
|
||||||
|
|
||||||
case TransitionContext.PurgeEnd: message = Strings.Emptying_i_n; break;
|
case TransitionContext.PurgeEnd: message = Strings.Emptying_i_n; break;
|
||||||
case TransitionContext.Stop: message = Strings.Test_stop_sequence_i_n; break;
|
case TransitionContext.Stop: message = Strings.Test_stop_sequence_i_n; break;
|
||||||
default: message = "Transition"; break;
|
default: message = "Transition"; break;
|
||||||
@@ -490,13 +511,13 @@ namespace TBF.BenchControl.Sequences
|
|||||||
|
|
||||||
if (transitionSequence == null)
|
if (transitionSequence == null)
|
||||||
{
|
{
|
||||||
log.WarnFormat("Transition(null, context={0})", context);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// No transition sequence defined --> Default action
|
/// No transition sequence defined --> Default action
|
||||||
///
|
///
|
||||||
if (context == TransitionContext.AfterTest)
|
if ((context == TransitionContext.AfterTest) || (context == TransitionContext.AfterTestWithOverlap))
|
||||||
{
|
{
|
||||||
|
log.WarnFormat("Transition(null, context={0}), turning FM pump off and setting valves to defaults", context);
|
||||||
|
|
||||||
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOff();
|
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOff();
|
||||||
|
|
||||||
State.Create("SequenceBase : Transition : TestEnd - Default action")
|
State.Create("SequenceBase : Transition : TestEnd - Default action")
|
||||||
@@ -516,7 +537,7 @@ namespace TBF.BenchControl.Sequences
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
///
|
///
|
||||||
/// Fetch and execute the transition sequence
|
/// Fetch and execute the transition sequence, it is guaranteed (transitionSequence != null)
|
||||||
///
|
///
|
||||||
IList<TransitionStep> transitionSteps = new List<TransitionStep>();
|
IList<TransitionStep> transitionSteps = new List<TransitionStep>();
|
||||||
if (StateMachine.TransitionSteps != null)
|
if (StateMachine.TransitionSteps != null)
|
||||||
@@ -680,7 +701,8 @@ namespace TBF.BenchControl.Sequences
|
|||||||
for (int first = 1; first <= lastStartedRV; first++)
|
for (int first = 1; first <= lastStartedRV; first++)
|
||||||
{
|
{
|
||||||
log.DebugFormat("SequenceBase.Transition() : Step {0} stop, opening={1}, closing={2}", step.ItemNr + 1, step.ValvesOpen, step.ValvesClose);
|
log.DebugFormat("SequenceBase.Transition() : Step {0} stop, opening={1}, closing={2}", step.ItemNr + 1, step.ValvesOpen, step.ValvesClose);
|
||||||
State stepStop = State.Create(string.Format("SequenceBase.Transition() : Step {0} stop, opening={1}, closing={2}", step.ItemNr + 1, step.ValvesOpen, step.ValvesClose))
|
State stepStop = State
|
||||||
|
.Create(string.Format("SequenceBase.Transition() : Step {0} stop, opening={1}, closing={2}", step.ItemNr + 1, step.ValvesOpen, step.ValvesClose))
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(conditionOperation)
|
.AddOperation(conditionOperation)
|
||||||
.AddOperation(new MettlerToledo.KeepReadingMassesOp())
|
.AddOperation(new MettlerToledo.KeepReadingMassesOp())
|
||||||
@@ -707,6 +729,9 @@ namespace TBF.BenchControl.Sequences
|
|||||||
///
|
///
|
||||||
if (context == TransitionContext.Stop || errorFlag || stopFlag)
|
if (context == TransitionContext.Stop || errorFlag || stopFlag)
|
||||||
{
|
{
|
||||||
|
log.ErrorFormat("Transition({0}, context={1}) errorFlag={2} stopFlag={3} ... stoppng all pumps off",
|
||||||
|
(transitionSequence != null) ? transitionSequence.Name : "null", context, errorFlag, stopFlag);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// On error or when STOP pressed
|
/// On error or when STOP pressed
|
||||||
///
|
///
|
||||||
@@ -714,14 +739,14 @@ namespace TBF.BenchControl.Sequences
|
|||||||
|
|
||||||
if (inPath != null)
|
if (inPath != null)
|
||||||
{
|
{
|
||||||
|
///
|
||||||
/// Stop the pump
|
/// Stop the pump
|
||||||
///
|
///
|
||||||
State.Create("SequenceBase.Transition() : Test stopped -> Stopping the pump")
|
State.Create("SequenceBase.Transition() : Test stopped -> Stopping the pump")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, inPath.Pump))
|
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, inPath.Pump))
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do
|
do {
|
||||||
{
|
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
if (e.Contains(Event.Error)) return Event.Error;
|
if (e.Contains(Event.Error)) return Event.Error;
|
||||||
}
|
}
|
||||||
@@ -730,6 +755,11 @@ namespace TBF.BenchControl.Sequences
|
|||||||
}
|
}
|
||||||
else if (context == TransitionContext.BeforeTest)
|
else if (context == TransitionContext.BeforeTest)
|
||||||
{
|
{
|
||||||
|
log.WarnFormat("Transition(any, context={0}), setting the required route before a test", context);
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Always set route at the beginning of this test
|
||||||
|
///
|
||||||
if (inPath != null && benchPath != null && outPath != null)
|
if (inPath != null && benchPath != null && outPath != null)
|
||||||
{
|
{
|
||||||
State.Create("SequenceBase : Transition : TestStart - Default action")
|
State.Create("SequenceBase : Transition : TestStart - Default action")
|
||||||
@@ -739,8 +769,7 @@ namespace TBF.BenchControl.Sequences
|
|||||||
.SetValvesOp(GenericDevices.ValveBase.Merge(inPath.ValvesOpen, benchPath.ValvesOpen, outPath.ValvesOpen),
|
.SetValvesOp(GenericDevices.ValveBase.Merge(inPath.ValvesOpen, benchPath.ValvesOpen, outPath.ValvesOpen),
|
||||||
GenericDevices.ValveBase.Merge(inPath.ValvesClose, benchPath.ValvesClose, outPath.ValvesClose)))
|
GenericDevices.ValveBase.Merge(inPath.ValvesClose, benchPath.ValvesClose, outPath.ValvesClose)))
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do
|
do {
|
||||||
{
|
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
if (e.Contains(Event.Error)) return Event.Error;
|
if (e.Contains(Event.Error)) return Event.Error;
|
||||||
if (TestAndLogUiCmdStop(e)) return Event.UiCmdStop;
|
if (TestAndLogUiCmdStop(e)) return Event.UiCmdStop;
|
||||||
@@ -748,7 +777,55 @@ namespace TBF.BenchControl.Sequences
|
|||||||
while (e.Contains(Event.ValvesBusy));
|
while (e.Contains(Event.ValvesBusy));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if ((context == TransitionContext.AfterTestWithOverlap) && (nextInPath != null) && (nextBenchPath != null) && (nextOutPath != null))
|
||||||
|
{
|
||||||
|
log.WarnFormat("Transition(., context={0}), overlapped action (next flow regulation)", context);
|
||||||
|
|
||||||
|
/// Set route for the next test
|
||||||
|
State.Create("SequenceBase : AfterTestWithOverlap : Default action")
|
||||||
|
.AddOperation(checkUiOp)
|
||||||
|
.AddOperation(new MettlerToledo.KeepReadingMassesOp())
|
||||||
|
.AddOperation(StateMachine.ControlBoard
|
||||||
|
.SetValvesOp(GenericDevices.ValveBase.Merge(nextInPath.ValvesOpen, nextBenchPath.ValvesOpen, nextOutPath.ValvesOpen),
|
||||||
|
GenericDevices.ValveBase.Merge(nextInPath.ValvesClose, nextBenchPath.ValvesClose, nextOutPath.ValvesClose)))
|
||||||
|
.EnterState();
|
||||||
|
do {
|
||||||
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
if (e.Contains(Event.Error)) return Event.Error;
|
||||||
|
if (TestAndLogUiCmdStop(e)) return Event.UiCmdStop;
|
||||||
|
}
|
||||||
|
while (e.Contains(Event.ValvesBusy));
|
||||||
|
|
||||||
|
|
||||||
|
/// Set PID coefficient, etc.
|
||||||
|
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||||
|
StateMachine.ControlBoard.SetFiltersPidShortPulses(filters, nextPidCoef, (nextTolerRed == 0) ? 0 : 1);
|
||||||
|
|
||||||
|
/// Set pump power
|
||||||
|
if (nextInPath.Pump is GenericDevices.IPumpFM) (nextInPath.Pump as GenericDevices.IPumpFM).TurnOn(nextPumpPower);
|
||||||
|
|
||||||
|
//------------------------------------------------
|
||||||
|
Bridge.OnActivity(this, Strings.Setting_the_flow);
|
||||||
|
//------------------------------------------------
|
||||||
|
/// Set flow for the next test
|
||||||
|
State.Create(string.Format("SequenceBase : AfterTestWithOverlap - Setting the flow to {0} - {1} m3/h", nextQfrom, nextQto))
|
||||||
|
.AddOperation(checkUiOp)
|
||||||
|
.AddOperation(new MettlerToledo.KeepReadingMassesOp())
|
||||||
|
.AddOperation(nextOutPath.RegulValve.SetFlowAndMeasureOp(nextOutPath.FlowMeter, nextQfrom, nextQto, RefFlow, FlowSettingTimeoutSec, 0))
|
||||||
|
.EnterState();
|
||||||
|
do {
|
||||||
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
|
if (e.Contains(Event.OpArgumentError)) return Event.Error;
|
||||||
|
if (TestAndLogUiCmdStop(e)) return Event.UiCmdStop;
|
||||||
|
if (e.Contains(Event.RegulValveTimeOut))
|
||||||
|
{
|
||||||
|
Bridge.OnError(this, Strings.Flow_adjustment_failed);
|
||||||
|
return Event.UiCmdStop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (!e.Contains(Event.Busy) && !e.Contains(Event.FlowReached));
|
||||||
|
}
|
||||||
|
|
||||||
if (errorFlag)
|
if (errorFlag)
|
||||||
return Event.Error;
|
return Event.Error;
|
||||||
@@ -866,6 +943,114 @@ namespace TBF.BenchControl.Sequences
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected Event SetFlowEtc(Test test, IFlowMeter flowMeter, IRegulValve regulValve, IValve pump, IValve stopBFValve, IList<IOperation> extraOperations, bool doNotWait)
|
||||||
|
{
|
||||||
|
IList<Event> e;
|
||||||
|
Event retVal = Event.Done;
|
||||||
|
|
||||||
|
if (pump is GenericDevices.IPumpFM) (pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
|
||||||
|
///
|
||||||
|
State.Create(string.Format("{0}({1}) : Starting the pump", test.Method, test.Name))
|
||||||
|
.AddOperation(checkUiOp)
|
||||||
|
.AddOperations(extraOperations)
|
||||||
|
.AddOperation(pump != null ? StateMachine.ControlBoard.SetValvesOp(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(e)) return Event.UiCmdStop;
|
||||||
|
if (e.Contains(Event.Error)) return Event.Error;
|
||||||
|
}
|
||||||
|
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))
|
||||||
|
.AddOperations(extraOperations)
|
||||||
|
.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(e)) return Event.UiCmdStop;
|
||||||
|
}
|
||||||
|
while (!e.Contains(Event.TimerExpired));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (stopBFValve != null)
|
||||||
|
{
|
||||||
|
State.Create(string.Format("{0}({1}) : Opening the stop backflow valve", test.Method, test.Name))
|
||||||
|
.AddOperation(checkUiOp)
|
||||||
|
.AddOperation(StateMachine.ControlBoard.SetValvesOp(stopBFValve, null))
|
||||||
|
.AddOperations(extraOperations)
|
||||||
|
.EnterState();
|
||||||
|
do
|
||||||
|
{
|
||||||
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
if (TestAndLogUiCmdStop(e)) return Event.UiCmdStop;
|
||||||
|
if (e.Contains(Event.Error)) return Event.Error;
|
||||||
|
}
|
||||||
|
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))
|
||||||
|
.AddOperations(extraOperations)
|
||||||
|
.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(e)) return Event.UiCmdStop;
|
||||||
|
}
|
||||||
|
while (!e.Contains(Event.TimerExpired));
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------
|
||||||
|
Bridge.OnActivity(this, Strings.Setting_the_flow);
|
||||||
|
//------------------------------------------------
|
||||||
|
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
|
||||||
|
.AddOperation(checkUiOp)
|
||||||
|
.AddOperation(doNotWait ? regulValve.SetFlowAndMeasureOp(flowMeter, test.Qfrom, test.Qto, RefFlow, FlowSettingTimeoutSec, 0)
|
||||||
|
: regulValve.SetFlowOp(flowMeter, test.Qfrom, test.Qto, RefFlow, FlowSettingTimeoutSec))
|
||||||
|
.AddOperations(extraOperations)
|
||||||
|
.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)) return Event.OpArgumentError;
|
||||||
|
if (TestAndLogUiCmdStop(e)) return Event.UiCmdStop;
|
||||||
|
if (e.Contains(Event.RegulValveTimeOut))
|
||||||
|
{
|
||||||
|
Bridge.OnError(this, Strings.Flow_adjustment_failed);
|
||||||
|
return Event.RecoverableError;
|
||||||
|
}
|
||||||
|
if (e.Contains(Event.Next)) return Event.Done;
|
||||||
|
}
|
||||||
|
while (!(e.Contains(Event.FlowReached) || (doNotWait && e.Contains(Event.Busy)))); /// Stay in the loop while e.Contains(Event.Starting)
|
||||||
|
|
||||||
|
return retVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Main loop where measurements are collected.
|
/// Main loop where measurements are collected.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1638,7 +1823,7 @@ namespace TBF.BenchControl.Sequences
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true and makes a log when 'e' contains Event.UiCmdStop
|
/// Returns true and makes a log when 'e' contains Event.UiCmdStop
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="test"></param>
|
/// <param name="test">test or null (only for logs)</param>
|
||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
protected bool TestAndLogUiCmdStop(Test test, IList<Event> e)
|
protected bool TestAndLogUiCmdStop(Test test, IList<Event> e)
|
||||||
|
|||||||
@@ -575,31 +575,6 @@ namespace TBF.BenchControl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Processes the selection done by the bench control panel in the main sequence.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="selection">Selection.Q1, .Q2, .Q3 or .Test</param>
|
|
||||||
/// <returns>The selected test or null</returns>
|
|
||||||
public static Config.Entities.Test GetTest(string selectedTestName, out int repetNr)
|
|
||||||
{
|
|
||||||
repetNr = 1;
|
|
||||||
foreach (var test in Tests)
|
|
||||||
{
|
|
||||||
if (test.Name.Equals(selectedTestName)) return test; /// Test name specified, keep repetNr = 1
|
|
||||||
|
|
||||||
for (int i = 1; i <= test.Repeats; i++)
|
|
||||||
{
|
|
||||||
if (Utils.TestTitle(test, i).Equals(selectedTestName))
|
|
||||||
{
|
|
||||||
repetNr = i;
|
|
||||||
return test;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called from the sequence to update paths based on the selected test
|
/// Called from the sequence to update paths based on the selected test
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -624,6 +599,9 @@ namespace TBF.BenchControl
|
|||||||
out TransitionSequence transitionAfter,
|
out TransitionSequence transitionAfter,
|
||||||
out string errorMsg)
|
out string errorMsg)
|
||||||
{
|
{
|
||||||
|
ITestMethod tm = TbfComponents.FindComponent(test.Method) as ITestMethod;
|
||||||
|
bool isHydroTest = (tm != null) ? tm.DoTransitions() : false;
|
||||||
|
|
||||||
pfeed = null;
|
pfeed = null;
|
||||||
pben = null;
|
pben = null;
|
||||||
pout = null;
|
pout = null;
|
||||||
@@ -649,13 +627,14 @@ namespace TBF.BenchControl
|
|||||||
|
|
||||||
pmtrs = GetMetersPath(test);
|
pmtrs = GetMetersPath(test);
|
||||||
|
|
||||||
if (pfeed == null) errorMsg = Strings.Cannot_load_feeding_path;
|
if (isHydroTest && (pfeed == null)) errorMsg = Strings.Cannot_load_feeding_path;
|
||||||
else if (pben == null) errorMsg = Strings.Cannot_load_bench_path;
|
else if (isHydroTest && (pben == null)) errorMsg = Strings.Cannot_load_bench_path;
|
||||||
else if (pout == null) errorMsg = Strings.Cannot_load_output_path;
|
else if (isHydroTest && (pout == null)) errorMsg = Strings.Cannot_load_output_path;
|
||||||
else if (pmtrs == null) errorMsg = Strings.Cannot_load_sensor_path;
|
else if (pmtrs == null) errorMsg = Strings.Cannot_load_sensor_path;
|
||||||
else errorMsg = string.Empty;
|
else errorMsg = string.Empty;
|
||||||
if ((pfeed == null) || (pben == null) || (pout == null) || (pmtrs == null))
|
if ((isHydroTest && (pfeed == null || pben == null || pout == null)) || (pmtrs == null))
|
||||||
{
|
{
|
||||||
|
log.ErrorFormat("GetPaths({0},...) returns false, wrong configuration", test.Name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -667,6 +646,7 @@ namespace TBF.BenchControl
|
|||||||
#endif
|
#endif
|
||||||
if (heatMetersPathRequired && phmtrs == null)
|
if (heatMetersPathRequired && phmtrs == null)
|
||||||
{
|
{
|
||||||
|
log.ErrorFormat("GetPaths({0},...) returns false, missing heat meters sensors", test.Name);
|
||||||
errorMsg = "Cannot load heat meters sensors";
|
errorMsg = "Cannot load heat meters sensors";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -678,18 +658,21 @@ namespace TBF.BenchControl
|
|||||||
if (tr.Name == test.TransitionAfter) transitionAfter = tr;
|
if (tr.Name == test.TransitionAfter) transitionAfter = tr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pout.Scale == null)
|
if (isHydroTest && pout.Scale == null)
|
||||||
{
|
{
|
||||||
|
log.ErrorFormat("GetPaths({0},...) returns false, missing scales in output path {1}", test.Name, test.OutputPath);
|
||||||
errorMsg = string.Format("No balance specified in path {0}", test.OutputPath);
|
errorMsg = string.Format("No balance specified in path {0}", test.OutputPath);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Program.LocalSettings.RealDensity < 500.0f || Program.LocalSettings.RealDensity > 2000.0f)
|
if (Program.LocalSettings.RealDensity < 500.0f || Program.LocalSettings.RealDensity > 2000.0f)
|
||||||
{
|
{
|
||||||
|
log.ErrorFormat("GetPaths({0},...) returns false, density was not specified", test.Name);
|
||||||
errorMsg = string.Format("Density was not specified");
|
errorMsg = string.Format("Density was not specified");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.WarnFormat("GetPaths({0},...) returns true, paths loaded OK, isHydroTest={1}", test.Name, isHydroTest);
|
||||||
errorMsg = string.Empty;
|
errorMsg = string.Empty;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,17 +56,20 @@ namespace TBF.BenchControl
|
|||||||
Factories.Add(new TestMethods.CombinedWithDetection.TestMethodFactory());
|
Factories.Add(new TestMethods.CombinedWithDetection.TestMethodFactory());
|
||||||
Factories.Add(new TestMethods.Counter.Factory());
|
Factories.Add(new TestMethods.Counter.Factory());
|
||||||
Factories.Add(new TestMethods.DiverterTest.Factory());
|
Factories.Add(new TestMethods.DiverterTest.Factory());
|
||||||
|
Factories.Add(new TestMethods.Dummy.Factory());
|
||||||
Factories.Add(new TestMethods.Endurance.Factory());
|
Factories.Add(new TestMethods.Endurance.Factory());
|
||||||
Factories.Add(new TestMethods.FixedStart.Single.Factory());
|
Factories.Add(new TestMethods.FixedStart.Single.Factory());
|
||||||
Factories.Add(new TestMethods.FixedStart.Compound.Factory());
|
Factories.Add(new TestMethods.FixedStart.Compound.Factory());
|
||||||
Factories.Add(new TestMethods.FixedStart.HeatMeters.Factory());
|
Factories.Add(new TestMethods.FixedStart.HeatMeters.Factory());
|
||||||
Factories.Add(new TestMethods.FixedStartAdvanced.Single.Factory());
|
Factories.Add(new TestMethods.FixedStartDeferredEval.Single.Factory());
|
||||||
Factories.Add(new TestMethods.FixedStartDeferredEvaluation.Single.Factory());
|
Factories.Add(new TestMethods.FixedStartDeferredEval.Compound.Factory());
|
||||||
Factories.Add(new TestMethods.FixedStartDeferredEvaluation.Compound.Factory());
|
Factories.Add(new TestMethods.FixedStartDeferredEval.HeatMeters.Factory());
|
||||||
Factories.Add(new TestMethods.FixedStartDeferredEvaluation.HeatMeters.Factory());
|
|
||||||
Factories.Add(new TestMethods.FixedStartMassCollection.Single.Factory());
|
Factories.Add(new TestMethods.FixedStartMassCollection.Single.Factory());
|
||||||
Factories.Add(new TestMethods.FixedStartMassCollection.Compound.Factory());
|
Factories.Add(new TestMethods.FixedStartMassCollection.Compound.Factory());
|
||||||
Factories.Add(new TestMethods.FixedStartMassCollection.HeatMeters.Factory());
|
Factories.Add(new TestMethods.FixedStartMassCollection.HeatMeters.Factory());
|
||||||
|
Factories.Add(new TestMethods.FixedStartMassCollDeferredEval.Single.Factory());
|
||||||
|
Factories.Add(new TestMethods.FixedStartMassCollDeferredEval.Compound.Factory());
|
||||||
|
Factories.Add(new TestMethods.FixedStartMassCollDeferredEval.HeatMeters.Factory());
|
||||||
Factories.Add(new TestMethods.FixedStartTankCollection.Single.Factory());
|
Factories.Add(new TestMethods.FixedStartTankCollection.Single.Factory());
|
||||||
Factories.Add(new TestMethods.FixedStartTankCollection.Compound.Factory());
|
Factories.Add(new TestMethods.FixedStartTankCollection.Compound.Factory());
|
||||||
Factories.Add(new TestMethods.FlyingStart.Single.Factory());
|
Factories.Add(new TestMethods.FlyingStart.Single.Factory());
|
||||||
|
|||||||
@@ -402,10 +402,12 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
tstRslt.FlowSetTime = flowSetTime;
|
tstRslt.FlowSetTime = flowSetTime;
|
||||||
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
|
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
|
||||||
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
|
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
|
||||||
|
tstRslt.MassStartRaw = 0;
|
||||||
tstRslt.MassStart = 0;
|
tstRslt.MassStart = 0;
|
||||||
|
tstRslt.MassEndRaw = 0;
|
||||||
tstRslt.MassEnd = 0;
|
tstRslt.MassEnd = 0;
|
||||||
tstRslt.FlowMass = 0; /// [kg/h]
|
tstRslt.FlowMass = 0; /// [kg/h]
|
||||||
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * cBrd.EtPulses(0) / tstRslt.TestTime; /// [m3/h]
|
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
|
||||||
tstRslt.Buoyancy = Config.Formulas.Buoyancy();
|
tstRslt.Buoyancy = Config.Formulas.Buoyancy();
|
||||||
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
|
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
|
||||||
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
|
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -15,6 +15,8 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
{
|
{
|
||||||
private static readonly ILog log = LogManager.GetLogger(typeof(WMErrorsForm));
|
private static readonly ILog log = LogManager.GetLogger(typeof(WMErrorsForm));
|
||||||
|
|
||||||
|
const int MaxWMsCount = 6; /// Implementation limit of this form
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Updated in constructor
|
/// Updated in constructor
|
||||||
///
|
///
|
||||||
@@ -43,13 +45,16 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
public WMErrorsForm(IList<GenericDevices.IWaterMeter> waterMeters)
|
public WMErrorsForm(IList<GenericDevices.IWaterMeter> waterMeters)
|
||||||
: this()
|
: this()
|
||||||
{
|
{
|
||||||
waterMetersCount = waterMeters.Count;
|
waterMetersCount = Math.Min(Config.Data.WMsCount, waterMeters.Count);
|
||||||
|
|
||||||
rects = new Rectangle[waterMetersCount];
|
rects = new Rectangle[waterMetersCount];
|
||||||
for (int i = 0; i < waterMetersCount; i++) rects[i] = new Rectangle(385, 30 + 90 * i, 324, 57);
|
for (int i = 0; i < waterMetersCount; i++) rects[i] = new Rectangle(385, 30 + 90 * i, 324, 57);
|
||||||
|
|
||||||
disabled = new bool[waterMetersCount];
|
disabled = new bool[waterMetersCount];
|
||||||
for (int i = 0; i < waterMetersCount; i++) disabled[i] = waterMeters[i].Disabled;
|
for (int i = 0; i < waterMetersCount; i++)
|
||||||
|
{
|
||||||
|
if (i < MaxWMsCount) disabled[i] = waterMeters[i].Disabled;
|
||||||
|
}
|
||||||
|
|
||||||
error = new double[waterMetersCount];
|
error = new double[waterMetersCount];
|
||||||
}
|
}
|
||||||
@@ -123,6 +128,8 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
string testName = args.TestName;
|
string testName = args.TestName;
|
||||||
|
|
||||||
Results.Entities.TestRslt tr = TBF.BenchControl.Sequences.ProcessData.BatchRslts.GetTestRslt(testName, 0);
|
Results.Entities.TestRslt tr = TBF.BenchControl.Sequences.ProcessData.BatchRslts.GetTestRslt(testName, 0);
|
||||||
|
if (tr != null)
|
||||||
|
{
|
||||||
errLimLo = tr.ErrLimLo() + tr.Uncertainty();
|
errLimLo = tr.ErrLimLo() + tr.Uncertainty();
|
||||||
errLimHi = tr.ErrLimHi() - tr.Uncertainty();
|
errLimHi = tr.ErrLimHi() - tr.Uncertainty();
|
||||||
|
|
||||||
@@ -135,6 +142,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
|
|
||||||
Redraw();
|
Redraw();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Redraw()
|
void Redraw()
|
||||||
{
|
{
|
||||||
@@ -154,7 +162,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
|
|
||||||
for (int i = 0; i < waterMetersCount; i++)
|
for (int i = 0; i < waterMetersCount; i++)
|
||||||
{
|
{
|
||||||
if (!disabled[i])
|
if ((i < MaxWMsCount) && (!disabled[i]))
|
||||||
{
|
{
|
||||||
PaintOne(graphics, rects[i], error[i], errLimLo, errLimHi);
|
PaintOne(graphics, rects[i], error[i], errLimLo, errLimHi);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2015 Sensus Metering Systems
|
/// Copyright (c) 2015-2019 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -90,12 +90,15 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
public WMErrorsForm12(IList<GenericDevices.IWaterMeter> waterMeters)
|
public WMErrorsForm12(IList<GenericDevices.IWaterMeter> waterMeters)
|
||||||
: this()
|
: this()
|
||||||
{
|
{
|
||||||
waterMetersCount = waterMeters.Count;
|
waterMetersCount = Math.Min(Config.Data.WMsCount, waterMeters.Count);
|
||||||
|
|
||||||
ShuffleTextBoxes(waterMetersCount, Config.Data.LineSize);
|
ShuffleTextBoxes(waterMetersCount, Config.Data.LineSize);
|
||||||
|
|
||||||
disabled = new bool[waterMetersCount];
|
disabled = new bool[waterMetersCount];
|
||||||
for (int i = 0; i < waterMetersCount; i++) disabled[i] = waterMeters[i].Disabled;
|
for (int i = 0; i < waterMetersCount; i++)
|
||||||
|
{
|
||||||
|
if (i < MaxWMsCount) disabled[i] = waterMeters[i].Disabled;
|
||||||
|
}
|
||||||
|
|
||||||
error = new double[waterMetersCount];
|
error = new double[waterMetersCount];
|
||||||
}
|
}
|
||||||
@@ -109,7 +112,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
/// <param name="lineSize">Number of watermeters in one line</param>
|
/// <param name="lineSize">Number of watermeters in one line</param>
|
||||||
void ShuffleTextBoxes(int wmsCount, int lineSize)
|
void ShuffleTextBoxes(int wmsCount, int lineSize)
|
||||||
{
|
{
|
||||||
if (wmsCount < textBoxesCount && lineSize > 0)
|
if ((wmsCount < textBoxesCount) && (lineSize > 0))
|
||||||
{
|
{
|
||||||
int nrLines = (wmsCount + lineSize - 1) / lineSize;
|
int nrLines = (wmsCount + lineSize - 1) / lineSize;
|
||||||
int gap = (textBoxesCount - wmsCount) / nrLines;
|
int gap = (textBoxesCount - wmsCount) / nrLines;
|
||||||
@@ -164,6 +167,8 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
string testName = args.TestName;
|
string testName = args.TestName;
|
||||||
|
|
||||||
Results.Entities.TestRslt tr = TBF.BenchControl.Sequences.ProcessData.BatchRslts.GetTestRslt(testName, 0);
|
Results.Entities.TestRslt tr = TBF.BenchControl.Sequences.ProcessData.BatchRslts.GetTestRslt(testName, 0);
|
||||||
|
if (tr != null)
|
||||||
|
{
|
||||||
errLimLo = tr.ErrLimLo() + tr.Uncertainty();
|
errLimLo = tr.ErrLimLo() + tr.Uncertainty();
|
||||||
errLimHi = tr.ErrLimHi() - tr.Uncertainty();
|
errLimHi = tr.ErrLimHi() - tr.Uncertainty();
|
||||||
|
|
||||||
@@ -176,6 +181,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
|
|
||||||
Redraw();
|
Redraw();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Redraw()
|
void Redraw()
|
||||||
{
|
{
|
||||||
@@ -192,7 +198,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
|
|
||||||
for (int i = 0; i < waterMetersCount; i++)
|
for (int i = 0; i < waterMetersCount; i++)
|
||||||
{
|
{
|
||||||
if (!disabled[i])
|
if ((i < MaxWMsCount) && (!disabled[i]))
|
||||||
{
|
{
|
||||||
PaintOne(graphics, rects[i], error[i], errLimLo, errLimHi);
|
PaintOne(graphics, rects[i], error[i], errLimLo, errLimHi);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2015 Sensus Metering Systems
|
/// Copyright (c) 2015-2019 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -94,12 +94,15 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
public WMErrorsForm24(IList<GenericDevices.IWaterMeter> waterMeters)
|
public WMErrorsForm24(IList<GenericDevices.IWaterMeter> waterMeters)
|
||||||
: this()
|
: this()
|
||||||
{
|
{
|
||||||
waterMetersCount = waterMeters.Count;
|
waterMetersCount = Math.Min(Config.Data.WMsCount, waterMeters.Count);
|
||||||
|
|
||||||
ShuffleTextBoxes(waterMetersCount, Config.Data.LineSize);
|
ShuffleTextBoxes(waterMetersCount, Config.Data.LineSize);
|
||||||
|
|
||||||
disabled = new bool[waterMetersCount];
|
disabled = new bool[waterMetersCount];
|
||||||
for (int i = 0; i < waterMetersCount; i++) disabled[i] = waterMeters[i].Disabled;
|
for (int i = 0; i < waterMetersCount; i++)
|
||||||
|
{
|
||||||
|
if (i < MaxWMsCount) disabled[i] = waterMeters[i].Disabled;
|
||||||
|
}
|
||||||
|
|
||||||
error = new double[waterMetersCount];
|
error = new double[waterMetersCount];
|
||||||
}
|
}
|
||||||
@@ -113,7 +116,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
/// <param name="lineSize">Number of watermeters in one line</param>
|
/// <param name="lineSize">Number of watermeters in one line</param>
|
||||||
void ShuffleTextBoxes(int wmsCount, int lineSize)
|
void ShuffleTextBoxes(int wmsCount, int lineSize)
|
||||||
{
|
{
|
||||||
if (wmsCount < textBoxesCount && lineSize > 0)
|
if ((wmsCount < textBoxesCount) && (lineSize > 0))
|
||||||
{
|
{
|
||||||
int nrLines = (wmsCount + lineSize - 1) / lineSize;
|
int nrLines = (wmsCount + lineSize - 1) / lineSize;
|
||||||
int gap = (textBoxesCount - wmsCount) / nrLines;
|
int gap = (textBoxesCount - wmsCount) / nrLines;
|
||||||
|
|||||||
@@ -608,6 +608,21 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
|||||||
tMass2 = StateMachine.Time;
|
tMass2 = StateMachine.Time;
|
||||||
TestEndTime = DateTime.Now;
|
TestEndTime = DateTime.Now;
|
||||||
|
|
||||||
|
if (test.DoDrainingAfter)
|
||||||
|
{
|
||||||
|
State.Create(string.Format("{0}({1}) : Open the drain valve", test.Method, test.Name))
|
||||||
|
.AddOperation(checkUiOp)
|
||||||
|
.AddOperation(StateMachine.ControlBoard.SetValvesOp(scale.DrainValve, null))
|
||||||
|
.AddOperations(readTempPressOps)
|
||||||
|
.EnterState();
|
||||||
|
do
|
||||||
|
{
|
||||||
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
if (e.Contains(Event.Error)) { goto error; }
|
||||||
|
}
|
||||||
|
while (e.Contains(Event.ValvesBusy));
|
||||||
|
}
|
||||||
|
|
||||||
/// Read the diverter switch time
|
/// Read the diverter switch time
|
||||||
switchTimeEnd = 0.001f * (float)cBrd.DivTime(0);
|
switchTimeEnd = 0.001f * (float)cBrd.DivTime(0);
|
||||||
log.WarnFormat("Diverter switch time on test end = {0} ms", cBrd.DivTime(0));
|
log.WarnFormat("Diverter switch time on test end = {0} ms", cBrd.DivTime(0));
|
||||||
|
|||||||
@@ -645,6 +645,21 @@ namespace TBF.BenchControl.TestMethods.DiverterTest
|
|||||||
log.WarnFormat("End mass = {0}kg", EndMass);
|
log.WarnFormat("End mass = {0}kg", EndMass);
|
||||||
TestEndTime = DateTime.Now;
|
TestEndTime = DateTime.Now;
|
||||||
|
|
||||||
|
if (test.DoDrainingAfter)
|
||||||
|
{
|
||||||
|
State.Create(string.Format("{0}({1}) : Open the drain valve", test.Method, test.Name))
|
||||||
|
.AddOperation(checkUiOp)
|
||||||
|
.AddOperation(StateMachine.ControlBoard.SetValvesOp(scale.DrainValve, null))
|
||||||
|
.AddOperations(readTempPressOps)
|
||||||
|
.EnterState();
|
||||||
|
do
|
||||||
|
{
|
||||||
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
|
}
|
||||||
|
while (e.Contains(Event.ValvesBusy));
|
||||||
|
}
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Test_completed);
|
Bridge.OnActivity(this, Strings.Test_completed);
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
///
|
||||||
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using log4net;
|
||||||
|
using Config.Entities;
|
||||||
|
using TBF.UiBridge;
|
||||||
|
|
||||||
|
namespace TBF.BenchControl.TestMethods.Dummy
|
||||||
|
{
|
||||||
|
public class DummySeq : Sequences.SequenceBase
|
||||||
|
{
|
||||||
|
private static readonly ILog log = LogManager.GetLogger(typeof(DummySeq));
|
||||||
|
|
||||||
|
/// <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)
|
||||||
|
{
|
||||||
|
IList<Event> e = new List<Event>(); /// Events from currently running operations
|
||||||
|
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
|
||||||
|
|
||||||
|
/// Start the test, initialize test results
|
||||||
|
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, heatMetersPath, 0));
|
||||||
|
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
|
||||||
|
TestStartTime = DateTime.Now;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Show a dialog with OK button and an appropriate message
|
||||||
|
///
|
||||||
|
Bridge.OnAdjustmentInProgress(this, new AdjustmentInProgressEventArgs(testName));
|
||||||
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
|
||||||
|
Bridge.OnActivity(this, test.Method);
|
||||||
|
State.Create(string.Format("{0}({1}) : Dummy", test.Method, test.Name))
|
||||||
|
.AddOperation(checkUiOp)
|
||||||
|
.AddOperation(StateMachine.BenchWaitingOp)
|
||||||
|
.AddOperation(new Operations.MessageBoxOp(string.Format("Dummy test {0}", test.Name)))
|
||||||
|
.EnterState();
|
||||||
|
do
|
||||||
|
{
|
||||||
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Config.Entities.Progress.Test));
|
||||||
|
|
||||||
|
if (e.Contains(Event.Error)) goto stopTest;
|
||||||
|
if (TestAndLogUiCmdStop(test, e)) goto stopTest;
|
||||||
|
}
|
||||||
|
while (!e.Contains(Event.OK));
|
||||||
|
|
||||||
|
return new List<Event> { Event.Done };
|
||||||
|
|
||||||
|
stopTest:
|
||||||
|
return new List<Event> { Event.UiCmdStop };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
///
|
||||||
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using TBF.BenchControl.Generic;
|
||||||
|
using TBF.BenchControl.Configs.NameOnly;
|
||||||
|
|
||||||
|
namespace TBF.BenchControl.TestMethods.Dummy
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
///
|
||||||
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using log4net;
|
||||||
|
using Config.Entities;
|
||||||
|
using TBF.BenchControl;
|
||||||
|
|
||||||
|
namespace TBF.BenchControl.TestMethods.Dummy
|
||||||
|
{
|
||||||
|
public class TestMethod : ComponentBase, GenericDevices.ITestMethod
|
||||||
|
{
|
||||||
|
private static readonly ILog log = LogManager.GetLogger(typeof(TestMethod));
|
||||||
|
public override string ToString() { return string.Format("TestMethods.Dummy({0})", Cfg.ToString(1)); }
|
||||||
|
|
||||||
|
public bool CanTest(MetersKind meters) { return true; }
|
||||||
|
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 DummySeq()).Execute(test, repetNr, isLastRepetition, DebugLevel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -31,13 +31,6 @@ namespace TBF.BenchControl.TestMethods.FixedStart
|
|||||||
HeatMeters.TestParams heatMetersTestParams,
|
HeatMeters.TestParams heatMetersTestParams,
|
||||||
Config.Entities.DebugMode debugLevel)
|
Config.Entities.DebugMode debugLevel)
|
||||||
{
|
{
|
||||||
IScale scale = outPath.Scale as IScale;
|
|
||||||
if (scale == null)
|
|
||||||
{
|
|
||||||
Bridge.OnError(this, Strings.Missing_a_scale);
|
|
||||||
new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop
|
|
||||||
}
|
|
||||||
|
|
||||||
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
|
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
|
||||||
if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter)
|
if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter)
|
||||||
{
|
{
|
||||||
@@ -138,61 +131,6 @@ namespace TBF.BenchControl.TestMethods.FixedStart
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!test.DoDraining)
|
|
||||||
{
|
|
||||||
///
|
|
||||||
/// Measure the weight in case there is no unconditional draining
|
|
||||||
///
|
|
||||||
State.Create(string.Format("{0}({1}) : Measuring mass of water in the tank", test.Method, test.Name))
|
|
||||||
.AddOperation(checkUiOp)
|
|
||||||
.AddOperations(readTempPressOps)
|
|
||||||
.AddOperation(scale.ReadMassOp(ref Mass))
|
|
||||||
.AddOperation(heatMetersPromptOp)
|
|
||||||
.EnterState();
|
|
||||||
do {
|
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
|
||||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.JustStarted));
|
|
||||||
|
|
||||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
|
||||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
|
||||||
}
|
|
||||||
while (!e.Contains(Event.BalanceDone));
|
|
||||||
}
|
|
||||||
///
|
|
||||||
/// Skip draining in case there is enough room in the tank
|
|
||||||
///
|
|
||||||
if (test.DoDraining || (Mass.Val + test.Volume >= scale.Capacity * Constants.TankFullFactor))
|
|
||||||
{
|
|
||||||
///
|
|
||||||
/// Drain the water tank
|
|
||||||
///
|
|
||||||
switch (DrainTheTank(scale, heatMetersPromptOp))
|
|
||||||
{
|
|
||||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
|
||||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
///
|
|
||||||
/// Make sure the drain valve is closed
|
|
||||||
///
|
|
||||||
State.Create(string.Format("{0}({1}) : Make sure the drain valve is closed", test.Method, test.Name))
|
|
||||||
.AddOperation(checkUiOp)
|
|
||||||
.AddOperations(readTempPressOps)
|
|
||||||
.AddOperation(scale.ReadMassOp(ref Mass))
|
|
||||||
.AddOperation(heatMetersPromptOp)
|
|
||||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, scale.DrainValve))
|
|
||||||
.EnterState();
|
|
||||||
do {
|
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
|
||||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.JustStarted));
|
|
||||||
|
|
||||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
|
||||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
|
||||||
}
|
|
||||||
while (!e.Contains(Event.ValvesSet) || !e.Contains(Event.BalanceDone));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Starting_the_pump);
|
Bridge.OnActivity(this, Strings.Starting_the_pump);
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
@@ -371,12 +309,12 @@ namespace TBF.BenchControl.TestMethods.FixedStart
|
|||||||
{
|
{
|
||||||
double Tw = (TempRefHi1.Val + TempRefHi2.Val) / 2;
|
double Tw = (TempRefHi1.Val + TempRefHi2.Val) / 2;
|
||||||
double Tc = (TempRefLo1.Val + TempRefLo2.Val) / 2;
|
double Tc = (TempRefLo1.Val + TempRefLo2.Val) / 2;
|
||||||
if (heatMetersTestParams.TempWarmLo <= Tw && Tw <= heatMetersTestParams.TempWarmHi &&
|
if ((heatMetersTestParams.TempWarmLo <= Tw) && (Tw <= heatMetersTestParams.TempWarmHi) &&
|
||||||
heatMetersTestParams.TempColdLo <= Tc && Tc <= heatMetersTestParams.TempColdHi &&
|
(heatMetersTestParams.TempColdLo <= Tc) && (Tc <= heatMetersTestParams.TempColdHi) &&
|
||||||
Math.Abs(Tw - Tw_last) <= heatMetersTestParams.ChangeInTimeWarm &&
|
(Math.Abs(Tw - Tw_last) <= heatMetersTestParams.ChangeInTimeWarm) &&
|
||||||
Math.Abs(Tc - Tc_last) <= heatMetersTestParams.ChangeInTimeCold &&
|
(Math.Abs(Tc - Tc_last) <= heatMetersTestParams.ChangeInTimeCold) &&
|
||||||
Math.Abs(TempRefHi1.Val - TempRefHi2.Val) <= heatMetersTestParams.DeltaTempWarm &&
|
(Math.Abs(TempRefHi1.Val - TempRefHi2.Val) <= heatMetersTestParams.DeltaTempWarm) &&
|
||||||
Math.Abs(TempRefLo1.Val - TempRefLo2.Val) <= heatMetersTestParams.DeltaTempCold)
|
(Math.Abs(TempRefLo1.Val - TempRefLo2.Val) <= heatMetersTestParams.DeltaTempCold))
|
||||||
{
|
{
|
||||||
goto temperature_set;
|
goto temperature_set;
|
||||||
}
|
}
|
||||||
@@ -434,26 +372,6 @@ namespace TBF.BenchControl.TestMethods.FixedStart
|
|||||||
double currentFlow = RefFlow.Val;
|
double currentFlow = RefFlow.Val;
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------
|
|
||||||
Bridge.OnActivity(this, Strings.Measuring_the_weight);
|
|
||||||
//------------------------------------------------
|
|
||||||
|
|
||||||
if (test.TimeFlow2Mass > 0)
|
|
||||||
{
|
|
||||||
State.Create(string.Format("{0}({1}) : Waiting before 1st measurement", test.Method, test.Name))
|
|
||||||
.AddOperation(checkUiOp)
|
|
||||||
.AddOperations(readTempPressOps)
|
|
||||||
.AddOperation(new Operations.TimerOp(test.TimeFlow2Mass))
|
|
||||||
.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));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
TestStartTime = DateTime.Now;
|
TestStartTime = DateTime.Now;
|
||||||
LogProcessDataTestInfo(processDataLogger, test.Procedure.Name, test.Name);
|
LogProcessDataTestInfo(processDataLogger, test.Procedure.Name, test.Name);
|
||||||
int startPulses = 0;
|
int startPulses = 0;
|
||||||
@@ -486,8 +404,7 @@ namespace TBF.BenchControl.TestMethods.FixedStart
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
state2.EnterState();
|
state2.EnterState();
|
||||||
do
|
do {
|
||||||
{
|
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
|
||||||
@@ -553,12 +470,19 @@ namespace TBF.BenchControl.TestMethods.FixedStart
|
|||||||
{
|
{
|
||||||
string srcDir = Path.Combine(Program.TempImagesDir, BatchRslts.Batch.BatchNr.ToString(), (i + 1).ToString());
|
string srcDir = Path.Combine(Program.TempImagesDir, BatchRslts.Batch.BatchNr.ToString(), (i + 1).ToString());
|
||||||
string destDir = Path.Combine(Program.ImagesDir, BatchRslts.Batch.BatchNr.ToString(), (i + 1).ToString());
|
string destDir = Path.Combine(Program.ImagesDir, BatchRslts.Batch.BatchNr.ToString(), (i + 1).ToString());
|
||||||
|
try
|
||||||
|
{
|
||||||
if (File.Exists(Path.Combine(srcDir, fileName)))
|
if (File.Exists(Path.Combine(srcDir, fileName)))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(destDir);
|
Directory.CreateDirectory(destDir);
|
||||||
File.Copy(Path.Combine(srcDir, fileName), Path.Combine(destDir, fileName), true);
|
File.Copy(Path.Combine(srcDir, fileName), Path.Combine(destDir, fileName), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
log.ErrorFormat("Failed to copy image {0} to {1}: {2}", fileName, destDir, exc.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -603,7 +527,7 @@ namespace TBF.BenchControl.TestMethods.FixedStart
|
|||||||
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
||||||
queryEnd2 = cBrd.QueryMeasurementEndOp();
|
queryEnd2 = cBrd.QueryMeasurementEndOp();
|
||||||
|
|
||||||
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, Math.Max((int)(test.TstTime/10), 5));
|
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, Math.Max((int)(test.TstTime / 10), 5));
|
||||||
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
|
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
|
||||||
|
|
||||||
/// Measurement loop - begin
|
/// Measurement loop - begin
|
||||||
@@ -696,22 +620,22 @@ namespace TBF.BenchControl.TestMethods.FixedStart
|
|||||||
}
|
}
|
||||||
while (e.Contains(Event.ValvesBusy));
|
while (e.Contains(Event.ValvesBusy));
|
||||||
|
|
||||||
switchTimeEnd = 0.001f * cBrd.ValveOpenCloseTime;
|
|
||||||
log.WarnFormat("Start valve switch time on test end = {0} ms", cBrd.ValveOpenCloseTime);
|
|
||||||
|
|
||||||
State.Create(string.Format("{0}({1}) : Waiting before 2nd measurement", test.Method, test.Name))
|
State.Create(string.Format("{0}({1}) : Stopping flow regulation", test.Method, test.Name))
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperations(readTempPressOps)
|
.AddOperations(readTempPressOps)
|
||||||
.AddOperation(scale.ReadMassOp(ref Mass))
|
.AddOperation(cBrd.StopFlowRegulationOp(outPath))
|
||||||
.AddOperation(new Operations.TimerOp(test.TimeStop2Mass))
|
|
||||||
.AddOperation(processDataLoggingOp)
|
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do {
|
do {
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
while (!e.Contains(Event.TimerExpired));
|
while (!e.Contains(Event.FlowRegulationStopped));
|
||||||
|
|
||||||
|
|
||||||
|
switchTimeEnd = 0.001f * cBrd.ValveOpenCloseTime;
|
||||||
|
log.WarnFormat("Start valve switch time on test end = {0} ms", cBrd.ValveOpenCloseTime);
|
||||||
|
|
||||||
|
|
||||||
TestEndTime = DateTime.Now;
|
TestEndTime = DateTime.Now;
|
||||||
@@ -780,7 +704,8 @@ namespace TBF.BenchControl.TestMethods.FixedStart
|
|||||||
State state = State.Create(string.Format("{0}({1}) : Entering the end-state", test.Method, test.Name));
|
State state = State.Create(string.Format("{0}({1}) : Entering the end-state", test.Method, test.Name));
|
||||||
if (heatMetersTestParams != null && dataEntryCmpnt is GenericDevices.IHasHeatMtrStatesForm)
|
if (heatMetersTestParams != null && dataEntryCmpnt is GenericDevices.IHasHeatMtrStatesForm)
|
||||||
{
|
{
|
||||||
state.AddOperation((dataEntryCmpnt as GenericDevices.IHasHeatMtrStatesForm).ShowTestEndFormOp(sensPath.RegisterReaders,
|
state.AddOperation((dataEntryCmpnt as GenericDevices.IHasHeatMtrStatesForm).
|
||||||
|
ShowTestEndFormOp(sensPath.RegisterReaders,
|
||||||
volumeCTV, test.ErrLimLo + test.Uncertainty, test.ErrLimHi - test.Uncertainty,
|
volumeCTV, test.ErrLimLo + test.Uncertainty, test.ErrLimHi - test.Uncertainty,
|
||||||
refEnergy, test.ErrLimLo + test.Uncertainty, test.ErrLimHi - test.Uncertainty));
|
refEnergy, test.ErrLimLo + test.Uncertainty, test.ErrLimHi - test.Uncertainty));
|
||||||
}
|
}
|
||||||
@@ -840,10 +765,17 @@ namespace TBF.BenchControl.TestMethods.FixedStart
|
|||||||
{
|
{
|
||||||
string srcDir = Path.Combine(Program.TempImagesDir, BatchRslts.Batch.BatchNr.ToString(), (i + 1).ToString());
|
string srcDir = Path.Combine(Program.TempImagesDir, BatchRslts.Batch.BatchNr.ToString(), (i + 1).ToString());
|
||||||
string destDir = Path.Combine(Program.ImagesDir, BatchRslts.Batch.BatchNr.ToString(), (i + 1).ToString());
|
string destDir = Path.Combine(Program.ImagesDir, BatchRslts.Batch.BatchNr.ToString(), (i + 1).ToString());
|
||||||
|
try
|
||||||
|
{
|
||||||
if (File.Exists(Path.Combine(srcDir, fileName)))
|
if (File.Exists(Path.Combine(srcDir, fileName)))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(destDir);
|
Directory.CreateDirectory(destDir);
|
||||||
File.Copy(Path.Combine(srcDir, fileName), Path.Combine(destDir, fileName), true);
|
File.Copy(Path.Combine(srcDir, fileName), Path.Combine(destDir, fileName), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
log.ErrorFormat("Failed to copy image {0} to {1}: {2}", fileName, destDir, exc.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1060,7 +992,7 @@ namespace TBF.BenchControl.TestMethods.FixedStart
|
|||||||
(BenchInfo != null) ? BenchInfo.TestBenchName : "testbench",
|
(BenchInfo != null) ? BenchInfo.TestBenchName : "testbench",
|
||||||
inPath.Pump != null ? inPath.Pump.Name : string.Empty,
|
inPath.Pump != null ? inPath.Pump.Name : string.Empty,
|
||||||
outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty,
|
outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty,
|
||||||
scale != null ? scale.Name : string.Empty,
|
string.Empty,
|
||||||
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
|
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
|
||||||
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));
|
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));
|
||||||
|
|
||||||
|
|||||||
@@ -490,6 +490,21 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
|||||||
tMass2 = StateMachine.Time;
|
tMass2 = StateMachine.Time;
|
||||||
TestEndTime = DateTime.Now;
|
TestEndTime = DateTime.Now;
|
||||||
|
|
||||||
|
if (test.DoDrainingAfter)
|
||||||
|
{
|
||||||
|
State.Create(string.Format("{0}({1}) : Open the drain valve", test.Method, test.Name))
|
||||||
|
.AddOperation(checkUiOp)
|
||||||
|
.AddOperation(StateMachine.ControlBoard.SetValvesOp(scale.DrainValve, null))
|
||||||
|
.AddOperations(readTempPressOps)
|
||||||
|
.EnterState();
|
||||||
|
do
|
||||||
|
{
|
||||||
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
|
}
|
||||||
|
while (e.Contains(Event.ValvesBusy));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
State.Create("FixedStartAdvanced : Stopping diverter, gate, etc.")
|
State.Create("FixedStartAdvanced : Stopping diverter, gate, etc.")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
|
|||||||
+4
-4
@@ -1,12 +1,12 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2017 Sensus Slovensko a.s.
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using log4net;
|
using log4net;
|
||||||
using Config.Entities;
|
using Config.Entities;
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation.Compound
|
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval.Compound
|
||||||
{
|
{
|
||||||
public class Component : ComponentBase, GenericDevices.ITestMethodWith2ndPass
|
public class Component : ComponentBase, GenericDevices.ITestMethodWith2ndPass
|
||||||
{
|
{
|
||||||
@@ -35,12 +35,12 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation.Compound
|
|||||||
|
|
||||||
public IList<Event> Execute(Test test, int repetNr, bool isLastRepetition)
|
public IList<Event> Execute(Test test, int repetNr, bool isLastRepetition)
|
||||||
{
|
{
|
||||||
return (new FixedStartDeferredEvaluationSeq()).Execute(test, repetNr, isLastRepetition, true, null, DebugLevel, out intermediateData);
|
return (new FixedStartDeferredEvalSeq()).Execute(test, repetNr, isLastRepetition, true, null, DebugLevel, out intermediateData);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IList<Event> Execute2ndPass(Test test, int repetNr, object data)
|
public IList<Event> Execute2ndPass(Test test, int repetNr, object data)
|
||||||
{
|
{
|
||||||
return (new FixedStartDeferredEvaluationSeq()).Execute2ndPass(test, repetNr, data as IntermediateData);
|
return (new FixedStartDeferredEvalSeq()).Execute2ndPass(test, repetNr, data as IntermediateData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,11 +1,11 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2017 Sensus Slovensko a.s.
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using TBF.BenchControl.Generic;
|
using TBF.BenchControl.Generic;
|
||||||
using TBF.BenchControl.Configs.NameOnly;
|
using TBF.BenchControl.Configs.NameOnly;
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation.Single
|
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval.Compound
|
||||||
{
|
{
|
||||||
public class Factory : IComponentFactory
|
public class Factory : IComponentFactory
|
||||||
{
|
{
|
||||||
File diff suppressed because it is too large
Load Diff
+4
-4
@@ -1,12 +1,12 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2017 Sensus Slovensko a.s.
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using log4net;
|
using log4net;
|
||||||
using Config.Entities;
|
using Config.Entities;
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation.HeatMeters
|
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval.HeatMeters
|
||||||
{
|
{
|
||||||
public class Component : ComponentBase, GenericDevices.ITestMethodWith2ndPass
|
public class Component : ComponentBase, GenericDevices.ITestMethodWith2ndPass
|
||||||
{
|
{
|
||||||
@@ -38,12 +38,12 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation.HeatMeters
|
|||||||
|
|
||||||
public IList<Event> Execute(Test test, int repetNr, bool isLastRepetition)
|
public IList<Event> Execute(Test test, int repetNr, bool isLastRepetition)
|
||||||
{
|
{
|
||||||
return (new FixedStartDeferredEvaluationSeq()).Execute(test, repetNr, isLastRepetition, false, testMethodCfg.TestParams, DebugLevel, out intermediateData);
|
return (new FixedStartDeferredEvalSeq()).Execute(test, repetNr, isLastRepetition, false, testMethodCfg.TestParams, DebugLevel, out intermediateData);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IList<Event> Execute2ndPass(Test test, int repetNr, object data)
|
public IList<Event> Execute2ndPass(Test test, int repetNr, object data)
|
||||||
{
|
{
|
||||||
return (new FixedStartDeferredEvaluationSeq()).Execute2ndPass(test, repetNr, data as IntermediateData);
|
return (new FixedStartDeferredEvalSeq()).Execute2ndPass(test, repetNr, data as IntermediateData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,10 +1,10 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2017 Sensus Slovensko a.s.
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using TBF.BenchControl.Generic;
|
using TBF.BenchControl.Generic;
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation.HeatMeters
|
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval.HeatMeters
|
||||||
{
|
{
|
||||||
public class Factory : IComponentFactory
|
public class Factory : IComponentFactory
|
||||||
{
|
{
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2017 Sensus Slovensko a.s.
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -8,7 +8,7 @@ using System.Xml.Serialization;
|
|||||||
using Config.Entities;
|
using Config.Entities;
|
||||||
using TBF.BenchControl.Generic;
|
using TBF.BenchControl.Generic;
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation.HeatMeters
|
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval.HeatMeters
|
||||||
{
|
{
|
||||||
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
|
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||||
{
|
{
|
||||||
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2017 Sensus Slovensko a.s.
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Config.Entities;
|
using Config.Entities;
|
||||||
using TBF.BenchControl.Generic;
|
using TBF.BenchControl.Generic;
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation.HeatMeters
|
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval.HeatMeters
|
||||||
{
|
{
|
||||||
public partial class TestMethodCfgCtrl : UserControl, IComponentCfgCtrl
|
public partial class TestMethodCfgCtrl : UserControl, IComponentCfgCtrl
|
||||||
{
|
{
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2017 Sensus Slovensko a.s.
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation.HeatMeters
|
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval.HeatMeters
|
||||||
{
|
{
|
||||||
partial class TestMethodCfgCtrl
|
partial class TestMethodCfgCtrl
|
||||||
{
|
{
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2017 Sensus Slovensko a.s.
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@@ -9,7 +9,7 @@ using Config.Entities;
|
|||||||
using TBF.BenchControl.Generic;
|
using TBF.BenchControl.Generic;
|
||||||
using TBF.Resources;
|
using TBF.Resources;
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation.HeatMeters
|
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval.HeatMeters
|
||||||
{
|
{
|
||||||
public class TestParams : TestParamsBase, IParamsProvider, ITestParams
|
public class TestParams : TestParamsBase, IParamsProvider, ITestParams
|
||||||
{
|
{
|
||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2017 Sensus Slovensko a.s.
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation
|
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval
|
||||||
{
|
{
|
||||||
public class IntermediateData
|
public class IntermediateData
|
||||||
{
|
{
|
||||||
+4
-4
@@ -1,12 +1,12 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2017 Sensus Slovensko a.s.
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using log4net;
|
using log4net;
|
||||||
using Config.Entities;
|
using Config.Entities;
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation.Single
|
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval.Single
|
||||||
{
|
{
|
||||||
public class Component : ComponentBase, GenericDevices.ITestMethodWith2ndPass
|
public class Component : ComponentBase, GenericDevices.ITestMethodWith2ndPass
|
||||||
{
|
{
|
||||||
@@ -35,12 +35,12 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation.Single
|
|||||||
|
|
||||||
public IList<Event> Execute(Test test, int repetNr, bool isLastRepetition)
|
public IList<Event> Execute(Test test, int repetNr, bool isLastRepetition)
|
||||||
{
|
{
|
||||||
return (new FixedStartDeferredEvaluationSeq()).Execute(test, repetNr, isLastRepetition, false, null, DebugLevel, out intermediateData);
|
return (new FixedStartDeferredEvalSeq()).Execute(test, repetNr, isLastRepetition, false, null, DebugLevel, out intermediateData);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IList<Event> Execute2ndPass(Test test, int repetNr, object data)
|
public IList<Event> Execute2ndPass(Test test, int repetNr, object data)
|
||||||
{
|
{
|
||||||
return (new FixedStartDeferredEvaluationSeq()).Execute2ndPass(test, repetNr, data as IntermediateData);
|
return (new FixedStartDeferredEvalSeq()).Execute2ndPass(test, repetNr, data as IntermediateData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,11 +1,11 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2017 Sensus Slovensko a.s.
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using TBF.BenchControl.Generic;
|
using TBF.BenchControl.Generic;
|
||||||
using TBF.BenchControl.Configs.NameOnly;
|
using TBF.BenchControl.Configs.NameOnly;
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation.Compound
|
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval.Single
|
||||||
{
|
{
|
||||||
public class Factory : IComponentFactory
|
public class Factory : IComponentFactory
|
||||||
{
|
{
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
///
|
||||||
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using log4net;
|
||||||
|
using Config.Entities;
|
||||||
|
|
||||||
|
namespace TBF.BenchControl.TestMethods.FixedStartMassCollDeferredEval.Compound
|
||||||
|
{
|
||||||
|
public class Component : ComponentBase, GenericDevices.ITestMethodWith2ndPass
|
||||||
|
{
|
||||||
|
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return string.Format("{0}({1})", this.GetType().Namespace.Substring(17), Cfg.ToString(1));
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool CanTest(MetersKind meters) { return meters == MetersKind.Combined; }
|
||||||
|
public bool DoTransitions() { return true; }
|
||||||
|
|
||||||
|
public Component()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public Component(Generic.IComponentCfg cfg)
|
||||||
|
: base(cfg)
|
||||||
|
{
|
||||||
|
log.Debug(this.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private IntermediateData intermediateData;
|
||||||
|
public object IntermediateData { get { return intermediateData; } }
|
||||||
|
|
||||||
|
public IList<Event> Execute(Test test, int repetNr, bool isLastRepetition)
|
||||||
|
{
|
||||||
|
return (new FixedStartMassCollDeferredEvalSeq()).Execute(test, repetNr, isLastRepetition, true, null, DebugLevel, out intermediateData);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IList<Event> Execute2ndPass(Test test, int repetNr, object data)
|
||||||
|
{
|
||||||
|
return (new FixedStartMassCollDeferredEvalSeq()).Execute2ndPass(test, repetNr, data as IntermediateData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
///
|
||||||
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using TBF.BenchControl.Generic;
|
||||||
|
using TBF.BenchControl.Configs.NameOnly;
|
||||||
|
|
||||||
|
namespace TBF.BenchControl.TestMethods.FixedStartMassCollDeferredEval.Compound
|
||||||
|
{
|
||||||
|
public class Factory : IComponentFactory
|
||||||
|
{
|
||||||
|
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
|
||||||
|
|
||||||
|
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
|
||||||
|
|
||||||
|
public IComponent DummyComponent() { return new Component(); }
|
||||||
|
|
||||||
|
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+19
-4
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2017 Sensus Slovensko a.s.
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -12,11 +12,11 @@ using TBF.Resources;
|
|||||||
using TBF.UiBridge;
|
using TBF.UiBridge;
|
||||||
using TBF.BenchControl.GenericDevices;
|
using TBF.BenchControl.GenericDevices;
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation
|
namespace TBF.BenchControl.TestMethods.FixedStartMassCollDeferredEval
|
||||||
{
|
{
|
||||||
public class FixedStartDeferredEvaluationSeq : Sequences.SequenceBase
|
public class FixedStartMassCollDeferredEvalSeq : Sequences.SequenceBase
|
||||||
{
|
{
|
||||||
private static readonly ILog log = LogManager.GetLogger(typeof(FixedStartDeferredEvaluationSeq));
|
private static readonly ILog log = LogManager.GetLogger(typeof(FixedStartMassCollDeferredEvalSeq));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fixed start mass collection method with deferred evaluation of images
|
/// Fixed start mass collection method with deferred evaluation of images
|
||||||
@@ -798,6 +798,21 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation
|
|||||||
tMass2 = StateMachine.Time;
|
tMass2 = StateMachine.Time;
|
||||||
TestEndTime = DateTime.Now;
|
TestEndTime = DateTime.Now;
|
||||||
|
|
||||||
|
if (test.DoDrainingAfter)
|
||||||
|
{
|
||||||
|
State.Create(string.Format("{0}({1}) : Open the drain valve", test.Method, test.Name))
|
||||||
|
.AddOperation(checkUiOp)
|
||||||
|
.AddOperation(StateMachine.ControlBoard.SetValvesOp(scale.DrainValve, null))
|
||||||
|
.AddOperations(readTempPressOps)
|
||||||
|
.EnterState();
|
||||||
|
do
|
||||||
|
{
|
||||||
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
|
}
|
||||||
|
while (e.Contains(Event.ValvesBusy));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
|
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
///
|
||||||
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using log4net;
|
||||||
|
using Config.Entities;
|
||||||
|
|
||||||
|
namespace TBF.BenchControl.TestMethods.FixedStartMassCollDeferredEval.HeatMeters
|
||||||
|
{
|
||||||
|
public class Component : ComponentBase, GenericDevices.ITestMethodWith2ndPass
|
||||||
|
{
|
||||||
|
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return string.Format("{0}({1})", this.GetType().Namespace.Substring(17), Cfg.ToString(1));
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly TestMethodCfg testMethodCfg;
|
||||||
|
|
||||||
|
public bool CanTest(MetersKind meters) { return meters == MetersKind.HeatMeter; }
|
||||||
|
public bool DoTransitions() { return true; }
|
||||||
|
|
||||||
|
public Component()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public Component(Generic.IComponentCfg cfg)
|
||||||
|
: base(cfg)
|
||||||
|
{
|
||||||
|
testMethodCfg = cfg as TestMethodCfg;
|
||||||
|
log.Debug(this.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private IntermediateData intermediateData;
|
||||||
|
public object IntermediateData { get { return intermediateData; } }
|
||||||
|
|
||||||
|
public IList<Event> Execute(Test test, int repetNr, bool isLastRepetition)
|
||||||
|
{
|
||||||
|
return (new FixedStartMassCollDeferredEvalSeq()).Execute(test, repetNr, isLastRepetition, false, testMethodCfg.TestParams, DebugLevel, out intermediateData);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IList<Event> Execute2ndPass(Test test, int repetNr, object data)
|
||||||
|
{
|
||||||
|
return (new FixedStartMassCollDeferredEvalSeq()).Execute2ndPass(test, repetNr, data as IntermediateData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
///
|
||||||
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using TBF.BenchControl.Generic;
|
||||||
|
|
||||||
|
namespace TBF.BenchControl.TestMethods.FixedStartMassCollDeferredEval.HeatMeters
|
||||||
|
{
|
||||||
|
public class Factory : IComponentFactory
|
||||||
|
{
|
||||||
|
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
|
||||||
|
|
||||||
|
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
|
||||||
|
|
||||||
|
public IComponent DummyComponent() { return new Component(); }
|
||||||
|
|
||||||
|
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+49
@@ -0,0 +1,49 @@
|
|||||||
|
///
|
||||||
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
using Config.Entities;
|
||||||
|
using TBF.BenchControl.Generic;
|
||||||
|
|
||||||
|
namespace TBF.BenchControl.TestMethods.FixedStartMassCollDeferredEval.HeatMeters
|
||||||
|
{
|
||||||
|
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||||
|
{
|
||||||
|
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
|
||||||
|
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||||
|
|
||||||
|
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
|
||||||
|
|
||||||
|
/// <summary> Test parameters </summary>
|
||||||
|
[XmlIgnore]
|
||||||
|
public TestParams TestParams; /// Created in constructor
|
||||||
|
public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
|
||||||
|
public override IParamsProvider CreateTestParamsProvider() { return new TestParams(true); }
|
||||||
|
public override IParamsProvider GetUITestParamsProvider(Test test)
|
||||||
|
{
|
||||||
|
return (test.Method == Name) ? base.GetUITestParamsProvider(test) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Private parameterless constructor invoked by all other (public) constructors
|
||||||
|
TestMethodCfg()
|
||||||
|
{
|
||||||
|
TestParams = new TestParams(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TestMethodCfg(string name, IComponentFactory factory)
|
||||||
|
: this()
|
||||||
|
{
|
||||||
|
Name = name;
|
||||||
|
Factory = factory;
|
||||||
|
ParentName = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ToString(int i)
|
||||||
|
{
|
||||||
|
return string.Format("Name={0}", Name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user