diff --git a/Common/Units.cs b/Common/Units.cs index 2513a4d64..5a9c903ed 100644 --- a/Common/Units.cs +++ b/Common/Units.cs @@ -2,6 +2,7 @@ /// Copyright (c) 2016-2021 Sensus Slovensko a.s. /// using System; +using System.Linq; namespace Common { @@ -286,97 +287,97 @@ namespace Common public static bool IsQuantity(Unit unit, Quantity quantity) { - return (quantity == GetQuantity(unit)); + return GetQuantity(unit).Contains(quantity); } - public static Quantity GetQuantity(Unit unit) + public static Quantity[] GetQuantity(Unit unit) { switch (unit) { case Unit.pulse: case Unit.degree: - return Quantity.Pulses; + return new[] { Quantity.Pulses }; case Unit.ml: - return Quantity.Volume; + return new[] { Quantity.Volume, Quantity.MultiFunctionalVariables }; case Unit.l: - return Quantity.Volume; + return new[] { Quantity.Volume, Quantity.MultiFunctionalVariables }; case Unit.dm3: - return Quantity.Volume; + return new[] { Quantity.Volume, Quantity.MultiFunctionalVariables }; case Unit.USgal: - return Quantity.Volume; + return new[] { Quantity.Volume, Quantity.MultiFunctionalVariables }; case Unit.UKgal: - return Quantity.Volume; + return new[] { Quantity.Volume, Quantity.MultiFunctionalVariables }; case Unit.cf: - return Quantity.Volume; + return new[] { Quantity.Volume, Quantity.MultiFunctionalVariables }; case Unit.m3: - return Quantity.Volume; + return new[] { Quantity.Volume, Quantity.MultiFunctionalVariables }; case Unit.lph: - return Quantity.Flow; + return new[] { Quantity.Flow }; case Unit.cfph: - return Quantity.Flow; + return new[] { Quantity.Flow }; case Unit.lpm: - return Quantity.Flow; + return new[] { Quantity.Flow }; case Unit.USgalpm: - return Quantity.Flow; + return new[] { Quantity.Flow }; case Unit.m3ph: - return Quantity.Flow; + return new[] { Quantity.Flow }; case Unit.lps: - return Quantity.Flow; + return new[] { Quantity.Flow }; case Unit.USgalps: - return Quantity.Flow; + return new[] { Quantity.Flow }; case Unit.m3pm: - return Quantity.Flow; + return new[] { Quantity.Flow }; case Unit.cfs: - return Quantity.Flow; + return new[] { Quantity.Flow }; case Unit.gps: - return Quantity.MassFlow; + return new[] { Quantity.MassFlow}; case Unit.gpm: - return Quantity.MassFlow; + return new[] { Quantity.MassFlow}; case Unit.gph: - return Quantity.MassFlow; + return new[] { Quantity.MassFlow}; case Unit.kgps: - return Quantity.MassFlow; + return new[] { Quantity.MassFlow}; case Unit.kgpm: - return Quantity.MassFlow; + return new[] { Quantity.MassFlow}; case Unit.kgph: - return Quantity.MassFlow; + return new[] { Quantity.MassFlow}; case Unit.tps: - return Quantity.MassFlow; + return new[] { Quantity.MassFlow}; case Unit.tpm: - return Quantity.MassFlow; + return new[] { Quantity.MassFlow}; case Unit.tph: - return Quantity.MassFlow; + return new[] { Quantity.MassFlow}; case Unit.lbps: - return Quantity.MassFlow; + return new[] { Quantity.MassFlow}; case Unit.lbpm: - return Quantity.MassFlow; + return new[] { Quantity.MassFlow}; case Unit.lbph: - return Quantity.MassFlow; + return new[] { Quantity.MassFlow}; case Unit.g: - return Quantity.Mass; + return new[] { Quantity.Mass, Quantity.MultiFunctionalVariables }; case Unit.oz: - return Quantity.Mass; + return new[] { Quantity.Mass, Quantity.MultiFunctionalVariables }; case Unit.lb: - return Quantity.Mass; + return new[] { Quantity.Mass, Quantity.MultiFunctionalVariables }; case Unit.kg: - return Quantity.Mass; + return new[] { Quantity.Mass, Quantity.MultiFunctionalVariables }; case Unit.t: - return Quantity.Mass; + return new[] { Quantity.Mass, Quantity.MultiFunctionalVariables }; case Unit.ms: case Unit.s: case Unit.min: case Unit.hour: - return Quantity.Time; + return new[] { Quantity.Time }; case Unit.C: case Unit.F: case Unit.K: - return Quantity.Temperature; + return new[] { Quantity.Temperature }; case Unit.Pa: case Unit.hPa: @@ -386,14 +387,14 @@ namespace Common case Unit.psi: case Unit.bar: case Unit.MPa: - return Quantity.Pressure; + return new[] { Quantity.Pressure }; case Unit.RPct: - return Quantity.Humidity; + return new[] { Quantity.Humidity }; case Unit.Promile: case Unit.Pct: - return Quantity.Error; + return new[] { Quantity.Error }; case Unit.mm: case Unit.cm: @@ -402,23 +403,23 @@ namespace Common case Unit.foot: case Unit.yard: case Unit.m: - return Quantity.Length; + return new[] { Quantity.Length }; - case Unit.kgpm3: + case Unit.kgpm3: case Unit.kgpl: - return Quantity.Density; + return new[] { Quantity.Density }; - case Unit.J: + case Unit.J: case Unit.kJ: case Unit.MJ: case Unit.Wh: case Unit.kWh: case Unit.MWh: - return Quantity.Energy; + return new[] { Quantity.Energy }; case Unit.uSpcm: case Unit.mSpm: - return Quantity.Conductivity; + return new[] { Quantity.Conductivity }; case Unit.ppl: case Unit.ppdm3: @@ -428,22 +429,22 @@ namespace Common case Unit.dm3pp: case Unit.lpdeg: case Unit.dm3pdeg: - return Quantity.PulsePerLtr; + return new[] { Quantity.PulsePerLtr }; case Unit.ppkWh: case Unit.kWhpp: - return Quantity.PulsePerKWh; - + return new[] { Quantity.PulsePerKWh }; + case Unit.A: case Unit.mA: - return Quantity.Current; - + return new[] { Quantity.Current }; + case Unit.V: case Unit.mV: - return Quantity.Voltage; + return new[] { Quantity.Voltage }; default: - return Quantity.Number; + return new[] { Quantity.Number }; } } diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index dbf3c820c..5c45b63fb 100644 --- a/TBF/Properties/AssemblyInfo.cs +++ b/TBF/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("3.9.3134.105")] -[assembly: AssemblyFileVersion("3.9.3134.105")] +[assembly: AssemblyVersion("3.9.3134.106")] +[assembly: AssemblyFileVersion("3.9.3134.106")] diff --git a/TBF/Resources/Strings.Designer.cs b/TBF/Resources/Strings.Designer.cs index b36eb5c49..36d84ecf8 100644 --- a/TBF/Resources/Strings.Designer.cs +++ b/TBF/Resources/Strings.Designer.cs @@ -1,6 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -18,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", "17.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "18.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Strings { @@ -4452,7 +4453,7 @@ namespace TBF.Resources { } /// - /// Looks up a localized string similar to Pulses per liter. + /// Looks up a localized string similar to Pulses per unit. /// internal static string PulsesPerLtr { get { diff --git a/TBF/Resources/Strings.cs.resx b/TBF/Resources/Strings.cs.resx index 2a45ee942..00234e6e2 100644 --- a/TBF/Resources/Strings.cs.resx +++ b/TBF/Resources/Strings.cs.resx @@ -529,7 +529,7 @@ Rychlost změny [%] - Impulsy na litr + Impulsy na jednotky Komponent @@ -1734,6 +1734,18 @@ Zobraz Okno + + + + + + + + + + + Probíhá výpočet + Uspořádání testu @@ -1755,16 +1767,4 @@ Znovu otevřít - - - - - - - - - - - Probíhá výpočet - \ No newline at end of file diff --git a/TBF/Resources/Strings.de.resx b/TBF/Resources/Strings.de.resx index 675a32298..2ce6b09c4 100644 --- a/TBF/Resources/Strings.de.resx +++ b/TBF/Resources/Strings.de.resx @@ -532,7 +532,7 @@ Durchflussänderung [%] - Impulse pro Liter + Impulse pro Einheit Komponente @@ -2187,6 +2187,15 @@ Dialog anzeigen + + + + + + + + + Wasserzähler geprüft @@ -2220,13 +2229,4 @@ Abtastkopf wurde deaktiviert vom Benutzer! - - - - - - - - - \ No newline at end of file diff --git a/TBF/Resources/Strings.es.resx b/TBF/Resources/Strings.es.resx index 42dd41499..2e116070f 100644 --- a/TBF/Resources/Strings.es.resx +++ b/TBF/Resources/Strings.es.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + pulsos por unidad + Activity in Spanish diff --git a/TBF/Resources/Strings.fr.resx b/TBF/Resources/Strings.fr.resx index 5b63f80f0..f37f2e22d 100644 --- a/TBF/Resources/Strings.fr.resx +++ b/TBF/Resources/Strings.fr.resx @@ -529,7 +529,7 @@ Taux de changement [%] - Impulsions par litre + impulsions par unité Composant @@ -2004,6 +2004,15 @@ Afficher la boîte de dialogue + + + + + + + + + Types compteurs testés @@ -2019,13 +2028,4 @@ Temps test [s] - - - - - - - - - \ No newline at end of file diff --git a/TBF/Resources/Strings.it.resx b/TBF/Resources/Strings.it.resx index b700dfed6..c1b24abd9 100644 --- a/TBF/Resources/Strings.it.resx +++ b/TBF/Resources/Strings.it.resx @@ -529,7 +529,7 @@ tasso di cambio [%] - impulsi per litro + impulsi per unità componente @@ -1761,6 +1761,15 @@ Mostra dialogo + + + + + + + + + tipi di contatori testati @@ -1791,13 +1800,4 @@ Drenare - - - - - - - - - \ No newline at end of file diff --git a/TBF/Resources/Strings.pl.resx b/TBF/Resources/Strings.pl.resx index 7036778c3..50978605f 100644 --- a/TBF/Resources/Strings.pl.resx +++ b/TBF/Resources/Strings.pl.resx @@ -520,7 +520,7 @@ Szybkość zmian [%] - Impulsy na litr + impulsów na jednostkę Element @@ -1644,6 +1644,15 @@ Napięcie + + + + + + + + + Układ testu @@ -1695,13 +1704,4 @@ Jeszcze raz - - - - - - - - - \ No newline at end of file diff --git a/TBF/Resources/Strings.resx b/TBF/Resources/Strings.resx index 064b2ec0a..fb5f56b04 100644 --- a/TBF/Resources/Strings.resx +++ b/TBF/Resources/Strings.resx @@ -541,7 +541,7 @@ Rate of change [%] - Pulses per liter + Pulses per unit Delay between pictures diff --git a/TBF/Resources/Strings.ro.resx b/TBF/Resources/Strings.ro.resx index fdb95c768..1f9f1fbba 100644 --- a/TBF/Resources/Strings.ro.resx +++ b/TBF/Resources/Strings.ro.resx @@ -433,7 +433,7 @@ Variatie debit [%] - impuls pe litru + impulsuri pe unitate Componenta @@ -819,6 +819,15 @@ Save Communication + + + + + + + + + rece @@ -843,13 +852,4 @@ seria - - - - - - - - - \ No newline at end of file diff --git a/TBF/Resources/Strings.ru.resx b/TBF/Resources/Strings.ru.resx index ec13473b8..eeb2d30f8 100644 --- a/TBF/Resources/Strings.ru.resx +++ b/TBF/Resources/Strings.ru.resx @@ -520,7 +520,7 @@ Скорость изменения [%] - Импульсов на литр + импульсов на единицу Компонент @@ -1554,6 +1554,15 @@ Voltage + + + + + + + + + холодный @@ -1608,13 +1617,4 @@ Снова - - - - - - - - - \ No newline at end of file diff --git a/TBF/Resources/Strings.sk.resx b/TBF/Resources/Strings.sk.resx index 5bea76082..0f17f5f1e 100644 --- a/TBF/Resources/Strings.sk.resx +++ b/TBF/Resources/Strings.sk.resx @@ -135,6 +135,9 @@ Združené vodomery + + Pulzy na jednotky + Činnosť diff --git a/TBF/Rig/RegisterReaders/PulsesFromUniCB/RRProcParams.cs b/TBF/Rig/RegisterReaders/PulsesFromUniCB/RRProcParams.cs index 212f24411..179d81694 100644 --- a/TBF/Rig/RegisterReaders/PulsesFromUniCB/RRProcParams.cs +++ b/TBF/Rig/RegisterReaders/PulsesFromUniCB/RRProcParams.cs @@ -24,14 +24,14 @@ namespace TBF.Rig.RegisterReaders.PulsesFromUniCB public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RRProcParams) })[0]; public override XmlSerializer GetSerializer() { return Serializer; } - public double PulsesPerLtr; /// [l^-1] - public string Units; /// [kg^-1]...MF + public double PulsesPerLtr; + public string Units; public int Filter; public override void InitializeAll() { PulsesPerLtr = 1.0; - Units = "---"; //...MF + Units = "---"; Filter = 0; } @@ -43,7 +43,7 @@ namespace TBF.Rig.RegisterReaders.PulsesFromUniCB Strings.Filter, }; - //...MF + private void RefreshParamNames(int i) { if (i == 0) { @@ -56,12 +56,12 @@ namespace TBF.Rig.RegisterReaders.PulsesFromUniCB public override string ParamName(int i) { - //if(i==0) RefreshParamNames(0);//...MF + //if(i==0) RefreshParamNames(0); return paramNames[i]; } public override int ParamsCount() { return paramNames.Length; } - public ICollection ParamValues(int ix) + /*public ICollection ParamValues(int ix) { var values = new List(); switch (ix) @@ -72,6 +72,33 @@ namespace TBF.Rig.RegisterReaders.PulsesFromUniCB default: return null; } + }*/ + + public ICollection ParamValues(int ix) + { + switch (ix) + { + case 1: + { + var values = new List + { + Unit.None.ToDescription() + }; + + for (Unit unit = (Unit)1; unit < Unit.Count; unit++) + { + if (Common.Units.IsQuantity(unit, Quantity.MultiFunctionalVariables)) + { + values.Add(unit.ToDescription()); + } + } + + return values; + } + + default: + return null; + } } public override string ToString(int i) @@ -127,7 +154,7 @@ namespace TBF.Rig.RegisterReaders.PulsesFromUniCB void CopyContentTo(RRProcParams prms) { prms.PulsesPerLtr = this.PulsesPerLtr; - prms.Units = this.Units; //...MF + prms.Units = this.Units; prms.Filter = this.Filter; } diff --git a/TBF/Rig/RegisterReaders/StandingStartStop/RRProcParams.cs b/TBF/Rig/RegisterReaders/StandingStartStop/RRProcParams.cs index b0c6ed40e..90b93ae10 100644 --- a/TBF/Rig/RegisterReaders/StandingStartStop/RRProcParams.cs +++ b/TBF/Rig/RegisterReaders/StandingStartStop/RRProcParams.cs @@ -24,23 +24,23 @@ namespace TBF.Rig.RegisterReaders.StandingStartStop public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RRProcParams) })[0]; public override XmlSerializer GetSerializer() { return Serializer; } - public double PulsesPerLtr; /// Target low limit of the flow increase or decrease - public string Units; /// [kg^-1]...MF + public double PulsesPerLtr; + public string Units; public override void InitializeAll() { PulsesPerLtr = 1.0; - Units = "---"; //...MF + Units = "---"; } string[] paramNames = new string[] { //Strings.PulsesPerLtr, - Strings.PulsesPerUnit,//...MF - Strings.Units,//...MF + Strings.PulsesPerUnit, + Strings.Units, }; - //...MF + private void RefreshParamNames(int i) { if (i == 0) @@ -54,7 +54,7 @@ namespace TBF.Rig.RegisterReaders.StandingStartStop public override string ParamName(int i) { return paramNames[i]; } public override int ParamsCount() { return paramNames.Length; } - public ICollection ParamValues(int ix) + /*marek mareciinopublic ICollection ParamValues(int ix) { var values = new List(); switch (ix) @@ -65,6 +65,33 @@ namespace TBF.Rig.RegisterReaders.StandingStartStop default: return null; } + }*/ + + public ICollection ParamValues(int ix) + { + switch (ix) + { + case 1: + { + var values = new List + { + Unit.None.ToDescription() + }; + + for (Unit unit = (Unit)1; unit < Unit.Count; unit++) + { + if (Common.Units.IsQuantity(unit, Quantity.MultiFunctionalVariables)) + { + values.Add(unit.ToDescription()); + } + } + + return values; + } + + default: + return null; + } } public override string ToString(int i) @@ -72,7 +99,7 @@ namespace TBF.Rig.RegisterReaders.StandingStartStop switch (i) { case 0: return PulsesPerLtr.ToString(); - case 1: return Units;//...MF + case 1: return Units; default: return string.Empty; } } @@ -113,7 +140,7 @@ namespace TBF.Rig.RegisterReaders.StandingStartStop void CopyContentTo(RRProcParams prms) { prms.PulsesPerLtr = this.PulsesPerLtr; - prms.Units = this.Units; //...MF + prms.Units = this.Units; } public IParamsProvider Clone()