Compare commits

...
Author SHA1 Message Date
Milan Hanajik f310094c33 Reconfigured for iPERL-NEW 2020-09-08 09:02:40 +02:00
Milan Hanajik e94eb83c1d ver. 2.26.1517 2020-09-08 09:01:39 +02:00
Milan Hanajik ff3de55593 TracingDB/Enums.cs updated, Output/DB/ProductionTracing/Enums.cs removed 2020-09-03 14:45:51 +02:00
Milan Hanajik 1e50cc6fb7 ver. 2.26.1516 2020-09-03 14:45:51 +02:00
Milan Hanajik 7b31c6b2b6 Modbus.WaterAnalyzer2 : Conductivity comm. and conversion from 4-20 mA 2020-09-03 14:45:07 +02:00
Milan Hanajik 38ee1cc067 English and US units added. 2020-08-28 09:06:27 +02:00
Milan Hanajik e27dfe570d Genesis component updated (21.8.2020). 2020-08-27 16:40:06 +02:00
Milan Hanajik b2f2f595e5 Output.EventTriggers.Standard bug fix (E13 cannot be changed). 2020-08-27 16:40:06 +02:00
Milan Hanajik 67f4683026 FixedStart methods : order of operations fixed (1. open start valve, 2. start measurement) 2020-08-12 10:10:49 +02:00
Milan Hanajik 42f8d02a68 (1) Heat Meters related fixes, (2) SLM50 component upgraded (7.8.2020), ver. 2.26.1513 2020-08-07 14:24:57 +02:00
Milan Hanajik 14717d5d46 ver. 2.26.1512 2020-08-07 12:14:04 +02:00
Milan Hanajik 450530a707 In FIxedStart methods there is a delay after start of a test before the flow regulation starts. 2020-08-07 12:14:04 +02:00
Milan Hanajik adf30d615b (1) MettlerToledo: Zero instead of Taring, (2) RegValveCalib array size fixed for ADC#8..11, ver. 2.26.1511 2020-08-07 11:11:44 +02:00
Milan Hanajik 610387e071 (1) Compound WM results are displayed correctly, ver. 2.26.1510 2020-08-05 10:27:34 +02:00
Milan Hanajik 114e628305 (1) Diverter.flowMtrNr4Cmd for SLM_150, (2) Config.Data cleanup 2020-08-05 09:36:00 +02:00
Milan Hanajik 68d01aab14 Bug fix in CombinedWithDetectionSeq related to test.Part, ver. 2.26.1509 2020-07-31 11:58:30 +02:00
Milan Hanajik eaf0e2cf22 Barcode printing in Output.Printers.Enhanced and Output.Printers.OnePerMeter, ver. 2.26.1508 2020-07-29 10:06:43 +02:00
Milan Hanajik 02ec8d8124 Camera.CLP1611 : More comments, TODO list, ver. 2.26.1505 2020-07-17 14:13:57 +02:00
Milan Hanajik 1dc328746d Gelsenwasser component upgraded. 2020-07-15 10:31:46 +02:00
Milan Hanajik 5bb94666a4 (1) Diverter.nextIdx not incremented when DebugMode.Off, (2) VR1 accepts number entry, ver. 2.26.1499 2020-07-09 13:31:24 +02:00
Milan Hanajik c1f23b8481 ResultsBrowser with a custom query for SUEZ, ver. 2.26.1498 2020-07-09 13:22:52 +02:00
Milan Hanajik 70c11ad6d9 German resources, ver. 2.26.1498 2020-07-08 10:16:33 +02:00
Milan Hanajik 3a8c6b4d3e ResultsBrowser : DEWA custom queries. 2020-07-07 12:57:45 +02:00
Milan Hanajik b8f1b9293a (1) Units : Quantity.Enumerated added, (2) LoginDlgWithBenchSelection : List of benches is alphabetically sorted. 2020-06-25 12:10:55 +02:00
Milan Hanajik 6558951857 ver. 2.26.1497 2020-06-25 09:53:48 +02:00
Milan Hanajik 54e964ffde Flow calculation : TestRslt.FlowVolume is always the most accurate CTV flow (calculated from the measured mass in case of mass collection methods) 2020-06-25 09:35:10 +02:00
Milan Hanajik a5b270eec8 Two documents added. 2020-06-24 14:08:36 +02:00
Milan Hanajik 6f9c6596d5 ResultsBrowser: 1 WR13 IP addr.updated, 2 default DbType=MySql, 3 changes in progress, ver. 2.26.1496 2020-06-24 12:01:37 +02:00
Milan Hanajik d99c53bc8e (1) psi unit, (2) Transition seq. fixed (ISequenceCondition seqCondition null after renaming a component). 2020-06-08 14:34:51 +02:00
Milan Hanajik 3496fcbbba Critical bug fixes in sequences - STOP not working !!! 2020-05-21 16:37:09 +02:00
Milan Hanajik 77a29dadfc ResetBatchNr console application added to solution. 2020-05-18 12:59:17 +02:00
108 changed files with 4063 additions and 1068 deletions
+2
View File
@@ -24,6 +24,8 @@ GraphLib/bin
GraphLib/obj
TracingDB/bin
TracingDB/obj
ResetBatchNr/bin
ResetBatchNr/obj
RestClient/bin
RestClient/obj
Results/bin/
+2 -2
View File
@@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
<DefineConstants>TRACE;DEBUG;TURA_IPERL_NEW;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -30,7 +30,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;MUNICH</DefineConstants>
<DefineConstants>TRACE;TURA_IPERL_NEW;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
+35 -53
View File
@@ -8,31 +8,43 @@ namespace Config
public const string AdminPassword = "staratura";
public const string SQLiteDbFName = "SQLite.db";
#if MUNICH
#if DN100 || BADGER_STREDNA_TRAT || BADGER_VELKA_TRAT || CEVAK_200
public const int WMsCount = 3;
public const int LineSize = 3;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 1;
#elif MUNICH
public const int WMsCount = 3;
public const int LineSize = 3;
public const int CompoundWMsCount = 3;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 3;
#elif DN100 || BADGER_STREDNA_TRAT || BADGER_VELKA_TRAT || CEVAK_200
public const int WMsCount = 3;
public const int LineSize = 3;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif FUZHOU_300 || FUZHOU_150 || IZRAEL_200 || GENESIS || SLM_150 || PETERSBURG_200
#elif MALTA_WSD25
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 1;
public const int CompoundWMsCount = 0;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 3;
public const int MaxPartNr = 1;
#elif BADGER_MALA_TRAT || BERLIN || FUZHOU_150 || FUZHOU_300 || GELSENWASSER || GENESIS || IZRAEL_200 || PETERSBURG_200 || SENTEC || SLM_150 || TORINO_50 || TURA_SPECIAL
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 1;
#elif PUCHONG_200
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 3;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 3;
#elif DEWA_300 || ROMA_200
#elif RUM_MOB
public const int WMsCount = 8;
public const int LineSize = 8;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif DEWA_300 || FUZHOU_100 || ROMA_200
public const int WMsCount = 10;
public const int LineSize = 10;
public const int CompoundWMsCount = 1;
@@ -44,63 +56,33 @@ namespace Config
public const int CompoundWMsCount = 0;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif IZRAEL_50
public const int WMsCount = 40;
public const int LineSize = 10;
public const int CompoundWMsCount = 0;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif FUZHOU_100
public const int WMsCount = 10;
public const int LineSize = 10;
#elif SLM_END || WARSAW_END
public const int WMsCount = 10;
public const int LineSize = 5;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif TORINO_50 || BADGER_MALA_TRAT || BERLIN || GELSENWASSER
public const int WMsCount = 6;
public const int LineSize = 6;
public const int MaxPartNr = 4;
#elif SLM_50
public const int WMsCount = 12;
public const int LineSize = 12;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 1;
public const int HeatMetersCount = 6;
public const int MaxPartNr = WMsCount / LineSize;
#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 LineSize = 10;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif RUM_MOB
public const int WMsCount = 8;
public const int LineSize = 8;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif TURA_IPERL || TURA_IPERL_NEW
public const int WMsCount = 40;
public const int LineSize = 20;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif TURA_SPECIAL || SENTEC
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif SLM_50
public const int WMsCount = 12;
public const int LineSize = 12;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 6;
public const int MaxPartNr = WMsCount / LineSize;
#elif SLM_END || WARSAW_END
public const int WMsCount = 10;
public const int LineSize = 5;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 4;
#elif MALTA_WSD25
public const int WMsCount = 6;
public const int LineSize = 6;
#elif IZRAEL_50
public const int WMsCount = 40;
public const int LineSize = 10;
public const int CompoundWMsCount = 0;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
+7 -1
View File
@@ -10,7 +10,7 @@ namespace Config
/// <summary>
/// Test bench database settings, contains bench name and settings od several databases
/// </summary>
public class DatabaseSettings : ICloneable
public class DatabaseSettings : ICloneable, IComparable
{
// Public fields
public string BenchName;
@@ -45,6 +45,12 @@ namespace Config
return result;
}
public int CompareTo(object dbs2)
{
if (!(dbs2 is DatabaseSettings)) return 0;
return String.Compare(BenchName, (dbs2 as DatabaseSettings).BenchName);
}
public override string ToString()
{
return string.Format("{0} config={1} results={2} events={3} users={4}",
+3 -3
View File
@@ -118,15 +118,15 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Failed" xml:space="preserve">
<value>NiO</value>
<value>Nicht OK</value>
</data>
<data name="Passed" xml:space="preserve">
<value>iO</value>
<value>OK</value>
</data>
<data name="Error" xml:space="preserve">
<value>Fehler</value>
</data>
<data name="Cannot_open_DB_Cause_0" xml:space="preserve">
<value>Datenbank kann nicht geöffnet.\\r\\nUrsache:\\r\\n{0}</value>
<value>Datenbank kann nicht geöffnet werden.\\r\\nUrsache:\\r\\n{0}</value>
</data>
</root>
+166 -130
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2016-2018 Sensus Slovensko a.s.
/// Copyright (c) 2016-2020 Sensus Slovensko a.s.
///
using System;
using System.Reflection;
@@ -17,24 +17,31 @@ namespace Config
#else
[Description("degree")] degree,
#endif
[Description("ml")] ml, /// 1 ml = 0.001 l
[Description("l")] l, /// * 1 liter
[Description("dm3")] dm3, /// 1 dm3 = 1 liter
[Description("m3")] m3, /// 1000 l
[Description("gal(UK)")] gal_UK, /// 1 gal(UK) = 4.54609 l
[Description("gal(US)")] gal_US, /// 1 gal(US) = 3.78541178 l
[Description("dm3")] dm3, /// 1 dm3 = 1 l
[Description("US gal")] USgal, /// 1 US gallon = 3.78541178 l
[Description("imper.gal")] UKgal, /// 1 imperial gallon = 4.54609 l
[Description("cf")] cf, /// 1 cubic foot = 28.316846592 l
[Description("m3")] m3, /// 1 m3 = 1000 l
[Description("l/h")] lph, /// 1 liter/h
[Description("m3/h")] m3ph, /// * 1 m3/h = 1000 l/h
[Description("l/h")] lph, /// 1 l/h = 0.001 m3/h
[Description("l/m")] lpm, /// 1 l/m = 60 l/h = 0.06 m3/h
[Description("m3/h")] m3ph, /// * 1 m3/h
[Description("l/s")] lps, /// 1 liter/s = 3.6 m3/h
[Description("US gal/s")] USgalps, /// 1 US gallon per second = 13.627482408 m3/h
[Description("m3/m")] m3pm, /// 1 m3/m = 60 m3/h
[Description("cf/s")] cfs, /// 1 cubic foot per second = 101.9406477312 m3/h
[Description("g")] g, /// 0.001 kg
[Description("lb")] lb, /// 0.45359237 kg
[Description("kg")] kg, /// * 1 kilogram
[Description("t")] t, /// 1000 kg
[Description("lb")] lb, /// 0.45359237 kg
[Description("ms")] ms, /// 1 ms = 0.001 s
[Description("s")] s, /// * 1 second
[Description("min")] min, /// 1 min = 60 s
[Description("hr")] hour, /// 1 hour = 60 min = 3600 s
[Description("ms")] ms, /// 1 ms = 0.001 s
[Description("°C")] C, /// * degree Celsius (°C)
[Description("°F")] F, /// degree Fahrenheit
@@ -42,21 +49,25 @@ namespace Config
[Description("Pa")] Pa, /// 1 Pa = 0.01 hPa
[Description("hPa")] hPa, /// 1 hPa = 100 Pa
[Description("kPa")] kPa, /// 1 kPa = 10 HPa
[Description("MPa")] MPa, /// 1 MPa = 10000 hPa
[Description("mbar")] mbar, /// 1 mbar = 1 hPa = 100 Pa
[Description("bar")] bar, /// * 1 Bar = 1000 mbar = 0.1 MPa = 100000 Pa
[Description("kPa")] kPa, /// 1 kPa = 10 hPa = 1000 Pa
[Description("inHg")] inHg, /// 1 inHg = 33.864 hPa
[Description("psi")] psi, /// 1 psi = 0.0689475729 bar
[Description("bar")] bar, /// * 1 Bar = 1000 mbar = 0.1 MPa = 100000 Pa
[Description("MPa")] MPa, /// 1 MPa = 10000 hPa
[Description("R%")] RPct, /// * 1 R%
[Description("%")] Pct, /// * 1 %
[Description("promile")] Promile, /// 1 promile = 0.1 %
[Description("%")] Pct, /// * 1 %
[Description("mm")] mm, /// * 1 millimeter
[Description("cm")] cm, /// 1 cm = 10 mm
[Description("m")] m, /// 1 m = 1000 mm
[Description("in")] inch, /// 1 inch = 25.4 mm
[Description("dm")] dm, /// 1 dm = 100 mm
[Description("ft")] foot, /// 1 foot = 304.8 mm
[Description("yd")] yard, /// 1 yard = 914.4 mm
[Description("m")] m, /// 1 m = 1000 mm
[Description("kg/m3")] kgpm3, /// * 1 kg/m3 = 0.001 kg/l
[Description("kg/l")] kgpl, /// 1 kg/l = 1000 kg/m3
@@ -69,6 +80,7 @@ namespace Config
[Description("MWh")] MWh, /// 1 MWh = 3600000000 J
[Description("uS/cm")] uSpcm, /// * 1 uS/cm
[Description("mS/m")] mSpm, /// 1 mS/m = 10 uS/cm
#if LANG_PL
[Description("imp/l")] ppl, /// * 1 pulse/l
@@ -81,17 +93,17 @@ namespace Config
[Description("dm3/stopień")] dm3pdeg, /// * 1 dm3/degree
#else
[Description("pulse/l")] ppl, /// * 1 pulse/l
[Description("pulse/dm3")] ppdm3, /// * 1 pulse/dm3
[Description("degree/l")] degpl, /// * 1 degree/l
[Description("degree/dm3")] degpdm3, /// * 1 degree/dm3
[Description("l/pulse")] lpp, /// * 1 l/pulse
[Description("dm3/pulse")] dm3pp, /// * 1 dm3/pulse
[Description("l/degree")] lpdeg, /// * 1 l/degree
[Description("dm3/degree")] dm3pdeg, /// * 1 dm3/degree
[Description("pulse/dm3")] ppdm3, /// 1 pulse/dm3
[Description("degree/l")] degpl, /// 1 degree/l
[Description("degree/dm3")] degpdm3, /// 1 degree/dm3
[Description("l/pulse")] lpp, /// 1 l/pulse
[Description("dm3/pulse")] dm3pp, /// 1 dm3/pulse
[Description("l/degree")] lpdeg, /// 1 l/degree
[Description("dm3/degree")] dm3pdeg, /// 1 dm3/degree
#endif
///
[Description("pulse/kWh")] ppkWh, /// * 1 pulse/kWh
[Description("kWh/pulse")] kWhpp, /// * 1 kWh/pulse
[Description("kWh/pulse")] kWhpp, /// 1 kWh/pulse
Count
}
@@ -121,6 +133,7 @@ namespace Config
[Description("Text")] String,
[Description("Boolean")] Boolean,
[Description("Datum und Uhrzeit")] DateTime,
[Description("Aufgezählt")] Enumerated,
#elif LANG_PL
[Description("Objętość")] Volume,
[Description("Przepływ")] Flow,
@@ -143,6 +156,7 @@ namespace Config
[Description("Tekst")] String,
[Description("Boolean")] Boolean,
[Description("Data i czas")] DateTime,
[Description("Wyliczone")] Enumerated,
#elif LANG_CS
[Description("Objem")] Volume,
[Description("Průtok")] Flow,
@@ -165,6 +179,7 @@ namespace Config
[Description("Text")] String,
[Description("Boolean")] Boolean,
[Description("Datum a čas")] DateTime,
[Description("Vyjmenované")] Enumerated,
#elif LANG_IT
[Description("Volume")] Volume,
[Description("Flusso")] Flow,
@@ -187,6 +202,7 @@ namespace Config
[Description("Stringa")] String,
[Description("Boolean")] Boolean,
[Description("Data e ora")] DateTime,
[Description("Enumerato")] Enumerated,
#else
[Description("Volume")] Volume,
[Description("Flow")] Flow,
@@ -209,7 +225,7 @@ namespace Config
[Description("String")] String,
[Description("Boolean")] Boolean,
[Description("Date and time")] DateTime,
[Description("Enum")] Enum,
[Description("Enumerated")] Enumerated,
#endif
Count,
}
@@ -223,8 +239,9 @@ namespace Config
public static bool IsDefaultUnit(Unit unit)
{
return unit == Unit.l || unit == Unit.m3ph || unit == Unit.kg || unit == Unit.s || unit == Unit.C || unit == Unit.bar || unit == Unit.RPct ||
unit == Unit.Pct || unit == Unit.mm || unit == Unit.kgpm3 || unit == Unit.J || unit == Unit.ppl || unit == Unit.ppkWh || unit == Unit.uSpcm;
return unit == Unit.l || unit == Unit.m3ph || unit == Unit.kg || unit == Unit.s || unit == Unit.C ||
unit == Unit.bar || unit == Unit.RPct || unit == Unit.Pct || unit == Unit.mm || unit == Unit.kgpm3 ||
unit == Unit.J || unit == Unit.uSpcm || unit == Unit.ppl || unit == Unit.ppkWh;
}
public static bool IsQuantity(Unit units, Quantity quantity)
@@ -238,61 +255,72 @@ namespace Config
{
case Unit.pulse:
case Unit.degree:
return Config.Quantity.Pulses;
return Quantity.Pulses;
case Unit.ml:
case Unit.l:
case Unit.dm3:
case Unit.USgal:
case Unit.UKgal:
case Unit.cf:
case Unit.m3:
case Unit.gal_UK:
case Unit.gal_US:
return Config.Quantity.Volume;
return Quantity.Volume;
case Unit.lph:
case Unit.lpm:
case Unit.m3ph:
return Config.Quantity.Flow;
case Unit.lps:
case Unit.USgalps:
case Unit.m3pm:
case Unit.cfs:
return Quantity.Flow;
case Unit.g:
case Unit.lb:
case Unit.kg:
case Unit.t:
case Unit.lb:
return Config.Quantity.Mass;
return Quantity.Mass;
case Unit.ms:
case Unit.s:
case Unit.min:
case Unit.hour:
case Unit.ms:
return Config.Quantity.Time;
return Quantity.Time;
case Unit.C:
case Unit.F:
case Unit.K:
return Config.Quantity.Temperature;
return Quantity.Temperature;
case Unit.Pa:
case Unit.hPa:
case Unit.mbar:
case Unit.kPa:
case Unit.inHg:
case Unit.psi:
case Unit.bar:
case Unit.MPa:
case Unit.inHg:
return Config.Quantity.Pressure;
return Quantity.Pressure;
case Unit.RPct:
return Config.Quantity.Humidity;
return Quantity.Humidity;
case Unit.Pct:
case Unit.Promile:
return Config.Quantity.Error;
case Unit.Pct:
return Quantity.Error;
case Unit.mm:
case Unit.cm:
case Unit.m:
case Unit.inch:
return Config.Quantity.Length;
case Unit.dm:
case Unit.foot:
case Unit.yard:
case Unit.m:
return Quantity.Length;
case Unit.kgpm3:
case Unit.kgpl:
return Config.Quantity.Density;
return Quantity.Density;
case Unit.J:
case Unit.kJ:
@@ -300,7 +328,11 @@ namespace Config
case Unit.Wh:
case Unit.kWh:
case Unit.MWh:
return Config.Quantity.Energy;
return Quantity.Energy;
case Unit.uSpcm:
case Unit.mSpm:
return Quantity.Conductivity;
case Unit.ppl:
case Unit.ppdm3:
@@ -310,17 +342,14 @@ namespace Config
case Unit.dm3pp:
case Unit.lpdeg:
case Unit.dm3pdeg:
return Config.Quantity.PulsePerLtr;
return Quantity.PulsePerLtr;
case Unit.ppkWh:
case Unit.kWhpp:
return Config.Quantity.PulsePerKWh;
case Unit.uSpcm:
return Config.Quantity.Conductivity;
return Quantity.PulsePerKWh;
default:
return Config.Quantity.Number;
return Quantity.Number;
}
}
@@ -341,77 +370,80 @@ namespace Config
public static bool IsConductivity(Unit units) { return IsQuantity(units, Config.Quantity.Conductivity); }
public static double ConvertTo(Unit units, double v)
{
switch (units)
{
/// Volume: internal representation in l
case Unit.dm3:
case Unit.l: return v; /// 1 liter
case Unit.m3: return 0.001 * v; /// 1 m3 = 1000 l
case Unit.gal_UK: return 0.21996925 * v; /// 1 gal(UK) = 4.54609 l
case Unit.gal_US: return 0.26417205 * v; /// 1 gal(US) = 3.78541178 l
case Unit.ml: return 1000 * v; /// 1 ml = 0.001 l
case Unit.USgal: return 0.26417205 * v; /// 1 gal(US) = 3.78541178 l
case Unit.UKgal: return 0.21996925 * v; /// 1 gal(UK) = 4.54609 l
case Unit.cf: return 0.0353146667215 * v; /// 1 cubic foot = 28.316846592 l
case Unit.m3: return 0.001 * v; /// 1 m3 = 1000 l
/// Flow: internal representation in m3/h
case Unit.lph: return 1000 * v; /// 1 liter/h
case Unit.m3ph: return v; /// 1 m3/h = 1000 l/h
case Unit.lph: return 1000 * v; /// 1 l/h
case Unit.lpm: return v / 0.06; /// 1 l/m
case Unit.lps: return v / 3.6; /// 1 l/s
case Unit.USgalps: return 0.733811257326 * v; /// 1 US gallon per second
case Unit.m3pm: return v / 60; /// 1 m3/m
case Unit.cfs: return 0.009809629644858 * v; /// 1 cubic foot per second
/// Mass: internal representation in kg
case Unit.g: return 1000 * v; /// 1 g = 0.001 kg
case Unit.kg: return v; /// 1 kilogram
case Unit.t: return 0.001 * v; /// 1 t = 1000 kg
case Unit.lb: return 2.2046226 * v; /// 1 lb = 0.45359237 kg
case Unit.g: return 1000 * v; /// 1 g = 0.001 kg
case Unit.lb: return 2.2046226 * v; /// 1 lb = 0.45359237 kg
case Unit.t: return 0.001 * v; /// 1 t = 1000 kg
/// Time or duration: internal representation in seconds [s]
case Unit.s: return v;
case Unit.ms: return 1000 * v;
case Unit.min: return v / 60;
case Unit.hour: return v / 3600;
case Unit.ms: return 1000 * v;
/// Temperature: internal representation in °C
case Unit.C: return v; /// degree Celsius (°C)
case Unit.F: return 1.8 * v + 32; /// degree Fahrenheit
case Unit.K: return v + 273.15; /// degree Kelvin
case Unit.F: return 1.8 * v + 32; /// degree Fahrenheit
case Unit.K: return v + 273.15; /// degree Kelvin
/// Pressure: internal representation in bar = 0.1 MPa
case Unit.Pa: return 100000 * v; /// 1 hPa = 100 Pa
case Unit.hPa: return 1000 * v; /// 1 hPa = 100 Pa
case Unit.mbar: return 1000 * v; /// 1 mbar = 1 hPa = 100 Pa
case Unit.kPa: return 100 * v; /// 1 kPa = 10 HPa
case Unit.bar: return v; /// 1 bar = 1000 mbar = 100000 Pa
case Unit.MPa: return 0.1 * v; /// 1 MPa = 10000 hPa
case Unit.inHg: return 29.53 * v; /// 1 inHg = 33.864 hPa
case Unit.Pa: return 100000 * v; /// 1 hPa = 100 Pa
case Unit.hPa: return 1000 * v; /// 1 hPa = 100 Pa
case Unit.mbar: return 1000 * v; /// 1 mbar = 1 hPa = 100 Pa
case Unit.kPa: return 100 * v; /// 1 kPa = 10 HPa
case Unit.inHg: return 29.53 * v; /// 1 inHg =
case Unit.psi: return 14.5037738 * v; /// 1 psi =
case Unit.MPa: return 0.1 * v; /// 1 MPa = 10000 hPa
/// Error: internal representation in %
case Unit.Pct: return v; /// 1 %
case Unit.Promile: return 10 * v; /// 1 promile = 0.1 %
/// Relative error: internal representation in %
case Unit.Promile: return 10 * v; /// 1 promile = 0.1 %
/// Diameter, length: internal representation in mm
case Unit.mm: return v; /// 1 mm
case Unit.cm: return 0.1 * v; /// 1 cm = 10 mm
case Unit.m: return 0.001 * v; /// 1 m = 1000 mm
case Unit.inch: return v / 25.4; /// 1 inch = 25.4 mm
case Unit.cm: return 0.1 * v; /// 1 cm = 10 mm
case Unit.inch: return v / 25.4; /// 1 inch = 25.4 mm
case Unit.dm: return 0.01 * v; /// 1 dm = 100 mm
case Unit.foot: return v / 304.8; /// 1 foot = 304.8 mm
case Unit.yard: return v / 914.4; /// 1 yard = 914,4 mm
case Unit.m: return 0.001 * v; /// 1 m = 1000 mm
/// Density: internal representation in kg/m3
case Unit.kgpm3: return v;
case Unit.kgpl: return 0.001 * v;
/// Energy, internal representation in Joul
case Unit.J: return v; /// 1 Joul
case Unit.kJ: return 0.001 * v; /// 1 kJ = 1000 J
case Unit.MJ: return 0.000001 * v; /// 1 kJ = 1000000 J
case Unit.Wh: return v / 3600.0; /// 1 Wh = 3600 J
case Unit.kWh: return v / 3600000.0; /// 1 kWh = 3600000 J
case Unit.MWh: return v / 3600000000.0;/// 1 MWh = 3600000000 J
case Unit.kJ: return 0.001 * v; /// 1 kJ = 1000 J
case Unit.MJ: return 0.000001 * v; /// 1 kJ = 1000000 J
case Unit.Wh: return v / 3600.0; /// 1 Wh = 3600 J
case Unit.kWh: return v / 3600000.0; /// 1 kWh = 3600000 J
case Unit.MWh: return v / 3600000000.0; /// 1 MWh = 3600000000 J
/// Electrical conductivity
case Unit.mSpm: return 0.1 * v;
/// Invert pulses
case Unit.kWhpp:
case Unit.lpp:
case Unit.dm3pp:
case Unit.lpdeg:
case Unit.dm3pdeg: return ((v <= float.Epsilon) ? 0 : 1 / v);
case Unit.dm3pdeg: return (v <= float.Epsilon) ? 0 : 1/v;
default: return v;
default: return v; /// Do not convert
}
}
@@ -420,71 +452,75 @@ namespace Config
switch (units)
{
/// Volume: internal representation in l
case Unit.dm3:
case Unit.l: return v; /// 1 liter
case Unit.m3: return 1000 * v; /// 1000 l
case Unit.gal_UK: return 4.54609 * v; /// 1 gal(UK) = 4.54609 l
case Unit.gal_US: return 3.78541178 * v; /// 1 gal(US) = 3.78541178 l
case Unit.ml: return 0.001 * v; /// 0.001 l
case Unit.USgal: return 3.78541178 * v; /// 1 gal(US) = 3.78541178 l
case Unit.UKgal: return 4.54609 * v; /// 1 gal(UK) = 4.54609 l
case Unit.cf: return 28.316846592 * v; /// 1 cubic foot = 28.316846592 l
case Unit.m3: return 1000 * v; /// 1000 l
/// Flow: internal representation in m3/h
case Unit.lph: return 0.001 * v; /// 1 liter/h
case Unit.m3ph: return v; /// 1 m3/h = 1000 l/h
case Unit.lph: return 0.001 * v; /// 1 l/h
case Unit.lpm: return 0.06 * v; /// 1 l/m
case Unit.lps: return 3.6 * v; /// 1 l/s
case Unit.USgalps: return 13.627482408 * v; /// 1 US gallon per second
case Unit.m3pm: return 60 * v; /// 1 m3/m
case Unit.cfs: return 101.9406477312 * v; /// 1 cubic foot per second
/// Mass: internal representation in kg
case Unit.g: return 0.001 * v; /// 1 g = 0.001 kg
case Unit.kg: return v; /// 1 kilogram
case Unit.t: return 1000 * v; /// 1 t = 1000 kg
case Unit.lb: return 0.45359237 * v; /// 1 lb = 0.45359237 kg
case Unit.g: return 0.001 * v; /// 1 g = 0.001 kg
case Unit.lb: return 0.45359237 * v; /// 1 lb = 0.45359237 kg
case Unit.t: return 1000 * v; /// 1 t = 1000 kg
/// Time or duration: internal representation in seconds [s]
case Unit.s: return v;
case Unit.ms: return 0.001 * v;
case Unit.min: return 60 * v;
case Unit.hour: return 3600 * v;
case Unit.ms: return v / 1000;
/// Temperature: internal representation in °C
case Unit.C: return v; /// degree Celsius (°C)
case Unit.F: return 5 * (v-32) / 9; /// degree Fahrenheit
case Unit.K: return v - 273.15; /// degree Kelvin
case Unit.F: return 5 * (v - 32) / 9; /// degree Fahrenheit
case Unit.K: return v - 273.15; /// degree Kelvin
/// Pressure: internal representation in bar = 0.1 MPa
case Unit.Pa: return 0.00001 * v; /// 1 hPa = 100 Pa
case Unit.hPa: return 0.001 * v; /// 1 hPa = 100 Pa
case Unit.mbar: return 0.001 * v; /// 1 mbar = 1 hPa = 100 Pa
case Unit.kPa: return 0.01 * v; /// 1 kPa = 10 HPa
case Unit.bar: return v; /// 1 bar = 1000 mbar = 100000 Pa
case Unit.MPa: return 10 * v; /// 1 MPa = 10000 hPa
case Unit.inHg: return 0.033864 * v; /// 1 inHg = 33.864 hPa
case Unit.Pa: return 0.00001 * v; /// 1 hPa = 100 Pa
case Unit.hPa: return 0.001 * v; /// 1 hPa = 100 Pa
case Unit.mbar: return 0.001 * v; /// 1 mbar = 1 hPa = 100 Pa
case Unit.kPa: return 0.01 * v; /// 1 kPa = 10 HPa
case Unit.inHg: return 0.033864 * v; /// 1 inHg = 33.864 hPa
case Unit.psi: return 0.0689475729 * v; /// 1 psi = 0.0689475729 bar
case Unit.MPa: return 10 * v; /// 1 MPa = 10000 hPa
/// Error: internal representation in %
case Unit.Pct: return v; /// 1 %
case Unit.Promile: return 0.1 * v; /// 1 promile = 0.1 %
/// Relative error: internal representation in %
case Unit.Promile: return 0.1 * v; /// 1 promile = 0.1 %
/// Diameter, length: internal representation in mm
case Unit.mm: return v; /// 1 mm
case Unit.cm: return 10 * v; /// 1 cm = 10 mm
case Unit.m: return 1000 * v; /// 1 m = 1000 mm
case Unit.inch: return 25.4 * v; /// 1 inch = 25.4 mm
case Unit.cm: return 10 * v; /// 1 cm = 10 mm
case Unit.inch: return 25.4 * v; /// 1 inch = 25.4 mm
case Unit.dm: return 100 * v; /// 1 dm = 100 mm
case Unit.foot: return 304.8 * v; /// 1 foot = 304.8 mm
case Unit.yard: return 914.4 * v; /// 1 yard = 914,4 mm
case Unit.m: return 1000 * v; /// 1 m = 1000 mm
/// Density: internal representation in kg/m3
case Unit.kgpm3: return v;
case Unit.kgpl: return 1000 * v;
/// Energy, internal representation in Joul
case Unit.J: return v; /// 1 Joul
case Unit.kJ: return 1000 * v; /// 1 kJ = 1000 J
case Unit.MJ: return 1000000 * v; /// 1 kJ = 1000000 J
case Unit.Wh: return 3600 * v; /// 1 Wh = 3600 J
case Unit.kWh: return 3600000 * v; /// 1 kWh = 3600000 J
case Unit.MWh: return 3600000000 * v; /// 1 kWh = 3600000000 J
case Unit.kJ: return 1000 * v; /// 1 kJ = 1000 J
case Unit.MJ: return 1000000 * v; /// 1 kJ = 1000000 J
case Unit.Wh: return 3600 * v; /// 1 Wh = 3600 J
case Unit.kWh: return 3600000 * v; /// 1 kWh = 3600000 J
case Unit.MWh: return 3600000000 * v; /// 1 kWh = 3600000000 J
/// Electrical conductivity
case Unit.mSpm: return 10 * v;
/// Invert
case Unit.kWhpp:
case Unit.lpp:
case Unit.dm3pp:
case Unit.lpdeg:
case Unit.dm3pdeg: return ((v == 0) ? 0 : 1 / v);
case Unit.dm3pdeg: return (v <= float.Epsilon) ? 0 : 1/v;
default: return v;
default: return v; /// Do not convert
}
}
}
+324 -18
View File
@@ -13,22 +13,28 @@ namespace DataStreamInterface
degree,
/// Volume
ml, /// 0.001 l
l, /// * 1 liter = 1 l
ml, /// 1 ml = 0.001 l
l, /// * 1 liter
dm3, /// 1 dm3 = 1 l
m3, /// 1000 l
gal_UK, /// 1 gal(UK) = 4.54609 l
gal_US, /// 1 gal(US) = 3.78541178 l
USgal, /// 1 US gallon = 3.78541178 l
UKgal, /// 1 imperial gallon = 4.54609 l
cf, /// 1 cubic foot = 28.316846592 l
m3, /// 1 m3 = 1000 l
/// Flow
lph, /// 1 liter/h
m3ph, /// * 1 m3/h = 1000 l/h
lph, /// 1 l/h = 0.001 m3/h
lpm, /// 1 l/m = 60 l/h = 0.06 m3/h
m3ph, /// * 1 m3/h
lps, /// 1 liter/s = 3.6 m3/h
USgalps, /// 1 US gallon per second = 13.627482408 m3/h
m3pm, /// 1 m3/m = 60 m3/h
cfs, /// 1 cubic foot per second = 101.9406477312 m3/h
/// Mass
g, /// 0.001 kg
lb, /// 0.45359237 kg
kg, /// * 1 kilogram
t, /// 1000 kg
lb, /// 0.45359237 kg
/// Time
ms, /// 1 ms = 0.001 s
@@ -47,6 +53,7 @@ namespace DataStreamInterface
mbar, /// 1 mbar = 1 hPa = 100 Pa
kPa, /// 1 kPa = 10 HPa
inHg, /// 1 inHg = 33.864 hPa
psi, /// 1 psi = 0.0689475729 bar
bar, /// * 1 Bar = 1000 mbar = 0.1 MPa = 100000 Pa
MPa, /// 1 MPa = 10000 hPa
@@ -61,7 +68,9 @@ namespace DataStreamInterface
mm, /// * 1 millimeter
cm, /// 1 cm = 10 mm
inch, /// 1 inch = 25.4 mm
dm, /// 1 dm = 100 mm
foot, /// 1 foot = 304.8 mm
yard, /// 1 yard = 914.4 mm
m, /// 1 m = 1000 mm
/// Density
@@ -76,20 +85,317 @@ namespace DataStreamInterface
kWh, /// 1 kWh = 3600000 J
MWh, /// 1 MWh = 3600000000 J
/// Electrical conductivity
uSpcm, /// * 1 uS/cm
mSpm, /// 1 mS/m = 10 uS/cm
/// Meter coefficient - volume
ppl, /// * 1 pulse/l
ppdm3, /// * 1 pulse/dm3
degpl, /// * 1 degree/l
degpdm3, /// * 1 degree/dm3
lpp, /// * 1 l/pulse
dm3pp, /// * 1 dm3/pulse
lpdeg, /// * 1 l/degree
dm3pdeg, /// * 1 dm3/degree
ppdm3, /// 1 pulse/dm3
degpl, /// 1 degree/l
degpdm3, /// 1 degree/dm3
lpp, /// 1 l/pulse
dm3pp, /// 1 dm3/pulse
lpdeg, /// 1 l/degree
dm3pdeg, /// 1 dm3/degree
/// Meter coefficient - energy
ppkWh, /// * 1 pulse/kWh
kWhpp, /// * 1 kWh/pulse
Count
kWhpp, /// 1 kWh/pulse
}
public enum Quantity
{
/// Quantities with units and conversions (double -> double)
Volume,
Flow,
Mass,
Time,
Temperature,
Pressure,
Humidity,
Error,
Length,
Density,
Energy,
Pulses,
PulsePerLtr,
PulsePerKWh,
Conductivity,
/// Quantities without units and conversions
Number,
String,
Boolean,
DateTime,
Enumerated,
}
public static class Units
{
public static bool IsDefaultUnit(Unit unit)
{
return unit == Unit.l || unit == Unit.m3ph || unit == Unit.kg || unit == Unit.s || unit == Unit.C ||
unit == Unit.bar || unit == Unit.RPct || unit == Unit.Pct || unit == Unit.mm || unit == Unit.kgpm3 ||
unit == Unit.J || unit == Unit.uSpcm || unit == Unit.ppl || unit == Unit.ppkWh;
}
public static Quantity GetQuantity(Unit units)
{
switch (units)
{
case Unit.pulse:
case Unit.degree:
return Quantity.Pulses;
case Unit.ml:
case Unit.l:
case Unit.dm3:
case Unit.USgal:
case Unit.UKgal:
case Unit.cf:
case Unit.m3:
return Quantity.Volume;
case Unit.lph:
case Unit.lpm:
case Unit.m3ph:
case Unit.lps:
case Unit.USgalps:
case Unit.m3pm:
case Unit.cfs:
return Quantity.Flow;
case Unit.g:
case Unit.lb:
case Unit.kg:
case Unit.t:
return Quantity.Mass;
case Unit.ms:
case Unit.s:
case Unit.min:
case Unit.hour:
return Quantity.Time;
case Unit.C:
case Unit.F:
case Unit.K:
return Quantity.Temperature;
case Unit.Pa:
case Unit.hPa:
case Unit.mbar:
case Unit.kPa:
case Unit.inHg:
case Unit.psi:
case Unit.bar:
case Unit.MPa:
return Quantity.Pressure;
case Unit.RPct:
return Quantity.Humidity;
case Unit.Promile:
case Unit.Pct:
return Quantity.Error;
case Unit.mm:
case Unit.cm:
case Unit.inch:
case Unit.dm:
case Unit.foot:
case Unit.yard:
case Unit.m:
return Quantity.Length;
case Unit.kgpm3:
case Unit.kgpl:
return Quantity.Density;
case Unit.J:
case Unit.kJ:
case Unit.MJ:
case Unit.Wh:
case Unit.kWh:
case Unit.MWh:
return Quantity.Energy;
case Unit.uSpcm:
case Unit.mSpm:
return Quantity.Conductivity;
case Unit.ppl:
case Unit.ppdm3:
case Unit.degpl:
case Unit.degpdm3:
case Unit.lpp:
case Unit.dm3pp:
case Unit.lpdeg:
case Unit.dm3pdeg:
return Quantity.PulsePerLtr;
case Unit.ppkWh:
case Unit.kWhpp:
return Quantity.PulsePerKWh;
default:
return Quantity.Number;
}
}
public static double ConvertTo(Unit units, double v)
{
switch (units)
{
/// Volume: internal representation in l
case Unit.ml: return 1000 * v; /// 1 l = 1000 ml
case Unit.USgal: return 0.26417205 * v; /// 1 gal(US) = 3.78541178 l
case Unit.UKgal: return 0.21996925 * v; /// 1 gal(UK) = 4.54609 l
case Unit.cf: return 0.0353146667215 * v; /// 1 cubic foot = 28.316846592 l
case Unit.m3: return 0.001 * v; /// 1 m3 = 1000 l
/// Flow: internal representation in m3/h
case Unit.lph: return 1000 * v; /// 1 l/h
case Unit.lpm: return v / 0.06; /// 1 l/m
case Unit.lps: return v / 3.6; /// 1 l/s
case Unit.USgalps: return 0.733811257326 * v; /// 1 US gallon per second
case Unit.m3pm: return v / 60; /// 1 m3/m
case Unit.cfs: return 0.009809629644858 * v; /// 1 cubic foot per second
/// Mass: internal representation in kg
case Unit.g: return 1000 * v; /// 1 g = 0.001 kg
case Unit.lb: return 2.2046226 * v; /// 1 lb = 0.45359237 kg
case Unit.t: return 0.001 * v; /// 1 t = 1000 kg
/// Time or duration: internal representation in seconds [s]
case Unit.ms: return 1000 * v;
case Unit.min: return v / 60;
case Unit.hour: return v / 3600;
/// Temperature: internal representation in °C
case Unit.F: return 1.8 * v + 32; /// degree Fahrenheit
case Unit.K: return v + 273.15; /// degree Kelvin
/// Pressure: internal representation in bar = 0.1 MPa
case Unit.Pa: return 100000 * v;
case Unit.hPa: return 1000 * v; /// 1 hPa = 100 Pa
case Unit.mbar: return 1000 * v; /// 1 mbar = 1 hPa = 100 Pa
case Unit.kPa: return 100 * v; /// 1 kPa = 10 HPa
case Unit.inHg: return 29.53 * v; /// 1 inHg =
case Unit.psi: return 14.5037738 * v; /// 1 psi =
case Unit.MPa: return 0.1 * v; /// 1 MPa = 10000 hPa
/// Relative error: internal representation in %
case Unit.Promile: return 10 * v; /// 1 promile = 0.1 %
/// Diameter, length: internal representation in mm
case Unit.cm: return 0.1 * v; /// 1 cm = 10 mm
case Unit.inch: return v / 25.4; /// 1 inch = 25.4 mm
case Unit.dm: return 0.01 * v; /// 1 dm = 100 mm
case Unit.foot: return v / 304.8; /// 1 foot = 304.8 mm
case Unit.yard: return v / 914.4; /// 1 yard = 914,4 mm
case Unit.m: return 0.001 * v; /// 1 m = 1000 mm
/// Density: internal representation in kg/m3
case Unit.kgpl: return 0.001 * v;
/// Energy, internal representation in Joul
case Unit.kJ: return 0.001 * v; /// 1 kJ = 1000 J
case Unit.MJ: return 0.000001 * v; /// 1 kJ = 1000000 J
case Unit.Wh: return v / 3600.0; /// 1 Wh = 3600 J
case Unit.kWh: return v / 3600000.0; /// 1 kWh = 3600000 J
case Unit.MWh: return v / 3600000000.0; /// 1 MWh = 3600000000 J
/// Electrical conductivity
case Unit.mSpm: return 0.1 * v;
/// Invert pulses
case Unit.kWhpp:
case Unit.lpp:
case Unit.dm3pp:
case Unit.lpdeg:
case Unit.dm3pdeg: return (v <= float.Epsilon) ? 0 : 1/v;
default: return v; /// Do not convert
}
}
public static double ConvertFrom(Unit units, double v)
{
switch (units)
{
/// Volume: internal representation in l
case Unit.ml: return 0.001 * v; /// 0.001 l
case Unit.USgal: return 3.78541178 * v; /// 1 gal(US) = 3.78541178 l
case Unit.UKgal: return 4.54609 * v; /// 1 gal(UK) = 4.54609 l
case Unit.cf: return 28.316846592 * v; /// 1 cubic foot = 28.316846592 l
case Unit.m3: return 1000 * v; /// 1000 l
/// Flow: internal representation in m3/h
case Unit.lph: return 0.001 * v; /// 1 l/h
case Unit.lpm: return 0.06 * v; /// 1 l/m
case Unit.lps: return 3.6 * v; /// 1 l/s
case Unit.USgalps: return 13.627482408 * v; /// 1 US gallon per second
case Unit.m3pm: return 60 * v; /// 1 m3/m
case Unit.cfs: return 101.9406477312 * v; /// 1 cubic foot per second
/// Mass: internal representation in kg
case Unit.g: return 0.001 * v; /// 1 g = 0.001 kg
case Unit.lb: return 0.45359237 * v; /// 1 lb = 0.45359237 kg
case Unit.t: return 1000 * v; /// 1 t = 1000 kg
/// Time or duration: internal representation in seconds [s]
case Unit.ms: return 0.001 * v;
case Unit.min: return 60 * v;
case Unit.hour: return 3600 * v;
/// Temperature: internal representation in °C
case Unit.F: return 5 * (v - 32) / 9; /// degree Fahrenheit
case Unit.K: return v - 273.15; /// degree Kelvin
/// Pressure: internal representation in bar = 0.1 MPa
case Unit.Pa: return 0.00001 * v; /// 1 hPa = 100 Pa
case Unit.hPa: return 0.001 * v; /// 1 hPa = 100 Pa
case Unit.mbar: return 0.001 * v; /// 1 mbar = 1 hPa = 100 Pa
case Unit.kPa: return 0.01 * v; /// 1 kPa = 10 HPa
case Unit.inHg: return 0.033864 * v; /// 1 inHg = 33.864 hPa
case Unit.psi: return 0.0689475729 * v; /// 1 psi = 0.0689475729 bar
case Unit.MPa: return 10 * v; /// 1 MPa = 10000 hPa
/// Relative error: internal representation in %
case Unit.Promile: return 0.1 * v; /// 1 promile = 0.1 %
/// Diameter, length: internal representation in mm
case Unit.cm: return 10 * v; /// 1 cm = 10 mm
case Unit.inch: return 25.4 * v; /// 1 inch = 25.4 mm
case Unit.dm: return 100 * v; /// 1 dm = 100 mm
case Unit.foot: return 304.8 * v; /// 1 foot = 304.8 mm
case Unit.yard: return 914.4 * v; /// 1 yard = 914,4 mm
case Unit.m: return 1000 * v; /// 1 m = 1000 mm
/// Density: internal representation in kg/m3
case Unit.kgpl: return 1000 * v;
/// Energy, internal representation in Joul
case Unit.kJ: return 1000 * v; /// 1 kJ = 1000 J
case Unit.MJ: return 1000000 * v; /// 1 kJ = 1000000 J
case Unit.Wh: return 3600 * v; /// 1 Wh = 3600 J
case Unit.kWh: return 3600000 * v; /// 1 kWh = 3600000 J
case Unit.MWh: return 3600000000 * v; /// 1 kWh = 3600000000 J
/// Electrical conductivity
case Unit.mSpm: return 10 * v;
/// Invert
case Unit.kWhpp:
case Unit.lpp:
case Unit.dm3pp:
case Unit.lpdeg:
case Unit.dm3pdeg: return (v <= float.Epsilon) ? 0 : 1/v;
default: return v; /// Do not convert
}
}
}
}
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
+46
View File
@@ -0,0 +1,46 @@
using System;
using System.IO;
using TBF;
namespace ResetBatchNr
{
class Program
{
static LocalSettings ls;
static void Main(string[] args)
{
if (!Directory.Exists(TBF.Program.ConfigDir)) return;
Environment.CurrentDirectory = TBF.Program.ConfigDir;
ls = LocalSettings.Load(TBF.Program.LocalSettingsFileName);
if (ls == null || ls.TestBenches == null)
{
/// Loading local seetings from regular config file failed. Use the backup
ls = LocalSettings.Load(TBF.Program.LocalSettingsBackupName);
if (ls == null || ls.TestBenches == null)
{
/// Neither config.xml, nor config.backup.xml could be loaded
Console.WriteLine(string.Format("Could not load file {0}, nor {1}.", TBF.Program.LocalSettingsFileName, TBF.Program.LocalSettingsBackupName));
Console.ReadLine();
return;
}
}
else
{
/// Loading local seetings from the regular config file was successful. Update the backup
File.Copy(TBF.Program.LocalSettingsFileName, TBF.Program.LocalSettingsBackupName, true);
}
///
/// Process local settings so that windows are shifted to the 1st monitor
///
ls.BatchNr = 1;
ls.Save();
Console.WriteLine("BatchNr was reset to 1");
Console.ReadLine();
return;
}
}
}
+36
View File
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ResetBatchNr")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ResetBatchNr")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("de8130eb-2f43-46a6-9f5b-bf96432a0c7c")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+72
View File
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D7F5A111-B2DF-4761-9574-AB730DF573A6}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ResetBatchNr</RootNamespace>
<AssemblyName>ResetBatchNr</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Config\Config.csproj">
<Project>{743df7db-c7b6-42eb-986d-0f485e5588e4}</Project>
<Name>Config</Name>
</ProjectReference>
<ProjectReference Include="..\TBF\TBF.csproj">
<Project>{8648fd92-cda1-4c3a-b5f9-fe547ce1fa48}</Project>
<Name>TBF</Name>
</ProjectReference>
<ProjectReference Include="..\Users\Users.csproj">
<Project>{6e5cb0e9-e1b6-4e5d-ac6e-b1049e180f2b}</Project>
<Name>Users</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
+5 -4
View File
@@ -66,13 +66,13 @@ namespace Results
switch (dbType)
{
default:
case Users.Entities.DBType.SQLite:
cfg = cfg.Database(SQLiteConfiguration.Standard.UsingFile(connectionString));
break;
case Users.Entities.DBType.MySql:
cfg = cfg.Database(MySQLConfiguration.Standard.ConnectionString(connectionString));
break;
}
case Users.Entities.DBType.SQLite:
cfg = cfg.Database(SQLiteConfiguration.Standard.UsingFile(connectionString));
break;
}
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Entities.WaterMeterData>());
@@ -311,6 +311,7 @@ namespace Results
batch.TestRslts = session.QueryOver<TestRslt>()
.Where(x => (x.Batch.Id == batch.Id))
.List();
batch.WaterMeters = session.QueryOver<WaterMeter>()
.Where(x => (x.Batch.Id == batch.Id))
.List();
Binary file not shown.
Binary file not shown.
@@ -1,19 +1,24 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
/// Copyright (c) 2017-2020 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Printing;
using System.IO;
using Config.Entities;
using GenCode128;
using Gma.QrCodeNet.Encoding;
using Results.Resources;
namespace Results.Output.Printers.Enhanced
{
public class EnhancedPrintDocument : PrintDocument
{
/// Size of the printed area without margins, after taking into account 'pageOrientation'
static QrEncoder encoder = new QrEncoder();
/// Size of the printed area without margins, after taking into account 'pageOrientation'
readonly int printHeight;
readonly int printWidth;
@@ -23,12 +28,14 @@ namespace Results.Output.Printers.Enhanced
readonly int TitleX;
readonly int TitleY; /// Depends on the size of the header
readonly int SpacingOne;
readonly int SpacingOneAndHalf;
readonly int SpacingOne4Header;
readonly int SpacingOneAndHalf4Header;
readonly int spacingOne;
readonly int spacingOneAndHalf;
readonly int spacingOne4Header;
readonly int spacingOneAndHalf4Header;
readonly int spacingOne4Footer;
readonly int SpacingOne4Footer;
int spacingAboveTable;
int spacingBelowTable;
int CommonTop; /// = TitleY + 60
int BodyTop; /// = HdrTop + 160
@@ -124,11 +131,11 @@ namespace Results.Output.Printers.Enhanced
}
/// Document outline preliminary calculations
SpacingOne = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", font).Height;
SpacingOneAndHalf = (3 * SpacingOne) / 2;
SpacingOne4Header = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", headerFont).Height;
SpacingOneAndHalf4Header = (3 * SpacingOne4Header) / 2;
SpacingOne4Footer = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", footerFont).Height;
spacingOne = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", font).Height;
spacingOneAndHalf = (3 * spacingOne) / 2;
spacingOne4Header = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", headerFont).Height;
spacingOneAndHalf4Header = (3 * spacingOne4Header) / 2;
spacingOne4Footer = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", footerFont).Height;
TitleX = cfg.LeftMargin;
TitleY = cfg.TopMargin;
@@ -178,17 +185,27 @@ namespace Results.Output.Printers.Enhanced
/// Prepare document outline
///----------
titleHeight = System.Windows.Forms.TextRenderer.MeasureText(header, titleFont).Height;
CommonTop = TitleY + titleHeight + SpacingOne4Header;
CommonTop = TitleY + titleHeight + spacingOne4Header;
commonHeight = commonItems.Count * SpacingOne;
BodyTop = CommonTop + commonHeight + SpacingOne4Header;
commonHeight = commonItems.Count * spacingOne;
BodyTop = CommonTop + commonHeight + spacingOne4Header;
Table table0 = Table.Create_TestsAreRows(batch.WaterMeters[0], testItems, style);
SizeF tableSize = table0.Measure(e);
int wmSectionHeight = (int)tableSize.Height + SpacingOne4Header * ((tableSize.Height > 0) ? 3 : 2);
nrWMsOnFirstPage = (printHeight - BodyTop + TitleY - 2 * SpacingOne) / wmSectionHeight;
nrWMsOnNextPage = (printHeight - 2 * SpacingOne) / wmSectionHeight;
if (cfg.BarcodeType == BarcodeType.None)
{
spacingAboveTable = spacingOneAndHalf4Header;
}
else
{
spacingAboveTable = Math.Max(spacingOneAndHalf4Header, cfg.BarcodeHeight + spacingOne4Header / 2);
}
spacingBelowTable = (tableSize.Height > 0) ? spacingOneAndHalf4Header : (spacingOne4Header / 2);
int wmSectionHeight = (int)tableSize.Height + spacingAboveTable + spacingBelowTable;
nrWMsOnFirstPage = (printHeight - BodyTop + TitleY - 2 * spacingOne) / wmSectionHeight;
nrWMsOnNextPage = (printHeight - 2 * spacingOne) / wmSectionHeight;
nrWMsOnNextPage = Math.Max(nrWMsOnNextPage, 1); /// Prevent division by zero if there are too many WM tests
nrPages = 1 + (batch.WaterMeters.Count - nrWMsOnFirstPage + nrWMsOnNextPage - 1) / nrWMsOnNextPage;
@@ -221,8 +238,8 @@ namespace Results.Output.Printers.Enhanced
/// Write aligned columns
for (int i = 0; i < Math.Min(leftColumn.Length, rightColumn.Length); i++)
{
PrintAt(e, leftMargin, CommonTop + SpacingOne * i, leftColumn[i]);
PrintAt(e, 300, CommonTop + SpacingOne * i, rightColumn[i]);
PrintAt(e, leftMargin, CommonTop + spacingOne * i, leftColumn[i]);
PrintAt(e, 300, CommonTop + spacingOne * i, rightColumn[i]);
}
}
@@ -241,7 +258,7 @@ namespace Results.Output.Printers.Enhanced
int wmPosition = true ? batch.WaterMeters[wmNr].WMPosition : (wmNr + 1);
if (!cfg.GoodOnly || batch.WaterMeters[wmNr].Passed)
{
nextWmTop = (int)PrintWM(e, batch.WaterMeters[wmNr], wmPosition, nextWmTop) + SpacingOneAndHalf4Header;
nextWmTop = (int)PrintWM(e, batch.WaterMeters[wmNr], wmPosition, nextWmTop) + spacingBelowTable;
}
}
@@ -252,11 +269,11 @@ namespace Results.Output.Printers.Enhanced
/// Footer
///----------
int footerWidth = (int)e.Graphics.MeasureString(footer, footerFont).Width;
PrintFooterAt(e, leftMargin + (printWidth - footerWidth) / 2, topMargin + printHeight - 2 * SpacingOne, footer);
PrintFooterAt(e, leftMargin + (printWidth - footerWidth) / 2, topMargin + printHeight - 2 * spacingOne, footer);
string pageNrText = string.Format("{0} {1}/{2}", Strings.Page, pageNr++, nrPages);
int pageNrWidth = (int)e.Graphics.MeasureString(pageNrText, font).Width;
PrintAt(e, leftMargin + (printWidth - pageNrWidth) / 2, topMargin + printHeight - SpacingOne, pageNrText);
PrintAt(e, leftMargin + (printWidth - pageNrWidth) / 2, topMargin + printHeight - spacingOne, pageNrText);
}
@@ -270,25 +287,48 @@ namespace Results.Output.Printers.Enhanced
float PrintWM(System.Drawing.Printing.PrintPageEventArgs e,
Results.Entities.WaterMeter wm, int printedWMNr, int top)
{
int tableTop = top + spacingAboveTable;
/// Print the water meter number and the serial number
string wmText = string.Format("{0} {1}", Strings.Water_Meter, printedWMNr);
PrintHeaderAt(e, leftMargin, top, wmText);
if (!string.IsNullOrEmpty(wm.SerialNr))
if (string.IsNullOrEmpty(wm.SerialNr))
{
PrintHeaderAt(e, leftMargin + (int)e.Graphics.MeasureString(wmText, headerFont).Width, top,
string.Format(" {0} = {1}", Strings.sn, wm.SerialNr));
string wmText = string.Format("{0} {1}", Strings.Water_Meter, printedWMNr);
int wmTextWidth = (int)e.Graphics.MeasureString(wmText, headerFont).Width;
PrintHeaderAt(e, leftMargin, tableTop - spacingOneAndHalf4Header, wmText);
}
else
{
string wmText = string.Format("{0} {1} {2} = {3}", Strings.Water_Meter, printedWMNr, Strings.sn, wm.SerialNr);
int wmTextWidth = (int)e.Graphics.MeasureString(wmText, headerFont).Width;
PrintHeaderAt(e, leftMargin, tableTop - spacingOneAndHalf4Header, wmText);
switch (cfg.BarcodeType)
{
case BarcodeType.Code_128_Horizontally:
{
Image img = Code128Rendering.MakeBarcodeImage(wm.SerialNr, 1, true);
e.Graphics.DrawImage(img, leftMargin + wmTextWidth + spacingOne4Header, top, cfg.BarcodeWidth, cfg.BarcodeHeight);
break;
}
case BarcodeType.Code_128_Vertically:
{
Image img = Code128Rendering.MakeBarcodeImage(wm.SerialNr, 1, true);
img.RotateFlip(RotateFlipType.Rotate90FlipNone);
e.Graphics.DrawImage(img, leftMargin + wmTextWidth + spacingOne4Header, top, cfg.BarcodeWidth, cfg.BarcodeHeight);
break;
}
case BarcodeType.QR_Code:
{
QrCode qrCode = encoder.Encode(wm.SerialNr);
DrawQR(e.Graphics, qrCode, leftMargin + wmTextWidth + spacingOne4Header, top, cfg.BarcodeWidth, cfg.BarcodeHeight);
break;
}
}
}
Table table = Table.Create_TestsAreRows(wm, testItems, style);
if (table.IsEmpty())
{
return top;
}
else
{
return table.Draw(e, leftMargin, top + SpacingOneAndHalf4Header);
}
return table.IsEmpty() ? tableTop : table.Draw(e, leftMargin, tableTop);
}
@@ -298,7 +338,7 @@ namespace Results.Output.Printers.Enhanced
}
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
{
RectangleF printArea = new RectangleF(x, y, 2000, SpacingOne);
RectangleF printArea = new RectangleF(x, y, 2000, spacingOne);
e.Graphics.DrawString(text, this.font, Brushes.Black, printArea);
}
@@ -309,7 +349,7 @@ namespace Results.Output.Printers.Enhanced
}
void PrintHeaderAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
{
RectangleF printArea = new RectangleF(x, y, 2000, SpacingOne4Header);
RectangleF printArea = new RectangleF(x, y, 2000, spacingOne4Header);
e.Graphics.DrawString(text, this.headerFont, Brushes.Black, printArea);
}
@@ -320,8 +360,33 @@ namespace Results.Output.Printers.Enhanced
}
void PrintFooterAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
{
RectangleF printArea = new RectangleF(x, y, 2000, SpacingOne4Footer);
RectangleF printArea = new RectangleF(x, y, 2000, spacingOne4Footer);
e.Graphics.DrawString(text, this.footerFont, Brushes.Black, printArea);
}
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) 2017 Sensus Slovensko a.s.
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
///
namespace Results.Output.Printers.Enhanced
@@ -30,5 +30,8 @@ namespace Results.Output.Printers.Enhanced
public string[] CommonItems;
public string[] TestItems;
public string Footer;
}
public BarcodeType BarcodeType; /// s/n is printed as barcode when valid (BarcodeType.None < BarcodeType < BarcodeType.Count)
public int BarcodeWidth;
public int BarcodeHeight;
}
}
@@ -1,12 +1,15 @@
///
/// Copyright (c) 2017-2018 Sensus Slovensko a.s.
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Printing;
using System.IO;
using Config.Entities;
using GenCode128;
using Gma.QrCodeNet.Encoding;
using Results.Resources;
namespace Results.Output.Printers.OnePerMeter
@@ -16,7 +19,9 @@ namespace Results.Output.Printers.OnePerMeter
const float GapBetweenTableColumns = 10;
const float GapBetweenCommonColumns = 10;
/// Size of the printed area without margins, after taking into account 'pageOrientation'
static QrEncoder encoder = new QrEncoder();
/// Size of the printed area without margins, after taking into account 'pageOrientation'
readonly int printHeight;
readonly int printWidth;
@@ -158,6 +163,30 @@ namespace Results.Output.Printers.OnePerMeter
WMChart.GetChart(wm, true).Printing.PrintPaint(e.Graphics, pos);
}
if (cfg.BarcodeType != BarcodeType.None && cfg.BarcodeType < BarcodeType.Count && !string.IsNullOrEmpty(wm.SerialNr))
{
try
{
if (cfg.BarcodeType == BarcodeType.QR_Code)
{
QrCode qrCode = encoder.Encode(wm.SerialNr);
DrawQR(e.Graphics, qrCode, cfg.BarcodeLeft, cfg.BarcodeTop, cfg.BarcodeWidth, cfg.BarcodeHeight);
}
else if (cfg.BarcodeType == BarcodeType.Code_128_Horizontally || cfg.BarcodeType == BarcodeType.Code_128_Vertically)
{
Image img = Code128Rendering.MakeBarcodeImage(wm.SerialNr, 1, true);
if (cfg.BarcodeType == BarcodeType.Code_128_Vertically)
{
img.RotateFlip(RotateFlipType.Rotate90FlipNone);
}
e.Graphics.DrawImage(img, cfg.BarcodeLeft, cfg.BarcodeTop, cfg.BarcodeWidth, cfg.BarcodeHeight);
}
}
catch (Exception)
{
}
}
float tableTop = cfg.TopMargin;
if (pageNr == 1)
@@ -351,5 +380,30 @@ namespace Results.Output.Printers.OnePerMeter
pageNr++;
}
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) 2017-2019 Sensus Slovensko a.s.
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
///
namespace Results.Output.Printers.OnePerMeter
@@ -54,5 +54,10 @@ namespace Results.Output.Printers.OnePerMeter
public int ImgWid;
public int ImgHgh;
public string ImgFullPathName;
public BarcodeType BarcodeType; /// s/n is printed as barcode when valid (BarcodeType.None < BarcodeType < BarcodeType.Count)
public int BarcodeLeft;
public int BarcodeTop;
public int BarcodeWidth;
public int BarcodeHeight;
}
}
+442 -28
View File
@@ -130,7 +130,7 @@
<value>Ergebnisse</value>
</data>
<data name="Batch_nr" xml:space="preserve">
<value>Stapel Nr.</value>
<value>Los Nr.</value>
</data>
<data name="Bench" xml:space="preserve">
<value>Prüfstand</value>
@@ -154,13 +154,13 @@
<value>Endzeit</value>
</data>
<data name="EndState_aux" xml:space="preserve">
<value>Eindstand Nebenz.</value>
<value>Endstand Nebenzähler</value>
</data>
<data name="EndState_main" xml:space="preserve">
<value>Eindstand Hauptz.</value>
<value>Endstand Hauptzähler</value>
</data>
<data name="End_state" xml:space="preserve">
<value>Eindstand</value>
<value>Endstand</value>
</data>
<data name="ErrLimHi" xml:space="preserve">
<value>Fehlergrenze hoch</value>
@@ -175,10 +175,10 @@
<value>Referenzfehler</value>
</data>
<data name="Err_aux" xml:space="preserve">
<value>Fehler Nebenz.</value>
<value>Fehler Nebenzähler</value>
</data>
<data name="Err_main" xml:space="preserve">
<value>Fehler Hauptz.</value>
<value>Fehler Hauptzähler</value>
</data>
<data name="Flow" xml:space="preserve">
<value>Durchfluss</value>
@@ -187,13 +187,13 @@
<value>Format</value>
</data>
<data name="H_amb" xml:space="preserve">
<value>H umgebung</value>
<value>Luftfeuchte Umgebung</value>
</data>
<data name="Item" xml:space="preserve">
<value>Posten</value>
<value>Objekt</value>
</data>
<data name="MClass" xml:space="preserve">
<value>Metr. Klasse</value>
<value>Metrologische Klasse</value>
</data>
<data name="OkBtnText" xml:space="preserve">
<value>OK</value>
@@ -220,34 +220,34 @@
<value>Impulse/l</value>
</data>
<data name="P_amb" xml:space="preserve">
<value>Dr umgebung</value>
<value>Druck amb. (Umgebungsdruck)</value>
</data>
<data name="P_dn_end" xml:space="preserve">
<value>Dr aus ende</value>
<value>Druck Eingang Prüfungsende</value>
</data>
<data name="P_dn" xml:space="preserve">
<value>Dr aus</value>
<value>Druck Eingang</value>
</data>
<data name="P_dn_start" xml:space="preserve">
<value>Dr aus start</value>
<value>Druck Eingang Prüfungsbeginn</value>
</data>
<data name="P_up_end" xml:space="preserve">
<value>Dr ein ende</value>
<value>Druck Ausgang Prüfungsende</value>
</data>
<data name="P_up" xml:space="preserve">
<value>Dr ein</value>
<value>Druck Ausgang</value>
</data>
<data name="P_up_start" xml:space="preserve">
<value>Dr ein start</value>
<value>Druck Ausgang Prüfungsanfang</value>
</data>
<data name="Q_fall" xml:space="preserve">
<value>Q fall</value>
<value>Q Fall </value>
</data>
<data name="Q_from" xml:space="preserve">
<value>Q von</value>
</data>
<data name="Q_rise" xml:space="preserve">
<value>Q steig</value>
<value>Q Steig</value>
</data>
<data name="Q_to" xml:space="preserve">
<value>Q bis</value>
@@ -292,13 +292,13 @@
<value>Prüfvolumen</value>
</data>
<data name="T_amb" xml:space="preserve">
<value>T umgebung</value>
<value>T Umgebung</value>
</data>
<data name="T_div" xml:space="preserve">
<value>T div</value>
<value>T Umschaltung</value>
</data>
<data name="T_end" xml:space="preserve">
<value>Endzeit</value>
<value>T Ende</value>
</data>
<data name="T_in" xml:space="preserve">
<value>T ein</value>
@@ -364,13 +364,13 @@
<value>Hersteller</value>
</data>
<data name="Meter_type" xml:space="preserve">
<value>Typ</value>
<value>WZ-Typ</value>
</data>
<data name="Compound" xml:space="preserve">
<value>Verbund</value>
<value>Verbundzähler</value>
</data>
<data name="Heat_meter" xml:space="preserve">
<value />
<value>Wärmezähler</value>
</data>
<data name="Single" xml:space="preserve">
<value>Einzel</value>
@@ -382,16 +382,16 @@
<value>Größe</value>
</data>
<data name="Page" xml:space="preserve">
<value>Blz.</value>
<value>Seite</value>
</data>
<data name="Water_Meter" xml:space="preserve">
<value>Wasserzähler</value>
</data>
<data name="aux" xml:space="preserve">
<value>Nebenz.</value>
<value>Nebenzähler</value>
</data>
<data name="main" xml:space="preserve">
<value>Hauptz.</value>
<value>Hauptzähler</value>
</data>
<data name="fall" xml:space="preserve">
<value>fall</value>
@@ -409,6 +409,420 @@
<value>Masse</value>
</data>
<data name="Density_correction" xml:space="preserve">
<value>Dichtekorektur</value>
<value>Dichtekorrektur</value>
</data>
<data name="Energy" xml:space="preserve">
<value>Energie</value>
</data>
<data name="Energy_ref" xml:space="preserve">
<value>Energie ref.</value>
</data>
<data name="P_delta" xml:space="preserve">
<value>Druckdifferenz </value>
</data>
<data name="P_delta_end" xml:space="preserve">
<value>Druckdifferenz Ende Prüfung</value>
</data>
<data name="P_delta_mean" xml:space="preserve">
<value>Druckdifferenz Delta Prüfung </value>
</data>
<data name="P_delta_start" xml:space="preserve">
<value>Druckdifferenz Beginn Prüfung</value>
</data>
<data name="End_volume" xml:space="preserve">
<value>Ende Volumen</value>
</data>
<data name="Start_volume" xml:space="preserve">
<value>Start Volumen</value>
</data>
<data name="End_volume_aux" xml:space="preserve">
<value>Ende Volumen Nebenzähler</value>
</data>
<data name="End_volume_main" xml:space="preserve">
<value>Ende Volumen Hauptzähler</value>
</data>
<data name="Start_volume_aux" xml:space="preserve">
<value>Start Volumen Nebenzähler</value>
</data>
<data name="Start_volume_main" xml:space="preserve">
<value>Start Volumen Hauptzähler</value>
</data>
<data name="Volume_aux" xml:space="preserve">
<value>Volumen Nebenzähler</value>
</data>
<data name="Volume_main" xml:space="preserve">
<value>Volumen Hauptzähler</value>
</data>
<data name="End_mass" xml:space="preserve">
<value>End Prüfung</value>
</data>
<data name="Start_mass" xml:space="preserve">
<value>Start Prüfung</value>
</data>
<data name="VName_Flow" xml:space="preserve">
<value>Q</value>
</data>
<data name="VName_Press" xml:space="preserve">
<value>Druck</value>
</data>
<data name="VName_Temp" xml:space="preserve">
<value>Temperatur</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_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>Druckdifferenz gemessen von Druckgeber aktuell</value>
</data>
<data name="Tooltip_P_de_avg" xml:space="preserve">
<value>Druckdifferenz gemessen von Druckgeber Mittelwert</value>
</data>
<data name="Tooltip_P_de_en" xml:space="preserve">
<value>Druckdifferenz gemessen von Druckgeber am Prüfungsende</value>
</data>
<data name="Tooltip_P_de_me" xml:space="preserve">
<value>Druckdifferenz gemessen von Druckgeber-Durchschnitt </value>
</data>
<data name="Tooltip_P_de_st" xml:space="preserve">
<value>Druckdifferenz gemessen von Druckgeber am Prüfungsbeginn</value>
</data>
<data name="Tooltip_P_dw_ac" xml:space="preserve">
<value>Druck am Prüfstreckenausgang aktuell</value>
</data>
<data name="Tooltip_P_dw_avg" xml:space="preserve">
<value>Druck Mittelwert am Prüfstreckenausgang</value>
</data>
<data name="Tooltip_P_dw_en" xml:space="preserve">
<value>Druck am Prüfstreckenausgang am Ende der Prüfung</value>
</data>
<data name="Tooltip_P_dw_me" xml:space="preserve">
<value>Druck Durchnschnitt am Prüfstreckenausgang</value>
</data>
<data name="Tooltip_P_dw_st" xml:space="preserve">
<value>Hauptdruck am Ausgang bei Prüfbeginn</value>
</data>
<data name="Tooltip_P_up_ac" xml:space="preserve">
<value>Hauptdruck am Eingang aktuell</value>
</data>
<data name="Tooltip_P_up_avg" xml:space="preserve">
<value>Druck Mittelwert am Prüfstreckeneingang</value>
</data>
<data name="Tooltip_P_up_en" xml:space="preserve">
<value>Druck am Prüfstreckeneingang am Ende der Prüfung</value>
</data>
<data name="Tooltip_P_up_me" xml:space="preserve">
<value>Druck Durchnschnitt am Prüfstreckeneingang</value>
</data>
<data name="Tooltip_P_up_st" xml:space="preserve">
<value>Druck am Prüfstreckeneingang bei Prüfbeginn</value>
</data>
<data name="Tooltip_Q_m_r" xml:space="preserve">
<value>Durchfluss berechnet von Masse der Waage und Zeit </value>
</data>
<data name="Tooltip_Q_riac" xml:space="preserve">
<value>Durchfluss angezeigt von NHO/ aktuell</value>
</data>
<data name="Tooltip_Q_rim" xml:space="preserve">
<value>Durchfluss von aktuellem NHO/ Durchnschnitt</value>
</data>
<data name="Tooltip_Q_v_r" xml:space="preserve">
<value>Durchfluss von aktuellem Refferenzzähler</value>
</data>
<data name="Tooltip_T_di_ac" xml:space="preserve">
<value>Temperatur aktuell an der Umschaltung</value>
</data>
<data name="Tooltip_T_di_avg" xml:space="preserve">
<value>Temperatur-Mittelwert an der Umschaltung</value>
</data>
<data name="Tooltip_T_di_en" xml:space="preserve">
<value>Temperatur Umschaltung am Prüfungsende (4 letzten Messungen)</value>
</data>
<data name="Tooltip_T_di_me" xml:space="preserve">
<value>Temperatur-Durchschnitt an der Umschaltung</value>
</data>
<data name="Tooltip_T_di_st" xml:space="preserve">
<value>Temperatur Umschaltung am Prüfungsanfang (4 ersten Messungen)</value>
</data>
<data name="Tooltip_T_dw_ac" xml:space="preserve">
<value>Temperatur aktuell am Prüfstreckenausgang</value>
</data>
<data name="Tooltip_T_dw_avg" xml:space="preserve">
<value>Temperatur-Mittelwert am Prüstreckenausgang</value>
</data>
<data name="Tooltip_T_dw_en" xml:space="preserve">
<value>Temperatur Prüfstreckenausgang am Prüfungsende ( 4 letzten Messungen)</value>
</data>
<data name="Tooltip_T_dw_me" xml:space="preserve">
<value>Temperatur-Durchschnitt am Prüstreckenausgang</value>
</data>
<data name="Tooltip_T_dw_st" xml:space="preserve">
<value>Temperatur Prüfstreckenausgang am Prüfungsanfang( 4 ersten Messungen)</value>
</data>
<data name="Tooltip_T_up_ac" xml:space="preserve">
<value>Temperatur aktuell am Prüfstreckeneingang</value>
</data>
<data name="Tooltip_T_up_avg" xml:space="preserve">
<value>Temperatur-Mittelwert am Prüstreckeneingang während der Prüfung</value>
</data>
<data name="Tooltip_T_up_en" xml:space="preserve">
<value>Temperatur Prüfstreckeneingang und -Ausgang am Prüfungsanfang( 4 Messungen bevor Ende)</value>
</data>
<data name="Tooltip_T_up_me" xml:space="preserve">
<value>Temperatur-Durchschnitt am Prüfstreckeneingang wärend der Prüfung</value>
</data>
<data name="Tooltip_T_up_st" xml:space="preserve">
<value>Temperatur Prüstreckeneingang am Prüfungsbeginn (4 Messungen nach Beginn)</value>
</data>
<data name="Tooltip_E_rel" xml:space="preserve">
<value>Relative Messabweichung eines WZ</value>
</data>
<data name="Tooltip_E_rel_ref" xml:space="preserve">
<value>Relative Messabweichung des NHO</value>
</data>
<data name="Tooltip_sn" xml:space="preserve">
<value>Serie Nr. des WZ</value>
</data>
<data name="Tooltip_sn_aux" xml:space="preserve">
<value>Serie Nr. des Nebenzählers (Verbundzähler)</value>
</data>
<data name="Tooltip_sn_main" xml:space="preserve">
<value>Serie Nr. des Hauptzählers (Verbundzähler)</value>
</data>
<data name="Tooltip_Vol_Mt" xml:space="preserve">
<value>Volumen gemessen vom geprüften WZ</value>
</data>
<data name="Tooltip_Vol_rm" xml:space="preserve">
<value>Refferenz-Volumen vom geprüften WZ</value>
</data>
<data name="VName_Error" xml:space="preserve">
<value>E</value>
</data>
<data name="Tooltip_Hu_Amb_M" xml:space="preserve">
<value>Umgebungs-Luftfeuchtigkeit während der Prüfung</value>
</data>
<data name="Tooltip_P_Amb_M" xml:space="preserve">
<value>Umgebungs-Druck während der Prüfung</value>
</data>
<data name="Tooltip_T_Amb_M" xml:space="preserve">
<value>Umgebungs-Temperatur während der Prüfung</value>
</data>
<data name="Test_done" xml:space="preserve">
<value>Prüfung erledigt</value>
</data>
<data name="Test_passed" xml:space="preserve">
<value>Prüfung beendet</value>
</data>
<data name="No" xml:space="preserve">
<value>Nein</value>
</data>
<data name="Yes" xml:space="preserve">
<value>Ja</value>
</data>
<data name="Error_flags" xml:space="preserve">
<value>Fehlerflags</value>
</data>
<data name="Legalizator" xml:space="preserve">
<value>Prüfstellenleiter</value>
</data>
<data name="User_description" xml:space="preserve">
<value>Benutzerbeschreibung</value>
</data>
<data name="Failed_meters_count" xml:space="preserve">
<value>WZ-Prüfung nicht bestanden</value>
</data>
<data name="Passed_meters_count" xml:space="preserve">
<value>WZ-Prüfung bestanden</value>
</data>
<data name="sensitivity" xml:space="preserve">
<value>Empfindlichkeit</value>
</data>
<data name="Tooltip_Q_end" xml:space="preserve">
<value>Durchflusswert vom NHO-am Prüfungsende</value>
</data>
<data name="Tooltip_Q_max" xml:space="preserve">
<value>Durchflusswert vom NHO-max</value>
</data>
<data name="Tooltip_Q_min" xml:space="preserve">
<value>Durchflusswert vom NHO-min</value>
</data>
<data name="Tooltip_Q_start" xml:space="preserve">
<value>Durchflusswert vom NHO-am Prüfungsanfang</value>
</data>
<data name="Tooltip_P_dw_max" xml:space="preserve">
<value>Druck max. am Prüfstandsausgang während der Prüfung</value>
</data>
<data name="Tooltip_P_dw_min" xml:space="preserve">
<value>Druck min. am Prüfstandsausgang während der Prüfung</value>
</data>
<data name="Tooltip_P_up_max" xml:space="preserve">
<value>Druck max. am Prüfstandseingang während der Prüfung</value>
</data>
<data name="Tooltip_P_up_min" xml:space="preserve">
<value>Druck min. am Prüfstandseingang während der Prüfung</value>
</data>
<data name="Tooltip_T_di_max" xml:space="preserve">
<value>Temp. max. an der Umschaltung während der Prüfung</value>
</data>
<data name="Tooltip_T_di_min" xml:space="preserve">
<value>Temp. min. an der Umschaltung während der Prüfung</value>
</data>
<data name="Tooltip_T_dw_max" xml:space="preserve">
<value>Temp. max am Prüfstandsausgang während der Prüfung</value>
</data>
<data name="Tooltip_T_dw_min" xml:space="preserve">
<value>Temp. min. am Prüfstandsausgang während der Prüfung</value>
</data>
<data name="Tooltip_T_up_max" xml:space="preserve">
<value>Temp. max am Prüfstandseingang während der Prüfung</value>
</data>
<data name="Tooltip_T_up_min" xml:space="preserve">
<value>Temp. min am Prüfstandseingang während der Prüfung</value>
</data>
<data name="Tooltip_P_de_max" xml:space="preserve">
<value>Druckdifferenz gemessen von Delta P /WZ max. während der Prüfung</value>
</data>
<data name="Tooltip_P_de_min" xml:space="preserve">
<value>Druckdifferenz gemessen von Delta P /WZ min. während der Prüfung</value>
</data>
<data name="Tooltip_Rho_Wa_calc" xml:space="preserve">
<value>Dichte vom Wasser aus Tabelle oder Formel</value>
</data>
<data name="Tooltip_T_rho_0" xml:space="preserve">
<value>Temperatur von der Wasserprobe bei der Dichtekalibrierung</value>
</data>
<data name="Tooltip_T_ln_ac" xml:space="preserve">
<value>Temperatur aktuell in der Prüfstrecke</value>
</data>
<data name="Tooltip_T_ln_avg" xml:space="preserve">
<value>Temperatur-Mittelwert in der Prüfstrecke während der Prüfung</value>
</data>
<data name="Tooltip_T_ln_en" xml:space="preserve">
<value>Temperatur in der Prüfstrecke am Ende der Prüfung -4 letzten Messungen</value>
</data>
<data name="Tooltip_T_ln_max" xml:space="preserve">
<value>Temperatur max. in der Prüfstrecke während der Prüfung</value>
</data>
<data name="Tooltip_T_ln_me" xml:space="preserve">
<value>Temperatur-Durchschnitt in der Prüfstrecke während der Prüfung</value>
</data>
<data name="Tooltip_T_ln_min" xml:space="preserve">
<value>Temperatur min. in der Prüfstrecke während der Prüfung</value>
</data>
<data name="Tooltip_T_ln_st" xml:space="preserve">
<value>Temperatur in der Prüfstrecke am Anfang der Prüfung -4 ersten Messungen</value>
</data>
<data name="Unit" xml:space="preserve">
<value>Einheit</value>
</data>
<data name="Procedure_description" xml:space="preserve">
<value>Prüfprozess Beschreibung</value>
</data>
<data name="Bench_ID" xml:space="preserve">
<value>Prüfstand ID</value>
</data>
<data name="Bench_name" xml:space="preserve">
<value>Prüfstamdsname</value>
</data>
<data name="Address" xml:space="preserve">
<value>Adresse</value>
</data>
<data name="Tooltip_E_rel_last" xml:space="preserve">
<value>Relativer Fehler vom WZ in vorheriger Prüfung/ in Produktion</value>
</data>
<data name="Batch" xml:space="preserve">
<value>Zälerlos</value>
</data>
<data name="repetition" xml:space="preserve">
<value>Wiederholung</value>
</data>
<data name="Invalid_Q2_correction_factors" xml:space="preserve">
<value>Fehlerhafter Q2 Korrektur-Faktor</value>
</data>
<data name="Previous_step_is_missing_or_NOK" xml:space="preserve">
<value>Vorgehender Schritt fehlt oder nicht OK</value>
</data>
<data name="Test_repetition_count_exceeded_upper_limit" xml:space="preserve">
<value>Prüfungswiederholung Anzahl überschritten!</value>
</data>
<data name="Wrong_iPerl_counting_direction" xml:space="preserve">
<value>Falsche iPERL Durchflussrichtung</value>
</data>
<data name="Failed" xml:space="preserve">
<value>Nicht OK</value>
</data>
<data name="Passed" xml:space="preserve">
<value>OK</value>
</data>
<data name="Test_in_progress" xml:space="preserve">
<value>Prüfung läuft</value>
</data>
<data name="Counter_0" xml:space="preserve">
<value>Zähler {0}</value>
</data>
<data name="Date_and_time" xml:space="preserve">
<value>Datum und Zeit</value>
</data>
<data name="Name" xml:space="preserve">
<value>Name</value>
</data>
<data name="Step" xml:space="preserve">
<value>Schritt</value>
</data>
<data name="Workplace" xml:space="preserve">
<value>Arbeitsplatz</value>
</data>
<data name="Workflow" xml:space="preserve">
<value>Arbeitsablauf</value>
</data>
<data name="Production_tracing_results" xml:space="preserve">
<value>Produktion Ergebnisse verfolgen</value>
</data>
<data name="Code" xml:space="preserve">
<value>Code</value>
</data>
<data name="Part" xml:space="preserve">
<value>Teil</value>
</data>
<data name="All_results" xml:space="preserve">
<value>Alle Ergebnisse</value>
</data>
<data name="Graphs" xml:space="preserve">
<value>Graphiken</value>
</data>
<data name="No_water_meter" xml:space="preserve">
<value>Kein WZ</value>
</data>
<data name="Serial_number_is_missing" xml:space="preserve">
<value>Serie Nr. fehlt.</value>
</data>
<data name="Lower_limit" xml:space="preserve">
<value>Untere Grenze</value>
</data>
<data name="Upper_limit" xml:space="preserve">
<value>Obere Grenze</value>
</data>
<data name="Water_meter_results" xml:space="preserve">
<value>WZ Ergebnisse</value>
</data>
<data name="Relative_error" xml:space="preserve">
<value>Relativer Fehler</value>
</data>
<data name="This_position_is_disabled" xml:space="preserve">
<value>Position nicht aktiviert.</value>
</data>
<data name="Available_items" xml:space="preserve">
<value>Verfügbare Positionen</value>
</data>
<data name="Selected_items" xml:space="preserve">
<value>Ausgewählte Objekte</value>
</data>
</root>
+2 -2
View File
@@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
<DefineConstants>TRACE;DEBUG;TURA_IPERL_NEW;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
@@ -29,7 +29,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;MUNICH</DefineConstants>
<DefineConstants>TRACE;TURA_IPERL_NEW;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
+17 -17
View File
@@ -210,22 +210,22 @@ namespace Results
///
/// Flow
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_from, string.Format("{0} {1}", Strings.VName_Flow, Strings.from), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qfrom())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_to, string.Format("{0} {1}", Strings.VName_Flow, Strings.to), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qto())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow, string.Format("{0} v r", Strings.VName_Flow), Strings.Tooltip_Q_v_r, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowVolume)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_mean, string.Format("{0} rim ()", Strings.VName_Flow), Strings.Tooltip_Q_rim, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_min, string.Format("{0} ref min ()", Strings.VName_Flow), Strings.Tooltip_Q_min, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_max, string.Format("{0} ref max ()", Strings.VName_Flow), Strings.Tooltip_Q_max, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMax)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_start, string.Format("{0} ref start ()",Strings.VName_Flow),Strings.Tooltip_Q_start, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_end, string.Format("{0} ref end ()", Strings.VName_Flow), Strings.Tooltip_Q_end, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Qc, string.Format("Qc"), "Calculated water meter flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V5", (w.GetMeterTestRslt(t).TestTime == 0 || w.GetTestRslt(t).PulsesMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV / w.GetMeterTestRslt(t).TestTime * 3.6 * w.GetMeterTestRslt(t).PulsesMaster / w.GetTestRslt(t).PulsesMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv, string.Format("{0} ctv ()", Strings.VName_Flow), "CTV of the flow (mean val.)", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V5", (w.GetMeterTestRslt(t).TestTime == 0 || w.GetTestRslt(t).PulsesMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV / w.GetMeterTestRslt(t).TestTime * 3.6 * w.GetMeterTestRslt(t).PulsesMaster / w.GetTestRslt(t).PulsesMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_min, string.Format("{0} ctv min ()", Strings.VName_Flow), "Min. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowMin / w.GetTestRslt(t).VolumeMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_max, string.Format("{0} ctv max ()", Strings.VName_Flow), "Max. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowMax / w.GetTestRslt(t).VolumeMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_start, string.Format("{0} ctv start ()", Strings.VName_Flow), "Start flow CTV", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowStart / w.GetTestRslt(t).VolumeMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_end, string.Format("{0} ctv end ()", Strings.VName_Flow), "End flow CTV", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowEnd / w.GetTestRslt(t).VolumeMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_rise, string.Format("{0} {1}", Strings.VName_Flow, Strings.rise), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QRise == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QRise)) : ""));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_fall, string.Format("{0} {1}", Strings.VName_Flow, Strings.fall), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QFall == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QFall)) : ""));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_from, string.Format("{0} {1}", Strings.VName_Flow, Strings.from), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qfrom())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_to, string.Format("{0} {1}", Strings.VName_Flow, Strings.to), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qto())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow, string.Format("{0} v r", Strings.VName_Flow), Strings.Tooltip_Q_v_r, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowVolume)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_mean, string.Format("{0} rim ()", Strings.VName_Flow), Strings.Tooltip_Q_rim, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_min, string.Format("{0} ref min ()", Strings.VName_Flow), Strings.Tooltip_Q_min, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_max, string.Format("{0} ref max ()", Strings.VName_Flow), Strings.Tooltip_Q_max, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMax)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_start, string.Format("{0} ref start ()",Strings.VName_Flow),Strings.Tooltip_Q_start, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_end, string.Format("{0} ref end ()", Strings.VName_Flow), Strings.Tooltip_Q_end, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Qc, string.Format("Qc"), "Calculated water meter flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V5", w.GetTestRslt(t).FlowVolume)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv, string.Format("{0} ctv ()", Strings.VName_Flow), "CTV of the flow (mean val.)", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V5", w.GetTestRslt(t).FlowVolume)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_min, string.Format("{0} ctv min ()", Strings.VName_Flow), "Min. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).FlowMean == 0) ? w.GetTestRslt(t).FlowMin : w.GetTestRslt(t).FlowVolume * w.GetTestRslt(t).FlowMin / w.GetTestRslt(t).FlowMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_max, string.Format("{0} ctv max ()", Strings.VName_Flow), "Max. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).FlowMean == 0) ? w.GetTestRslt(t).FlowMax : w.GetTestRslt(t).FlowVolume * w.GetTestRslt(t).FlowMax / w.GetTestRslt(t).FlowMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_start, string.Format("{0} ctv start ()", Strings.VName_Flow), "Start flow CTV", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).FlowMean == 0) ? w.GetTestRslt(t).FlowStart : w.GetTestRslt(t).FlowVolume * w.GetTestRslt(t).FlowStart / w.GetTestRslt(t).FlowMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_end, string.Format("{0} ctv end ()", Strings.VName_Flow), "End flow CTV", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).FlowMean == 0) ? w.GetTestRslt(t).FlowEnd : w.GetTestRslt(t).FlowVolume * w.GetTestRslt(t).FlowEnd / w.GetTestRslt(t).FlowMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_rise, string.Format("{0} {1}", Strings.VName_Flow, Strings.rise), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QRise == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QRise)) : ""));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_fall, string.Format("{0} {1}", Strings.VName_Flow, Strings.fall), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QFall == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QFall)) : ""));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_sensitivity, string.Format("{0} {1}", Strings.VName_Flow, Strings.sensitivity), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QRise == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QRise)) : ""));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ConstMaster, string.Format("k MID ()"), "Const. of the reference flow meter", Quantity.PulsePerLtr, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", ((w.GetTestRslt(t).ConstMaster < float.Epsilon) ? 0 : (1 / w.GetTestRslt(t).ConstMaster)))));
@@ -336,7 +336,7 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed, Strings.Result, Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => string.IsNullOrEmpty(t) ? w.PassedColorStr(f)
: ((w.GetMeterTestRslt(t) == null) ? "" : w.GetMeterTestRslt(t).PassedColorStr(f))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ThreeState, "Three state result", Quantity.Enum, ItemCategory.MeterResult, (w, t, u, f, p) => FormatThreeState(f, w.ThreeStateFromTests())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ThreeState, "Three state result", Quantity.Enumerated, ItemCategory.MeterResult, (w, t, u, f, p) => FormatThreeState(f, w.ThreeStateFromTests())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.RefFlowmeter, "Ref. flowmeter", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).RefFlowmeter()) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ResultOrErrorFlags, "Winiki lub E", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.PassedOrErrorFlagsStr()))); /// PL specific result
+1
View File
@@ -14,6 +14,7 @@ namespace ResultsBrowser
ListOfSerialNumbers,
WZTypeIdAndTimePeriod,
ProducedWithinTimePeriod,
BenchAndBatchNr,
Count,
}
@@ -39,6 +39,7 @@ namespace ResultsBrowser.Forms
//queryTypeComboBox.Items.Add(new CQSelectionItem(CQCriteria.ListOfSerialNumbers, "Všetky vodomery so sériovými číslami podľa zadaného zoznamu"));
queryTypeComboBox.Items.Add(new CQSelectionItem(CQCriteria.WZTypeIdAndTimePeriod, "Všetky vodomery so zadaným WZTypeID vyrobené v zadanom časovom období"));
queryTypeComboBox.Items.Add(new CQSelectionItem(CQCriteria.ProducedWithinTimePeriod, "Všetky vodomery vyrobené v zadanom časovom období"));
queryTypeComboBox.Items.Add(new CQSelectionItem(CQCriteria.BenchAndBatchNr, "Stanica a číslo dávky"));
queryTypeComboBox.Text = "Všetky vodomery vyrobené v zadanom časovom období";
destinationFileTextBox.Text = string.Format("vysledky_hladania_{0:ddMMyyyy_HHmm}.csv", DateTime.Now);
@@ -68,7 +69,8 @@ namespace ResultsBrowser.Forms
/// Update UI elements visibility
inputListGroupBox.Enabled = (CQCriteria == CQCriteria.ListOfOrders) ||
(CQCriteria == CQCriteria.ListOfPcbNumbers) ||
(CQCriteria == CQCriteria.ListOfSerialNumbers);
(CQCriteria == CQCriteria.ListOfSerialNumbers) ||
(CQCriteria == CQCriteria.BenchAndBatchNr);
timePeriodGroupBox.Enabled = (CQCriteria == CQCriteria.WZTypeIdAndTimePeriod) ||
(CQCriteria == CQCriteria.ProducedWithinTimePeriod);
@@ -78,6 +80,11 @@ namespace ResultsBrowser.Forms
parameterGroupBox.Enabled = true;
parameterNameLabel.Text = "WZ Type ID";
}
else if (CQCriteria == CQCriteria.BenchAndBatchNr)
{
parameterGroupBox.Enabled = true;
parameterNameLabel.Text = "Test bench number (e.g. 10 for WR10)";
}
else
{
parameterGroupBox.Enabled = false;
+7
View File
@@ -20,11 +20,18 @@ namespace ResultsBrowser
public DateTime End;
public int HydrPruefung;
public double AdjErr;
public double Q4Err;
public double Q3Err;
public double Q2AdjErr;
public double Q2Err;
public double Q1Err;
public double AdjErrA4;
public double Q3RlErr;
public double Q3LrErr;
public double Q2RlErr;
public double Q2LrErr;
public double Q2acRlErr;
public double Q2acLrErr;
public double Q1RlErr;
public double Q1LrErr;
public int CalibFactor;
+3 -3
View File
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Sensus")]
[assembly: AssemblyProduct("ResultsBrowser")]
[assembly: AssemblyCopyright("Copyright © 2015 - 2018 Sensus Slovensko a.s.")]
[assembly: AssemblyCopyright("Copyright © 2015 - 2020 Sensus Slovensko a.s.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.25.1440.0")]
[assembly: AssemblyFileVersion("2.25.1440.0")]
[assembly: AssemblyVersion("2.26.1498.0")]
[assembly: AssemblyFileVersion("2.26.1498.0")]
+75 -3
View File
@@ -163,7 +163,7 @@
<value>OK</value>
</data>
<data name="Print_query_results" xml:space="preserve">
<value>Ergebnise drucken</value>
<value>Ergebnisse Abfrage Drucken</value>
</data>
<data name="Procedure" xml:space="preserve">
<value>Prüfvorlage</value>
@@ -172,7 +172,7 @@
<value>Protokoll</value>
</data>
<data name="Query_results" xml:space="preserve">
<value>Ergebnisse</value>
<value>Abfrageergebnisse</value>
</data>
<data name="Results_Browser" xml:space="preserve">
<value>Analyse der Ergebnisse</value>
@@ -199,7 +199,7 @@
<value>Statistiken</value>
</data>
<data name="Test" xml:space="preserve">
<value>Prüfpunkt</value>
<value>Prüfung</value>
</data>
<data name="Test_bench" xml:space="preserve">
<value>Prüfstand</value>
@@ -231,4 +231,76 @@
<data name="Print" xml:space="preserve">
<value>Drucken</value>
</data>
<data name="Name" xml:space="preserve">
<value>Name</value>
</data>
<data name="ConfigureDatabaseText" xml:space="preserve">
<value>Password für Prüfstand configurieren</value>
</data>
<data name="ExitBtnText" xml:space="preserve">
<value>Exit</value>
</data>
<data name="Component" xml:space="preserve">
<value>Komponenten</value>
</data>
<data name="Configure" xml:space="preserve">
<value>Konfigurieren</value>
</data>
<data name="Printer" xml:space="preserve">
<value>Drucker</value>
</data>
<data name="Question" xml:space="preserve">
<value>Fragen</value>
</data>
<data name="Add" xml:space="preserve">
<value>&amp;Hinzufügen</value>
</data>
<data name="Message" xml:space="preserve">
<value>Nachricht</value>
</data>
<data name="Data" xml:space="preserve">
<value>Daten</value>
</data>
<data name="All_files" xml:space="preserve">
<value>Alle Dateien</value>
</data>
<data name="Query_files" xml:space="preserve">
<value>Abfragedateien</value>
</data>
<data name="No_program_settings_found" xml:space="preserve">
<value>Programmeinstellungen nicht gefunden</value>
</data>
<data name="Using_default_settings" xml:space="preserve">
<value>Einstellungen Vorgaben benutzen.</value>
</data>
<data name="Selected_language_not_supported" xml:space="preserve">
<value>Ausgewählte Sprache wird nicht unterstützt.</value>
</data>
<data name="Using_English" xml:space="preserve">
<value>Englische Sprache benutzen!</value>
</data>
<data name="Warning" xml:space="preserve">
<value>Warnung</value>
</data>
<data name="Format" xml:space="preserve">
<value>Formatieren</value>
</data>
<data name="Configure_printer" xml:space="preserve">
<value>Drucker konfigurieren.</value>
</data>
<data name="No_printer_defined" xml:space="preserve">
<value>Kein Drucker ausgewählt.</value>
</data>
<data name="Printing_failed" xml:space="preserve">
<value>Druck fehlgeschlagen</value>
</data>
<data name="Printing_completed" xml:space="preserve">
<value>Druck vollständig</value>
</data>
<data name="Error_exporting_results" xml:space="preserve">
<value>Fehler beim exportieren der Ergebnisse!</value>
</data>
<data name="Histograms" xml:space="preserve">
<value>Histogramm</value>
</data>
</root>
+2 -2
View File
@@ -21,7 +21,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
<DefineConstants>TRACE;DEBUG;TURA_IPERL_NEW;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -32,7 +32,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;MUNICH</DefineConstants>
<DefineConstants>TRACE;TURA_IPERL_NEW;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
+254 -122
View File
@@ -28,8 +28,8 @@ namespace ResultsBrowser
IList<WaterMeter> waterMeters;
DateTime timePeriodStart;
DateTime timePeriodEnd;
DateTime timePeriodStart;
DateTime timePeriodEnd;
static IList<IComponent> tbfComponents;
static IList<IDevice> tbfDevices;
@@ -47,9 +47,9 @@ namespace ResultsBrowser
tbfComponents = new List<TBF.BenchControl.Generic.IComponent>();
tbfDevices = new List<IDevice>();
timePeriodStart = new DateTime(0);
timePeriodEnd = new DateTime(0);
}
timePeriodStart = new DateTime(0);
timePeriodEnd = new DateTime(0);
}
private void ResultsBrowserWnd_Load(object sender, EventArgs e)
{
@@ -102,15 +102,15 @@ namespace ResultsBrowser
checkBox6.Visible = !string.IsNullOrEmpty(checkBox6.Text);
}
string BenchName()
{
return checkBox1.Checked ? Program.LocalSettings.Bench1
: checkBox2.Checked ? Program.LocalSettings.Bench2
: checkBox3.Checked ? Program.LocalSettings.Bench3
: checkBox4.Checked ? Program.LocalSettings.Bench4
string BenchName()
{
return checkBox1.Checked ? Program.LocalSettings.Bench1
: checkBox2.Checked ? Program.LocalSettings.Bench2
: checkBox3.Checked ? Program.LocalSettings.Bench3
: checkBox4.Checked ? Program.LocalSettings.Bench4
: checkBox5.Checked ? Program.LocalSettings.Bench5
: Program.LocalSettings.Bench6;
}
}
void Localize()
{
@@ -118,19 +118,19 @@ namespace ResultsBrowser
resultsGroupBox.Text = Strings.Query_results;
settingsBtn.Text = Strings.Settings;
testBenchesGroupBox.Text = Strings.Test_benches;
clearFiltersBtn.Text = Strings.Clear_filters;
clearFiltersBtn.Text = Strings.Clear_filters;
addFilterBtn.Text = Strings.Add_filter;
formatOfResultsBtn.Text = Strings.Format_of_results;
printerConfigBtn.Text = Strings.Configure_printer;
loadConfigBtn.Text = Strings.Load_filters;
formatOfResultsBtn.Text = Strings.Format_of_results;
printerConfigBtn.Text = Strings.Configure_printer;
loadConfigBtn.Text = Strings.Load_filters;
saveConfigBtn.Text = Strings.Save_filters;
executeQueryBtn.Text = Strings.Execute_query;
executeQueryBtn.Text = Strings.Execute_query;
exportQueryResultsBtn.Text = Strings.Export_query_results;
printQueryResultsBtn.Text = Strings.Print_query_results;
statisticsBtn.Text = Strings.Statistics;
statisticsBtn.Text = Strings.Statistics;
}
private void settingsBtn_Click(object sender, EventArgs e)
@@ -176,40 +176,40 @@ namespace ResultsBrowser
}
}
private void formatOfResultsBtn_Click(object sender, EventArgs e)
{
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg();
dlg.MetersKind = Config.Entities.MetersKind.Single;
dlg.SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
private void formatOfResultsBtn_Click(object sender, EventArgs e)
{
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg();
dlg.MetersKind = Config.Entities.MetersKind.Single;
dlg.SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
if (dlg.ShowDialog() == DialogResult.OK)
{
filtersConfig.ResultItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
RedrawResults();
}
}
if (dlg.ShowDialog() == DialogResult.OK)
{
filtersConfig.ResultItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
RedrawResults();
}
}
private void printerConfigBtn_Click(object sender, EventArgs e)
{
Forms.PrinterConfigDlg dlg = new Forms.PrinterConfigDlg
{
PrinterClass = filtersConfig.PrinterClass,
PrinterCfg = filtersConfig.PrinterCfg
};
private void printerConfigBtn_Click(object sender, EventArgs e)
{
Forms.PrinterConfigDlg dlg = new Forms.PrinterConfigDlg
{
PrinterClass = filtersConfig.PrinterClass,
PrinterCfg = filtersConfig.PrinterCfg
};
if (dlg.ShowDialog() == DialogResult.OK)
{
filtersConfig.PrinterClass = dlg.PrinterClass;
filtersConfig.PrinterCfg = dlg.PrinterCfg;
}
}
if (dlg.ShowDialog() == DialogResult.OK)
{
filtersConfig.PrinterClass = dlg.PrinterClass;
filtersConfig.PrinterCfg = dlg.PrinterCfg;
}
}
private void loadConfigBtn_Click(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = string.Format("{0} (*.qry)|*.qry|{1} (*.*)|*.*", Strings.Query_files, Strings.All_files);
if (dlg.ShowDialog() == DialogResult.OK)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = string.Format("{0} (*.qry)|*.qry|{1} (*.*)|*.*", Strings.Query_files, Strings.All_files);
if (dlg.ShowDialog() == DialogResult.OK)
{
LoadConfigFromFile(dlg.FileName);
}
}
@@ -269,8 +269,8 @@ namespace ResultsBrowser
private void executeQueryBtn_Click(object sender, EventArgs e)
{
timePeriodStart = new DateTime(0);
timePeriodEnd = new DateTime(0);
timePeriodStart = new DateTime(0);
timePeriodEnd = new DateTime(0);
try
{
@@ -291,11 +291,11 @@ namespace ResultsBrowser
foreach (var filter in filters)
{
if (filter is DateFilter)
{
timePeriodStart = (filter as DateFilter).From;
timePeriodEnd = (filter as DateFilter).To;
}
if (filter is DateFilter)
{
timePeriodStart = (filter as DateFilter).From;
timePeriodEnd = (filter as DateFilter).To;
}
waterMeters2 = filter.ExecuteQuery(sessions, waterMeters);
waterMeters = waterMeters2;
}
@@ -364,10 +364,10 @@ namespace ResultsBrowser
if (dlg.ShowDialog() == DialogResult.OK)
{
try
{
using (TextWriter writer = new StreamWriter(dlg.FileName, false, System.Text.Encoding.UTF8))
{
try
{
using (TextWriter writer = new StreamWriter(dlg.FileName, false, System.Text.Encoding.UTF8))
{
for (int i = 0; i < items.Count; i++)
{
writer.Write(items[i].Caption);
@@ -397,10 +397,10 @@ namespace ResultsBrowser
}
}
}
catch (Exception exc)
{
catch (Exception exc)
{
MessageBox.Show(exc.Message, Strings.Error_exporting_results, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
}
}
@@ -448,11 +448,11 @@ namespace ResultsBrowser
IComponent component = printerFactory.GetComponent(printerCfg, tbfComponents);
IResultsPrinter printer = component as IResultsPrinter;
if (printer== null)
if (printer == null)
{
MessageBox.Show(Strings.No_printer_defined);
return;
}
}
tbfComponents.Clear();
tbfDevices.Clear();
@@ -493,7 +493,7 @@ namespace ResultsBrowser
{
if (waterMeters == null || waterMeters.Count == 0) return;
IList<Results.WMeterRsltItemSpec> items = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
IList<Results.WMeterRsltItemSpec> items = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
///
/// Statistics options
@@ -529,24 +529,24 @@ namespace ResultsBrowser
}
/// <summary>
/// Updates component factory
/// </summary>
/// <param name="className">Component class name</param>
/// <param name="factory">Reference to a factory</param>
/// <returns>true when factory changed</returns>
IComponentFactory GetFactory(string className)
{
if (!string.IsNullOrEmpty(className))
{
foreach (var fac in TbfComponents.Factories)
{
if (fac.ClassName == className) return fac;
}
}
/// <summary>
/// Updates component factory
/// </summary>
/// <param name="className">Component class name</param>
/// <param name="factory">Reference to a factory</param>
/// <returns>true when factory changed</returns>
IComponentFactory GetFactory(string className)
{
if (!string.IsNullOrEmpty(className))
{
foreach (var fac in TbfComponents.Factories)
{
if (fac.ClassName == className) return fac;
}
}
return null;
}
return null;
}
private void customQueryButton_Click(object sender, EventArgs e)
{
@@ -609,12 +609,22 @@ namespace ResultsBrowser
while (dr.Read())
{
int i = 0;
string queryResult = dr.GetString(i++);
string queryResult;
try { queryResult = dr.GetString(i++); }
catch { queryResult = string.Empty; }
int maxPruefIx = dr.GetInt32(i++);
int testBenchId = maxPruefIx / 100;
maxPruefIx = maxPruefIx % 100;
string prefix = dr.GetString(i++);
int sn = dr.GetInt32(i++);
string prefix;
try { prefix = dr.GetString(i++); }
catch { prefix = string.Empty; }
int sn;
try { sn = dr.GetInt32(i++); }
catch { sn = -1; }
if (sn == -1) continue;
@@ -639,7 +649,6 @@ namespace ResultsBrowser
return;
}
/// Add this test bench to the list of test benches if it was still missing
if (!testBenches.Contains(testBenchId)) testBenches.Add(testBenchId);
}
@@ -730,25 +739,35 @@ namespace ResultsBrowser
double flow = dr.GetDouble(i++); /// Q_WZ
double error = dr.GetDouble(i++); /// Q_FEHLER
bool testPassed = (dr.GetInt32(i++) != 0);
#if true
/// SUEZ specific
switch (testId)
{
case -2:
oraD.AdjErrA4 = error;
break;
case -1:
oraD.AdjErr = error;
break;
case 5:
oraD.Q3LrErr = error;
break;
case 10:
oraD.Q3RlErr = error;
break;
default:
break;
case -2: oraD.AdjErrA4 = error; break;
case -1: oraD.AdjErr = error; break;
case 1: oraD.Q1LrErr = error; break;
case 2: oraD.Q2acLrErr = error; break;
case 3: oraD.Q2LrErr = error; break;
case 5: oraD.Q3LrErr = error; break;
case 6: oraD.Q1RlErr = error; break;
case 7: oraD.Q2acRlErr = error; break;
case 8: oraD.Q2RlErr = error; break;
case 10: oraD.Q3RlErr = error; break;
default: break;
}
#else /// DEWA specific
switch (testId)
{
case -1: oraD.AdjErr = error; break;
case 1: oraD.Q1Err = error; break;
case 2: oraD.Q2Err = error; break;
case 3: oraD.Q2AdjErr = error; break;
case 4: oraD.Q3Err = error; break;
case 5: oraD.Q4Err = error; break;
default: break;
}
#endif
}
dr.Close();
} /// end of foreach (var oraD in OraDatas)
@@ -756,6 +775,78 @@ namespace ResultsBrowser
oracleConnection.Close();
}
else if (dlg.CQCriteria == CQCriteria.BenchAndBatchNr)
{
switch (dlg.IntParameter)
{
case 10: Results.DB.ConnectionString = "SERVER=10.42.130.69; DATABASE=st-wr10-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 11: Results.DB.ConnectionString = "SERVER=10.42.129.27; DATABASE=st-wr11-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 13: Results.DB.ConnectionString = "SERVER=10.42.130.52; DATABASE=st-wr13-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 15: Results.DB.ConnectionString = "SERVER=10.42.130.71; DATABASE=st-wr15-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 14: Results.DB.ConnectionString = "SERVER=10.42.130.72; DATABASE=st-wr14-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 18: Results.DB.ConnectionString = "SERVER=10.42.130.165; DATABASE=st-wr18-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 19: Results.DB.ConnectionString = "SERVER=10.42.128.159; DATABASE=st-wr19-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 20: Results.DB.ConnectionString = "SERVER=10.42.130.76; DATABASE=st-wr20-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 21: Results.DB.ConnectionString = "SERVER=10.42.128.201; DATABASE=st-wr21-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
default: Results.DB.ConnectionString = string.Empty; break;
}
Results.DB.DbType = Users.Entities.DBType.MySql;
string[] fields = dlg.InputList.Split(new char[] { ',' });
int[] batchNrs = new int[fields.Length];
int batchNr;
for (int i = 0; i < batchNrs.Length; i++) if (int.TryParse(fields[i], out batchNr)) batchNrs[i] = batchNr;
IList<WaterMeter> waterMeters = new List<WaterMeter>();
if (!string.IsNullOrEmpty(Results.DB.ConnectionString))
{
ISession session = Results.DB.CreateSession();
for (int i = 0; i < batchNrs.Length; i++)
{
var batches = session.QueryOver<Batch>()
.Where(x => (x.BatchNr == batchNrs[i]))
.List();
if (batches.Count == 1)
{
var wms = session.QueryOver<WaterMeter>()
.Where(x => (x.Batch == batches[0]))
.List();
foreach (var wm in wms) waterMeters.Add(wm);
}
}
}
consoleTextBox.Text += "Collecting water meters\r\n";
foreach (var waterMeter in waterMeters)
{
oracleConnection = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltachef;Password=deltachef;");
oracleConnection.Open();
OracleCommand cmd = new OracleCommand("select AUFTRAGSNUMMER, MAX_PRUEFINDEX, PREFIX, ZAEHLERNUMMER from VT_ZAEHLER_PD where VT_FERNUM = :1 AND ANBID = 4 order by ZAEHLERNUMMER", oracleConnection);
cmd.Parameters.Add(new OracleParameter { ParameterName = "1", OracleDbType = OracleDbType.Varchar2, Value = waterMeter.SerialNr });
OracleDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
int i = 0;
string queryResult = dr.GetString(i++);
int maxPruefIx = dr.GetInt32(i++);
int testBenchId = maxPruefIx / 100;
maxPruefIx = maxPruefIx % 100;
string prefix = dr.GetString(i++);
int sn = dr.GetInt32(i++);
if (sn == -1) continue;
/// Create 'OraData' object and add it to 'oraDatas' list
oraDatas.Add(new OraData() { PO = queryResult, PcbNr = waterMeter.SerialNr, TestBenchId = testBenchId, MaxPruefIx = maxPruefIx, Prefix = prefix, SN = sn });
/// Add this test bench to the list of test benches if it was still missing
if (!testBenches.Contains(testBenchId)) testBenches.Add(testBenchId);
}
}
}
else if (dlg.CQCriteria == CQCriteria.WZTypeIdAndTimePeriod)
{
}
@@ -795,18 +886,19 @@ namespace ResultsBrowser
/// Test bench databases
switch (testBenchId)
{
case 5: Results.DB.ConnectionString = "SERVER=10.42.130.69; DATABASE=st-wr10-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 6: Results.DB.ConnectionString = "SERVER=10.42.129.27; DATABASE=st-wr11-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 8: Results.DB.ConnectionString = "SERVER=10.42.128.61; DATABASE=st-wr13-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 9: Results.DB.ConnectionString = "SERVER=10.42.130.71; DATABASE=st-wr15-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 10: Results.DB.ConnectionString = "SERVER=10.42.130.72; DATABASE=st-wr14-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 5: Results.DB.ConnectionString = "SERVER=10.42.130.69; DATABASE=st-wr10-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 6: Results.DB.ConnectionString = "SERVER=10.42.129.27; DATABASE=st-wr11-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 8: Results.DB.ConnectionString = "SERVER=10.42.130.52; DATABASE=st-wr13-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 9: Results.DB.ConnectionString = "SERVER=10.42.130.71; DATABASE=st-wr15-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 10: Results.DB.ConnectionString = "SERVER=10.42.130.72; DATABASE=st-wr14-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 11: Results.DB.ConnectionString = "SERVER=10.42.130.165; DATABASE=st-wr18-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 12: Results.DB.ConnectionString = "SERVER=10.42.128.159; DATABASE=st-wr19-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 13: Results.DB.ConnectionString = "SERVER=10.42.130.76; DATABASE=st-wr20-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 13: Results.DB.ConnectionString = "SERVER=10.42.130.76; DATABASE=st-wr20-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
case 14: Results.DB.ConnectionString = "SERVER=10.42.128.201; DATABASE=st-wr21-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
default: Results.DB.ConnectionString = string.Empty; break;
}
#endif
Results.DB.DbType = Users.Entities.DBType.MySql;
if (!string.IsNullOrEmpty(Results.DB.ConnectionString))
{
@@ -854,18 +946,19 @@ namespace ResultsBrowser
consoleTextBox.Text += Environment.NewLine;
if (session != null) session.Close();
}
}
}
consoleTextBox.Text += "End reading additional data from MySQL\r\n";
consoleTextBox.Text += "CSV data begin\r\n";
using (TextWriter writer = new StreamWriter(dlg.DestinationFile))
{
writer.WriteLine(string.Format("PO; prefix; S/N; PcbNr; Bench; Batch; Start; Start; End; End; Pos; AdjA0; AdjA4; Q3RL; Q3LR; CalF; CAlF_LNA; HP; Q2cRL; Q2cLR"));
#if true
writer.WriteLine(string.Format("PO; prefix; S/N; PcbNr; Bench; Batch; Start; Start; End; End; Pos; AdjA0; AdjA4; Q3RL; Q3LR; Q2RL; Q2LR; Q2acRL; Q2acLR; Q1RL; Q1LR; CalF; CAlF_LNA; HP; Q2cRL; Q2cLR"));
//Console.WriteLine(string.Format("s/n;PCB nr.;bench;batch;position;Err. at 640 l/h;Err. LNA at 640 l/h;Err. Q3 RL;Err. Q3 LR;Cal.f.;Cal.f.LNA;Q2 corr.f. RL;Q2 corr.f. LR"));
foreach (var oraD in oraDatas)
{
writer.WriteLine(string.Format("{0}; {1}; {2}; =(\"{3}\"); {4}; {5}; {7}; {8}; {9}; {10};{11};{12};{13};{14};{15};{16};{17};{18};{19};{20}",
writer.WriteLine(string.Format("{0}; {1}; {2}; =(\"{3}\"); {4}; {5}; {7}; {8}; {9}; {10};{11};{12};{13};{14};{15};{16};{17};{18};{19};{20};{21};{22};{23};{24};{25};{26};{27};{28}",
//Console.WriteLine(string.Format("{2};=(\"{3}\"); {4};{5};{11};{12};{13};{14};{15};{16};{17};{19};{20}",
/* 0 */ oraD.PO,
/* 1 */ oraD.Prefix,
@@ -879,18 +972,57 @@ namespace ResultsBrowser
/* 9 */ oraD.End.ToShortDateString(),
/* 10 */ oraD.End.ToShortTimeString(),
/* 11 */ oraD.WMPosition,
/* 12 */ oraD.AdjErr.ToString("F2"),
/* 13 */ oraD.AdjErrA4.ToString("F2"),
/* 14 */ oraD.Q3RlErr.ToString("F2"),
/* 15 */ oraD.Q3LrErr.ToString("F2"),
/* 16 */ oraD.CalibFactor,
/* 17 */ oraD.CalibFactorLNA,
/* 18 */ oraD.HydrPruefung,
/* 19 */ oraD.Q2CorrectionRl,
/* 20 */ oraD.Q2CorrectionLr,
/* 21 */ oraD.WMTypeId,
/* 22 */ oraD.WMTypeRev));
/* 12 */ oraD.AdjErr.ToString("F3"),
/* 13 */ oraD.AdjErrA4.ToString("F3"),
/* 14 */ oraD.Q3RlErr.ToString("F3"),
/* 15 */ oraD.Q3LrErr.ToString("F3"),
/* 16 */ oraD.Q2RlErr.ToString("F3"),
/* 17 */ oraD.Q2LrErr.ToString("F3"),
/* 18 */ oraD.Q2acRlErr.ToString("F3"),
/* 19 */ oraD.Q2acLrErr.ToString("F3"),
/* 20 */ oraD.Q1RlErr.ToString("F3"),
/* 21 */ oraD.Q1LrErr.ToString("F3"),
/* 22 */ oraD.CalibFactor,
/* 23 */ oraD.CalibFactorLNA,
/* 24 */ oraD.HydrPruefung,
/* 25 */ oraD.Q2CorrectionRl,
/* 26 */ oraD.Q2CorrectionLr,
/* 27 */ oraD.WMTypeId,
/* 28 */ oraD.WMTypeRev));
}
#else
writer.WriteLine(string.Format("PO; prefix; S/N; PcbNr; Bench; Batch; Start; Start; End; End; Pos; AdjA0; Q4; Q3; Q2Adj; Q2; Q1; CalF; HP; Q2cRL; Q2cLR"));
//Console.WriteLine(string.Format("s/n;PCB nr.;bench;batch;position;Err. at 640 l/h;Err. LNA at 640 l/h;Err. Q3 RL;Err. Q3 LR;Cal.f.;Cal.f.LNA;Q2 corr.f. RL;Q2 corr.f. LR"));
foreach (var oraD in oraDatas)
{
writer.WriteLine(string.Format("{0}; {1}; {2}; =(\"{3}\"); {4}; {5}; {7}; {8}; {9}; {10};{11};{12};{13};{14};{15};{16};{17};{18};{19};{20};{21}",
//Console.WriteLine(string.Format("{2};=(\"{3}\"); {4};{5};{11};{12};{13};{14};{15};{16};{17};{19};{20}",
/* 0 */ oraD.PO,
/* 1 */ oraD.Prefix,
/* 2 */ oraD.SN,
/* 3 */ oraD.PcbNr,
/* 4 */ GetBenchName(oraD.TestBenchId),
/* 5 */ oraD.BatchNr,
/* 6 */ oraD.ProgramVer,
/* 7 */ oraD.Start.ToShortDateString(),
/* 8 */ oraD.Start.ToShortTimeString(),
/* 9 */ oraD.End.ToShortDateString(),
/* 10 */ oraD.End.ToShortTimeString(),
/* 11 */ oraD.WMPosition,
/* 12 */ oraD.AdjErr.ToString("F3"),
/* 13 */ oraD.Q4Err.ToString("F3"),
/* 14 */ oraD.Q3Err.ToString("F3"),
/* 15 */ oraD.Q2AdjErr.ToString("F3"),
/* 16 */ oraD.Q2Err.ToString("F3"),
/* 17 */ oraD.Q1Err.ToString("F3"),
/* 18 */ oraD.CalibFactor,
/* 19 */ oraD.HydrPruefung,
/* 20 */ oraD.Q2CorrectionRl,
/* 21 */ oraD.Q2CorrectionLr,
/* 22 */ oraD.WMTypeId,
/* 23 */ oraD.WMTypeRev));
}
#endif
}
consoleTextBox.Text += "CSV data end\r\n";
+12
View File
@@ -69,6 +69,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "Common\Common.csp
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataStreamInterface", "DataStreamInterface\DataStreamInterface.csproj", "{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResetBatchNr", "ResetBatchNr\ResetBatchNr.csproj", "{D7F5A111-B2DF-4761-9574-AB730DF573A6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -303,6 +305,16 @@ Global
{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}.Release|x86.ActiveCfg = Release|Any CPU
{D7F5A111-B2DF-4761-9574-AB730DF573A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D7F5A111-B2DF-4761-9574-AB730DF573A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7F5A111-B2DF-4761-9574-AB730DF573A6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{D7F5A111-B2DF-4761-9574-AB730DF573A6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{D7F5A111-B2DF-4761-9574-AB730DF573A6}.Debug|x86.ActiveCfg = Debug|Any CPU
{D7F5A111-B2DF-4761-9574-AB730DF573A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7F5A111-B2DF-4761-9574-AB730DF573A6}.Release|Any CPU.Build.0 = Release|Any CPU
{D7F5A111-B2DF-4761-9574-AB730DF573A6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{D7F5A111-B2DF-4761-9574-AB730DF573A6}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{D7F5A111-B2DF-4761-9574-AB730DF573A6}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
+1 -2
View File
@@ -40,9 +40,8 @@ namespace TBF.BenchControl.Dummy.Balance
public float BuoyancyPress { get { return 1.013f; } }
public float BuoyancyHumi { get { return 50.0f; } }
public IOperation TaringOp(ref Boxes.DoubleBox tara)
public IOperation ZeroOp()
{
tara.Val = 0;
return this;
}
+6 -6
View File
@@ -110,11 +110,11 @@ namespace TBF.BenchControl.Elde
public byte MeretProtocol = 0;
// Array length is the reference flowmeters count plus one
#if DN100 || FUZHOU_150 || FUZHOU_300 || IZRAEL_200 || SLM_150 || SENTEC || CEVAK_200
#if DN100 || FUZHOU_150 || FUZHOU_300 || IZRAEL_200 || SENTEC || CEVAK_200
public uint[,] RegValveCalib = new uint[8,2] {{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500}};
public byte[] MeretRS485Address = new byte[4];
public float[] EtCalib = new float[6] { 1, 1, 1, 1, 1, 1 };
#elif PUCHONG_200 || GENESIS || BERLIN || GELSENWASSER || PETERSBURG_200 || RUM_MOB
#elif PUCHONG_200 || GENESIS || BERLIN || GELSENWASSER || PETERSBURG_200 || RUM_MOB || SLM_150
public uint[,] RegValveCalib = new uint[16, 2] { {100,500}, {100,500}, {100,500}, {100,500}, {100,500}, {100,500}, {100,500}, {100,500},
{100,500}, {100,500}, {100,500}, {100,500}, {100,500}, {100,500}, {100,500}, {100,500} };
public byte[] MeretRS485Address = new byte[4];
@@ -599,7 +599,7 @@ namespace TBF.BenchControl.Elde
/// <param name="refPulses">Number of reference pulses to complete the test</param>
/// <returns>Created operation</returns>
public IOperation StartMeasurementOp(OutputPath outputPath, TestMethods method,
double requiredFlowLo, double requiredFlowHi, int refPulses)
double requiredFlowLo, double requiredFlowHi, int refPulses, int delayBeforeFlowRegulation = 0)
{
if (controlBoardCfg.DebugLevel == DebugMode.Simulate)
{
@@ -607,7 +607,7 @@ namespace TBF.BenchControl.Elde
}
else
{
return new StartMeasurementOp(this, outputPath, method, requiredFlowLo, requiredFlowHi, refPulses);
return new StartMeasurementOp(this, outputPath, method, requiredFlowLo, requiredFlowHi, refPulses, delayBeforeFlowRegulation);
}
}
@@ -621,7 +621,7 @@ namespace TBF.BenchControl.Elde
/// <returns>Created operation</returns>
public IOperation StartProlongedMeasurementOp(OutputPath outputPath, TestMethods method,
double requiredFlowLo, double requiredFlowHi,
int totalRefPulses, int massRefPulses)
int totalRefPulses, int massRefPulses, int delayBeforeFlowRegulation = 0)
{
if (controlBoardCfg.DebugLevel == DebugMode.Simulate)
{
@@ -629,7 +629,7 @@ namespace TBF.BenchControl.Elde
}
else
{
return new StartMeasurementOp(this, outputPath, method, requiredFlowLo, requiredFlowHi, totalRefPulses, massRefPulses);
return new StartMeasurementOp(this, outputPath, method, requiredFlowLo, requiredFlowHi, totalRefPulses, massRefPulses, delayBeforeFlowRegulation);
}
}
+66 -64
View File
@@ -69,83 +69,85 @@ namespace TBF.BenchControl.Elde.Diverter
{
diverterCfg = cfg as DiverterCfg;
controlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components);
if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent");
if (diverterCfg.BitPosition < 0 || diverterCfg.BitPosition >= 64) throw new ArgumentOutOfRangeException("position");
this.mask = (((UInt128)1) << diverterCfg.BitPosition);
switchTimeStart = new FloatBox(diverterCfg.DfltSwithTimeStartMs / 1000.0f);
switchTimeEnd = new FloatBox(diverterCfg.DfltSwithTimeEndMs / 1000.0f);
diverterNr0 = nextIdx++;
///
if (Diverters == null || Diverters.Length < nextIdx)
{
GenericDevices.IDiverter[] divertersSoFar = Diverters;
Diverters = new GenericDevices.IDiverter[nextIdx];
if (divertersSoFar != null)
{
for (int i = 0; i < divertersSoFar.Length; i++) Diverters[i] = divertersSoFar[i];
}
Diverters[nextIdx - 1] = this;
}
/// Prepare arguments of SendCalibData()
if (diverterCfg.AdcNr >= 0 && diverterCfg.AdcNr < controlBoard.RegValveCalib.GetLength(0))
{
controlBoard.RegValveCalib[diverterCfg.AdcNr, 0] = (uint)diverterCfg.AdcValueToSink;
controlBoard.RegValveCalib[diverterCfg.AdcNr, 1] = (uint)diverterCfg.AdcValueToTank;
}
else
{
log.ErrorFormat("Unable to set {0} ADC levels: RegValveCalib array size={1}, diverter AdcNr={2}",
Name, controlBoard.RegValveCalib.GetLength(0), diverterCfg.AdcNr);
}
int divNrFromName;
if (!int.TryParse(Name.Substring(3), out divNrFromName))
if (cfg.DebugLevel != Config.Entities.DebugMode.Off)
{
divNrFromName = nextIdx;
}
#if GENESIS || PETERSBURG_50 || PETERSBURG_200 || FUZHOU_50 || FUZHOU_150 || FUZHOU_300 || ROMA_200
flowMtrNr4Cmd = divNrFromName + 1;
controlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components);
if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent");
if (diverterCfg.BitPosition < 0 || diverterCfg.BitPosition >= 64) throw new ArgumentOutOfRangeException("position");
this.mask = (((UInt128)1) << diverterCfg.BitPosition);
switchTimeStart = new FloatBox(diverterCfg.DfltSwithTimeStartMs / 1000.0f);
switchTimeEnd = new FloatBox(diverterCfg.DfltSwithTimeEndMs / 1000.0f);
diverterNr0 = nextIdx++;
///
if (Diverters == null || Diverters.Length < nextIdx)
{
GenericDevices.IDiverter[] divertersSoFar = Diverters;
Diverters = new GenericDevices.IDiverter[nextIdx];
if (divertersSoFar != null)
{
for (int i = 0; i < divertersSoFar.Length; i++) Diverters[i] = divertersSoFar[i];
}
Diverters[nextIdx - 1] = this;
}
/// Prepare arguments of SendCalibData()
if (diverterCfg.AdcNr >= 0 && diverterCfg.AdcNr < controlBoard.RegValveCalib.GetLength(0))
{
controlBoard.RegValveCalib[diverterCfg.AdcNr, 0] = (uint)diverterCfg.AdcValueToSink;
controlBoard.RegValveCalib[diverterCfg.AdcNr, 1] = (uint)diverterCfg.AdcValueToTank;
}
else
{
log.ErrorFormat("Unable to set {0} ADC levels: RegValveCalib array size={1}, diverter AdcNr={2}",
Name, controlBoard.RegValveCalib.GetLength(0), diverterCfg.AdcNr);
}
int divNrFromName;
if (!int.TryParse(Name.Substring(3), out divNrFromName))
{
divNrFromName = nextIdx;
}
#if GENESIS || PETERSBURG_50 || PETERSBURG_200 || FUZHOU_50 || FUZHOU_150 || FUZHOU_300 || ROMA_200 || SLM_150
flowMtrNr4Cmd = divNrFromName + 1;
#elif BADGER_STREDNA_TRAT
flowMtrNr4Cmd = (divNrFromName == 1) ? 1 : ((divNrFromName == 2) ? 9 : 20);
flowMtrNr4Cmd = (divNrFromName == 1) ? 1 : ((divNrFromName == 2) ? 9 : 20);
#elif BADGER_VELKA_TRAT
flowMtrNr4Cmd = ((divNrFromName % 10) == 1) ? 0x11 : (((divNrFromName % 10) == 2) ? 0x22 : 0x33);
flowMtrNr4Cmd = ((divNrFromName % 10) == 1) ? 0x11 : (((divNrFromName % 10) == 2) ? 0x22 : 0x33);
#elif FUZHOU_100
flowMtrNr4Cmd = divNrFromName;
flowMtrNr4Cmd = divNrFromName;
#elif CEVAK_200
flowMtrNr4Cmd = (divNrFromName == 4) ? 5 : divNrFromName;
flowMtrNr4Cmd = (divNrFromName == 4) ? 5 : divNrFromName;
#elif DEWA_300 || PUCHONG_200
flowMtrNr4Cmd = divNrFromName + 2; /// Div1: 1,2,3, Div2: 4, Div3: 5, Div4: 6, Div5: 7
flowMtrNr4Cmd = divNrFromName + 2; /// Div1: 1,2,3, Div2: 4, Div3: 5, Div4: 6, Div5: 7
#elif TURA_IPERL || TURA_IPERL_NEW
flowMtrNr4Cmd = divNrFromName + 16 * divNrFromName;
flowMtrNr4Cmd = divNrFromName + 16 * divNrFromName;
#elif FILIPINY_50
flowMtrNr4Cmd = (divNrFromName == 1) ? 1 : 7;
flowMtrNr4Cmd = (divNrFromName == 1) ? 1 : 7;
#elif GELSENWASSER
switch (divNrFromName)
{
default:
case 1: flowMtrNr4Cmd = 1; break;
case 2: flowMtrNr4Cmd = 0x12; break;
case 3: flowMtrNr4Cmd = 3; break;
case 4: flowMtrNr4Cmd = 5; break;
}
switch (divNrFromName)
{
default:
case 1: flowMtrNr4Cmd = 1; break;
case 2: flowMtrNr4Cmd = 0x12; break;
case 3: flowMtrNr4Cmd = 3; break;
case 4: flowMtrNr4Cmd = 5; break;
}
#else
flowMtrNr4Cmd = (divNrFromName == 1) ? 1 : 3;
#endif
diverterToTankOp = new SwitchDiverterOp(controlBoard, true, flowMtrNr4Cmd);
diverterToSinkOp = new SwitchDiverterOp(controlBoard, false, flowMtrNr4Cmd);
diverterToTankOp = new SwitchDiverterOp(controlBoard, true, flowMtrNr4Cmd);
diverterToSinkOp = new SwitchDiverterOp(controlBoard, false, flowMtrNr4Cmd);
log.Debug(this.ToString());
log.Debug(this.ToString());
}
}
///
+43 -23
View File
@@ -22,8 +22,9 @@ namespace TBF.BenchControl.Elde
readonly double maximalFlow;
readonly double reqFlowLo;
readonly double reqFlowHi;
readonly int totalRefPulses; /// Number of reference pulses for a complete test
readonly int massRefPulses; /// Number of reference pulses for mass collection
readonly int totalRefPulses; /// Number of reference pulses for a complete test
readonly int massRefPulses; /// Number of reference pulses for mass collection
readonly int delayBeforeFlowRegulation; /// Delay before flow control starts in seconds
readonly TestMethods testMethod;
readonly int diverterNr;
@@ -34,13 +35,16 @@ namespace TBF.BenchControl.Elde
{
StartingTest,
ResendCommand,
TestStarted,
ValveMoveToFlow,
WaitingBeforeValveMove,
StartingFlowRegulation,
OpCompleted,
}
OpState opState;
int delayStartTime; /// StateMachine.Time snapshot when delay before flow regulation starts
/// <summary>
/// Starts the measurement.
/// Events: MeasurementStarted
@@ -51,8 +55,8 @@ namespace TBF.BenchControl.Elde
/// <param name="totalRefPulses">Test duration in number of reference flowmeter pulses</param>
/// <param name="filterConstant">Specifies filter for watermeter pulses</param>
public StartMeasurementOp(ControlBoardDev controlBoard, OutputPath outputPath, TestMethods method,
double requiredFlowLo, double requiredFlowHi, int refPulses)
: this(controlBoard, outputPath, method, requiredFlowLo, requiredFlowHi, refPulses, refPulses)
double requiredFlowLo, double requiredFlowHi, int refPulses, int delayBeforeFlowRegulation = 0)
: this(controlBoard, outputPath, method, requiredFlowLo, requiredFlowHi, refPulses, refPulses, delayBeforeFlowRegulation)
{
}
@@ -66,7 +70,7 @@ namespace TBF.BenchControl.Elde
/// <param name="refPulses">Test duration in number of reference flowmeter pulses</param>
/// <param name="filterConstant">Specifies filter for watermeter pulses</param>
public StartMeasurementOp(ControlBoardDev controlBoard, OutputPath outputPath, TestMethods method,
double requiredFlowLo, double requiredFlowHi, int totalRefPulses, int massRefPulses)
double requiredFlowLo, double requiredFlowHi, int totalRefPulses, int massRefPulses, int delayBeforeFlowRegulation = 0)
{
if (controlBoard == null) throw new ArgumentNullException("controlBoardDev");
this.controlBoard = controlBoard;
@@ -100,12 +104,12 @@ namespace TBF.BenchControl.Elde
nominalFlow = outputPath.FlowMeter.NominalFlow;
maximalFlow = 1.25 * nominalFlow;
this.reqFlowLo = requiredFlowLo;
this.testMethod = method;
this.reqFlowLo = requiredFlowLo;
this.reqFlowHi = requiredFlowHi;
this.totalRefPulses = totalRefPulses;
this.massRefPulses = massRefPulses;
this.testMethod = method;
this.delayBeforeFlowRegulation = delayBeforeFlowRegulation;
log.Debug(this.ToString());
}
@@ -155,7 +159,15 @@ namespace TBF.BenchControl.Elde
if ((statusP & StatusP.TestInProgress) != 0)
{
log.Info("Test started");
opState = OpState.TestStarted;
if (delayBeforeFlowRegulation > 0)
{
delayStartTime = StateMachine.Time;
opState = OpState.WaitingBeforeValveMove;
}
else
{
opState = OpState.StartingFlowRegulation;
}
}
else
{
@@ -170,7 +182,15 @@ namespace TBF.BenchControl.Elde
opState = OpState.StartingTest;
return Event.None;
}
else if (opState == OpState.TestStarted)
else if (opState == OpState.WaitingBeforeValveMove)
{
if (StateMachine.Time - delayStartTime >= delayBeforeFlowRegulation)
{
opState = OpState.StartingFlowRegulation;
}
return Event.None;
}
else if (opState == OpState.StartingFlowRegulation)
{
///
/// Done once, issues an appropriate ValveMove(...) command
@@ -185,18 +205,18 @@ namespace TBF.BenchControl.Elde
double freqLo = 2000.0 * reqFlowLo / nominalFlow;
double freqHi = 2000.0 * reqFlowHi / nominalFlow;
if (regulValve.IsCoax)
{
controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetFrequency,
if (regulValve.IsCoax)
{
controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetFrequency,
new float[2] { (float)((freqLo + freqHi) / 2), (float)((freqLo + freqHi) / 2) },
regulValveStableTime);
}
else
{
controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetFrequency,
new float[2] { (float)freqLo, (float)freqHi },
regulValveStableTime);
}
regulValveStableTime);
}
else
{
controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetFrequency,
new float[2] { (float)freqLo, (float)freqHi },
regulValveStableTime);
}
opState = OpState.OpCompleted;
return Event.None;
+3 -4
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
///
using TBF.Boxes;
@@ -17,9 +17,8 @@ namespace TBF.BenchControl.GenericDevices
/// <summary>
/// Events: BalanceDone, Error
/// </summary>
/// <param name="result">Reference to a variable for 'tara' in kg</param>
/// <returns>TaringOp instance reference casted to IOperaton</returns>
IOperation TaringOp(ref DoubleBox tara);
/// <returns>ZeroOp instance reference casted to IOperaton</returns>
IOperation ZeroOp();
/// <summary>
/// Events: BalanceDone, Error
@@ -197,7 +197,7 @@ namespace TBF.BenchControl.MettlerToledo.Multi
{
if (balanceCfg.DebugLevel == DebugMode.Simulate)
{
Masses[balanceNr] = TestBenchSim.GetSimMass(balanceNr);
Masses[balanceNr] = 123.456;
msrmntState = MsrmntState.Valid;
msrmntTimeStamp = StateMachine.Time;
return;
@@ -297,16 +297,26 @@ namespace TBF.BenchControl.MettlerToledo.Multi
public void StopDevice2() { }
/// <summary>
/// Events: BalanceDone, Error
/// </summary>
/// <param name="result">Reference to a variable for 'tara' in kg</param>
/// <returns>TaringOp instance reference casted to IOperaton</returns>
public IOperation TaringOp(ref DoubleBox tara)
/// <returns>ZeroOp reference</returns>
public IOperation ZeroOp()
{
return new TaringOp(this, ref tara);
return new ZeroOp(this);
}
/// <summary>
/// Events: BalanceDone, Error
/// </summary>
/// <param name="result">Reference to a variable for 'tara' in kg</param>
/// <returns>TaringOp reference</returns>
public IOperation TaringOp(ref DoubleBox tara)
{
return new TaringOp(this, ref tara);
}
/// <summary>
/// Events: BalanceDone, Error
/// </summary>
@@ -0,0 +1,68 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using log4net;
namespace TBF.BenchControl.MettlerToledo.Multi
{
public class ZeroOp : IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(ZeroOp));
public override string ToString() { return string.Format("ZeroOp(.,.)"); }
bool done;
/// Set by the constructor
BalanceDev balanceDev;
/// <summary>
/// Events: BalanceDone, Error
/// </summary>
/// <param name="balanceDev">Balance device instance</param>
public ZeroOp(BalanceDev balanceDev)
{
if (balanceDev == null) throw new ArgumentNullException("balanceDev");
this.balanceDev = balanceDev;
log.Debug(this.ToString());
}
/// <summary>Start this operation</summary>
public void Start()
{
done = true;
}
/// <summary>Run this operation</summary>
/// <returns>
/// Event.None
/// Event.BalanceDone
/// Event.Error . . . . . Current.Tick == null
/// </returns>
public Event Run()
{
if (done) return Event.BalanceDone; /// Zero has been done already
if (balanceDev.MsrmntState == MsrmntState.Busy) return Event.Busy;
if (balanceDev.MsrmntState == MsrmntState.Overload)
{
done = true;
return Event.BalanceOverload;
}
if (balanceDev.MsrmntState == MsrmntState.Valid)
{
done = true;
return Event.BalanceDone; /// Zero completed
}
return Event.Busy;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
}
}
}
@@ -78,9 +78,8 @@ namespace TBF.BenchControl.MettlerToledo.Standard
public string Format { get { return balanceCfg.Format; } }
public BalanceDev()
{
}
public BalanceDev() { }
/// <summary>
/// Constructor
@@ -297,7 +296,7 @@ namespace TBF.BenchControl.MettlerToledo.Standard
if (balanceCfg.DebugLevel == DebugMode.Simulate)
{
Masses[balanceNr] = TestBenchSim.GetSimMass(balanceNr);
Masses[balanceNr] = 123.456;
msrmntState = MsrmntState.Valid;
msrmntTimeStamp = StateMachine.Time;
return;
@@ -513,13 +512,22 @@ namespace TBF.BenchControl.MettlerToledo.Standard
/// <summary>
/// Events: BalanceDone, Error
/// </summary>
/// <param name="result">Reference to a variable for 'tara' in kg</param>
/// <returns>TaringOp instance reference casted to IOperaton</returns>
public IOperation TaringOp(ref DoubleBox tara)
/// <returns>ZeroOp reference</returns>
public IOperation ZeroOp()
{
return new TaringOp(this, ref tara);
return new ZeroOp(this);
}
/// <summary>
/// Events: BalanceDone, Error
/// </summary>
/// <param name="result">Reference to a variable for 'tara' in kg</param>
/// <returns>TaringOp reference</returns>
public IOperation TaringOp(ref DoubleBox tara)
{
return new TaringOp(this, ref tara);
}
/// <summary>
/// Events: BalanceDone, Error
/// </summary>
@@ -0,0 +1,74 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using log4net;
namespace TBF.BenchControl.MettlerToledo.Standard
{
public class ZeroOp : IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(ZeroOp));
public override string ToString() { return string.Format("ZeroOp(.,.)"); }
bool done;
/// Set by the constructor
BalanceDev balanceDev;
/// <summary>
/// Events: BalanceDone, Error
/// </summary>
/// <param name="balanceDev">Balance device instance</param>
/// <param name="result">Reference to variable for 'tara' in kg</param>
public ZeroOp(BalanceDev balanceDev)
{
if (balanceDev == null) throw new ArgumentNullException("balanceDev");
this.balanceDev = balanceDev;
log.Debug(this.ToString());
}
/// <summary>Start this operation</summary>
public void Start()
{
log.DebugFormat("{0} - Start()", balanceDev.Name);
done = false;
balanceDev.ZeroWhenStable();
}
/// <summary>Run this operation</summary>
/// <returns>
/// Event.None
/// Event.BalanceDone
/// Event.Error . . . . . Current.Tick == null
/// </returns>
public Event Run()
{
if (done) return Event.BalanceDone; /// Zeroing has been done already
if (balanceDev.MsrmntState == MsrmntState.Busy) return Event.Busy;
if (balanceDev.MsrmntState == MsrmntState.Overload)
{
done = true;
return Event.BalanceOverload;
}
if (balanceDev.MsrmntState == MsrmntState.Valid)
{
done = true;
return Event.BalanceDone; /// Zeroing completed
}
balanceDev.ZeroWhenStable(); /// Failed -> repeat zeroing
return Event.Busy;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
log.DebugFormat("{0} - Stop()", balanceDev.Name);
}
}
}
@@ -0,0 +1,149 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using log4net;
using TBF.BenchControl.Generic;
using TBF.Boxes;
using Config.Entities;
using System.Diagnostics;
namespace TBF.BenchControl.Modbus.WaterAnalyzer2
{
public class Analyzer : ComponentBase, GenericDevices.ITempMeter, IDevice
{
private static readonly ILog log = LogManager.GetLogger(typeof(Analyzer));
public override string ToString() { return string.Format("Analyzer({0})", Cfg.ToString(1)); }
readonly AnalyzerCfg myCfg;
readonly GenericDevices.IModbus modbus;
/// <summary>The state of the measurement</summary>
MsrmntState msrmntState;
///
/// Measured values when MsrmntState == MsrmntState.Valid
///
float conductivity; /// [uS/cm] electrical conductivity of water
double temperature; /// [°C] water temperature
public float Conductivity { get { return conductivity; } }
/// <summary>Measurement time stamp when MsrmntState == MsrmntState.Valid</summary>
int msrmntTimeStamp;
public Analyzer()
{
}
public Analyzer(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
: base(cfg)
{
myCfg = cfg as AnalyzerCfg;
modbus = (GenericDevices.IModbus)TbfComponents.FindComponent(cfg.ParentName, components);
if (modbus == null) throw new Exception("Cannot find " + Name + " parent");
/// Connect to handler
//ModbusAddress.MeretRS485Address[Idx0] = ModbusAddress;
log.Debug(this.ToString());
}
/// <summary>Initialize this device</summary>
public void Initialize()
{
if (myCfg.DebugLevel == DebugMode.Simulate)
{
conductivity = 0.0F;
temperature = 0.0;
msrmntTimeStamp = StateMachine.Time;
msrmntState = MsrmntState.Valid;
return;
}
msrmntState = MsrmntState.Busy;
log.FatalFormat("Successfully initialized device {0}", ToString());
}
/// Returns electrical conductivity of water in [uS/cm]
public float ReadConductivity()
{
return conductivity;
}
public double ReadTemperature() { return temperature; } /// Returns water temperature in [°C]
public ReadConductivityOp ReadConductivityOp(ref FloatBox conduct) { return new ReadConductivityOp(this, ref conduct); }
public IOperation ReadTempOp(ref DoubleBox temperature) { return new ReadTempOp(this, ref temperature); }
public IOperation ReadTempOp(ref DoubleBox temperature, Event eventDone) { return new ReadTempOp(this, ref temperature, eventDone); }
/// <summary>Run this device</summary>
public void RunDeviceBefore()
{
if (myCfg.DebugLevel == Config.Entities.DebugMode.Simulate ||
myCfg.DebugLevel == Config.Entities.DebugMode.FailureDuringOperation)
{
msrmntTimeStamp = StateMachine.Time;
return;
}
if (modbus.ReceivedTelegrams[myCfg.ModbusAddress].Count > 0)
{
byte[] telegram = modbus.ReceivedTelegrams[myCfg.ModbusAddress].Dequeue();
if (telegram.Length == 7 && telegram[1] == 3)
{
///
/// Telegram with values
///
int current_uA = 256 * telegram[3] + telegram[4];
conductivity = Convert.ToSingle(myCfg.ConductiviyAt4mA + (myCfg.ConductiviyAt20mA - myCfg.ConductiviyAt4mA) * (current_uA - 4000) / 16000.0);
UpdateProcessData(conductivity);
string line = string.Format("conductivity = {0} uS/cm", conductivity);
log.Debug(line);
Debug.WriteLine(line);
}
}
byte[] msg = new byte[8]; /// Buffer for data to send
if ((StateMachine.Time % 10) == 0) /// Each 10 seconds
{
///
/// Send command to request 1 float value in 2 registers at addresses 0x50 and 0x51 from Modbus.WaterAnalyzer
///
UInt16 regAddr = 0x0060;
UInt16 count = 1;
/// Prepare data to be sent
msg[0] = myCfg.ModbusAddress;
msg[1] = 3; /// CMD =
msg[2] = (byte)(regAddr >> 8); /// Control Word Hi
msg[3] = (byte)(regAddr & 0xFF); /// Control Word Lo
msg[4] = (byte)(count >> 8); /// Serial Com Reference Hi
msg[5] = (byte)(count & 0xFF); /// Serial Com Reference Lo
modbus.SendMessage(msg);
}
}
public void RunDeviceAfter() { }
public void StopDevice() { }
public void StopDevice2() { }
void UpdateProcessData(float conduct)
{
TBF.BenchControl.Sequences.ProcessData.Conductivity.Val = conduct;
}
}
}
@@ -0,0 +1,169 @@
///
/// Copyright (c) 2020 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.Modbus.WaterAnalyzer2
{
public class AnalyzerCfg : ComponentCfgBase, Generic.IChildComponentCfg, Config.Entities.IParamsProvider
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(AnalyzerCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl()
{
IList<string> parents = new List<string>();
// TODO:
//if (StateMachine.Components != null)
//{
// foreach (var cmpnt in StateMachine.Components)
// {
// if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is TBF.BenchControl.Modbus.Common.Factory)
// {
// parents.Add(cmpnt.Name);
// }
// }
//}
parents.Add("Modbus");
parents.Add("ModbusUSB");
return new Configs.ParamsProvider.ComponentCfgCtrl(this, parents);
}
///
/// Serialized parameters
///
public byte ModbusAddress; /// 1..247
public double ConductiviyAt4mA;
public double ConductiviyAt20mA;
/// Private parameterless constructor invoked by all other (public) constructors
AnalyzerCfg() {}
public AnalyzerCfg(string name, IComponentFactory factory)
: this()
{
Factory = factory;
Name = name;
ParentName = "ModbusUSB";
InitializeAll();
}
public string ComponentName { get { return Name; } }
public void InitializeAll()
{
ModbusAddress = 51;
ConductiviyAt4mA = 0; /// uS/cm
ConductiviyAt20mA = 1200; /// uS/cm
}
string[] paramNames = new string[]
{
"Modbus address",
"Conductivity @4mA in uS/cm",
"Conductivity @20mA in uS/cm",
};
public string ParamName(int i) { return paramNames[i]; }
public int ParamsCount() { return paramNames.Length; }
public IList<string> ParamValues(int i) { return null; }
public string ToString(int i)
{
if (i == -1)
{
return string.Format("ModbusAddr={0}", ModbusAddress);
}
switch (i)
{
case 0: return ModbusAddress.ToString();
case 1: return ConductiviyAt4mA.ToString();
case 2: return ConductiviyAt20mA.ToString();
default: return string.Empty;
}
}
public CfgUpdateFlags UpdateParam(int i, string strValue)
{
switch (i)
{
case 0:
byte addr = byte.Parse(strValue);
if (ModbusAddress != addr)
{
ModbusAddress = addr;
return CfgUpdateFlags.RestartRqrd;
}
else
{
return CfgUpdateFlags.None;
}
case 1:
ConductiviyAt4mA = Utils.ParseUDouble(strValue);
return CfgUpdateFlags.RestartRqrd;
case 2:
ConductiviyAt20mA = Utils.ParseUDouble(strValue);
return CfgUpdateFlags.RestartRqrd;
default:
return CfgUpdateFlags.None;
}
}
public bool ValidateParam(int i, string strValue, out string message)
{
message = string.Empty;
int dummy;
double ddummy;
switch (i)
{
case 0:
if (int.TryParse(strValue, out dummy) && dummy >= 1 && dummy <= 247) return true;
message = ParamName(i) + " is invalid. Address range is 1 .. 247";
return false;
case 1:
case 2:
if (Utils.TryParseUDouble(strValue, out ddummy)) return true;
break;
default:
message = "Invalid index";
return false;
}
message = ParamName(i) + " is invalid";
return false;
}
void CopyContentTo(AnalyzerCfg prms)
{
prms.ParentName = this.ParentName;
prms.ModbusAddress = this.ModbusAddress;
prms.ConductiviyAt4mA = this.ConductiviyAt4mA;
prms.ConductiviyAt20mA = this.ConductiviyAt20mA;
}
public Config.Entities.IParamsProvider Clone()
{
AnalyzerCfg pars = new AnalyzerCfg();
CopyContentTo(pars);
return pars;
}
public bool UpdateEmbeddedDbEntity()
{
return true; /// =OK, do nothing
}
}
}
@@ -0,0 +1,26 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Modbus.WaterAnalyzer2
{
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public void ResetStaticProperties() { Analyzer.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Analyzer(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Analyzer(cfg, components); }
public IComponentCfg DefaultConfig() { return new AnalyzerCfg(this.GetType().Namespace.Substring(24), this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(AnalyzerCfg.Serializer, component, this);
}
}
}
@@ -0,0 +1,58 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using log4net;
using TBF.Boxes;
namespace TBF.BenchControl.Modbus.WaterAnalyzer2
{
public class ReadConductivityOp : IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(ReadConductivityOp));
public override string ToString() { return string.Format("ReadLevelOp(.,.)"); }
/// Set by the constructor
readonly Analyzer analyzer;
/// Measured value
FloatBox conductivity; /// [uS/cm] electrical conductivity of water
/// <summary>
/// Events: LevelDone or Error
/// </summary>
/// <param name="analyzer">Water level meter reference</param>
/// <param name="conduct">Reference to the measured level variable, value is in mm</param>
/// <param name="eventDone">Event to be returned by Run() when completed OK</param>
public ReadConductivityOp(Analyzer analyzer, ref FloatBox conduct)
{
if (analyzer == null) throw new ArgumentNullException("analyzer");
this.analyzer = analyzer;
this.conductivity = conduct;
log.Debug(this.ToString());
}
/// <summary>Start this operation</summary>
public void Start()
{
conductivity.Val = analyzer.ReadConductivity();
}
/// <summary>Run this operation</summary>
/// <returns>
/// Event.ConductivityDone
/// </returns>
public Event Run()
{
conductivity.Val = analyzer.ReadConductivity();
return Event.ConductivityDone;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
}
}
}
@@ -0,0 +1,64 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using log4net;
using TBF.Boxes;
namespace TBF.BenchControl.Modbus.WaterAnalyzer2
{
public class ReadTempOp : IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(ReadTempOp));
public override string ToString() { return string.Format("ReadTempOp(.,{0},.)", eventDone); }
/// Set by the constructor
readonly Analyzer analyzer;
readonly Event eventDone;
/// Measured value
DoubleBox temperature;
/// <summary>
/// Events: eventDone or Error
/// </summary>
/// <param name="analyzer">Water temperature meter reference</param>
/// <param name="temperature">Reference to the measured temperature variable, value is in l</param>
/// <param name="eventDone">Event to be returned by Run() when completed OK</param>
public ReadTempOp(Analyzer analyzer, ref DoubleBox temperature, Event eventDone)
{
if (analyzer == null) throw new ArgumentNullException("analyzer");
this.analyzer = analyzer;
this.temperature = temperature;
this.eventDone = eventDone;
log.Debug(this.ToString());
}
public ReadTempOp(Analyzer levelMeter, ref DoubleBox temperature)
: this(levelMeter, ref temperature, Event.TempDone)
{
}
/// <summary>Start this operation</summary>
public void Start()
{
temperature.Val = analyzer.ReadTemperature();
}
/// <summary>Run this operation</summary>
/// <returns>
/// Event.temperatureDone
/// </returns>
public Event Run()
{
temperature.Val = analyzer.ReadTemperature();
return eventDone;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
}
}
}
@@ -277,7 +277,7 @@ namespace TBF.BenchControl.Network.Camera
public JpegFrame() : base(26) { }
/// <summary>
/// //Writes the packets to a memory stream and created the default header and quantization tables if necessary.
/// Writes packets to a memory stream and created the default header and quantization tables if necessary.
/// </summary>
void ProcessPackets(System.IO.MemoryStream buffer)
{
@@ -9,10 +9,10 @@ namespace TBF.BenchControl.Network.Camera
{
public enum STATE
{
Empty,
OK,
Error,
Complete,
Empty, /// Initial state after being constructed
OK, /// The frame is not empty, but it's not complete yet. It's without any error
Error, /// An error occured
Complete, /// The frame is complete, consequent AddPacket() calls will be ignored
}
public readonly int PayloadType;
@@ -1,48 +0,0 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
namespace TBF.BenchControl.Output.DB.ProductionTracing
{
public enum CodeType
{
UniqueNr,
FlowtubeNr, /// Prvé 3 znaky sa zhodujú s poslednými 3 znakmi názvu
FlowtubeNrLU, /// Začiatok kódu sa zhoduje s názvom
BatchNr,
BatchNrContainingPartName,
DateMMYY,
QualityCheck,
}
public enum CodeForm
{
Barcode,
QRCode,
Keyboard,
OkNok,
}
public enum CodeLocation
{
OnPart,
OnPallet,
}
public enum LifetimeManagement
{
None,
OneYear,
Count,
}
public enum ReleaseStatus
{
In_preparation,
Released,
ReleasedActive,
Deactivated,
Count,
}
}
@@ -1,9 +1,10 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
/// Copyright (c) 2018-2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using MySql.Data.MySqlClient;
using TracingDB;
namespace TBF.BenchControl.Output.DB.ProductionTracing
{
@@ -15,9 +16,9 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
public string Description;
public string Code;
public DateTime TimeStamp;
public CodeType CodeType;
public CodeForm CodeForm;
public CodeLocation CodeLocation;
public TracingDB.CodeType CodeType;
public TracingDB.CodeForm CodeForm;
public TracingDB.CodeLocation CodeLocation;
public string UserName;
public string Workplace;
@@ -267,7 +267,7 @@ namespace TBF.BenchControl.Output.EventTriggers.Standard
case 26: E10 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 27: E11 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 28: E12 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 29: E12 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 29: E13 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 30: E14 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 31: E15 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
case 32: E16 = (strValue == Strings.yes); return CfgUpdateFlags.AnyChange;
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2017 Sensus Slovensko a.s.
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -102,6 +102,10 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
printerCfg.DocName = newCfg.DocName;
printerCfg.NrOfCopies = newCfg.NrOfCopies;
printerCfg.BarcodeType = newCfg.BarcodeType;
printerCfg.BarcodeWidth = newCfg.BarcodeWidth;
printerCfg.BarcodeHeight = newCfg.BarcodeHeight;
ApplyConfig();
}
}
@@ -191,6 +195,9 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
CommonItems = printerCfg.CommonItems,
TestItems = printerCfg.SelectedItems,
Footer = printerCfg.Footer,
BarcodeType = printerCfg.BarcodeType,
BarcodeWidth = printerCfg.BarcodeWidth,
BarcodeHeight = printerCfg.BarcodeHeight,
};
for (int i = 1; i <= printerCfg.NrOfCopies; i++)
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2017 Sensus Slovensko a.s.
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
///
using System.Xml.Serialization;
using Config.Entities;
@@ -44,6 +44,10 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
public string DocName;
public int NrOfCopies;
public Results.Output.Printers.BarcodeType BarcodeType;
public int BarcodeWidth;
public int BarcodeHeight;
[XmlIgnore]
public Config.Entities.MetersKind MetersKind;
@@ -76,6 +76,12 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
this.templateLabel = new System.Windows.Forms.Label();
this.nrOfCopiesTextBox = new System.Windows.Forms.TextBox();
this.nrOfCopiesLabel = new System.Windows.Forms.Label();
this.barcodeTypeComboBox = new System.Windows.Forms.ComboBox();
this.barcodeLabel = new System.Windows.Forms.Label();
this.barcodeWidthTextBox = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.barcodeHeightTextBox = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// nameTextBox
@@ -108,7 +114,7 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
//
this.supressPrintingCheckBox.AutoSize = true;
this.supressPrintingCheckBox.Enabled = false;
this.supressPrintingCheckBox.Location = new System.Drawing.Point(19, 259);
this.supressPrintingCheckBox.Location = new System.Drawing.Point(91, 307);
this.supressPrintingCheckBox.Name = "supressPrintingCheckBox";
this.supressPrintingCheckBox.Size = new System.Drawing.Size(101, 17);
this.supressPrintingCheckBox.TabIndex = 33;
@@ -187,9 +193,9 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
// commonItemsButton
//
this.commonItemsButton.Enabled = false;
this.commonItemsButton.Location = new System.Drawing.Point(142, 259);
this.commonItemsButton.Location = new System.Drawing.Point(193, 259);
this.commonItemsButton.Name = "commonItemsButton";
this.commonItemsButton.Size = new System.Drawing.Size(218, 23);
this.commonItemsButton.Size = new System.Drawing.Size(167, 23);
this.commonItemsButton.TabIndex = 36;
this.commonItemsButton.Text = "Common items";
this.commonItemsButton.UseVisualStyleBackColor = true;
@@ -198,9 +204,9 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
// footerButton
//
this.footerButton.Enabled = false;
this.footerButton.Location = new System.Drawing.Point(142, 303);
this.footerButton.Location = new System.Drawing.Point(193, 303);
this.footerButton.Name = "footerButton";
this.footerButton.Size = new System.Drawing.Size(218, 23);
this.footerButton.Size = new System.Drawing.Size(167, 23);
this.footerButton.TabIndex = 38;
this.footerButton.Text = "Footer";
this.footerButton.UseVisualStyleBackColor = true;
@@ -209,9 +215,9 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
// headerButton
//
this.headerButton.Enabled = false;
this.headerButton.Location = new System.Drawing.Point(142, 237);
this.headerButton.Location = new System.Drawing.Point(193, 237);
this.headerButton.Name = "headerButton";
this.headerButton.Size = new System.Drawing.Size(218, 23);
this.headerButton.Size = new System.Drawing.Size(167, 23);
this.headerButton.TabIndex = 35;
this.headerButton.Text = "Title";
this.headerButton.UseVisualStyleBackColor = true;
@@ -220,9 +226,9 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
// testItemsButton
//
this.testItemsButton.Enabled = false;
this.testItemsButton.Location = new System.Drawing.Point(142, 281);
this.testItemsButton.Location = new System.Drawing.Point(193, 281);
this.testItemsButton.Name = "testItemsButton";
this.testItemsButton.Size = new System.Drawing.Size(218, 23);
this.testItemsButton.Size = new System.Drawing.Size(167, 23);
this.testItemsButton.TabIndex = 37;
this.testItemsButton.Text = "Test items";
this.testItemsButton.UseVisualStyleBackColor = true;
@@ -251,9 +257,9 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
// docNameTextBox
//
this.docNameTextBox.Enabled = false;
this.docNameTextBox.Location = new System.Drawing.Point(197, 328);
this.docNameTextBox.Location = new System.Drawing.Point(193, 328);
this.docNameTextBox.Name = "docNameTextBox";
this.docNameTextBox.Size = new System.Drawing.Size(163, 20);
this.docNameTextBox.Size = new System.Drawing.Size(167, 20);
this.docNameTextBox.TabIndex = 40;
//
// docNameLabel
@@ -269,7 +275,7 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
//
this.goodOnlyCheckBox.AutoSize = true;
this.goodOnlyCheckBox.Enabled = false;
this.goodOnlyCheckBox.Location = new System.Drawing.Point(19, 281);
this.goodOnlyCheckBox.Location = new System.Drawing.Point(15, 307);
this.goodOnlyCheckBox.Name = "goodOnlyCheckBox";
this.goodOnlyCheckBox.Size = new System.Drawing.Size(74, 17);
this.goodOnlyCheckBox.TabIndex = 34;
@@ -494,16 +500,74 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
this.nrOfCopiesLabel.TabIndex = 44;
this.nrOfCopiesLabel.Text = "# copies";
//
// barcodeTypeComboBox
//
this.barcodeTypeComboBox.Enabled = false;
this.barcodeTypeComboBox.FormattingEnabled = true;
this.barcodeTypeComboBox.Location = new System.Drawing.Point(19, 257);
this.barcodeTypeComboBox.Name = "barcodeTypeComboBox";
this.barcodeTypeComboBox.Size = new System.Drawing.Size(167, 21);
this.barcodeTypeComboBox.TabIndex = 45;
//
// barcodeLabel
//
this.barcodeLabel.AutoSize = true;
this.barcodeLabel.Location = new System.Drawing.Point(16, 241);
this.barcodeLabel.Name = "barcodeLabel";
this.barcodeLabel.Size = new System.Drawing.Size(47, 13);
this.barcodeLabel.TabIndex = 46;
this.barcodeLabel.Text = "Barcode";
//
// barcodeWidthTextBox
//
this.barcodeWidthTextBox.Enabled = false;
this.barcodeWidthTextBox.Location = new System.Drawing.Point(79, 281);
this.barcodeWidthTextBox.Name = "barcodeWidthTextBox";
this.barcodeWidthTextBox.Size = new System.Drawing.Size(31, 20);
this.barcodeWidthTextBox.TabIndex = 14;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(42, 285);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(35, 13);
this.label5.TabIndex = 15;
this.label5.Text = "Width";
//
// barcodeHeightTextBox
//
this.barcodeHeightTextBox.Enabled = false;
this.barcodeHeightTextBox.Location = new System.Drawing.Point(156, 281);
this.barcodeHeightTextBox.Name = "barcodeHeightTextBox";
this.barcodeHeightTextBox.Size = new System.Drawing.Size(30, 20);
this.barcodeHeightTextBox.TabIndex = 17;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(116, 285);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(38, 13);
this.label6.TabIndex = 18;
this.label6.Text = "Height";
//
// PrinterCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.barcodeLabel);
this.Controls.Add(this.barcodeTypeComboBox);
this.Controls.Add(this.label6);
this.Controls.Add(this.nrOfCopiesLabel);
this.Controls.Add(this.nrOfCopiesTextBox);
this.Controls.Add(this.barcodeHeightTextBox);
this.Controls.Add(this.templateTextBox);
this.Controls.Add(this.templateLabel);
this.Controls.Add(this.label5);
this.Controls.Add(this.footerItalicCheckBox);
this.Controls.Add(this.footerBoldCheckBox);
this.Controls.Add(this.barcodeWidthTextBox);
this.Controls.Add(this.footerFontSizeTextBox);
this.Controls.Add(this.footerFontFamilyComboBox);
this.Controls.Add(this.footerFontLabel);
@@ -598,5 +662,11 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
private System.Windows.Forms.Label templateLabel;
private System.Windows.Forms.TextBox nrOfCopiesTextBox;
private System.Windows.Forms.Label nrOfCopiesLabel;
private System.Windows.Forms.ComboBox barcodeTypeComboBox;
private System.Windows.Forms.Label barcodeLabel;
private System.Windows.Forms.TextBox barcodeWidthTextBox;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox barcodeHeightTextBox;
private System.Windows.Forms.Label label6;
}
}
@@ -1,14 +1,15 @@
///
/// Copyright (c) 2017 Sensus Slovensko a.s.
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using log4net;
using Config.Entities;
using Results.Output.Printers;
using TBF.BenchControl.Configs;
using TBF.BenchControl.Generic;
using TBF.Resources;
using TBF.BenchControl.Configs;
namespace TBF.BenchControl.Output.Printers.Enhanced
{
@@ -49,7 +50,12 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
bodyFontFamilyComboBox.Items.Add(ff.Name);
footerFontFamilyComboBox.Items.Add(ff.Name);
}
}
for (BarcodeType bt = BarcodeType.None; bt < BarcodeType.Count; bt++)
{
barcodeTypeComboBox.Items.Add(bt.ToString());
}
}
private void PrinterCfgCtrl_Load(object sender, EventArgs e)
{
@@ -114,6 +120,10 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
docNameTextBox.Text = config.DocName;
nrOfCopiesTextBox.Text = config.NrOfCopies.ToString();
barcodeTypeComboBox.Text = config.BarcodeType.ToString();
barcodeWidthTextBox.Text = config.BarcodeWidth.ToString();
barcodeHeightTextBox.Text = config.BarcodeHeight.ToString();
}
public void Unlock()
@@ -149,6 +159,10 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
footerButton.Enabled = true;
docNameTextBox.Enabled = true;
nrOfCopiesTextBox.Enabled = true;
barcodeTypeComboBox.Enabled = true;
barcodeWidthTextBox.Enabled = true;
barcodeHeightTextBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
@@ -216,6 +230,22 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
flags |= CfgUpdateFlags.Error;
}
if (!barcodeTypeComboBox.Items.Contains(barcodeTypeComboBox.Text))
{
message += Environment.NewLine + "Invalid barcode type";
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;
}
@@ -292,6 +322,18 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
flags |= UpdateDifferent(ref config.DocName, docNameTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.NrOfCopies, nrOfCopiesTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
for (BarcodeType bt = BarcodeType.None; bt < BarcodeType.Count; bt++)
{
if (bt.ToString().Equals(barcodeTypeComboBox.Text))
{
config.BarcodeType = bt;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
break;
}
}
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)
{
Printer.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
@@ -122,6 +122,11 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
printerCfg.ImgHgh = newCfg.ImgHgh;
printerCfg.ImgName = newCfg.ImgName;
printerCfg.DocName = newCfg.DocName;
printerCfg.BarcodeType = newCfg.BarcodeType;
printerCfg.BarcodeLeft = newCfg.BarcodeLeft;
printerCfg.BarcodeTop = newCfg.BarcodeTop;
printerCfg.BarcodeWidth = newCfg.BarcodeWidth;
printerCfg.BarcodeHeight = newCfg.BarcodeHeight;
ApplyConfig();
}
@@ -238,6 +243,11 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
ImgWid = printerCfg.ImgWid,
ImgHgh = printerCfg.ImgHgh,
ImgFullPathName = (wm.ArchivePath != null) ? System.IO.Path.Combine(wm.ArchivePath, printerCfg.ImgName) : null,
BarcodeType = printerCfg.BarcodeType,
BarcodeLeft = printerCfg.BarcodeLeft,
BarcodeTop = printerCfg.BarcodeTop,
BarcodeWidth = printerCfg.BarcodeWidth,
BarcodeHeight = printerCfg.BarcodeHeight,
};
new OnePerMeterPrintDocument(batch, cfg, wm, documentName).Print();
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2017-2019 Sensus Slovensko a.s.
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
///
using System.Xml.Serialization;
using Config.Entities;
@@ -70,6 +70,12 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
public string ImgName;
public string DocName;
public Results.Output.Printers.BarcodeType BarcodeType; /// s/n is printed as barcode when valid (BarcodeType.None < BarcodeType < BarcodeType.Count)
public int BarcodeLeft;
public int BarcodeTop;
public int BarcodeWidth;
public int BarcodeHeight;
[XmlIgnore]
public Config.Entities.MetersKind MetersKind;
@@ -109,6 +115,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
Footer = string.Empty;
DocName = string.Empty;
ImgName = string.Empty;
BarcodeType = Results.Output.Printers.BarcodeType.None;
}
public string ToString(int i)
@@ -107,6 +107,13 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
this.graphWidthTextBox = new System.Windows.Forms.TextBox();
this.graphTopTextBox = new System.Windows.Forms.TextBox();
this.graphLeftTextBox = new System.Windows.Forms.TextBox();
this.label14 = new System.Windows.Forms.Label();
this.barcodeLabel = new System.Windows.Forms.Label();
this.barcodeHeightTextBox = new System.Windows.Forms.TextBox();
this.barcodeWidthTextBox = new System.Windows.Forms.TextBox();
this.barcodeTopTextBox = new System.Windows.Forms.TextBox();
this.barcodeLeftTextBox = new System.Windows.Forms.TextBox();
this.barcodeTypeComboBox = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// nameTextBox
@@ -139,7 +146,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
//
this.supressPrintingCheckBox.AutoSize = true;
this.supressPrintingCheckBox.Enabled = false;
this.supressPrintingCheckBox.Location = new System.Drawing.Point(334, 26);
this.supressPrintingCheckBox.Location = new System.Drawing.Point(306, 5);
this.supressPrintingCheckBox.Name = "supressPrintingCheckBox";
this.supressPrintingCheckBox.Size = new System.Drawing.Size(101, 17);
this.supressPrintingCheckBox.TabIndex = 33;
@@ -421,7 +428,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
//
this.goodOnlyCheckBox.AutoSize = true;
this.goodOnlyCheckBox.Enabled = false;
this.goodOnlyCheckBox.Location = new System.Drawing.Point(334, 44);
this.goodOnlyCheckBox.Location = new System.Drawing.Point(306, 21);
this.goodOnlyCheckBox.Name = "goodOnlyCheckBox";
this.goodOnlyCheckBox.Size = new System.Drawing.Size(74, 17);
this.goodOnlyCheckBox.TabIndex = 34;
@@ -448,18 +455,18 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
// docNameLabel
//
this.docNameLabel.AutoSize = true;
this.docNameLabel.Location = new System.Drawing.Point(16, 331);
this.docNameLabel.Location = new System.Drawing.Point(297, 41);
this.docNameLabel.Name = "docNameLabel";
this.docNameLabel.Size = new System.Drawing.Size(246, 13);
this.docNameLabel.Size = new System.Drawing.Size(127, 13);
this.docNameLabel.TabIndex = 42;
this.docNameLabel.Text = "Doc.name (0=start 1-end, 2=batch, 3=wm, 4=s/n) :";
this.docNameLabel.Text = "Doc.name (0=start 1-end,";
//
// docNameTextBox
//
this.docNameTextBox.Enabled = false;
this.docNameTextBox.Location = new System.Drawing.Point(261, 328);
this.docNameTextBox.Location = new System.Drawing.Point(302, 69);
this.docNameTextBox.Name = "docNameTextBox";
this.docNameTextBox.Size = new System.Drawing.Size(135, 20);
this.docNameTextBox.Size = new System.Drawing.Size(151, 20);
this.docNameTextBox.TabIndex = 43;
//
// footerItalicCheckBox
@@ -513,7 +520,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
this.imageNameTextBox.Enabled = false;
this.imageNameTextBox.Location = new System.Drawing.Point(287, 306);
this.imageNameTextBox.Name = "imageNameTextBox";
this.imageNameTextBox.Size = new System.Drawing.Size(135, 20);
this.imageNameTextBox.Size = new System.Drawing.Size(166, 20);
this.imageNameTextBox.TabIndex = 44;
//
// imageLeftTextBox
@@ -758,7 +765,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
this.table1FormComboBox.FormattingEnabled = true;
this.table1FormComboBox.Location = new System.Drawing.Point(392, 237);
this.table1FormComboBox.Name = "table1FormComboBox";
this.table1FormComboBox.Size = new System.Drawing.Size(64, 21);
this.table1FormComboBox.Size = new System.Drawing.Size(61, 21);
this.table1FormComboBox.TabIndex = 78;
//
// label3
@@ -802,10 +809,76 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
this.graphLeftTextBox.Size = new System.Drawing.Size(33, 20);
this.graphLeftTextBox.TabIndex = 79;
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(339, 56);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(120, 13);
this.label14.TabIndex = 84;
this.label14.Text = " 2=batch, 3=wm, 4=s/n)";
//
// barcodeLabel
//
this.barcodeLabel.AutoSize = true;
this.barcodeLabel.Location = new System.Drawing.Point(17, 330);
this.barcodeLabel.Name = "barcodeLabel";
this.barcodeLabel.Size = new System.Drawing.Size(121, 13);
this.barcodeLabel.TabIndex = 89;
this.barcodeLabel.Text = "Barcode left/t/w/h/type";
//
// barcodeHeightTextBox
//
this.barcodeHeightTextBox.Enabled = false;
this.barcodeHeightTextBox.Location = new System.Drawing.Point(245, 327);
this.barcodeHeightTextBox.Name = "barcodeHeightTextBox";
this.barcodeHeightTextBox.Size = new System.Drawing.Size(31, 20);
this.barcodeHeightTextBox.TabIndex = 88;
//
// barcodeWidthTextBox
//
this.barcodeWidthTextBox.Enabled = false;
this.barcodeWidthTextBox.Location = new System.Drawing.Point(211, 327);
this.barcodeWidthTextBox.Name = "barcodeWidthTextBox";
this.barcodeWidthTextBox.Size = new System.Drawing.Size(31, 20);
this.barcodeWidthTextBox.TabIndex = 87;
//
// barcodeTopTextBox
//
this.barcodeTopTextBox.Enabled = false;
this.barcodeTopTextBox.Location = new System.Drawing.Point(177, 327);
this.barcodeTopTextBox.Name = "barcodeTopTextBox";
this.barcodeTopTextBox.Size = new System.Drawing.Size(31, 20);
this.barcodeTopTextBox.TabIndex = 86;
//
// barcodeLeftTextBox
//
this.barcodeLeftTextBox.Enabled = false;
this.barcodeLeftTextBox.Location = new System.Drawing.Point(141, 327);
this.barcodeLeftTextBox.Name = "barcodeLeftTextBox";
this.barcodeLeftTextBox.Size = new System.Drawing.Size(33, 20);
this.barcodeLeftTextBox.TabIndex = 85;
//
// barcodeTypeComboBox
//
this.barcodeTypeComboBox.Enabled = false;
this.barcodeTypeComboBox.FormattingEnabled = true;
this.barcodeTypeComboBox.Location = new System.Drawing.Point(287, 327);
this.barcodeTypeComboBox.Name = "barcodeTypeComboBox";
this.barcodeTypeComboBox.Size = new System.Drawing.Size(166, 21);
this.barcodeTypeComboBox.TabIndex = 90;
//
// PrinterCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.barcodeTypeComboBox);
this.Controls.Add(this.barcodeLabel);
this.Controls.Add(this.barcodeHeightTextBox);
this.Controls.Add(this.barcodeWidthTextBox);
this.Controls.Add(this.barcodeTopTextBox);
this.Controls.Add(this.barcodeLeftTextBox);
this.Controls.Add(this.label14);
this.Controls.Add(this.label3);
this.Controls.Add(this.graphHeightTextBox);
this.Controls.Add(this.graphWidthTextBox);
@@ -968,5 +1041,12 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
private System.Windows.Forms.TextBox graphWidthTextBox;
private System.Windows.Forms.TextBox graphTopTextBox;
private System.Windows.Forms.TextBox graphLeftTextBox;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label barcodeLabel;
private System.Windows.Forms.TextBox barcodeHeightTextBox;
private System.Windows.Forms.TextBox barcodeWidthTextBox;
private System.Windows.Forms.TextBox barcodeTopTextBox;
private System.Windows.Forms.TextBox barcodeLeftTextBox;
private System.Windows.Forms.ComboBox barcodeTypeComboBox;
}
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2017-2019 Sensus Slovensko a.s.
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -7,6 +7,7 @@ using System.Linq;
using System.Windows.Forms;
using log4net;
using Config.Entities;
using Results.Output.Printers;
using TBF.BenchControl.Generic;
using TBF.Resources;
using TBF.BenchControl.Configs;
@@ -61,7 +62,12 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
{
table1FormComboBox.Items.Add(f.ToString());
}
}
for (BarcodeType bt = BarcodeType.None; bt < BarcodeType.Count; bt++)
{
barcodeTypeComboBox.Items.Add(bt.ToString());
}
}
private void PrinterCfgCtrl_Load(object sender, EventArgs e)
{
@@ -151,6 +157,12 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
docNameTextBox.Text = config.DocName;
table1FormComboBox.Text = config.Form.ToString();
barcodeTypeComboBox.Text = config.BarcodeType.ToString();
barcodeLeftTextBox.Text = config.BarcodeLeft.ToString();
barcodeTopTextBox.Text = config.BarcodeTop.ToString();
barcodeWidthTextBox.Text = config.BarcodeWidth.ToString();
barcodeHeightTextBox.Text = config.BarcodeHeight.ToString();
}
public void Unlock()
@@ -207,6 +219,11 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
imageHeightTextBox.Enabled = true;
imageNameTextBox.Enabled = true;
docNameTextBox.Enabled = true;
barcodeTypeComboBox.Enabled = true;
barcodeLeftTextBox.Enabled = true;
barcodeTopTextBox.Enabled = true;
barcodeWidthTextBox.Enabled = true;
barcodeHeightTextBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
@@ -361,6 +378,32 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
flags |= CfgUpdateFlags.Error;
}
if (!barcodeTypeComboBox.Items.Contains(barcodeTypeComboBox.Text))
{
message += Environment.NewLine + "Invalid barcode type";
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;
}
@@ -471,6 +514,20 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
flags |= UpdateDifferent(ref config.DocName, docNameTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
for (BarcodeType bt = BarcodeType.None; bt < BarcodeType.Count; bt++)
{
if (bt.ToString().Equals(barcodeTypeComboBox.Text))
{
config.BarcodeType = bt;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
break;
}
}
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)
{
Printer.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
+3 -6
View File
@@ -132,13 +132,10 @@ namespace TBF.BenchControl.Sequences
Bridge.OnActivity(this, Strings.Resetting_scales);
Bridge.Bench2UI(ButtonsEtc.StopBtnEn); /// Resetting scales -> Enable STOP button
DoubleBox tara1 = new DoubleBox(0);
DoubleBox tara2 = new DoubleBox(0);
DoubleBox tara3 = new DoubleBox(0);
State.Create("MainSeq : Reset scales").AddOperation(checkUiOp)
.AddOperation((StateMachine.Tank1 is IScale) ? (StateMachine.Tank1 as IScale).TaringOp(ref tara1) : null)
.AddOperation((StateMachine.Tank2 is IScale) ? (StateMachine.Tank2 as IScale).TaringOp(ref tara2) : null)
.AddOperation((StateMachine.Tank3 is IScale) ? (StateMachine.Tank3 as IScale).TaringOp(ref tara3) : null)
.AddOperation((StateMachine.Tank1 is IScale) ? (StateMachine.Tank1 as IScale).ZeroOp() : null)
.AddOperation((StateMachine.Tank2 is IScale) ? (StateMachine.Tank2 as IScale).ZeroOp() : null)
.AddOperation((StateMachine.Tank3 is IScale) ? (StateMachine.Tank3 as IScale).ZeroOp() : null)
.EnterState();
do
{
+109 -107
View File
@@ -590,7 +590,7 @@ namespace TBF.BenchControl.Sequences
{
ISequenceCondition seqCondition = TbfComponents.FindComponent(fields[0]) as ISequenceCondition;
int condID;
if (int.TryParse(fields[1], out condID))
if ((seqCondition != null) && int.TryParse(fields[1], out condID))
{
conditionOperation = seqCondition.ConditionOp(condID);
}
@@ -1588,123 +1588,125 @@ namespace TBF.BenchControl.Sequences
Results.Entities.TestRslt tstRslt = ProcessData.BatchRslts.GetTestRslt(fullTestName, part);
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = DateTime.Now;
tstRslt.EndTime = DateTime.Now + new TimeSpan(0, 0, 1);
tstRslt.FlowSetTime = 10;
tstRslt.TestTime = tstRslt.TargetTime();
/// TODO: Verify whether 'ltrPerRefPulse' is up to date
tstRslt.PulsesMaster = (LtrPerRefPulse > 1E-6) ? (tstRslt.TargetVolume() / LtrPerRefPulse) : 1;
tstRslt.ConstMasterRaw = LtrPerRefPulse;
tstRslt.ConstMaster = LtrPerRefPulse;
tstRslt.MassStartRaw = 0;
tstRslt.MassStart = 0;
tstRslt.MassEndRaw = tstRslt.TargetVolume() * Config.Formulas.RealDensity() / 1000.0f;
tstRslt.MassEnd = tstRslt.MassEndRaw;
tstRslt.DensityIn = Config.Formulas.RealDensity();
tstRslt.DensityLine = Config.Formulas.RealDensity();
tstRslt.DensityDiv = Config.Formulas.RealDensity();
tstRslt.Buoyancy = Formulas.Buoyancy();
tstRslt.FlowMass = tstRslt.MassEnd / tstRslt.TargetTime();
tstRslt.FlowVolume = tstRslt.TargetVolume() / tstRslt.TargetTime();
tstRslt.VolumeCTV = tstRslt.TargetVolume();
tstRslt.VolumeMaster = tstRslt.TargetVolume();
tstRslt.ErrorMaster = 0;
if (tstRslt != null)
{
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = DateTime.Now;
tstRslt.EndTime = DateTime.Now + new TimeSpan(0, 0, 1);
tstRslt.FlowSetTime = 10;
tstRslt.TestTime = tstRslt.TargetTime();
/// TODO: Verify whether 'ltrPerRefPulse' is up to date
tstRslt.PulsesMaster = (LtrPerRefPulse > 1E-6) ? (tstRslt.TargetVolume() / LtrPerRefPulse) : 1;
tstRslt.ConstMasterRaw = LtrPerRefPulse;
tstRslt.ConstMaster = LtrPerRefPulse;
tstRslt.MassStartRaw = 0;
tstRslt.MassStart = 0;
tstRslt.MassEndRaw = tstRslt.TargetVolume() * Config.Formulas.RealDensity() / 1000.0f;
tstRslt.MassEnd = tstRslt.MassEndRaw;
tstRslt.DensityIn = Config.Formulas.RealDensity();
tstRslt.DensityLine = Config.Formulas.RealDensity();
tstRslt.DensityDiv = Config.Formulas.RealDensity();
tstRslt.Buoyancy = Formulas.Buoyancy();
tstRslt.FlowMass = tstRslt.MassEnd / tstRslt.TargetTime();
tstRslt.FlowVolume = tstRslt.TargetVolume() / tstRslt.TargetTime();
tstRslt.VolumeCTV = tstRslt.TargetVolume();
tstRslt.VolumeMaster = tstRslt.TargetVolume();
tstRslt.ErrorMaster = 0;
tstRslt.AmbTempMean = 20.0f;
tstRslt.AmbPressMean = 1.0f;
tstRslt.AmbHumiMean = 50.0f;
tstRslt.AmbTempMean = 20.0f;
tstRslt.AmbPressMean = 1.0f;
tstRslt.AmbHumiMean = 50.0f;
tstRslt.PressUpStart = 1.0f;
tstRslt.PressDownStart = 1.0f;
tstRslt.TempUpStart = 20.0f;
tstRslt.TempDownStart = 20.0f;
tstRslt.TempDivStart = 20.0f;
tstRslt.PressUpEnd = 1.0f;
tstRslt.PressDownEnd = 1.0f;
tstRslt.TempUpEnd = 20.0f;
tstRslt.TempDownEnd = 20.0f;
tstRslt.TempDivEnd = 20.0f;
tstRslt.PressUpMean = 1.0f;
tstRslt.PressDownMean = 1.0f;
tstRslt.TempUpMean = 20.0f;
tstRslt.TempDownMean = 20.0f;
tstRslt.TempDivMean = 20.0f;
tstRslt.PressUpMin = 1.0f;
tstRslt.PressDownMin = 1.0f;
tstRslt.TempUpMin = 20.0f;
tstRslt.TempDownMin = 20.0f;
tstRslt.TempDivMin = 20.0f;
tstRslt.PressUpMax = 1.0f;
tstRslt.PressDownMax = 1.0f;
tstRslt.TempUpMax = 20.0f;
tstRslt.TempDownMax = 20.0f;
tstRslt.TempDivMax = 20.0f;
tstRslt.ConductMin = Conductivity.Val;
tstRslt.ConductMax = Conductivity.Val;
tstRslt.PressUpStart = 1.0f;
tstRslt.PressDownStart = 1.0f;
tstRslt.TempUpStart = 20.0f;
tstRslt.TempDownStart = 20.0f;
tstRslt.TempDivStart = 20.0f;
tstRslt.PressUpEnd = 1.0f;
tstRslt.PressDownEnd = 1.0f;
tstRslt.TempUpEnd = 20.0f;
tstRslt.TempDownEnd = 20.0f;
tstRslt.TempDivEnd = 20.0f;
tstRslt.PressUpMean = 1.0f;
tstRslt.PressDownMean = 1.0f;
tstRslt.TempUpMean = 20.0f;
tstRslt.TempDownMean = 20.0f;
tstRslt.TempDivMean = 20.0f;
tstRslt.PressUpMin = 1.0f;
tstRslt.PressDownMin = 1.0f;
tstRslt.TempUpMin = 20.0f;
tstRslt.TempDownMin = 20.0f;
tstRslt.TempDivMin = 20.0f;
tstRslt.PressUpMax = 1.0f;
tstRslt.PressDownMax = 1.0f;
tstRslt.TempUpMax = 20.0f;
tstRslt.TempDownMax = 20.0f;
tstRslt.TempDivMax = 20.0f;
tstRslt.ConductMin = Conductivity.Val;
tstRslt.ConductMax = Conductivity.Val;
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
Results.Entities.MeterTestRslt compoundRslt = ProcessData.BatchRslts.GetMeterTestRslt(fullTestName, i, CompoundMeterId.Compound);
Results.Entities.MeterTestRslt mainRslt = ProcessData.BatchRslts.GetMeterTestRslt(fullTestName, i, CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxRslt = ProcessData.BatchRslts.GetMeterTestRslt(fullTestName, i, CompoundMeterId.CompoundAux);
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
Results.Entities.MeterTestRslt compoundRslt = ProcessData.BatchRslts.GetMeterTestRslt(fullTestName, i, CompoundMeterId.Compound);
Results.Entities.MeterTestRslt mainRslt = ProcessData.BatchRslts.GetMeterTestRslt(fullTestName, i, CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxRslt = ProcessData.BatchRslts.GetMeterTestRslt(fullTestName, i, CompoundMeterId.CompoundAux);
double compoundVolume = tstRslt.TargetVolume() * (1.0 + 0.01 * errorPct);
double mainVolume = compoundVolume * mainPart;
double auxVolume = compoundVolume * (1.0 - mainPart);
double compoundVolume = tstRslt.TargetVolume() * (1.0 + 0.01 * errorPct);
double mainVolume = compoundVolume * mainPart;
double auxVolume = compoundVolume * (1.0 - mainPart);
for (int isAux = 0; isAux <= 1; isAux++) /// 0=main, 1=aux
{
GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[2 * i + isAux];
Results.Entities.MeterTestRslt meterRslt = (isAux == 0) ? mainRslt : auxRslt;
for (int isAux = 0; isAux <= 1; isAux++) /// 0=main, 1=aux
{
GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[2 * i + isAux];
Results.Entities.MeterTestRslt meterRslt = (isAux == 0) ? mainRslt : auxRslt;
if (meterRslt != null && regReader != null)
{
meterRslt.VolumeMeter = (isAux == 0) ? mainVolume : auxVolume;
if (meterRslt != null && regReader != null)
{
meterRslt.VolumeMeter = (isAux == 0) ? mainVolume : auxVolume;
meterRslt.PulsesMeter = regReader.PulsesPerLtr * meterRslt.VolumeMeter;
meterRslt.PulsesMaster = tstRslt.PulsesMaster;
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
meterRslt.VolumeStart = 0;
meterRslt.VolumeEnd = meterRslt.VolumeMeter;
meterRslt.VolumeRef = tstRslt.TargetVolume();
meterRslt.TimestampStart = 0;
meterRslt.TimestampEnd = tstRslt.TargetTime();
meterRslt.TestTime = tstRslt.TargetTime();
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, tstRslt.VolumeCTV);
meterRslt.Passed = (errorPct >= tstRslt.ErrLimLo() + tstRslt.ErrLimMargin())
&& (errorPct <= tstRslt.ErrLimHi() - tstRslt.ErrLimMargin());
meterRslt.TestDone = true;
}
}
meterRslt.PulsesMeter = regReader.PulsesPerLtr * meterRslt.VolumeMeter;
meterRslt.PulsesMaster = tstRslt.PulsesMaster;
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
meterRslt.VolumeStart = 0;
meterRslt.VolumeEnd = meterRslt.VolumeMeter;
meterRslt.VolumeRef = tstRslt.TargetVolume();
meterRslt.TimestampStart = 0;
meterRslt.TimestampEnd = tstRslt.TargetTime();
meterRslt.TestTime = tstRslt.TargetTime();
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, tstRslt.VolumeCTV);
meterRslt.Passed = (errorPct >= tstRslt.ErrLimLo() + tstRslt.ErrLimMargin())
&& (errorPct <= tstRslt.ErrLimHi() - tstRslt.ErrLimMargin());
meterRslt.TestDone = true;
}
}
compoundRslt.VolumeRef = tstRslt.VolumeCTV; /// [l] must be calculated before main & aux. meter error
compoundRslt.VolumeMeter = mainRslt.VolumeMeter + auxRslt.VolumeMeter;
compoundRslt.VolumeRef = tstRslt.VolumeCTV; /// [l] must be calculated before main & aux. meter error
compoundRslt.VolumeMeter = mainRslt.VolumeMeter + auxRslt.VolumeMeter;
compoundRslt.PulsesMaster = tstRslt.PulsesMaster;
compoundRslt.TestTime = tstRslt.TargetTime();
compoundRslt.Error = Formulas.ErrorFromVolumes(compoundRslt.VolumeMeter, tstRslt.VolumeCTV);
compoundRslt.Passed = (compoundRslt.Error >= tstRslt.ErrLimLo() + tstRslt.ErrLimMargin())
&& (compoundRslt.Error <= tstRslt.ErrLimHi() - tstRslt.ErrLimMargin());
compoundRslt.TestDone = true;
tstRslt.TestDone = true;
compoundRslt.PulsesMaster = tstRslt.PulsesMaster;
compoundRslt.TestTime = tstRslt.TargetTime();
compoundRslt.Error = Formulas.ErrorFromVolumes(compoundRslt.VolumeMeter, tstRslt.VolumeCTV);
compoundRslt.Passed = (compoundRslt.Error >= tstRslt.ErrLimLo() + tstRslt.ErrLimMargin())
&& (compoundRslt.Error <= tstRslt.ErrLimHi() - tstRslt.ErrLimMargin());
compoundRslt.TestDone = true;
tstRslt.TestDone = true;
}
tstRslt.Components = Results.Entities.Components.UpdateList(BatchRslts.ComponentsList,
new Results.Entities.Components((BenchInfo != null) ? BenchInfo.TestBenchId : 1,
(BenchInfo != null) ? BenchInfo.TestBenchName : "testbench",
inPath.Pump != null ? inPath.Pump.Name : string.Empty,
outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty,
outPath.Scale != null ? outPath.Scale.Name : string.Empty,
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));
}
tstRslt.Components = Results.Entities.Components
.UpdateList(BatchRslts.ComponentsList,
new Results.Entities.Components((BenchInfo != null) ? BenchInfo.TestBenchId : 1,
(BenchInfo != null) ? BenchInfo.TestBenchName : "testbench",
inPath.Pump != null ? inPath.Pump.Name : string.Empty,
outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty,
outPath.Scale != null ? outPath.Scale.Name : string.Empty,
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));
}
+1
View File
@@ -122,6 +122,7 @@ namespace TBF.BenchControl
Factories.Add(new Modbus.TankSelector.Factory()); /// Modbus.TankSelector
Factories.Add(new Modbus.UltrasoundLevelMeter.Factory());
Factories.Add(new Modbus.WaterAnalyzer.Factory());
Factories.Add(new Modbus.WaterAnalyzer2.Factory());
Factories.Add(new Network.Adapter.Factory());
Factories.Add(new Network.Camera.CLP1611.Factory());
Factories.Add(new Network.Camera.Display.Factory());
@@ -411,20 +411,21 @@ namespace TBF.BenchControl.TestMethods.Adjustment
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.FlowMass = 0; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.Buoyancy = Config.Formulas.Buoyancy();
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = tstRslt.ConstMasterCorr; /// Corrected master pulses per liter
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0.0f; /// Cannot be determined without the collected water mass measurement
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = tstRslt.ConstMasterCorr; /// Corrected master pulses per liter
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0.0f; /// Cannot be determined without the collected water mass measurement
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average);
tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First);
tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last);
tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min);
tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max);
tstRslt.DiverterStart = 0;
tstRslt.DiverterEnd = 0;
@@ -523,7 +524,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; }
}
while (!e.Contains(Event.PreviousStopped));
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -56,9 +56,9 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
return new List<Event> { Event.ConfigurationError };
}
if (test.Part < 1 || test.Part > Config.Data.CompoundWMsCount)
if (test.Part < 0 || test.Part > Config.Data.CompoundWMsCount)
{
UiBridge.Bridge.OnError(this, string.Format("Test 'Part' should be 1 .. {0}", Config.Data.CompoundWMsCount));
UiBridge.Bridge.OnError(this, string.Format("Test 'Part' should be '-' or 1 .. {0}", Config.Data.CompoundWMsCount));
return new List<Event> { Event.ConfigurationError };
}
@@ -333,7 +333,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
}
flowsForDetection[0] = cBrd.ReferenceFreq * outPath.FlowMeter.NominalFlow / 2000.0;
double diff = RegisterReaders[(test.Part - 1) * 2 + 1].WMPulses - lastWMPulses[(test.Part - 1) * 2 + 1];
double diff = RegisterReaders[Math.Max(0, test.Part - 1) * 2 + 1].WMPulses - lastWMPulses[Math.Max(0, test.Part - 1) * 2 + 1];
pulseFreqsForDetection[0] = diff / (double)(StateMachine.Time - lastTime);
lastTime = StateMachine.Time;
}
@@ -682,27 +682,28 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = Config.Formulas.CorrectedValue(tstRslt.MassEndRaw, scale.Corrections);
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart + massOfEvaporatedWater) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * cBrd.EtPulses(0) / tstRslt.TestTime; /// [m3/h]
double flow = 3.6 * LtrPerRefPulse * cBrd.EtPulses(0) / tstRslt.TestTime; /// [m3/h]
tstRslt.Buoyancy = Config.Formulas.Buoyancy();
tstRslt.VolumeCTV = 1000 * tstRslt.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart + massOfEvaporatedWater) / tstRslt.DensityLine; /// [l] commercially true volume
if ((outPath.Diverter != null) && (tstRslt.TestTime > float.Epsilon))
{
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(tstRslt.FlowVolume);
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flow);
tstRslt.VolumeCTV *= tstRslt.TestTime + tstRslt.TestTimeCorrection;
tstRslt.VolumeCTV /= tstRslt.TestTime;
}
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average);
tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First);
tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last);
tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min);
tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max);
tstRslt.DiverterStart = switchTimeStart;
tstRslt.DiverterEnd = switchTimeEnd;
@@ -494,30 +494,20 @@ namespace TBF.BenchControl.TestMethods.FixedStart
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress);
//------------------------------------------------
StartTime = (double)StateMachine.Time;
State.Create(string.Format("{0}({1}) : Starting the test", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(cBrd.StartMeasurementOp(outPath, Elde.TestMethods.Synchro, test.Qfrom, test.Qto, 2 * totalPulses))
.AddOperation(new TBF.BenchControl.Elde.SetValvesOp(cBrd, false, outPath)) /// This line should precede StartMeasureentOp (sending commands)
.AddOperation(cBrd.StartMeasurementOp(outPath, Elde.TestMethods.Synchro,
test.Qfrom, test.Qto, 2 * totalPulses, 10))
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.MeasurementStarted));
StartTime = (double)StateMachine.Time;
State.Create(string.Format("{0}({1}) : Opening the start/stop valve at the beginning of the fixed start test", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(new TBF.BenchControl.Elde.SetValvesOp(cBrd, false, outPath))
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
}
while (!e.Contains(Event.ValvesSet));
while (!e.Contains(Event.MeasurementStarted) || !e.Contains(Event.ValvesSet));
switchTimeStart = 0.001f * cBrd.ValveOpenCloseTime;
log.WarnFormat("Start valve switch time on test start = {0} ms", cBrd.ValveOpenCloseTime);
@@ -814,7 +804,6 @@ namespace TBF.BenchControl.TestMethods.FixedStart
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.FlowMass = 0;
tstRslt.FlowVolume = flowVolume; /// [m3/h]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.Buoyancy = Config.Formulas.Buoyancy();
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
@@ -823,11 +812,12 @@ namespace TBF.BenchControl.TestMethods.FixedStart
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0;
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average);
tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First);
tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last);
tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min);
tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max);
tstRslt.DiverterStart = switchTimeStart;
tstRslt.DiverterEnd = switchTimeEnd;
@@ -1042,7 +1032,7 @@ namespace TBF.BenchControl.TestMethods.FixedStart
do
{
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; }
}
while (!e.Contains(Event.PreviousStopped));
}
@@ -686,7 +686,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; }
}
while (!e.Contains(Event.PreviousStopped));
}
@@ -800,7 +800,6 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.FlowMass = 0;
tstRslt.FlowVolume = flowVolume; /// [m3/h]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.Buoyancy = Config.Formulas.Buoyancy();
tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3]
@@ -810,11 +809,12 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval
/// Calculated master pulses per liter
tstRslt.ErrorMaster = 0;
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average);
tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First);
tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last);
tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min);
tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max);
tstRslt.DiverterStart = switchTimeStart;
tstRslt.DiverterEnd = switchTimeEnd;
@@ -855,7 +855,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } /// TODO: this is an endless loop !!!
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; } /// TODO: this is an endless loop !!!
}
while (!e.Contains(Event.PreviousStopped));
}
@@ -945,21 +945,22 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollDeferredEval
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = massEnd;
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart + massOfEvaporatedWater) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.Buoyancy = buoyancy;
tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average);
tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First);
tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last);
tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min);
tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max);
tstRslt.DiverterStart = switchTimeStart;
tstRslt.DiverterEnd = switchTimeEnd;
@@ -1000,7 +1001,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollDeferredEval
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } /// TODO: this is an endless loop !!!
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; } /// TODO: this is an endless loop !!!
}
while (!e.Contains(Event.PreviousStopped));
}
@@ -614,31 +614,20 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress);
//------------------------------------------------
StartTime = (double)StateMachine.Time;
State.Create(string.Format("{0}({1}) : Starting the test", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(cBrd.StartMeasurementOp(outPath, (Elde.TestMethods.Diverter | Elde.TestMethods.FixedStart),
test.Qfrom, test.Qto, 2 * totalPulses))
.AddOperation(new TBF.BenchControl.Elde.SetValvesOp(cBrd, false, outPath)) /// This line should precede StartMeasureentOp (sending commands)
.AddOperation(cBrd.StartMeasurementOp(outPath, (Elde.TestMethods.Diverter | Elde.TestMethods.FixedStart),
test.Qfrom, test.Qto, 2 * totalPulses, 10))
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.MeasurementStarted));
StartTime = (double)StateMachine.Time;
State.Create(string.Format("{0}({1}) : Opening the start/stop valve at the beginning of the fixed start test", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(new TBF.BenchControl.Elde.SetValvesOp(cBrd, false, outPath))
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
}
while (!e.Contains(Event.ValvesSet));
while (!e.Contains(Event.MeasurementStarted) || !e.Contains(Event.ValvesSet));
switchTimeStart = 0.001f * cBrd.ValveOpenCloseTime;
log.WarnFormat("Start valve switch time on test start = {0} ms", cBrd.ValveOpenCloseTime);
@@ -992,21 +981,22 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = massEnd;
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart + massOfEvaporatedWater) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.Buoyancy = buoyancy;
tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average);
tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First);
tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last);
tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min);
tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max);
tstRslt.DiverterStart = switchTimeStart;
tstRslt.DiverterEnd = switchTimeEnd;
@@ -1220,7 +1210,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; }
}
while (!e.Contains(Event.PreviousStopped));
}
@@ -723,21 +723,22 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.FlowMass = 0; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.Buoyancy = 0;
tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average);
tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First);
tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last);
tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min);
tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max);
tstRslt.DiverterStart = switchTimeStart;
tstRslt.DiverterEnd = switchTimeEnd;
@@ -882,7 +883,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection
do
{
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; }
}
while (!e.Contains(Event.PreviousStopped));
}
@@ -477,20 +477,21 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.FlowMass = 0; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.Buoyancy = Config.Formulas.Buoyancy();
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = tstRslt.ConstMasterCorr;
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0.0; /// Cannot be determined without a mass measurement
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0.0; /// Cannot be determined without a mass measurement
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average);
tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First);
tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last);
tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min);
tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max);
tstRslt.DiverterStart = 0;
tstRslt.DiverterEnd = 0;
@@ -724,8 +725,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (e.Contains(Event.Error)) { retVal = Event.Error; break; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; }
}
while (!e.Contains(Event.FlowRegulationStopped));
@@ -749,7 +749,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
double massOfEvaporatedWater = tstRslt.TimeBtwnMassMsrmnts * outPath.Scale.EvaporationRate(tstRslt.TempDivMean);
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
///
tstRslt.Buoyancy = Config.Formulas.Buoyancy();
if (repetitionNr == 1)
@@ -762,13 +762,13 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
tstRslt.VolumeCTV = 1000 * tstRslt.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart + massOfEvaporatedWater) / tstRslt.DensityLine; /// [l] commercially true volume
if ((outPath.Diverter != null) && (tstRslt.TestTime > float.Epsilon))
{
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(tstRslt.FlowVolume);
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flow);
tstRslt.VolumeCTV *= tstRslt.TestTime + tstRslt.TestTimeCorrection;
tstRslt.VolumeCTV /= tstRslt.TestTime;
}
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
@@ -798,7 +798,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
tstRslt.MassEnd = 0;
tstRslt.FlowMass = 0;
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = tstResRepet1.ConstMaster; /// Master constant ( pulses per liter) from the first repetition (=against the scale)
tstRslt.VolumeMaster = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.VolumeCTV = tstRslt.VolumeMaster; /// [l] 1000.0f is because density is in [kg/m3]
@@ -818,11 +818,12 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
tstRslt.InfoFlags = infoFlags;
} /// [kg/h]
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average);
tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First);
tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last);
tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min);
tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max);
if (compoundTestParams != null)
@@ -871,27 +871,28 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = EndMass.Val + (refMass - (measuredRefMass.Val - StartMass.Val));
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart + massOfEvaporatedWater) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.Buoyancy = Config.Formulas.Buoyancy();
tstRslt.VolumeCTV = 1000 * tstRslt.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart + massOfEvaporatedWater) / tstRslt.DensityLine; /// [l] commercially true volume
if ((outPath.Diverter != null) && (tstRslt.TestTime > float.Epsilon))
{
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(tstRslt.FlowVolume);
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flow);
tstRslt.VolumeCTV *= tstRslt.TestTime + tstRslt.TestTimeCorrection;
tstRslt.VolumeCTV /= tstRslt.TestTime;
}
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
tstRslt.DiverterStart = outPath.Diverter.SwitchTimeStart.Val;
tstRslt.DivStart10 = 0;
@@ -818,26 +818,27 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, scale.Corrections);
tstRslt.FlowMass = 3600 * (tstRslt.MassEnd - tstRslt.MassStart + massOfEvaporatedWater) * totalPulses / (tstRslt.TestTime * massPulses); /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * totalPulses / tstRslt.TestTime; /// [m3/h]
double flow = 3.6 * LtrPerRefPulse * totalPulses / tstRslt.TestTime; /// [m3/h]
tstRslt.Buoyancy = Formulas.Buoyancy();
tstRslt.VolumeCTV = 1000 * tstRslt.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart + massOfEvaporatedWater) / tstRslt.DensityLine; /// [l] commercially true volume of collected water
if ((outPath.Diverter != null) && (tstRslt.TestTime > float.Epsilon))
{
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(tstRslt.FlowVolume);
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flow);
tstRslt.VolumeCTV *= tstRslt.TestTime + tstRslt.TestTimeCorrection;
tstRslt.VolumeCTV /= tstRslt.TestTime;
}
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (massPulses == 0) ? tstRslt.ConstMasterCorr : (tstRslt.VolumeCTV / massPulses);
tstRslt.VolumeMaster = LtrPerRefPulse * massPulses; /// [l] volume from the master flow meter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
tstRslt.FlowVolume = 3.6 * totalPulses * tstRslt.VolumeCTV / (massPulses * tstRslt.TestTime);
tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average);
tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First);
tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last);
tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min);
tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max);
tstRslt.DiverterStart = outPath.Diverter.SwitchTimeStart.Val;
tstRslt.DivStart10 = 0;
@@ -744,27 +744,28 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = Config.Formulas.CorrectedValue(tstRslt.MassEndRaw, scale.Corrections);
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart + massOfEvaporatedWater) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.Buoyancy = Config.Formulas.Buoyancy();
tstRslt.VolumeCTV = 1000 * tstRslt.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart + massOfEvaporatedWater) / tstRslt.DensityLine; /// [l] commercially true volume
if ((outPath.Diverter != null) && (tstRslt.TestTime > float.Epsilon))
{
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(tstRslt.FlowVolume);
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flow);
tstRslt.VolumeCTV *= tstRslt.TestTime + tstRslt.TestTimeCorrection;
tstRslt.VolumeCTV /= tstRslt.TestTime;
}
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average);
tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First);
tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last);
tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min);
tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max);
tstRslt.DiverterStart = outPath.Diverter.SwitchTimeStart.Val;
tstRslt.DivStart10 = 0;
@@ -501,27 +501,28 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.FlowMass = 0;
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.Buoyancy = 0;
tstRslt.VolumeCTV = volumeBox.Val; /// [l]
if ((outPath.Diverter != null) && (tstRslt.TestTime > float.Epsilon))
{
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(tstRslt.FlowVolume);
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flow);
tstRslt.VolumeCTV *= tstRslt.TestTime + tstRslt.TestTimeCorrection;
tstRslt.VolumeCTV /= tstRslt.TestTime;
}
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average);
tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First);
tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last);
tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min);
tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max);
tstRslt.DiverterStart = outPath.Diverter.SwitchTimeStart.Val;
tstRslt.DivStart10 = 0;
@@ -474,7 +474,7 @@ namespace TBF.BenchControl.TestMethods.LeakTest
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; }
}
while (!e.Contains(Event.PreviousStopped));
}
@@ -302,7 +302,7 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; }
}
while (!e.Contains(Event.PreviousStopped));
}
@@ -517,7 +517,7 @@ namespace TBF.BenchControl.TestMethods.PulsesTest
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; }
}
while (!e.Contains(Event.PreviousStopped));
}
@@ -508,7 +508,7 @@ namespace TBF.BenchControl.TestMethods.PulsesTestManual
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; }
}
while (!e.Contains(Event.PreviousStopped));
}
@@ -926,9 +926,9 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
switch (units)
{
default:
case VolumeUnits.m3: return Config.Units.ConvertFrom(Config.Unit.m3, 1.0); /// liter
case VolumeUnits.UK_gallon: return Config.Units.ConvertFrom(Config.Unit.gal_UK, 1.0); /// liter
case VolumeUnits.US_gallon: return Config.Units.ConvertFrom(Config.Unit.gal_US, 1.0); /// liter
case VolumeUnits.m3: return Config.Units.ConvertFrom(Config.Unit.m3, 1.0); /// 1 liter
case VolumeUnits.UK_gallon: return Config.Units.ConvertFrom(Config.Unit.UKgal, 1.0); /// 1 imperial gallon
case VolumeUnits.US_gallon: return Config.Units.ConvertFrom(Config.Unit.USgal, 1.0); /// 1 US gallon
}
}
@@ -37,8 +37,7 @@ namespace TBF.BenchControl.Various.ErrorFlags
/// Any E# is 'true' on error, 'false' when OK
/// Average flow
double aveFlow = 3.6 * testRslt.VolumeCTV / testRslt.TestTime;
bool E1 = (aveFlow < testRslt.Qfrom()) || (aveFlow > testRslt.Qto());
bool E1 = (testRslt.FlowVolume < testRslt.Qfrom()) || (testRslt.FlowVolume > testRslt.Qto());
/// Max. and min. up and down water temperature
bool E2 = ProcessData.TempUpStat.Min < testRslt.TempLimLo()
@@ -94,8 +93,9 @@ namespace TBF.BenchControl.Various.ErrorFlags
|| ProcessData.PressDownStat.Max > errorsCfg.TestParams.Pressure_max;
/// Max. and min. flow
bool E21 = ProcessData.RefFlowStat.Min < testRslt.Qfrom()
|| ProcessData.RefFlowStat.Max > testRslt.Qto();
double rectifiedFlowMin = (testRslt.FlowMean == 0) ? testRslt.FlowMin : testRslt.FlowMin * testRslt.FlowVolume / testRslt.FlowMean;
double rectifiedFlowMax = (testRslt.FlowMean == 0) ? testRslt.FlowMax : testRslt.FlowMax * testRslt.FlowVolume / testRslt.FlowMean;
bool E21 = rectifiedFlowMin < testRslt.Qfrom() || rectifiedFlowMax > testRslt.Qto();
/// Electrical conductivity of water
bool E36 = ProcessData.ConductStat.Min < errorsCfg.TestParams.Conductivity_min
+2 -2
View File
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.26.1463.0")]
[assembly: AssemblyFileVersion("2.26.1463.0")]
[assembly: AssemblyVersion("2.26.1517.0")]
[assembly: AssemblyFileVersion("2.26.1517.0")]
+4 -4
View File
@@ -19,7 +19,7 @@ namespace TBF.Resources {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Strings {
@@ -2887,7 +2887,7 @@ namespace TBF.Resources {
}
/// <summary>
/// Looks up a localized string similar to MIn. height.
/// Looks up a localized string similar to Min. height.
/// </summary>
internal static string Min_height {
get {
@@ -3040,7 +3040,7 @@ namespace TBF.Resources {
}
/// <summary>
/// Looks up a localized string similar to PHeat.
/// Looks up a localized string similar to P Heat.
/// </summary>
internal static string New_heat_meters_path_name {
get {
@@ -5977,7 +5977,7 @@ namespace TBF.Resources {
}
/// <summary>
/// Looks up a localized string similar to End - transiiton.
/// Looks up a localized string similar to End - transition.
/// </summary>
internal static string TransitionEnd_chdr {
get {
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -752,7 +752,7 @@
<value>Emergency STOP</value>
</data>
<data name="TransitionEnd_chdr" xml:space="preserve">
<value>End - transiiton</value>
<value>End - transition</value>
</data>
<data name="TransitionStart_chdr" xml:space="preserve">
<value>Start - transition</value>
@@ -1379,7 +1379,7 @@
<value>T warm</value>
</data>
<data name="New_heat_meters_path_name" xml:space="preserve">
<value>PHeat</value>
<value>P Heat</value>
</data>
<data name="Created_by" xml:space="preserve">
<value>Created by</value>
@@ -1850,7 +1850,7 @@
<value>Pulses count is OK</value>
</data>
<data name="Min_height" xml:space="preserve">
<value>MIn. height</value>
<value>Min. height</value>
</data>
<data name="Min_width" xml:space="preserve">
<value>Min. width</value>
+32 -7
View File
@@ -39,7 +39,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH;CAMERA</DefineConstants>
<DefineConstants>TRACE;DEBUG;TURA_IPERL_NEW;IPERL;ORACLE_DB;LANG_SK;STABLE_MASS_EXTRAS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -50,7 +50,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;MUNICH;CAMERA</DefineConstants>
<DefineConstants>TRACE;TURA_IPERL_NEW;IPERL;ORACLE_DB;LANG_SK;STABLE_MASS_EXTRAS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
@@ -60,7 +60,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH;CAMERA</DefineConstants>
<DefineConstants>TRACE;DEBUG;TURA_IPERL_NEW;IPERL;ORACLE_DB;LANG_SK;STABLE_MASS_EXTRAS</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
@@ -70,7 +70,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;MUNICH;CAMERA</DefineConstants>
<DefineConstants>TRACE;TURA_IPERL_NEW;IPERL;ORACLE_DB;LANG_SK;STABLE_MASS_EXTRAS</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
@@ -101,8 +101,9 @@
<SignManifests>false</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="ControlComponent3Munich">
<HintPath>..\packages\ControlBoard\Munich\ControlComponent3Munich.dll</HintPath>
<Reference Include="ControlComponent3U, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\ControlBoard\iPerlST-new\ControlComponent3U.dll</HintPath>
</Reference>
<Reference Include="FluentNHibernate">
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
@@ -680,6 +681,7 @@
<Compile Include="BenchControl\MettlerToledo\Multi\ReadMassOp.cs" />
<Compile Include="BenchControl\MettlerToledo\Multi\ReadStableMassOp.cs" />
<Compile Include="BenchControl\MettlerToledo\Multi\TaringOp.cs" />
<Compile Include="BenchControl\MettlerToledo\Multi\ZeroOp.cs" />
<Compile Include="BenchControl\MettlerToledo\ReadMassesOp.cs" />
<Compile Include="BenchControl\MettlerToledo\Standard\BalanceCfg.cs" />
<Compile Include="BenchControl\MettlerToledo\Standard\BalanceCfgCtrl.cs">
@@ -699,6 +701,7 @@
<Compile Include="BenchControl\MettlerToledo\Standard\ReadStableMassOp.cs" />
<Compile Include="BenchControl\MettlerToledo\Standard\SetUnitsOp.cs" />
<Compile Include="BenchControl\MettlerToledo\Standard\TaringOp.cs" />
<Compile Include="BenchControl\MettlerToledo\Standard\ZeroOp.cs" />
<Compile Include="BenchControl\MettlerToledo\TankDraining.cs" />
<Compile Include="BenchControl\MettlerToledo\WaitTankEmptyOp.cs" />
<Compile Include="BenchControl\MettlerToledo\WaitTankContainsMoreThenOp.cs" />
@@ -780,6 +783,11 @@
<Compile Include="BenchControl\Modbus\UltrasoundLevelMeter\ReadLevelOp.cs" />
<Compile Include="BenchControl\Modbus\UltrasoundLevelMeter\ReadStableLevelOp.cs" />
<Compile Include="BenchControl\Modbus\UltrasoundLevelMeter\ReadTempOp.cs" />
<Compile Include="BenchControl\Modbus\WaterAnalyzer2\Analyzer.cs" />
<Compile Include="BenchControl\Modbus\WaterAnalyzer2\AnalyzerCfg.cs" />
<Compile Include="BenchControl\Modbus\WaterAnalyzer2\Factory.cs" />
<Compile Include="BenchControl\Modbus\WaterAnalyzer2\ReadConductivityOp.cs" />
<Compile Include="BenchControl\Modbus\WaterAnalyzer2\ReadTempOp.cs" />
<Compile Include="BenchControl\Modbus\WaterAnalyzer\Factory.cs" />
<Compile Include="BenchControl\Modbus\WaterAnalyzer\Analyzer.cs" />
<Compile Include="BenchControl\Modbus\WaterAnalyzer\AnalyzerCfg.cs" />
@@ -877,7 +885,6 @@
</Compile>
<Compile Include="BenchControl\Operations\LargeMessageBoxOp.cs" />
<Compile Include="BenchControl\Operations\ReturnGivenEventOp.cs" />
<Compile Include="BenchControl\Output\DB\ProductionTracing\Enums.cs" />
<Compile Include="BenchControl\Output\DB\ProductionTracing\Tracing.cs" />
<Compile Include="BenchControl\Output\DB\ProductionTracing\MonitoringCfg.cs" />
<Compile Include="BenchControl\Output\DB\ProductionTracing\TracingCfgCtrl.cs">
@@ -3507,6 +3514,24 @@
<None Include="Resources\RoiStyle1.bmp" />
<None Include="Resources\RoiStyle2.bmp" />
<None Include="Resources\RoiStyle3.bmp" />
<Content Include="libgcc_s_dw2-1.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="libRfid1.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="libRfid2.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="libRfid3.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="libRfid4.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="libstdc++-6.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Pictures\forward_dir_left.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
+2 -2
View File
@@ -40,7 +40,7 @@ namespace TBF.UI.Bench.Paths
#if HEAT_METERS
private System.Windows.Forms.TabPage heatMetersTabPage;
private UiControls.PathsHeatMetersCtrl pathsHeatMetersCtrl;
private PathsHeatMetersCtrl pathsHeatMetersCtrl;
#endif
public PathsDlg()
@@ -98,7 +98,7 @@ namespace TBF.UI.Bench.Paths
#if HEAT_METERS
this.heatMetersTabPage = new System.Windows.Forms.TabPage();
this.pathsHeatMetersCtrl = new TBF.UiControls.PathsHeatMetersCtrl();
this.pathsHeatMetersCtrl = new PathsHeatMetersCtrl();
this.heatMetersTabPage.SuspendLayout();
this.SuspendLayout();
+14 -13
View File
@@ -10,6 +10,7 @@ using Results.Forms;
using TBF.BenchControl;
using TBF.BenchControl.GenericDevices;
using TBF.Resources;
using TBF.UI;
using TBF.UI.Shared;
namespace TBF.UI.Bench.Paths
@@ -74,19 +75,19 @@ namespace TBF.UI.Bench.Paths
/// ListViewEx columns
TBF.LocalSettings ls = Program.LocalSettings;
Columns.Add(Strings.Name, (ls.HeatMetersColumnCount > 0) ? ls.HeatMetersColumnWidths[0] : 60 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(Strings.T_warm_from, (ls.HeatMetersColumnCount > 1) ? ls.HeatMetersColumnWidths[1] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(Strings.T_warm_to, (ls.HeatMetersColumnCount > 2) ? ls.HeatMetersColumnWidths[2] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(Strings.T_cold_from, (ls.HeatMetersColumnCount > 3) ? ls.HeatMetersColumnWidths[3] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(Strings.T_cold_to, (ls.HeatMetersColumnCount > 4) ? ls.HeatMetersColumnWidths[4] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_ref_warm, 1), (ls.HeatMetersColumnCount > 5) ? ls.HeatMetersColumnWidths[5] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_ref_warm, 2), (ls.HeatMetersColumnCount > 6) ? ls.HeatMetersColumnWidths[6] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_ref_cold, 1), (ls.HeatMetersColumnCount > 7) ? ls.HeatMetersColumnWidths[7] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_ref_cold, 2), (ls.HeatMetersColumnCount > 8) ? ls.HeatMetersColumnWidths[8] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_work_warm, 1), (ls.HeatMetersColumnCount > 9) ? ls.HeatMetersColumnWidths[9] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_work_warm, 2), (ls.HeatMetersColumnCount > 10) ? ls.HeatMetersColumnWidths[10] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_work_cold, 1), (ls.HeatMetersColumnCount > 11) ? ls.HeatMetersColumnWidths[11] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_work_cold, 2), (ls.HeatMetersColumnCount > 12) ? ls.HeatMetersColumnWidths[12] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(Strings.Name, (ls.HeatMetersColumnCount > 0) ? ls.HeatMetersColumnWidths[0] : 60 * parent.Dpi / Constants.Dpi100pct);
Columns.Add(Strings.T_warm_from, (ls.HeatMetersColumnCount > 1) ? ls.HeatMetersColumnWidths[1] : 50 * parent.Dpi / Constants.Dpi100pct);
Columns.Add(Strings.T_warm_to, (ls.HeatMetersColumnCount > 2) ? ls.HeatMetersColumnWidths[2] : 50 * parent.Dpi / Constants.Dpi100pct);
Columns.Add(Strings.T_cold_from, (ls.HeatMetersColumnCount > 3) ? ls.HeatMetersColumnWidths[3] : 50 * parent.Dpi / Constants.Dpi100pct);
Columns.Add(Strings.T_cold_to, (ls.HeatMetersColumnCount > 4) ? ls.HeatMetersColumnWidths[4] : 50 * parent.Dpi / Constants.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_ref_warm, 1), (ls.HeatMetersColumnCount > 5) ? ls.HeatMetersColumnWidths[5] : 50 * parent.Dpi / Constants.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_ref_warm, 2), (ls.HeatMetersColumnCount > 6) ? ls.HeatMetersColumnWidths[6] : 50 * parent.Dpi / Constants.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_ref_cold, 1), (ls.HeatMetersColumnCount > 7) ? ls.HeatMetersColumnWidths[7] : 50 * parent.Dpi / Constants.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_ref_cold, 2), (ls.HeatMetersColumnCount > 8) ? ls.HeatMetersColumnWidths[8] : 50 * parent.Dpi / Constants.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_work_warm, 1), (ls.HeatMetersColumnCount > 9) ? ls.HeatMetersColumnWidths[9] : 50 * parent.Dpi / Constants.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_work_warm, 2), (ls.HeatMetersColumnCount > 10) ? ls.HeatMetersColumnWidths[10] : 50 * parent.Dpi / Constants.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_work_cold, 1), (ls.HeatMetersColumnCount > 11) ? ls.HeatMetersColumnWidths[11] : 50 * parent.Dpi / Constants.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_work_cold, 2), (ls.HeatMetersColumnCount > 12) ? ls.HeatMetersColumnWidths[12] : 50 * parent.Dpi / Constants.Dpi100pct);
/// Temperatures, pressures
ComboBox tWarmCBox = new ComboBox();
+2 -2
View File
@@ -54,9 +54,9 @@ namespace TBF.UI
this.horizontalSplitContainer = new System.Windows.Forms.SplitContainer();
this.mainTabControl = new System.Windows.Forms.TabControl();
this.homeTabPage = new System.Windows.Forms.TabPage();
this.ctrlBrdComponent = new ControlComponent3Munich.UserControl1();
this.ctrlBrdComponent = new ControlComponent_Torino2015.UserControl1();
this.processTabPage = new System.Windows.Forms.TabPage();
this.processTabPageCtrl = new TBF.UI.Process.ProcessTabPageCtrl6();
this.processTabPageCtrl = new TBF.UI.Process.ProcessTabPageCtrl48();
this.insertTabPage = new System.Windows.Forms.TabPage();
this.resultsTabPage = new System.Windows.Forms.TabPage();
this.resultsTabPageCtrl = new TBF.UI.ResultsMI.ResultsTabPageCtrl();
+1 -1
View File
@@ -348,7 +348,7 @@ namespace TBF.UI
/// </summary>
private void MainWnd_KeyPress(object sender, KeyPressEventArgs e)
{
#if BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || BADGER_VELKA_TRAT || GENESIS || CEVAK_200 || TURA_SPECIAL
#if BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || BADGER_VELKA_TRAT || GENESIS || CEVAK_200 || TURA_SPECIAL || GELSENWASSER
/// Do nothing = do not process keys
#else
if (BenchControlPanel != null && BenchControlPanel.ProcessKey(e.KeyChar))
+74 -2
View File
@@ -183,7 +183,7 @@
<value>132, 17</value>
</data>
<data name="activityStatusLabel.Text" xml:space="preserve">
<value>Please start a procedure</value>
<value>Prüfprozess bitte starten</value>
</data>
<data name="statusStrip1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 690</value>
@@ -231,7 +231,7 @@
<value>122, 20</value>
</data>
<data name="homeTSMenuItem.Text" xml:space="preserve">
<value>Schema-Diagramm</value>
<value>Home</value>
</data>
<data name="resultsTSMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 20</value>
@@ -311,4 +311,76 @@
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>1254, 712</value>
</data>
<data name="activityGroupBox.Text" xml:space="preserve">
<value>Aktivität</value>
</data>
<data name="procedureGroupBox.Text" xml:space="preserve">
<value>Prüfvorlage</value>
</data>
<data name="progressGroupBox.Text" xml:space="preserve">
<value>Fortschritt</value>
</data>
<data name="homeTabPage.Text" xml:space="preserve">
<value>Hydraulisch</value>
</data>
<data name="processTabPage.Text" xml:space="preserve">
<value>Prozess</value>
</data>
<data name="insertTabPage.Text" xml:space="preserve">
<value>Einfügen</value>
</data>
<data name="resultsTabPage.Text" xml:space="preserve">
<value>Ergebnisse</value>
</data>
<data name="graphsTabPage.Text" xml:space="preserve">
<value>Grafik</value>
</data>
<data name="logsTabPage.Text" xml:space="preserve">
<value>Protokolle</value>
</data>
<data name="picturesTabPage.Text" xml:space="preserve">
<value>Bilder</value>
</data>
<data name="statusStrip1.Text" xml:space="preserve">
<value>Status</value>
</data>
<data name="benchUncertaintyTSMItem.Text" xml:space="preserve">
<value>Messunsicherheit</value>
</data>
<data name="benchTestProfilesTSMItem.Text" xml:space="preserve">
<value>Test Profile</value>
</data>
<data name="languageTSMItem.Text" xml:space="preserve">
<value>Sprache</value>
</data>
<data name="backUpConfigTSMItem.Text" xml:space="preserve">
<value>Konfiguration</value>
</data>
<data name="backUpResultsTSMItem.Text" xml:space="preserve">
<value>Ergebnisse</value>
</data>
<data name="backUpTSMItem.Text" xml:space="preserve">
<value>Back up</value>
</data>
<data name="passwdTSMItem.Text" xml:space="preserve">
<value>Passwort</value>
</data>
<data name="upgradeTSMenuItem.Text" xml:space="preserve">
<value>Upgrade</value>
</data>
<data name="iPerlHeadsToolStripMenuItem.Text" xml:space="preserve">
<value>iPERL Abtastköpfe</value>
</data>
<data name="clearCountersToolStripMenuItem.Text" xml:space="preserve">
<value>Zähler zurücksetzen</value>
</data>
<data name="graphsToolStripMenuItem.Text" xml:space="preserve">
<value>Grafik</value>
</data>
<data name="mainMenuStrip.Text" xml:space="preserve">
<value>Hauptmenü</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Test Bench Framework</value>
</data>
</root>
+9
View File
@@ -1644,4 +1644,13 @@
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="logsTabPage.Text" xml:space="preserve">
<value>Logs</value>
</data>
<data name="logsTSMenuItem.Text" xml:space="preserve">
<value>Logs</value>
</data>
<data name="editTSMenuItem.Text" xml:space="preserve">
<value>Settings</value>
</data>
</root>
+1 -1
View File
@@ -1456,7 +1456,7 @@ namespace TBF.UI.Procedures
#if HEAT_METERS
if ((processEditors[(int)ProcessClmn.HeatMeterSensors] as ComboBox).Items.Contains(lvi.SubItems[(int)ProcessClmn.HeatMeterSensors].Text))
{
entity.HeatMetersPath = lvi.SubItems[(int)ProcessClmn.HeatMeterSensors].Text;
test.HeatMetersPath = lvi.SubItems[(int)ProcessClmn.HeatMeterSensors].Text;
}
#endif
}
+2
View File
@@ -119,6 +119,8 @@ namespace TBF.UI.ResultsMI
void OnProcedureSelected(object sender, ProcedureSelectedEventArgs args)
{
BatchResults batchResults = TBF.BenchControl.Sequences.ProcessData.BatchRslts;
metersKind = batchResults.Batch.Compound ? MetersKind.Combined : (batchResults.Batch.HeatMeter ? MetersKind.HeatMeter : MetersKind.Single);
UpdateItems(GetRsltItems(metersKind));
if ((batchResults != null) && (Program.LocalSettings != null))
{
@@ -87,6 +87,7 @@ namespace TBF.UI.Shared
userNameTextBox.Text = "milan";
passwordTextBox.Text = "kremik";
#endif
Array.Sort(Program.LocalSettings.TestBenches);
for (int i = 0; i < Program.LocalSettings.BenchesCount; i++)
{
testBenchComboBox.Items.Add(Program.LocalSettings.TestBenches[i].BenchName);
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
+9 -6
View File
@@ -1,19 +1,22 @@
Vyroba:
Výroba:
- nedovoliť obicyklovať leak test, potvrdiť event v kalendári až keď prejde
- zastaviť cyklus ak neprejde leak test alebo je E-čko ktoré spôsobí že všetky
vodomery budú NOK. Jasná správa o príčine na obrazovke
- Odlogovat zo zvysenej urovne po 10 min.
Igor
- kalibracia meraca hladiny
- stabilne meranie hladiny
- kalibracia merača hladiny
- stabilné meranie hladiny
- niekedy neprepne diverter
- sekvencia medzi opakovanymi skuskami
- podmienka pre minimalny objem vody vo vezi
- sekvencia medzi opakovanými skúškami
- podmienka pre minimálny objem vody vo veži
- testovanie citlivosti vodomera
- zivotnostne: menit prietok 15 min.
- diverter test (prietok 1x, vahy bud vzdy alebo 1x)
iPerl:
- neukladat process data pre UnknownPcbNr... vodomery
- neukladať process data pre UnknownPcbNr... vodomery
- log pre pevny start, podobne (zarazky) ako pre letmy
- 'Q2 corrected from ...' Evaluate a Publish parametre

Some files were not shown because too many files have changed in this diff Show More