Compare commits

..
Author SHA1 Message Date
Milan Hanajik 003862a109 Fixes for #if IPERL related to recent uncertainty/error flags changes, ver. 2.24.1391 2020-01-10 11:33:37 +01:00
Milan Hanajik 771758892b Solution upgraded to VS2012 2020-01-07 11:09:52 +01:00
Milan Hanajik 42dfbeab2f Testmethods.ManualEntry : (1) UI (yes/no, last values are stored, etc.), (2) PMax pressure and test time fixed, ver. 2.24.1390 2020-01-07 11:05:31 +01:00
Milan Hanajik 6678cb31c5 TestMethods.ManualEntry, Results.ManualEntryItemSpec, Results.Forms.ManualEntryConfig..., etc., ver. 2.24.1389 2019-12-22 11:51:54 +01:00
Milan Hanajik 94b9f564cc Output.DB.ProductionTracing : Alternative profuction tracing DB possible. 2019-12-18 17:53:12 +01:00
Milan Hanajik 4bf4445672 RestoreAndFixBatch functionality modified. 2019-12-18 17:52:46 +01:00
Milan Hanajik b4763441a8 (1) Bug fix in sending FM pump frequencies to control board, (2) More logging, ver. 2.24.1386 2019-12-18 10:45:25 +01:00
Milan Hanajik 296198550a CLosing modeless forms Adjustment.WMErrorsForm and PulsesTest.WMPulsesForm. 2019-12-13 18:08:55 +01:00
Milan Hanajik 9cffd9e5c8 BenchControlPanel localization. 2019-12-13 18:08:54 +01:00
Milan Hanajik 55df6e809e FixedStartDeferredEvalSeq : Delay time before grabbing images introduced. 2019-12-13 18:08:53 +01:00
Milan Hanajik 512530f456 MainSeq bug fix : Program crashed when OuterLoop.Start was started as the first test. 2019-12-13 18:08:52 +01:00
Milan Hanajik 3c7d3e5ea6 E5 modified/fixed 2019-12-13 18:08:51 +01:00
Milan Hanajik 88a7de450a Users cleanup, ver. 2.24.1382 2019-12-13 18:08:38 +01:00
Milan Hanajik 531b5d29ae (1) TestProfiles and TestWizard.TestProfileSel (2) ErrorFlags and some WM params updated from profiles (3) Proc./Profile names case insensitive, ver. 2.24.1369 2019-12-13 11:25:22 +01:00
Milan Hanajik 511ef6a1f3 ErrorFlags : (1) bool --> (sbyte)ErrorFlagsMode, (2) Mode disappeared, (3) Prepared for E1 .. E63 2019-12-13 11:18:12 +01:00
Milan Hanajik c6497ef1b4 Kepno_50 : (1) Component updates (4.12.2019), (2) TestTimeCorrection into SummaryResults 2019-12-12 12:46:17 +01:00
Milan Hanajik 61fe458ea0 French language, ver. 2.24.1368 2019-11-27 15:01:57 +01:00
Milan Hanajik a43031c0a5 TBF.UI.Results namespace --> TBF.UI.ResultsMI, etc. 2019-11-26 18:05:02 +01:00
Milan Hanajik e9c6f58e0d ALZIR_25 symbol and component added 2019-11-26 18:03:24 +01:00
Milan Hanajik 3e026d7129 Elde.RegisterReader.RegisterReader.Position, IRegisterReader.Position, etc. introduced., ver. 2.24.1365 2019-11-20 13:09:38 +01:00
Milan Hanajik dd8ea86fc3 FixedStartDeferredEval a FixedStartMassCollDeferredEval 2019-11-19 07:54:54 +01:00
Milan Hanajik b5be8f74bf (1) FixedStartSeq code cleanup, scale/tank/draining/mass measurement removed, (2) Adjustment.WMErrorsForm-s are more robust, ver. 2.24.1364 2019-11-15 16:53:57 +01:00
Milan Hanajik 0297d74b17 ROMA_200 : (1) Component upgraded (12.11.2019), (2) Dummy scale does not overwrite Tank/DrainValve info, (3) minor changes, ver. 2.24.1363 2019-11-13 08:14:01 +01:00
Milan Hanajik 708610b8ab ROMA_200 : Component added, symbol processing added, ver. 2.24.1359 2019-11-07 14:45:09 +01:00
Milan Hanajik b3fdb11b81 TestProfiles : UI changes 2019-11-07 14:00:30 +01:00
Milan Hanajik ecaca8cc6b Config.Entities.Profile, PTest, Config.Mappings.ProfileMap, PTestMap added. 2019-10-31 14:01:41 +01:00
Milan Hanajik 0a68fed3e9 TBF.UI.Bench.TestProfiles changes. 2019-10-30 09:24:52 +01:00
Milan Hanajik 21cbc4220e TBF.UI : Item.EditXyz added. 2019-10-30 09:24:50 +01:00
Milan Hanajik 7fd4966757 Uncertainty under construction, Results DB TestRslt table modified 2019-10-30 09:24:49 +01:00
Milan Hanajik 424be60a05 Bug fixes : (1) FlowMeterDewa, (2) ControlComWrap.ReferenceFreqs(int i) 2019-10-30 09:24:48 +01:00
Milan Hanajik 68d6479d20 Output.fileWriters.IperlLogger bug fix 2019-10-28 17:05:52 +01:00
Milan Hanajik 1ca6b182d4 iPerlCommunication : DelayBetweenRetries introduced. 2019-10-28 17:05:51 +01:00
Milan Hanajik 870d57fb67 (1) ProcedureDlg: Draining before/after in Process tab, (2) DoDrainingAfter implemented in test method sequences. 2019-10-28 17:05:41 +01:00
Milan Hanajik 28123c3a31 Transition sequences and hydraulic paths are not displayed and cannot be edited for test methods with DoTranisitions( ) == false. 2019-10-24 12:57:52 +02:00
Milan Hanajik d5c0eb9c09 (1) TBF.BenchControl.Elde.SendCommandArgs class and cbCommandQueue (2) DiverterToTank, DiverterToSink commands modified. 2019-10-24 12:57:37 +02:00
Milan Hanajik dbe87a375d TransitionContext.AfterTestWithOverlap, PID coef. set earlier as well, nextHydroTest in MainSeq. 2019-10-24 12:56:59 +02:00
Milan Hanajik f1147031a1 (1) Modifications for WR20, WR21 (2) ProcessData.BenchInfo.TestBenchId/TextBenchName are always used by Oracle and ProductionTracing. 2019-10-24 12:51:08 +02:00
Milan Hanajik c95860dcce iPerl : "Fix' is possible for user 'milan' even when previous records are missing 2019-10-11 16:52:20 +02:00
Milan Hanajik b37023eff7 (1) TestMethods.Dummy component, (2) Three custom shared buttons, (3) ProcedureDlg and Procedures.TestWizard modified. 2019-10-11 16:52:09 +02:00
Milan Hanajik 0934940556 SensusTestInfo extended 2019-10-11 15:06:02 +02:00
Milan Hanajik f7c10daa52 'ShowDisabledPositions' supported when displaying previous results. 2019-10-11 15:06:01 +02:00
Milan Hanajik 1d75cbc239 Oracle DB only : Refactorization : TBF.UI namespace, no change of function, part 2. 2019-10-01 12:11:10 +02:00
Milan Hanajik 2aa8b19c87 FlowMeter, FlowmeterTriplet : Condiiton (flow < 0.1 * NominalFlow) removed from LtrPerPulseCorrected( ) 2019-09-26 15:39:19 +02:00
Milan Hanajik 179735fcd1 Bug fix : Program crashed when on-screen result items were defined for the first time on a PC (columnWidths == null). 2019-09-23 07:17:42 +02:00
Milan Hanajik 9caae8dffd (1) FlowMeteDewa uses EtPulses2, EtPulses3, (2) WMChart fixed, Q4 displayed, (3) Minor MainSeq bug fix. 2019-09-22 16:37:58 +02:00
Milan Hanajik 4fc427d875 (1) StandardCamera.TestStartEndForm fixed (exclamation), (2) Simulate mode for camera with sample.bmp. 2019-09-22 16:37:55 +02:00
Milan Hanajik 688580c29f TBF ver. 2.24.1320 2019-09-22 16:37:46 +02:00
Milan Hanajik 28937ff01d Temperature, Pressure : shorter filter (7s -> 4s) and skip (5s -> 3s) times, ver. 2.24.1317 2019-09-19 15:06:36 +02:00
Milan Hanajik 6dbb6118ea UpgradeSelectionDlg : 2.18 -> 2.22 and 2.22 -> 2.24 2019-09-19 14:22:34 +02:00
Milan Hanajik adc9e4efe4 Clean-up 2019-09-19 07:45:35 +02:00
Milan Hanajik 3333b4baa2 FlowMeterDewa bug fix, wrong indices used when calculating a correction of a sum of flows. 2019-09-19 07:45:21 +02:00
Milan Hanajik a1ef22b809 ver. 2.24.1316 2019-09-19 07:43:29 +02:00
Milan Hanajik 90b760075c TBF.UI.Bench.Uncertainties : Modifications, 3 tab pages completed, 2 in preparation. 2019-09-18 18:49:11 +02:00
Milan Hanajik 74f8c44783 Config.Data.RealDensity etc., DataContainers.Density and Buoyancy components, related metrology tabs modified/created. 2019-09-18 18:49:00 +02:00
346 changed files with 23536 additions and 5765 deletions
+5
View File
@@ -84,6 +84,8 @@
<Compile Include="Entities\OutputPath.cs" />
<Compile Include="Entities\Procedure.cs" />
<Compile Include="Entities\ProcedureHistory.cs" />
<Compile Include="Entities\Profile.cs" />
<Compile Include="Entities\PTest.cs" />
<Compile Include="Entities\Test.cs" />
<Compile Include="Entities\TransitionSequence.cs" />
<Compile Include="Entities\TransitionStep.cs" />
@@ -106,6 +108,8 @@
<Compile Include="Mappings\MetersPathMap.cs" />
<Compile Include="Mappings\OutputPathMap.cs" />
<Compile Include="Mappings\ProcedureMap.cs" />
<Compile Include="Mappings\ProfileMap.cs" />
<Compile Include="Mappings\PTestMap.cs" />
<Compile Include="Mappings\TestMap.cs" />
<Compile Include="Mappings\TransitionSequenceMap.cs" />
<Compile Include="Mappings\TransitionStepMap.cs" />
@@ -127,6 +131,7 @@
<ItemGroup>
<EmbeddedResource Include="Resources\Strings.cs.resx" />
<EmbeddedResource Include="Resources\Strings.de.resx" />
<EmbeddedResource Include="Resources\Strings.fr.resx" />
<EmbeddedResource Include="Resources\Strings.it.resx" />
<EmbeddedResource Include="Resources\Strings.pl.resx" />
<EmbeddedResource Include="Resources\Strings.resx">
+8 -4
View File
@@ -32,10 +32,10 @@ namespace Config
public const int CompoundWMsCount = 3;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 3;
#elif DEWA_300
#elif DEWA_300 || ROMA_200
public const int WMsCount = 10;
public const int LineSize = 10;
public const int CompoundWMsCount = 3;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif DUBAJ_50
@@ -62,7 +62,7 @@ namespace Config
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 1;
#elif TORUN_50 || CEVAK_40 || MURES_40 || FUZHOU_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50
#elif TORUN_50 || CEVAK_40 || MURES_40 || FUZHOU_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || ALZIR_25
public const int WMsCount = 20;
public const int LineSize = 10;
public const int CompoundWMsCount = 1;
@@ -110,5 +110,9 @@ namespace Config
/// Database related: This object reference is set after a successful user login
///
public static DatabaseSettings CurrentBench;
}
public static double RealDensity = 0; /// true water density [kg/m3]
public static double AtTemperature = 0; /// measured at temperature [°C]
public static double Buoyancy = 0;
}
}
+136 -17
View File
@@ -83,6 +83,23 @@ namespace Config.Entities
Count,
}
public enum ProfileType
{
Q3R,
QnClassColdWater,
QnClassHotWater,
QpQi,
Manual,
Count,
}
public enum ErrorLimitType
{
Manual,
QpClass,
Count,
}
/// <summary> Kind of meters for the procedure / test </summary>
public enum MetersKind
{
@@ -90,6 +107,10 @@ namespace Config.Entities
[Description("Wasserzähler")] Single,
[Description("Verbundwasserzähler")] Combined,
[Description("Wärmezähler")] HeatMeter,
#elif LANG_FR
[Description("Compteurs eau")] Single,
[Description("Mètres composés")] Combined,
[Description("Thermomètres")] HeatMeter,
#elif LANG_CS
[Description("Vodoměry")] Single,
[Description("Kombinované vodoměry")] Combined,
@@ -125,6 +146,9 @@ namespace Config.Entities
#elif LANG_IT
[Description("freddo")] ColdWater,
[Description("caldo")] HotWater,
#elif LANG_FR
[Description("eau froide")] ColdWater,
[Description("eau chaude")] HotWater,
#else
[Description("cold")] ColdWater,
[Description("hot")] HotWater,
@@ -240,6 +264,11 @@ namespace Config.Entities
[Description("immer")] Always = 1,
[Description("Bildschirm")] OnScreen = 2,
[Description("intern")] Internal = 3,
#elif LANG_FR
[Description("jamais")] Never = 0,
[Description("toujours")] Always = 1,
[Description("À l'écran")] OnScreen = 2,
[Description("interne")] Internal = 3,
#elif LANG_CS
/// czech
[Description("nikdy")] Never = 0,
@@ -281,6 +310,10 @@ namespace Config.Entities
[Description("Waage")] Scale,
[Description("Spanne")] Spread,
[Description("Standardabw.")] StdDev,
#elif LANG_FR
[Description("Balance")] Scale,
[Description("Envergure")] Spread,
[Description("Déviation std.")] StdDev,
#elif LANG_CS
/// cesky
[Description("váhou")] Scale,
@@ -291,22 +324,16 @@ namespace Config.Entities
[Description("Spread")] Spread,
[Description("Std.dev.")] StdDev,
#endif
Count
Count
}
public enum TestRedType
public enum TestProfile
{
Fix,
/// etc.
Count,
}
public enum FQC1
{
FQC1,
FQP1,
Count,
}
UserDefined,
UserDefinedHeatMeter,
Protected, /// The first protected one
ProtectedHeatMeter,
}
public enum Progress
{
@@ -345,6 +372,14 @@ namespace Config.Entities
[Description("Prüfpunktergebnisse")] TestResult,
[Description("Wasserzelledaten")] MeterData,
[Description("Wasserzelleergebnisse")] MeterResult,
#elif LANG_FR
[Description("Autres")] Other,
[Description("Données de banc")] BenchData,
[Description("Résultats du banc")] BenchResult,
[Description("Données de test")] TestData,
[Description("Résultats de test")] TestResult,
[Description("Données du compteur d'eau")] MeterData,
[Description("Résultats du compteur d'eau")] MeterResult,
#else
[Description("Other")] Other,
[Description("Bench data")] BenchData,
@@ -354,7 +389,7 @@ namespace Config.Entities
[Description("Meter data")] MeterData,
[Description("Meter result")] MeterResult,
#endif
Count,
Count,
}
/// <summary> Possible modes of operation of components and devices. </summary>
@@ -371,6 +406,17 @@ namespace Config.Entities
[Description("Reply")] Reply,
[Description("Simuliert")] Simulate, /// Test bench simulation, this mode does not require any hardware
[Description("Geerbt")] Inherit,
#elif LANG_FR
[Description("Détection automatique: Éteindre")] DetectedOff = -2,
[Description("Détection automatique: Allumé")] DetectedOn = -1,
[Description("Ordinaire")] Normal = 0,
[Description("Détection automatique")] AutoDetect,
[Description("Erreur d'exécution")] FailureDuringOperation,
[Description("Éteindre")] Off,
[Description("Record")] Record,
[Description("Répondre")] Reply,
[Description("Simuler")] Simulate,
[Description("Hériter")] Inherit,
#else
[Description("Detected off")] DetectedOff = -2,
[Description("Detected on")] DetectedOn = -1,
@@ -383,7 +429,7 @@ namespace Config.Entities
[Description("Simulate")] Simulate, /// Test bench simulation, this mode does not require any hardware
[Description("Inherit")] Inherit,
#endif
Count,
Count,
}
public enum LogLevel
@@ -430,6 +476,11 @@ namespace Config.Entities
[Description("zentriert")] Center,
[Description("rechts")] Right,
[Description("angepasst")] Justified,
#elif LANG_FR
[Description("gauche")] Left,
[Description("centré")] Center,
[Description("droit")] Right,
[Description("justifié")] Justified,
#else
[Description("Left")] Left,
[Description("Center")] Center,
@@ -479,6 +530,10 @@ namespace Config.Entities
[Description("aus")] Off,
[Description("info")] Info,
[Description("ein")] On,
#elif LANG_FR
[Description("éteindre")] Off,
[Description("info")] Info,
[Description("allumé")] On,
#elif LANG_CS
[Description("vypnuto")] Off,
[Description("info")] Info,
@@ -496,7 +551,7 @@ namespace Config.Entities
[Description("info")] Info,
[Description("on")] On,
#endif
Count
Count
}
@@ -533,9 +588,41 @@ namespace Config.Entities
E29,
E30,
E31,
E32,
E33,
E34,
E35,
E36,
E37,
E38,
E39,
E40,
E41,
E42,
E43,
E44,
E45,
E46,
E47,
E48,
E49,
E50,
E51,
E52,
E53,
E54,
E55,
E56,
E57,
E58,
E59,
E60,
E61,
E62,
E63,
}
public enum ErrorFlagMask
public enum ErrorFlagMask : long
{
E1 = (1 << (int)ErrorFlagShift.E1),
E2 = (1 << (int)ErrorFlagShift.E2),
@@ -568,5 +655,37 @@ namespace Config.Entities
E29 = (1 << (int)ErrorFlagShift.E29),
E30 = (1 << (int)ErrorFlagShift.E30),
E31 = (1 << (int)ErrorFlagShift.E31),
E32 = (1 << (int)ErrorFlagShift.E32),
E33 = (1 << (int)ErrorFlagShift.E33),
E34 = (1 << (int)ErrorFlagShift.E34),
E35 = (1 << (int)ErrorFlagShift.E35),
E36 = (1 << (int)ErrorFlagShift.E36),
E37 = (1 << (int)ErrorFlagShift.E37),
E38 = (1 << (int)ErrorFlagShift.E38),
E39 = (1 << (int)ErrorFlagShift.E39),
E40 = (1 << (int)ErrorFlagShift.E40),
E41 = (1 << (int)ErrorFlagShift.E41),
E42 = (1 << (int)ErrorFlagShift.E42),
E43 = (1 << (int)ErrorFlagShift.E43),
E44 = (1 << (int)ErrorFlagShift.E44),
E45 = (1 << (int)ErrorFlagShift.E45),
E46 = (1 << (int)ErrorFlagShift.E46),
E47 = (1 << (int)ErrorFlagShift.E47),
E48 = (1 << (int)ErrorFlagShift.E48),
E49 = (1 << (int)ErrorFlagShift.E49),
E50 = (1 << (int)ErrorFlagShift.E50),
E51 = (1 << (int)ErrorFlagShift.E51),
E52 = (1 << (int)ErrorFlagShift.E52),
E53 = (1 << (int)ErrorFlagShift.E53),
E54 = (1 << (int)ErrorFlagShift.E54),
E55 = (1 << (int)ErrorFlagShift.E55),
E56 = (1 << (int)ErrorFlagShift.E56),
E57 = (1 << (int)ErrorFlagShift.E57),
E58 = (1 << (int)ErrorFlagShift.E58),
E59 = (1 << (int)ErrorFlagShift.E59),
E60 = (1 << (int)ErrorFlagShift.E60),
E61 = (1 << (int)ErrorFlagShift.E61),
E62 = (1 << (int)ErrorFlagShift.E62),
E63 = (1 << (int)ErrorFlagShift.E63),
}
}
+4 -6
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
///
using System;
@@ -8,17 +8,15 @@ namespace Config.Entities
public class Group
{
public virtual int Id { get; protected set; }
public virtual int Gid { get; set; }
public virtual string Name { get; set; }
public virtual Users.Entities.GID GID { get; set; }
public Group()
{
}
public Group(int gid, string name)
public Group(Users.Entities.GID gid)
{
Gid = gid;
Name = name;
GID = gid;
}
}
}
+325
View File
@@ -0,0 +1,325 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using System.Globalization;
using System.IO;
namespace Config.Entities
{
/// <summary>
/// Test, consisting of one or more repetitions of the test 'SingleTest'.
/// </summary>
public class PTest : IHasName, IHasItemNr
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual int Part { get; set; } /// Part=0 ... test of all WM-s /// Part>0 ... part of a set of tests with the same Name: subset of WM-s is given by MetersPath
public virtual double CoefQfrom { get; set; } /// Water flow low limit in [m3/h]
public virtual double CoefQto { get; set; } /// Water flow high limit in [m3/h]
public virtual double ErrLimLo { get; set; } /// in [%] usually < 0, in case of heat meters: 1=class1, 2=class2, 3=class3
public virtual double ErrLimHi { get; set; } /// in [%] usually > 0, in case of heat meters: -Qn in m3/h
public virtual double TempLimLo { get; set; } /// Lower limit for the controlled temperature
public virtual double TempLimHi { get; set; } /// Upper limit for the controlled temperature
public virtual double PressLimLo { get; set; } /// [bar] min. water pressure
public virtual double PressLimHi { get; set; } /// [bar] max. water pressure
public virtual sbyte E1 { get; set; } ///
public virtual sbyte E2 { get; set; } ///
public virtual sbyte E3 { get; set; } ///
public virtual sbyte E4 { get; set; } ///
public virtual sbyte E5 { get; set; } ///
public virtual sbyte E6 { get; set; } ///
public virtual sbyte E7 { get; set; } ///
public virtual sbyte E8 { get; set; } ///
public virtual sbyte E9 { get; set; } /// 0=off, 1=info, 2=evaluate
public virtual sbyte E10 { get; set; } ///
public virtual sbyte E11 { get; set; } ///
public virtual sbyte E12 { get; set; } ///
public virtual sbyte E13 { get; set; } ///
public virtual sbyte E14 { get; set; } ///
public virtual sbyte E15 { get; set; } ///
public virtual sbyte E16 { get; set; } ///
public virtual sbyte E21 { get; set; } ///
public virtual double Delta_Q_pct { get; set; } /// [%] max deviation from the mean flow
public virtual double Delta_T { get; set; } /// [°C] max. T_up or T_down deviation from the mean temperature
public virtual double Delta_Tup_Tdn { get; set; } /// [°C] max. difference abs(T_up - T_down)
public virtual double TestTime_min { get; set; } /// [s]
public virtual double TestTime_max { get; set; } /// [s]
public virtual double AmbTemp_min { get; set; } /// [°C] min. ambient temperature
public virtual double AmbTemp_max { get; set; } /// [°C] max. ambient temperature
public virtual double Coef_E9 { get; set; } /// Coefficient used in E9, default 0.025
public virtual double Coef_E10 { get; set; } /// Coefficient used in E10, default 0.04
public virtual double Coef_E11 { get; set; } /// Coefficient used in E11, default 0.1
public virtual double Coef_E12 { get; set; } /// Coefficient used in E12, default 1
public virtual double Offset_E9 { get; set; } /// [s] default 0 (no offset)
public virtual double Offset_E12 { get; set; } /// [s] default 0 (no offset)
public virtual Profile Profile { get; set; }
/// ------------- Additional stuff not mapped into the database -------------
public PTest()
{
///
/// Default values
///
Part = 0;
CoefQfrom = 1.0;
CoefQto = 1.1;
ErrLimLo = -2.0; /// [%]
ErrLimHi = 2.0; /// [%]
TempLimLo = 15.0; /// [°C]
TempLimHi = 25.0; /// [°C]
PressLimLo = 0; /// [bar]
PressLimHi = 16.0; /// [bar]
E1 = 1;
E2 = 1;
E3 = 1;
E4 = 1;
E5 = 1;
E6 = 1;
E7 = 1;
E8 = 1;
E9 = 1;
E10 = 1;
E11 = 1;
E12 = 1;
E13 = 1;
E14 = 1;
E15 = 1;
E16 = 1;
E21 = 1;
Delta_Q_pct = 5.0; /// [%]
Delta_T = 10.0; /// [°C]
Delta_Tup_Tdn = 10.0; /// [°C]
TestTime_min = 0; /// [s]
TestTime_max = 99999; /// [s]
AmbTemp_min = 5.0; /// [°C]
AmbTemp_max = 95.0; /// [°C]
Coef_E9 = 0.025;
Coef_E10 = 0.04;
Coef_E11 = 0.1;
Coef_E12 = 1.0;
Offset_E9 = 0; /// [s]
Offset_E12 = 0; /// [s]
}
public PTest(string name, int itemNr, Profile profile)
: this()
{
Name = name;
ItemNr = itemNr;
Profile = profile;
}
// Makes a new copy of this object (not just a reference)
public virtual PTest Clone()
{
PTest result = new PTest(Name, ItemNr, Profile);
result.Part = Part;
result.CoefQfrom = CoefQfrom;
result.CoefQto = CoefQto;
result.ErrLimLo = ErrLimLo;
result.ErrLimHi = ErrLimHi;
result.TempLimLo = TempLimLo;
result.TempLimHi = TempLimHi;
result.PressLimLo = PressLimLo;
result.PressLimHi = PressLimHi;
result.E1 = E1;
result.E2 = E2;
result.E3 = E3;
result.E4 = E4;
result.E5 = E5;
result.E6 = E6;
result.E7 = E7;
result.E8 = E8;
result.E9 = E9;
result.E10 = E10;
result.E11 = E11;
result.E12 = E12;
result.E13 = E13;
result.E14 = E14;
result.E15 = E15;
result.E16 = E16;
result.E21 = E21;
result.Delta_Q_pct = Delta_Q_pct;
result.Delta_T = Delta_T;
result.Delta_Tup_Tdn = Delta_Tup_Tdn;
result.TestTime_min = TestTime_min;
result.TestTime_max = TestTime_max;
result.AmbTemp_min = AmbTemp_min;
result.AmbTemp_max = AmbTemp_max;
result.Coef_E9 = Coef_E9;
result.Coef_E10 = Coef_E10;
result.Coef_E11 = Coef_E11;
result.Coef_E12 = Coef_E12;
result.Offset_E9 = Offset_E9;
result.Offset_E12 = Offset_E12;
return result;
}
public virtual void Export(StreamWriter output)
{
CultureInfo ci = CultureInfo.InvariantCulture;
output.WriteLine(Name);
output.WriteLine(Part);
output.WriteLine(CoefQfrom.ToString(ci));
output.WriteLine(CoefQto.ToString(ci));
output.WriteLine(ErrLimLo.ToString(ci));
output.WriteLine(ErrLimHi.ToString(ci));
output.WriteLine(TempLimLo.ToString(ci));
output.WriteLine(TempLimHi.ToString(ci));
output.WriteLine(PressLimLo.ToString(ci));
output.WriteLine(PressLimHi.ToString(ci));
output.WriteLine(E1.ToString());
output.WriteLine(E2.ToString());
output.WriteLine(E3.ToString());
output.WriteLine(E4.ToString());
output.WriteLine(E5.ToString());
output.WriteLine(E6.ToString());
output.WriteLine(E7.ToString());
output.WriteLine(E8.ToString());
output.WriteLine(E9.ToString());
output.WriteLine(E10.ToString());
output.WriteLine(E11.ToString());
output.WriteLine(E12.ToString());
output.WriteLine(E13.ToString());
output.WriteLine(E14.ToString());
output.WriteLine(E15.ToString());
output.WriteLine(E16.ToString());
output.WriteLine(E21.ToString());
output.WriteLine(Delta_Q_pct.ToString(ci));
output.WriteLine(Delta_T.ToString(ci));
output.WriteLine(Delta_Tup_Tdn.ToString(ci));
output.WriteLine(TestTime_min.ToString(ci));
output.WriteLine(TestTime_max.ToString(ci));
output.WriteLine(AmbTemp_min.ToString(ci));
output.WriteLine(AmbTemp_max.ToString(ci));
output.WriteLine(Coef_E9.ToString(ci));
output.WriteLine(Coef_E10.ToString(ci));
output.WriteLine(Coef_E11.ToString(ci));
output.WriteLine(Coef_E12.ToString(ci));
output.WriteLine(Offset_E9.ToString(ci));
output.WriteLine(Offset_E12.ToString(ci));
}
public static PTest Import(StreamReader input, Profile newProfile)
{
string firstLine = input.ReadLine();
if (string.IsNullOrEmpty(firstLine))
{
return null;
}
CultureInfo ci = CultureInfo.InvariantCulture;
PTest tst = new PTest();
tst.Name = firstLine;
tst.Part = int.Parse(input.ReadLine());
tst.CoefQfrom = double.Parse(input.ReadLine(), ci);
tst.CoefQto = double.Parse(input.ReadLine(), ci);
tst.ErrLimLo = double.Parse(input.ReadLine(), ci);
tst.ErrLimHi = double.Parse(input.ReadLine(), ci);
tst.TempLimLo = double.Parse(input.ReadLine(), ci);
tst.TempLimHi = double.Parse(input.ReadLine(), ci);
/// TODO (E1 .. E21)
tst.Delta_Q_pct = double.Parse(input.ReadLine(), ci);
tst.Delta_T = double.Parse(input.ReadLine(), ci);
tst.Delta_Tup_Tdn = double.Parse(input.ReadLine(), ci);
tst.TestTime_min = double.Parse(input.ReadLine(), ci);
tst.TestTime_max = double.Parse(input.ReadLine(), ci);
tst.AmbTemp_min = double.Parse(input.ReadLine(), ci);
tst.AmbTemp_max = double.Parse(input.ReadLine(), ci);
tst.Coef_E9 = double.Parse(input.ReadLine(), ci);
tst.Coef_E10 = double.Parse(input.ReadLine(), ci);
tst.Coef_E11 = double.Parse(input.ReadLine(), ci);
tst.Coef_E12 = double.Parse(input.ReadLine(), ci);
tst.Offset_E9 = double.Parse(input.ReadLine(), ci);
tst.Offset_E12 = double.Parse(input.ReadLine(), ci);
tst.Profile = newProfile;
return tst;
}
public virtual string Compare(StreamReader inp)
{
System.Text.StringBuilder diff = new System.Text.StringBuilder();
string fmt = string.Format("Test {0} : ", Name) + "{0} = {1}\r\n (in the file {2})\r\n";
string ln;
CultureInfo ci = CultureInfo.InvariantCulture;
string firstLine = inp.ReadLine();
if (string.IsNullOrEmpty(firstLine)) return string.Format("Test {0} is missing in the file\r\n", Name);
if (Name != firstLine) { diff.AppendFormat(fmt, "Name", Name, firstLine); };
ln = inp.ReadLine(); if (ln != Part.ToString()) { diff.AppendFormat(fmt, "Part", Part.ToString(), ln); };
ln = inp.ReadLine(); if (ln != CoefQfrom.ToString(ci)) { diff.AppendFormat(fmt, "CoefQfrom", CoefQfrom.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != CoefQto.ToString(ci)) { diff.AppendFormat(fmt, "CoefQto", CoefQto.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != ErrLimLo.ToString(ci)) { diff.AppendFormat(fmt, "ErrLimLo", ErrLimLo.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != ErrLimHi.ToString(ci)) { diff.AppendFormat(fmt, "ErrLimHi", ErrLimHi.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TempLimLo.ToString(ci)) { diff.AppendFormat(fmt, "TempLimLo", TempLimLo.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TempLimHi.ToString(ci)) { diff.AppendFormat(fmt, "TempLimHi", TempLimHi.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != PressLimLo.ToString(ci)) { diff.AppendFormat(fmt, "Pressure_min", TempLimLo.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != PressLimHi.ToString(ci)) { diff.AppendFormat(fmt, "Pressure_max", TempLimHi.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != E1.ToString()) { diff.AppendFormat(fmt, "E1", E1.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E2.ToString()) { diff.AppendFormat(fmt, "E2", E2.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E3.ToString()) { diff.AppendFormat(fmt, "E3", E3.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E4.ToString()) { diff.AppendFormat(fmt, "E4", E4.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E5.ToString()) { diff.AppendFormat(fmt, "E5", E5.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E6.ToString()) { diff.AppendFormat(fmt, "E6", E6.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E7.ToString()) { diff.AppendFormat(fmt, "E7", E7.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E8.ToString()) { diff.AppendFormat(fmt, "E8", E8.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E9.ToString()) { diff.AppendFormat(fmt, "E9", E9.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E10.ToString()) { diff.AppendFormat(fmt, "E10", E10.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E11.ToString()) { diff.AppendFormat(fmt, "E11", E11.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E12.ToString()) { diff.AppendFormat(fmt, "E12", E12.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E13.ToString()) { diff.AppendFormat(fmt, "E13", E13.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E14.ToString()) { diff.AppendFormat(fmt, "E14", E14.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E15.ToString()) { diff.AppendFormat(fmt, "E15", E15.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E16.ToString()) { diff.AppendFormat(fmt, "E16", E16.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E21.ToString()) { diff.AppendFormat(fmt, "E21", E21.ToString(), ln); };
ln = inp.ReadLine(); if (ln != Delta_Q_pct.ToString(ci)) { diff.AppendFormat(fmt, "Delta_Q_pct", Delta_Q_pct.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Delta_T.ToString(ci)) { diff.AppendFormat(fmt, "Delta_T", Delta_T.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Delta_Tup_Tdn.ToString(ci)) { diff.AppendFormat(fmt, "Delta_Tup_Tdn", Delta_Tup_Tdn.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TestTime_min.ToString(ci)) { diff.AppendFormat(fmt, "TestTime_min", TestTime_min.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TestTime_max.ToString(ci)) { diff.AppendFormat(fmt, "TestTime_max", TestTime_max.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != AmbTemp_min.ToString(ci)) { diff.AppendFormat(fmt, "AmbTemp_min", AmbTemp_min.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != AmbTemp_max.ToString(ci)) { diff.AppendFormat(fmt, "AmbTemp_max", AmbTemp_max.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Coef_E9.ToString(ci)) { diff.AppendFormat(fmt, "Coef_E9", Coef_E9.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Coef_E10.ToString(ci)) { diff.AppendFormat(fmt, "Coef_E10", Coef_E10.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Coef_E11.ToString(ci)) { diff.AppendFormat(fmt, "Coef_E11", Coef_E11.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Coef_E12.ToString(ci)) { diff.AppendFormat(fmt, "Coef_E12", Coef_E12.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Offset_E9.ToString(ci)) { diff.AppendFormat(fmt, "Offset_E9", Offset_E9.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Offset_E12.ToString(ci)) { diff.AppendFormat(fmt, "Offset_E12", Offset_E12.ToString(ci), ln); };
return diff.ToString();
}
public override string ToString()
{
return string.Format("{0}", Name);
}
}
}
+38 -2
View File
@@ -86,12 +86,10 @@ namespace Config.Entities
result.LastChgUser = LastChgUser;
result.LastChgTime = LastChgTime;
result.LongDescription = LongDescription;
result.ProcedureState = ProcedureState;
result.Revision = Revision;
result.PredecessorId = Id;
result.ObtainedByCopy = ObtainedByCopy;
result.MetersKind = MetersKind;
result.Watermeters = Watermeters;
result.Protected = Protected;
@@ -102,6 +100,8 @@ namespace Config.Entities
result.ResultsWriter = ResultsWriter;
result.TransitionStart = TransitionStart;
result.TransitionEnd = TransitionEnd;
result.AltProcName = AltProcName;
result.AltProcPeriod = AltProcPeriod;
foreach (var prms in MoreParams) { result.MoreParams.Add(prms.Clone(result)); }
foreach (var test in Tests) { result.Tests.Add(test.Clone()); }
@@ -234,6 +234,42 @@ namespace Config.Entities
return null;
}
/// <summary>
/// Processes the selection done by the bench control panel in the main sequence.
/// </summary>
/// <param name="selection">Selection.Q1, .Q2, .Q3 or .Test</param>
/// <returns>The selected test or null</returns>
public virtual Test GetTest(string expandedTestName, out int testIx, out int repetNr)
{
for (int ix = 0; ix < Tests.Count; ix++)
{
Test test = Tests[ix];
if (test.Name.Equals(expandedTestName))
{
/// Name is not expanded => Repeats==1
testIx = ix;
repetNr = 1;
return test;
}
for (int r = 1; r <= test.Repeats; r++)
{
if (test.GetExpandedTestName(r).Equals(expandedTestName))
{
testIx = ix;
repetNr = r;
return test;
}
}
}
testIx = 0;
repetNr = 1;
return null;
}
public override string ToString()
{
return string.Format("{0}, rev.{1}", Name, Revision);
+143
View File
@@ -0,0 +1,143 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
namespace Config.Entities
{
/// <summary>
/// Stores one test procedure, supports revisions and history log
/// </summary>
public class Profile : IHasName, IHasItemNr
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string Description { get; set; } /// Short description
public virtual string CreationUser { get; set; } /// Name of the user who has created or changed this procedure
public virtual DateTime CreationTime { get; set; } /// Date and time of the creation or change
public virtual string LastChgUser { get; set; } /// Name of the user who has created or changed this procedure
public virtual DateTime LastChgTime { get; set; } /// Date and time of the creation or change
public virtual ProfileType ProfileType { get; set; }
public virtual ErrorLimitType ErrorLimitType { get; set; }
public virtual IList<PTest> Tests { get; set; }
/// ------------- Additional stuff not mapped into the database -------------
public Profile()
{
Tests = new List<PTest>();
///
/// Default values
///
CreationUser = (Users.GlobalData.CurrentUser != null) ? Users.GlobalData.CurrentUser.UserName : null;
CreationTime = DateTime.Now;
LastChgUser = CreationUser;
LastChgTime = CreationTime;
Description = string.Empty;
}
public Profile(string name, int itemNr)
: this()
{
Name = name;
ItemNr = itemNr;
}
public virtual Profile Clone()
{
Profile result = new Profile();
result.ItemNr = ItemNr;
result.Name = Name;
result.Description = Description;
result.CreationUser = CreationUser;
result.CreationTime = CreationTime;
result.LastChgUser = LastChgUser;
result.LastChgTime = LastChgTime;
result.ProfileType = ProfileType;
result.ErrorLimitType = ErrorLimitType;
foreach (var test in Tests) { result.Tests.Add(test.Clone()); }
return result;
}
public virtual void Export(StreamWriter output)
{
output.WriteLine(ItemNr.ToString(CultureInfo.InvariantCulture));
output.WriteLine(Name);
output.WriteLine(Description);
output.WriteLine(CreationUser);
output.WriteLine(CreationTime.ToString(CultureInfo.InvariantCulture));
output.WriteLine(LastChgUser);
output.WriteLine(LastChgTime.ToString(CultureInfo.InvariantCulture));
foreach (var test in Tests) { test.Export(output); }
output.WriteLine();
output.Close();
}
public static Profile Import(StreamReader input)
{
Profile result = new Profile();
result.ItemNr = int.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
result.Name = input.ReadLine();
result.Description = input.ReadLine();
result.CreationUser = input.ReadLine();
result.CreationTime = DateTime.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
result.LastChgUser = input.ReadLine();
result.LastChgTime = DateTime.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
string line = input.ReadLine();
while (true)
{
PTest tst = PTest.Import(input, result);
if (tst == null)
break;
else
result.Tests.Add(tst);
}
return result;
}
public virtual string Compare(StreamReader inp)
{
System.Text.StringBuilder diff = new System.Text.StringBuilder();
const string fmt = "{0} = {1}\r\n (in the file {2})\r\n";
string ln;
ln = inp.ReadLine(); /// skip ItemNr
ln = inp.ReadLine(); if (ln != Name) { diff.AppendFormat(fmt, "Name", Name, ln); };
ln = inp.ReadLine(); if (ln != Description) { diff.AppendFormat(fmt, "Description", Description, ln); };
ln = inp.ReadLine(); /// skip CreationUser
ln = inp.ReadLine(); /// skip CreationTime
ln = inp.ReadLine(); /// skip LastChgUser
ln = inp.ReadLine(); /// skip LastChgTime
//foreach (var test in Tests)
//{
// string testDiff = test.Compare(inp);
// if (testDiff.Contains(
//}
//bool extraTestsInFile = true;
//while (Test.Import(inp, null) != null) { extraTestsInFile = true; }
return diff.ToString();
}
public override string ToString()
{
return string.Format("{0}", Name);
}
}
}
+56 -20
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -18,9 +18,11 @@ namespace Config.Entities
public virtual string Name { get; set; }
public virtual int Part { get; set; } /// Part=0 ... test of all WM-s
/// Part>0 ... part of a set of tests with the same Name: subset of WM-s is given by MetersPath
public virtual sbyte Publish { get; set; } /// 0=no, 1=in all protocols, 2=on screen, 3=internal
public virtual bool DoEvaluate { get; set; }
public virtual float Qfrom { get; set; } /// Water flow low limit in [m3/h]
public virtual TestProfile Profile { get; set; } /// UserDefined, Protected, UserDefinedHeatMeter, ProtectedHeatMeter
public virtual sbyte Publish { get; set; } /// 0=no, 1=in all protocols, 2=on screen, 3=internal
public virtual bool DoEvaluate { get; set; }
public virtual float Qtg { get; set; } /// Target water flow [m3/h]
public virtual float Qfrom { get; set; } /// Water flow low limit in [m3/h]
public virtual float Qto { get; set; } /// Water flow high limit in [m3/h]
public virtual float Volume { get; set; } /// Test volume (target) in [l]
public virtual float TstTime { get; set; } /// Test time (estimate) in [s]
@@ -30,7 +32,7 @@ namespace Config.Entities
public virtual float Uncertainty { get; set; } /// int [%] makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
public virtual int Repeats { get; set; }
public virtual bool DoDraining { get; set; }
public virtual bool DoZeroing { get; set; }
public virtual bool DoDrainingAfter { get; set; }
public virtual bool DoControlWaterTemp { get; set; }
public virtual float TempLimLo { get; set; } /// Lower limit for the controlled temperature
public virtual float TempLimHi { get; set; } /// Upper limit for the controlled temperature
@@ -43,7 +45,7 @@ namespace Config.Entities
public virtual int TimePump2StartV { get; set; } /// Delay time from the start of the pump to opening the start valve in [s]
public virtual int TimeStop2Mass { get; set; } /// Delay time from the test end (diverted) to the 2nd mass measuremen in [s]
public virtual double TolerRed { get; set; } /// = Filter
public virtual TestRedType RedType { get; set; }
public virtual string RedType { get; set; }
public virtual string FeedingPath { get; set; }
public virtual string BenchPath { get; set; }
public virtual string OutputPath { get; set; }
@@ -53,7 +55,6 @@ namespace Config.Entities
#endif
public virtual string RelTransBefore { get; set; }
public virtual string RelTransBetween { get; set; }
public virtual string RelTransAfter { get; set; }
public virtual string TransitionAfter { get; set; }
public virtual bool IsOuterLoopStart { get; set; } /// Not mapped to database
@@ -72,11 +73,13 @@ namespace Config.Entities
///
/// Default values
///
Publish = (sbyte)Config.Entities.Publish.Always;
Part = 0;
Profile = TestProfile.UserDefined;
Publish = (sbyte)Config.Entities.Publish.Always;
DoEvaluate = true;
Repeats = 1;
DoDraining = false;
DoZeroing = false;
DoDrainingAfter = false;
DoControlWaterTemp = false;
TempLimLo = 15.0f;
TempLimHi = 25.0f;
@@ -94,7 +97,6 @@ namespace Config.Entities
TolerRed = 0; /// = Filter parameter
RelTransBefore = string.Empty;
RelTransBetween = string.Empty;
RelTransAfter = string.Empty;
TransitionAfter = string.Empty;
}
@@ -112,8 +114,10 @@ namespace Config.Entities
Test result = new Test(Name, ItemNr, Procedure);
result.Part = Part;
result.Publish = Publish;
result.Profile = Profile;
result.Publish = Publish;
result.DoEvaluate = DoEvaluate;
result.Qtg = Qtg;
result.Qfrom = Qfrom;
result.Qto = Qto;
result.Volume = Volume;
@@ -124,7 +128,7 @@ namespace Config.Entities
result.Uncertainty = Uncertainty;
result.Repeats = Repeats;
result.DoDraining = DoDraining;
result.DoZeroing = DoZeroing;
result.DoDrainingAfter = DoDrainingAfter;
result.DoControlWaterTemp = DoControlWaterTemp;
result.TempLimLo = TempLimLo;
result.TempLimHi = TempLimHi;
@@ -147,7 +151,6 @@ namespace Config.Entities
#endif
result.RelTransBefore = RelTransBefore;
result.RelTransBetween = RelTransBetween;
result.RelTransAfter = RelTransAfter;
result.TransitionAfter = TransitionAfter;
foreach (var prms in MoreParams) { result.MoreParams.Add(prms.Clone()); }
@@ -162,6 +165,7 @@ namespace Config.Entities
output.WriteLine(Part.ToString(ci));
output.WriteLine(Publish.ToString(ci));
output.WriteLine(DoEvaluate.ToString());
output.WriteLine(Qtg.ToString(ci));
output.WriteLine(Qfrom.ToString(ci));
output.WriteLine(Qto.ToString(ci));
output.WriteLine(Volume.ToString(ci));
@@ -172,7 +176,7 @@ namespace Config.Entities
output.WriteLine(Uncertainty.ToString(ci));
output.WriteLine(Repeats.ToString(ci));
output.WriteLine(DoDraining.ToString());
output.WriteLine(DoZeroing.ToString());
output.WriteLine(DoDrainingAfter.ToString());
output.WriteLine(DoControlWaterTemp.ToString());
output.WriteLine(TempLimLo.ToString(ci));
output.WriteLine(TempLimHi.ToString(ci));
@@ -190,7 +194,7 @@ namespace Config.Entities
output.WriteLine(MetersPath);
output.WriteLine(RelTransBefore);
output.WriteLine(RelTransBetween);
output.WriteLine(RelTransAfter);
output.WriteLine(Profile);
output.WriteLine(TransitionAfter);
foreach (var prms in MoreParams) { prms.Export(output); }
@@ -212,7 +216,8 @@ namespace Config.Entities
tst.Part = int.Parse(input.ReadLine(), ci);
tst.Publish = sbyte.Parse(input.ReadLine(), ci);
tst.DoEvaluate = bool.Parse(input.ReadLine());
tst.Qfrom = float.Parse(input.ReadLine(), ci);
tst.Qtg = float.Parse(input.ReadLine(), ci);
tst.Qfrom = float.Parse(input.ReadLine(), ci);
tst.Qto = float.Parse(input.ReadLine(), ci);
tst.Volume = float.Parse(input.ReadLine(), ci);
tst.TstTime = float.Parse(input.ReadLine(), ci);
@@ -222,7 +227,7 @@ namespace Config.Entities
tst.Uncertainty = float.Parse(input.ReadLine(), ci);
tst.Repeats = int.Parse(input.ReadLine(), ci);
tst.DoDraining = bool.Parse(input.ReadLine());
tst.DoZeroing = bool.Parse(input.ReadLine());
tst.DoDrainingAfter = bool.Parse(input.ReadLine());
tst.DoControlWaterTemp = bool.Parse(input.ReadLine());
tst.TempLimLo = float.Parse(input.ReadLine(), ci);
tst.TempLimHi = float.Parse(input.ReadLine(), ci);
@@ -240,7 +245,10 @@ namespace Config.Entities
tst.MetersPath = input.ReadLine();
tst.RelTransBefore = input.ReadLine();
tst.RelTransBetween = input.ReadLine();
tst.RelTransAfter = input.ReadLine();
string line = input.ReadLine();
tst.Profile = line.Equals(TestProfile.ProtectedHeatMeter.ToString()) ? TestProfile.ProtectedHeatMeter
: line.Equals(TestProfile.UserDefinedHeatMeter.ToString()) ? TestProfile.UserDefinedHeatMeter
: line.Equals(TestProfile.Protected.ToString()) ? TestProfile.Protected : TestProfile.UserDefined; /// UserDefined is the default
tst.TransitionAfter = input.ReadLine();
while (true)
@@ -270,6 +278,7 @@ namespace Config.Entities
ln = inp.ReadLine(); if (ln != Part.ToString(ci)) { diff.AppendFormat(fmt, "Part", Part.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Publish.ToString(ci)) { diff.AppendFormat(fmt, "Publish", Publish.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoEvaluate.ToString(ci)) { diff.AppendFormat(fmt, "Evaluate", DoEvaluate.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Qtg.ToString(ci)) { diff.AppendFormat(fmt, "Qtg", Qtg.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Qfrom.ToString(ci)) { diff.AppendFormat(fmt, "Qfrom", Qfrom.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Qto.ToString(ci)) { diff.AppendFormat(fmt, "Qto", Qto.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Volume.ToString(ci)) { diff.AppendFormat(fmt, "Volume", Volume.ToString(ci), ln); };
@@ -280,7 +289,7 @@ namespace Config.Entities
ln = inp.ReadLine(); if (ln != Uncertainty.ToString(ci)) { diff.AppendFormat(fmt, "Uncertainty", Uncertainty.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Repeats.ToString(ci)) { diff.AppendFormat(fmt, "Repeats", Repeats.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoDraining.ToString(ci)) { diff.AppendFormat(fmt, "Draining", DoDraining.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoZeroing.ToString(ci)) { diff.AppendFormat(fmt, "Zeroing", DoZeroing.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoDrainingAfter.ToString(ci)) { diff.AppendFormat(fmt, "Zeroing", DoDrainingAfter.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoControlWaterTemp.ToString()) { diff.AppendFormat(fmt, "DoControlWaterTemp", DoControlWaterTemp.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TempLimLo.ToString(ci)) { diff.AppendFormat(fmt, "TempLimLo", TempLimLo.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TempLimHi.ToString(ci)) { diff.AppendFormat(fmt, "TempLimHi", TempLimHi.ToString(ci), ln); };
@@ -298,7 +307,7 @@ namespace Config.Entities
ln = inp.ReadLine(); if (ln != MetersPath) { diff.AppendFormat(fmt, "MetersPath", MetersPath, ln); };
ln = inp.ReadLine(); if (ln != RelTransBefore) { diff.AppendFormat(fmt, "RelTransBefore", RelTransBefore, ln); };
ln = inp.ReadLine(); if (ln != RelTransBetween) { diff.AppendFormat(fmt, "RelTransBetween", RelTransBetween, ln); };
ln = inp.ReadLine(); if (ln != RelTransAfter) { diff.AppendFormat(fmt, "RelTransAfter", RelTransAfter, ln); };
ln = inp.ReadLine(); if (ln != Profile.ToString()) { diff.AppendFormat(fmt, "RelTransAfter", Profile, ln); };
ln = inp.ReadLine(); if (ln != TransitionAfter) { diff.AppendFormat(fmt, "TransitionAfter", TransitionAfter, ln); };
return diff.ToString();
@@ -313,6 +322,33 @@ namespace Config.Entities
return null;
}
/// <summary>
/// Return test title for a this test and a given repetition number
/// </summary>
/// <param name="repetitonNr">1 .. Nr. repetitions</param>
/// <returns>Test title (string)</returns>
public virtual string GetExpandedTestName(int repetitionNr)
{
if (Repeats == 1)
{
if (Part == 0)
{
/// Single test
return Name;
}
else
{
/// A part of a single test
return string.Format("{0} ({1})", Name, Part);
}
}
else
{
/// More test repetitions
return string.Format("{0} ({1}/{2})", Name, repetitionNr, Repeats);
}
}
public virtual double GetErrLimLo(double volumeCTV, double testTime)
{
if (ErrLimLo <= ErrLimHi)
+1
View File
@@ -16,6 +16,7 @@ namespace Config.Entities
public virtual string Password { get; set; }
public virtual string Password2 { get; set; }
public virtual string Password3 { get; set; }
public virtual string Password4 { get; set; }
public virtual DateTime LastPwChange { get; set; }
public virtual IList<Group> Groups { get; set; } //User can be a member of a list of groups
+7 -7
View File
@@ -147,13 +147,13 @@ namespace Config
///
/// Prepare all groups
///
var testers = new Config.Entities.Group((int)Users.Grp.GID.Testers, Strings.Tester);
var testingSpecialists = new Config.Entities.Group((int)Users.Grp.GID.TestingSpecialists, Strings.Testing_Specialist);
var headOfLab = new Config.Entities.Group((int)Users.Grp.GID.HeadOfLab, Strings.Head_of_Lab);
var maintenanceSpecialists = new Config.Entities.Group((int)Users.Grp.GID.MaintenanceSpecialists, Strings.Maintenance_Specialist);
var metrologists = new Config.Entities.Group((int)Users.Grp.GID.Metrologists, Strings.Metrologist);
var calibrationSpecialists = new Config.Entities.Group((int)Users.Grp.GID.CalibrationSpecialists, Strings.Calibration_Specialist);
var administrators = new Config.Entities.Group((int)Users.Grp.GID.Administrators, Strings.Administrator);
var testers = new Config.Entities.Group(Users.Entities.GID.Testers);
var testingSpecialists = new Config.Entities.Group(Users.Entities.GID.TestingSpecialists);
var headOfLab = new Config.Entities.Group(Users.Entities.GID.HeadOfLab);
var maintenanceSpecialists = new Config.Entities.Group(Users.Entities.GID.MaintenanceSpecialists);
var metrologists = new Config.Entities.Group(Users.Entities.GID.Metrologists);
var calibrationSpecialists = new Config.Entities.Group(Users.Entities.GID.CalibrationSpecialists);
var administrators = new Config.Entities.Group(Users.Entities.GID.Administrators);
/// Create the user 'admin' add his groups
var admin = new Config.Entities.User
+20 -17
View File
@@ -11,14 +11,23 @@ namespace Config
{
private static readonly ILog log = LogManager.GetLogger(typeof(Formulas));
///
/// Tables to calculate specific enthalpy
///
private static readonly int[] Ii;
private static readonly int[] Ji;
private static readonly double[] ni;
private static readonly double[] Di;
///
/// Wrappers
///
public static double RealDensity() { return Data.RealDensity; }
public static double AtTemperature() { return Data.AtTemperature; }
public static double Buoyancy() { return Data.Buoyancy; }
/// Private tables with coeficients to calculate specific enthalpy
static readonly int[] Ii;
static readonly int[] Ji;
static readonly double[] ni;
/// Private table with coeficients to calculate temperature of a platinum thermometer
static readonly double[] Di;
/// <summary>
/// Constructor
@@ -153,9 +162,9 @@ namespace Config
/// </summary>
/// <param name="t">Temperature in [°C]</param>
/// <returns>Density in [kg/m3]</returns>
public static double WaterDensityFromTemp(double t, double realDensity, double atTemperature)
public static double WaterDensityFromTemp(double t)
{
return DistilledWaterDensityFromTemp(t) + DensityCorrection(realDensity, atTemperature);
return DistilledWaterDensityFromTemp(t) + DensityCorrection(RealDensity(), AtTemperature());
}
/// <summary>
@@ -163,7 +172,7 @@ namespace Config
/// </summary>
/// <param name="t">Temperature in [°C]</param>
/// <returns>Density in [kg/m3]</returns>
public static double WaterDensityFromTempPress(double temp, double pressure, double realDensity, double atTemperature)
public static double WaterDensityFromTempPress(double temp, double pressure)
{
double x0 = 5.08821E-10;
double x1 = 1.2639418;
@@ -173,7 +182,7 @@ namespace Config
double theta = temp / 100.0;
double B = x0 * (((x3 * theta + x2) * theta + x1) * theta + 1) / (1 + x4 * theta);
return WaterDensityFromTemp(temp, realDensity, atTemperature) * (1 + B * Config.Units.ConvertTo(Config.Unit.Pa, pressure));
return WaterDensityFromTemp(temp) * (1 + B * Config.Units.ConvertTo(Config.Unit.Pa, pressure));
}
@@ -394,11 +403,5 @@ namespace Config
return (-(R0 * A) + Math.Sqrt(R0 * R0 * A * A - 4 * R0 * B * (R0 - R))) / (2 * R0 * B);
}
public static double Buoyancy()
{
return 1.00103;
}
}
}
+2 -3
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
@@ -10,8 +10,7 @@ namespace Config.Mappings
public GroupMap()
{
Id(x => x.Id);
Map(x => x.Gid);
Map(x => x.Name);
Map(x => x.GID).Column("Name"); ;
}
}
}
+58
View File
@@ -0,0 +1,58 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
using Config.Entities;
namespace Config.Mappings
{
class PTestMap : ClassMap<PTest>
{
public PTestMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.Part);
Map(x => x.CoefQfrom);
Map(x => x.CoefQto);
Map(x => x.ErrLimLo);
Map(x => x.ErrLimHi);
Map(x => x.TempLimLo);
Map(x => x.TempLimHi);
Map(x => x.PressLimLo);
Map(x => x.PressLimHi);
Map(x => x.E1);
Map(x => x.E2);
Map(x => x.E3);
Map(x => x.E4);
Map(x => x.E5);
Map(x => x.E6);
Map(x => x.E7);
Map(x => x.E8);
Map(x => x.E9);
Map(x => x.E10);
Map(x => x.E11);
Map(x => x.E12);
Map(x => x.E13);
Map(x => x.E14);
Map(x => x.E15);
Map(x => x.E16);
Map(x => x.E21);
Map(x => x.Delta_Q_pct);
Map(x => x.Delta_T);
Map(x => x.Delta_Tup_Tdn);
Map(x => x.TestTime_min);
Map(x => x.TestTime_max);
Map(x => x.AmbTemp_min);
Map(x => x.AmbTemp_max);
Map(x => x.Coef_E9);
Map(x => x.Coef_E10);
Map(x => x.Coef_E11);
Map(x => x.Coef_E12);
Map(x => x.Offset_E9);
Map(x => x.Offset_E12);
References(x => x.Profile);
}
}
}
+28
View File
@@ -0,0 +1,28 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
using Config.Entities;
namespace Config.Mappings
{
class ProfileMap : ClassMap<Profile>
{
public ProfileMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.Description);
Map(x => x.CreationUser);
Map(x => x.CreationTime);
Map(x => x.LastChgUser);
Map(x => x.LastChgTime);
Map(x => x.ProfileType);
Map(x => x.ErrorLimitType);
HasMany(x => x.Tests)
.OrderBy("ItemNr")
.Cascade.All();
}
}
}
+16 -9
View File
@@ -14,17 +14,21 @@ namespace Config.Mappings
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.Part);
Map(x => x.Publish);
Map(x => x.Profile);
Map(x => x.Publish);
Map(x => x.DoEvaluate)
.Column("Evaluate");
Map(x => x.Qfrom);
#if TEST_PROFILES
Map(x => x.Qtg);
#endif
Map(x => x.Qfrom);
Map(x => x.Qto);
Map(x => x.Volume);
Map(x => x.TstTime);
Map(x => x.Repeats);
Map(x => x.DoDraining)
.Column("Emptying");
Map(x => x.DoZeroing)
Map(x => x.DoDrainingAfter)
.Column("Zeroing");
Map(x => x.DoControlWaterTemp);
Map(x => x.TempLimLo);
@@ -45,7 +49,7 @@ namespace Config.Mappings
Map(x => x.Uncertainty);
Map(x => x.TolerRed)
.Column("TolerRed"); /// ???
Map(x => x.RedType); /// ???
Map(x => x.RedType);
Map(x => x.FeedingPath);
Map(x => x.BenchPath);
Map(x => x.OutputPath);
@@ -53,11 +57,14 @@ namespace Config.Mappings
#if HEAT_METERS
Map(x => x.HeatMetersPath);
#endif
Map(x => x.RelTransBefore);
Map(x => x.RelTransBetween);
Map(x => x.RelTransAfter);
Map(x => x.TransitionAfter);
HasMany(x => x.MoreParams)
Map(x => x.RelTransBefore)
.Column("RelTransBefore");
Map(x => x.RelTransBetween)
.Column("RelTransBetween");
Map(x => x.TransitionAfter)
.Column("TransitionAfter");
HasMany(x => x.MoreParams)
.Cascade.All();
References(x => x.Procedure);
}
+1 -2
View File
@@ -12,12 +12,11 @@ namespace Config.Mappings
Id(x => x.Id);
Map(x => x.UserName).Column("Name");
Map(x => x.Number);
#if TURA_IPERL || TURA_IPERL_NEW || TURA_SPECIAL
Map(x => x.Tag);
#endif
Map(x => x.Password);
Map(x => x.Password2);
Map(x => x.Password3);
Map(x => x.Password4);
Map(x => x.FullName).Column("Description");
Map(x => x.LastPwChange);
HasMany(x => x.Groups)
+2 -2
View File
@@ -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.24.1315.0")]
[assembly: AssemblyFileVersion("2.24.1315.0")]
[assembly: AssemblyVersion("2.24.1382.0")]
[assembly: AssemblyFileVersion("2.24.1382.0")]
-21
View File
@@ -117,27 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Administrator" xml:space="preserve">
<value>Administrator</value>
</data>
<data name="Calibration_Specialist" xml:space="preserve">
<value>Kalibriertechniker</value>
</data>
<data name="Head_of_Lab" xml:space="preserve">
<value>Laborleiter</value>
</data>
<data name="Maintenance_Specialist" xml:space="preserve">
<value>Wartungstechniker</value>
</data>
<data name="Metrologist" xml:space="preserve">
<value>Messtechniker</value>
</data>
<data name="Tester" xml:space="preserve">
<value>Prüfer</value>
</data>
<data name="Testing_Specialist" xml:space="preserve">
<value>Prüftechniker</value>
</data>
<data name="Failed" xml:space="preserve">
<value>NiO</value>
</data>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
@@ -117,70 +117,16 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="startTestBtn.Text" xml:space="preserve">
<value>Start testu</value>
<data name="Failed" xml:space="preserve">
<value>Échoué</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Wyniki</value>
<data name="Passed" xml:space="preserve">
<value>Passé</value>
</data>
<data name="otherGroupBox.Text" xml:space="preserve">
<value>Wspomagający</value>
<data name="Cannot_open_DB_Cause_0" xml:space="preserve">
<value>Impossible d'ouvrir la base de données Cause\\r\\n{0}</value>
</data>
<data name="cameraTestBtn.Text" xml:space="preserve">
<value>Test kamery</value>
</data>
<data name="resetResultsBtn.Text" xml:space="preserve">
<value>Zrzut</value>
</data>
<data name="purgeEndBtn.Text" xml:space="preserve">
<value>Koniec</value>
</data>
<data name="emptyTank1Btn.Text" xml:space="preserve">
<value>W1</value>
</data>
<data name="purgeBeginBtn.Text" xml:space="preserve">
<value>Początek</value>
</data>
<data name="startQ3Btn.Text" xml:space="preserve">
<value>Q3</value>
</data>
<data name="emptyTank2Btn.Text" xml:space="preserve">
<value>W2</value>
</data>
<data name="startQ1Btn.Text" xml:space="preserve">
<value>Q1</value>
</data>
<data name="startCycleBtn.Text" xml:space="preserve">
<value>Start cyklu</value>
</data>
<data name="purgeGroupBox.Text" xml:space="preserve">
<value>Usunąć</value>
</data>
<data name="emptyGroupBox.Text" xml:space="preserve">
<value>Pusty</value>
</data>
<data name="nextButton.Text" xml:space="preserve">
<value>Następny</value>
</data>
<data name="testGroupBox.Text" xml:space="preserve">
<value>Test</value>
</data>
<data name="startQ2Btn.Text" xml:space="preserve">
<value>Q2</value>
</data>
<data name="acceptResultsBtn.Text" xml:space="preserve">
<value>Akceptuj</value>
</data>
<data name="emptyTank3Btn.Text" xml:space="preserve">
<value>W3</value>
</data>
<data name="stopBtn.Text" xml:space="preserve">
<value>Stop</value>
</data>
<data name="breakBtn.Text" xml:space="preserve">
<value>Przerwać</value>
</data>
<data name="sensitivityTestBtn.Text" xml:space="preserve">
<value>Czułość</value>
<data name="Error" xml:space="preserve">
<value>Erreur</value>
</data>
</root>
-21
View File
@@ -117,27 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Administrator" xml:space="preserve">
<value>Amministratore</value>
</data>
<data name="Calibration_Specialist" xml:space="preserve">
<value>esperto in calibrazione</value>
</data>
<data name="Head_of_Lab" xml:space="preserve">
<value>capo di laboratorio</value>
</data>
<data name="Maintenance_Specialist" xml:space="preserve">
<value>esperto di manutenzione</value>
</data>
<data name="Metrologist" xml:space="preserve">
<value>metrologo</value>
</data>
<data name="Tester" xml:space="preserve">
<value>tester</value>
</data>
<data name="Testing_Specialist" xml:space="preserve">
<value>esperto di prove </value>
</data>
<data name="Failed" xml:space="preserve">
<value>NOK</value>
</data>
-21
View File
@@ -117,27 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Administrator" xml:space="preserve">
<value>Administrator</value>
</data>
<data name="Calibration_Specialist" xml:space="preserve">
<value>Specjalista ds. kalibracji</value>
</data>
<data name="Head_of_Lab" xml:space="preserve">
<value>Kierownik Laboratorium</value>
</data>
<data name="Maintenance_Specialist" xml:space="preserve">
<value>Konserwator</value>
</data>
<data name="Metrologist" xml:space="preserve">
<value>Metrolog</value>
</data>
<data name="Tester" xml:space="preserve">
<value>Pracownik przeprowadzający testy</value>
</data>
<data name="Testing_Specialist" xml:space="preserve">
<value>Specjalista ds. testów</value>
</data>
<data name="Failed" xml:space="preserve">
<value>Niepowodzenie</value>
</data>
-21
View File
@@ -117,27 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Administrator" xml:space="preserve">
<value>Administrator</value>
</data>
<data name="Calibration_Specialist" xml:space="preserve">
<value>Calibration Specialist</value>
</data>
<data name="Head_of_Lab" xml:space="preserve">
<value>Head of Lab</value>
</data>
<data name="Maintenance_Specialist" xml:space="preserve">
<value>Maintenance Specialist</value>
</data>
<data name="Metrologist" xml:space="preserve">
<value>Metrologist</value>
</data>
<data name="Tester" xml:space="preserve">
<value>Tester</value>
</data>
<data name="Testing_Specialist" xml:space="preserve">
<value>Testing Specialist</value>
</data>
<data name="Failed" xml:space="preserve">
<value>NOK</value>
</data>
-21
View File
@@ -117,27 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Administrator" xml:space="preserve">
<value>Администратор</value>
</data>
<data name="Calibration_Specialist" xml:space="preserve">
<value>Специалист по калибровке</value>
</data>
<data name="Head_of_Lab" xml:space="preserve">
<value>Руководитель лаборатории</value>
</data>
<data name="Maintenance_Specialist" xml:space="preserve">
<value>Специалист по техобслуживанию</value>
</data>
<data name="Metrologist" xml:space="preserve">
<value>Метролог</value>
</data>
<data name="Tester" xml:space="preserve">
<value>Контролер</value>
</data>
<data name="Testing_Specialist" xml:space="preserve">
<value>Специалист по тестированию</value>
</data>
<data name="Failed" xml:space="preserve">
<value>NOK</value>
</data>
+125 -124
View File
@@ -1,128 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Administrator" xml:space="preserve">
<value>管理员</value>
</data>
<data name="Calibration_Specialist" xml:space="preserve">
<value>校准专员</value>
</data>
<data name="Failed" xml:space="preserve">
<value>NOK</value>
</data>
<data name="Head_of_Lab" xml:space="preserve">
<value>实验室负责人</value>
</data>
<data name="Maintenance_Specialist" xml:space="preserve">
<value>维护专员</value>
</data>
<data name="Metrologist" xml:space="preserve">
<value>计量者</value>
</data>
<data name="Passed" xml:space="preserve">
<value>好</value>
</data>
<data name="Tester" xml:space="preserve">
<value>测试仪</value>
</data>
<data name="Testing_Specialist" xml:space="preserve">
<value>测试专员</value>
</data>
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Error" xml:space="preserve">
<value>错误 Error</value>
</data>
<data name="Failed" xml:space="preserve">
<value>NOK</value>
</data>
<data name="Passed" xml:space="preserve">
<value>好</value>
</data>
</root>
+114
View File
@@ -138,5 +138,119 @@ namespace Config
/// pattern NOT found
return string.Empty;
}
/// <summary>
/// Get either Q1 or Qmin flow for a given Qn and metrological class
/// </summary>
/// <param name="Qn">Nominal flow in m3/h</param>
/// <param name="metroClass">Metrological class ("A" ,"B", "C" or "R#")</param>
/// <param name="medium">NotSpecified, ColdWater or HotWater</param>
/// <param name="Qdflt">Default flow when metrologic does not match pattern</param>
/// <returns>Q1 or Qmin flow in m3/h</returns>
public static double GetQ1Qmin(double Qn, string metroClass, Entities.Medium medium = Entities.Medium.ColdWater, double Qdflt = 0)
{
if (string.IsNullOrEmpty(metroClass)) return Qdflt;
int metroClassRatio;
if ((metroClass[0] == 'R') && int.TryParse(metroClass.Substring(1), out metroClassRatio) && (metroClassRatio > 0))
{
return Qn / (double)metroClassRatio;
}
else
{
if (medium == Entities.Medium.HotWater)
{
switch (metroClass)
{
case "A": return (Qn < 15) ? (0.04 * Qn) : (0.08 * Qn);
case "B": return (Qn < 15) ? (0.02 * Qn) : (0.04 * Qn);
case "C": return (Qn < 15) ? (0.01 * Qn) : (0.02 * Qn);
case "D": return (Qn < 15) ? (0.01 * Qn) : Qdflt;
default: break;
}
}
else
{
switch (metroClass)
{
case "A": return (Qn < 15) ? (0.04 * Qn) : (0.08 * Qn);
case "B": return (Qn < 15) ? (0.02 * Qn) : (0.03 * Qn);
case "C": return (Qn < 15) ? (0.01 * Qn) : (0.006 * Qn);
default: break;
}
}
}
return Qdflt;
}
/// <summary>
/// Get either Q2 or Qt flow for a given Qn and metrological class
/// </summary>
/// <param name="Qn">Nominal flow in m3/h</param>
/// <param name="metroClass">Metrological class ("A" ,"B", "C" or "R#")</param>
/// <param name="medium">NotSpecified, ColdWater or HotWater</param>
/// <param name="Qdflt">Default flow when metrologic does not match pattern</param>
/// <returns>Q2 or Qt flow in m3/h</returns>
public static double GetQ2Qt(double Qn, string metroClass, Entities.Medium medium = Entities.Medium.ColdWater, double Qdflt = 0)
{
if (string.IsNullOrEmpty(metroClass)) return Qdflt;
int metroClassRatio;
if ((metroClass[0] == 'R') && int.TryParse(metroClass.Substring(1), out metroClassRatio) && (metroClassRatio > 0))
{
return 1.6 * Qn / (double)metroClassRatio;
}
if (medium == Entities.Medium.HotWater)
{
switch (metroClass)
{
case "A": return (Qn < 15) ? (0.1 * Qn) : (0.2 * Qn);
case "B": return (Qn < 15) ? (0.08 * Qn) : (0.15 * Qn);
case "C": return (Qn < 15) ? (0.06 * Qn) : (0.1 * Qn);
case "D": return (Qn < 15) ? (0.015 * Qn) : Qdflt;
default: break;
}
}
else
{
switch (metroClass)
{
case "A": return (Qn < 15) ? (0.1 * Qn) : (0.3 * Qn);
case "B": return (Qn < 15) ? (0.08 * Qn) : (0.2 * Qn);
case "C": return (Qn < 15) ? (0.015 * Qn) : (0.015 * Qn);
default: break;
}
}
return Qdflt;
}
/// <summary>
/// Get either Q4 or Qmax flow for a given Qn and metrological class
/// </summary>
/// <param name="Qn">Nominal flow in m3/h</param>
/// <param name="metroClass">Metrological class ("A" ,"B", "C" or "R#")</param>
/// <param name="medium">NotSpecified, ColdWater or HotWater</param>
/// <param name="Qdflt">Default flow when metrologic does not match pattern</param>
/// <returns>Q4 or Qmax flow in m3/h</returns>
public static double GetQ4Qmax(double Qn, string metroClass, Entities.Medium medium = Entities.Medium.ColdWater, double Qdflt = 0)
{
if (string.IsNullOrEmpty(metroClass)) return Qdflt;
switch (metroClass[0])
{
case 'A':
case 'B':
case 'C':
case 'D':
return 2 * Qn;
case 'R':
return 1.25 * Qn;
default:
return Qdflt;
}
}
}
}
+11 -5
View File
@@ -130,13 +130,19 @@ namespace Results
public static BatchResults FromBatch(Batch batch)
{
int wmCount = batch.WaterMeters.Count;
if (wmCount == 0) return null;
if (batch.WaterMeters == null || batch.WaterMeters.Count == 0) return null;
BatchResults batchResults = new BatchResults(wmCount);
int wmPosMax = 0;
foreach (var wm in batch.WaterMeters) if (wm.WMPosition > wmPosMax) wmPosMax = wm.WMPosition;
BatchResults batchResults = new BatchResults(wmPosMax);
batchResults.Batch = batch;
batchResults.WaterMeters = new WaterMeter[wmCount];
for (int i = 0; i < wmCount; i++) batchResults.WaterMeters[i] = batch.WaterMeters[i];
batchResults.WaterMeters = new WaterMeter[wmPosMax];
for (int i = 0; i < batch.WaterMeters.Count; i++)
{
WaterMeter wm = batch.WaterMeters[i];
batchResults.WaterMeters[wm.WMPosition - 1] = wm;
}
return batchResults;
}
+5 -3
View File
@@ -25,7 +25,8 @@ namespace Results.Entities
/// Main result
public virtual double Error { get; set; } /// [%]
public virtual int ErrorIndicators { get; set; } /// Not mapped to DB !!!, bit24=E25, bit25=E26, bit26=E27, bit27=E28
public virtual long ErrorIndicators { get; set; } /// Not mapped to DB !!!, bit24=E25, bit25=E26, bit26=E27, bit27=E28 (error flags)
public virtual long InfoIndicators { get; set; } /// Not mapped to DB !!!, bit24=E25, bit25=E26, bit26=E27, bit27=E28 (info flags)
public virtual double KorrErrQ { get; set; } /// [%] not mapped to results DB, saved to Oracle DB
public virtual bool TestDone { get; set; } /// true = test was completed
public virtual bool Passed { get; set; } /// true = test passed, water meter is OK
@@ -50,14 +51,15 @@ namespace Results.Entities
public virtual TestData TestData() { return TestRslt.TestData; }
///
public virtual int Repeats() { return TestData().Repeats; }
public virtual double Qfrom() { return TestData().Qfrom; } /// [m3/h]
public virtual double Qtg() { return TestData().Qtg; } /// [m3/h]
public virtual double Qfrom() { return TestData().Qfrom; } /// [m3/h]
public virtual double Qto() { return TestData().Qto; } /// [m3/h]
public virtual double TargetVolume() { return TestData().TargetVolume; } /// [l]
public virtual double TargetTime() { return TestData().TargetTime; } /// [s]
public virtual string Method() { return TestData().Method; }
public virtual double ErrLimLo() { return TestData().ErrLimLo; } /// [%]
public virtual double ErrLimHi() { return TestData().ErrLimHi; } /// [%]
public virtual double Uncertainty() { return TestData().Uncertainty; } /// [%]
public virtual double Uncertainty() { return TestData().ErrLimMargin; } /// [%]
public virtual string ProcedureName() { return WaterMeter.Batch.ProcedureName; }
public virtual int BatchNr() { return WaterMeter.Batch.BatchNr; }
+9 -6
View File
@@ -15,14 +15,15 @@ namespace Results.Entities
public virtual int Id { get; protected set; }
public virtual string Name { get; set; }
public virtual int Repeats { get; set; }
public virtual double Qfrom { get; set; } /// [m3/h] flow range low limit
public virtual double Qtg { get; set; } /// [m3/h] flow range low limit
public virtual double Qfrom { get; set; } /// [m3/h] flow range low limit
public virtual double Qto { get; set; } /// [m3/h] flow range high limit
public virtual double TargetVolume { get; set; } /// [l] target test volume
public virtual double TargetTime { get; set; } /// [s] target test time
public virtual string Method { get; set; }
public virtual double ErrLimLo { get; set; } /// [%] usually < 0, in case of heat meters: 1=class1, 2=class2, 3=class3
public virtual double ErrLimHi { get; set; } /// [%] usually > 0, in case of heat meters: -Qn in m3/h
public virtual double Uncertainty { get; set; } /// [%] makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
public virtual double ErrLimMargin { get; set; } /// [%] makes error limits tighter: 0 <= ErrLimMargin <= abs(ErrLimXx)
public virtual bool DoControlWaterTemp { get; set; }
public virtual float TempLimLo { get; set; }
public virtual float TempLimHi { get; set; }
@@ -41,14 +42,15 @@ namespace Results.Entities
{
Name = test.Name;
Repeats = test.Repeats;
Qfrom = (double)test.Qfrom;
Qtg = (double)test.Qtg;
Qfrom = (double)test.Qfrom;
Qto = (double)test.Qto;
TargetVolume = (double)test.Volume;
TargetTime = (double)test.TstTime;
Method = test.Method;
ErrLimLo = (double)test.ErrLimLo;
ErrLimHi = (double)test.ErrLimHi;
Uncertainty = (double)test.Uncertainty;
ErrLimMargin = (double)test.Uncertainty;
DoControlWaterTemp = test.DoControlWaterTemp;
TempLimLo = test.TempLimLo;
TempLimHi = test.TempLimHi;
@@ -66,14 +68,15 @@ namespace Results.Entities
{
if (!Name.Equals(td.Name)) return false;
if (Repeats != td.Repeats) return false;
if (Qfrom != td.Qfrom) return false;
if (Qtg != td.Qtg) return false;
if (Qfrom != td.Qfrom) return false;
if (Qto != td.Qto) return false;
if (TargetVolume != td.TargetVolume) return false;
if (TargetTime != td.TargetTime) return false;
if (!Method.Equals(td.Method)) return false;
if (ErrLimLo != td.ErrLimLo) return false;
if (ErrLimHi != td.ErrLimHi) return false;
if (Uncertainty != td.Uncertainty) return false;
if (ErrLimMargin != td.ErrLimMargin) return false;
if (DoControlWaterTemp != td.DoControlWaterTemp) return false;
if (DoControlWaterTemp)
{
+16 -16
View File
@@ -56,9 +56,9 @@ namespace Results.Entities
public virtual float DivEnd90 { get; set; } /// [s] Diverter switch time when test starts at level 90 (e.g. 90%) (not mapped to DB)
public virtual float DivEnd50 { get; set; } /// [s] Diverter switch time when test starts at level 50 (e.g. 50%) (not mapped to DB)
public virtual float DivEnd10 { get; set; } /// [s] Diverter switch time when test starts at level 10 (e.g. 10%) (not mapped to DB)
public virtual int ErrorFlags { get; set; } /// bitfield : bit0=E1, bit1=E2, bit2=E3, etc.
public virtual sbyte ErrorFlagsMd { get; set; } /// 0=off, 1=info, 2=on (evaluated in MeterTestRslt.Passed)
public virtual long ErrorFlags { get; set; } /// bitfield : bit0=E1, bit1=E2, bit2=E3, etc.
public virtual long InfoFlags { get; set; } /// bitfield : bit0=E1, bit1=E2, bit2=E3, etc.
/// Main results of heat meters
public virtual double RefEnergy { get; set; } /// [J] Joul
@@ -115,6 +115,12 @@ namespace Results.Entities
public virtual float FlowMin { get; set; } /// [m3/h]
public virtual float FlowMax { get; set; } /// [m3/h]
public virtual float Uncertnt { get; set; } /// [%] Relative error uncertainty
public virtual float UncertntScale { get; set; } /// [%] Contribution to uncertainty from scale
public virtual float UncertntDensity { get; set; } /// [%] Contribution to uncertainty from density
public virtual float UncertntTemp { get; set; } /// [%] Contribution to uncertainty from temperature
public virtual float UncertntPressure { get; set; } /// [%] Contribution to uncertainty from pressure
public virtual float Custom1 { get; set; } /// [°C] T ref hi mean
public virtual float Custom2 { get; set; } /// [°C] T ref hi start
public virtual float Custom3 { get; set; } /// [°C] T ref hi end
@@ -125,7 +131,7 @@ namespace Results.Entities
public virtual float Custom8 { get; set; } /// [°C] T ref lo end
public virtual float Custom9 { get; set; } /// [°C] T ref lo min
public virtual float Custom10 { get; set; } /// [°C] T ref lo max
/// Wrappers
public virtual string Name() { return Utils.GetTestName(TestData.Name, TestData.Repeats, RepetitionNr); }
public virtual int Repeats() { return TestData.Repeats; }
@@ -135,8 +141,8 @@ namespace Results.Entities
public virtual double TargetTime() { return TestData.TargetTime; }
public virtual string Method() { return TestData.Method; }
public virtual string RefFlowmeter() { return (Components != null) ? Components.Flowmeter : string.Empty; }
public virtual bool IsRelErrTest() { return (MethodClass != null) ? (MethodClass.Contains("FixedStart") || MethodClass.Contains("FlyingStart") || MethodClass.Contains("CombinedWithDetection") || MethodClass.Contains("DiverterTest")) : true; }
public virtual bool IsPMaxTest() { return (MethodClass != null) ? (MethodClass.Contains("PMaxTest") || MethodClass.Contains("LeakTest")) : true; }
public virtual bool IsRelErrTest() { return (MethodClass != null) ? (MethodClass.Contains("FixedStart") || MethodClass.Contains("FlyingStart") || MethodClass.Contains("CombinedWithDetection") || MethodClass.Contains("DiverterTest") || MethodClass.Contains("ManualEntry")) : true; }
public virtual bool IsPMaxTest() { return (MethodClass != null) ? (MethodClass.Contains("PMaxTest") || MethodClass.Contains("LeakTest") || TestData.Method.ToLower().Contains("pmax")) : true; }
public virtual bool IsStartStop() { return (MethodClass != null) ? MethodClass.Contains("FixedStart") : true; }
public virtual bool IsDiverter() { return (MethodClass != null) ? ((MethodClass.Contains("FlyingStart") && MethodClass.Contains("MassColl")) || MethodClass.Contains("DiverterTest")) : true; }
public virtual bool IsVolumeMethod() { return (MethodClass != null) ? (MethodClass.Contains("TestMethods.FixedStart.") || MethodClass.Contains("TestMethods.FlyingStart.")) : false; }
@@ -202,7 +208,7 @@ namespace Results.Entities
}
}
public virtual double Uncertainty() { return TestData.Uncertainty; }
public virtual double ErrLimMargin() { return TestData.ErrLimMargin; }
public virtual float TempLimLo() { return TestData.TempLimLo; }
public virtual float TempLimHi() { return TestData.TempLimHi; }
public virtual bool Evaluate() { return TestData.Evaluate; }
@@ -264,7 +270,7 @@ namespace Results.Entities
DivEnd50 = src.DivEnd50;
DivEnd90 = src.DivEnd90;
ErrorFlags = src.ErrorFlags;
ErrorFlagsMd = src.ErrorFlagsMd;
InfoFlags = src.InfoFlags;
RefEnergy = src.RefEnergy;
AmbTempMean = src.AmbTempMean;
AmbTempStart = src.AmbTempStart;
@@ -328,12 +334,6 @@ namespace Results.Entities
Custom10 = src.Custom10;
}
/// <summary> Wrapper </summary>
public virtual Config.Entities.ErrorFlagsMode ErrorFlagsMode()
{
return (Config.Entities.ErrorFlagsMode)ErrorFlagsMd;
}
/// <summary> Wrapper </summary>
public virtual string ErrorFlagsStr()
{
@@ -364,11 +364,11 @@ namespace Results.Entities
public virtual string ToString(int i)
{
return string.Format("TestRslt: Part={0} RepetitionNr={1} TestDone={2} Remark={3} StartTime={4} EndTime={5} FlowSetTime={6} TestTime={7} PulsesMaster={8} ConstMaster={9} MassStartRaw={10} MassStart={11} MassEndRaw={12} MassEnd={13} DensityIn={14} DensityOut={15} DensityDiv={16} Buoyancy={17} FlowMass={18} FlowVolume={19} VolumeCTV={20} VolumeMaster={21} ErrorMaster={22} DiverterStart={85} DiverterEnd={86} ErrorFlags={23} ErrorFlagsMd={24} AmbTempMean={25} AmbTempStart={26} AmbTempEnd={27} AmbTempMin={28} AmbTempMax={29} AmbPressMean={30} AmbPressStart={31} AmbPressEnd={32} AmbPressMin={33} AmbPressMax={34} AmbHumiMean={35} AmbHumiStart={36} AmbHumiEnd={37} AmbHumiMin={38} AmbHumiMax={39} PressUpMean={40} PressUpStart={41} PressUpEnd={42} PressUpMin={43} PressUpMax={44} PressDownMean={45} PressDownStart={46} PressDownEnd={47} PressDownMin={48} PressDownMax={49} PressDeltaMean={50} PressDeltaStart={51} PressDeltaEnd={52} PressDeltaMin={53} PressDeltaMax={54} TempUpMean={55} TempUpStart={56} TempUpEnd={57} TempUpMin={58} TempUpMax={59} TempDownMean={60} TempDownStart={61} TempDownEnd={62} TempDownMin={63} TempDownMax={64} TempDivMean={65} TempDivStart={66} TempDivEnd={67} TempDivMin={68} TempDivMax={69} FlowMean={70} FlowStart={71} FlowEnd={72} FlowMin={73} FlowMax={74} Custom1={75} Custom2={76} Custom3={77} Custom4={78} Custom5={79} Custom6={80} Custom7={81} Custom8={82} Custom9={83} Custom10={84}",
return string.Format("TestRslt: Part={0} RepetitionNr={1} TestDone={2} Remark={3} StartTime={4} EndTime={5} FlowSetTime={6} TestTime={7} PulsesMaster={8} ConstMaster={9} MassStartRaw={10} MassStart={11} MassEndRaw={12} MassEnd={13} DensityIn={14} DensityOut={15} DensityDiv={16} Buoyancy={17} FlowMass={18} FlowVolume={19} VolumeCTV={20} VolumeMaster={21} ErrorMaster={22} DiverterStart={85} DiverterEnd={86} ErrorFlags={23} InfoFlags={24} AmbTempMean={25} AmbTempStart={26} AmbTempEnd={27} AmbTempMin={28} AmbTempMax={29} AmbPressMean={30} AmbPressStart={31} AmbPressEnd={32} AmbPressMin={33} AmbPressMax={34} AmbHumiMean={35} AmbHumiStart={36} AmbHumiEnd={37} AmbHumiMin={38} AmbHumiMax={39} PressUpMean={40} PressUpStart={41} PressUpEnd={42} PressUpMin={43} PressUpMax={44} PressDownMean={45} PressDownStart={46} PressDownEnd={47} PressDownMin={48} PressDownMax={49} PressDeltaMean={50} PressDeltaStart={51} PressDeltaEnd={52} PressDeltaMin={53} PressDeltaMax={54} TempUpMean={55} TempUpStart={56} TempUpEnd={57} TempUpMin={58} TempUpMax={59} TempDownMean={60} TempDownStart={61} TempDownEnd={62} TempDownMin={63} TempDownMax={64} TempDivMean={65} TempDivStart={66} TempDivEnd={67} TempDivMin={68} TempDivMax={69} FlowMean={70} FlowStart={71} FlowEnd={72} FlowMin={73} FlowMax={74} Custom1={75} Custom2={76} Custom3={77} Custom4={78} Custom5={79} Custom6={80} Custom7={81} Custom8={82} Custom9={83} Custom10={84}",
Part, RepetitionNr, TestDone, Remark, StartTime, EndTime, FlowSetTime, TestTime,
PulsesMaster, ConstMaster, MassStartRaw, MassStart, MassEndRaw, MassEnd,
DensityIn, DensityLine, DensityDiv, Buoyancy, FlowMass, FlowVolume,
VolumeCTV, VolumeMaster, ErrorMaster, ErrorFlags, ErrorFlagsMd,
VolumeCTV, VolumeMaster, ErrorMaster, ErrorFlags, InfoFlags,
AmbTempMean, AmbTempStart, AmbTempEnd, AmbTempMin, AmbTempMax,
AmbPressMean, AmbPressStart, AmbPressEnd, AmbPressMin, AmbPressMax,
AmbHumiMean, AmbHumiStart, AmbHumiEnd, AmbHumiMin, AmbHumiMax,
+13 -20
View File
@@ -51,7 +51,8 @@ namespace Results.Entities
public virtual string EndStateAux { get; set; } /// End state of the auxiliary water meter
public virtual double QRise { get; set; } /// [m3/h] detected Q_rise of a composed meter or 'sensitivity' of a single meter
public virtual double QFall { get; set; } /// [m3/h] detected Q_fall of a composed meter
public virtual int ErrorFlags { get; set; } /// bitfield : bit14=E15, bit15=E16
public virtual long ErrorFlags { get; set; } /// bitfield : bit14=E15, bit15=E16
public virtual long InfoFlags { get; set; } /// bitfield : bit14=E15, bit15=E16
public virtual bool Passed { get; set; }
public virtual int ResultCode { get; set; }
public virtual string ArchivePath { get; set; }
@@ -97,6 +98,7 @@ namespace Results.Entities
public virtual object CompleteTestInfos { get; set; } /// SensusTestInfo[] obtained as a best match at the beginning of the cycle, not mapped to DB !!!
#endif
public virtual int ProcessId { get; set; } /// Not mapped to DB !!! Tracing DB Process ID
public virtual int SessionId { get; set; } /// Not mapped to DB !!! 1 (regular tracing DB session) or 2 (alternative tracing DB session)
public virtual bool LastRecordIsNok { get; set; } /// Not mapped to DB !!! Previous record verification result
public virtual WaterMeterData WaterMeterData { get; set; }
@@ -135,23 +137,19 @@ namespace Results.Entities
public virtual MeterTestRslt LastMeterTestRslts() { return lastMeterTestRslts; }
public virtual int ErrorFlagsFromTests(out ErrorFlagsMode errorFlagsMode)
public virtual long ErrorFlagsFromTests()
{
int errorFlags = 0;
ErrorFlagsMode eFlagsMode = 0; /// = ErrorFlagsMode.Off;
long errorFlags = 0;
foreach (var mtr in MeterTestRslts)
{
if (mtr.Evaluate() && mtr.TestDone) errorFlags |= mtr.TestRslt.ErrorFlags;
if ((int)mtr.TestRslt.ErrorFlagsMode() > (int)eFlagsMode) eFlagsMode = mtr.TestRslt.ErrorFlagsMode();
}
errorFlagsMode = eFlagsMode; /// Maximum from all tests (=ErrorFlagsMode.On if at least one test is ErrorFlagsMode.On)
return errorFlags;
}
public virtual int ErrorFlagsFromTestsAndWM(out ErrorFlagsMode errorFlagsMode)
public virtual long ErrorFlagsFromTestsAndWM()
{
int eFlagsFromTests = ErrorFlagsFromTests(out errorFlagsMode) | ErrorFlags;
return (errorFlagsMode != ErrorFlagsMode.Off) ? (eFlagsFromTests | ErrorFlags) : 0;
return ErrorFlagsFromTests() | ErrorFlags;
}
/// <summary>
@@ -160,8 +158,7 @@ namespace Results.Entities
/// <returns>ErrorFlags string</returns>
public virtual string ErrorFlagsStr()
{
ErrorFlagsMode errorFlagsMode;
string eFlags = Utils.ErrorFlagsStr(ErrorFlagsFromTestsAndWM(out errorFlagsMode));
string eFlags = Utils.ErrorFlagsStr(ErrorFlagsFromTestsAndWM());
#if LANG_PL
return string.IsNullOrEmpty(eFlags) ? "brak" : eFlags;
#else
@@ -171,8 +168,7 @@ namespace Results.Entities
public virtual string PassedOrErrorFlagsStr()
{
ErrorFlagsMode errorFlagsMode;
string eFlags = Utils.ErrorFlagsStr(ErrorFlagsFromTestsAndWM(out errorFlagsMode));
string eFlags = Utils.ErrorFlagsStr(ErrorFlagsFromTestsAndWM());
return string.IsNullOrEmpty(eFlags) ? (WaterMeterData.Text4 + PassedColorStr(null)) : eFlags;
}
@@ -192,19 +188,14 @@ namespace Results.Entities
}
}
ErrorFlagsMode errorFlagsMode;
errFlgsStr.Append(Utils.ErrorFlagsStr(ErrorFlagsFromTestsAndWM(out errorFlagsMode)));
errFlgsStr.Append(Utils.ErrorFlagsStr(ErrorFlagsFromTestsAndWM()));
return errFlgsStr.ToString();
}
public virtual bool PassedFromTests()
{
ErrorFlagsMode eFlagsMode;
int eFlags = ErrorFlagsFromTestsAndWM(out eFlagsMode);
bool passed = true;
if (eFlagsMode == ErrorFlagsMode.On && eFlags != 0) passed = false;
bool passed = (ErrorFlagsFromTestsAndWM() == 0);
foreach (var mtr in MeterTestRslts)
{
@@ -359,6 +350,7 @@ namespace Results.Entities
CompleteTestInfos = null;
#endif
ProcessId = 0;
SessionId = 0;
ErrorFlags = 0;
LastRecordIsNok = false;
}
@@ -419,6 +411,7 @@ namespace Results.Entities
CompleteTestInfos = src.CompleteTestInfos;
#endif
ProcessId = src.ProcessId;
SessionId = src.SessionId;
LastRecordIsNok = src.LastRecordIsNok;
foreach (var mtr in MeterTestRslts)
+25 -22
View File
@@ -126,12 +126,9 @@ namespace Results.Forms
int displayedControlsCount = 0;
for (int i = 0; i < results.WaterMeters.Length; i++)
{
if (results.WaterMeters[i] != null)
if (((results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled) || ShowDisabledPositions)
{
if (ShowDisabledPositions || !results.WaterMeters[i].Disabled)
{
displayedControlsCount++;
}
displayedControlsCount++;
}
}
@@ -170,16 +167,23 @@ namespace Results.Forms
firstEnabledControl = null;
for (int i = 0; i < results.WaterMeters.Length; i++)
{
if (results.WaterMeters[i] != null)
if (((results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled) || ShowDisabledPositions)
{
if (!results.WaterMeters[i].Disabled || ShowDisabledPositions)
/// Create one water meter position / control
wmRsltsCtrl[ix] = (TestsArrangement == TestsArrangement.Rows)
? new OneWMResultsRowsCtrl() as IOneWMResultsCtrl
: new OneWMResultsColumnsCtrl() as IOneWMResultsCtrl;
wmRsltsCtrl[ix].Width = oneWidth;
wmRsltsCtrl[ix].Height = oneHeight;
if ((results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled)
{
/// Create one water meter position / control
wmRsltsCtrl[ix] = (TestsArrangement == TestsArrangement.Rows)
? new OneWMResultsRowsCtrl() as IOneWMResultsCtrl
: new OneWMResultsColumnsCtrl() as IOneWMResultsCtrl;
wmRsltsCtrl[ix].Width = oneWidth;
wmRsltsCtrl[ix].Height = oneHeight;
if ((firstEnabledControl == null) && (results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled)
{
firstEnabledControl = wmRsltsCtrl[ix];
}
//wmRsltsCtrl[ix].Update(results.WaterMeters[i].WMPosition);
wmRsltsCtrl[ix].Update(Items);
wmRsltsCtrl[ix].WMResultsClickedHandler += delegate(object s, Results.Forms.WaterMeterEventArgs args)
{
@@ -192,11 +196,10 @@ namespace Results.Forms
OnDoubleClick(s, args);
}
};
flowLayoutPanel.Controls.Add(wmRsltsCtrl[ix] as UserControl);
if ((firstEnabledControl == null) && !results.WaterMeters[i].Disabled) firstEnabledControl = wmRsltsCtrl[ix];
ix++;
}
flowLayoutPanel.Controls.Add(wmRsltsCtrl[ix] as UserControl);
ix++;
}
}
@@ -206,16 +209,16 @@ namespace Results.Forms
}
void UpdateResults(Results.BatchResults batchResults)
void UpdateResults(Results.BatchResults results)
{
if ((batchResults != null) && (batchResults.WaterMeters != null))
if ((results != null) && (results.WaterMeters != null))
{
int ctrlIx = 0;
for (int i = 0; i < batchResults.WaterMeters.Length; i++)
for (int i = 0; i < results.WaterMeters.Length; i++)
{
if (!batchResults.WaterMeters[i].Disabled || ShowDisabledPositions)
if (((results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled) || ShowDisabledPositions)
{
if (ctrlIx < wmRsltsCtrl.Length) wmRsltsCtrl[ctrlIx++].Update(batchResults.WaterMeters[i]);
if (ctrlIx < wmRsltsCtrl.Length) wmRsltsCtrl[ctrlIx++].Update(results.WaterMeters[i]);
}
}
}
+258
View File
@@ -0,0 +1,258 @@
namespace Results.Forms
{
partial class ManualEntryConfigCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.availableTabControl = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.availableByQuantityTreeView = new System.Windows.Forms.TreeView();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.availableByCategoryTreeView = new System.Windows.Forms.TreeView();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.availableAlphabeticTreeView = new System.Windows.Forms.TreeView();
this.downButton = new System.Windows.Forms.Button();
this.upButton = new System.Windows.Forms.Button();
this.selectedResultsListViewEx = new Results.Forms.ListViewEx();
this.removeAllButton = new System.Windows.Forms.Button();
this.removeButton = new System.Windows.Forms.Button();
this.addButton = new System.Windows.Forms.Button();
this.selectedItemsLabel = new System.Windows.Forms.Label();
this.availableItemsLabel = new System.Windows.Forms.Label();
this.availableTabControl.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.SuspendLayout();
//
// availableTabControl
//
this.availableTabControl.Controls.Add(this.tabPage1);
this.availableTabControl.Controls.Add(this.tabPage2);
this.availableTabControl.Controls.Add(this.tabPage3);
this.availableTabControl.Enabled = false;
this.availableTabControl.Location = new System.Drawing.Point(9, 33);
this.availableTabControl.Name = "availableTabControl";
this.availableTabControl.SelectedIndex = 0;
this.availableTabControl.Size = new System.Drawing.Size(206, 453);
this.availableTabControl.TabIndex = 59;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.availableByQuantityTreeView);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(198, 427);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "A...Z";
this.tabPage1.UseVisualStyleBackColor = true;
//
// availableByQuantityTreeView
//
this.availableByQuantityTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableByQuantityTreeView.Location = new System.Drawing.Point(3, 3);
this.availableByQuantityTreeView.Name = "availableByQuantityTreeView";
this.availableByQuantityTreeView.Size = new System.Drawing.Size(192, 421);
this.availableByQuantityTreeView.TabIndex = 0;
this.availableByQuantityTreeView.DoubleClick += new System.EventHandler(this.availableByQuantityTreeView_DoubleClick);
//
// tabPage2
//
this.tabPage2.Controls.Add(this.availableByCategoryTreeView);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(198, 427);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "by quantity";
this.tabPage2.UseVisualStyleBackColor = true;
//
// availableByCategoryTreeView
//
this.availableByCategoryTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableByCategoryTreeView.Location = new System.Drawing.Point(3, 3);
this.availableByCategoryTreeView.Name = "availableByCategoryTreeView";
this.availableByCategoryTreeView.Size = new System.Drawing.Size(192, 421);
this.availableByCategoryTreeView.TabIndex = 0;
this.availableByCategoryTreeView.DoubleClick += new System.EventHandler(this.availableByCategoryTreeView_DoubleClick);
//
// tabPage3
//
this.tabPage3.Controls.Add(this.availableAlphabeticTreeView);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(198, 427);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "by category";
this.tabPage3.UseVisualStyleBackColor = true;
//
// availableAlphabeticTreeView
//
this.availableAlphabeticTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableAlphabeticTreeView.Location = new System.Drawing.Point(0, 0);
this.availableAlphabeticTreeView.Name = "availableAlphabeticTreeView";
this.availableAlphabeticTreeView.Size = new System.Drawing.Size(198, 427);
this.availableAlphabeticTreeView.TabIndex = 0;
this.availableAlphabeticTreeView.DoubleClick += new System.EventHandler(this.availableAlphabeticTreeView_DoubleClick);
//
// downButton
//
this.downButton.Enabled = false;
this.downButton.Location = new System.Drawing.Point(221, 351);
this.downButton.Name = "downButton";
this.downButton.Size = new System.Drawing.Size(93, 30);
this.downButton.TabIndex = 58;
this.downButton.Text = "Down";
this.downButton.UseVisualStyleBackColor = true;
this.downButton.Click += new System.EventHandler(this.downButton_Click);
//
// upButton
//
this.upButton.Enabled = false;
this.upButton.Location = new System.Drawing.Point(221, 315);
this.upButton.Name = "upButton";
this.upButton.Size = new System.Drawing.Size(93, 30);
this.upButton.TabIndex = 57;
this.upButton.Text = "Up";
this.upButton.UseVisualStyleBackColor = true;
this.upButton.Click += new System.EventHandler(this.upButton_Click);
//
// selectedResultsListViewEx
//
this.selectedResultsListViewEx.AllowColumnReorder = true;
this.selectedResultsListViewEx.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.selectedResultsListViewEx.DoubleClickActivation = false;
this.selectedResultsListViewEx.Enabled = false;
this.selectedResultsListViewEx.FullRowSelect = true;
this.selectedResultsListViewEx.GridLines = true;
this.selectedResultsListViewEx.Location = new System.Drawing.Point(322, 33);
this.selectedResultsListViewEx.Name = "selectedResultsListViewEx";
this.selectedResultsListViewEx.Size = new System.Drawing.Size(594, 453);
this.selectedResultsListViewEx.TabIndex = 56;
this.selectedResultsListViewEx.UseCompatibleStateImageBehavior = false;
this.selectedResultsListViewEx.View = System.Windows.Forms.View.Details;
this.selectedResultsListViewEx.DoubleClick += new System.EventHandler(this.selectedResultsListViewEx_DoubleClick);
//
// removeAllButton
//
this.removeAllButton.Enabled = false;
this.removeAllButton.Location = new System.Drawing.Point(221, 223);
this.removeAllButton.Name = "removeAllButton";
this.removeAllButton.Size = new System.Drawing.Size(94, 30);
this.removeAllButton.TabIndex = 55;
this.removeAllButton.Text = "<< R&emove all";
this.removeAllButton.UseVisualStyleBackColor = true;
this.removeAllButton.Visible = false;
this.removeAllButton.Click += new System.EventHandler(this.removeAllButton_Click);
//
// removeButton
//
this.removeButton.Enabled = false;
this.removeButton.Location = new System.Drawing.Point(221, 188);
this.removeButton.Name = "removeButton";
this.removeButton.Size = new System.Drawing.Size(93, 30);
this.removeButton.TabIndex = 54;
this.removeButton.Text = "< &Remove";
this.removeButton.UseVisualStyleBackColor = true;
this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
//
// addButton
//
this.addButton.Enabled = false;
this.addButton.Location = new System.Drawing.Point(221, 153);
this.addButton.Name = "addButton";
this.addButton.Size = new System.Drawing.Size(93, 30);
this.addButton.TabIndex = 53;
this.addButton.Text = "&Add >";
this.addButton.UseVisualStyleBackColor = true;
this.addButton.Click += new System.EventHandler(this.addButton_Click);
//
// selectedItemsLabel
//
this.selectedItemsLabel.AutoSize = true;
this.selectedItemsLabel.Location = new System.Drawing.Point(321, 11);
this.selectedItemsLabel.Name = "selectedItemsLabel";
this.selectedItemsLabel.Size = new System.Drawing.Size(79, 13);
this.selectedItemsLabel.TabIndex = 52;
this.selectedItemsLabel.Text = "Selected items:";
//
// availableItemsLabel
//
this.availableItemsLabel.AutoSize = true;
this.availableItemsLabel.Location = new System.Drawing.Point(11, 11);
this.availableItemsLabel.Name = "availableItemsLabel";
this.availableItemsLabel.Size = new System.Drawing.Size(80, 13);
this.availableItemsLabel.TabIndex = 51;
this.availableItemsLabel.Text = "Available items:";
//
// ManualEntryConfigCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.availableTabControl);
this.Controls.Add(this.downButton);
this.Controls.Add(this.upButton);
this.Controls.Add(this.selectedResultsListViewEx);
this.Controls.Add(this.removeAllButton);
this.Controls.Add(this.removeButton);
this.Controls.Add(this.addButton);
this.Controls.Add(this.selectedItemsLabel);
this.Controls.Add(this.availableItemsLabel);
this.Name = "ManualEntryConfigCtrl";
this.Size = new System.Drawing.Size(925, 496);
this.Load += new System.EventHandler(this.ManualEntryConfigCtrl_Load);
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.ManualEntryConfigCtrl_KeyPress);
this.availableTabControl.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TabControl availableTabControl;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TreeView availableByQuantityTreeView;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TreeView availableByCategoryTreeView;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.TreeView availableAlphabeticTreeView;
private System.Windows.Forms.Button downButton;
private System.Windows.Forms.Button upButton;
private ListViewEx selectedResultsListViewEx;
private System.Windows.Forms.Button removeAllButton;
private System.Windows.Forms.Button removeButton;
private System.Windows.Forms.Button addButton;
private System.Windows.Forms.Label selectedItemsLabel;
private System.Windows.Forms.Label availableItemsLabel;
}
}
+450
View File
@@ -0,0 +1,450 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Config.Entities;
using Results.Resources;
namespace Results.Forms
{
public partial class ManualEntryConfigCtrl : UserControl
{
/// <summary>
/// ListViewEx columns
/// </summary>
enum Column
{
Item,
Caption,
Units,
Count,
}
Control[] editors; /// all editors except of units
ComboBox unitsCB; /// units combo box
public IList<ManualEntryItemSpec> SelectedItems;
public bool Unlocked
{
set
{
availableTabControl.Enabled = value;
selectedResultsListViewEx.Enabled = value;
addButton.Enabled = value;
removeButton.Enabled = value;
removeAllButton.Enabled = value;
upButton.Enabled = value;
downButton.Enabled = value;
unlocked = value;
}
get { return unlocked; }
}
bool unlocked;
public ManualEntryConfigCtrl()
{
InitializeComponent();
}
void Localize()
{
Text = Strings.Configuration;
availableItemsLabel.Text = Strings.Available_items;
availableTabControl.TabPages[0].Text = Strings.Quantity;
availableTabControl.TabPages[1].Text = Strings.Category;
availableTabControl.TabPages[2].Text = "A...Z";
selectedItemsLabel.Text = Strings.Selected_items;
addButton.Text = Strings.Add;
removeButton.Text = Strings.Remove;
removeAllButton.Text = Strings.Remove_all;
upButton.Text = Strings.UpBtnText;
downButton.Text = Strings.DownBtnText;
}
private void ManualEntryConfigCtrl_Load(object sender, EventArgs e)
{
Localize();
/// Add columns to ListViewEx
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Item, Width = 120 });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Caption });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Units });
/// Create controls used by ListViewEx to edit items
unitsCB = new ComboBox();
ComboBox alignmentCB = new ComboBox();
for (Config.Entities.Alignment a = 0; a < Config.Entities.Alignment.Count; a++)
{
alignmentCB.Items.Add(a.ToDescription());
}
editors = new Control[]
{
null,
new TextBox(), /// caption
unitsCB,
};
foreach (var edi in editors)
{
if (edi != null)
{
edi.Visible = false;
Controls.Add(edi);
}
}
selectedResultsListViewEx.SubItemClicked += new SubItemEventHandler(selectedResultsListViewEx_SubItemClicked);
selectedResultsListViewEx.SubItemEndEditing += new SubItemEndEditingEventHandler(selectedResultsListViewEx_SubItemEndEditing);
availableByQuantityTreeView.ShowNodeToolTips = true;
availableByCategoryTreeView.ShowNodeToolTips = true;
availableAlphabeticTreeView.ShowNodeToolTips = true;
RedrawAvailable();
RedrawSelected();
}
void selectedResultsListViewEx_SubItemClicked(object sender, SubItemEventArgs e)
{
if (e.SubItem == (int)Column.Units)
{
Config.Quantity quantity = (e.Item.Tag as ManualEntryItemSpec).Quantity;
unitsCB.Items.Clear();
unitsCB.Items.Add(Config.Unit.None.ToDescription()); /// "---"
for (Config.Unit u = (Config.Unit)1; u < Config.Unit.Count; u++)
{
if (Config.Units.IsQuantity(u, quantity)) unitsCB.Items.Add(u.ToDescription());
}
selectedResultsListViewEx.StartEditing(unitsCB, e.Item, e.SubItem);
}
else if ((e.SubItem > 0) && (e.SubItem < (int)Column.Count))
{
selectedResultsListViewEx.StartEditing(editors[e.SubItem], e.Item, e.SubItem);
}
}
void selectedResultsListViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e)
{
ListViewItem lvi = e.Item;
ManualEntryItemSpec item = lvi.Tag as ManualEntryItemSpec;
switch ((Column)e.SubItem)
{
case Column.Caption: item.Caption = e.DisplayText; return;
case Column.Units:
for (Config.Unit u = 0; u < Config.Unit.Count; u++)
{
if (u.ToDescription().Equals(unitsCB.Text))
{
item.Units = u;
return; /// OK
}
}
break; /// Error
default:
return; /// OK
}
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
e.Cancel = true;
return;
}
/// <summary>
/// Redraw available items (right hand side)
/// </summary>
void RedrawAvailable()
{
RedrawByQuantity(availableByQuantityTreeView);
RedrawByCategory(availableByCategoryTreeView);
RedrawInAlphabeticOrder(availableAlphabeticTreeView);
}
void RedrawInAlphabeticOrder(TreeView treeView)
{
treeView.Nodes.Clear();
IList<ManualEntryItemSpec> alphabeticlList = ManualEntryItemSpec.AllItems.OrderBy(x => x.Name).ToList();
///
foreach (var item in alphabeticlList)
{
TreeNode node = new TreeNode(item.Name);
node.Tag = item;
node.ToolTipText = item.ToolTipText;
treeView.Nodes.Add(node);
}
}
void RedrawByQuantity(TreeView treeView)
{
treeView.Nodes.Clear();
IList<Config.Quantity> quantities = new List<Config.Quantity>();
for (Config.Quantity q = 0; q < Config.Quantity.Count; q++) quantities.Add(q);
IList<Config.Quantity> sortedQuantities = quantities.OrderBy(x => x.ToDescription()).ToList();
foreach (var q in sortedQuantities)
{
int n = 0;
foreach (var ri in ManualEntryItemSpec.AllItems)
{
if (ri.Quantity == q) n++;
}
if (n > 0)
{
TreeNode[] array = new TreeNode[n];
int i = 0;
foreach (var ri in ManualEntryItemSpec.AllItems)
{
if (ri.Quantity == q)
{
TreeNode node = new TreeNode(ri.Name);
node.Tag = ri;
node.ToolTipText = ri.ToolTipText;
array[i++] = node;
}
}
treeView.Nodes.Add(new TreeNode(q.ToDescription(), array));
}
}
}
void RedrawByCategory(TreeView treeView)
{
treeView.Nodes.Clear();
IList<ItemCategory> categories = new List<ItemCategory>();
for (ItemCategory c = 0; c < ItemCategory.Count; c++) categories.Add(c);
IList<ItemCategory> sortedCategories = categories.OrderBy(x => x.ToDescription()).ToList();
foreach (var c in sortedCategories)
{
int n = 0;
foreach (var ri in ManualEntryItemSpec.AllItems)
{
if (ri.Category == c) n++;
}
if (n > 0)
{
TreeNode[] array = new TreeNode[n];
int i = 0;
foreach (var ri in ManualEntryItemSpec.AllItems)
{
if (ri.Category == c)
{
TreeNode node = new TreeNode(ri.Name);
node.Tag = ri;
node.ToolTipText = ri.ToolTipText;
array[i++] = node;
}
}
treeView.Nodes.Add(new TreeNode(c.ToDescription(), array));
}
}
}
/// <summary>
/// Redraw selected items (right hand side)
/// </summary>
void RedrawSelected()
{
selectedResultsListViewEx.Items.Clear();
if (SelectedItems == null) return;
foreach (var item in SelectedItems)
{
ListViewItem lvi = new ListViewItem(item.Name); /// Item
lvi.Tag = item;
lvi.SubItems.Add(item.Caption); /// Header
lvi.SubItems.Add(item.Units.ToDescription()); /// Units
selectedResultsListViewEx.Items.Add(lvi);
}
}
void UpdateSelectedFromView()
{
}
void addButton_Click(object sender, EventArgs e)
{
switch (availableTabControl.SelectedIndex)
{
case 0:
availableByQuantityTreeView_DoubleClick(this, null);
break;
case 1:
availableByCategoryTreeView_DoubleClick(this, null);
break;
case 2:
availableAlphabeticTreeView_DoubleClick(this, null);
break;
default:
break;
}
}
private void availableByQuantityTreeView_DoubleClick(object sender, EventArgs e)
{
if (availableByQuantityTreeView.SelectedNode != null &&
availableByQuantityTreeView.SelectedNode.Tag is ManualEntryItemSpec)
{
AddItem(availableByQuantityTreeView.SelectedNode.Tag as ManualEntryItemSpec);
}
}
private void availableByCategoryTreeView_DoubleClick(object sender, EventArgs e)
{
if (availableByCategoryTreeView.SelectedNode != null &&
availableByCategoryTreeView.SelectedNode.Tag is ManualEntryItemSpec)
{
AddItem(availableByCategoryTreeView.SelectedNode.Tag as ManualEntryItemSpec);
}
}
private void availableAlphabeticTreeView_DoubleClick(object sender, EventArgs e)
{
if (availableAlphabeticTreeView.SelectedNode != null &&
availableAlphabeticTreeView.SelectedNode.Tag is ManualEntryItemSpec)
{
AddItem(availableAlphabeticTreeView.SelectedNode.Tag as ManualEntryItemSpec);
}
}
void AddItem(ManualEntryItemSpec item)
{
ManualEntryItemSpec newItem = item.Clone();
newItem.Caption = newItem.Name;
SelectedItems.Add(newItem);
RedrawSelected();
/// Select the last item
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[SelectedItems.Count - 1].Selected = true;
selectedResultsListViewEx.Items[SelectedItems.Count - 1].EnsureVisible();
}
private void selectedResultsListViewEx_DoubleClick(object sender, EventArgs e)
{
/// Double click works when just one item is selected
if (selectedResultsListViewEx.SelectedIndices.Count == 1)
{
SelectedItems.RemoveAt(selectedResultsListViewEx.SelectedIndices[0]);
RedrawAvailable();
RedrawSelected();
}
}
void removeButton_Click(object sender, EventArgs e)
{
/// Remove from the list (the last selected item first so that the indexes are not affected)
for (int i = selectedResultsListViewEx.SelectedIndices.Count - 1; i >= 0; i--)
{
SelectedItems.RemoveAt(selectedResultsListViewEx.SelectedIndices[i]);
}
RedrawAvailable();
RedrawSelected();
}
void removeAllButton_Click(object sender, EventArgs e)
{
/// Remove all items from 'Selected' list
SelectedItems.Clear();
RedrawAvailable();
RedrawSelected();
}
//void okButton_Click(object sender, EventArgs e)
//{
// DialogResult = DialogResult.OK;
// Close();
//}
private void ManualEntryConfigCtrl_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
}
private void upButton_Click(object sender, EventArgs e)
{
if (selectedResultsListViewEx.SelectedIndices.Count != 1) return;
int selIdx = selectedResultsListViewEx.SelectedIndices[0];
if (selIdx == 0)
{
/// Cannot move up
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[0].Selected = true;
return;
}
ManualEntryItemSpec tmp = SelectedItems[selIdx - 1];
SelectedItems[selIdx - 1] = SelectedItems[selIdx];
SelectedItems[selIdx] = tmp;
RedrawSelected();
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[selIdx - 1].Selected = true;
selectedResultsListViewEx.Items[selIdx - 1].EnsureVisible();
}
private void downButton_Click(object sender, EventArgs e)
{
if (selectedResultsListViewEx.SelectedIndices.Count != 1) return;
int selIdx = selectedResultsListViewEx.SelectedIndices[0];
if (selIdx == SelectedItems.Count - 1)
{
/// Cannot move down
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[SelectedItems.Count - 1].Selected = true;
return;
}
ManualEntryItemSpec tmp = SelectedItems[selIdx + 1];
SelectedItems[selIdx + 1] = SelectedItems[selIdx];
SelectedItems[selIdx] = tmp;
RedrawSelected();
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[selIdx + 1].Selected = true;
selectedResultsListViewEx.Items[selIdx + 1].EnsureVisible();
}
//private void cancelButton_Click(object sender, EventArgs e)
//{
// DialogResult = DialogResult.Cancel;
// Close();
//}
private void availableByCategoryTreeView_NodeMouseHover2(object sender, TreeNodeMouseHoverEventArgs e)
{
ToolTip toolTip = new ToolTip();
toolTip.SetToolTip(this, e.Node.ToolTipText);
}
}
}
+60
View File
@@ -0,0 +1,60 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using log4net;
using Config.Entities;
using Results;
using Results.Resources;
namespace Results.Forms
{
public partial class ManualEntryConfigDlg : Form
{
public IList<ManualEntryItemSpec> SelectedItems
{
set { manualEntryConfigCtrl.SelectedItems = value; }
get { return manualEntryConfigCtrl.SelectedItems; }
}
public ManualEntryConfigDlg()
{
InitializeComponent();
manualEntryConfigCtrl.Unlocked = true;
}
void Localize()
{
Text = Strings.Configuration;
okButton.Text = Strings.OkBtnText;
cancelButton.Text = Strings.CancelBtnText;
}
void ManualEntryConfig_Load(object sender, EventArgs e)
{
Localize();
}
void okButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
Close();
}
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
private void ManualEntryConfigDlg_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
}
}
}
+95
View File
@@ -0,0 +1,95 @@
///
/// Copyright (c) 2016 Sensus Metering Systems
///
namespace Results.Forms
{
partial class ManualEntryConfigDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.manualEntryConfigCtrl = new Results.Forms.ManualEntryConfigCtrl();
this.SuspendLayout();
//
// okButton
//
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.Location = new System.Drawing.Point(939, 29);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(105, 42);
this.okButton.TabIndex = 4;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(939, 82);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(105, 42);
this.cancelButton.TabIndex = 5;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// manualEntryConfigCtrl
//
this.manualEntryConfigCtrl.Location = new System.Drawing.Point(-1, 1);
this.manualEntryConfigCtrl.Name = "manualEntryConfigCtrl";
this.manualEntryConfigCtrl.Size = new System.Drawing.Size(925, 496);
this.manualEntryConfigCtrl.TabIndex = 6;
this.manualEntryConfigCtrl.Unlocked = false;
//
// ManualEntryConfigDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1066, 498);
this.Controls.Add(this.manualEntryConfigCtrl);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "ManualEntryConfigDlg";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "ManualEntryConfig";
this.Load += new System.EventHandler(this.ManualEntryConfig_Load);
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.ManualEntryConfigDlg_KeyPress);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
private ManualEntryConfigCtrl manualEntryConfigCtrl;
}
}
+2 -2
View File
@@ -90,11 +90,11 @@ namespace Results.Forms
#endif
/// Header
lView.Columns.Add(wmPosition.ToString(), (columnWidths.Length > 0) ? columnWidths[0] : 40);
lView.Columns.Add(wmPosition.ToString(), (columnWidths != null && columnWidths.Length > 0) ? columnWidths[0] : 40);
int col = 1;
foreach (var str in wMtr.GetAllDecoratedTestNames())
{
lView.Columns.Add(str, (columnWidths.Length > col) ? columnWidths[col] : 70);
lView.Columns.Add(str, (columnWidths != null && columnWidths.Length > col) ? columnWidths[col] : 70);
col++;
}
+2 -2
View File
@@ -67,13 +67,13 @@ namespace Results.Forms
/// Always draw ListView header
lView.Columns.Clear();
lView.Columns.Add(wmPosition.ToString(), (columnWidths.Length > 0) ? columnWidths[0] : 40);
lView.Columns.Add(wmPosition.ToString(), (columnWidths != null && columnWidths.Length > 0) ? columnWidths[0] : 40);
if (items == null || items.Count == 0) return;
int col = 1;
foreach (var item in items)
{
lView.Columns.Add(item.Caption, (columnWidths.Length > col) ? columnWidths[col] : 70);
lView.Columns.Add(item.Caption, (columnWidths != null && columnWidths.Length > col) ? columnWidths[col] : 70);
col++;
}
}
+252
View File
@@ -0,0 +1,252 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using Config;
using Config.Entities;
using Results.Entities;
using Results.Resources;
using System.Globalization;
namespace Results
{
public class ManualEntryItemSpec
{
///
/// Public fields
///
public readonly int Uid;
public readonly string Name; /// Name-s of all items must be unique
public readonly string ToolTipText; /// Tool-Tip Text
public readonly Quantity Quantity; /// Quantity
public readonly ItemCategory Category; ///
public string Caption; /// Specifies item description to be printed as a caption (in the header, etc.)
public Config.Unit Units; /// Specifies units for the output
public ManualEntryItemSpec Clone()
{
ManualEntryItemSpec item = new ManualEntryItemSpec((ItemID)Uid, Name, ToolTipText, Quantity, Category, updateDlgt);
item.Caption = Caption;
item.Units = Units;
return item;
}
///
/// Function to pick a MeterTestResult field and convert it into a string
///
public delegate bool UpdateDlgt(string str, MeterTestRslt meterTestRslt);
private readonly UpdateDlgt updateDlgt;
public bool Update(string str, MeterTestRslt meterTestRslt)
{
return (updateDlgt != null) ? updateDlgt(str, meterTestRslt) : true;
}
public static bool ParseBool(string str, out bool success)
{
bool b;
success = bool.TryParse(str, out b);
return b;
}
public static int ParseInt(string str, out bool success)
{
int i;
success = int.TryParse(str, out i);
return i;
}
public static float ParseFloat(string str, out bool success)
{
float f;
success = float.TryParse(str, NumberStyles.AllowDecimalPoint, CultureInfo.CurrentCulture, out f) ||
float.TryParse(str, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out f);
return f;
}
public static double ParseDouble(string str, out bool success)
{
double d;
success = double.TryParse(str, NumberStyles.AllowDecimalPoint, CultureInfo.CurrentCulture, out d) ||
double.TryParse(str, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out d);
return d;
}
///
/// Public constructor
///
public ManualEntryItemSpec(ItemID itemId, string name, string toolTipText, Quantity quantity, ItemCategory category, UpdateDlgt updateDlgt)
{
Uid = (int)itemId;
Name = name;
ToolTipText = toolTipText;
Quantity = quantity;
Category = category;
this.updateDlgt = updateDlgt;
}
/// Static list of all available items
public static readonly IList<ManualEntryItemSpec> AllItems;
/// <summary>
/// Initializes the <see cref="ManualEntryItemSpec"/> class.
/// </summary>
/// Static constructor that initializes the list of all items
static ManualEntryItemSpec()
{
AllItems = new List<ManualEntryItemSpec>();
AllItems.Add(new ManualEntryItemSpec(ItemID.P_PMax_test_mean,
string.Format("{0} PMax mean", Strings.VName_Press),
"PMax test pressure",
Quantity.Pressure,
ItemCategory.TestResult,
(str, mtr) => { bool r;
mtr.TestRslt.PressUpMean = mtr.TestRslt.PressDownMean = ParseFloat(str, out r);
return r; }));
AllItems.Add(new ManualEntryItemSpec(ItemID.T_line_mean,
string.Format("{0} LN ME", Strings.VName_Temp),
Strings.Tooltip_T_ln_me,
Quantity.Temperature,
ItemCategory.TestResult,
(str, mtr) => { bool r;
mtr.TestRslt.TempUpMean = mtr.TestRslt.TempDownMean = ParseFloat(str, out r);
return r; }));
AllItems.Add(new ManualEntryItemSpec(ItemID.Test_time,
Strings.T_s,
"Test time",
Quantity.Time,
ItemCategory.MeterResult,
(str, mtr) => { bool r;
mtr.TestTime = ParseDouble(str, out r);
return r; }));
AllItems.Add(new ManualEntryItemSpec(ItemID.PMax_test_time,
"Pressure test time",
"Pressure test time",
Quantity.Time,
ItemCategory.MeterResult,
(str, mtr) => { bool r;
mtr.TestTime = ParseDouble(str, out r);
return r; }));
AllItems.Add(new ManualEntryItemSpec(ItemID.TestPassed,
Strings.Test_passed,
"Passed",
Quantity.Boolean,
ItemCategory.MeterResult,
(str, mtr) => { bool r;
mtr.Passed = ParseBool(str, out r);
return r; }));
}
/// <summary>
/// Converts a list of 'Output item specifications' to a string array
/// </summary>
/// <param name="items"></param>
/// <returns></returns>
public static string[] ToStrArray(IList<ManualEntryItemSpec> items)
{
int count = (items != null) ? items.Count : 0;
string[] result = new string[count];
for (int i = 0; i < count; i++)
{
if (items[i].Caption == null) items[i].Caption = string.Empty;
result[i] = string.Format("{0}~{1}~{2}",
items[i].Uid,
items[i].Caption.Replace("~", "\n"),
items[i].Units);
}
return result;
}
/// <summary>
/// Converts a string array to a list of 'Output item specifications'
/// </summary>
/// <param name="strArray"></param>
/// <returns></returns>
public static IList<ManualEntryItemSpec> FromStrArray(string[] strArray)
{
IList<ManualEntryItemSpec> result = new List<ManualEntryItemSpec>();
if (strArray != null)
{
for (int i = 0; i < strArray.Length; i++)
{
try
{
ManualEntryItemSpec item;
string[] field = strArray[i].Split(new char[] { '~' });
if (!strArray[i].Contains("~"))
{
item = GetItem(0);
item.Caption = "Prs.Err.";
result.Add(item);
}
else if ((item = GetItem(int.Parse(field[0]))) != null)
{
///
/// Load the new style results item specification
///
item.Caption = field[1].Replace("\n", "~");
item.Units = 0;
for (Config.Unit u = 0; u < Config.Unit.Count; u++)
{
if (u.ToString().Equals(field[2])) { item.Units = u; break; }
}
result.Add(item);
}
else
{
///
/// Create an item with parse error information
///
ManualEntryItemSpec item2 = GetItem(0);
item2.Caption = "Prs.Err.";
result.Add(item2);
}
}
catch
{
ManualEntryItemSpec item = GetItem(0);
item.Caption = "Prs.Err.";
result.Add(item);
}
}
}
return result;
}
public static ManualEntryItemSpec GetItem(int uid)
{
foreach (var item in AllItems)
{
if (item.Uid == uid) return item.Clone();
}
return null;
}
public static ManualEntryItemSpec GetItem(ItemID itemId)
{
return GetItem((int)itemId);
}
public override string ToString()
{
if (!string.IsNullOrEmpty(Caption))
return Caption;
else
return ((ItemID)Uid).ToString();
}
}
}
+6 -3
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
/// Copyright (c) 2015-2019 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
using Results.Entities;
@@ -12,7 +12,10 @@ namespace Results.Mappings
{
Id(x => x.Id);
Map(x => x.Name);
Map(x => x.Qfrom);
#if TEST_PROFILES
Map(x => x.Qtg);
#endif
Map(x => x.Qfrom);
Map(x => x.Qto);
Map(x => x.TargetVolume);
Map(x => x.TargetTime);
@@ -20,7 +23,7 @@ namespace Results.Mappings
Map(x => x.Method);
Map(x => x.ErrLimLo);
Map(x => x.ErrLimHi);
Map(x => x.Uncertainty);
Map(x => x.ErrLimMargin).Column("Uncertainty");
Map(x => x.Publish);
Map(x => x.Evaluate);
}
+7 -1
View File
@@ -48,7 +48,7 @@ namespace Results.Mappings
Map(x => x.DiverterStart);
Map(x => x.DiverterEnd);
Map(x => x.ErrorFlags);
Map(x => x.ErrorFlagsMd);
Map(x => x.InfoFlags);
#if HEAT_METERS
Map(x => x.RefEnergy);
#endif
@@ -103,6 +103,12 @@ namespace Results.Mappings
Map(x => x.FlowMin);
Map(x => x.FlowMax);
Map(x => x.Uncertnt);
Map(x => x.UncertntScale);
Map(x => x.UncertntDensity);
Map(x => x.UncertntTemp);
Map(x => x.UncertntPressure);
Map(x => x.Custom1);
Map(x => x.Custom2);
Map(x => x.Custom3);
+2 -1
View File
@@ -21,7 +21,8 @@ namespace Results.Mappings
Map(x => x.QRise);
Map(x => x.QFall);
Map(x => x.ErrorFlags);
Map(x => x.Passed);
Map(x => x.InfoFlags);
Map(x => x.Passed);
Map(x => x.ResultCode);
Map(x => x.ArchivePath);
Map(x => x.Remark)
+13 -3
View File
@@ -13,17 +13,25 @@ namespace Results.Output
{
public static Chart GetChart(WaterMeter wm, bool isPrinter)
{
return GetChart(wm, isPrinter, Config.Unit.lph, false);
return GetChart(wm, isPrinter, Config.Unit.lph);
}
public static Chart GetChart(WaterMeter wm, bool isPrinter, Config.Unit flowUnit, bool isQ4)
public static Chart GetChart(WaterMeter wm, bool isPrinter, Config.Unit flowUnit)
{
double maxFlow_m3h = 0;
IList<PointF> unsortedPoints = new List<PointF>();
foreach (var mtr in wm.MeterTestRslts)
{
if (mtr.IsPilotRslt() && mtr.TestRslt.TestData.Evaluate && (mtr.TestRslt.TestTime > 0) && (mtr.TestRslt.PulsesMaster > 0))
{
double flow = Config.Units.ConvertTo(flowUnit, 3.6 * mtr.TestRslt.VolumeCTV / mtr.TestRslt.TestTime);
double flow_m3h = (mtr.TestTime != 0)
? (3.6 * mtr.TestRslt.VolumeCTV / mtr.TestTime * mtr.PulsesMaster / mtr.TestRslt.PulsesMaster)
: (3.6 * mtr.TestRslt.VolumeCTV / mtr.TestRslt.TestTime);
if (flow_m3h > maxFlow_m3h) maxFlow_m3h = flow_m3h;
double flow = Config.Units.ConvertTo(flowUnit, flow_m3h); /// Convert to specified units
if (flow > 0)
{
unsortedPoints.Add(new PointF((float)flow, (float)mtr.Error));
@@ -32,6 +40,8 @@ namespace Results.Output
}
IEnumerable<PointF> sortedPoints = unsortedPoints.OrderBy(x => x.X);
bool isQ4 = (maxFlow_m3h > 1.1 * wm.WaterMeterData.Q3_Qn);
Chart chart = new Chart
{
Name = "chart",
+2 -2
View File
@@ -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.24.1315.0")]
[assembly: AssemblyFileVersion("2.24.1315.0")]
[assembly: AssemblyVersion("2.24.1390.0")]
[assembly: AssemblyFileVersion("2.24.1390.0")]
+18
View File
@@ -114,6 +114,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Available items.
/// </summary>
internal static string Available_items {
get {
return ResourceManager.GetString("Available_items", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Available results.
/// </summary>
@@ -978,6 +987,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Selected item.
/// </summary>
internal static string Selected_items {
get {
return ResourceManager.GetString("Selected_items", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Selected results.
/// </summary>
+807
View File
@@ -0,0 +1,807 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Add" xml:space="preserve">
<value>Ajouter &gt;</value>
</data>
<data name="Alignment" xml:space="preserve">
<value>Alignement</value>
</data>
<data name="Approval" xml:space="preserve">
<value>Approbation</value>
</data>
<data name="Available_results" xml:space="preserve">
<value>Résultats disponibles</value>
</data>
<data name="Batch_nr" xml:space="preserve">
<value>Numéro de lot</value>
</data>
<data name="Bench" xml:space="preserve">
<value>Banc</value>
</data>
<data name="CancelBtnText" xml:space="preserve">
<value>Annuler</value>
</data>
<data name="Caption" xml:space="preserve">
<value>Légende</value>
</data>
<data name="Configuration" xml:space="preserve">
<value>Configuration</value>
</data>
<data name="Density" xml:space="preserve">
<value>Densité</value>
</data>
<data name="DownBtnText" xml:space="preserve">
<value>Vers le bas</value>
</data>
<data name="End" xml:space="preserve">
<value>Fin</value>
</data>
<data name="EndState_aux" xml:space="preserve">
<value>État final aux</value>
</data>
<data name="EndState_main" xml:space="preserve">
<value>État final principal</value>
</data>
<data name="End_state" xml:space="preserve">
<value>État final</value>
</data>
<data name="ErrLimHi" xml:space="preserve">
<value>Err LimHi</value>
</data>
<data name="ErrLimLo" xml:space="preserve">
<value>Err LimLo</value>
</data>
<data name="Error" xml:space="preserve">
<value>Erreur</value>
</data>
<data name="ErrRef" xml:space="preserve">
<value>Err Ref</value>
</data>
<data name="Err_aux" xml:space="preserve">
<value>Err aux</value>
</data>
<data name="Err_main" xml:space="preserve">
<value>Err principale</value>
</data>
<data name="Flow" xml:space="preserve">
<value>Couler</value>
</data>
<data name="Format" xml:space="preserve">
<value>Format</value>
</data>
<data name="H_amb" xml:space="preserve">
<value>Hamb</value>
</data>
<data name="Item" xml:space="preserve">
<value>Article</value>
</data>
<data name="MClass" xml:space="preserve">
<value>MClass</value>
</data>
<data name="OkBtnText" xml:space="preserve">
<value>Oui</value>
</data>
<data name="PO" xml:space="preserve">
<value>Commande</value>
</data>
<data name="Pos" xml:space="preserve">
<value>Pos.</value>
</data>
<data name="Precision" xml:space="preserve">
<value>Précision</value>
</data>
<data name="Procedure" xml:space="preserve">
<value>Procédure</value>
</data>
<data name="Producer" xml:space="preserve">
<value>Producteur</value>
</data>
<data name="Protocol" xml:space="preserve">
<value>Protocole</value>
</data>
<data name="Pulses" xml:space="preserve">
<value>Impulsion</value>
</data>
<data name="PulsesLiter" xml:space="preserve">
<value>Impulsion/litre</value>
</data>
<data name="P_amb" xml:space="preserve">
<value>P amb</value>
</data>
<data name="P_dn_end" xml:space="preserve">
<value>P dn fin</value>
</data>
<data name="P_dn" xml:space="preserve">
<value>P dn</value>
</data>
<data name="P_dn_start" xml:space="preserve">
<value>P dn début</value>
</data>
<data name="P_up_end" xml:space="preserve">
<value>P up fin</value>
</data>
<data name="P_up" xml:space="preserve">
<value>P up</value>
</data>
<data name="P_up_start" xml:space="preserve">
<value>P up début</value>
</data>
<data name="Q_fall" xml:space="preserve">
<value>Q tomber</value>
</data>
<data name="Q_from" xml:space="preserve">
<value>Q de</value>
</data>
<data name="Q_rise" xml:space="preserve">
<value>Q monter</value>
</data>
<data name="Q_to" xml:space="preserve">
<value>Q à</value>
</data>
<data name="RefPulses" xml:space="preserve">
<value>Ref Puls</value>
</data>
<data name="Remove" xml:space="preserve">
<value>&lt; Retirer</value>
</data>
<data name="Remove_all" xml:space="preserve">
<value>Enlever tout</value>
</data>
<data name="Result" xml:space="preserve">
<value>Résultat</value>
</data>
<data name="Selected_results" xml:space="preserve">
<value>Résultats sélectionnés</value>
</data>
<data name="sn" xml:space="preserve">
<value>s/n</value>
</data>
<data name="sn_aux" xml:space="preserve">
<value>s/n aux</value>
</data>
<data name="sn_main" xml:space="preserve">
<value>s/n principale</value>
</data>
<data name="Start" xml:space="preserve">
<value>Début</value>
</data>
<data name="Test" xml:space="preserve">
<value>Test</value>
</data>
<data name="Test_ID" xml:space="preserve">
<value>Test ID</value>
</data>
<data name="Test_method" xml:space="preserve">
<value>Méthode d'essai</value>
</data>
<data name="Test_vol" xml:space="preserve">
<value>Test vol</value>
</data>
<data name="T_amb" xml:space="preserve">
<value>T amb</value>
</data>
<data name="T_div" xml:space="preserve">
<value>T div</value>
</data>
<data name="T_end" xml:space="preserve">
<value>T fin</value>
</data>
<data name="T_in" xml:space="preserve">
<value>T dans</value>
</data>
<data name="T_out" xml:space="preserve">
<value>T en dehors</value>
</data>
<data name="T_s" xml:space="preserve">
<value>T [s]</value>
</data>
<data name="T_start" xml:space="preserve">
<value>T début</value>
</data>
<data name="Uncertainty" xml:space="preserve">
<value>Incertitude</value>
</data>
<data name="Units" xml:space="preserve">
<value>Unités</value>
</data>
<data name="UpBtnText" xml:space="preserve">
<value>En haut</value>
</data>
<data name="User" xml:space="preserve">
<value>Utilisateur</value>
</data>
<data name="User_nr" xml:space="preserve">
<value>N° Utilisateur</value>
</data>
<data name="Ver" xml:space="preserve">
<value>Ver.</value>
</data>
<data name="VolRef" xml:space="preserve">
<value>Vol ref.</value>
</data>
<data name="Volume" xml:space="preserve">
<value>Le volume</value>
</data>
<data name="Width" xml:space="preserve">
<value>Largeur</value>
</data>
<data name="WMs" xml:space="preserve">
<value>CEs</value>
</data>
<data name="WM_Type" xml:space="preserve">
<value>CE Type</value>
</data>
<data name="Year" xml:space="preserve">
<value>Année</value>
</data>
<data name="Results" xml:space="preserve">
<value>Résultats</value>
</data>
<data name="Remark" xml:space="preserve">
<value>Remarque</value>
</data>
<data name="Result_code" xml:space="preserve">
<value>Code de résultat</value>
</data>
<data name="Mounting" xml:space="preserve">
<value>Montage</value>
</data>
<data name="Energy" xml:space="preserve">
<value>Énergie</value>
</data>
<data name="Energy_ref" xml:space="preserve">
<value>Énergie ref</value>
</data>
<data name="P_delta" xml:space="preserve">
<value>P delta</value>
</data>
<data name="P_delta_end" xml:space="preserve">
<value>P delta fin</value>
</data>
<data name="P_delta_mean" xml:space="preserve">
<value>P delta moyenne</value>
</data>
<data name="P_delta_start" xml:space="preserve">
<value>P delta début</value>
</data>
<data name="Meter_type" xml:space="preserve">
<value>Type de compteur</value>
</data>
<data name="Compound" xml:space="preserve">
<value>Composé</value>
</data>
<data name="Heat_meter" xml:space="preserve">
<value>Thermomètre</value>
</data>
<data name="Single" xml:space="preserve">
<value>Unique</value>
</data>
<data name="Page" xml:space="preserve">
<value>Page</value>
</data>
<data name="End_volume" xml:space="preserve">
<value>Volume fin</value>
</data>
<data name="Start_volume" xml:space="preserve">
<value>Volume début</value>
</data>
<data name="End_volume_aux" xml:space="preserve">
<value>Fin volume aux</value>
</data>
<data name="End_volume_main" xml:space="preserve">
<value>Fin volume principale</value>
</data>
<data name="Start_volume_aux" xml:space="preserve">
<value>Début volume aux</value>
</data>
<data name="Start_volume_main" xml:space="preserve">
<value>Début volume principale</value>
</data>
<data name="Volume_aux" xml:space="preserve">
<value>Volume aux</value>
</data>
<data name="Volume_main" xml:space="preserve">
<value>Volume principale</value>
</data>
<data name="End_mass" xml:space="preserve">
<value>Fin masse</value>
</data>
<data name="Start_mass" xml:space="preserve">
<value>Début masse</value>
</data>
<data name="Category" xml:space="preserve">
<value>Catégorie</value>
</data>
<data name="Quantity" xml:space="preserve">
<value>Quantité</value>
</data>
<data name="Water_Meter" xml:space="preserve">
<value>Compteur d'eau</value>
</data>
<data name="VName_Flow" xml:space="preserve">
<value>Q</value>
</data>
<data name="VName_Press" xml:space="preserve">
<value>Press.</value>
</data>
<data name="VName_Temp" xml:space="preserve">
<value>Temp.</value>
</data>
<data name="VName_Dens" xml:space="preserve">
<value>Ro</value>
</data>
<data name="VName_Humi" xml:space="preserve">
<value>Hu.</value>
</data>
<data name="VName_Mass" xml:space="preserve">
<value>Masse</value>
</data>
<data name="VName_TstTime" xml:space="preserve">
<value>Tau</value>
</data>
<data name="VName_Vol" xml:space="preserve">
<value>Vol.</value>
</data>
<data name="Tooltip_P_de_ac" xml:space="preserve">
<value>Différence de pression mesurée par delta P mètre - réelle</value>
</data>
<data name="Tooltip_P_de_avg" xml:space="preserve">
<value>Différence de pression mesurée par delta P mètre - moyenne</value>
</data>
<data name="Tooltip_P_de_en" xml:space="preserve">
<value>Différence de pression mesurée par delta P mètre - à la fin de l'essai</value>
</data>
<data name="Tooltip_P_de_me" xml:space="preserve">
<value>Différence de pression mesurée par delta P mètre - moyenne</value>
</data>
<data name="Tooltip_P_de_st" xml:space="preserve">
<value>Différence de pression mesurée par delta P mètre - au début de l'essai</value>
</data>
<data name="Tooltip_P_dw_ac" xml:space="preserve">
<value>Pression à la sortie réelle</value>
</data>
<data name="Tooltip_P_dw_avg" xml:space="preserve">
<value>Pression moyenne à la sortie</value>
</data>
<data name="Tooltip_P_dw_en" xml:space="preserve">
<value>Pression à la sortie à la fin du test</value>
</data>
<data name="Tooltip_P_dw_me" xml:space="preserve">
<value>Pression moyenne à la sortie</value>
</data>
<data name="Tooltip_P_dw_st" xml:space="preserve">
<value>Pression à la sortie au début du test</value>
</data>
<data name="Tooltip_P_up_ac" xml:space="preserve">
<value>Pression à l'entrée réelle</value>
</data>
<data name="Tooltip_P_up_avg" xml:space="preserve">
<value>Pression moyenne à l'entrée</value>
</data>
<data name="Tooltip_P_up_en" xml:space="preserve">
<value>Pression à l'entrée à la fin de l'essai</value>
</data>
<data name="Tooltip_P_up_me" xml:space="preserve">
<value>Pression moyenne à l'entrée</value>
</data>
<data name="Tooltip_P_up_st" xml:space="preserve">
<value>Pression à l'entrée au début de l'essai</value>
</data>
<data name="Tooltip_Q_m_r" xml:space="preserve">
<value>Débit calculé à partir de la masse vraie et du temps conventionnels</value>
</data>
<data name="Tooltip_Q_riac" xml:space="preserve">
<value>Débit obtenu à partir du compteur principal - réel</value>
</data>
<data name="Tooltip_Q_rim" xml:space="preserve">
<value>Débit obtenu à partir du compteur principal - moyenne</value>
</data>
<data name="Tooltip_Q_v_r" xml:space="preserve">
<value>Débit mesuré par le débitmètre de référence</value>
</data>
<data name="Tooltip_T_di_ac" xml:space="preserve">
<value>Température réelle au déviateur</value>
</data>
<data name="Tooltip_T_di_avg" xml:space="preserve">
<value>Température moyenne au déviateur</value>
</data>
<data name="Tooltip_T_di_en" xml:space="preserve">
<value>Température au déviateur à la fin du test - 4 dernières mesures avant la fin</value>
</data>
<data name="Tooltip_T_di_me" xml:space="preserve">
<value>Température moyenne au déviateur</value>
</data>
<data name="Tooltip_T_di_st" xml:space="preserve">
<value>Température au déviateur au début du test - 4 premières mesures après le début</value>
</data>
<data name="Tooltip_T_dw_ac" xml:space="preserve">
<value>Température réelle à la sortie</value>
</data>
<data name="Tooltip_T_dw_avg" xml:space="preserve">
<value>Température moyenne à la sortie</value>
</data>
<data name="Tooltip_T_dw_en" xml:space="preserve">
<value>Température à la sortie à la fin du test - 4 dernières mesures avant la fin</value>
</data>
<data name="Tooltip_T_dw_me" xml:space="preserve">
<value>Température moyenne à la sortie</value>
</data>
<data name="Tooltip_T_dw_st" xml:space="preserve">
<value>Température à la sortie au début du test - 4 premières mesures après le début</value>
</data>
<data name="Tooltip_T_up_ac" xml:space="preserve">
<value>Température réelle à l'entrée</value>
</data>
<data name="Tooltip_T_up_avg" xml:space="preserve">
<value>Température moyenne à l'entrée lors d'un test</value>
</data>
<data name="Tooltip_T_up_en" xml:space="preserve">
<value>Température à l'entrée à la fin de l'essai - 4 dernières mesures avant la fin</value>
</data>
<data name="Tooltip_T_up_me" xml:space="preserve">
<value>Température moyenne à l'entrée lors d'un test</value>
</data>
<data name="Tooltip_T_up_st" xml:space="preserve">
<value>Température d'entrée au début du test - 4 premières mesures après le début</value>
</data>
<data name="aux" xml:space="preserve">
<value>aux.</value>
</data>
<data name="main" xml:space="preserve">
<value>principale</value>
</data>
<data name="Tooltip_E_rel" xml:space="preserve">
<value>Erreur relative d'un compteur</value>
</data>
<data name="Tooltip_E_rel_ref" xml:space="preserve">
<value>Erreur relative du compteur maître</value>
</data>
<data name="Tooltip_sn" xml:space="preserve">
<value>Numéro de série du compteur</value>
</data>
<data name="Tooltip_sn_aux" xml:space="preserve">
<value>Numéro de série du compteur auxiliaire d'un compteur d'eau composé</value>
</data>
<data name="Tooltip_sn_main" xml:space="preserve">
<value>Numéro de série du compteur principal d'un compteur d'eau composé</value>
</data>
<data name="Tooltip_Vol_Mt" xml:space="preserve">
<value>Volume mesuré par le compteur testé</value>
</data>
<data name="Tooltip_Vol_rm" xml:space="preserve">
<value>Volume de référence pour compteur testé</value>
</data>
<data name="VName_Error" xml:space="preserve">
<value>E</value>
</data>
<data name="fall" xml:space="preserve">
<value>tomber</value>
</data>
<data name="from" xml:space="preserve">
<value>de</value>
</data>
<data name="rise" xml:space="preserve">
<value>monter</value>
</data>
<data name="to" xml:space="preserve">
<value>à</value>
</data>
<data name="Tooltip_Hu_Amb_M" xml:space="preserve">
<value>Humidité ambiante pendant le test</value>
</data>
<data name="Tooltip_P_Amb_M" xml:space="preserve">
<value>Pression ambiante pendant le test</value>
</data>
<data name="Tooltip_T_Amb_M" xml:space="preserve">
<value>Température ambiante pendant le test</value>
</data>
<data name="Test_done" xml:space="preserve">
<value>Test fait</value>
</data>
<data name="Test_passed" xml:space="preserve">
<value>Test réussi</value>
</data>
<data name="No" xml:space="preserve">
<value>Non</value>
</data>
<data name="Yes" xml:space="preserve">
<value>Oui</value>
</data>
<data name="Density_correction" xml:space="preserve">
<value>Correction densité</value>
</data>
<data name="Error_flags" xml:space="preserve">
<value>Drapeaux erreur</value>
</data>
<data name="Legalizator" xml:space="preserve">
<value>Légalisateur</value>
</data>
<data name="User_description" xml:space="preserve">
<value>Description utilisateur</value>
</data>
<data name="Failed_meters_count" xml:space="preserve">
<value>Compteur échoué</value>
</data>
<data name="Passed_meters_count" xml:space="preserve">
<value>Mètres passés</value>
</data>
<data name="sensitivity" xml:space="preserve">
<value>sensibilité</value>
</data>
<data name="Tooltip_Q_end" xml:space="preserve">
<value>Débit obtenu à partir du compteur principal - fin</value>
</data>
<data name="Tooltip_Q_max" xml:space="preserve">
<value>Débit obtenu à partir du compteur principal - max.</value>
</data>
<data name="Tooltip_Q_min" xml:space="preserve">
<value>Débit obtenu à partir du compteur principal - min</value>
</data>
<data name="Tooltip_Q_start" xml:space="preserve">
<value>Débit obtenu à partir du compteur principal - départ</value>
</data>
<data name="Tooltip_P_dw_max" xml:space="preserve">
<value>Pression maximale à la sortie pendant le test</value>
</data>
<data name="Tooltip_P_dw_min" xml:space="preserve">
<value>Pression minimale à la sortie pendant le test</value>
</data>
<data name="Tooltip_P_up_max" xml:space="preserve">
<value>Pression maximale à l'entrée pendant l'essai</value>
</data>
<data name="Tooltip_P_up_min" xml:space="preserve">
<value>Pression minimale à l'entrée lors de l'essai</value>
</data>
<data name="Tooltip_T_di_max" xml:space="preserve">
<value>Température maximale au déviateur pendant le test</value>
</data>
<data name="Tooltip_T_di_min" xml:space="preserve">
<value>Température minimale au déviateur pendant le test</value>
</data>
<data name="Tooltip_T_dw_max" xml:space="preserve">
<value>Température maximale à la sortie pendant le test</value>
</data>
<data name="Tooltip_T_dw_min" xml:space="preserve">
<value>Température minimale à la sortie pendant le test</value>
</data>
<data name="Tooltip_T_up_max" xml:space="preserve">
<value>Température maximale à l'entrée pendant le test</value>
</data>
<data name="Tooltip_T_up_min" xml:space="preserve">
<value>Température minimale à l'entrée pendant l'essai</value>
</data>
<data name="Tooltip_P_de_max" xml:space="preserve">
<value>Différence de pression mesurée par delta P mètre - maximum pendant le test</value>
</data>
<data name="Tooltip_P_de_min" xml:space="preserve">
<value>Différence de pression mesurée par delta P mètre - minimum pendant l'essai</value>
</data>
<data name="Tooltip_Rho_Wa_calc" xml:space="preserve">
<value>Densité calculée de l'eau à partir d'une table ou d'une formule à la température d'étalonnage de la densité de l'eau (r)</value>
</data>
<data name="Tooltip_T_rho_0" xml:space="preserve">
<value>Température de l'échantillon d'eau lors de l'étalonnage de la densité de l'eau</value>
</data>
<data name="Tooltip_T_ln_ac" xml:space="preserve">
<value>Température réelle dans la ligne</value>
</data>
<data name="Tooltip_T_ln_avg" xml:space="preserve">
<value>Température moyenne dans la ligne pendant un test</value>
</data>
<data name="Tooltip_T_ln_en" xml:space="preserve">
<value>Température dans la ligne à la fin du test - 4 dernières mesures avant la fin</value>
</data>
<data name="Tooltip_T_ln_max" xml:space="preserve">
<value>Température maximale dans la ligne pendant le test</value>
</data>
<data name="Tooltip_T_ln_me" xml:space="preserve">
<value>Température moyenne dans la ligne pendant un test</value>
</data>
<data name="Tooltip_T_ln_min" xml:space="preserve">
<value>Température minimale dans la ligne pendant le test</value>
</data>
<data name="Tooltip_T_ln_st" xml:space="preserve">
<value>Température dans la ligne au début du test - 4 premières mesures après le début</value>
</data>
<data name="Unit" xml:space="preserve">
<value>Unité</value>
</data>
<data name="Procedure_description" xml:space="preserve">
<value>Description procédure</value>
</data>
<data name="Bench_ID" xml:space="preserve">
<value>ID banc</value>
</data>
<data name="Bench_name" xml:space="preserve">
<value>Nom banc</value>
</data>
<data name="Address" xml:space="preserve">
<value>Adresse</value>
</data>
<data name="Tooltip_E_rel_last" xml:space="preserve">
<value>Erreur relative d'un compteur dans un test précédent / en production</value>
</data>
<data name="Batch" xml:space="preserve">
<value>Lot</value>
</data>
<data name="repetition" xml:space="preserve">
<value>répétition</value>
</data>
<data name="Invalid_Q2_correction_factors" xml:space="preserve">
<value>Facteurs correction Q2 non valides</value>
</data>
<data name="Previous_step_is_missing_or_NOK" xml:space="preserve">
<value>L'étape précédente est manquante ou NOK</value>
</data>
<data name="Test_repetition_count_exceeded_upper_limit" xml:space="preserve">
<value>nombre répétitions test dépasse limite supérieure</value>
</data>
<data name="Wrong_iPerl_counting_direction" xml:space="preserve">
<value>Mauvais sens comptage iPerl</value>
</data>
<data name="Failed" xml:space="preserve">
<value>Échoué</value>
</data>
<data name="Passed" xml:space="preserve">
<value>Passé</value>
</data>
<data name="Test_in_progress" xml:space="preserve">
<value>Test en cours</value>
</data>
<data name="Counter_0" xml:space="preserve">
<value>Compteur {0}</value>
</data>
<data name="Date_and_time" xml:space="preserve">
<value>Date et heure</value>
</data>
<data name="Name" xml:space="preserve">
<value>Prénom</value>
</data>
<data name="Step" xml:space="preserve">
<value>Étape</value>
</data>
<data name="Workplace" xml:space="preserve">
<value>Lieu travail</value>
</data>
<data name="Workflow" xml:space="preserve">
<value>Flux travail</value>
</data>
<data name="Production_tracing_results" xml:space="preserve">
<value>Résultats production</value>
</data>
<data name="Code" xml:space="preserve">
<value>Code</value>
</data>
<data name="Part" xml:space="preserve">
<value>Partie</value>
</data>
<data name="All_results" xml:space="preserve">
<value>Tous résultats</value>
</data>
<data name="Graphs" xml:space="preserve">
<value>Graphiques</value>
</data>
<data name="No_water_meter" xml:space="preserve">
<value>Pas de compteur</value>
</data>
<data name="Serial_number_is_missing" xml:space="preserve">
<value>Numérotation en série</value>
</data>
</root>
+6
View File
@@ -819,4 +819,10 @@
<data name="This_position_is_disabled" xml:space="preserve">
<value>This position is disabled</value>
</data>
<data name="Available_items" xml:space="preserve">
<value>Available items</value>
</data>
<data name="Selected_items" xml:space="preserve">
<value>Selected item</value>
</data>
</root>
+20
View File
@@ -82,6 +82,18 @@
<Compile Include="Forms\ListViewExtensions.cs" />
<Compile Include="Forms\LviIntColumnComparer.cs" />
<Compile Include="Forms\LviTextColumnComparer.cs" />
<Compile Include="Forms\ManualEntryConfigCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\ManualEntryConfigCtrl.designer.cs">
<DependentUpon>ManualEntryConfigCtrl.cs</DependentUpon>
</Compile>
<Compile Include="Forms\ManualEntryConfigDlg.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\ManualEntryConfigDlg.designer.cs">
<DependentUpon>ManualEntryConfigDlg.cs</DependentUpon>
</Compile>
<Compile Include="Forms\MoreWMResultsDlg.cs">
<SubType>Form</SubType>
</Compile>
@@ -120,6 +132,7 @@
</Compile>
<Compile Include="Forms\WaterMeterEventArgs.cs" />
<Compile Include="ItemID.cs" />
<Compile Include="ManualEntryItemSpec.cs" />
<Compile Include="Mappings\BatchMap.cs" />
<Compile Include="Mappings\ComponentsMap.cs" />
<Compile Include="Mappings\MeterTestRsltMap.cs" />
@@ -191,6 +204,12 @@
<EmbeddedResource Include="Forms\ListViewEx.resx">
<DependentUpon>ListViewEx.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\ManualEntryConfigCtrl.resx">
<DependentUpon>ManualEntryConfigCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\ManualEntryConfigDlg.resx">
<DependentUpon>ManualEntryConfigDlg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\MoreWMResultsDlg.resx">
<DependentUpon>MoreWMResultsDlg.cs</DependentUpon>
</EmbeddedResource>
@@ -217,6 +236,7 @@
<EmbeddedResource Include="Resources\Strings.de.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Strings.fr.resx" />
<EmbeddedResource Include="Resources\Strings.it.resx" />
<EmbeddedResource Include="Resources\Strings.pl.resx" />
<EmbeddedResource Include="Resources\Strings.resx">
+8 -4
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2016-2018 Sensus Slovensko a.s.
/// Copyright (c) 2016-2019 Sensus Slovensko a.s.
///
using System;
using System.Text;
@@ -30,6 +30,8 @@ namespace Results
case 10: return 38; /// WR14
case 11: return 39; /// WR18
case 12: return 40; /// WR19
case 13: return 41; /// WR20
case 14: return 42; /// WR21
default: return 0;
}
}
@@ -47,6 +49,8 @@ namespace Results
case 10: return "WR14";
case 11: return "WR18";
case 12: return "WR19";
case 13: return "WR20";
case 14: return "WR21";
default: return string.Empty;
}
}
@@ -57,12 +61,12 @@ namespace Results
/// </summary>
/// <param name="errorFlags">Input</param>
/// <returns>Output string</returns>
public static string ErrorFlagsStr(int errorFlags)
public static string ErrorFlagsStr(long errorFlags)
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 31; i++)
for (int i = 0; i < 63; i++)
{
if ((errorFlags & (1 << i)) != 0)
if ((errorFlags & (1L << i)) != 0)
{
sb.Append("E");
sb.Append(i + 1);
+5 -3
View File
@@ -44,8 +44,10 @@ namespace Results
}
public static double RealDensity;
public static double AtTemperature;
/// This is to show RealDensity and AtTemperatire in reports.
public static double RealDensity; /// true water density [kg/m3]
public static double AtTemperature; /// measured at temperature [°C]
public static double Buoyancy;
///
@@ -311,7 +313,7 @@ namespace Results
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Lo, Strings.ErrLimLo + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).ErrLimLo())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Hi, Strings.ErrLimHi + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).ErrLimHi())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty, Strings.Uncertainty + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).Uncertainty())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty, Strings.Uncertainty + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).ErrLimMargin())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_error, string.Format("{0} rel.ref. ()", Strings.VName_Error), Strings.Tooltip_E_rel_ref, Quantity.Error, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).ErrorMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_error_corr, string.Format("{0} ref.corr. ()", Strings.VName_Error), "Relative error of the reference flow meter after correction using correction curve", Quantity.Error, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", Config.Formulas.ErrorFromVolumes(w.GetTestRslt(t).ConstMasterCorr, w.GetTestRslt(t).ConstMaster))));
#if ORACLE_DB
+2 -2
View File
@@ -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.18.1273.0")]
[assembly: AssemblyFileVersion("2.18.1273.0")]
[assembly: AssemblyVersion("2.24.1368.0")]
[assembly: AssemblyFileVersion("2.24.1368.0")]
+306
View File
@@ -0,0 +1,306 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Error" xml:space="preserve">
<value>Erreur</value>
</data>
<data name="Test_bench" xml:space="preserve">
<value>Banc essai</value>
</data>
<data name="Name" xml:space="preserve">
<value>Prénom</value>
</data>
<data name="CancelBtnText" xml:space="preserve">
<value>Annuler</value>
</data>
<data name="OkBtnText" xml:space="preserve">
<value>Ok</value>
</data>
<data name="ConfigureDatabaseText" xml:space="preserve">
<value>Configurer les bancs d'essai (mot de passe requis)</value>
</data>
<data name="ExitBtnText" xml:space="preserve">
<value>Quitter </value>
</data>
<data name="Procedure" xml:space="preserve">
<value>Procédure</value>
</data>
<data name="Test" xml:space="preserve">
<value>Tester</value>
</data>
<data name="Component" xml:space="preserve">
<value>Composant</value>
</data>
<data name="Configure" xml:space="preserve">
<value>Configurer</value>
</data>
<data name="Printer" xml:space="preserve">
<value>Imprimante</value>
</data>
<data name="Question" xml:space="preserve">
<value>Question</value>
</data>
<data name="Connection_string" xml:space="preserve">
<value>Chaîne connexion</value>
</data>
<data name="Add" xml:space="preserve">
<value>&amp;Ajouter &gt;</value>
</data>
<data name="Message" xml:space="preserve">
<value>Message</value>
</data>
<data name="Data" xml:space="preserve">
<value>Données</value>
</data>
<data name="Protocol" xml:space="preserve">
<value>Protocole</value>
</data>
<data name="Serial_Number" xml:space="preserve">
<value>Numéro série</value>
</data>
<data name="Language" xml:space="preserve">
<value>Langue</value>
</data>
<data name="Add_filter" xml:space="preserve">
<value>Ajouter filtre</value>
</data>
<data name="Clear_filters" xml:space="preserve">
<value>Effacer filtres</value>
</data>
<data name="Execute_query" xml:space="preserve">
<value>Exécuter ordre</value>
</data>
<data name="Export_query_results" xml:space="preserve">
<value>Résultats exportation</value>
</data>
<data name="Filters" xml:space="preserve">
<value>Filtres</value>
</data>
<data name="Format_of_results" xml:space="preserve">
<value>Configurer la sortie</value>
</data>
<data name="Load_filters" xml:space="preserve">
<value>charge filters</value>
</data>
<data name="Print_query_results" xml:space="preserve">
<value>Résultats impression</value>
</data>
<data name="Query_results" xml:space="preserve">
<value>Résultats requête</value>
</data>
<data name="Results_Browser" xml:space="preserve">
<value>Résultats Browser</value>
</data>
<data name="Save_filters" xml:space="preserve">
<value>Enregistrer filtres</value>
</data>
<data name="Settings" xml:space="preserve">
<value>Réglages</value>
</data>
<data name="Test_benches" xml:space="preserve">
<value>Bancs essai</value>
</data>
<data name="RetryDatabaseText" xml:space="preserve">
<value>Recommencez</value>
</data>
<data name="Date" xml:space="preserve">
<value>Date</value>
</data>
<data name="From" xml:space="preserve">
<value>De</value>
</data>
<data name="To" xml:space="preserve">
<value>À</value>
</data>
<data name="Statistics" xml:space="preserve">
<value>Statistiques</value>
</data>
<data name="Columns" xml:space="preserve">
<value>colonnes</value>
</data>
<data name="Rows" xml:space="preserve">
<value>Lignes</value>
</data>
<data name="Select_a_filter" xml:space="preserve">
<value>Sélectionnez filtre</value>
</data>
<data name="Error_displaying_results" xml:space="preserve">
<value>Erreur affichage résultats</value>
</data>
<data name="All_files" xml:space="preserve">
<value>Tous fichiers</value>
</data>
<data name="Error_saving_file" xml:space="preserve">
<value>Fichier sauvegarde erreurs</value>
</data>
<data name="Error_serializing_filters" xml:space="preserve">
<value>Erreurs sérialisation filtres</value>
</data>
<data name="Query_files" xml:space="preserve">
<value>Fichiers requête</value>
</data>
<data name="No_program_settings_found" xml:space="preserve">
<value>Aucun paramètre programme trouvé</value>
</data>
<data name="Using_default_settings" xml:space="preserve">
<value>Utilisation valeurs par défaut</value>
</data>
<data name="Selected_language_not_supported" xml:space="preserve">
<value>Langue sélectionnée non prise en charge</value>
</data>
<data name="Using_English" xml:space="preserve">
<value>Utilisation anglais</value>
</data>
<data name="Warning" xml:space="preserve">
<value>Attention</value>
</data>
<data name="Count" xml:space="preserve">
<value>Compter</value>
</data>
<data name="Format" xml:space="preserve">
<value>Format</value>
</data>
<data name="Page_orientation" xml:space="preserve">
<value>Page orientation</value>
</data>
<data name="Yes_Portrait_No_Landscape" xml:space="preserve">
<value>Oui portrait non paysage</value>
</data>
<data name="Print" xml:space="preserve">
<value>Impression</value>
</data>
<data name="Configure_printer" xml:space="preserve">
<value>Configurer impréssion</value>
</data>
<data name="No_printer_defined" xml:space="preserve">
<value>Aucune imprimante définie</value>
</data>
<data name="Printing_failed" xml:space="preserve">
<value>Impression échouée</value>
</data>
<data name="Printing_completed" xml:space="preserve">
<value>Impression terminée</value>
</data>
<data name="Error_exporting_results" xml:space="preserve">
<value>Erreur exportation résultats</value>
</data>
<data name="Histograms" xml:space="preserve">
<value>histogrammes</value>
</data>
</root>
+1
View File
@@ -254,6 +254,7 @@
</Compile>
<EmbeddedResource Include="Resources\Strings.cs.resx" />
<EmbeddedResource Include="Resources\Strings.de.resx" />
<EmbeddedResource Include="Resources\Strings.fr.resx" />
<EmbeddedResource Include="Resources\Strings.it.resx" />
<EmbeddedResource Include="Resources\Strings.pl.resx">
<SubType>Designer</SubType>
+2 -10
View File
@@ -1,14 +1,12 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TBF", "TBF\TBF.csproj", "{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}"
ProjectSection(ProjectDependencies) = postProject
{EFEC8A31-3022-4DA7-A8F6-16D30A94C3FF} = {EFEC8A31-3022-4DA7-A8F6-16D30A94C3FF}
{0C0A1F4D-1363-4544-A7C5-196C76D26CCA} = {0C0A1F4D-1363-4544-A7C5-196C76D26CCA}
EndProjectSection
EndProject
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "TBFSetup", "TBFSetup\TBFSetup.vdproj", "{4890DE5C-9F68-40D7-B075-92C8EAB79833}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Results", "Results\Results.csproj", "{9D0DCC88-DC81-47EB-9FDD-4C3907871BFB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Config", "Config\Config.csproj", "{743DF7DB-C7B6-42EB-986D-0F485E5588E4}"
@@ -74,12 +72,6 @@ Global
{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}.Release|Mixed Platforms.Build.0 = Release|x86
{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}.Release|x86.ActiveCfg = Release|x86
{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}.Release|x86.Build.0 = Release|x86
{4890DE5C-9F68-40D7-B075-92C8EAB79833}.Debug|Any CPU.ActiveCfg = Debug
{4890DE5C-9F68-40D7-B075-92C8EAB79833}.Debug|Mixed Platforms.ActiveCfg = Debug
{4890DE5C-9F68-40D7-B075-92C8EAB79833}.Debug|x86.ActiveCfg = Debug
{4890DE5C-9F68-40D7-B075-92C8EAB79833}.Release|Any CPU.ActiveCfg = Release
{4890DE5C-9F68-40D7-B075-92C8EAB79833}.Release|Mixed Platforms.ActiveCfg = Release
{4890DE5C-9F68-40D7-B075-92C8EAB79833}.Release|x86.ActiveCfg = Release
{9D0DCC88-DC81-47EB-9FDD-4C3907871BFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9D0DCC88-DC81-47EB-9FDD-4C3907871BFB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{9D0DCC88-DC81-47EB-9FDD-4C3907871BFB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
@@ -1,47 +0,0 @@
///
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using log4net;
using Config.Entities;
using TBF.BenchControl;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.BenchInfo.Munich
{
/// <summary>
/// Holds information identifying the test bench.
/// </summary>
public class Component : ComponentBase, GenericDevices.IBenchInfo
{
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
public override string ToString() { return string.Format("BenchInfo({0})", Cfg.ToString(1)); }
readonly ComponentCfg benchInfoCfg;
public string TestBenchName { get { return benchInfoCfg.TestBenchName; } }
public int TestBenchId { get { return benchInfoCfg.TestBenchId; } }
public string Address1 { get { return string.Empty; } }
public string Address2 { get { return string.Empty; } }
public string Address3 { get { return string.Empty; } }
public string Address4 { get { return string.Empty; } }
public string Address5 { get { return string.Empty; } }
public RemoteDBUse RemoteDBUse { get { return RemoteDBUse.LocalDBOnly; } }
#if ORACLE_DB
public int MaxTestIndex { get { return 0; } }
#endif
public Component()
{
}
public Component(Generic.IComponentCfg cfg)
: base(cfg)
{
benchInfoCfg = cfg as ComponentCfg;
log.Debug(this.ToString());
}
}
}
@@ -1,48 +0,0 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
/// Author: Milan Hanajík
///
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.BenchInfo.Munich
{
/// <summary>
/// Holds information identifying the test bench - serializable configuration.
/// </summary>
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ComponentCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new ComponentCfgCtrl(); }
///
/// Serialized parameters
///
public string TestBenchName;
public int TestBenchId;
/// Private parameterless constructor invoked by all other (public) constructors
ComponentCfg()
{
Name = "BenchInfo";
ParentName = string.Empty;
TestBenchName = "1";
TestBenchId = 1;
}
public ComponentCfg(IComponentFactory factory)
: this()
{
this.Factory = factory;
}
public string ToString(int i)
{
return string.Format("Name={0}, Bench name={1}, Bench Id={2}", Name, TestBenchName, TestBenchId);
}
}
}
@@ -1,88 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Author: Milan Hanajík
///
using System;
using System.Windows.Forms;
using Config.Entities;
using TBF.BenchControl.Generic;
using TBF.Resources;
namespace TBF.BenchControl.BenchInfo.Munich
{
public partial class ComponentCfgCtrl : UserControl, IComponentCfgCtrl
{
public bool ShowMore { get { return false; } }
ComponentCfg config;
public IComponentCfg Config
{
get { return config as IComponentCfg; }
set
{
config = value as ComponentCfg;
Redraw();
}
}
public ComponentCfgCtrl()
{
InitializeComponent();
}
private void EntryFormCfgCtrl_Load(object sender, EventArgs e)
{
nameLabel.Text = Strings.Name;
benchNameLabel.Text = Strings.Test_bench_name;
benchIdLabel.Text = Strings.Test_bench_number;
Redraw();
}
public void Closing()
{
}
void Redraw()
{
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
benchNameTextBox.Text = config.TestBenchName;
benchIdTextBox.Text = config.TestBenchId.ToString();
}
public void Unlock()
{
nameTextBox.Enabled = true;
benchNameTextBox.Enabled = true;
benchIdTextBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
int dummy;
if (!int.TryParse(benchIdTextBox.Text, out dummy) || dummy < 0)
{
flags = CfgUpdateFlags.Error;
message = string.Format("Invalid {0} parameter", Strings.Test_bench_number);
}
return flags;
}
public CfgUpdateFlags UpdateCfg()
{
CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd;
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
///
config.Name = nameTextBox.Text;
config.TestBenchName = benchNameTextBox.Text;
config.TestBenchId = int.Parse(benchIdTextBox.Text);
return flags;
}
}
}
@@ -1,132 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
namespace TBF.BenchControl.BenchInfo.Munich
{
partial class ComponentCfgCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.benchNameLabel = new System.Windows.Forms.Label();
this.benchNameTextBox = new System.Windows.Forms.TextBox();
this.benchIdTextBox = new System.Windows.Forms.TextBox();
this.benchIdLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(140, 55);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
this.nameTextBox.TabIndex = 5;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(25, 58);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 4;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(137, 31);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(60, 13);
this.classNameLabel.TabIndex = 3;
this.classNameLabel.Text = "ClassName";
//
// benchNameLabel
//
this.benchNameLabel.AutoSize = true;
this.benchNameLabel.Location = new System.Drawing.Point(25, 84);
this.benchNameLabel.Name = "benchNameLabel";
this.benchNameLabel.Size = new System.Drawing.Size(90, 13);
this.benchNameLabel.TabIndex = 6;
this.benchNameLabel.Text = "Test bench name";
//
// benchNameTextBox
//
this.benchNameTextBox.Enabled = false;
this.benchNameTextBox.Location = new System.Drawing.Point(140, 81);
this.benchNameTextBox.Name = "benchNameTextBox";
this.benchNameTextBox.Size = new System.Drawing.Size(67, 20);
this.benchNameTextBox.TabIndex = 7;
//
// benchIdTextBox
//
this.benchIdTextBox.Enabled = false;
this.benchIdTextBox.Location = new System.Drawing.Point(140, 107);
this.benchIdTextBox.Name = "benchIdTextBox";
this.benchIdTextBox.Size = new System.Drawing.Size(67, 20);
this.benchIdTextBox.TabIndex = 9;
//
// benchIdLabel
//
this.benchIdLabel.AutoSize = true;
this.benchIdLabel.Location = new System.Drawing.Point(25, 110);
this.benchIdLabel.Name = "benchIdLabel";
this.benchIdLabel.Size = new System.Drawing.Size(99, 13);
this.benchIdLabel.TabIndex = 8;
this.benchIdLabel.Text = "Test bench number";
//
// ComponentCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.benchIdTextBox);
this.Controls.Add(this.benchIdLabel);
this.Controls.Add(this.benchNameTextBox);
this.Controls.Add(this.benchNameLabel);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "ComponentCfgCtrl";
this.Size = new System.Drawing.Size(300, 200);
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.Label benchNameLabel;
private System.Windows.Forms.TextBox benchNameTextBox;
private System.Windows.Forms.TextBox benchIdTextBox;
private System.Windows.Forms.Label benchIdLabel;
}
}
+1 -1
View File
@@ -42,7 +42,7 @@ namespace TBF.BenchControl
Flags = CfgUpdateFlags.None;
/// SharedDlgButtons configuration
sharedButtons.RequiredGroupMembership = new Users.Grp.GID[] { global::Users.Grp.GID.Metrologists };
sharedButtons.RequiredGroupMembership = new Users.Entities.GID[] { global::Users.Entities.GID.Metrologists };
sharedButtons.MoreButtonTop = ComponentCfgCtrlHeight - 45;
sharedButtons.OptionalButtons = SharedButtons.Buttons.None;
sharedButtons.Unlocked += Unlock;
@@ -2,18 +2,17 @@
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using Users;
using log4net;
namespace TBF.BenchControl.BackupAndSecurity.Default
namespace TBF.BenchControl.DataContainers.BackupAndSecurityOptions
{
/// <summary>
/// Holds backup and security options.
/// </summary>
public class Component : ComponentBase, GenericDevices.IBackupAndSecurity
public class Component : ComponentBase
{
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
public override string ToString() { return string.Format("BackupAndSecurity.Default({0})", Cfg.ToString(1)); }
public override string ToString() { return string.Format("{0}({1})", this.GetType().Namespace.Substring(32), Cfg.ToString(1)); }
readonly ComponentCfg myCfg;
@@ -29,8 +28,8 @@ namespace TBF.BenchControl.BackupAndSecurity.Default
{
myCfg = cfg as ComponentCfg;
GlobalData.MinPasswdLength = myCfg.MinPasswdLength;
GlobalData.PasswdExpirationPeriodDays = myCfg.PasswdExpirationPeriodDays;
Users.GlobalData.MinPasswdLength = myCfg.MinPasswdLength;
Users.GlobalData.PasswdExpirationPeriodDays = myCfg.PasswdExpirationPeriodDays;
log.Debug(this.ToString());
}
@@ -7,7 +7,7 @@ using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.BackupAndSecurity.Default
namespace TBF.BenchControl.DataContainers.BackupAndSecurityOptions
{
/// <summary>
/// Holds backup and security options - serializable configuration.
@@ -4,7 +4,7 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.BackupAndSecurity.Default
namespace TBF.BenchControl.DataContainers.BackupAndSecurityOptions
{
public class ComponentFactory : IComponentFactory
{
@@ -9,7 +9,7 @@ using Config.Entities;
using TBF.BenchControl;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.BenchInfo.Extended
namespace TBF.BenchControl.DataContainers.BenchInfo.Extended
{
/// <summary>
/// Holds information identifying the test bench.
@@ -7,7 +7,7 @@ using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.BenchInfo.Extended
namespace TBF.BenchControl.DataContainers.BenchInfo.Extended
{
/// <summary>
/// Holds information identifying the test bench - serializable configuration.
@@ -4,7 +4,7 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.BenchInfo.Extended
namespace TBF.BenchControl.DataContainers.BenchInfo.Extended
{
public class ComponentFactory : IComponentFactory
{
@@ -9,7 +9,7 @@ using Config.Entities;
using TBF.BenchControl;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.BenchInfo.iPerl
namespace TBF.BenchControl.DataContainers.BenchInfo.iPerl
{
/// <summary>
/// Holds information identifying the test bench.
@@ -8,7 +8,7 @@ using Config.Entities;
using TBF.BenchControl.Generic;
using TBF.Resources;
namespace TBF.BenchControl.BenchInfo.iPerl
namespace TBF.BenchControl.DataContainers.BenchInfo.iPerl
{
/// <summary>
/// Holds information identifying the test bench - serializable configuration.
@@ -4,7 +4,7 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.BenchInfo.iPerl
namespace TBF.BenchControl.DataContainers.BenchInfo.iPerl
{
public class ComponentFactory : IComponentFactory
{
@@ -0,0 +1,39 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using log4net;
namespace TBF.BenchControl.DataContainers.Buoyancy
{
/// <summary>
/// Holds measured (true) buoyancy value.
/// </summary>
public class Component : ComponentBase
{
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
public override string ToString() { return string.Format("{0}({1})", this.GetType().Namespace.Substring(32), Cfg.ToString(1)); }
readonly ComponentCfg myCfg;
public double Buoyancy { get { return myCfg.Buoyancy; } }
public Component()
{
}
public Component(Generic.IComponentCfg cfg)
: base(cfg)
{
myCfg = cfg as ComponentCfg;
/// This is to use data in formulas
Config.Data.Buoyancy = Buoyancy;
/// This is to have data in reports
Results.WMeterRsltItemSpec.Buoyancy = Buoyancy;
log.Debug(this.ToString());
}
}
}
@@ -0,0 +1,118 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.DataContainers.Buoyancy
{
/// <summary>
/// Holds backup and security options - serializable configuration.
/// </summary>
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, Config.Entities.IParamsProvider
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ComponentCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new Configs.ParamsProvider.ComponentCfgCtrl(this, null); }
///
/// Serialized parameters
///
public double Buoyancy;
/// Private parameterless constructor invoked by all other (public) constructors
ComponentCfg() {}
public ComponentCfg(string name, IComponentFactory factory)
: this()
{
Name = name;
Factory = factory;
ParentName = string.Empty;
InitializeAll();
}
public string ComponentName { get { return Name; } }
public void InitializeAll()
{
Buoyancy = 1.00103;
}
string[] paramNames = new string[]
{
"Buoyancy",
};
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("{0}: Buoyancy = {1}", Name, Buoyancy);
}
switch (i)
{
case 0: return Buoyancy.ToString();
default: return string.Empty;
}
}
public CfgUpdateFlags UpdateParam(int i, string strValue)
{
switch (i)
{
case 0: Buoyancy = Utils.ParseUDouble(strValue); return CfgUpdateFlags.RestartRqrd;
default: return CfgUpdateFlags.None;
}
}
public bool ValidateParam(int i, string strValue, out string message)
{
message = string.Empty;
double dummy;
switch (i)
{
case 0:
/// Real number between 0.8 and 1.2 expected
if (Utils.TryParseUDouble(strValue, out dummy) && (dummy >= 0.8) && (dummy <= 1.2)) return true;
break;
default:
message = "Invalid index";
return false;
}
message = ParamName(i) + " is invalid";
return false;
}
void CopyContentTo(ComponentCfg prms)
{
prms.Buoyancy = this.Buoyancy;
}
public Config.Entities.IParamsProvider Clone()
{
ComponentCfg pars = new ComponentCfg();
CopyContentTo(pars);
return pars;
}
public bool UpdateEmbeddedDbEntity()
{
return true; /// =OK, do nothing
}
}
}
@@ -0,0 +1,26 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.DataContainers.Buoyancy
{
public class ComponentFactory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Component(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
public IComponentCfg DefaultConfig() { return new ComponentCfg(this.GetType().Namespace.Substring(32), this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(ComponentCfg.Serializer, component, this);
}
}
}
@@ -0,0 +1,42 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using log4net;
namespace TBF.BenchControl.DataContainers.Density
{
/// <summary>
/// Holds measured (true) density value.
/// </summary>
public class Component : ComponentBase
{
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
public override string ToString() { return string.Format("{0}({1})", this.GetType().Namespace.Substring(32), Cfg.ToString(1)); }
readonly ComponentCfg myCfg;
public double RealDensity { get { return myCfg.RealDensity; } }
public double AtTemperature { get { return myCfg.AtTemperature; } }
public Component()
{
}
public Component(Generic.IComponentCfg cfg)
: base(cfg)
{
myCfg = cfg as ComponentCfg;
/// This is to use data in formulas
Config.Data.RealDensity = RealDensity;
Config.Data.AtTemperature = AtTemperature;
/// This is to have data in reports
Results.WMeterRsltItemSpec.RealDensity = RealDensity;
Results.WMeterRsltItemSpec.AtTemperature = AtTemperature;
log.Debug(this.ToString());
}
}
}
@@ -0,0 +1,128 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.DataContainers.Density
{
/// <summary>
/// Holds backup and security options - serializable configuration.
/// </summary>
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, Config.Entities.IParamsProvider
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ComponentCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new Configs.ParamsProvider.ComponentCfgCtrl(this, null); }
///
/// Serialized parameters
///
public double RealDensity;
public double AtTemperature;
/// Private parameterless constructor invoked by all other (public) constructors
ComponentCfg() {}
public ComponentCfg(string name, IComponentFactory factory)
: this()
{
Name = name;
Factory = factory;
ParentName = string.Empty;
InitializeAll();
}
public string ComponentName { get { return Name; } }
public void InitializeAll()
{
RealDensity = 998.2008; /// kg/m3
AtTemperature = 20.0; /// °C
}
string[] paramNames = new string[]
{
"True density [kg/m3]",
"@temperature [°C]",
};
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("{0}: True density = {1} kg/m3 measured @temperature {2} °C", Name, RealDensity, AtTemperature);
}
switch (i)
{
case 0: return RealDensity.ToString();
case 1: return AtTemperature.ToString();
default: return string.Empty;
}
}
public CfgUpdateFlags UpdateParam(int i, string strValue)
{
switch (i)
{
case 0: RealDensity = Utils.ParseUDouble(strValue); return CfgUpdateFlags.RestartRqrd;
case 1: AtTemperature = Utils.ParseUDouble(strValue); return CfgUpdateFlags.RestartRqrd;
default: return CfgUpdateFlags.None;
}
}
public bool ValidateParam(int i, string strValue, out string message)
{
message = string.Empty;
double dummy;
switch (i)
{
case 0:
/// Real number between 800 and 1200 kg/m3 expected
if (Utils.TryParseUDouble(strValue, out dummy) && (dummy >= 800) && (dummy <= 1200)) return true;
break;
case 1:
/// Real number above 0 expected
if (Utils.TryParseUDouble(strValue, out dummy) && (dummy >= 0)) return true;
break;
default:
message = "Invalid index";
return false;
}
message = ParamName(i) + " is invalid";
return false;
}
void CopyContentTo(ComponentCfg prms)
{
prms.RealDensity = this.RealDensity;
prms.AtTemperature = this.AtTemperature;
}
public Config.Entities.IParamsProvider Clone()
{
ComponentCfg pars = new ComponentCfg();
CopyContentTo(pars);
return pars;
}
public bool UpdateEmbeddedDbEntity()
{
return true; /// =OK, do nothing
}
}
}
@@ -1,15 +1,14 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
/// Author: Milan Hanajík
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.BenchInfo.Munich
namespace TBF.BenchControl.DataContainers.Density
{
public class ComponentFactory : IComponentFactory
{
public string ClassName { get { return "Bench-ID"; } }
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
@@ -17,11 +16,11 @@ namespace TBF.BenchControl.BenchInfo.Munich
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
public IComponentCfg DefaultConfig() { return new ComponentCfg(this); }
public IComponentCfg DefaultConfig() { return new ComponentCfg(this.GetType().Namespace.Substring(32), this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(ComponentCfg.Serializer, component, this);
return ComponentCfgBase.CreateFromDbEntity(ComponentCfg.Serializer, component, this);
}
}
}
@@ -21,6 +21,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
public readonly int WaterMetersCount;
public readonly bool AtTheEnd;
public readonly bool SensusExtensions;
public readonly bool PlusKeyIsOK;
/// To be retrieved after the form is closed
public string PurchaseOrder;
@@ -77,13 +78,14 @@ namespace TBF.BenchControl.DataEntry.Standard12
/// Constructor
/// </summary>
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public CycleBeginningForm(Results.Entities.WaterMeter[] waterMeters, bool atTheEnd, bool sensusExtensions)
public CycleBeginningForm(Results.Entities.WaterMeter[] waterMeters, bool atTheEnd, bool sensusExtensions, bool plusKeyIsOK)
: this()
{
this.WaterMeters = waterMeters;
this.WaterMetersCount = waterMeters.Length;
this.AtTheEnd = atTheEnd;
this.SensusExtensions = sensusExtensions;
this.PlusKeyIsOK = plusKeyIsOK;
SNText = new string[WaterMetersCount];
Disabled = new bool[WaterMetersCount];
@@ -457,7 +459,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
/// <param name="currentFocusOwner">TextBox control which received the event</param>
private void ProcKeyPress(object sender, KeyPressEventArgs e, ComboBox currentFocusOwner)
{
if (e.KeyChar == '+')
if (e.KeyChar == '+' && PlusKeyIsOK)
{
/// Process '+' key ..... Form completed
okButton_Click(sender, e);
@@ -22,6 +22,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
public bool EnterSerialNrsAtTheEnd;
public bool ShowCycleEndForm;
public bool SensusExtensions;
public bool PlusKeyIsOK;
/// Private parameterless constructor invoked by all other (public) constructors
EntryFormCfg()
@@ -31,6 +32,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
EnterSerialNrsAtTheEnd = false;
ShowCycleEndForm = false;
SensusExtensions = false;
PlusKeyIsOK = false;
}
public EntryFormCfg(IComponentFactory factory)
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
///
using System;
using System.Windows.Forms;
@@ -54,6 +54,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
enterSNsAtTheEndCheckBox.Checked = config.EnterSerialNrsAtTheEnd;
showEndStateFormCheckBox.Checked = config.ShowCycleEndForm;
sensusExtensionsCheckBox.Checked = config.SensusExtensions;
plusKeyIsOkCheckBox.Checked = config.PlusKeyIsOK;
}
public void Unlock()
@@ -62,6 +63,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
enterSNsAtTheEndCheckBox.Enabled = true;
showEndStateFormCheckBox.Enabled = true;
sensusExtensionsCheckBox.Enabled = true;
plusKeyIsOkCheckBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
@@ -80,6 +82,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
config.EnterSerialNrsAtTheEnd = enterSNsAtTheEndCheckBox.Checked;
config.ShowCycleEndForm = showEndStateFormCheckBox.Checked;
config.SensusExtensions = sensusExtensionsCheckBox.Checked;
config.PlusKeyIsOK = plusKeyIsOkCheckBox.Checked;
return flags;
}
@@ -37,6 +37,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
this.showEndStateFormCheckBox = new System.Windows.Forms.CheckBox();
this.enterSNsAtTheEndCheckBox = new System.Windows.Forms.CheckBox();
this.sensusExtensionsCheckBox = new System.Windows.Forms.CheckBox();
this.plusKeyIsOkCheckBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// nameTextBox
@@ -98,10 +99,22 @@ namespace TBF.BenchControl.DataEntry.Standard12
this.sensusExtensionsCheckBox.Text = "Sensus extensions";
this.sensusExtensionsCheckBox.UseVisualStyleBackColor = true;
//
// plusKeyIsOkCheckBox
//
this.plusKeyIsOkCheckBox.AutoSize = true;
this.plusKeyIsOkCheckBox.Enabled = false;
this.plusKeyIsOkCheckBox.Location = new System.Drawing.Point(99, 158);
this.plusKeyIsOkCheckBox.Name = "plusKeyIsOkCheckBox";
this.plusKeyIsOkCheckBox.Size = new System.Drawing.Size(114, 17);
this.plusKeyIsOkCheckBox.TabIndex = 6;
this.plusKeyIsOkCheckBox.Text = "Sensus extensions";
this.plusKeyIsOkCheckBox.UseVisualStyleBackColor = true;
//
// EntryFormCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.plusKeyIsOkCheckBox);
this.Controls.Add(this.sensusExtensionsCheckBox);
this.Controls.Add(this.enterSNsAtTheEndCheckBox);
this.Controls.Add(this.showEndStateFormCheckBox);
@@ -124,5 +137,6 @@ namespace TBF.BenchControl.DataEntry.Standard12
private System.Windows.Forms.CheckBox showEndStateFormCheckBox;
private System.Windows.Forms.CheckBox enterSNsAtTheEndCheckBox;
private System.Windows.Forms.CheckBox sensusExtensionsCheckBox;
private System.Windows.Forms.CheckBox plusKeyIsOkCheckBox;
}
}
@@ -125,7 +125,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
///
void OpenBeginningDlg(EntryFormNoStartEnd myRef)
{
myRef.modelessDlg = new CycleBeginningForm(myRef.waterMeters, entryFormCfg.EnterSerialNrsAtTheEnd, entryFormCfg.SensusExtensions);
myRef.modelessDlg = new CycleBeginningForm(myRef.waterMeters, entryFormCfg.EnterSerialNrsAtTheEnd, entryFormCfg.SensusExtensions, entryFormCfg.PlusKeyIsOK);
modelessDlg.Show();
}
///
@@ -471,17 +471,20 @@ namespace TBF.BenchControl.DataEntry.StandardCamera
///
void UpdateExclamation(int uiCtrlPos) /// uiCtrlPos = 0 .. TextBoxesCount-1
{
try
{
double startVolumeLtr = Utils.ParseUDouble(startTextBoxes[uiCtrlPos].Text) * regReaders[phys2wm[uiCtrlPos] - 1].LtrsPerPulse;
double endVolumeLtr = Utils.ParseUDouble(endTextBoxes[uiCtrlPos].Text) * regReaders[phys2wm[uiCtrlPos] - 1].LtrsPerPulse;
double err = 100.0 * (endVolumeLtr - startVolumeLtr - refVolume) / refVolume;
exclamations[uiCtrlPos].Visible = (err < warningLimLo) || (err > warningLimHi);
}
catch
{
exclamations[uiCtrlPos].Visible = false;
}
if ((mode == Tst.End) || (mode == Tst.Both))
{
try
{
double startVolumeLtr = Utils.ParseUDouble(startTextBoxes[uiCtrlPos].Text) * regReaders[phys2wm[uiCtrlPos] - 1].LtrsPerPulse;
double endVolumeLtr = Utils.ParseUDouble(endTextBoxes[uiCtrlPos].Text) * regReaders[phys2wm[uiCtrlPos] - 1].LtrsPerPulse;
double err = 100.0 * (endVolumeLtr - startVolumeLtr - refVolume) / refVolume;
exclamations[uiCtrlPos].Visible = (err < warningLimLo) || (warningLimHi < err);
}
catch
{
exclamations[uiCtrlPos].Visible = false;
}
}
}
@@ -63,8 +63,8 @@ namespace TBF.BenchControl.DataEntry.iPerl
///
/// Draw an appropriate test bench picture
///
Config.Entities.Side side = (TBF.BenchControl.Sequences.ProcessData.BenchInfo is BenchInfo.iPerl.Component)
? (TBF.BenchControl.Sequences.ProcessData.BenchInfo as BenchInfo.iPerl.Component).Side
Config.Entities.Side side = (TBF.BenchControl.Sequences.ProcessData.BenchInfo is DataContainers.BenchInfo.iPerl.Component)
? (TBF.BenchControl.Sequences.ProcessData.BenchInfo as DataContainers.BenchInfo.iPerl.Component).Side
: Config.Entities.Side.Left;
if (reversedDirection && (side == Config.Entities.Side.Left))
{
+1 -1
View File
@@ -19,7 +19,7 @@ namespace TBF.BenchControl.Elde
EnduranceCycleStop = 13,
}
#if FUZHOU_300 || IZRAEL_200 || TORINO_50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TURA_IPERL || TURA_IPERL_NEW || TURA_SPECIAL || BADGER_VELKA_TRAT || PUCHONG_200 || SLM_50 || GENESIS || MALTA_WSD25 || SLM_END || WARSAW_END || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || DEWA_300 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || SENTEC || FUZHOU_100 || CEVAK_200 || IZRAEL_50
#if FUZHOU_300 || IZRAEL_200 || TORINO_50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TURA_IPERL || TURA_IPERL_NEW || TURA_SPECIAL || BADGER_VELKA_TRAT || PUCHONG_200 || SLM_50 || GENESIS || MALTA_WSD25 || SLM_END || WARSAW_END || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || DEWA_300 || ROMA_200 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || SENTEC || FUZHOU_100 || CEVAK_200 || IZRAEL_50 || ALZIR_25
public enum StatusP : ulong
{
RefFlowMeterMask = 0x7, /// bits 0,1,2
+148 -159
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
///
using System;
using System.Text;
@@ -18,6 +18,8 @@ namespace TBF.BenchControl.Elde
private static readonly ILog log = LogManager.GetLogger(typeof(ControlBoardDev));
public override string ToString() { return string.Format("ControlBoard({0})", Cfg.ToString(1)); }
const int FiltersCount = 8;
readonly ControlBoardCfg controlBoardCfg;
///
@@ -43,7 +45,9 @@ namespace TBF.BenchControl.Elde
public StatusP StatusP { get { return controlCom.StatusP; } }
public int EtPulses(int wmNr1) { return controlCom.EtPulses(wmNr1); }
public int EtPulsesK { get { return controlCom.EtPulsesK; } }
public UInt16 WMeterPulses(int wmNr1) { return controlCom.WMeterPulses(wmNr1); }
public int EtPulses2 { get { return controlCom.EtPulses2; } } /// DEWA_300: pulses from I12
public int EtPulses3 { get { return controlCom.EtPulses3; } } /// DEWA_300: pulses from I13
public UInt16 WMeterPulses(int wmNr1) { return controlCom.WMeterPulses(wmNr1); }
public int WMeterReference(int wmNr0) { return controlCom.WMeterReference(wmNr0); }
public uint RegulValveDAC(int rvNr0) { return controlCom.RegulValveDAC(rvNr0); }
public float Pressure(int prsNr0) { return controlCom.Pressure(prsNr0); }
@@ -77,53 +81,27 @@ namespace TBF.BenchControl.Elde
bool previousEmergencyStop;
private int flowmeterNr4DiverterTest;
private bool scheduleDiverterToTank;
private bool scheduleDiverterToSink;
private bool scheduleReadDiverterTransition;
private bool pumpPowerChanged;
///
public void DiverterToTank(int flowmeterNr)
public void DiverterToTank(int flowMtrNr)
{
if (!scheduleDiverterToSink && !scheduleReadDiverterTransition && !emergencyStop)
{
flowmeterNr4DiverterTest = flowmeterNr;
scheduleDiverterToTank = true;
}
cbCommandQueue.Enqueue(new SendCommandArgs(Command.Start, flowMtrNr, int.MaxValue, int.MaxValue, TestMethods.Diverter | TestMethods.Synchro, StopDevs.None));
}
///
public void DiverterToSink(int flowmeterNr)
public void DiverterToSink(int flowMtrNr)
{
if (!scheduleDiverterToTank && !scheduleReadDiverterTransition && !emergencyStop)
{
flowmeterNr4DiverterTest = flowmeterNr;
scheduleDiverterToSink = true;
}
cbCommandQueue.Enqueue(new SendCommandArgs(Command.Stop, 0, 0, 0, TestMethods.Diverter,
StopDevs.Diverter | StopDevs.GatePulse | StopDevs.Reference | StopDevs.RegValveRegulation));
}
///
public void ReadDiverterTransition(int flowmeterNr)
public void ReadDiverterTransition(int flowMtrNr)
{
if (!scheduleDiverterToTank && !scheduleDiverterToSink && !emergencyStop)
{
flowmeterNr4DiverterTest = flowmeterNr;
scheduleReadDiverterTransition = true;
}
cbCommandQueue.Enqueue(new SendCommandArgs(Command.ReadDivTransition, flowMtrNr, 0, 0, TestMethods.Diverter, 0));
}
/// <summary> State of valves sent out - buffered by the last SendCommand() </summary>
public UInt128 Route { get { return benchModelRoute; } }
UInt128 valvesToInvert; /// Route = valesToInvert ^ RequiredRouteWithoutInvertedVlaves
readonly UInt128 routeMask; /// This mask masks out virtual valves, routeMask is set in the constructor
///
/// Initialization data updated by constructors of children components
/// and sent to 'controlCom2panel' by SendCalibData() method.
///
#if DEWA_300
#if DEWA_300 || ROMA_200
public float[,] TempCalibData = new float[16, 5];
#else
public float[,] TempCalibData = new float[8, 5];
@@ -137,20 +115,21 @@ namespace TBF.BenchControl.Elde
public byte[] MeretRS485Address = new byte[4];
public float[] EtCalib = new float[6] { 1, 1, 1, 1, 1, 1 };
#elif PUCHONG_200 || GENESIS || BERLIN || PETERSBURG_200 || RUM_MOB
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 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];
public float[] EtCalib = new float[7] { 1, 1, 1, 1, 1, 1, 1 };
#elif DEWA_300
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 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];
public float[] EtCalib = new float[8] { 1, 1, 1, 1, 1, 1, 1, 1 };
#elif MUNICH || TORINO_50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TORUN_50 || CEVAK_40 || TURA_IPERL || TURA_IPERL_NEW || TURA_SPECIAL || MURES_40 || FUZHOU_50 || SLM_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || FUZHOU_100
#elif ROMA_200
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[5];
public float[] EtCalib = new float[8] { 1, 1, 1, 1, 1, 1, 1, 1 };
#elif MUNICH || TORINO_50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TORUN_50 || CEVAK_40 || TURA_IPERL || TURA_IPERL_NEW || TURA_SPECIAL || MURES_40 || FUZHOU_50 || SLM_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || FUZHOU_100 || ALZIR_25
public uint[,] RegValveCalib = new uint[8,2] {{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500}};
public byte[] MeretRS485Address = new byte[4];
public float[] EtCalib = new float[5] { 1, 1, 1, 1, 1 };
@@ -175,21 +154,22 @@ namespace TBF.BenchControl.Elde
public uint[] BalanceRange = new uint[2];
///
/// Private values sent by the last SendCommand()
///
bool sendCommandFlag;
Command cmd;
int refNr;
Queue<SendCommandArgs> cbCommandQueue;
/// <summary>
/// Route: 128-bit word representing the current state of all valves and pumps
/// </summary>
public UInt128 Route { get { return benchModelRoute; } }
UInt128 benchModelRoute;
int totalRefPulses;
int massRefPulses;
TestMethods testMethods;
UInt128 valvesToInvert; /// Route = valesToInvert ^ RequiredRouteWithoutInvertedVlaves
readonly UInt128 routeMask; /// This mask masks out virtual valves, routeMask is set in the constructor
int[] filters;
float[] FMFreq;
int regConst;
int shortImp;
StopDevs stopDevs;
/// <summary>
@@ -212,6 +192,8 @@ namespace TBF.BenchControl.Elde
/// <param name="power">Power (0.0f .. 100.0f)</param>
public void SetFMFreq(int index, float power)
{
bool pumpPowerChanged = false;
#if DN100 || MUNICH || FUZHOU_150
if ((FMFreq == null) || (FMFreq.Length != 2))
{
@@ -232,20 +214,27 @@ namespace TBF.BenchControl.Elde
}
#endif
if (index >= 0 && index < FMFreq.Length && FMFreq[index] != power)
{
FMFreq[index] = power;
if (index >= 0 && index < FMFreq.Length)
{
if (FMFreq[index] != power)
{
FMFreq[index] = power;
pumpPowerChanged = true; /// Forces sending a command using Command.None
pumpPowerChanged = true; /// Forces sending a command using Command.None
log.DebugFormat("FMFreq=[{0}{1}{2}{3}{4}{5}]",
FMFreq[0].ToString(),
(FMFreq.Length > 1) ? ("," + FMFreq[1].ToString()) : "",
(FMFreq.Length > 2) ? ("," + FMFreq[2].ToString()) : "",
(FMFreq.Length > 3) ? ("," + FMFreq[3].ToString()) : "",
(FMFreq.Length > 4) ? ("," + FMFreq[4].ToString()) : "",
(FMFreq.Length > 5) ? ("," + FMFreq[5].ToString()) : "");
}
string s = string.Format("FMFreq=[{0}{1}{2}{3}{4}{5}]", FMFreq[0].ToString(),
(FMFreq.Length > 1) ? ("," + FMFreq[1].ToString()) : "",
(FMFreq.Length > 2) ? ("," + FMFreq[2].ToString()) : "",
(FMFreq.Length > 3) ? ("," + FMFreq[3].ToString()) : "",
(FMFreq.Length > 4) ? ("," + FMFreq[4].ToString()) : "",
(FMFreq.Length > 5) ? ("," + FMFreq[5].ToString()) : "");
log.Warn(s);
}
}
else
{
log.ErrorFormat("Wrong FM pump: index = {0}, power = {1}", index, power);
}
}
@@ -290,6 +279,9 @@ namespace TBF.BenchControl.Elde
{
controlBoardCfg = cfg as ControlBoardCfg;
cbCommandQueue = new Queue<SendCommandArgs>();
lastSentFilters = new uint[FiltersCount];
#if DN100 || MUNICH || FUZHOU_150
FMFreq = new float[2] { 0, 0 }; /// Nr. of pumps: Fuzhou150=2, Fuzhou300=6, newer=6
#elif SLM_END || WARSAW_END
@@ -328,7 +320,7 @@ namespace TBF.BenchControl.Elde
#else /// all newer benches
ControlComponent_Torino2015.UserControl1 ctrlBrdComponent,
#endif
UInt128 valvesToInvert,
UInt128 valvesToInvert,
double[] tankCapacities)
{
this.valvesToInvert = valvesToInvert;
@@ -377,7 +369,9 @@ namespace TBF.BenchControl.Elde
log.FatalFormat("Successfully initialized device {0}", ToString());
}
/// <summary>Run this device</summary>
/// <summary>
/// Run this device
/// </summary>
public void RunDeviceBefore()
{
if (DebugLevel == DebugMode.Simulate) return;
@@ -398,95 +392,99 @@ namespace TBF.BenchControl.Elde
{
UiBridge.Bridge.OnEmergencyStopChanged(this,UiBridge.EmergencyStopEventArgs.State.CloseForm);
}
if (emergencyStop)
{
/// SendCommand() arguments to clear the emergency stop state
sendCommandFlag = true;
this.refNr = 0;
this.totalRefPulses = 0;
this.massRefPulses = 0;
this.cmd = Command.Stop;
this.testMethods = 0;
this.stopDevs = StopDevs.All;
}
else if (scheduleDiverterToTank)
{
/// Reset all SendCommand() arguments
sendCommandFlag = true;
this.cmd = Command.Start;
this.refNr = flowmeterNr4DiverterTest;
this.totalRefPulses = int.MaxValue;
this.massRefPulses = int.MaxValue;
this.testMethods = TestMethods.Diverter;
this.stopDevs = 0;
scheduleDiverterToTank = false;
}
else if (scheduleDiverterToSink)
{
/// Reset all SendCommand() arguments
sendCommandFlag = true;
this.cmd = Command.Stop;
this.refNr = flowmeterNr4DiverterTest;
this.totalRefPulses = 0;
this.massRefPulses = 0;
this.testMethods = TestMethods.Diverter;
this.stopDevs = StopDevs.Diverter;
scheduleDiverterToSink = false;
}
else if (scheduleReadDiverterTransition)
{
/// Reset all SendCommand() arguments
sendCommandFlag = true;
this.cmd = Command.ReadDivTransition;
this.refNr = flowmeterNr4DiverterTest;
this.totalRefPulses = 0;
this.massRefPulses = 0;
this.testMethods = TestMethods.Diverter;
this.stopDevs = 0;
scheduleReadDiverterTransition = false;
}
else if (pumpPowerChanged)
{
/// Reset all SendCommand() arguments
sendCommandFlag = true;
this.cmd = Command.None;
pumpPowerChanged = false;
}
else
{
/// Reset all SendCommand() arguments
sendCommandFlag = false;
this.cmd = Command.None;
this.refNr = 0;
this.totalRefPulses = 0;
this.massRefPulses = 0;
this.testMethods = 0;
this.stopDevs = 0;
}
if (this.filters == null) this.filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, };
}
/// <summary>Run this device</summary>
///
/// Used in RunDeviceAfter() when sending commands
///
UInt128 lastSentRoute;
uint[] lastSentFilters;
float[] lastSentFMFreq;
int lastsentRegConst;
int lastSentShortImp;
/// <summary>
/// Run this device
/// </summary>
public void RunDeviceAfter()
{
if (DebugLevel == DebugMode.Simulate) return;
UpdateWeights();
uint[] uintFilters = new uint[8];
for (int i = 0; i < 8; i++)
/// Modify queue in case of emergency stop
if (emergencyStop && !previousEmergencyStop)
{
uintFilters[i] = (filters.Length > i) ? (uint)filters[i] : uintFilters[i - 1];
/// SendCommand() arguments to clear the emergency stop state
cbCommandQueue.Clear();
cbCommandQueue.Enqueue(new SendCommandArgs(Command.Stop, 0, 0, 0, 0, StopDevs.All));
}
///
if (sendCommandFlag)
/// Prepare uintFilters array and evaluate changes
uint[] uintFilters = new uint[FiltersCount];
uintFilters[0] = (filters != null && filters.Length > 0) ? (uint)filters[0] : 0;
bool filtersAreDifferent = (uintFilters[0] != lastSentFilters[0]);
for (int i = 1; i < FiltersCount; i++)
{
controlCom.SendCommand(cmd, refNr, (benchModelRoute & routeMask),
totalRefPulses, massRefPulses, testMethods,
uintFilters, FMFreq, regConst, shortImp, stopDevs);
uintFilters[i] = (filters != null && filters.Length > i) ? (uint)filters[i] : uintFilters[i - 1];
filtersAreDifferent |= (uintFilters[i] != lastSentFilters[i]);
}
/// Evaluate FMFreq changes
bool fmFreqsAreDifferent = false;
if ((FMFreq == null) || (lastSentFMFreq == null) || (FMFreq.Length != lastSentFMFreq.Length))
{
fmFreqsAreDifferent = true;
}
else
{
for (int i = 0; i < FMFreq.Length; i++)
{
if (FMFreq[i] != lastSentFMFreq[i])
{
fmFreqsAreDifferent = true;
break;
}
}
}
if (cbCommandQueue.Count > 0)
{
///
/// There is a command in the queue
///
controlCom.SendCommand(cbCommandQueue.Dequeue(), (benchModelRoute & routeMask), uintFilters, FMFreq, regConst, shortImp);
lastSentRoute = (benchModelRoute & routeMask);
lastsentRegConst = regConst;
lastSentShortImp = shortImp;
/// Deep copy of arrays lastSentFilters and lastSentFMFreq
if ((lastSentFilters == null) || (lastSentFilters.Length != uintFilters.Length)) lastSentFilters = new uint[(uintFilters == null) ? 0 : uintFilters.Length];
for (int i = 0; i < lastSentFilters.Length; i++) lastSentFilters[i] = uintFilters[i];
if ((lastSentFMFreq == null) || (lastSentFMFreq.Length != FMFreq.Length)) lastSentFMFreq = new float[(FMFreq == null) ? 0 : FMFreq.Length];
for (int i = 0; i < lastSentFMFreq.Length; i++) lastSentFMFreq[i] = FMFreq[i];
}
else if (((benchModelRoute & routeMask) != lastSentRoute) ||
filtersAreDifferent ||
fmFreqsAreDifferent ||
(lastsentRegConst != regConst) ||
(lastSentShortImp != shortImp))
{
///
/// Command queue is mepty, but 'route', pump frequency, PID coef., filters or shortImp have changed
///
controlCom.SendCommand(new SendCommandArgs(Command.None, 0, 0, 0, 0, 0), (benchModelRoute & routeMask), uintFilters, FMFreq, regConst, shortImp);
lastSentRoute = (benchModelRoute & routeMask);
lastsentRegConst = regConst;
lastSentShortImp = shortImp;
/// Deep copy of arrays lastSentFilters and lastSentFMFreq
if ((lastSentFilters == null) || (lastSentFilters.Length != uintFilters.Length)) lastSentFilters = new uint[(uintFilters == null) ? 0 : uintFilters.Length];
for (int i = 0; i < lastSentFilters.Length; i++) lastSentFilters[i] = uintFilters[i];
if ((lastSentFMFreq == null) || (lastSentFMFreq.Length != FMFreq.Length)) lastSentFMFreq = new float[(FMFreq == null) ? 0 : FMFreq.Length];
for (int i = 0; i < lastSentFMFreq.Length; i++) lastSentFMFreq[i] = FMFreq[i];
}
controlCom.RunDeviceAfter();
@@ -510,25 +508,17 @@ namespace TBF.BenchControl.Elde
/// </summary>
/// <param name="cmd">See ControlBoard.Command enum</param>
/// <param name="refFlowmtrNr">Number of the etalon/reference (1..5)</param>
/// <param name="route">Route: 64-bit installation specific number</param>
/// <param name="route">State of valves, 128-bit word</param>
/// <param name="totalRefPulses">kolko impulzov ma trvat skuska</param>
/// <param name="testMethods">See ControlBoard.TestMethods enum</param>
/// <param name="filterConstant">0 = No filtering (0..255)</param>
/// <param name="regConst">Coefficient used to control reg. valves (1..100)</param>
/// <param name="shortImp">0 = default value, 1 = spec. processing of very short pulses</param>
/// <param name="stopDevs">What to stop</param>
public void SendCommand(Command cmd, int refFlowmtrNr, UInt128 route,
int totalRefPulses, int massRefPulses, TestMethods testMethods, StopDevs stopDevs)
public void SendCommand(Command cmd, int refFlowmtrNr, int totalRefPulses, int massRefPulses,
TestMethods testMethods, StopDevs stopDevs)
{
this.cmd = cmd;
this.refNr = refFlowmtrNr;
this.benchModelRoute = route;
this.totalRefPulses = totalRefPulses;
this.massRefPulses = massRefPulses;
this.testMethods = testMethods;
this.stopDevs = stopDevs;
sendCommandFlag = true;
cbCommandQueue.Enqueue(new SendCommandArgs(cmd, refFlowmtrNr, totalRefPulses, massRefPulses, testMethods, stopDevs));
}
/// <summary>
@@ -543,7 +533,6 @@ namespace TBF.BenchControl.Elde
benchModelRoute = (((benchModelRoute ^ valvesToInvert) | valvesToOpen) & (~valvesToClose)) ^ valvesToInvert;
foreach (var extV in extendedValves) extV.UpdateRoute(ref benchModelRoute);
log.DebugFormat("SetValves(x,x), new route = {0}", Utils.RouteToStr(benchModelRoute));
sendCommandFlag = true;
return oldRoute ^ benchModelRoute;
}
+18 -18
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -28,6 +28,8 @@ namespace TBF.BenchControl.Elde
}
public int EtPulsesK { get { return 1; } }
public int EtPulses2 { get { return 0; } }
public int EtPulses3 { get { return 0; } }
double[] errFactor = new double[Config.Data.WMsCount + 1]; /// Internal
double[] wMeterPulsesF = new double[Config.Data.WMsCount + 1]; /// Internal
@@ -167,7 +169,7 @@ namespace TBF.BenchControl.Elde
/// </summary>
/// <param name="cmd">See ControlBoard.Command enum</param>
/// <param name="refFlowmtrNr">Number of the etalon/reference (1..5)</param>
/// <param name="route">Route: 64-bit installation specific number</param>
/// <param name="route">State of valves, 128-bit word</param>
/// <param name="refPulses">kolko impulzov ma trvat skuska</param>
/// <param name="testMethods">See ControlBoard.TestMethods enum</param>
/// <param name="filterConstant">0 = No filtering (0..255)</param>
@@ -175,17 +177,15 @@ namespace TBF.BenchControl.Elde
/// <param name="regConst">Coefficient used to control reg. valves (1..100)</param>
/// <param name="shortImp">0 = default value, 1 = spec. processing of very short pulses</param>
/// <param name="stopDevs">What to stop</param>
public void SendCommand(Command cmd, int refFlowmtrNr, UInt128 route,
int totalRefPulses, int massRefPulses, TestMethods testMethods,
uint[] filterConstants, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs)
public void SendCommand(SendCommandArgs sendCommandArgs, UInt128 route, uint[] filterConstants, float[] fmFreq, int regConst, int shortImp)
{
log.InfoFormat("SendCommand(Cmd={0},Ref#={1},Route={2} {3} {4} {5},TotalPls={6},MassPls={7},TstM={8},filt={9},FM=[{10}{11}{12}{13}{14}{15}],Reg={16},ShrtImp={17},Stop={18})",
cmd, refFlowmtrNr, /// 0, 1
((route >> 48) & 0xFFFF).ToString("X4"), /// 2
((route >> 32) & 0xFFFF).ToString("X4"), /// 3
((route >> 16) & 0xFFFF).ToString("X4"), /// 4
(route & 0xFFFF).ToString("X4"), /// 5
totalRefPulses, massRefPulses, testMethods, filterConstants, /// 6, 7, 8, 9
sendCommandArgs.Cmd, sendCommandArgs.RefFlowmtrNr, /// 0, 1
((route >> 48) & 0xFFFF).ToString("X4"), /// 2
((route >> 32) & 0xFFFF).ToString("X4"), /// 3
((route >> 16) & 0xFFFF).ToString("X4"), /// 4
(route & 0xFFFF).ToString("X4"), /// 5
totalRefPulses, massRefPulses, testMethods, filterConstants, /// 6, 7, 8, 9
fmFreq[0].ToString(), /// 10
(fmFreq.Length > 1) ? ("," + fmFreq[1].ToString()) : "", /// 11
(fmFreq.Length > 2) ? ("," + fmFreq[2].ToString()) : "", /// 12
@@ -197,8 +197,8 @@ namespace TBF.BenchControl.Elde
/// Simulation
///
Command lastCmd = this.cmd;
this.cmd = cmd;
this.refFlowmtrNr = refFlowmtrNr;
this.cmd = sendCommandArgs.Cmd;
this.refFlowmtrNr = sendCommandArgs.RefFlowmtrNr;
#if FUZHOU_300
///
@@ -212,14 +212,14 @@ namespace TBF.BenchControl.Elde
log.DebugFormat("SendCommand route = {0}", Utils.RouteToStr(route));
#endif
TestBenchSim.SimRoute = this.simRoute = route;
this.totalRefPulses = totalRefPulses;
this.massRefPulses = massRefPulses;
this.testMethods = testMethods;
this.filterConstants = filterConstants;
this.totalRefPulses = sendCommandArgs.TotalRefPulses;
this.massRefPulses = sendCommandArgs.MassRefPulses;
this.testMethods = sendCommandArgs.TestMethods;
this.stopDevs = sendCommandArgs.StopDevs;
this.filterConstants = filterConstants;
this.FMFreq = fmFreq;
this.regConst = regConst;
this.shortImp = shortImp;
this.stopDevs = stopDevs;
#pragma warning disable
statusP = (StatusP)(((ulong)statusP & (ulong)0xFFFFFFFFFFFFFFF8L) | (ulong)refFlowmtrNr);
+117 -85
View File
@@ -20,25 +20,24 @@ namespace TBF.BenchControl.Elde
public StatusP StatusP { get { return (StatusP)ctrlBrdComponent.StatusP; } }
#if DN100 || MUNICH || FUZHOU_150
public double ReferenceFreq { get { return 1000.0f * ctrlBrdComponent.referenceFreq; } } /// In [Hz] 0..2500, nom.=2000
public double ReferenceFreq { get { return 1000.0f * ctrlBrdComponent.referenceFreq; } } /// Returns in [Hz] 0..2500, nom.=2000
public double ReferenceFreqs(int i) { return 0; }
#else /// all newer benches
#else
/// All newer benches
public double ReferenceFreq { get { return 1000.0 * ctrlBrdComponent.referenceFreq[0]; } } /// Returns in [Hz] 0..2500, nom.=2000
///
/// <summary>
/// In case of I11, I12
/// referenceFreq[0] = I11 + I12
/// referenceFreq[1] = I11
/// referenceFreq[2] = I12
/// cBrd.referenceFreq[0] = I11 + I12
/// cBrd.referenceFreq[1] = I11
/// cBrd.referenceFreq[2] = I12
/// otherwise
/// referenceFreq[0] = I2 or I3 or I4
/// cBrd.referenceFreq[0] = I2 or I3 or I4
/// </summary>
public double ReferenceFreq { get { return 1000.0 * ctrlBrdComponent.referenceFreq[0]; } } /// In [Hz] 0..2500, nom.=2000 ///
/// <returns>Reference frequency in Hz</returns>
public double ReferenceFreqs(int i)
{
if ((i >= 0) && (i < ctrlBrdComponent.referenceFreq.Length))
{
return 1000.0 * ctrlBrdComponent.referenceFreq[0]; /// In [Hz] 0..2500, nom.=2000
}
else return 0;
return ((i >= 0) && (i < ctrlBrdComponent.referenceFreq.Length)) ? (1000.0 * ctrlBrdComponent.referenceFreq[i]) : 0;
}
#endif
@@ -50,6 +49,16 @@ namespace TBF.BenchControl.Elde
public int EtPulsesK { get { return (int)ctrlBrdComponent.etPulsesK; } }
#endif
#if DEWA_300
public int EtPulses2 { get { return (int)ctrlBrdComponent.EtPulses2; } }
public int EtPulses3 { get { return (int)ctrlBrdComponent.EtPulses3; } }
#elif ROMA_200
public int EtPulses2 { get { return (int)ctrlBrdComponent.EtPulses2; } }
public int EtPulses3 { get { return 0; } }
#else
public int EtPulses2 { get { return 0; } }
public int EtPulses3 { get { return 0; } }
#endif
public UInt16 WMeterPulses(int wmNr1) { return (UInt16)ctrlBrdComponent.wMeterPuls[wmNr1]; }
public int WMeterReference(int wmNr0) { return (int)ctrlBrdComponent.wMeterReference[wmNr0]; }
@@ -63,15 +72,15 @@ namespace TBF.BenchControl.Elde
}
public float Pressure(int prsNr0) { return ctrlBrdComponent.pressure[prsNr0]; }
public float Temperature(int tmpNr0) { return ctrlBrdComponent.temperature[tmpNr0]; }
public float Temperature(int tmpNr0) { return (tmpNr0 >= 0 && tmpNr0 < ctrlBrdComponent.temperature.Length) ? ctrlBrdComponent.temperature[tmpNr0] : 0; }
public RegulValveState RegulValveState(int rvNr1) { return (RegulValveState)ctrlBrdComponent.rValveStatus[rvNr1 - 1]; }
#if GENESIS || BERLIN || PETERSBURG_200 || DEWA_300
#if GENESIS || BERLIN || PETERSBURG_200 || DEWA_300 || ROMA_200
public UInt128 RRoute { get { return ((UInt128)ctrlBrdComponent.rRouteH << 64) | (UInt128)ctrlBrdComponent.rRoute; } }
#else
public UInt128 RRoute { get { return ctrlBrdComponent.rRoute; } }
#endif
#if GENESIS || KEMPNO_50 || KRAKOW_50 || BAHRAIN_50 || BADGER_STREDNA_TRAT || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || SENTEC || FUZHOU_100 || CEVAK_200 || IZRAEL_50 || DEWA_300 || PUCHONG_200 || TURA_IPERL_NEW
#if GENESIS || KEMPNO_50 || KRAKOW_50 || BAHRAIN_50 || BADGER_STREDNA_TRAT || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || SENTEC || FUZHOU_100 || CEVAK_200 || IZRAEL_50 || DEWA_300 || ROMA_200 || PUCHONG_200 || TURA_IPERL_NEW || ALZIR_25
public uint DivTime(int id) { return ctrlBrdComponent.divTime[id]; }
public void SetDivLimit(int divNo, uint limLoPct, uint limHiPct)
{
@@ -131,7 +140,7 @@ namespace TBF.BenchControl.Elde
public uint[] WMeterCont { get { return new uint[3]; } } /// Dummy
#endif
#if KEMPNO_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || FUZHOU_100 || CEVAK_200 || IZRAEL_50
#if KEMPNO_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || FUZHOU_100 || CEVAK_200 || IZRAEL_50 || ALZIR_25
public float ValveOpenCloseTime { get { return ctrlBrdComponent.ValveMoveTime[0]; } }
#else
public float ValveOpenCloseTime { get { return 0.001f; } }
@@ -254,7 +263,7 @@ namespace TBF.BenchControl.Elde
ctrlBrdComponent.ExternalCom = true;
#if SENTEC || CEVAK_200 || FUZHOU_100 || IZRAEL_25
#if SENTEC || CEVAK_200 || FUZHOU_100 || IZRAEL_25 || ALZIR_25
ctrlBrdComponent.SendCalibData(rvCalib, meretA, (byte)usedCom, tempCalib, etCalib, divEdge, balanceRange, meretProtocol);
#else
ctrlBrdComponent.SendCalibData(rvCalib, meretA, (byte)usedCom, tempCalib, etCalib, divEdge, balanceRange);
@@ -301,68 +310,40 @@ namespace TBF.BenchControl.Elde
/// <summary>
/// Sends a command to the control board.
/// </summary>
/// <param name="cmd">See ControlBoard.Command enum</param>
/// <param name="refFlowMeterNr">Reference flow meter number (1..5)</param>
/// <param name="route">Route: 64-bit installation specific number</param>
/// <param name="refPulses">Test duration as a number of reference flow meter pulses</param>
/// <param name="testMethods">See ControlBoard.TestMethods enum</param>
/// <param name="filterConstants">0 = No filtering (0..255)</param>
/// <param name="FMFreq">Freq.inverter control (not applicable in DT100, Munich)</param>
/// <param name="regConst">Coefficient used to control the regulation valve (1..100)</param>
/// <param name="sendCommandArgs">Arguments</param>
/// <param name="route">State of valves, 128-bit word</param>
/// <param name="filterConstants">Array with length=8 of filter costants (0..255, 0 = no filtering)</param>
/// <param name="fmFreq">Freq.inverter control (not applicable in DT100, Munich)</param>
/// <param name="regConst">PID coefficient for flow control</param>
/// <param name="shortImp">0 = default value, 1 = spec. processing of very short pulses</param>
/// <param name="stopDevs">What to stop</param>
public void SendCommand(Command cmd, int refFlowMeterNr, UInt128 route,
int totalRefPulses, int massRefPulses, TestMethods testMethods,
uint[] filterConstants, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs)
public void SendCommand(SendCommandArgs sendCommandArgs, UInt128 route, uint[] filterConstants, float[] fmFreq, int regConst, int shortImp)
{
if (Program.MainWnd.InvokeRequired)
{
/// When SendCommand(...) called from the worker thread
object[] args = new object[] { cmd, refFlowMeterNr, route, totalRefPulses, massRefPulses,
testMethods, filterConstants, fmFreq, regConst, shortImp, stopDevs };
Program.MainWnd.Invoke((SendCommandDlgt)DoSendCommand, args); /// Component was created in UI thread - use Invoke()
/// From another thread ... use Invoke()
Program.MainWnd.Invoke((SendCommandDlgt)DoSendCommand, new object[] { sendCommandArgs, route, filterConstants, fmFreq, regConst, shortImp });
}
else
{
/// When SendCommand(...) called from the UI thread
DoSendCommand(cmd, refFlowMeterNr, route, totalRefPulses, massRefPulses, testMethods,
filterConstants, fmFreq, regConst, shortImp, stopDevs);
/// Call DoSendCommand() directly
DoSendCommand(sendCommandArgs, route, filterConstants, fmFreq, regConst, shortImp);
}
}
///
delegate void SendCommandDlgt(Command cmd, int refFlowmtrNr, UInt128 route,
int totalRefPulses, int massRefPulses, TestMethods testMethods,
uint[] filterConstants, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs);
delegate void SendCommandDlgt(SendCommandArgs sendCommandArgs, UInt128 route, uint[] filterConstants, float[] fmFreq, int regConst, int shortImp);
///
private void DoSendCommand(Command cmd, int refFlowMeterNr, UInt128 route,
int totalRefPulses, int massRefPulses, TestMethods testMethods,
uint[] filterConstants, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs)
private void DoSendCommand(SendCommandArgs sendCommandArgs, UInt128 route, uint[] filterConstants, float[] fmFreq, int regConst, int shortImp)
{
//TBF.UiBridge.Bridge.OnLog(this, string.Format("{0} SendCommand({1}, {2}, {3}, {4}, {5}, {6}, [{7},{8}], {9}, {10}, {11})\r\n",
// DateTime.Now.ToLongTimeString(),
// cmd,
// refFlowMeterNr,
// route.ToString("X"),
// totalRefPulses,
// testMethods,
// filterConstant,
// fmFreq[0],
// fmFreq[1],
// regConst,
// shortImp,
// stopDevs));
#if FUZHOU_300
///
/// The following code deals with the situation that all FM controlled pumps share bit #39.
/// In settings the bits of pumps should be sent as follows: P1=50, P2=51, P3=52, P4=53, P5=54 and P7=55
/// (in FUZHOU_300 the FM pump bit should be set set to value FMIndex+50).
/// (in FUZHOU_300 the FM pump bit should be set to value FMIndex+50).
///
bool bit39 = (route & 0x00FC000000000000) != 0; /// true if any of bits 50 through 55 is set
route = route & 0xFF03FFFFFFFFFFFF;
if (bit39) route = route | 0x0000008000000000;
#elif PETERSBURG_200 || DEWA_300
#elif PETERSBURG_200 || DEWA_300 || ROMA_200
///
/// The following code deals with the situation that all pumps share bit #80.
/// In settings the bits of pumps should be sent as follows: P1=64, P2=65, P3=66, P4=67 and P5=68
@@ -374,49 +355,100 @@ namespace TBF.BenchControl.Elde
route = route & (~(((UInt128)1) << 80));
#endif
log.InfoFormat("DoSendCommand(Cmd={0},Ref#={1},Route={2},TotalPls={3},MassPls={4},TM={5},filt={6},FM=[{7}{8}{9}{10}{11}{12}],Reg={13},ShrtImp={14},Stop={15})",
cmd, /// 0
refFlowMeterNr, /// 1
Utils.RouteToStr(route), /// 2
totalRefPulses, massRefPulses, testMethods, filterConstants, /// 3, 4, 5, 6
log.InfoFormat("DoSendCommand(Cmd={0},Ref#={1},Route={2},TotalPls={3},MassPls={4},TM={5},filt={6},FM=[{7}{8}{9}{10}{11}{12}],Reg={13},ShrtImp={14},Stop={15})",
sendCommandArgs.Cmd, /// 0
sendCommandArgs.RefFlowmtrNr, /// 1
Utils.RouteToStr(route), /// 2
sendCommandArgs.TotalRefPulses,
sendCommandArgs.MassRefPulses,
sendCommandArgs.TestMethods,
filterConstants, /// 3, 4, 5, 6
fmFreq[0].ToString(), /// 7
(fmFreq.Length > 1) ? ("," + fmFreq[1].ToString()) : "", /// 8
(fmFreq.Length > 2) ? ("," + fmFreq[2].ToString()) : "", /// 9
(fmFreq.Length > 3) ? ("," + fmFreq[3].ToString()) : "", /// 10
(fmFreq.Length > 4) ? ("," + fmFreq[4].ToString()) : "", /// 11
(fmFreq.Length > 5) ? ("," + fmFreq[5].ToString()) : "", /// 12
regConst, shortImp, stopDevs); /// 13, 14, 15
regConst, /// 13
shortImp, /// 14
sendCommandArgs.StopDevs); /// 15
#if DN100 || MUNICH
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, (uint)totalRefPulses, (uint)testMethods,
Convert.ToSingle(filterConstants[0]), fmFreq[0], (uint)regConst, (uint)shortImp, (uint)stopDevs);
ctrlBrdComponent.SendCommand((uint)sendCommandArgs.Cmd,
(byte)sendCommandArgs.RefFlowmtrNr,
(ulong)route,
(uint)sendCommandArgs.TotalRefPulses,
(uint)sendCommandArgs.TestMethods,
Convert.ToSingle(filterConstants[0]),
fmFreq[0],
(uint)regConst,
(uint)shortImp,
(uint)sendCommandArgs.StopDevs);
#elif BADGER_MALA_TRAT || BADGER_VELKA_TRAT || FUZHOU_50 || FUZHOU_150 || FUZHOU_300 || IZRAEL_200 || TORINO_50 || TORUN_50 || CEVAK_40 || MURES_40
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, (uint)totalRefPulses, (uint)testMethods,
Convert.ToSingle(filterConstants[0]), fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
ctrlBrdComponent.SendCommand((uint)sendCommandArgs.Cmd,
(byte)sendCommandArgs.RefFlowmtrNr,
(ulong)route,
(uint)sendCommandArgs.TotalRefPulses,
(uint)sendCommandArgs.TestMethods,
Convert.ToSingle(filterConstants[0]),
fmFreq,
(uint)regConst,
(uint)shortImp,
(uint)sendCommandArgs.StopDevs);
#elif BERLIN || SLM_150 || PETERSBURG_200
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)(route & (UInt128)0xFFFFFFFFFFFFFFFF), (ulong)(route >> 64), pulsesArr, (uint)testMethods,
Convert.ToSingle(filterConstants[0]), fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
#elif GENESIS || DEWA_300
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)(route & (UInt128)0xFFFFFFFFFFFFFFFF), (ulong)(route >> 64), pulsesArr, (uint)testMethods,
filterConstants, fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
#elif JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || SENTEC || FUZHOU_100 || CEVAK_200 || IZRAEL_50
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, pulsesArr, (uint)testMethods,
filterConstants, fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
ctrlBrdComponent.SendCommand((uint)sendCommandArgs.Cmd,
(byte)sendCommandArgs.RefFlowmtrNr,
(ulong)(route & (UInt128)0xFFFFFFFFFFFFFFFF),
(ulong)(route >> 64),
new uint[] { (uint)sendCommandArgs.TotalRefPulses, (uint)sendCommandArgs.MassRefPulses },
(uint)sendCommandArgs.TestMethods,
Convert.ToSingle(filterConstants[0]),
fmFreq,
(uint)regConst,
(uint)shortImp,
(uint)sendCommandArgs.StopDevs);
#elif GENESIS || DEWA_300 || ROMA_200
ctrlBrdComponent.SendCommand((uint)sendCommandArgs.Cmd,
(byte)sendCommandArgs.RefFlowmtrNr,
(ulong)(route & (UInt128)0xFFFFFFFFFFFFFFFF),
(ulong)(route >> 64),
new uint[] { (uint)sendCommandArgs.TotalRefPulses, (uint)sendCommandArgs.MassRefPulses },
(uint)sendCommandArgs.TestMethods,
filterConstants,
fmFreq,
(uint)regConst,
(uint)shortImp,
(uint)sendCommandArgs.StopDevs);
#elif JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || SENTEC || FUZHOU_100 || CEVAK_200 || IZRAEL_50 || ALZIR_25
ctrlBrdComponent.SendCommand((uint)sendCommandArgs.Cmd,
(byte)sendCommandArgs.RefFlowmtrNr,
(ulong)route,
new uint[] { (uint)sendCommandArgs.TotalRefPulses, (uint)sendCommandArgs.MassRefPulses },
(uint)sendCommandArgs.TestMethods,
filterConstants,
fmFreq,
(uint)regConst,
(uint)shortImp,
(uint)sendCommandArgs.StopDevs);
#else /// if TURA_IPERL || TURA_IPERL_NEW || TURA_SPECIAL || MALTA_WSD25 || SLM_50 || SLM_END || WARSAW_END || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || BADGER_STREDNA_TRAT || PUCHONG_200
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, pulsesArr, (uint)testMethods,
Convert.ToSingle(filterConstants[0]), fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
ctrlBrdComponent.SendCommand((uint)sendCommandArgs.Cmd,
(byte)sendCommandArgs.RefFlowmtrNr,
(ulong)route,
new uint[] { (uint)sendCommandArgs.TotalRefPulses, (uint)sendCommandArgs.MassRefPulses },
(uint)sendCommandArgs.TestMethods,
Convert.ToSingle(filterConstants[0]),
fmFreq,
(uint)regConst,
(uint)shortImp,
(uint)sendCommandArgs.StopDevs);
#endif
log.DebugFormat("DoSendCommand() Route = {0}", Utils.RouteToStr(route));
if (lastRoute != route) /// This is to update the MainWnd status bar on changes only
if (lastRoute != route) /// This is to update the MainWnd status bar on changes only
{
UInt128 rRoute = RRoute;
Program.MainWnd.UpdateRoute(string.Format("{0} ({1})", Utils.RouteToStr(route), Utils.RouteToStr(rRoute)));
lastRoute = route;
lastRoute = route;
}
}
+1 -1
View File
@@ -24,7 +24,7 @@ namespace TBF.BenchControl.Elde.CoverTest
readonly ulong mask; /// derived from bitPosition in the constructor
readonly ulong target;
readonly string message;
readonly Users.Grp.GID[] bypassLevel;
readonly Users.Entities.GID[] bypassLevel;
public CoverTest()
{
@@ -22,7 +22,7 @@ namespace TBF.BenchControl.Elde.CoverTest
public int BitPosition;
public bool Invert;
public string Message;
public Users.Grp.GID[] BypassLevel;
public Users.Entities.GID[] BypassLevel;
/// Private parameterless constructor invoked by all other (public) constructors
CoverTestCfg()
@@ -35,7 +35,7 @@ namespace TBF.BenchControl.Elde.CoverTest
Invert = false;
Message = Strings.Close_the_cover;
BypassLevel = new Users.Grp.GID[] { Users.Grp.GID.TestingSpecialists };
BypassLevel = new Users.Entities.GID[] { Users.Entities.GID.TestingSpecialists };
}
public CoverTestCfg(IComponentFactory factory)
@@ -46,7 +46,7 @@ namespace TBF.BenchControl.Elde.CoverTest
}
}
for (Users.Grp.GID gid = 0; gid < Users.Grp.GID.NrOfGroups; gid++)
for (Users.Entities.GID gid = 0; gid < Users.Entities.GID.NrOfGroups; gid++)
{
bypassLevelComboBox.Items.Add(gid.ToString());
}
@@ -94,11 +94,11 @@ namespace TBF.BenchControl.Elde.CoverTest
config.Message = messageTextBox.Text;
config.BypassLevel = null;
for (Users.Grp.GID gid = 0; gid < Users.Grp.GID.NrOfGroups; gid++)
for (Users.Entities.GID gid = 0; gid < Users.Entities.GID.NrOfGroups; gid++)
{
if (bypassLevelComboBox.Text == gid.ToString())
{
config.BypassLevel = new Users.Grp.GID[] { gid };
config.BypassLevel = new Users.Entities.GID[] { gid };
break;
}
}
@@ -18,9 +18,9 @@ namespace TBF.BenchControl.Elde.CoverTest
public bool Completed { get { return completed; } }
bool completed;
Users.Grp.GID[] bypassLevel;
Users.Entities.GID[] bypassLevel;
public CoverTestForm(string message, Users.Grp.GID[] bypassLevel, ILog bypassLog)
public CoverTestForm(string message, Users.Entities.GID[] bypassLevel, ILog bypassLog)
{
InitializeComponent();
ControlBox = false;
+1 -1
View File
@@ -113,7 +113,7 @@ namespace TBF.BenchControl.Elde.Diverter
{
divNrFromName = nextIdx;
}
#if GENESIS || PETERSBURG_50 || PETERSBURG_200 || FUZHOU_50 || FUZHOU_150 || FUZHOU_300
#if GENESIS || PETERSBURG_50 || PETERSBURG_200 || FUZHOU_50 || FUZHOU_150 || FUZHOU_300 || ROMA_200
flowMtrNr4Cmd = divNrFromName + 1;
#elif BADGER_STREDNA_TRAT
flowMtrNr4Cmd = (divNrFromName == 1) ? 1 : ((divNrFromName == 2) ? 9 : 20);
+2 -2
View File
@@ -56,7 +56,7 @@ namespace TBF.BenchControl.Elde
public void Start()
{
controlBoard.SyncRoute();
controlBoard.SendCommand(commandOnStartOp, 0, controlBoard.Route, 0, 0, testMethod, StopDevs.None);
controlBoard.SendCommand(commandOnStartOp, 0, 0, 0, testMethod, StopDevs.None);
opState = OpState.StartingCommand;
}
@@ -99,7 +99,7 @@ namespace TBF.BenchControl.Elde
if (commandOnStopOp != Command.None)
{
controlBoard.SyncRoute();
controlBoard.SendCommand(commandOnStopOp, 0, controlBoard.Route, 0, 0, testMethod, StopDevs.None);
controlBoard.SendCommand(commandOnStopOp, 0, 0, 0, testMethod, StopDevs.None);
}
}
}
@@ -17,6 +17,15 @@ namespace TBF.BenchControl.Elde.FixedStartRegisterReader
readonly ControlBoardDev controlBoard;
public int Position
{
get
{
int firstDigitPos = Name.IndexOfAny(new char[] { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' });
int position;
return (firstDigitPos < 0) ? 0 : (int.TryParse(Name.Substring(firstDigitPos), out position) ? position : 0);
}
}
public Config.Entities.RegisterReaderType RegisterReaderType { get { return Config.Entities.RegisterReaderType.Manual; } }
public double PulsesPerLtr { get { return registerReaderCfg.ProcParams.PulsesPerLtr; } }
public double LtrsPerPulse { get { return (PulsesPerLtr <= float.Epsilon) ? 1.0 : (1 / PulsesPerLtr); } }
@@ -22,8 +22,6 @@ namespace TBF.BenchControl.Elde.FlowMeter
public double LtrPerPulseCorrected(double flow, int rangeIx)
{
if (flow < 0.1 * NominalFlow) return LtrPerPulse; /// No correction for small flow
/// Apply correction
var rangeCorrections = new List<Config.Entities.MeasurementCorrection>();
foreach (var corr in Corrections)
@@ -28,22 +28,67 @@ namespace TBF.BenchControl.Elde.FlowMeterDewa
public double NominalFlow { get { return nominalFlow; } }
public double LtrPerPulse { get { return ltrPerPulse; } }
double[] refFreq;
double[] refFreq; /// 0..sum, 1..I11, 2..I12, 3..I13
int[] refPulses;
public double LtrPerPulseCorrected(double flow, int rangeIx)
{
if (flow < 0.1 * NominalFlow) return LtrPerPulse; /// No correction for small flow
log.DebugFormat("LtrPerPulseCorrected({0}, {1}) started", flow, rangeIx);
refFreq[0] = controlBoard.ReferenceFreqs(0);
refFreq[1] = controlBoard.ReferenceFreqs(1);
refFreq[2] = controlBoard.ReferenceFreqs(2);
refFreq[3] = controlBoard.ReferenceFreqs(3);
log.DebugFormat("refFreq[] = ({0}, {1}, {2}, {3})", refFreq[0], refFreq[1], refFreq[2], refFreq[3]);
refFreq[1] = refFreq[0] - refFreq[2] - refFreq[3];
double ltrPerPulseCorrected = 0;
if (flowMeter1 != null) ltrPerPulseCorrected += refFreq[1] * flowMeter1.LtrPerPulseCorrected(flow * refFreq[1] / refFreq[0], rangeIx);
if (flowMeter2 != null) ltrPerPulseCorrected += refFreq[2] * flowMeter2.LtrPerPulseCorrected(flow * refFreq[2] / refFreq[0], rangeIx);
if (flowMeter3 != null) ltrPerPulseCorrected += refFreq[3] * flowMeter3.LtrPerPulseCorrected(flow * refFreq[3] / refFreq[0], rangeIx);
return ltrPerPulseCorrected / refFreq[0];
refPulses[0] = controlBoard.EtPulses(0);
refPulses[2] = controlBoard.EtPulses2;
refPulses[3] = controlBoard.EtPulses3;
refPulses[1] = refPulses[0] - refPulses[2] - refPulses[3];
log.DebugFormat("refPulses[] = ({0}, {1}, {2}, {3})", refPulses[0], refPulses[1], refPulses[2], refPulses[3]);
double flow1, flow2, flow3;
double contribution1, contribution2, contribution3;
if (refPulses[0] != 0)
{
/// Division by zero prevented inside this 'if'
double ltrPerPulseCorrected = 0;
if (flowMeter1 != null)
{
double ratio = (double)refPulses[flowMeter1.Idx1] / (double)refPulses[0];
flow1 = flow * ratio;
contribution1 = flowMeter1.LtrPerPulseCorrected(flow1, rangeIx) * ratio;
ltrPerPulseCorrected += contribution1;
log.DebugFormat("flowmeter1 = {0}, flow1 = {1}, contribution1 = {2}", flowMeter1.Name, flow1, contribution1);
}
if (flowMeter2 != null)
{
double ratio = (double)refPulses[flowMeter2.Idx1] / (double)refPulses[0];
flow2 = flow * ratio;
contribution2 = flowMeter2.LtrPerPulseCorrected(flow2, rangeIx) * ratio;
ltrPerPulseCorrected += contribution2;
log.DebugFormat("flowmeter2 = {0}, flow2 = {1}, contribution2 = {2}", flowMeter2.Name, flow2, contribution2);
}
if (flowMeter3 != null)
{
double ratio = (double)refPulses[flowMeter3.Idx1] / (double)refPulses[0];
flow3 = flow * ratio;
contribution3 = flowMeter3.LtrPerPulseCorrected(flow3, rangeIx) * ratio;
ltrPerPulseCorrected += contribution3;
log.DebugFormat("flowmeter3 = {0}, flow3 = {1}, contribution3 = {2}", flowMeter3.Name, flow3, contribution3);
}
log.DebugFormat("LtrPerPulseCorrected() returns {0}", ltrPerPulseCorrected);
return ltrPerPulseCorrected;
}
else
{
log.DebugFormat("LtrPerPulseCorrected() returns 1");
return 1;
}
}
@@ -56,7 +101,9 @@ namespace TBF.BenchControl.Elde.FlowMeterDewa
public FlowMeter()
{
}
refFreq = new double[4];
refPulses = new int[4];
}
public FlowMeter(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
: base(cfg)
@@ -80,6 +127,7 @@ namespace TBF.BenchControl.Elde.FlowMeterDewa
ltrPerPulse = nominalFlow / (flowMetersCount * 7200.0); /// Nominal freq. is flowMetersCount * 2000 Hz (2000, 4000 or 6000 Hz)
refFreq = new double[4];
refPulses = new int[4];
log.Debug(this.ToString());
}
@@ -22,8 +22,6 @@ namespace TBF.BenchControl.Elde.FlowMeterTriplet
public double LtrPerPulseCorrected(double flow, int rangeIx)
{
if (flow < 0.1 * NominalFlow) return LtrPerPulse; /// No correction for small flow
/// Apply correction
double correctedFlow = Config.Formulas.CorrectedValue(flow, Corrections);
return (LtrPerPulse * correctedFlow / flow);
+11 -15
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
///
using System;
using Dirichlet.Numerics;
@@ -11,7 +11,9 @@ namespace TBF.BenchControl.Elde
StatusP StatusP { get; }
int EtPulses(int wmNr1);
int EtPulsesK { get; }
UInt16 WMeterPulses(int wmNr1);
int EtPulses2 { get; }
int EtPulses3 { get; }
UInt16 WMeterPulses(int wmNr1);
int WMeterReference(int wmNr0);
uint RegulValveDAC(int rvNr0);
float Pressure(int prsNr0);
@@ -59,19 +61,13 @@ namespace TBF.BenchControl.Elde
/// <summary>
/// Updates a command that is regularly sent to the control board by SendCommand.
/// </summary>
/// <param name="cmd">See ControlBoard.Command enum</param>
/// <param name="refNr">Number of the etalon/reference (1..5)</param>
/// <param name="route">Route: 64-bit installation specific number</param>
/// <param name="totalRefPulses">Kolko impulzov ma trvat skuska</param>
/// <param name="massRefPulses">Pri 'MassAndContinue' metode kolko impulzov ma trvat mass measurement</param>
/// <param name="testMethods">See ControlBoard.TestMethods enum</param>
/// <param name="filterConstant">0 = No filtering (0..255)</param>
/// <param name="FMFreq">Freq.inverter control (not applicable in DT100, Munich)</param>
/// <param name="regConst">Coefficient used to control reg. valves (1..100)</param>
/// <param name="shortImp">0 = default value, 1 = spec. processing of very short pulses</param>
/// <param name="stopDevs">What to stop</param>
void SendCommand(Command cmd, int refNr, UInt128 route, int totalRefPulses, int massRefPulses, TestMethods testMethods,
uint[] filterConstants, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs);
/// <param name="sendCommandArgs">Arguments, see SendCommandArgs class</param>
/// <param name="route">State of valves, 128-bit word</param>
/// <param name="filterConstants">Array with length=8 of filter costants (0..255, 0 = no filtering)</param>
/// <param name="fmFreq">Freq.inverter control (not applicable in DT100, Munich)</param>
/// <param name="regConst">PID coefficient for flow control</param>
/// <param name="shortImp">0 = default value, 1 = spec. processing of very short pulses</param>
void SendCommand(SendCommandArgs sendCommandArgs, UInt128 route, uint[] filterConstants, float[] fmFreq, int regConst, int shortImp);
/// <summary>
/// Control of regulating valves.
@@ -132,7 +132,7 @@ namespace TBF.BenchControl.Elde
void SendCommand()
{
controlBoard.SyncRoute();
controlBoard.SendCommand(Command.ReadDivTransition, 0, controlBoard.Route, 0, 0, 0, StopDevs.None);
controlBoard.SendCommand(Command.ReadDivTransition, 0, 0, 0, 0, StopDevs.None);
cmdSent = true;
}
@@ -110,13 +110,12 @@ namespace TBF.BenchControl.Elde.RegisterReader
wmPulses = lastPulses;
wmRefPulses = (int)controlBoard.EtPulses(Position);
log.DebugFormat("{0}:ReadPulses() completed, wmPulses={1} wmRefPulses={2} cb.EtPulses(0)={3}", Name, wmPulses, wmRefPulses, (int)controlBoard.EtPulses(0));
log.DebugFormat("{0}:ReadPulses() completed, wmPulses={1} wmRefPulses={2}", Name, wmPulses, wmRefPulses);
}
/// <summary>Start this operation</summary>
public void Start()
{
log.DebugFormat("{0}:Start()", Name);
lastPulsesValid = false;
ReadPulses();
}
@@ -125,7 +124,6 @@ namespace TBF.BenchControl.Elde.RegisterReader
/// <returns>eventDone</returns>
public Event Run()
{
log.DebugFormat("{0}:Run()", Name);
ReadPulses();
return Event.ReadRegisterDone;
}
@@ -133,7 +131,6 @@ namespace TBF.BenchControl.Elde.RegisterReader
/// <summary>Stop this operation</summary>
public void Stop()
{
log.DebugFormat("{0}:Stop()", Name);
ReadPulses();
}
}
@@ -108,14 +108,9 @@ namespace TBF.BenchControl.Elde.RegulValve
#endif
if (Idx1 < ControlBoard.RegValveCalib.GetLength(0))
{
#if IZRAEL_25
{
this.ControlBoard.RegValveCalib[adcChannel, 0] = (uint)DacValueClosed;
this.ControlBoard.RegValveCalib[adcChannel, 1] = (uint)DacValueOpen;
#else
this.ControlBoard.RegValveCalib[Idx1 - 1, 0] = (uint)DacValueClosed;
this.ControlBoard.RegValveCalib[Idx1 - 1, 1] = (uint)DacValueOpen;
#endif
}
else
{

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