Compare commits

..
Author SHA1 Message Date
Milan Hanajik 7c070fc635 Config project and DB cleanup 2020-01-13 14:24:39 +01:00
Milan Hanajik 4090bd1618 UsersGroups table added to config DB, User and Group have ManyToMany relation, ver. 2.25.1400 2020-01-13 14:24:25 +01:00
Milan Hanajik ab43cabc57 (1) RestClient project added, (2) Testmethods.Q2CorrectionFromHisotry modified. 2020-01-13 14:10:28 +01:00
Milan Hanajik 91461eb2cc .NET Framework 4.7.2 2020-01-13 14:10:20 +01:00
Milan Hanajik aa18b75ef8 CHARACTER SET utf8 COLLATE utf8_unicode-ci after creating/importing a database. 2020-01-13 14:10:13 +01:00
Milan Hanajik f029fdbd2e Publish and Evaluate were added to PTest, are specified in Test profiles. 2020-01-13 14:08:06 +01:00
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
409 changed files with 97812 additions and 6187 deletions
+2
View File
@@ -14,6 +14,8 @@ GraphLib/bin
GraphLib/obj
TracingDB/bin
TracingDB/obj
RestClient/bin
RestClient/obj
Results/bin/
Results/obj/
ResultsBrowser/bin/
+9 -8
View File
@@ -10,8 +10,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Config</RootNamespace>
<AssemblyName>Config</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -23,6 +24,7 @@
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -31,6 +33,7 @@
<DefineConstants>TRACE;MUNICH</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="FluentNHibernate">
@@ -83,7 +86,8 @@
<Compile Include="Entities\MetersPath.cs" />
<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" />
@@ -91,8 +95,6 @@
<Compile Include="Entities\User.cs" />
<Compile Include="Entities\VirtualBenchSequence.cs" />
<Compile Include="Entities\VirtualBenchStep.cs" />
<Compile Include="Entities\Watermeter.cs" />
<Compile Include="Entities\WMType.cs" />
<Compile Include="FluentCommon.cs" />
<Compile Include="Formulas.cs" />
<Compile Include="Mappings\BenchPathMap.cs" />
@@ -106,15 +108,13 @@
<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" />
<Compile Include="Mappings\UncertaintyMap.cs" />
<Compile Include="Mappings\UserMap.cs" />
<Compile Include="Mappings\VirtualBenchSequenceMap.cs" />
<Compile Include="Mappings\VirtualBenchStepMap.cs" />
<Compile Include="Mappings\WatermeterMap.cs" />
<Compile Include="Mappings\WMTypeMap.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Resources\Strings.Designer.cs">
<AutoGen>True</AutoGen>
@@ -127,6 +127,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),
}
}
+11 -8
View File
@@ -1,24 +1,27 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
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 virtual long AccessFlags { get; set; } /// Bitfield of access flags: bit0 .. bit62
public virtual IList<User> Users { get; set; } /// Group can be a member of a list of users
public Group()
{
Users = new List<User>();
}
public Group(int gid, string name)
{
Gid = gid;
Name = name;
public Group(Users.Entities.GID gid)
: this()
{
GID = gid;
}
}
}
}
+337
View File
@@ -0,0 +1,337 @@
///
/// 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 Publish { get; set; } /// 0=no, 1=in all protocols, 2=on screen, 3=internal
public virtual bool Evaluate { get; set; }
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]
Publish = (sbyte)Config.Entities.Publish.Always;
Evaluate = true;
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.Publish = Publish;
result.Evaluate = Evaluate;
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(Publish.ToString());
output.WriteLine(Evaluate.ToString());
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);
tst.Publish = sbyte.Parse(input.ReadLine());
tst.Evaluate = bool.Parse(input.ReadLine());
/// 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", PressLimLo.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != PressLimHi.ToString(ci)) { diff.AppendFormat(fmt, "Pressure_max", PressLimHi.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Publish.ToString()) { diff.AppendFormat(fmt, "Publish", Publish.ToString(), ln); };
ln = inp.ReadLine(); if (ln != Evaluate.ToString()) { diff.AppendFormat(fmt, "Evaluate", Evaluate.ToString(), 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);
-31
View File
@@ -1,31 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
namespace Config.Entities
{
public class ProcedureHistory
{
public virtual int Id { get; protected set; }
public virtual Procedure Current { get; set; }
public virtual IList<Procedure> OldProcedures { get; set; }
/// ------------- Additional stuff not mapped into the database -------------
public ProcedureHistory()
{
Current = new Procedure();
OldProcedures = new List<Procedure>();
}
public virtual ProcedureHistory Clone()
{
ProcedureHistory result = new ProcedureHistory();
result.Current = Current.Clone();
foreach (Procedure p in OldProcedures) result.OldProcedures.Add(p.Clone());
return result;
}
}
}
+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
-78
View File
@@ -1,78 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/// This class holds the watermeter type specific data
/// that have all watermaters of the same type in common
namespace Config.Entities
{
public class WMType
{
// mapped
public virtual int Id { get; protected set; } /// primary key
public virtual DateTime CreateTime { get; set; } /// Date and time of the creation or change
public virtual string CreateUserName { get; set; } /// Name of the user who has created or changed this procedure
public virtual string CreateDescription { get; set; } /// Description\
public virtual string Name { get; set; } /// type name
public virtual float PulseRate { get; set; } /// Pulses per Liter
// not yet mapped
public virtual int IdentNr { get; protected set; } /// identification number of watermeter tzpe
public virtual int Diameter { get; set; } /// nominal diameter
public virtual int Pressure { get; set; } /// nominal pressure
public virtual int Length { get; set; } /// construction length
public virtual int Temperatur { get; set; } /// nominal temperature in C
public virtual float NominalFlow { get; set; } /// nominal flow Qn
/// ------------- Additional stuff not mapped into the database -------------
public WMType()
{
}
public static WMType DefaultWMType()
{
WMType procedure = new WMType()
{
CreateTime = DateTime.Now,
CreateUserName = Users.GlobalData.CurrentUser.UserName,
CreateDescription = "A default water meter created.",
Name = "Watermeter",
PulseRate = 1000,
};
return procedure;
}
public virtual WMType Clone()
{
WMType result = new WMType();
result.CreateTime = CreateTime;
result.CreateUserName = CreateUserName;
result.CreateDescription = CreateDescription;
result.Name = Name;
result.PulseRate = PulseRate;
return result;
}
public override string ToString()
{
string result = "";
result += "WMTpe: " + Environment.NewLine;
result += " Name = " + Name + Environment.NewLine;
result += " Created by = " + CreateUserName + Environment.NewLine;
result += " Created on = " + CreateTime.ToString() + Environment.NewLine;
result += " Description = " + CreateDescription + Environment.NewLine;
result += " Pulse rate = " + PulseRate.ToString() + Environment.NewLine;
return result;
}
}
}
-40
View File
@@ -1,40 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate;
using FluentNHibernate;
namespace Config.Entities
{
public class Watermeter
{
public virtual int Id { get; protected set; } /// primary key
public virtual DateTime CreateTime { get; set; } /// Date and time of the creation or change
public virtual string CreateUserName { get; set; } /// Name of the user who has created or changed this procedure
public virtual string CreateDescription { get; set; } /// Description
/// mapped
public virtual string Serial { get; set; } /// serial number
public virtual WMType WMType { get; set; } /// type of watermeter
///
/// <summary>
/// Load a watermeter from the database
/// </summary>
public static Watermeter LoadBySerialnr(string SerialNr)
{
IList<Watermeter> ListOfWatermeters = FluentCommon.CreateSession(Users.Entities.DBKind.Results)
.CreateQuery("FROM Watermeter WHERE Serial = :SerialNrParameter")
.SetParameter("SerialNrParameter", SerialNr)
.List<Watermeter>();
if (ListOfWatermeters.Count > 0) return ListOfWatermeters.ElementAt(0);
return null;
}
}
}
+28 -22
View File
@@ -145,17 +145,8 @@ namespace Config
using (var transaction = session.BeginTransaction())
{
///
/// Prepare all groups
/// Create user 'admin'
///
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);
/// Create the user 'admin' add his groups
var admin = new Config.Entities.User
{
UserName = Data.AdminUsername,
@@ -163,20 +154,35 @@ namespace Config
LastPwChange = DateTime.Now
};
admin.SetPassword(Data.AdminPassword);
admin.AddGroup(testers);
admin.AddGroup(testingSpecialists);
admin.AddGroup(headOfLab);
admin.AddGroup(maintenanceSpecialists);
admin.AddGroup(metrologists);
admin.AddGroup(calibrationSpecialists);
admin.AddGroup(administrators);
session.SaveOrUpdate(admin);
///// Create the control board component
//var cmpnt = (new BenchControl.Elde.ControlBoardCfg(new BenchControl.Elde.ControlBoardFactory())).CreateDbEntity();
//session.SaveOrUpdate(cmpnt);
///
/// Prepare all groups, add some of them to admin
///
for (Users.Entities.GID gid = 0; gid < Users.Entities.GID.NrOfGroups; gid++)
{
Config.Entities.Group group = new Config.Entities.Group(gid);
switch (gid)
{
case Users.Entities.GID.Testers:
case Users.Entities.GID.TestingSpecialists:
case Users.Entities.GID.HeadOfLab:
case Users.Entities.GID.MaintenanceSpecialists:
case Users.Entities.GID.Metrologists:
case Users.Entities.GID.CalibrationSpecialists:
case Users.Entities.GID.Administrators:
#if TURA_IPERL || TURA_IPERL_NEW || TURA_SPECIAL
case Users.Entities.GID.TraceabilityManagement:
#elif KEMPNO_50 || KRAKOW_50 || TORUN_50 || WARSAW_END
case Users.Entities.GID.MetrologicalAuthority:
case Users.Entities.GID.WaterMeterAuthority:
#endif
admin.AddGroup(group);
session.SaveOrUpdate(group); /// Save this group
break;
}
}
session.SaveOrUpdate(admin); /// Save user 'admin'
transaction.Commit();
}
}
+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;
}
}
}
+10 -3
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
@@ -7,11 +7,18 @@ namespace Config.Mappings
{
class GroupMap : ClassMap<Entities.Group>
{
/// <seealso>
/// https://stackoverflow.com/questions/9108083/fluent-nhibernate-many-to-many-mapping-way/9125059
/// </seealso>
public GroupMap()
{
Id(x => x.Id);
Map(x => x.Gid);
Map(x => x.Name);
Map(x => x.GID).Column("Name");
Map(x => x.AccessFlags);
HasManyToMany(x => x.Users)
.Cascade.SaveUpdate()
.Inverse()
.Table("UsersGroups");
}
}
}
+60
View File
@@ -0,0 +1,60 @@
///
/// 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.Publish);
Map(x => x.Evaluate);
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);
}
+5 -5
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2016-2019 Sensus Slovensko a.s.
/// Copyright (c) 2016-2020 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
@@ -12,16 +12,16 @@ 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)
.Cascade.All();
HasManyToMany(x => x.Groups)
.Cascade.SaveUpdate()
.Table("UsersGroups");
}
}
}
@@ -1,22 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using FluentNHibernate.Mapping;
using Config.Entities;
namespace Config.Mappings
{
class VirtualBenchSequenceMap : ClassMap<VirtualBenchSequence>
{
public VirtualBenchSequenceMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.Description);
HasMany(x => x.VirtualBenchSteps)
.OrderBy("ItemNr")
.Cascade.All();
}
}
}
-20
View File
@@ -1,20 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using FluentNHibernate.Mapping;
using Config.Entities;
namespace Config.Mappings
{
class VirtualBenchStepMap : ClassMap<VirtualBenchStep>
{
public VirtualBenchStepMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Duration);
References(x => x.VirtualBenchSequence);
}
}
}
-20
View File
@@ -1,20 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using FluentNHibernate.Mapping;
namespace Config.Mappings
{
class WMTypeMap : ClassMap<Entities.WMType>
{
public WMTypeMap()
{
Id(x => x.Id);
Map(x => x.CreateTime);
Map(x => x.CreateUserName);
Map(x => x.CreateDescription);
Map(x => x.Name);
Map(x => x.PulseRate);
}
}
}
-19
View File
@@ -1,19 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using FluentNHibernate.Mapping;
namespace Config.Mappings
{
class WatermeterMap : ClassMap<Entities.Watermeter>
{
public WatermeterMap()
{
Id(x => x.Id);
Map(x => x.Serial);
// HasOne(x => x.WMType)
// .Cascade.All();
References(x => x.WMType);
}
}
}
+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.25.1400.0")]
[assembly: AssemblyFileVersion("2.25.1400.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;
}
}
}
}
+3 -1
View File
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Decrypt</RootNamespace>
<AssemblyName>Decrypt</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
@@ -24,6 +24,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
@@ -33,6 +34,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<StartupObject>Decrypt.Program</StartupObject>
+1 -1
View File
@@ -1,3 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup></configuration>
+3 -1
View File
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DeviceTest</RootNamespace>
<AssemblyName>DeviceTest</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
@@ -24,6 +24,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
@@ -33,6 +34,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<StartupObject>DeviceTest.Program</StartupObject>
+1 -1
View File
@@ -12,7 +12,7 @@ namespace DeviceTest.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+1 -1
View File
@@ -1,3 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup></configuration>
+7 -4
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -10,9 +10,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Dirichlet.Numerics</RootNamespace>
<AssemblyName>Dirichlet.Numerics</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -22,6 +23,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -30,6 +32,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
@@ -48,4 +51,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
+3 -1
View File
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Encrypt</RootNamespace>
<AssemblyName>Encrypt</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
@@ -24,6 +24,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
@@ -33,6 +34,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<StartupObject>Encrypt.Program</StartupObject>
+1 -1
View File
@@ -1,3 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup></configuration>
+5 -1
View File
@@ -28,7 +28,7 @@
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
@@ -66,6 +66,7 @@
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
@@ -87,6 +88,7 @@
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
@@ -99,6 +101,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
@@ -110,6 +113,7 @@
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System">
+4 -1
View File
@@ -10,12 +10,13 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ClassLibrary1</RootNamespace>
<AssemblyName>GraphLib</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>2.0</OldToolsVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -25,6 +26,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -33,6 +35,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
+12 -12
View File
@@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.18408
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@@ -13,12 +13,12 @@ namespace ClassLibrary1.Properties {
/// <summary>
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
@@ -33,7 +33,7 @@ namespace ClassLibrary1.Properties {
}
/// <summary>
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
@@ -47,8 +47,8 @@ namespace ClassLibrary1.Properties {
}
/// <summary>
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
+198
View File
@@ -0,0 +1,198 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
namespace RestClient
{
public class BaseClient
{
private string _token;
private string _baseUrl;
public string ErrorMessage { get; set; }
private readonly HttpClient client;
private AuthenticationHeaderValue _authValue;
public BaseClient(string baseUrl)
{
this._baseUrl = baseUrl;
}
public void SetToken(string token)
{
_authValue = new AuthenticationHeaderValue("Bearer", token);
}
protected Uri GetUrl(string relativeUrl)
{
try
{
return new Uri(_baseUrl + relativeUrl);
}
catch (Exception)
{
Trace.TraceError("Invalid url " + relativeUrl);
return null;
}
}
protected async Task<TResult> GetResultAsync<TResult>(string relativeUrl)
{
ErrorMessage = String.Empty;
Uri url = null;
try
{
url = new Uri(_baseUrl + relativeUrl);
}
catch (Exception)
{
Trace.TraceError("Invalid url " + relativeUrl);
return default(TResult);
}
using (var client = GetClient())
{
try
{
var result = await client.GetAsync(url).ConfigureAwait(false);
var parsedResult = await result.Content.ReadAsStringAsync().ConfigureAwait(false);
if (result.IsSuccessStatusCode)
{
return JsonConvert.DeserializeObject<TResult>(parsedResult);
}
if (result.StatusCode == System.Net.HttpStatusCode.NotFound)
{
//Create not an error message, because communication is okay, only the meter is not available in database.
return default(TResult);
}
try
{
string Messages = await result.Content.ReadAsStringAsync();
var errors = JsonConvert.DeserializeObject<Dictionary<string, object>>(Messages);
string ServiceError = String.Empty;
if (errors != null)
{
ServiceError = errors["Message"].ToString();
}
ErrorMessage = string.Format("Error message: {0}", ServiceError);
}
catch
{
result.EnsureSuccessStatusCode();
}
return default(TResult);
}
catch (Exception ex)
{
string Message = ex.Message;
if (ex.InnerException != null)
{
Message += ". " + ex.InnerException.Message;
}
Trace.TraceError(Message);
ErrorMessage = Message;
return default(TResult);
}
}
}
/// <summary>
/// Post method.
/// </summary>
/// <typeparam name="TResult"></typeparam>
/// <param name="relativeUrl"></param>
/// <param name="Position"></param>
/// /// <param name="withBaseUrl"></param>
/// <returns>The new resource</returns>
protected async Task<string> PostWithReturnDataAsync<TResult>(string relativeUrl, bool withBaseUrl, TResult Position)
{
string data = string.Empty;
ErrorMessage = String.Empty;
Uri url = null;
try
{
if (withBaseUrl)
{
url = new Uri(_baseUrl + relativeUrl);
}
else
{
url = new Uri(relativeUrl);
}
}
catch (Exception ex)
{
Trace.TraceError("Invalid url " + url);
ErrorMessage = ex.Message;
return data;
}
using (var client = GetClient())
{
try
{
string json = JsonConvert.SerializeObject(Position);
HttpContent content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
HttpResponseMessage response = await client.PostAsync(url.ToString(), content).ConfigureAwait(false);
if (response.IsSuccessStatusCode)
{
data = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
return data;
}
else
{
if (response.StatusCode == HttpStatusCode.NotFound)
{
ErrorMessage = String.Format("Status code: {0}. Url: {1}", response.StatusCode, url);
}
else
{
string errorMessageService = string.Empty;
string message = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
if (string.IsNullOrEmpty(message))
{
errorMessageService = response.ReasonPhrase;
}
else
{
try
{
var errors = JsonConvert.DeserializeObject<Dictionary<string, object>>(message);
errorMessageService = errors["Message"].ToString();
}
catch (Exception)
{
errorMessageService = message;
}
}
ErrorMessage = String.Format("Status code: {0}. Error message: {1}", response.StatusCode, errorMessageService);
}
return data;
}
}
catch (Exception ex)
{
Trace.TraceError(ex.Message);
ErrorMessage = ex.Message;
return data;
}
}
}
protected HttpClient GetClient()
{
HttpClientHandler handler = new HttpClientHandler();
handler.ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; };
HttpClient client = new HttpClient(handler);
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = _authValue;
return client;
}
}
}
+82
View File
@@ -0,0 +1,82 @@
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Newtonsoft.Json;
using RestClient.Models;
namespace RestClient
{
public class GetQ2PreCorrectionClient : BaseClient
{
public GetQ2PreCorrectionClient(string baseUrl)
: base(baseUrl)
{ }
public async Task GetToken(string name, string password, string urlLogin)
{
LoginUser user = new LoginUser { Name = name, Password = password };
var response = await PostWithReturnDataAsync(urlLogin, false, user).ConfigureAwait(false);
var tmp = JsonConvert.DeserializeObject<CustomJwt>(response);
if (tmp != null)
{
SetToken(tmp.access_token);
}
else
{
throw new Exception(string.Format("No token loaded: {0}", ErrorMessage));
}
}
public async Task<Q2PreCorrection> GetQ2Correction(string relativeUrl)
{
ErrorMessage = String.Empty;
Uri url = GetUrl(relativeUrl);
if (url == null) return new Q2PreCorrection { AreDataCalculated = false, CorrLR = 0, CorrRL = 0, };
using (var client = GetClient())
{
try
{
var result = await client.GetAsync(url).ConfigureAwait(false);
string jsonResult = await result.Content.ReadAsStringAsync().ConfigureAwait(false);
if (result.IsSuccessStatusCode)
{
Q2PreCorrection retVal = new Q2PreCorrection();
string pattern = "\"areDataCalculated\":";
int position = jsonResult.IndexOf(pattern) + pattern.Length;
int length = jsonResult.Substring(position).IndexOfAny(new char[] { ',', '}', '\r', '\n' });
retVal.AreDataCalculated = bool.Parse(jsonResult.Substring(position, length));
pattern = "\"right\":";
position = jsonResult.IndexOf(pattern) + pattern.Length;
length = jsonResult.Substring(position).IndexOfAny(new char[] { ',', '}', '\r', '\n' });
retVal.CorrLR = int.Parse(jsonResult.Substring(position, length));
pattern = "\"left\":";
position = jsonResult.IndexOf(pattern) + pattern.Length;
length = jsonResult.Substring(position).IndexOfAny(new char[] { ',', '}', '\r', '\n' });
retVal.CorrRL = int.Parse(jsonResult.Substring(position, length));
return retVal;
}
else
{
return new Q2PreCorrection { AreDataCalculated = false, CorrLR = 0, CorrRL = 0, };
}
}
catch (Exception ex)
{
string Message = ex.Message;
if (ex.InnerException != null)
{
Message += ". " + ex.InnerException.Message;
}
Trace.TraceError(Message);
ErrorMessage = Message;
return new Q2PreCorrection { AreDataCalculated = false, CorrLR = 0, CorrRL = 0, };
}
}
}
}
}
+13
View File
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace RestClient.Models
{
public class CustomJwt
{
public string access_token { get; set; }
public string token_type { get; set; }
public int expires_in { get; set; }
}
}
+12
View File
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace RestClient.Models
{
public class LoginUser
{
public string Name { get; set; }
public string Password { get; set; }
}
}
+36
View File
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("RestClient")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RestClient")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("46e3b0e1-209f-4550-b0dd-d7e2c039b3ce")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+11
View File
@@ -0,0 +1,11 @@
using System;
namespace RestClient
{
public class Q2PreCorrection
{
public bool AreDataCalculated;
public int CorrLR;
public int CorrRL;
}
}
+59
View File
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{46E3B0E1-209F-4550-B0DD-D7E2C039B3CE}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RestClient</RootNamespace>
<AssemblyName>RestClient</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="BaseClient.cs" />
<Compile Include="GetQ2PreCorrectionClient.cs" />
<Compile Include="Models\CustomJwt.cs" />
<Compile Include="Models\LoginUser.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Q2PreCorrection.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net472" />
</packages>
+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.25.1400.0")]
[assembly: AssemblyFileVersion("2.25.1400.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>
+24 -1
View File
@@ -10,8 +10,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Results</RootNamespace>
<AssemblyName>Results</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -22,6 +23,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -30,6 +32,7 @@
<DefineConstants>TRACE;MUNICH</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="FluentNHibernate">
@@ -82,6 +85,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 +135,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 +207,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 +239,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")]
+1 -1
View File
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
+2 -2
View File
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -12,7 +12,7 @@ namespace ResultsBrowser.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+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>
+4 -1
View File
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ResultsBrowser</RootNamespace>
<AssemblyName>ResultsBrowser</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
@@ -25,6 +25,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
@@ -34,6 +35,7 @@
<DefineConstants>TRACE;MUNICH</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<StartupObject>ResultsBrowser.Program</StartupObject>
@@ -254,6 +256,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>
+1 -1
View File
@@ -1,3 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup></configuration>
+1 -1
View File
@@ -12,7 +12,7 @@ namespace Statistics.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+3 -1
View File
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Statistics</RootNamespace>
<AssemblyName>Statistics</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
@@ -24,6 +24,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
@@ -33,6 +34,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="FluentNHibernate">
+1 -1
View File
@@ -1,3 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup></configuration>
+16 -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}"
@@ -52,6 +50,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Decrypt", "Decrypt\Decrypt.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Encrypt", "Encrypt\Encrypt.csproj", "{DA9B09F3-A99D-4883-A954-537560453674}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RestClient", "RestClient\RestClient.csproj", "{46E3B0E1-209F-4550-B0DD-D7E2C039B3CE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -74,12 +74,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
@@ -210,6 +204,18 @@ Global
{DA9B09F3-A99D-4883-A954-537560453674}.Release|Mixed Platforms.Build.0 = Release|x86
{DA9B09F3-A99D-4883-A954-537560453674}.Release|x86.ActiveCfg = Release|x86
{DA9B09F3-A99D-4883-A954-537560453674}.Release|x86.Build.0 = Release|x86
{46E3B0E1-209F-4550-B0DD-D7E2C039B3CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{46E3B0E1-209F-4550-B0DD-D7E2C039B3CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{46E3B0E1-209F-4550-B0DD-D7E2C039B3CE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{46E3B0E1-209F-4550-B0DD-D7E2C039B3CE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{46E3B0E1-209F-4550-B0DD-D7E2C039B3CE}.Debug|x86.ActiveCfg = Debug|Any CPU
{46E3B0E1-209F-4550-B0DD-D7E2C039B3CE}.Debug|x86.Build.0 = Debug|Any CPU
{46E3B0E1-209F-4550-B0DD-D7E2C039B3CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{46E3B0E1-209F-4550-B0DD-D7E2C039B3CE}.Release|Any CPU.Build.0 = Release|Any CPU
{46E3B0E1-209F-4550-B0DD-D7E2C039B3CE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{46E3B0E1-209F-4550-B0DD-D7E2C039B3CE}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{46E3B0E1-209F-4550-B0DD-D7E2C039B3CE}.Release|x86.ActiveCfg = Release|Any CPU
{46E3B0E1-209F-4550-B0DD-D7E2C039B3CE}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -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.

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