Compare commits
288
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c60ee5ca7 | ||
|
|
76042756b1 | ||
|
|
2f3f67c82e | ||
|
|
97c041801f | ||
|
|
7d968ba9b4 | ||
|
|
d3cd831e03 | ||
|
|
20b2b9da97 | ||
|
|
55aff104ae | ||
|
|
9ba3fd34d3 | ||
|
|
bb8b4a6fd6 | ||
|
|
1b7dbec443 | ||
|
|
6f8ad1638f | ||
|
|
695cca6509 | ||
|
|
9417415781 | ||
|
|
a626cec54e | ||
|
|
4419c5361c | ||
|
|
70f3dbbf5d | ||
|
|
0e37e7217d | ||
|
|
5f4cf04edb | ||
|
|
58fad28546 | ||
|
|
c783967d87 | ||
|
|
b0c95c0677 | ||
|
|
439f20bc95 | ||
|
|
7576a68651 | ||
|
|
b6380ff896 | ||
|
|
c3fd5b9366 | ||
|
|
aa24558d07 | ||
|
|
40d4c74493 | ||
|
|
bc89faf220 | ||
|
|
0b12e79820 | ||
|
|
7bdb7f99d4 | ||
|
|
afea809b97 | ||
|
|
3122f6dd9a | ||
|
|
a2f0781fb4 | ||
|
|
31a684f03a | ||
|
|
89eddaa3c2 | ||
|
|
b060068a95 | ||
|
|
3ffdf4e2cc | ||
|
|
7d1d95305f | ||
|
|
98fc15a709 | ||
|
|
a8e0a8087d | ||
|
|
f81c30f072 | ||
|
|
05f6c8c75c | ||
|
|
76a08324b4 | ||
|
|
2a98c485ef | ||
|
|
872409870e | ||
|
|
f48a71ce12 | ||
|
|
d2d571945c | ||
|
|
bd9c3aa5e2 | ||
|
|
73ea0ff586 | ||
|
|
78408ed5eb | ||
|
|
f04cdccd20 | ||
|
|
82acf60f2e | ||
|
|
68413867ad | ||
|
|
1fd8881d53 | ||
|
|
cebdd71065 | ||
|
|
668304cb72 | ||
|
|
c28c5a5554 | ||
|
|
450493069c | ||
|
|
d7519aa95a | ||
|
|
e89ab89874 | ||
|
|
025fa81941 | ||
|
|
845c66b511 | ||
|
|
3725e238fc | ||
|
|
ac2ac82187 | ||
|
|
5e6be0c4b4 | ||
|
|
ed66c6a259 | ||
|
|
0db7736247 | ||
|
|
02cebe0966 | ||
|
|
4f2bb6291f | ||
|
|
498c8afbe4 | ||
|
|
0e6dce4750 | ||
|
|
7a74579c8b | ||
|
|
c23630a980 | ||
|
|
205df83c1c | ||
|
|
b26f65dab4 | ||
|
|
8d1ac8f41d | ||
|
|
115916fd36 | ||
|
|
6641ed9d96 | ||
|
|
5e3d408706 | ||
|
|
8fc9e3e5ce | ||
|
|
e7aa9731d0 | ||
|
|
0fc63655e9 | ||
|
|
86b47cb434 | ||
|
|
b3ec97d95c | ||
|
|
1620758545 | ||
|
|
5a2d51db95 | ||
|
|
c0e99364a4 | ||
|
|
371a27c646 | ||
|
|
4a06dcff3e | ||
|
|
0f54bf86ac | ||
|
|
921c524f0e | ||
|
|
a8df9b50de | ||
|
|
5da9b1e94e | ||
|
|
63871c9bcc | ||
|
|
e5b61825ff | ||
|
|
2d484ea993 | ||
|
|
b5b7d50742 | ||
|
|
19d77a9ad9 | ||
|
|
e77c0460de | ||
|
|
2ad5843f4f | ||
|
|
631ef5fe20 | ||
|
|
cd246e89c8 | ||
|
|
438374532f | ||
|
|
92609b9ead | ||
|
|
07b51f12a2 | ||
|
|
16494389c6 | ||
|
|
be86f0278f | ||
|
|
7e7ae86f65 | ||
|
|
3b2139d3df | ||
|
|
16c59b5c47 | ||
|
|
49cc584914 | ||
|
|
aeefac1d4e | ||
|
|
2b30607d9c | ||
|
|
cef8d3ff95 | ||
|
|
64646486e9 | ||
|
|
769e68d49b | ||
|
|
3dcb134aa1 | ||
|
|
81cb0eae64 | ||
|
|
4fad9925ec | ||
|
|
92d246eda0 | ||
|
|
34479778b9 | ||
|
|
163d209071 | ||
|
|
8eb601f24d | ||
|
|
ac9407b59d | ||
|
|
00dd0ed8fd | ||
|
|
6a53417b62 | ||
|
|
90f2b83fc0 | ||
|
|
3382c6e77a | ||
|
|
072de642e1 | ||
|
|
489ebd04aa | ||
|
|
2a68934b0e | ||
|
|
f3a502b7df | ||
|
|
2b0e66c71d | ||
|
|
e5c01a14d9 | ||
|
|
e5ef10beac | ||
|
|
4c3c499ad5 | ||
|
|
bdc7f5abd8 | ||
|
|
0ff78b9d4c | ||
|
|
41959d863f | ||
|
|
e7d495e47d | ||
|
|
e4f5be3f41 | ||
|
|
f42c1b7f0c | ||
|
|
9dbca87429 | ||
|
|
49ae2a84c4 | ||
|
|
34073844bc | ||
|
|
6f3b9be77e | ||
|
|
f675c7ada2 | ||
|
|
6aee0a71ed | ||
|
|
fa818c5cf8 | ||
|
|
0ef9505af1 | ||
|
|
bf69524fd8 | ||
|
|
58df07300e | ||
|
|
bef4928162 | ||
|
|
5995204d8d | ||
|
|
69b7c94176 | ||
|
|
540bc8ca74 | ||
|
|
03920d5b90 | ||
|
|
765637ce2d | ||
|
|
b4596ae6e9 | ||
|
|
4c92cb7af0 | ||
|
|
770b8447ac | ||
|
|
f3532fc3cb | ||
|
|
a7cfbc0b76 | ||
|
|
608dd087b8 | ||
|
|
5d2871b9ed | ||
|
|
779c870613 | ||
|
|
3cd585fe41 | ||
|
|
ff27ae7635 | ||
|
|
a41e805e8d | ||
|
|
9bcf3aa7f6 | ||
|
|
ff2248720c | ||
|
|
9bd2cd2634 | ||
|
|
9ba1b58d2e | ||
|
|
1d8728c7ce | ||
|
|
af68f35400 | ||
|
|
de269b66b5 | ||
|
|
ea894c2db5 | ||
|
|
bd9785c195 | ||
|
|
044046080d | ||
|
|
04efa02089 | ||
|
|
426a21fd0b | ||
|
|
8523324962 | ||
|
|
f06f819adb | ||
|
|
ac8e766476 | ||
|
|
a67a709782 | ||
|
|
9543de4170 | ||
|
|
79fea707f3 | ||
|
|
1034c8e752 | ||
|
|
aa95f60a81 | ||
|
|
420cf6397b | ||
|
|
fce2fcf293 | ||
|
|
41c662f053 | ||
|
|
72d2b602ab | ||
|
|
dc08f308d0 | ||
|
|
910f15dfbf | ||
|
|
d4f8c23cce | ||
|
|
324be83f9b | ||
|
|
ea8d4cb63d | ||
|
|
7b5231af80 | ||
|
|
63b7b83363 | ||
|
|
7a814c2a00 | ||
|
|
76053d466b | ||
|
|
6020d6e4eb | ||
|
|
61d06dc910 | ||
|
|
e889215cf4 | ||
|
|
cdc971f733 | ||
|
|
863856d27d | ||
|
|
cf5dd8cb71 | ||
|
|
619c06a511 | ||
|
|
9b85630405 | ||
|
|
078dc08ed0 | ||
|
|
f82658cee2 | ||
|
|
7c2135a8fe | ||
|
|
b5383a445e | ||
|
|
f3c0da79e8 | ||
|
|
c4c221f58c | ||
|
|
2a622d4aa2 | ||
|
|
baa67cfe02 | ||
|
|
d0cddd072c | ||
|
|
e20a95029c | ||
|
|
392a02b83c | ||
|
|
385825c9e8 | ||
|
|
acb5491225 | ||
|
|
5d4dedcb25 | ||
|
|
775af25d1b | ||
|
|
c4e4bb2e77 | ||
|
|
7e2781148e | ||
|
|
dd851fb344 | ||
|
|
531a728b37 | ||
|
|
f10c5797bb | ||
|
|
052f39d330 | ||
|
|
2e593d11eb | ||
|
|
e150624f4d | ||
|
|
ca9d83e424 | ||
|
|
3b1544b330 | ||
|
|
518a1f792c | ||
|
|
2f3b09ffc5 | ||
|
|
d9c60584eb | ||
|
|
d8e0772a0f | ||
|
|
875caf0e28 | ||
|
|
86601e1ba1 | ||
|
|
67a762e51c | ||
|
|
d6881bfdf3 | ||
|
|
878c89591e | ||
|
|
f332fd7141 | ||
|
|
bb3be1c649 | ||
|
|
e88175b349 | ||
|
|
c0f4c5acef | ||
|
|
1f9df9bb67 | ||
|
|
de4a0c61b9 | ||
|
|
0f3f54f8d0 | ||
|
|
60f7fbe4c3 | ||
|
|
37e84ee678 | ||
|
|
04878cea50 | ||
|
|
7c940bd633 | ||
|
|
5769b6ad48 | ||
|
|
b17d710044 | ||
|
|
441601bd42 | ||
|
|
d1f5bd8300 | ||
|
|
98c1194e5b | ||
|
|
85f2f31469 | ||
|
|
fe3867bc5c | ||
|
|
b2e467714e | ||
|
|
0993716c8e | ||
|
|
c19802fa13 | ||
|
|
efa5084d8b | ||
|
|
673e04a1b6 | ||
|
|
a4a589a40c | ||
|
|
0436906a59 | ||
|
|
f2a3c47cf7 | ||
|
|
80db263929 | ||
|
|
701c2f33bb | ||
|
|
dd8dce1d59 | ||
|
|
cd1bee1018 | ||
|
|
3f9312a606 | ||
|
|
f2c7b9904b | ||
|
|
9ac7f691e0 | ||
|
|
bf1da91018 | ||
|
|
3f8fc9475a | ||
|
|
72c3006c8a | ||
|
|
5c8ebd6476 | ||
|
|
2efdb8bb61 | ||
|
|
b9886599ed | ||
|
|
570570570b | ||
|
|
1593dc3070 | ||
|
|
9931138e5d | ||
|
|
91e7b95332 |
+6
-2
@@ -4,14 +4,18 @@ DeviceTest/bin/
|
|||||||
DeviceTest/obj/
|
DeviceTest/obj/
|
||||||
Dirichlet.Numerics/bin
|
Dirichlet.Numerics/bin
|
||||||
Dirichlet.Numerics/obj
|
Dirichlet.Numerics/obj
|
||||||
|
GemCard/bin
|
||||||
|
GemCard/obj
|
||||||
GraphLib/bin
|
GraphLib/bin
|
||||||
GraphLib/obj
|
GraphLib/obj
|
||||||
MonitoringDB/bin
|
TracingDB/bin
|
||||||
MonitoringDB/obj
|
TracingDB/obj
|
||||||
Results/bin/
|
Results/bin/
|
||||||
Results/obj/
|
Results/obj/
|
||||||
ResultsBrowser/bin/
|
ResultsBrowser/bin/
|
||||||
ResultsBrowser/obj/
|
ResultsBrowser/obj/
|
||||||
|
Statistics/bin/
|
||||||
|
Statistics/obj/
|
||||||
TBF/bin/
|
TBF/bin/
|
||||||
TBF/obj/
|
TBF/obj/
|
||||||
TBFSetup/Debug/
|
TBFSetup/Debug/
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
|
<DefineConstants>TRACE;DEBUG;ZODINO;LANG_RU</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
<DefineConstants>TRACE;MUNICH</DefineConstants>
|
<DefineConstants>TRACE;ZODINO;LANG_RU</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@@ -77,6 +77,8 @@
|
|||||||
<Compile Include="Entities\IHasItemNr.cs" />
|
<Compile Include="Entities\IHasItemNr.cs" />
|
||||||
<Compile Include="Entities\IHasName.cs" />
|
<Compile Include="Entities\IHasName.cs" />
|
||||||
<Compile Include="Entities\IHasValves.cs" />
|
<Compile Include="Entities\IHasValves.cs" />
|
||||||
|
<Compile Include="Entities\IParamsProvider.cs" />
|
||||||
|
<Compile Include="Entities\IperlEnums.cs" />
|
||||||
<Compile Include="Entities\MeasurementCorrection.cs" />
|
<Compile Include="Entities\MeasurementCorrection.cs" />
|
||||||
<Compile Include="Entities\MetersPath.cs" />
|
<Compile Include="Entities\MetersPath.cs" />
|
||||||
<Compile Include="Entities\OutputPath.cs" />
|
<Compile Include="Entities\OutputPath.cs" />
|
||||||
@@ -91,6 +93,7 @@
|
|||||||
<Compile Include="Entities\Watermeter.cs" />
|
<Compile Include="Entities\Watermeter.cs" />
|
||||||
<Compile Include="Entities\WMType.cs" />
|
<Compile Include="Entities\WMType.cs" />
|
||||||
<Compile Include="FluentCommon.cs" />
|
<Compile Include="FluentCommon.cs" />
|
||||||
|
<Compile Include="Formulas.cs" />
|
||||||
<Compile Include="Mappings\BenchPathMap.cs" />
|
<Compile Include="Mappings\BenchPathMap.cs" />
|
||||||
<Compile Include="Mappings\ComponentMap.cs" />
|
<Compile Include="Mappings\ComponentMap.cs" />
|
||||||
<Compile Include="Mappings\ComponentProcedureMap.cs" />
|
<Compile Include="Mappings\ComponentProcedureMap.cs" />
|
||||||
@@ -117,6 +120,7 @@
|
|||||||
<DependentUpon>Strings.resx</DependentUpon>
|
<DependentUpon>Strings.resx</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Units.cs" />
|
<Compile Include="Units.cs" />
|
||||||
|
<Compile Include="Utils.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="Resources\Strings.cs.resx" />
|
<EmbeddedResource Include="Resources\Strings.cs.resx" />
|
||||||
|
|||||||
+24
-6
@@ -14,25 +14,43 @@ namespace Config
|
|||||||
public const int CompoundWMsCount = 1;
|
public const int CompoundWMsCount = 1;
|
||||||
public const int HeatMetersCount = 0;
|
public const int HeatMetersCount = 0;
|
||||||
public const int MaxPartNr = 3;
|
public const int MaxPartNr = 3;
|
||||||
#elif DN100 || BADGER_STREDNA_TRAT || BADGER_VELKA_TRAT
|
#elif DN100 || BADGER_STREDNA_TRAT || BADGER_VELKA_TRAT || CEVAK_200
|
||||||
public const int WMsCount = 3;
|
public const int WMsCount = 3;
|
||||||
public const int LineSize = 3;
|
public const int LineSize = 3;
|
||||||
public const int CompoundWMsCount = 1;
|
public const int CompoundWMsCount = 1;
|
||||||
public const int HeatMetersCount = 0;
|
public const int HeatMetersCount = 0;
|
||||||
public const int MaxPartNr = WMsCount / LineSize;
|
public const int MaxPartNr = WMsCount / LineSize;
|
||||||
#elif FUZHOU300 || FUZHOU150 || PT200IL || PUCHONG_PT200 || GENESIS || SLM_150 || PETERSBURG_200
|
#elif FUZHOU_300 || FUZHOU_150 || IZRAEL_200 || PUCHONG_200 || GENESIS || SLM_150 || PETERSBURG_200
|
||||||
public const int WMsCount = 6;
|
public const int WMsCount = 6;
|
||||||
public const int LineSize = 6;
|
public const int LineSize = 6;
|
||||||
public const int CompoundWMsCount = 3;
|
public const int CompoundWMsCount = 3;
|
||||||
public const int HeatMetersCount = 0;
|
public const int HeatMetersCount = 0;
|
||||||
public const int MaxPartNr = 3;
|
public const int MaxPartNr = 3;
|
||||||
#elif TORINO50 || BADGER_MALA_TRAT || BERLIN
|
#elif DUBAJ_50
|
||||||
|
public const int WMsCount = 10;
|
||||||
|
public const int LineSize = 5;
|
||||||
|
public const int CompoundWMsCount = 0;
|
||||||
|
public const int HeatMetersCount = 0;
|
||||||
|
public const int MaxPartNr = WMsCount / LineSize;
|
||||||
|
#elif IZRAEL_50
|
||||||
|
public const int WMsCount = 40;
|
||||||
|
public const int LineSize = 10;
|
||||||
|
public const int CompoundWMsCount = 0;
|
||||||
|
public const int HeatMetersCount = 0;
|
||||||
|
public const int MaxPartNr = WMsCount / LineSize;
|
||||||
|
#elif FUZHOU_100
|
||||||
|
public const int WMsCount = 10;
|
||||||
|
public const int LineSize = 10;
|
||||||
|
public const int CompoundWMsCount = 1;
|
||||||
|
public const int HeatMetersCount = 0;
|
||||||
|
public const int MaxPartNr = WMsCount / LineSize;
|
||||||
|
#elif TORINO_50 || BADGER_MALA_TRAT || BERLIN
|
||||||
public const int WMsCount = 6;
|
public const int WMsCount = 6;
|
||||||
public const int LineSize = 6;
|
public const int LineSize = 6;
|
||||||
public const int CompoundWMsCount = 1;
|
public const int CompoundWMsCount = 1;
|
||||||
public const int HeatMetersCount = 0;
|
public const int HeatMetersCount = 0;
|
||||||
public const int MaxPartNr = 1;
|
public const int MaxPartNr = 1;
|
||||||
#elif TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40 || FUZHOU_40 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_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
|
||||||
public const int WMsCount = 20;
|
public const int WMsCount = 20;
|
||||||
public const int LineSize = 10;
|
public const int LineSize = 10;
|
||||||
public const int CompoundWMsCount = 1;
|
public const int CompoundWMsCount = 1;
|
||||||
@@ -50,8 +68,8 @@ namespace Config
|
|||||||
public const int CompoundWMsCount = 1;
|
public const int CompoundWMsCount = 1;
|
||||||
public const int HeatMetersCount = 0;
|
public const int HeatMetersCount = 0;
|
||||||
public const int MaxPartNr = WMsCount / LineSize;
|
public const int MaxPartNr = WMsCount / LineSize;
|
||||||
#elif TURA_SPECIAL
|
#elif TURA_SPECIAL || SENTEC
|
||||||
public const int WMsCount = 6;
|
public const int WMsCount = 6;
|
||||||
public const int LineSize = 6;
|
public const int LineSize = 6;
|
||||||
public const int CompoundWMsCount = 1;
|
public const int CompoundWMsCount = 1;
|
||||||
public const int HeatMetersCount = 0;
|
public const int HeatMetersCount = 0;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace Config
|
|||||||
result.IsRealBench = IsRealBench;
|
result.IsRealBench = IsRealBench;
|
||||||
result.ProceduresDBSettings = (Users.DBSettings)ProceduresDBSettings.Clone();
|
result.ProceduresDBSettings = (Users.DBSettings)ProceduresDBSettings.Clone();
|
||||||
result.WaterMetersDBSettings = (Users.DBSettings)WaterMetersDBSettings.Clone();
|
result.WaterMetersDBSettings = (Users.DBSettings)WaterMetersDBSettings.Clone();
|
||||||
result.UsersDBSettings = (Users.DBSettings)ProceduresDBSettings.Clone();
|
result.UsersDBSettings = (Users.DBSettings)UsersDBSettings.Clone();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@@ -13,13 +13,25 @@ namespace Config.Entities
|
|||||||
public virtual string Parameters { get; set; }
|
public virtual string Parameters { get; set; }
|
||||||
public virtual Procedure Procedure { get; set; }
|
public virtual Procedure Procedure { get; set; }
|
||||||
|
|
||||||
|
IParamsProvider paramsProvider;
|
||||||
|
///
|
||||||
|
public virtual IParamsProvider GetParamsProvider() { return paramsProvider; }
|
||||||
|
public virtual void SetParamsProvider(IParamsProvider paramsProvider) { this.paramsProvider = paramsProvider; }
|
||||||
|
|
||||||
|
|
||||||
|
protected ComponentProcedure() { }
|
||||||
|
|
||||||
|
public ComponentProcedure(string name, string parameters, Procedure procedure)
|
||||||
|
{
|
||||||
|
this.CmpntName = name;
|
||||||
|
this.Parameters = parameters;
|
||||||
|
this.Procedure = procedure;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public virtual ComponentProcedure Clone(Procedure newProcedure)
|
public virtual ComponentProcedure Clone(Procedure newProcedure)
|
||||||
{
|
{
|
||||||
ComponentProcedure result = new ComponentProcedure();
|
return new ComponentProcedure(CmpntName, Parameters, newProcedure);
|
||||||
result.CmpntName = CmpntName;
|
|
||||||
result.Parameters = Parameters;
|
|
||||||
result.Procedure = newProcedure;
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Export(StreamWriter output)
|
public virtual void Export(StreamWriter output)
|
||||||
@@ -34,11 +46,16 @@ namespace Config.Entities
|
|||||||
|
|
||||||
if (string.IsNullOrEmpty(firstLine)) return null;
|
if (string.IsNullOrEmpty(firstLine)) return null;
|
||||||
|
|
||||||
ComponentProcedure result = new ComponentProcedure();
|
try
|
||||||
result.CmpntName = firstLine;
|
{
|
||||||
result.Parameters = input.ReadLine().Replace("~", Environment.NewLine);
|
string cmptnName = firstLine;
|
||||||
result.Procedure = newProcedure;
|
string parameters = input.ReadLine().Replace("~", Environment.NewLine);
|
||||||
return result;
|
return new ComponentProcedure(cmptnName, parameters, newProcedure);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@@ -13,13 +13,25 @@ namespace Config.Entities
|
|||||||
public virtual string Parameters { get; set; }
|
public virtual string Parameters { get; set; }
|
||||||
public virtual Test Test { get; set; }
|
public virtual Test Test { get; set; }
|
||||||
|
|
||||||
|
IParamsProvider paramsProvider;
|
||||||
|
///
|
||||||
|
public virtual IParamsProvider GetParamsProvider() { return paramsProvider; }
|
||||||
|
public virtual void SetParamsProvider(IParamsProvider paramsProvider) { this.paramsProvider = paramsProvider; }
|
||||||
|
|
||||||
|
|
||||||
|
protected ComponentTest() { }
|
||||||
|
|
||||||
|
public ComponentTest(string name, string parameters, Test test)
|
||||||
|
{
|
||||||
|
this.CmpntName = name;
|
||||||
|
this.Parameters = parameters;
|
||||||
|
this.Test = test;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public virtual ComponentTest Clone()
|
public virtual ComponentTest Clone()
|
||||||
{
|
{
|
||||||
ComponentTest result = new ComponentTest();
|
return new ComponentTest(CmpntName, Parameters, Test);
|
||||||
result.CmpntName = CmpntName;
|
|
||||||
result.Parameters = Parameters;
|
|
||||||
result.Test = Test;
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Export(StreamWriter output)
|
public virtual void Export(StreamWriter output)
|
||||||
@@ -34,11 +46,16 @@ namespace Config.Entities
|
|||||||
|
|
||||||
if (string.IsNullOrEmpty(firstLine)) return null;
|
if (string.IsNullOrEmpty(firstLine)) return null;
|
||||||
|
|
||||||
ComponentTest result = new ComponentTest();
|
try
|
||||||
result.CmpntName = firstLine;
|
{
|
||||||
result.Parameters = input.ReadLine().Replace("~", Environment.NewLine);
|
string cmptnName = firstLine;
|
||||||
result.Test = newTest;
|
string parameters = input.ReadLine().Replace("~", Environment.NewLine);
|
||||||
return result;
|
return new ComponentTest(cmptnName, parameters, newTest);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -38,7 +38,45 @@ namespace Config.Entities
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ProcedureState
|
/// <summary>
|
||||||
|
/// Flags returned by each device configuration control Verify(...) function.
|
||||||
|
/// </summary>
|
||||||
|
public enum CfgUpdateFlags
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
Error = 0x1, /// Some settings in the user control are invalid and cannot be set
|
||||||
|
Warning = 0x02, /// Some settings in the user control are suspicious, can be set after user confirmation
|
||||||
|
RestartRqrd = 0x04, /// TBF program restart is required to apply all changed parameters
|
||||||
|
AnyChange = 0x08, /// At least one parameter have changed
|
||||||
|
VolatileChange = 0x10,
|
||||||
|
InvokeCfgChange = 0x20, /// Invoke CfgChange handler of the component
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum RemoteDBUse
|
||||||
|
{
|
||||||
|
[Description("Local DB only")] LocalDBOnly,
|
||||||
|
[Description("Remote DB only")] RemoteDBOnly,
|
||||||
|
[Description("Both DB-s, local 1st")] BothDBsLocalFirst,
|
||||||
|
[Description("Both DB-s, remote 1st")] BothDBsRemoteFirst,
|
||||||
|
Count
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Contains a procedure name and a database specification (local/remote).
|
||||||
|
/// </summary>
|
||||||
|
public class ProcedureInfo
|
||||||
|
{
|
||||||
|
public readonly string Name;
|
||||||
|
public readonly Users.Entities.DBKind DBKind;
|
||||||
|
|
||||||
|
public ProcedureInfo(string name, Users.Entities.DBKind dbKind)
|
||||||
|
{
|
||||||
|
Name = name;
|
||||||
|
DBKind = dbKind;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum ProcedureState
|
||||||
{
|
{
|
||||||
Active,
|
Active,
|
||||||
History,
|
History,
|
||||||
@@ -80,9 +118,17 @@ namespace Config.Entities
|
|||||||
|
|
||||||
public enum Medium
|
public enum Medium
|
||||||
{
|
{
|
||||||
[Description("")] NotSpecified,
|
[Description("")] NotSpecified,
|
||||||
ColdWater,
|
#if LANG_PL
|
||||||
HotWater,
|
[Description("zimna")] ColdWater,
|
||||||
|
[Description("ciepła")] HotWater,
|
||||||
|
#elif LANG_IT
|
||||||
|
[Description("freddo")] ColdWater,
|
||||||
|
[Description("caldo")] HotWater,
|
||||||
|
#else
|
||||||
|
[Description("cold")] ColdWater,
|
||||||
|
[Description("hot")] HotWater,
|
||||||
|
#endif
|
||||||
Count
|
Count
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,6 +202,17 @@ namespace Config.Entities
|
|||||||
Count
|
Count
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary> Register reader type </summary>
|
||||||
|
public enum RegisterReaderType
|
||||||
|
{
|
||||||
|
Unknown,
|
||||||
|
Pulses, /// Sick, optical and similar
|
||||||
|
Camera, /// CLP1611
|
||||||
|
DataStream, /// iPerl
|
||||||
|
Manual, /// Entered by human via form (also from camera images)
|
||||||
|
Count
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary> Transition step is finished when this condition is fulfilled </summary>
|
/// <summary> Transition step is finished when this condition is fulfilled </summary>
|
||||||
public enum StepCondition
|
public enum StepCondition
|
||||||
{
|
{
|
||||||
@@ -167,6 +224,14 @@ namespace Config.Entities
|
|||||||
Count
|
Count
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum MeretProtocol
|
||||||
|
{
|
||||||
|
[Description("<undefined>")] Undefined,
|
||||||
|
[Description("Meret (obsolete)")] Meret,
|
||||||
|
[Description("Modbus")] Modbus,
|
||||||
|
Count
|
||||||
|
}
|
||||||
|
|
||||||
public enum Publish : sbyte
|
public enum Publish : sbyte
|
||||||
{
|
{
|
||||||
#if LANG_DE
|
#if LANG_DE
|
||||||
@@ -381,6 +446,15 @@ namespace Config.Entities
|
|||||||
[Description("Bottom")] Bottom,
|
[Description("Bottom")] Bottom,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum TableForm
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
Rows,
|
||||||
|
Columns,
|
||||||
|
ColumnsPL,
|
||||||
|
Count,
|
||||||
|
}
|
||||||
|
|
||||||
public enum ImageRotation
|
public enum ImageRotation
|
||||||
{
|
{
|
||||||
[Description("0 deg")] None,
|
[Description("0 deg")] None,
|
||||||
|
|||||||
@@ -1,10 +1,19 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
namespace TBF.BenchControl.Generic
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
namespace Config.Entities
|
||||||
{
|
{
|
||||||
public interface IParamsProvider
|
public interface IParamsProvider
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Get XML Serializer
|
||||||
|
/// </summary>
|
||||||
|
XmlSerializer GetSerializer();
|
||||||
|
|
||||||
string ComponentName { get; }
|
string ComponentName { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -13,13 +22,19 @@ namespace TBF.BenchControl.Generic
|
|||||||
int ParamsCount();
|
int ParamsCount();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Parameter names
|
/// Returns a parameter name
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ix">Zero based index of the parameter</param>
|
/// <param name="ix">Zero based index of the parameter</param>
|
||||||
string ParamName(int ix);
|
string ParamName(int ix);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of possible values of one parameter (ComboBox when editing) or null (Textbox when editing).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ix">Zero based index of the parameter</param>
|
||||||
|
IList<string> ParamValues(int ix);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Parameter values in string form
|
/// Returns a parameter value in the string form
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ix">Zero based index of the parameter</param>
|
/// <param name="ix">Zero based index of the parameter</param>
|
||||||
string ToString(int ix);
|
string ToString(int ix);
|
||||||
@@ -43,9 +58,13 @@ namespace TBF.BenchControl.Generic
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ix">Zero based index of the parameter</param>
|
/// <param name="ix">Zero based index of the parameter</param>
|
||||||
/// <param name="strValue">String representation of the parameter</param>
|
/// <param name="strValue">String representation of the parameter</param>
|
||||||
void UpdateParam(int ix, string strValue);
|
CfgUpdateFlags UpdateParam(int ix, string strValue);
|
||||||
|
|
||||||
void UpdateDbEntity();
|
/// <summary>
|
||||||
|
/// Updates DB entities for related parameters
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>true when successful</returns>
|
||||||
|
bool UpdateEmbeddedDbEntity();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an object copy
|
/// Creates an object copy
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
///
|
||||||
|
/// Copyright (c) 2018 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Config.Entities
|
||||||
|
{
|
||||||
|
|
||||||
|
public enum Side
|
||||||
|
{
|
||||||
|
#if LANG_CS
|
||||||
|
[Description("Levá")] Left,
|
||||||
|
[Description("Pravá")] Right,
|
||||||
|
#else
|
||||||
|
[Description("Left")] Left,
|
||||||
|
[Description("Right")] Right,
|
||||||
|
#endif
|
||||||
|
Count
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum FlowDir
|
||||||
|
{
|
||||||
|
R_L,
|
||||||
|
L_R,
|
||||||
|
Count
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum OptoHeadState
|
||||||
|
{
|
||||||
|
Disabled,
|
||||||
|
OptoAndDirOK,
|
||||||
|
OptoNok,
|
||||||
|
DirNok,
|
||||||
|
Count
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,11 +12,14 @@ namespace Config.Entities
|
|||||||
public virtual float Measurement { get; set; }
|
public virtual float Measurement { get; set; }
|
||||||
public virtual float Correction { get; set; }
|
public virtual float Correction { get; set; }
|
||||||
|
|
||||||
public MeasurementCorrection() { }
|
public MeasurementCorrection()
|
||||||
|
{
|
||||||
|
RangeIx = 0;
|
||||||
|
}
|
||||||
|
|
||||||
public MeasurementCorrection(int rangeIx)
|
public MeasurementCorrection(int rangeIx)
|
||||||
{
|
{
|
||||||
RangeIx = rangeIx;
|
RangeIx = rangeIx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -225,6 +225,15 @@ namespace Config.Entities
|
|||||||
return diff.ToString();
|
return diff.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual ComponentProcedure GetProcedureParamsEntity(string cmpntName)
|
||||||
|
{
|
||||||
|
foreach (var procPrms in MoreParams)
|
||||||
|
{
|
||||||
|
if (procPrms.CmpntName == cmpntName) return procPrms;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return string.Format("{0}, rev.{1}", Name, Revision);
|
return string.Format("{0}, rev.{1}", Name, Revision);
|
||||||
|
|||||||
@@ -301,6 +301,15 @@ namespace Config.Entities
|
|||||||
return diff.ToString();
|
return diff.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual ComponentTest GetTestParamsEntity(string cmpntName)
|
||||||
|
{
|
||||||
|
foreach (var tstPrms in MoreParams)
|
||||||
|
{
|
||||||
|
if (tstPrms.CmpntName == cmpntName) return tstPrms;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public virtual float GetErrLimLo(float flow)
|
public virtual float GetErrLimLo(float flow)
|
||||||
{
|
{
|
||||||
if (ErrLimLo <= ErrLimHi)
|
if (ErrLimLo <= ErrLimHi)
|
||||||
|
|||||||
+7
-62
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
@@ -39,7 +39,11 @@ namespace Config
|
|||||||
dbType = Data.CurrentBench.WaterMetersDBSettings.DbType;
|
dbType = Data.CurrentBench.WaterMetersDBSettings.DbType;
|
||||||
connectionString = Data.CurrentBench.WaterMetersDBSettings.ConnectionString;
|
connectionString = Data.CurrentBench.WaterMetersDBSettings.ConnectionString;
|
||||||
break;
|
break;
|
||||||
}
|
case Users.Entities.DBKind.RemoteConfig:
|
||||||
|
dbType = Data.CurrentBench.UsersDBSettings.DbType;
|
||||||
|
connectionString = Data.CurrentBench.UsersDBSettings.ConnectionString;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return CreateSessionFactory(database, dbType, connectionString, false);
|
return CreateSessionFactory(database, dbType, connectionString, false);
|
||||||
}
|
}
|
||||||
@@ -69,6 +73,7 @@ namespace Config
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
case Users.Entities.DBKind.Config:
|
case Users.Entities.DBKind.Config:
|
||||||
|
case Users.Entities.DBKind.RemoteConfig:
|
||||||
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Data>());
|
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Data>());
|
||||||
break;
|
break;
|
||||||
case Users.Entities.DBKind.Results:
|
case Users.Entities.DBKind.Results:
|
||||||
@@ -122,41 +127,6 @@ namespace Config
|
|||||||
return SessionFactories[ix].OpenSession();
|
return SessionFactories[ix].OpenSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SaveToDb(Users.Entities.DBKind database, object obj)
|
|
||||||
{
|
|
||||||
SaveToDb(CreateSession(database), obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void SaveToDb(ISession session, object obj)
|
|
||||||
{
|
|
||||||
using (var transaction = session.BeginTransaction())
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
session.SaveOrUpdate(obj);
|
|
||||||
transaction.Commit();
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
transaction.Rollback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void DeleteFromDb(Users.Entities.DBKind database, object obj)
|
|
||||||
{
|
|
||||||
DeleteFromDb(CreateSession(database), obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void DeleteFromDb(ISession session, object obj)
|
|
||||||
{
|
|
||||||
using (var transaction = session.BeginTransaction())
|
|
||||||
{
|
|
||||||
session.Delete(obj);
|
|
||||||
transaction.Commit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create an empty users database.
|
/// Create an empty users database.
|
||||||
/// Database contains only the user 'admin' and the control board component 'CB'.
|
/// Database contains only the user 'admin' and the control board component 'CB'.
|
||||||
@@ -213,30 +183,5 @@ namespace Config
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Create an empty water meters database
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="dbType">DBType.SQLite or DBType.MySql</param>
|
|
||||||
/// <param name="connectionString">Connection string</param>
|
|
||||||
/// <returns>true=success, false=error</returns>
|
|
||||||
public static bool CreateEmptyResultsDB(Users.Entities.DBType dbType, string connectionString)
|
|
||||||
{
|
|
||||||
ISessionFactory sessionFactory = CreateSessionFactory(Users.Entities.DBKind.Results, dbType, connectionString, true);
|
|
||||||
if (sessionFactory == null) return false;
|
|
||||||
|
|
||||||
/// Populate the database
|
|
||||||
//using (var session = sessionFactory.OpenSession())
|
|
||||||
//{
|
|
||||||
// using (var transaction = session.BeginTransaction())
|
|
||||||
// {
|
|
||||||
// /// Create one component
|
|
||||||
// var cmpnt = (new BenchControl.Elde.ControlBoardCfg("CB", 1)).CreateDbEntity();
|
|
||||||
// session.SaveOrUpdate(cmpnt);
|
|
||||||
// transaction.Commit();
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using log4net;
|
using log4net;
|
||||||
|
|
||||||
namespace TBF.BenchControl
|
namespace Config
|
||||||
{
|
{
|
||||||
public static class Formulas
|
public static class Formulas
|
||||||
{
|
{
|
||||||
@@ -153,10 +153,9 @@ namespace TBF.BenchControl
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="t">Temperature in [°C]</param>
|
/// <param name="t">Temperature in [°C]</param>
|
||||||
/// <returns>Density in [kg/m3]</returns>
|
/// <returns>Density in [kg/m3]</returns>
|
||||||
public static double WaterDensityFromTemp(double t)
|
public static double WaterDensityFromTemp(double t, double realDensity, double atTemperature)
|
||||||
{
|
{
|
||||||
return DistilledWaterDensityFromTemp(t) +
|
return DistilledWaterDensityFromTemp(t) + DensityCorrection(realDensity, atTemperature);
|
||||||
DensityCorrection(Program.LocalSettings.RealDensity, Program.LocalSettings.AtTemperature);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -164,7 +163,7 @@ namespace TBF.BenchControl
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="t">Temperature in [°C]</param>
|
/// <param name="t">Temperature in [°C]</param>
|
||||||
/// <returns>Density in [kg/m3]</returns>
|
/// <returns>Density in [kg/m3]</returns>
|
||||||
public static double WaterDensityFromTempPress(double temp, double pressure)
|
public static double WaterDensityFromTempPress(double temp, double pressure, double realDensity, double atTemperature)
|
||||||
{
|
{
|
||||||
double x0 = 5.08821E-10;
|
double x0 = 5.08821E-10;
|
||||||
double x1 = 1.2639418;
|
double x1 = 1.2639418;
|
||||||
@@ -174,7 +173,7 @@ namespace TBF.BenchControl
|
|||||||
double theta = temp / 100.0;
|
double theta = temp / 100.0;
|
||||||
double B = x0 * (((x3 * theta + x2) * theta + x1) * theta + 1) / (1 + x4 * theta);
|
double B = x0 * (((x3 * theta + x2) * theta + x1) * theta + 1) / (1 + x4 * theta);
|
||||||
|
|
||||||
return WaterDensityFromTemp(temp) * (1 + B * Config.Units.ConvertTo(Config.Unit.Pa, pressure));
|
return WaterDensityFromTemp(temp, realDensity, atTemperature) * (1 + B * Config.Units.ConvertTo(Config.Unit.Pa, pressure));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("2.18.837.0")]
|
[assembly: AssemblyVersion("2.18.1102.0")]
|
||||||
[assembly: AssemblyFileVersion("2.18.837.0")]
|
[assembly: AssemblyFileVersion("2.18.1102.0")]
|
||||||
|
|||||||
+82
-7
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2016-2017 Sensus Slovensko a.s.
|
/// Copyright (c) 2016-2018 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
@@ -11,6 +11,12 @@ namespace Config
|
|||||||
{
|
{
|
||||||
[Description("---")] None,
|
[Description("---")] None,
|
||||||
|
|
||||||
|
[Description("imp.")] pulse,
|
||||||
|
#if LANG_PL
|
||||||
|
[Description("stopień")] degree,
|
||||||
|
#else
|
||||||
|
[Description("degree")] degree,
|
||||||
|
#endif
|
||||||
[Description("l")] l, /// * 1 liter
|
[Description("l")] l, /// * 1 liter
|
||||||
[Description("dm3")] dm3, /// 1 dm3 = 1 liter
|
[Description("dm3")] dm3, /// 1 dm3 = 1 liter
|
||||||
[Description("m3")] m3, /// 1000 l
|
[Description("m3")] m3, /// 1000 l
|
||||||
@@ -62,9 +68,28 @@ namespace Config
|
|||||||
[Description("kWh")] kWh, /// 1 kWh = 3600000 J
|
[Description("kWh")] kWh, /// 1 kWh = 3600000 J
|
||||||
[Description("MWh")] MWh, /// 1 MWh = 3600000000 J
|
[Description("MWh")] MWh, /// 1 MWh = 3600000000 J
|
||||||
|
|
||||||
|
#if LANG_PL
|
||||||
|
[Description("imp/l")] ppl, /// * 1 pulse/l
|
||||||
|
[Description("imp/dm3")] ppdm3, /// * 1 pulse/dm3
|
||||||
|
[Description("stopień/l")] degpl, /// * 1 degree/l
|
||||||
|
[Description("stopień/dm3")] degpdm3, /// * 1 degree/dm3
|
||||||
|
[Description("l/imp")] lpp, /// * 1 l/pulse
|
||||||
|
[Description("dm3/imp")] dm3pp, /// * 1 dm3/pulse
|
||||||
|
[Description("l/stopień")] lpdeg, /// * 1 l/degree
|
||||||
|
[Description("dm3/stopień")] dm3pdeg, /// * 1 dm3/degree
|
||||||
|
#else
|
||||||
[Description("pulse/l")] ppl, /// * 1 pulse/l
|
[Description("pulse/l")] ppl, /// * 1 pulse/l
|
||||||
///
|
[Description("pulse/dm3")] ppdm3, /// * 1 pulse/dm3
|
||||||
|
[Description("degree/l")] degpl, /// * 1 degree/l
|
||||||
|
[Description("degree/dm3")] degpdm3, /// * 1 degree/dm3
|
||||||
|
[Description("l/pulse")] lpp, /// * 1 l/pulse
|
||||||
|
[Description("dm3/pulse")] dm3pp, /// * 1 dm3/pulse
|
||||||
|
[Description("l/degree")] lpdeg, /// * 1 l/degree
|
||||||
|
[Description("dm3/degree")] dm3pdeg, /// * 1 dm3/degree
|
||||||
|
#endif
|
||||||
|
///
|
||||||
[Description("pulse/kWh")] ppkWh, /// * 1 pulse/kWh
|
[Description("pulse/kWh")] ppkWh, /// * 1 pulse/kWh
|
||||||
|
[Description("kWh/pulse")] kWhpp, /// * 1 kWh/pulse
|
||||||
|
|
||||||
Count
|
Count
|
||||||
}
|
}
|
||||||
@@ -84,6 +109,7 @@ namespace Config
|
|||||||
[Description("Länge")] Length,
|
[Description("Länge")] Length,
|
||||||
[Description("Dichte")] Density,
|
[Description("Dichte")] Density,
|
||||||
[Description("Energie")] Energy,
|
[Description("Energie")] Energy,
|
||||||
|
[Description("Impulse")] Pulses,
|
||||||
[Description("Impulse/l")] PulsePerLtr,
|
[Description("Impulse/l")] PulsePerLtr,
|
||||||
[Description("Impulse/kWh")] PulsePerKWh,
|
[Description("Impulse/kWh")] PulsePerKWh,
|
||||||
|
|
||||||
@@ -93,7 +119,7 @@ namespace Config
|
|||||||
[Description("Boolean")] Boolean,
|
[Description("Boolean")] Boolean,
|
||||||
[Description("Datum und Uhrzeit")] DateTime,
|
[Description("Datum und Uhrzeit")] DateTime,
|
||||||
#elif LANG_PL
|
#elif LANG_PL
|
||||||
[Description("Objętość")] Volume,
|
[Description("Objętość")] Volume,
|
||||||
[Description("Przepływ")] Flow,
|
[Description("Przepływ")] Flow,
|
||||||
[Description("Masa")] Mass,
|
[Description("Masa")] Mass,
|
||||||
[Description("Czas")] Time,
|
[Description("Czas")] Time,
|
||||||
@@ -104,6 +130,7 @@ namespace Config
|
|||||||
[Description("Długość")] Length,
|
[Description("Długość")] Length,
|
||||||
[Description("Gęstość")] Density,
|
[Description("Gęstość")] Density,
|
||||||
[Description("Energia")] Energy,
|
[Description("Energia")] Energy,
|
||||||
|
[Description("Impulsy")] Pulses,
|
||||||
[Description("Impulsy/litr")] PulsePerLtr,
|
[Description("Impulsy/litr")] PulsePerLtr,
|
||||||
[Description("Impulsy/kWh")] PulsePerKWh,
|
[Description("Impulsy/kWh")] PulsePerKWh,
|
||||||
|
|
||||||
@@ -124,6 +151,7 @@ namespace Config
|
|||||||
[Description("Délka")] Length,
|
[Description("Délka")] Length,
|
||||||
[Description("Hustota")] Density,
|
[Description("Hustota")] Density,
|
||||||
[Description("Energie")] Energy,
|
[Description("Energie")] Energy,
|
||||||
|
[Description("Pulzy")] Pulses,
|
||||||
[Description("Pulzy/litr")] PulsePerLtr,
|
[Description("Pulzy/litr")] PulsePerLtr,
|
||||||
[Description("Pulzy/kWh")] PulsePerKWh,
|
[Description("Pulzy/kWh")] PulsePerKWh,
|
||||||
|
|
||||||
@@ -132,8 +160,29 @@ namespace Config
|
|||||||
[Description("Text")] String,
|
[Description("Text")] String,
|
||||||
[Description("Boolean")] Boolean,
|
[Description("Boolean")] Boolean,
|
||||||
[Description("Datum a čas")] DateTime,
|
[Description("Datum a čas")] DateTime,
|
||||||
#else
|
#elif LANG_IT
|
||||||
[Description("Volume")] Volume,
|
[Description("Volume")] Volume,
|
||||||
|
[Description("Flusso")] Flow,
|
||||||
|
[Description("Massa")] Mass,
|
||||||
|
[Description("Tempo")] Time,
|
||||||
|
[Description("Temperatura")] Temperature,
|
||||||
|
[Description("Pressione")] Pressure,
|
||||||
|
[Description("Umidità")] Humidity,
|
||||||
|
[Description("Errore")] Error,
|
||||||
|
[Description("Lungezza")] Length,
|
||||||
|
[Description("Densità")] Density,
|
||||||
|
[Description("Energia")] Energy,
|
||||||
|
[Description("Impulso")] Pulses,
|
||||||
|
[Description("Impulso/litro")] PulsePerLtr,
|
||||||
|
[Description("Impulso/kWh")] PulsePerKWh,
|
||||||
|
|
||||||
|
/// Quantities without units and conversions
|
||||||
|
[Description("Numero")] Number,
|
||||||
|
[Description("Stringa")] String,
|
||||||
|
[Description("Boolean")] Boolean,
|
||||||
|
[Description("Data e ora")] DateTime,
|
||||||
|
#else
|
||||||
|
[Description("Volume")] Volume,
|
||||||
[Description("Flow")] Flow,
|
[Description("Flow")] Flow,
|
||||||
[Description("Mass")] Mass,
|
[Description("Mass")] Mass,
|
||||||
[Description("Time")] Time,
|
[Description("Time")] Time,
|
||||||
@@ -144,6 +193,7 @@ namespace Config
|
|||||||
[Description("Length")] Length,
|
[Description("Length")] Length,
|
||||||
[Description("Density")] Density,
|
[Description("Density")] Density,
|
||||||
[Description("Energy")] Energy,
|
[Description("Energy")] Energy,
|
||||||
|
[Description("Pulses")] Pulses,
|
||||||
[Description("Pulses/liter")] PulsePerLtr,
|
[Description("Pulses/liter")] PulsePerLtr,
|
||||||
[Description("Pulses/kWh")] PulsePerKWh,
|
[Description("Pulses/kWh")] PulsePerKWh,
|
||||||
|
|
||||||
@@ -153,7 +203,7 @@ namespace Config
|
|||||||
[Description("Boolean")] Boolean,
|
[Description("Boolean")] Boolean,
|
||||||
[Description("Date and time")] DateTime,
|
[Description("Date and time")] DateTime,
|
||||||
#endif
|
#endif
|
||||||
Count,
|
Count,
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Units
|
public static class Units
|
||||||
@@ -178,6 +228,10 @@ namespace Config
|
|||||||
{
|
{
|
||||||
switch (units)
|
switch (units)
|
||||||
{
|
{
|
||||||
|
case Unit.pulse:
|
||||||
|
case Unit.degree:
|
||||||
|
return Config.Quantity.Pulses;
|
||||||
|
|
||||||
case Unit.l:
|
case Unit.l:
|
||||||
case Unit.dm3:
|
case Unit.dm3:
|
||||||
case Unit.m3:
|
case Unit.m3:
|
||||||
@@ -241,9 +295,17 @@ namespace Config
|
|||||||
return Config.Quantity.Energy;
|
return Config.Quantity.Energy;
|
||||||
|
|
||||||
case Unit.ppl:
|
case Unit.ppl:
|
||||||
|
case Unit.ppdm3:
|
||||||
|
case Unit.degpl:
|
||||||
|
case Unit.degpdm3:
|
||||||
|
case Unit.lpp:
|
||||||
|
case Unit.dm3pp:
|
||||||
|
case Unit.lpdeg:
|
||||||
|
case Unit.dm3pdeg:
|
||||||
return Config.Quantity.PulsePerLtr;
|
return Config.Quantity.PulsePerLtr;
|
||||||
|
|
||||||
case Unit.ppkWh:
|
case Unit.ppkWh:
|
||||||
|
case Unit.kWhpp:
|
||||||
return Config.Quantity.PulsePerKWh;
|
return Config.Quantity.PulsePerKWh;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -262,6 +324,7 @@ namespace Config
|
|||||||
public static bool IsLength(Unit units) { return IsQuantity(units, Config.Quantity.Length); }
|
public static bool IsLength(Unit units) { return IsQuantity(units, Config.Quantity.Length); }
|
||||||
public static bool IsDensity(Unit units) { return IsQuantity(units, Config.Quantity.Density); }
|
public static bool IsDensity(Unit units) { return IsQuantity(units, Config.Quantity.Density); }
|
||||||
public static bool IsEnergy(Unit units) { return IsQuantity(units, Config.Quantity.Energy); }
|
public static bool IsEnergy(Unit units) { return IsQuantity(units, Config.Quantity.Energy); }
|
||||||
|
public static bool IsPulses(Unit units) { return IsQuantity(units, Config.Quantity.Pulses); }
|
||||||
public static bool IsPulsePerLtr(Unit units) { return IsQuantity(units, Config.Quantity.PulsePerLtr); }
|
public static bool IsPulsePerLtr(Unit units) { return IsQuantity(units, Config.Quantity.PulsePerLtr); }
|
||||||
public static bool IsPulsePerKWh(Unit units) { return IsQuantity(units, Config.Quantity.PulsePerKWh); }
|
public static bool IsPulsePerKWh(Unit units) { return IsQuantity(units, Config.Quantity.PulsePerKWh); }
|
||||||
|
|
||||||
@@ -329,7 +392,13 @@ namespace Config
|
|||||||
case Unit.kWh: return v / 3600000.0; /// 1 kWh = 3600000 J
|
case Unit.kWh: return v / 3600000.0; /// 1 kWh = 3600000 J
|
||||||
case Unit.MWh: return v / 3600000000.0;/// 1 MWh = 3600000000 J
|
case Unit.MWh: return v / 3600000000.0;/// 1 MWh = 3600000000 J
|
||||||
|
|
||||||
default: return v;
|
case Unit.kWhpp:
|
||||||
|
case Unit.lpp:
|
||||||
|
case Unit.dm3pp:
|
||||||
|
case Unit.lpdeg:
|
||||||
|
case Unit.dm3pdeg: return ((v <= float.Epsilon) ? 0 : 1 / v);
|
||||||
|
|
||||||
|
default: return v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -396,7 +465,13 @@ namespace Config
|
|||||||
case Unit.kWh: return 3600000 * v; /// 1 kWh = 3600000 J
|
case Unit.kWh: return 3600000 * v; /// 1 kWh = 3600000 J
|
||||||
case Unit.MWh: return 3600000000 * v; /// 1 kWh = 3600000000 J
|
case Unit.MWh: return 3600000000 * v; /// 1 kWh = 3600000000 J
|
||||||
|
|
||||||
default: return v;
|
case Unit.kWhpp:
|
||||||
|
case Unit.lpp:
|
||||||
|
case Unit.dm3pp:
|
||||||
|
case Unit.lpdeg:
|
||||||
|
case Unit.dm3pdeg: return ((v == 0) ? 0 : 1 / v);
|
||||||
|
|
||||||
|
default: return v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,86 @@
|
|||||||
|
///
|
||||||
|
/// Copyright (c) 2017-2018 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Config
|
||||||
|
{
|
||||||
|
public static class Utils
|
||||||
|
{
|
||||||
|
public static string SignificantDigitsToFmt(double value, int sigDigits)
|
||||||
|
{
|
||||||
|
if (sigDigits == 6)
|
||||||
|
{
|
||||||
|
if (value >= 99999.5 || value < -99999.5) return "F0";
|
||||||
|
else if (value >= 9999.95 || value < -9999.95) return "F1";
|
||||||
|
else if (value >= 999.995 || value < -999.995) return "F2";
|
||||||
|
else if (value >= 99.9995 || value < -99.9995) return "F3";
|
||||||
|
else if (value >= 9.99995 || value < -9.99995) return "F4";
|
||||||
|
else if (value >= 0.999995 || value < -0.999995) return "F5";
|
||||||
|
else if (value >= 0.0999995 || value < -0.0999995) return "F6";
|
||||||
|
else if (value >= 0.00999995 || value < -0.00999995) return "F7";
|
||||||
|
else if (value >= 0.000999995 || value < -0.000999995) return "F8";
|
||||||
|
else if (value >= 0.0000999995 || value < -0.0000999995) return "F9";
|
||||||
|
else return "F10";
|
||||||
|
}
|
||||||
|
else if (sigDigits == 5)
|
||||||
|
{
|
||||||
|
if (value >= 9999.5 || value < -9999.5) return "F0";
|
||||||
|
else if (value >= 999.95 || value < -999.95) return "F1";
|
||||||
|
else if (value >= 99.995 || value < -99.995) return "F2";
|
||||||
|
else if (value >= 9.9995 || value < -9.9995) return "F3";
|
||||||
|
else if (value >= 0.99995 || value < -0.99995) return "F4";
|
||||||
|
else if (value >= 0.099995 || value < -0.099995) return "F5";
|
||||||
|
else if (value >= 0.0099995 || value < -0.0099995) return "F6";
|
||||||
|
else if (value >= 0.00099995 || value < -0.00099995) return "F7";
|
||||||
|
else if (value >= 0.000099995 || value < -0.000099995) return "F8";
|
||||||
|
else return "F9";
|
||||||
|
}
|
||||||
|
else if (sigDigits == 4)
|
||||||
|
{
|
||||||
|
if (value >= 999.5 || value < -999.5) return "F0";
|
||||||
|
else if (value >= 99.95 || value < -99.95) return "F1";
|
||||||
|
else if (value >= 9.995 || value < -9.995) return "F2";
|
||||||
|
else if (value >= 0.9995 || value < -0.9995) return "F3";
|
||||||
|
else if (value >= 0.09995 || value < -0.09995) return "F4";
|
||||||
|
else if (value >= 0.009995 || value < -0.009995) return "F5";
|
||||||
|
else if (value >= 0.0009995 || value < -0.0009995) return "F6";
|
||||||
|
else if (value >= 0.00009995 || value < -0.00009995) return "F7";
|
||||||
|
else return "F8";
|
||||||
|
}
|
||||||
|
else if (sigDigits == 3)
|
||||||
|
{
|
||||||
|
if (value >= 99.5 || value < -99.5) return "F0";
|
||||||
|
else if (value >= 9.95 || value < -9.95) return "F1";
|
||||||
|
else if (value >= 0.995 || value < -0.995) return "F2";
|
||||||
|
else if (value >= 0.0995 || value < -0.0995) return "F3";
|
||||||
|
else if (value >= 0.00995 || value < -0.00995) return "F4";
|
||||||
|
else if (value >= 0.000995 || value < -0.000995) return "F5";
|
||||||
|
else if (value >= 0.0000995 || value < -0.0000995) return "F6";
|
||||||
|
else return "F7";
|
||||||
|
}
|
||||||
|
else if (sigDigits == 2)
|
||||||
|
{
|
||||||
|
if (value >= 9.5 || value < -9.5) return "F0";
|
||||||
|
else if (value >= 0.95 || value < -0.95) return "F1";
|
||||||
|
else if (value >= 0.095 || value < -0.095) return "F2";
|
||||||
|
else if (value >= 0.0095 || value < -0.0095) return "F3";
|
||||||
|
else if (value >= 0.00095 || value < -0.00095) return "F4";
|
||||||
|
else if (value >= 0.000095 || value < -0.000095) return "F5";
|
||||||
|
else return "F6";
|
||||||
|
}
|
||||||
|
else /// if (sigDigits == 1)
|
||||||
|
{
|
||||||
|
if (value >= 0.95 || value < -0.95) return "F0";
|
||||||
|
else if (value >= 0.095 || value < -0.095) return "F1";
|
||||||
|
else if (value >= 0.0095 || value < -0.0095) return "F2";
|
||||||
|
else if (value >= 0.00095 || value < -0.00095) return "F3";
|
||||||
|
else if (value >= 0.000095 || value < -0.000095) return "F4";
|
||||||
|
else return "F5";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+31
-10
@@ -56,7 +56,10 @@ namespace DeviceTest
|
|||||||
|
|
||||||
|
|
||||||
static TBF.Boxes.FloatBox floatBox;
|
static TBF.Boxes.FloatBox floatBox;
|
||||||
static Event evnt;
|
static TBF.Boxes.DoubleBox dblBox1;
|
||||||
|
static TBF.Boxes.DoubleBox dblBox2;
|
||||||
|
static TBF.Boxes.DoubleBox dblBox3;
|
||||||
|
static Event evnt;
|
||||||
|
|
||||||
|
|
||||||
static DeviceTestDlg()
|
static DeviceTestDlg()
|
||||||
@@ -657,7 +660,12 @@ namespace DeviceTest
|
|||||||
operation1 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
|
operation1 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
|
||||||
operation2 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
|
operation2 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
|
||||||
}
|
}
|
||||||
else if (tbfComponent1forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
|
else if (tbfComponent1forOp is TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter)
|
||||||
|
{
|
||||||
|
operation1 = (tbfComponent1forOp as TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter).ReadLevelOp(ref dblBox1);
|
||||||
|
operation2 = (tbfComponent1forOp as TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter).ReadTempOp(ref dblBox3);
|
||||||
|
}
|
||||||
|
else if (tbfComponent1forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
|
||||||
{
|
{
|
||||||
//operation1 = (tbfComponent1forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(1);
|
//operation1 = (tbfComponent1forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(1);
|
||||||
//operation2 = (tbfComponent1forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(2);
|
//operation2 = (tbfComponent1forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(2);
|
||||||
@@ -681,10 +689,15 @@ namespace DeviceTest
|
|||||||
}
|
}
|
||||||
else if (tbfComponent2forOp is TBF.BenchControl.Modbus.Easytherm.Easytherm)
|
else if (tbfComponent2forOp is TBF.BenchControl.Modbus.Easytherm.Easytherm)
|
||||||
{
|
{
|
||||||
operation21 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
|
operation21 = (tbfComponent2forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
|
||||||
operation22 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
|
operation22 = (tbfComponent2forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
|
||||||
}
|
}
|
||||||
else if (tbfComponent2forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
|
else if (tbfComponent2forOp is TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter)
|
||||||
|
{
|
||||||
|
operation21 = (tbfComponent2forOp as TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter).ReadLevelOp(ref dblBox1);
|
||||||
|
operation22 = (tbfComponent2forOp as TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter).ReadTempOp(ref dblBox3);
|
||||||
|
}
|
||||||
|
else if (tbfComponent2forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
|
||||||
{
|
{
|
||||||
//operation21 = (tbfComponent2forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(1);
|
//operation21 = (tbfComponent2forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(1);
|
||||||
//operation22 = (tbfComponent2forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(2);
|
//operation22 = (tbfComponent2forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(2);
|
||||||
@@ -708,10 +721,15 @@ namespace DeviceTest
|
|||||||
}
|
}
|
||||||
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.Easytherm.Easytherm)
|
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.Easytherm.Easytherm)
|
||||||
{
|
{
|
||||||
operation31 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
|
operation31 = (tbfComponent3forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
|
||||||
operation32 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
|
operation32 = (tbfComponent3forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
|
||||||
}
|
}
|
||||||
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
|
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter)
|
||||||
|
{
|
||||||
|
operation31 = (tbfComponent3forOp as TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter).ReadLevelOp(ref dblBox1);
|
||||||
|
operation32 = (tbfComponent3forOp as TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter).ReadTempOp(ref dblBox3);
|
||||||
|
}
|
||||||
|
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
|
||||||
{
|
{
|
||||||
//operation31 = (tbfComponent3forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(1);
|
//operation31 = (tbfComponent3forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(1);
|
||||||
//operation32 = (tbfComponent3forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(2);
|
//operation32 = (tbfComponent3forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(2);
|
||||||
@@ -720,11 +738,14 @@ namespace DeviceTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
while (workerThreadRunning)
|
int time = 0;
|
||||||
|
while (workerThreadRunning)
|
||||||
{
|
{
|
||||||
Thread.Sleep(1000);
|
Thread.Sleep(1000);
|
||||||
|
|
||||||
if (workerThreadRunning)
|
StateMachine.Time = ++time;
|
||||||
|
|
||||||
|
if (workerThreadRunning)
|
||||||
{
|
{
|
||||||
foreach (var d in tbfDevices) d.RunDeviceBefore();
|
foreach (var d in tbfDevices) d.RunDeviceBefore();
|
||||||
|
|
||||||
|
|||||||
@@ -72,10 +72,10 @@ namespace DeviceTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Configure and start logging
|
/// Configure and start logging
|
||||||
log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo(LocAppDataDir + log4netConfigFName));
|
log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo(Path.Combine(LocAppDataDir, log4netConfigFName)));
|
||||||
log = LogManager.GetLogger(typeof(Program));
|
log = LogManager.GetLogger(typeof(Program));
|
||||||
log.Fatal("--------------------------------------------------------------------------------");
|
log.Fatal("--------------------------------------------------------------------------------");
|
||||||
log.Fatal(string.Format("TBF ver.{0}", Version));
|
log.FatalFormat("DeviceTest ver.{0}", Version);
|
||||||
|
|
||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
Application.SetCompatibleTextRenderingDefault(false);
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
|||||||
@@ -0,0 +1,94 @@
|
|||||||
|
using System;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace GemCard
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// This class represents a command APDU
|
||||||
|
/// </summary>
|
||||||
|
public class APDUCommand
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Minimun size of an APDU command in bytes
|
||||||
|
/// </summary>
|
||||||
|
public const int APDU_MIN_LENGTH = 4;
|
||||||
|
|
||||||
|
public byte Class; /// Class byte
|
||||||
|
public byte Ins; /// Instruction byte
|
||||||
|
public byte P1; /// Parameter P1 byte
|
||||||
|
public byte P2; /// Parameter P2 byte
|
||||||
|
public byte[] Data; /// Data to send to the card if any, null if no data to send
|
||||||
|
public byte Le; /// Number of data expected, 0 if none
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bCla">Class byte</param>
|
||||||
|
/// <param name="bIns">Instruction byte</param>
|
||||||
|
/// <param name="bP1">Parameter P1 byte</param>
|
||||||
|
/// <param name="bP2">Parameter P2 byte</param>
|
||||||
|
/// <param name="baData">Data to send to the card if any, null if no data to send</param>
|
||||||
|
/// <param name="bLe">Number of data expected, 0 if none</param>
|
||||||
|
public APDUCommand(byte bCla, byte bIns, byte bP1, byte bP2, byte[] baData, byte bLe)
|
||||||
|
{
|
||||||
|
this.Class = bCla;
|
||||||
|
this.Ins = bIns;
|
||||||
|
this.P1 = bP1;
|
||||||
|
this.P2 = bP2;
|
||||||
|
this.Data = baData;
|
||||||
|
this.Le = bLe;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update the current APDU with selected parameters
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="apduParam">APDU parameters</param>
|
||||||
|
public void Update(APDUParam apduParam)
|
||||||
|
{
|
||||||
|
if (apduParam.UseData) Data = apduParam.Data;
|
||||||
|
if (apduParam.UseLe) Le = apduParam.Le;
|
||||||
|
if (apduParam.UseP1) P1 = apduParam.P1;
|
||||||
|
if (apduParam.UseP2) P2 = apduParam.P2;
|
||||||
|
if (apduParam.UseChannel) Class += apduParam.Channel;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overrides the ToString method to format to a string the APDUCommand object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
string strData = null;
|
||||||
|
byte bLc = 0;
|
||||||
|
byte bP3 = Le;
|
||||||
|
|
||||||
|
if (Data != null)
|
||||||
|
{
|
||||||
|
StringBuilder sData = new StringBuilder(Data.Length * 2);
|
||||||
|
for (int nI = 0; nI < Data.Length; nI++)
|
||||||
|
{
|
||||||
|
sData.AppendFormat("{0:X02}", Data[nI]);
|
||||||
|
}
|
||||||
|
|
||||||
|
strData = "Data=" + sData.ToString();
|
||||||
|
bLc = (byte) Data.Length;
|
||||||
|
bP3 = bLc;
|
||||||
|
}
|
||||||
|
|
||||||
|
//string strApdu = string.Format("Class={0:X02} Ins={1:X02} P1={2:X02} P2={3:X02} Le={4:X02} Lc={5:X02} ",
|
||||||
|
//m_bCla, m_bIns, m_bP1, m_bP2, m_bLe, bLc);
|
||||||
|
StringBuilder strApdu = new StringBuilder();
|
||||||
|
|
||||||
|
strApdu.AppendFormat("Class={0:X02} Ins={1:X02} P1={2:X02} P2={3:X02} P3={4:X02} ",
|
||||||
|
Class, Ins, P1, P2, bP3);
|
||||||
|
|
||||||
|
if (Data != null)
|
||||||
|
{
|
||||||
|
strApdu.Append(strData);
|
||||||
|
}
|
||||||
|
|
||||||
|
return strApdu.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,147 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace GemCard
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// This class is used to update a set of parameters of an APDUCommand object
|
||||||
|
/// </summary>
|
||||||
|
public class APDUParam
|
||||||
|
{
|
||||||
|
byte bClass;
|
||||||
|
byte bChannel;
|
||||||
|
byte bP2;
|
||||||
|
byte bP1;
|
||||||
|
|
||||||
|
byte[] baData;
|
||||||
|
short nLe;
|
||||||
|
|
||||||
|
bool fUseP1;
|
||||||
|
bool fUseP2;
|
||||||
|
bool fChannel;
|
||||||
|
bool fData;
|
||||||
|
bool fClass;
|
||||||
|
bool fLe;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Resets the current instance, all flags are set to false
|
||||||
|
/// </summary>
|
||||||
|
public void Reset()
|
||||||
|
{
|
||||||
|
bClass = 0;
|
||||||
|
bChannel = 0;
|
||||||
|
bP2 = 0;
|
||||||
|
bP1 = 0;
|
||||||
|
|
||||||
|
baData = null;
|
||||||
|
nLe = -1;
|
||||||
|
|
||||||
|
fUseP1 = false;
|
||||||
|
fUseP2 = false;
|
||||||
|
fChannel = false;
|
||||||
|
fData = false;
|
||||||
|
fClass = false;
|
||||||
|
fLe = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Constructors
|
||||||
|
|
||||||
|
public APDUParam()
|
||||||
|
{
|
||||||
|
Reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Copy constructor (used for cloning)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="param"></param>
|
||||||
|
public APDUParam(APDUParam param)
|
||||||
|
{
|
||||||
|
// Copy field
|
||||||
|
if (param.baData != null)
|
||||||
|
{
|
||||||
|
param.baData.CopyTo(baData, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.bClass = param.bClass;
|
||||||
|
this.bChannel = param.bChannel;
|
||||||
|
this.bP1 = param.bP1;
|
||||||
|
this.bP2 = param.bP2;
|
||||||
|
this.nLe = param.nLe;
|
||||||
|
|
||||||
|
// Copy flags field
|
||||||
|
this.fChannel = param.fChannel;
|
||||||
|
this.fClass = param.fClass;
|
||||||
|
this.fData = param.fData;
|
||||||
|
this.fLe = param.fLe;
|
||||||
|
this.fUseP1 = param.fUseP1;
|
||||||
|
this.fUseP2 = param.fUseP2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public APDUParam(byte bClass, byte bP1, byte bP2, byte[] baData, short nLe)
|
||||||
|
{
|
||||||
|
this.Class = bClass;
|
||||||
|
this.P1 = bP1;
|
||||||
|
this.P2 = bP2;
|
||||||
|
this.Data = baData;
|
||||||
|
this.Le = (byte)nLe;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clones the current APDUParam instance
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public APDUParam Clone()
|
||||||
|
{
|
||||||
|
return new APDUParam(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Properties
|
||||||
|
|
||||||
|
public bool UseClass { get { return fClass; } }
|
||||||
|
public bool UseChannel { get { return fChannel; } }
|
||||||
|
public bool UseLe { get { return fLe; } }
|
||||||
|
public bool UseData { get { return fData; } }
|
||||||
|
public bool UseP1 { get { return fUseP1; } }
|
||||||
|
public bool UseP2 { get { return fUseP2; } }
|
||||||
|
|
||||||
|
public byte P1
|
||||||
|
{
|
||||||
|
get { return bP1; }
|
||||||
|
set { bP1 = value; fUseP1 = true; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte P2
|
||||||
|
{
|
||||||
|
get { return bP2; }
|
||||||
|
set { bP2 = value; fUseP2 = true; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] Data
|
||||||
|
{
|
||||||
|
get { return baData; }
|
||||||
|
set { baData = value; fData = true; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte Le
|
||||||
|
{
|
||||||
|
get { return (byte)nLe; }
|
||||||
|
set { nLe = value; fLe = true; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte Channel
|
||||||
|
{
|
||||||
|
get { return bChannel; }
|
||||||
|
set { bChannel = value; fChannel = true; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte Class
|
||||||
|
{
|
||||||
|
get { return bClass; }
|
||||||
|
set { bClass = value; fClass = true; }
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
using System;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace GemCard
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// This class represents the APDU response sent by the card
|
||||||
|
/// </summary>
|
||||||
|
public class APDUResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Status bytes length
|
||||||
|
/// </summary>
|
||||||
|
public const int SW_LENGTH = 2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Response data. Contains the data sent by the card minus the 2 status bytes (SW1, SW2)
|
||||||
|
/// null if no data were sent by the card
|
||||||
|
/// </summary>
|
||||||
|
public byte[] Data;
|
||||||
|
public byte SW1;
|
||||||
|
public byte SW2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Status get property
|
||||||
|
/// </summary>
|
||||||
|
public ushort Status
|
||||||
|
{
|
||||||
|
get { return (ushort)(((short)SW1 << 8) + (short)SW2); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor from the byte data sent back by the card
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="baData">Buffer of data from the card</param>
|
||||||
|
public APDUResponse(byte[] baData)
|
||||||
|
{
|
||||||
|
if (baData.Length > SW_LENGTH)
|
||||||
|
{
|
||||||
|
Data = new byte[baData.Length - SW_LENGTH];
|
||||||
|
|
||||||
|
for (int nI = 0; nI < baData.Length - SW_LENGTH; nI++)
|
||||||
|
{
|
||||||
|
this.Data[nI] = baData[nI];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.SW1 = baData[baData.Length - 2];
|
||||||
|
this.SW2 = baData[baData.Length - 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overrides the ToString method to format to a string the APDUResponse object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
if (Data != null)
|
||||||
|
{
|
||||||
|
StringBuilder sData = new StringBuilder(Data.Length * 2);
|
||||||
|
for (int nI = 0; nI < Data.Length; nI++)
|
||||||
|
{
|
||||||
|
sData.AppendFormat("{0:X02}", Data[nI]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return sData.ToString();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
|
//
|
||||||
|
// 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("")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("")]
|
||||||
|
[assembly: AssemblyCopyright("")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
//
|
||||||
|
// 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 Revision and Build Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
|
||||||
|
[assembly: AssemblyVersion("1.0.*")]
|
||||||
|
|
||||||
|
//
|
||||||
|
// In order to sign your assembly you must specify a key to use. Refer to the
|
||||||
|
// Microsoft .NET Framework documentation for more information on assembly signing.
|
||||||
|
//
|
||||||
|
// Use the attributes below to control which key is used for signing.
|
||||||
|
//
|
||||||
|
// Notes:
|
||||||
|
// (*) If no key is specified, the assembly is not signed.
|
||||||
|
// (*) KeyName refers to a key that has been installed in the Crypto Service
|
||||||
|
// Provider (CSP) on your machine. KeyFile refers to a file which contains
|
||||||
|
// a key.
|
||||||
|
// (*) If the KeyFile and the KeyName values are both specified, the
|
||||||
|
// following processing occurs:
|
||||||
|
// (1) If the KeyName can be found in the CSP, that key is used.
|
||||||
|
// (2) If the KeyName does not exist and the KeyFile does exist, the key
|
||||||
|
// in the KeyFile is installed into the CSP and used.
|
||||||
|
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
|
||||||
|
// When specifying the KeyFile, the location of the KeyFile should be
|
||||||
|
// relative to the project output directory which is
|
||||||
|
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
|
||||||
|
// located in the project directory, you would specify the AssemblyKeyFile
|
||||||
|
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
|
||||||
|
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
|
||||||
|
// documentation for more information on this.
|
||||||
|
//
|
||||||
|
[assembly: AssemblyDelaySign(false)]
|
||||||
|
[assembly: AssemblyKeyFile("")]
|
||||||
|
[assembly: AssemblyKeyName("")]
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
|
namespace GemCard
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Values for AttrId of SCardGetAttrib
|
||||||
|
/// </summary>
|
||||||
|
public class SCARD_ATTR_VALUE
|
||||||
|
{
|
||||||
|
private const uint
|
||||||
|
SCARD_CLASS_COMMUNICATIONS = 2,
|
||||||
|
SCARD_CLASS_PROTOCOL = 3,
|
||||||
|
SCARD_CLASS_MECHANICAL = 6,
|
||||||
|
SCARD_CLASS_VENDOR_DEFINED = 7,
|
||||||
|
SCARD_CLASS_IFD_PROTOCOL = 8,
|
||||||
|
SCARD_CLASS_ICC_STATE = 9,
|
||||||
|
SCARD_CLASS_SYSTEM = 0x7fff;
|
||||||
|
|
||||||
|
private static UInt32 SCardAttrValue(UInt32 attrClass, UInt32 val)
|
||||||
|
{
|
||||||
|
return (attrClass << 16) | val;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static UInt32 CHANNEL_ID { get { return SCardAttrValue(SCARD_CLASS_COMMUNICATIONS, 0x0110); } }
|
||||||
|
|
||||||
|
public static UInt32 CHARACTERISTICS { get { return SCardAttrValue(SCARD_CLASS_MECHANICAL, 0x0150); } }
|
||||||
|
|
||||||
|
public static UInt32 CURRENT_PROTOCOL_TYPE { get { return SCardAttrValue(SCARD_CLASS_IFD_PROTOCOL, 0x0201); } }
|
||||||
|
|
||||||
|
public static UInt32 DEVICE_UNIT { get { return SCardAttrValue(SCARD_CLASS_SYSTEM, 0x0001); } }
|
||||||
|
public static UInt32 DEVICE_FRIENDLY_NAME { get { return SCardAttrValue(SCARD_CLASS_SYSTEM, 0x0003); } }
|
||||||
|
public UInt32 DEVICE_SYSTEM_NAME { get { return SCardAttrValue(SCARD_CLASS_SYSTEM, 0x0004); } }
|
||||||
|
|
||||||
|
public static UInt32 ICC_PRESENCE { get { return SCardAttrValue(SCARD_CLASS_ICC_STATE, 0x0300); } }
|
||||||
|
public static UInt32 ICC_INTERFACE_STATUS { get { return SCardAttrValue(SCARD_CLASS_ICC_STATE, 0x0301); } }
|
||||||
|
public static UInt32 ATR_STRING { get { return SCardAttrValue(SCARD_CLASS_ICC_STATE, 0x0303); } }
|
||||||
|
public static UInt32 ICC_TYPE_PER_ATR { get { return SCardAttrValue(SCARD_CLASS_ICC_STATE, 0x0304); } }
|
||||||
|
|
||||||
|
public static UInt32 PROTOCOL_TYPES { get { return SCardAttrValue(SCARD_CLASS_PROTOCOL, 0x0120); } }
|
||||||
|
|
||||||
|
public static UInt32 VENDOR_NAME { get { return SCardAttrValue(SCARD_CLASS_VENDOR_DEFINED, 0x0100); } }
|
||||||
|
public static UInt32 VENDOR_IFD_TYPE { get { return SCardAttrValue(SCARD_CLASS_VENDOR_DEFINED, 0x0101); } }
|
||||||
|
public static UInt32 VENDOR_IFD_VERSION { get { return SCardAttrValue(SCARD_CLASS_VENDOR_DEFINED, 0x0102); } }
|
||||||
|
public static UInt32 VENDOR_IFD_SERIAL_NO { get { return SCardAttrValue(SCARD_CLASS_VENDOR_DEFINED, 0x0103); } }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Abstract class that adds a basic event management to the ICard interface.
|
||||||
|
/// </summary>
|
||||||
|
abstract public class CardBase : ICard
|
||||||
|
{
|
||||||
|
protected const uint INFINITE = 0xFFFFFFFF;
|
||||||
|
protected const uint WAIT_TIME = 250;
|
||||||
|
|
||||||
|
protected bool m_bRunCardDetection = true;
|
||||||
|
protected Thread m_thread = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Event handler for the card insertion
|
||||||
|
/// </summary>
|
||||||
|
public event EventHandler<CardInsertedEventArgs> OnCardInserted = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Event handler for the card removal
|
||||||
|
/// </summary>
|
||||||
|
public event EventHandler<CardRemovedEventArgs> OnCardRemoved = null;
|
||||||
|
|
||||||
|
~CardBase()
|
||||||
|
{
|
||||||
|
// Stop any eventual card detection thread
|
||||||
|
StopCardEvents();
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Abstract method that implement the ICard interface
|
||||||
|
abstract public string[] ListReaders();
|
||||||
|
abstract public void Connect(string Reader, SHARE ShareMode, PROTOCOL PreferredProtocols);
|
||||||
|
abstract public void Disconnect(DISCONNECT Disposition);
|
||||||
|
abstract public APDUResponse Transmit(APDUCommand ApduCmd);
|
||||||
|
abstract public void BeginTransaction();
|
||||||
|
abstract public void EndTransaction(DISCONNECT Disposition);
|
||||||
|
abstract public byte[] GetAttribute(UInt32 AttribId);
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This method should start a thread that checks for card insertion or removal
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Reader"></param>
|
||||||
|
public void StartCardEvents(string Reader)
|
||||||
|
{
|
||||||
|
if (m_thread == null)
|
||||||
|
{
|
||||||
|
m_bRunCardDetection = true;
|
||||||
|
|
||||||
|
m_thread = new Thread(new ParameterizedThreadStart(RunCardDetection));
|
||||||
|
m_thread.Start(Reader);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stops the card events thread
|
||||||
|
/// </summary>
|
||||||
|
public void StopCardEvents()
|
||||||
|
{
|
||||||
|
if (m_thread != null)
|
||||||
|
{
|
||||||
|
int
|
||||||
|
nTimeOut = 10,
|
||||||
|
nCount = 0;
|
||||||
|
bool m_bStop = false;
|
||||||
|
m_bRunCardDetection = false;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if (nCount > nTimeOut)
|
||||||
|
{
|
||||||
|
m_thread.Abort();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_thread.ThreadState == ThreadState.Aborted)
|
||||||
|
m_bStop = true;
|
||||||
|
|
||||||
|
if (m_thread.ThreadState == ThreadState.Stopped)
|
||||||
|
m_bStop = true;
|
||||||
|
|
||||||
|
Thread.Sleep(200);
|
||||||
|
++nCount; // Manage time out
|
||||||
|
}
|
||||||
|
while (!m_bStop);
|
||||||
|
|
||||||
|
m_thread = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This function must implement a card detection mechanism.
|
||||||
|
///
|
||||||
|
/// When card insertion is detected, it must call the method CardInserted()
|
||||||
|
/// When card removal is detected, it must call the method CardRemoved()
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Reader">Name of the reader to scan for card event</param>
|
||||||
|
abstract protected void RunCardDetection(object Reader);
|
||||||
|
|
||||||
|
#region Event methods
|
||||||
|
|
||||||
|
protected void CardInserted(object sender, CardInsertedEventArgs args)
|
||||||
|
{
|
||||||
|
if (OnCardInserted != null) OnCardInserted(sender, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void CardRemoved(object sender, CardRemovedEventArgs args)
|
||||||
|
{
|
||||||
|
if (OnCardRemoved != null) OnCardRemoved(sender, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using SCARDSSPLib;
|
||||||
|
using GemCardExLib;
|
||||||
|
|
||||||
|
namespace GemCard
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Implements the ICard interface using the SCard COM objects from Microsoft and SCardDatabaseEx object
|
||||||
|
/// for the ListReaders function.
|
||||||
|
/// </summary>
|
||||||
|
public class CardCOM : CardBase
|
||||||
|
{
|
||||||
|
private ISCard m_itfCard = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default constructor
|
||||||
|
/// </summary>
|
||||||
|
public CardCOM()
|
||||||
|
{
|
||||||
|
// Create the SCard object
|
||||||
|
m_itfCard = new CSCardClass();
|
||||||
|
}
|
||||||
|
|
||||||
|
#region ICard Members
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps the PCSC function
|
||||||
|
/// LONG SCardListReaders(SCARDCONTEXT hContext,
|
||||||
|
/// LPCTSTR mszGroups,
|
||||||
|
/// LPTSTR mszReaders,
|
||||||
|
/// LPDWORD pcchReaders
|
||||||
|
/// );
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A string array of the readers</returns>
|
||||||
|
public override string[] ListReaders()
|
||||||
|
{
|
||||||
|
ISCardDatabaseEx itfCardBase = new SCardDatabaseEx();
|
||||||
|
|
||||||
|
return (string[]) itfCardBase.ListReaders();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps the PCSC function
|
||||||
|
/// LONG SCardConnect(
|
||||||
|
/// IN SCARDCONTEXT hContext,
|
||||||
|
/// IN LPCTSTR szReader,
|
||||||
|
/// IN DWORD dwShareMode,
|
||||||
|
/// IN DWORD dwPreferredProtocols,
|
||||||
|
/// OUT LPSCARDHANDLE phCard,
|
||||||
|
/// OUT LPDWORD pdwActiveProtocol
|
||||||
|
/// );
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Reader"></param>
|
||||||
|
/// <param name="ShareMode"></param>
|
||||||
|
/// <param name="PreferredProtocols"></param>
|
||||||
|
public override void Connect(string Reader, SHARE ShareMode, PROTOCOL PreferredProtocols)
|
||||||
|
{
|
||||||
|
// Calls AttachReader to connect to the card
|
||||||
|
m_itfCard.AttachByReader(Reader, (SCARD_SHARE_MODES) ShareMode, (SCARD_PROTOCOLS) PreferredProtocols);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps the PCSC function
|
||||||
|
/// LONG SCardDisconnect(
|
||||||
|
/// IN SCARDHANDLE hCard,
|
||||||
|
/// IN DWORD dwDisposition
|
||||||
|
/// );
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Disposition"></param>
|
||||||
|
public override void Disconnect(DISCONNECT Disposition)
|
||||||
|
{
|
||||||
|
// Off the connection with the card
|
||||||
|
m_itfCard.Detach((SCARD_DISPOSITIONS) Disposition);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps the PCSC function
|
||||||
|
/// LONG SCardTransmit(
|
||||||
|
/// SCARDHANDLE hCard,
|
||||||
|
/// LPCSCARD_I0_REQUEST pioSendPci,
|
||||||
|
/// LPCBYTE pbSendBuffer,
|
||||||
|
/// DWORD cbSendLength,
|
||||||
|
/// LPSCARD_IO_REQUEST pioRecvPci,
|
||||||
|
/// LPBYTE pbRecvBuffer,
|
||||||
|
/// LPDWORD pcbRecvLength
|
||||||
|
/// );
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ApduCmd">APDUCommand object with the APDU to send to the card</param>
|
||||||
|
/// <returns>An APDUResponse object with the response from the card</returns>
|
||||||
|
public override APDUResponse Transmit(APDUCommand ApduCmd)
|
||||||
|
{
|
||||||
|
CSCardCmd itfCmd = new CSCardCmdClass();
|
||||||
|
CByteBuffer itfData = new CByteBufferClass();
|
||||||
|
int nLe = ApduCmd.Le;
|
||||||
|
|
||||||
|
if (ApduCmd.Data == null)
|
||||||
|
{
|
||||||
|
itfData.SetSize(0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int nWrite = 0;
|
||||||
|
|
||||||
|
itfData.SetSize(ApduCmd.Data.Length);
|
||||||
|
itfData.Write(ref ApduCmd.Data[0], ApduCmd.Data.Length, ref nWrite);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build the APDU command
|
||||||
|
itfCmd.BuildCmd(ApduCmd.Class, ApduCmd.Ins, ApduCmd.P1, ApduCmd.P2, itfData, ref nLe);
|
||||||
|
|
||||||
|
// Send the command
|
||||||
|
m_itfCard.Transaction(ref itfCmd);
|
||||||
|
|
||||||
|
// Analyse the response
|
||||||
|
int nRead = 0;
|
||||||
|
byte[] pbResp = new byte[itfCmd.ApduReplyLength];
|
||||||
|
|
||||||
|
itfCmd.ApduReply.Read(ref pbResp[0], itfCmd.ApduReplyLength, ref nRead);
|
||||||
|
|
||||||
|
return new APDUResponse(pbResp);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps the PSCS function
|
||||||
|
/// LONG SCardBeginTransaction(
|
||||||
|
/// SCARDHANDLE hCard
|
||||||
|
// );
|
||||||
|
/// This function is not supported in the COM implementation
|
||||||
|
/// </summary>
|
||||||
|
public override void BeginTransaction()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException("BeginTransaction is not supported in the COM implementation");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps the PCSC function
|
||||||
|
/// LONG SCardEndTransaction(
|
||||||
|
/// SCARDHANDLE hCard,
|
||||||
|
/// DWORD dwDisposition
|
||||||
|
/// );
|
||||||
|
/// This function is not supported in the COM implementation
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Disposition">A value from DISCONNECT enum</param>
|
||||||
|
public override void EndTransaction(DISCONNECT Disposition)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException("EndTransaction is not supported in the COM implementation");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the attributes of the card
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="AttribId">Identifier for the Attribute to get</param>
|
||||||
|
/// <returns>Attribute content</returns>
|
||||||
|
public override byte[] GetAttribute(UInt32 AttribId)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This function must implement a card detection mechanism.
|
||||||
|
///
|
||||||
|
/// When card insertion is detected, it must call the method CardInserted()
|
||||||
|
/// When card removal is detected, it must call the method CardRemoved()
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
protected override void RunCardDetection(object Reader)
|
||||||
|
{
|
||||||
|
throw new Exception("The method or operation is not implemented.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace GemCard
|
||||||
|
{
|
||||||
|
public class CardInsertedEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public CardInsertedEventArgs() { }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,620 @@
|
|||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
|
namespace GemCard
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// CARD_STATE enumeration, used by the PC/SC function SCardGetStatusChanged
|
||||||
|
/// </summary>
|
||||||
|
enum CARD_STATE
|
||||||
|
{
|
||||||
|
UNAWARE = 0x00000000,
|
||||||
|
IGNORE = 0x00000001,
|
||||||
|
CHANGED = 0x00000002,
|
||||||
|
UNKNOWN = 0x00000004,
|
||||||
|
UNAVAILABLE = 0x00000008,
|
||||||
|
EMPTY = 0x00000010,
|
||||||
|
PRESENT = 0x00000020,
|
||||||
|
ATRMATCH = 0x00000040,
|
||||||
|
EXCLUSIVE = 0x00000080,
|
||||||
|
INUSE = 0x00000100,
|
||||||
|
MUTE = 0x00000200,
|
||||||
|
UNPOWERED = 0x00000400
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps the SCARD_IO_STRUCTURE
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
public struct SCard_IO_Request
|
||||||
|
{
|
||||||
|
public UInt32 m_dwProtocol;
|
||||||
|
public UInt32 m_cbPciLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps theSCARD_READERSTATE structure of PC/SC
|
||||||
|
/// </summary>
|
||||||
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
|
||||||
|
public struct SCard_ReaderState
|
||||||
|
{
|
||||||
|
public string m_szReader;
|
||||||
|
public IntPtr m_pvUserData;
|
||||||
|
public UInt32 m_dwCurrentState;
|
||||||
|
public UInt32 m_dwEventState;
|
||||||
|
public UInt32 m_cbAtr;
|
||||||
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst=32)]
|
||||||
|
public byte[] m_rgbAtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Implementation of ICard using native (P/Invoke) interoperability for PC/SC
|
||||||
|
/// </summary>
|
||||||
|
public class CardNative : CardBase
|
||||||
|
{
|
||||||
|
private UInt32 m_hContext = 0;
|
||||||
|
private UInt32 m_hCard = 0;
|
||||||
|
private UInt32 m_nProtocol = (uint) PROTOCOL.T0;
|
||||||
|
private int m_nLastError = 0;
|
||||||
|
|
||||||
|
#region PCSC_FUNCTIONS
|
||||||
|
/// <summary>
|
||||||
|
/// Native SCardGetStatusChanged from winscard.dll
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="hContext"></param>
|
||||||
|
/// <param name="dwTimeout"></param>
|
||||||
|
/// <param name="rgReaderStates"></param>
|
||||||
|
/// <param name="cReaders"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[DllImport("winscard.dll", SetLastError = true)]
|
||||||
|
internal static extern int SCardGetStatusChange(UInt32 hContext,
|
||||||
|
UInt32 dwTimeout,
|
||||||
|
[In,Out] SCard_ReaderState[] rgReaderStates,
|
||||||
|
UInt32 cReaders);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Native SCardListReaders function from winscard.dll
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="hContext"></param>
|
||||||
|
/// <param name="mszGroups"></param>
|
||||||
|
/// <param name="mszReaders"></param>
|
||||||
|
/// <param name="pcchReaders"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[DllImport("winscard.dll", SetLastError=true)]
|
||||||
|
internal static extern int SCardListReaders(UInt32 hContext,
|
||||||
|
[MarshalAs(UnmanagedType.LPTStr)] string mszGroups,
|
||||||
|
IntPtr mszReaders,
|
||||||
|
out UInt32 pcchReaders);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Native SCardEstablishContext function from winscard.dll
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dwScope"></param>
|
||||||
|
/// <param name="pvReserved1"></param>
|
||||||
|
/// <param name="pvReserved2"></param>
|
||||||
|
/// <param name="phContext"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[DllImport("winscard.dll", SetLastError=true)]
|
||||||
|
internal static extern int SCardEstablishContext(UInt32 dwScope,
|
||||||
|
IntPtr pvReserved1,
|
||||||
|
IntPtr pvReserved2,
|
||||||
|
IntPtr phContext);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Native SCardReleaseContext function from winscard.dll
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="hContext"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[DllImport("winscard.dll", SetLastError=true)]
|
||||||
|
internal static extern int SCardReleaseContext(UInt32 hContext);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Native SCardConnect function from winscard.dll
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="hContext"></param>
|
||||||
|
/// <param name="szReader"></param>
|
||||||
|
/// <param name="dwShareMode"></param>
|
||||||
|
/// <param name="dwPreferredProtocols"></param>
|
||||||
|
/// <param name="phCard"></param>
|
||||||
|
/// <param name="pdwActiveProtocol"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[DllImport("winscard.dll", SetLastError=true, CharSet=CharSet.Auto)]
|
||||||
|
internal static extern int SCardConnect(UInt32 hContext,
|
||||||
|
[MarshalAs(UnmanagedType.LPTStr)] string szReader,
|
||||||
|
UInt32 dwShareMode,
|
||||||
|
UInt32 dwPreferredProtocols,
|
||||||
|
IntPtr phCard,
|
||||||
|
IntPtr pdwActiveProtocol);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Native SCardDisconnect function from winscard.dll
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="hCard"></param>
|
||||||
|
/// <param name="dwDisposition"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[DllImport("winscard.dll", SetLastError=true)]
|
||||||
|
internal static extern int SCardDisconnect(UInt32 hCard,
|
||||||
|
UInt32 dwDisposition);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Native SCardTransmit function from winscard.dll
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="hCard"></param>
|
||||||
|
/// <param name="pioSendPci"></param>
|
||||||
|
/// <param name="pbSendBuffer"></param>
|
||||||
|
/// <param name="cbSendLength"></param>
|
||||||
|
/// <param name="pioRecvPci"></param>
|
||||||
|
/// <param name="pbRecvBuffer"></param>
|
||||||
|
/// <param name="pcbRecvLength"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[DllImport("winscard.dll", SetLastError=true)]
|
||||||
|
internal static extern int SCardTransmit(UInt32 hCard,
|
||||||
|
[In] ref SCard_IO_Request pioSendPci,
|
||||||
|
byte[] pbSendBuffer,
|
||||||
|
UInt32 cbSendLength,
|
||||||
|
IntPtr pioRecvPci,
|
||||||
|
[Out] byte[] pbRecvBuffer,
|
||||||
|
out UInt32 pcbRecvLength
|
||||||
|
);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Native SCardBeginTransaction function of winscard.dll
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="hContext"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[DllImport("winscard.dll", SetLastError = true)]
|
||||||
|
internal static extern int SCardBeginTransaction(UInt32 hContext);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Native SCardEndTransaction function of winscard.dll
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="hContext"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[DllImport("winscard.dll", SetLastError = true)]
|
||||||
|
internal static extern int SCardEndTransaction(UInt32 hContext, UInt32 dwDisposition);
|
||||||
|
|
||||||
|
[DllImport("winscard.dll", SetLastError = true)]
|
||||||
|
internal static extern int SCardGetAttrib(UInt32 hCard,
|
||||||
|
UInt32 dwAttribId,
|
||||||
|
[Out] byte[] pbAttr,
|
||||||
|
out UInt32 pcbAttrLen);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default constructor
|
||||||
|
/// </summary>
|
||||||
|
public CardNative()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Object destruction
|
||||||
|
/// </summary>
|
||||||
|
~CardNative()
|
||||||
|
{
|
||||||
|
Disconnect(DISCONNECT.Unpower);
|
||||||
|
|
||||||
|
ReleaseContext();
|
||||||
|
}
|
||||||
|
|
||||||
|
#region ICard Members
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps the PCSC function
|
||||||
|
/// LONG SCardListReaders(SCARDCONTEXT hContext,
|
||||||
|
/// LPCTSTR mszGroups,
|
||||||
|
/// LPTSTR mszReaders,
|
||||||
|
/// LPDWORD pcchReaders
|
||||||
|
/// );
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A string array of the readers</returns>
|
||||||
|
public override string[] ListReaders()
|
||||||
|
{
|
||||||
|
EstablishContext(SCOPE.User);
|
||||||
|
|
||||||
|
string[] sListReaders = null;
|
||||||
|
UInt32 pchReaders = 0;
|
||||||
|
IntPtr szListReaders = IntPtr.Zero;
|
||||||
|
|
||||||
|
m_nLastError = SCardListReaders(m_hContext, null, szListReaders, out pchReaders);
|
||||||
|
if (m_nLastError == 0)
|
||||||
|
{
|
||||||
|
szListReaders = Marshal.AllocHGlobal((int) pchReaders);
|
||||||
|
m_nLastError = SCardListReaders(m_hContext, null, szListReaders, out pchReaders);
|
||||||
|
if (m_nLastError == 0)
|
||||||
|
{
|
||||||
|
char[] caReadersData = new char[pchReaders];
|
||||||
|
int nbReaders = 0;
|
||||||
|
for (int nI = 0; nI < pchReaders; nI++)
|
||||||
|
{
|
||||||
|
caReadersData[nI] = (char) Marshal.ReadByte(szListReaders, nI);
|
||||||
|
|
||||||
|
if (caReadersData[nI] == 0)
|
||||||
|
nbReaders++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove last 0
|
||||||
|
--nbReaders;
|
||||||
|
|
||||||
|
if (nbReaders != 0)
|
||||||
|
{
|
||||||
|
sListReaders = new string[nbReaders];
|
||||||
|
char[] caReader = new char[pchReaders];
|
||||||
|
int nIdx = 0;
|
||||||
|
int nIdy = 0;
|
||||||
|
int nIdz = 0;
|
||||||
|
// Get the nJ string from the multi-string
|
||||||
|
|
||||||
|
while(nIdx < pchReaders - 1)
|
||||||
|
{
|
||||||
|
caReader[nIdy] = caReadersData[nIdx];
|
||||||
|
if (caReader[nIdy] == 0)
|
||||||
|
{
|
||||||
|
sListReaders[nIdz] = new string(caReader, 0, nIdy);
|
||||||
|
++nIdz;
|
||||||
|
nIdy = 0;
|
||||||
|
caReader = new char[pchReaders];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
++nIdy;
|
||||||
|
|
||||||
|
++nIdx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Marshal.FreeHGlobal(szListReaders);
|
||||||
|
}
|
||||||
|
|
||||||
|
ReleaseContext();
|
||||||
|
|
||||||
|
return sListReaders;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps the PCSC function
|
||||||
|
/// LONG SCardEstablishContext(
|
||||||
|
/// IN DWORD dwScope,
|
||||||
|
/// IN LPCVOID pvReserved1,
|
||||||
|
/// IN LPCVOID pvReserved2,
|
||||||
|
/// OUT LPSCARDCONTEXT phContext
|
||||||
|
/// );
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Scope"></param>
|
||||||
|
public void EstablishContext(SCOPE Scope)
|
||||||
|
{
|
||||||
|
IntPtr hContext = Marshal.AllocHGlobal(Marshal.SizeOf(m_hContext));
|
||||||
|
|
||||||
|
m_nLastError = SCardEstablishContext((uint) Scope, IntPtr.Zero, IntPtr.Zero, hContext);
|
||||||
|
if (m_nLastError != 0)
|
||||||
|
{
|
||||||
|
string msg = "SCardEstablishContext error: " + m_nLastError;
|
||||||
|
|
||||||
|
Marshal.FreeHGlobal(hContext);
|
||||||
|
throw new Exception(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_hContext = (uint) Marshal.ReadInt32(hContext);
|
||||||
|
|
||||||
|
Marshal.FreeHGlobal(hContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps the PCSC function
|
||||||
|
/// LONG SCardReleaseContext(
|
||||||
|
/// IN SCARDCONTEXT hContext
|
||||||
|
/// );
|
||||||
|
/// </summary>
|
||||||
|
public void ReleaseContext()
|
||||||
|
{
|
||||||
|
if (m_hContext != 0)
|
||||||
|
{
|
||||||
|
m_nLastError = SCardReleaseContext(m_hContext);
|
||||||
|
|
||||||
|
if (m_nLastError != 0)
|
||||||
|
{
|
||||||
|
string msg = "SCardReleaseContext error: " + m_nLastError;
|
||||||
|
throw new Exception(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_hContext = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps the PCSC function
|
||||||
|
/// LONG SCardConnect(
|
||||||
|
/// IN SCARDCONTEXT hContext,
|
||||||
|
/// IN LPCTSTR szReader,
|
||||||
|
/// IN DWORD dwShareMode,
|
||||||
|
/// IN DWORD dwPreferredProtocols,
|
||||||
|
/// OUT LPSCARDHANDLE phCard,
|
||||||
|
/// OUT LPDWORD pdwActiveProtocol
|
||||||
|
/// );
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Reader"></param>
|
||||||
|
/// <param name="ShareMode"></param>
|
||||||
|
/// <param name="PreferredProtocols"></param>
|
||||||
|
public override void Connect(string Reader, SHARE ShareMode, PROTOCOL PreferredProtocols)
|
||||||
|
{
|
||||||
|
EstablishContext(SCOPE.User);
|
||||||
|
|
||||||
|
IntPtr hCard = Marshal.AllocHGlobal(Marshal.SizeOf(m_hCard));
|
||||||
|
IntPtr pProtocol = Marshal.AllocHGlobal(Marshal.SizeOf(m_nProtocol));
|
||||||
|
|
||||||
|
m_nLastError = SCardConnect(m_hContext,
|
||||||
|
Reader,
|
||||||
|
(uint) ShareMode,
|
||||||
|
(uint) PreferredProtocols,
|
||||||
|
hCard,
|
||||||
|
pProtocol);
|
||||||
|
|
||||||
|
if (m_nLastError != 0)
|
||||||
|
{
|
||||||
|
string msg = "SCardConnect error: " + m_nLastError;
|
||||||
|
|
||||||
|
Marshal.FreeHGlobal(hCard);
|
||||||
|
Marshal.FreeHGlobal(pProtocol);
|
||||||
|
throw new Exception(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_hCard = (uint) Marshal.ReadInt32(hCard);
|
||||||
|
m_nProtocol = (uint) Marshal.ReadInt32(pProtocol);
|
||||||
|
|
||||||
|
Marshal.FreeHGlobal(hCard);
|
||||||
|
Marshal.FreeHGlobal(pProtocol);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps the PCSC function
|
||||||
|
/// LONG SCardDisconnect(
|
||||||
|
/// IN SCARDHANDLE hCard,
|
||||||
|
/// IN DWORD dwDisposition
|
||||||
|
/// );
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Disposition"></param>
|
||||||
|
public override void Disconnect(DISCONNECT Disposition)
|
||||||
|
{
|
||||||
|
if (m_hCard != 0)
|
||||||
|
{
|
||||||
|
m_nLastError = SCardDisconnect(m_hCard, (uint) Disposition);
|
||||||
|
m_hCard = 0;
|
||||||
|
|
||||||
|
if (m_nLastError != 0)
|
||||||
|
{
|
||||||
|
string msg = "SCardDisconnect error: " + m_nLastError;
|
||||||
|
throw new Exception(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
ReleaseContext();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps the PCSC function
|
||||||
|
/// LONG SCardTransmit(
|
||||||
|
/// SCARDHANDLE hCard,
|
||||||
|
/// LPCSCARD_I0_REQUEST pioSendPci,
|
||||||
|
/// LPCBYTE pbSendBuffer,
|
||||||
|
/// DWORD cbSendLength,
|
||||||
|
/// LPSCARD_IO_REQUEST pioRecvPci,
|
||||||
|
/// LPBYTE pbRecvBuffer,
|
||||||
|
/// LPDWORD pcbRecvLength
|
||||||
|
/// );
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ApduCmd">APDUCommand object with the APDU to send to the card</param>
|
||||||
|
/// <returns>An APDUResponse object with the response from the card</returns>
|
||||||
|
public override APDUResponse Transmit(APDUCommand ApduCmd)
|
||||||
|
{
|
||||||
|
uint RecvLength = (uint) (ApduCmd.Le + APDUResponse.SW_LENGTH);
|
||||||
|
byte[] ApduBuffer = null;
|
||||||
|
byte[] ApduResponse = new byte[ApduCmd.Le + APDUResponse.SW_LENGTH];
|
||||||
|
SCard_IO_Request ioRequest = new SCard_IO_Request();
|
||||||
|
ioRequest.m_dwProtocol = m_nProtocol;
|
||||||
|
ioRequest.m_cbPciLength = 8;
|
||||||
|
|
||||||
|
// Build the command APDU
|
||||||
|
if (ApduCmd.Data == null)
|
||||||
|
{
|
||||||
|
ApduBuffer = new byte[APDUCommand.APDU_MIN_LENGTH + ((ApduCmd.Le != 0) ? 1 : 0)];
|
||||||
|
|
||||||
|
if (ApduCmd.Le != 0)
|
||||||
|
ApduBuffer[4] = (byte) ApduCmd.Le;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ApduBuffer = new byte[APDUCommand.APDU_MIN_LENGTH + 1 + ApduCmd.Data.Length];
|
||||||
|
|
||||||
|
for (int nI = 0; nI < ApduCmd.Data.Length; nI++)
|
||||||
|
ApduBuffer[APDUCommand.APDU_MIN_LENGTH + 1 + nI] = ApduCmd.Data[nI];
|
||||||
|
|
||||||
|
ApduBuffer[APDUCommand.APDU_MIN_LENGTH] = (byte) ApduCmd.Data.Length;
|
||||||
|
}
|
||||||
|
|
||||||
|
ApduBuffer[0] = ApduCmd.Class;
|
||||||
|
ApduBuffer[1] = ApduCmd.Ins;
|
||||||
|
ApduBuffer[2] = ApduCmd.P1;
|
||||||
|
ApduBuffer[3] = ApduCmd.P2;
|
||||||
|
|
||||||
|
m_nLastError = SCardTransmit(m_hCard, ref ioRequest, ApduBuffer, (uint) ApduBuffer.Length, IntPtr.Zero, ApduResponse, out RecvLength);
|
||||||
|
if (m_nLastError != 0)
|
||||||
|
{
|
||||||
|
string msg = "SCardTransmit error: " + m_nLastError;
|
||||||
|
throw new Exception(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
byte[] ApduData = new byte[RecvLength];
|
||||||
|
|
||||||
|
for (int nI = 0; nI < RecvLength; nI++)
|
||||||
|
ApduData[nI] = ApduResponse[nI];
|
||||||
|
|
||||||
|
return new APDUResponse(ApduData);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps the PSCS function
|
||||||
|
/// LONG SCardBeginTransaction(
|
||||||
|
/// SCARDHANDLE hCard
|
||||||
|
// );
|
||||||
|
/// </summary>
|
||||||
|
public override void BeginTransaction()
|
||||||
|
{
|
||||||
|
if (m_hCard != 0)
|
||||||
|
{
|
||||||
|
m_nLastError = SCardBeginTransaction(m_hCard);
|
||||||
|
if (m_nLastError != 0)
|
||||||
|
{
|
||||||
|
string msg = "SCardBeginTransaction error: " + m_nLastError;
|
||||||
|
throw new Exception(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps the PCSC function
|
||||||
|
/// LONG SCardEndTransaction(
|
||||||
|
/// SCARDHANDLE hCard,
|
||||||
|
/// DWORD dwDisposition
|
||||||
|
/// );
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Disposition">A value from DISCONNECT enum</param>
|
||||||
|
public override void EndTransaction(DISCONNECT Disposition)
|
||||||
|
{
|
||||||
|
if (m_hCard != 0)
|
||||||
|
{
|
||||||
|
m_nLastError = SCardEndTransaction(m_hCard, (UInt32)Disposition);
|
||||||
|
if (m_nLastError != 0)
|
||||||
|
{
|
||||||
|
string msg = "SCardEndTransaction error: " + m_nLastError;
|
||||||
|
throw new Exception(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the attributes of the card
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="AttribId">Identifier for the Attribute to get</param>
|
||||||
|
/// <returns>Attribute content</returns>
|
||||||
|
public override byte[] GetAttribute(UInt32 AttribId)
|
||||||
|
{
|
||||||
|
byte[] attr = null;
|
||||||
|
UInt32 attrLen = 0;
|
||||||
|
|
||||||
|
m_nLastError = SCardGetAttrib(m_hCard, AttribId, attr, out attrLen);
|
||||||
|
if (m_nLastError == 0)
|
||||||
|
{
|
||||||
|
if (attrLen != 0)
|
||||||
|
{
|
||||||
|
attr = new byte[attrLen];
|
||||||
|
m_nLastError = SCardGetAttrib(m_hCard, AttribId, attr, out attrLen);
|
||||||
|
if (m_nLastError != 0)
|
||||||
|
{
|
||||||
|
string msg = "SCardGetAttr error: " + m_nLastError;
|
||||||
|
throw new Exception(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string msg = "SCardGetAttr error: " + m_nLastError;
|
||||||
|
throw new Exception(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
return attr;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This function must implement a card detection mechanism.
|
||||||
|
///
|
||||||
|
/// When card insertion is detected, it must call the method CardInserted()
|
||||||
|
/// When card removal is detected, it must call the method CardRemoved()
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
protected override void RunCardDetection(object Reader)
|
||||||
|
{
|
||||||
|
bool bFirstLoop = true;
|
||||||
|
UInt32 hContext = 0; // Local context
|
||||||
|
IntPtr phContext;
|
||||||
|
|
||||||
|
phContext = Marshal.AllocHGlobal(Marshal.SizeOf(hContext));
|
||||||
|
|
||||||
|
if (SCardEstablishContext((uint) SCOPE.User, IntPtr.Zero, IntPtr.Zero, phContext) == 0)
|
||||||
|
{
|
||||||
|
hContext = (uint)Marshal.ReadInt32(phContext);
|
||||||
|
Marshal.FreeHGlobal(phContext);
|
||||||
|
|
||||||
|
UInt32 nbReaders = 1;
|
||||||
|
SCard_ReaderState[] readerState = new SCard_ReaderState[nbReaders];
|
||||||
|
|
||||||
|
readerState[0].m_dwCurrentState = (UInt32) CARD_STATE.UNAWARE;
|
||||||
|
readerState[0].m_szReader = (string)Reader;
|
||||||
|
|
||||||
|
UInt32 eventState;
|
||||||
|
UInt32 currentState = readerState[0].m_dwCurrentState;
|
||||||
|
|
||||||
|
// Card detection loop
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if (SCardGetStatusChange(hContext, WAIT_TIME
|
||||||
|
, readerState, nbReaders) == 0)
|
||||||
|
{
|
||||||
|
eventState = readerState[0].m_dwEventState;
|
||||||
|
currentState = readerState[0].m_dwCurrentState;
|
||||||
|
|
||||||
|
// Check state
|
||||||
|
if (((eventState & (uint) CARD_STATE.CHANGED) == (uint) CARD_STATE.CHANGED) && !bFirstLoop)
|
||||||
|
{
|
||||||
|
// State has changed
|
||||||
|
if ((eventState & (uint) CARD_STATE.EMPTY) == (uint) CARD_STATE.EMPTY)
|
||||||
|
{
|
||||||
|
// There is no card, card has been removed -> Fire CardRemoved event
|
||||||
|
CardRemoved(this, new CardRemovedEventArgs());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (((eventState & (uint)CARD_STATE.PRESENT) == (uint)CARD_STATE.PRESENT) &&
|
||||||
|
((eventState & (uint) CARD_STATE.PRESENT) != (currentState & (uint) CARD_STATE.PRESENT)))
|
||||||
|
{
|
||||||
|
// There is a card in the reader -> Fire CardInserted event
|
||||||
|
CardInserted(this, new CardInsertedEventArgs());
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((eventState & (uint) CARD_STATE.ATRMATCH) == (uint) CARD_STATE.ATRMATCH)
|
||||||
|
{
|
||||||
|
// There is a card in the reader and it matches the ATR we were expecting-> Fire CardInserted event
|
||||||
|
CardInserted(this, new CardInsertedEventArgs());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// The current stateis now the event state
|
||||||
|
readerState[0].m_dwCurrentState = eventState;
|
||||||
|
|
||||||
|
bFirstLoop = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Thread.Sleep(100);
|
||||||
|
|
||||||
|
if (m_bRunCardDetection == false)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
while (true); // Exit on request
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Marshal.FreeHGlobal(phContext);
|
||||||
|
throw new Exception("PC/SC error");
|
||||||
|
}
|
||||||
|
|
||||||
|
SCardReleaseContext(hContext);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace GemCard
|
||||||
|
{
|
||||||
|
public class CardRemovedEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public CardRemovedEventArgs() { }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,179 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ProjectType>Local</ProjectType>
|
||||||
|
<ProductVersion>8.0.50727</ProductVersion>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<ProjectGuid>{8B10D15A-39DE-4B56-8DD1-710C1EB3A697}</ProjectGuid>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ApplicationIcon>
|
||||||
|
</ApplicationIcon>
|
||||||
|
<AssemblyKeyContainerName>
|
||||||
|
</AssemblyKeyContainerName>
|
||||||
|
<AssemblyName>GemCard</AssemblyName>
|
||||||
|
<AssemblyOriginatorKeyFile>
|
||||||
|
</AssemblyOriginatorKeyFile>
|
||||||
|
<DefaultClientScript>JScript</DefaultClientScript>
|
||||||
|
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||||
|
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||||
|
<DelaySign>false</DelaySign>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<RootNamespace>GemCard</RootNamespace>
|
||||||
|
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||||
|
<StartupObject>
|
||||||
|
</StartupObject>
|
||||||
|
<FileUpgradeFlags>
|
||||||
|
</FileUpgradeFlags>
|
||||||
|
<UpgradeBackupLocation>
|
||||||
|
</UpgradeBackupLocation>
|
||||||
|
<OldToolsVersion>3.5</OldToolsVersion>
|
||||||
|
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||||
|
<PublishUrl>publish\</PublishUrl>
|
||||||
|
<Install>true</Install>
|
||||||
|
<InstallFrom>Disk</InstallFrom>
|
||||||
|
<UpdateEnabled>false</UpdateEnabled>
|
||||||
|
<UpdateMode>Foreground</UpdateMode>
|
||||||
|
<UpdateInterval>7</UpdateInterval>
|
||||||
|
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||||
|
<UpdatePeriodically>false</UpdatePeriodically>
|
||||||
|
<UpdateRequired>false</UpdateRequired>
|
||||||
|
<MapFileExtensions>true</MapFileExtensions>
|
||||||
|
<ApplicationRevision>0</ApplicationRevision>
|
||||||
|
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||||
|
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||||
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
|
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<BaseAddress>285212672</BaseAddress>
|
||||||
|
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
|
||||||
|
<ConfigurationOverrideFile>
|
||||||
|
</ConfigurationOverrideFile>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<DocumentationFile>
|
||||||
|
</DocumentationFile>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<FileAlignment>4096</FileAlignment>
|
||||||
|
<NoStdLib>false</NoStdLib>
|
||||||
|
<NoWarn>
|
||||||
|
</NoWarn>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<RegisterForComInterop>false</RegisterForComInterop>
|
||||||
|
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||||
|
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<BaseAddress>285212672</BaseAddress>
|
||||||
|
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
|
||||||
|
<ConfigurationOverrideFile>
|
||||||
|
</ConfigurationOverrideFile>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<DocumentationFile>
|
||||||
|
</DocumentationFile>
|
||||||
|
<DebugSymbols>false</DebugSymbols>
|
||||||
|
<FileAlignment>4096</FileAlignment>
|
||||||
|
<NoStdLib>false</NoStdLib>
|
||||||
|
<NoWarn>
|
||||||
|
</NoWarn>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<RegisterForComInterop>false</RegisterForComInterop>
|
||||||
|
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||||
|
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<BaseAddress>285212672</BaseAddress>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<FileAlignment>4096</FileAlignment>
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
|
||||||
|
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
|
||||||
|
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||||
|
<OutputPath>bin\x86\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<BaseAddress>285212672</BaseAddress>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<FileAlignment>4096</FileAlignment>
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
|
||||||
|
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="System">
|
||||||
|
<Name>System</Name>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Data">
|
||||||
|
<Name>System.Data</Name>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Xml">
|
||||||
|
<Name>System.XML</Name>
|
||||||
|
</Reference>
|
||||||
|
<COMReference Include="stdole">
|
||||||
|
<Guid>{00020430-0000-0000-C000-000000000046}</Guid>
|
||||||
|
<VersionMajor>2</VersionMajor>
|
||||||
|
<VersionMinor>0</VersionMinor>
|
||||||
|
<Lcid>0</Lcid>
|
||||||
|
<WrapperTool>primary</WrapperTool>
|
||||||
|
<Isolated>False</Isolated>
|
||||||
|
</COMReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="APDUCommand.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="APDUParam.cs" />
|
||||||
|
<Compile Include="APDUResponse.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="AssemblyInfo.cs" />
|
||||||
|
<Compile Include="CardBase.cs" />
|
||||||
|
<Compile Include="CardInsertedEventArgs.cs" />
|
||||||
|
<Compile Include="CardNative.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="CardRemovedEventArgs.cs" />
|
||||||
|
<Compile Include="ICard.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="SmartCardException.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||||
|
<Install>false</Install>
|
||||||
|
</BootstrapperPackage>
|
||||||
|
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||||
|
<Install>true</Install>
|
||||||
|
</BootstrapperPackage>
|
||||||
|
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<ProductName>Windows Installer 3.1</ProductName>
|
||||||
|
<Install>true</Install>
|
||||||
|
</BootstrapperPackage>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<PreBuildEvent>
|
||||||
|
</PreBuildEvent>
|
||||||
|
<PostBuildEvent>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<LastOpenVersion>8.0.50215</LastOpenVersion>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ReferencePath>
|
||||||
|
</ReferencePath>
|
||||||
|
<CopyProjectDestinationFolder>
|
||||||
|
</CopyProjectDestinationFolder>
|
||||||
|
<CopyProjectUncPath>
|
||||||
|
</CopyProjectUncPath>
|
||||||
|
<CopyProjectOption>0</CopyProjectOption>
|
||||||
|
<ProjectView>ProjectFiles</ProjectView>
|
||||||
|
<ProjectTrust>0</ProjectTrust>
|
||||||
|
<PublishUrlHistory />
|
||||||
|
<InstallUrlHistory />
|
||||||
|
<SupportUrlHistory />
|
||||||
|
<UpdateUrlHistory />
|
||||||
|
<BootstrapperUrlHistory />
|
||||||
|
<ErrorReportUrlHistory />
|
||||||
|
<FallbackCulture>en-US</FallbackCulture>
|
||||||
|
<VerifyUploadedFiles>false</VerifyUploadedFiles>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<EnableASPDebugging>false</EnableASPDebugging>
|
||||||
|
<EnableASPXDebugging>false</EnableASPXDebugging>
|
||||||
|
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
|
||||||
|
<EnableSQLServerDebugging>false</EnableSQLServerDebugging>
|
||||||
|
<RemoteDebugEnabled>false</RemoteDebugEnabled>
|
||||||
|
<RemoteDebugMachine>
|
||||||
|
</RemoteDebugMachine>
|
||||||
|
<StartAction>Project</StartAction>
|
||||||
|
<StartArguments>
|
||||||
|
</StartArguments>
|
||||||
|
<StartPage>
|
||||||
|
</StartPage>
|
||||||
|
<StartProgram>
|
||||||
|
</StartProgram>
|
||||||
|
<StartURL>
|
||||||
|
</StartURL>
|
||||||
|
<StartWorkingDirectory>
|
||||||
|
</StartWorkingDirectory>
|
||||||
|
<StartWithIE>true</StartWithIE>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<EnableASPDebugging>false</EnableASPDebugging>
|
||||||
|
<EnableASPXDebugging>false</EnableASPXDebugging>
|
||||||
|
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
|
||||||
|
<EnableSQLServerDebugging>false</EnableSQLServerDebugging>
|
||||||
|
<RemoteDebugEnabled>false</RemoteDebugEnabled>
|
||||||
|
<RemoteDebugMachine>
|
||||||
|
</RemoteDebugMachine>
|
||||||
|
<StartAction>Project</StartAction>
|
||||||
|
<StartArguments>
|
||||||
|
</StartArguments>
|
||||||
|
<StartPage>
|
||||||
|
</StartPage>
|
||||||
|
<StartProgram>
|
||||||
|
</StartProgram>
|
||||||
|
<StartURL>
|
||||||
|
</StartURL>
|
||||||
|
<StartWorkingDirectory>
|
||||||
|
</StartWorkingDirectory>
|
||||||
|
<StartWithIE>false</StartWithIE>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||||
|
<StartWithIE>true</StartWithIE>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,149 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace GemCard
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// This interface gives access to the basic card functions. It must be implemented by a class.
|
||||||
|
/// </summary>
|
||||||
|
public interface ICard
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps the PCSC funciton
|
||||||
|
/// LONG SCardListReaders(SCARDCONTEXT hContext,
|
||||||
|
/// LPCTSTR mszGroups,
|
||||||
|
/// LPTSTR mszReaders,
|
||||||
|
/// LPDWORD pcchReaders
|
||||||
|
/// );
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A string array of the readers</returns>
|
||||||
|
string[] ListReaders();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps the PCSC function
|
||||||
|
/// LONG SCardConnect(
|
||||||
|
/// IN SCARDCONTEXT hContext,
|
||||||
|
/// IN LPCTSTR szReader,
|
||||||
|
/// IN DWORD dwShareMode,
|
||||||
|
/// IN DWORD dwPreferredProtocols,
|
||||||
|
/// OUT LPSCARDHANDLE phCard,
|
||||||
|
/// OUT LPDWORD pdwActiveProtocol
|
||||||
|
/// );
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Reader"></param>
|
||||||
|
/// <param name="ShareMode"></param>
|
||||||
|
/// <param name="PreferredProtocols"></param>
|
||||||
|
void Connect(string Reader, SHARE ShareMode, PROTOCOL PreferredProtocols);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps the PCSC function
|
||||||
|
/// LONG SCardDisconnect(
|
||||||
|
/// IN SCARDHANDLE hCard,
|
||||||
|
/// IN DWORD dwDisposition
|
||||||
|
/// );
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Disposition"></param>
|
||||||
|
void Disconnect(DISCONNECT Disposition);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps the PCSC function
|
||||||
|
/// LONG SCardTransmit(
|
||||||
|
/// SCARDHANDLE hCard,
|
||||||
|
/// LPCSCARD_I0_REQUEST pioSendPci,
|
||||||
|
/// LPCBYTE pbSendBuffer,
|
||||||
|
/// DWORD cbSendLength,
|
||||||
|
/// LPSCARD_IO_REQUEST pioRecvPci,
|
||||||
|
/// LPBYTE pbRecvBuffer,
|
||||||
|
/// LPDWORD pcbRecvLength
|
||||||
|
/// );
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ApduCmd">APDUCommand object with the APDU to send to the card</param>
|
||||||
|
/// <returns>An APDUResponse object with the response from the card</returns>
|
||||||
|
APDUResponse Transmit(APDUCommand ApduCmd);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps the PSCS function
|
||||||
|
/// LONG SCardBeginTransaction(
|
||||||
|
/// SCARDHANDLE hCard
|
||||||
|
// );
|
||||||
|
/// </summary>
|
||||||
|
void BeginTransaction();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wraps the PCSC function
|
||||||
|
/// LONG SCardEndTransaction(
|
||||||
|
/// SCARDHANDLE hCard,
|
||||||
|
/// DWORD dwDisposition
|
||||||
|
/// );
|
||||||
|
/// </summary>
|
||||||
|
void EndTransaction(DISCONNECT Disposition);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the attributes of the card
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="AttribId">Identifier for the Attribute to get</param>
|
||||||
|
/// <returns>Attribute content</returns>
|
||||||
|
byte[] GetAttribute(UInt32 AttribId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SCOPE context
|
||||||
|
/// </summary>
|
||||||
|
public enum SCOPE
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The context is a user context, and any database operations are performed within the
|
||||||
|
/// domain of the user.
|
||||||
|
/// </summary>
|
||||||
|
User,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The context is that of the current terminal, and any database operations are performed
|
||||||
|
/// within the domain of that terminal. (The calling application must have appropriate
|
||||||
|
/// access permissions for any database actions.)
|
||||||
|
/// </summary>
|
||||||
|
Terminal,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The context is the system context, and any database operations are performed within the
|
||||||
|
/// domain of the system. (The calling application must have appropriate access
|
||||||
|
/// permissions for any database actions.)
|
||||||
|
/// </summary>
|
||||||
|
System
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SHARE mode enumeration
|
||||||
|
/// </summary>
|
||||||
|
public enum SHARE
|
||||||
|
{
|
||||||
|
Exclusive = 1, /// This app. is not willing to share this card with other applications.
|
||||||
|
Shared, /// This app. is willing to share this card with other applications.
|
||||||
|
Direct, /// This app. demands direct control of the reader, so it is not available to other applications.
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// PROTOCOL enumeration
|
||||||
|
/// </summary>
|
||||||
|
public enum PROTOCOL
|
||||||
|
{
|
||||||
|
Undefined = 0x00000000, /// There is no active protocol.
|
||||||
|
T0 = 0x00000001, /// T=0 is the active protocol.
|
||||||
|
T1 = 0x00000002, /// T=1 is the active protocol.
|
||||||
|
T0orT1 = T0 | T1, /// T=1 or T=0 can be the active protocol
|
||||||
|
Raw = 0x00010000, /// Raw is the active protocol.
|
||||||
|
Default = unchecked ((int) 0x80000000), /// Use implicit PTS.
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DISCONNECT action enumeration
|
||||||
|
/// </summary>
|
||||||
|
public enum DISCONNECT
|
||||||
|
{
|
||||||
|
Leave, /// Don't do anything special on close
|
||||||
|
Reset, /// Reset the card on close
|
||||||
|
Unpower, /// Power down the card on close
|
||||||
|
Eject, /// Eject(!) the card on close
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace GemCard
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Smart card exceptions
|
||||||
|
/// </summary>
|
||||||
|
public class SmartCardException : Exception
|
||||||
|
{
|
||||||
|
|
||||||
|
public SmartCardException() : base("Smart card exception")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public SmartCardException(string Message) : base(Message)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class ApduCommandException : Exception
|
||||||
|
{
|
||||||
|
public const string
|
||||||
|
NotValidDocument = "The file is not a valid APDU command document",
|
||||||
|
NoSuchCommand = "No such APDU command in the document",
|
||||||
|
ParamLeFormat = "Le parameter format is not correct",
|
||||||
|
ParamP3Format = "P3 parameter format is not correct",
|
||||||
|
NoSuchSequence = "No such APDU sequence in the document",
|
||||||
|
MissingApduOrCommand = "An Apdu or a Sequence is missing in this Sequence";
|
||||||
|
|
||||||
|
public ApduCommandException() : base("APDU command exception")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApduCommandException(string Message) : base(Message)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -75,7 +75,6 @@
|
|||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
<DependentUpon>Resources.resx</DependentUpon>
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="PrecisionTimer.cs" />
|
|
||||||
<Compile Include="Utils.cs" />
|
<Compile Include="Utils.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -43,11 +43,6 @@ namespace GraphLib
|
|||||||
PlotterGraphSelectCurvesForm GraphPropertiesForm = null;
|
PlotterGraphSelectCurvesForm GraphPropertiesForm = null;
|
||||||
PrintPreviewForm printPreviewForm = null;
|
PrintPreviewForm printPreviewForm = null;
|
||||||
|
|
||||||
private PrecisionTimer.Timer mTimer = null;
|
|
||||||
private float play_speed = 0.5f;
|
|
||||||
private float play_speed_max = 10f;
|
|
||||||
private float play_speed_min = 0.5f;
|
|
||||||
|
|
||||||
private bool paused = false;
|
private bool paused = false;
|
||||||
private bool isRunning = false;
|
private bool isRunning = false;
|
||||||
|
|
||||||
@@ -58,11 +53,6 @@ namespace GraphLib
|
|||||||
public PlotterDisplayEx()
|
public PlotterDisplayEx()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
mTimer = new PrecisionTimer.Timer();
|
|
||||||
mTimer.Period = 50; // 20 fps
|
|
||||||
mTimer.Tick += new EventHandler(OnTimerTick);
|
|
||||||
play_speed = 0.5f; // 20x10 = 200 values per second == sample frequency
|
|
||||||
mTimer.Start();
|
|
||||||
isRunning = false;
|
isRunning = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,85 +182,10 @@ namespace GraphLib
|
|||||||
|
|
||||||
protected override void Dispose(bool disposing)
|
protected override void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
paused = true;
|
paused = true;
|
||||||
|
|
||||||
if (mTimer.IsRunning)
|
|
||||||
{
|
|
||||||
mTimer.Stop();
|
|
||||||
mTimer.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
base.Dispose(disposing);
|
base.Dispose(disposing);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Start()
|
|
||||||
{
|
|
||||||
if (isRunning == false && paused == false)
|
|
||||||
{
|
|
||||||
gPane.starting_idx = 0;
|
|
||||||
paused = false;
|
|
||||||
isRunning = true;
|
|
||||||
// mTimer.Start();
|
|
||||||
tb1.Buttons[0].ImageIndex = 2;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (paused == false)
|
|
||||||
{
|
|
||||||
//mTimer.Stop();
|
|
||||||
paused = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// mTimer.Start();
|
|
||||||
paused = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (paused)
|
|
||||||
{
|
|
||||||
|
|
||||||
tb1.Buttons[0].ImageIndex = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
tb1.Buttons[0].ImageIndex = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Stop()
|
|
||||||
{
|
|
||||||
if (isRunning)
|
|
||||||
{
|
|
||||||
// mTimer.Stop();
|
|
||||||
isRunning = false;
|
|
||||||
paused = false;
|
|
||||||
hScrollBar1.Value = 0;
|
|
||||||
tb1.Buttons[0].ImageIndex = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void tb1_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
|
|
||||||
{
|
|
||||||
bool pushed = e.Button.Pushed;
|
|
||||||
switch (e.Button.Tag.ToString().ToLower())
|
|
||||||
{
|
|
||||||
case "play":
|
|
||||||
|
|
||||||
Start();
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "stop":
|
|
||||||
|
|
||||||
Stop();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SetPlayPanelVisible()
|
private void SetPlayPanelVisible()
|
||||||
{
|
{
|
||||||
panel1.Visible = true;
|
panel1.Visible = true;
|
||||||
@@ -317,27 +232,6 @@ namespace GraphLib
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdatePlayback()
|
|
||||||
{
|
|
||||||
if (!paused && isRunning == true)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
gPane.starting_idx += play_speed;
|
|
||||||
UpdateScrollBar();
|
|
||||||
gPane.Invalidate();
|
|
||||||
}
|
|
||||||
catch { }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnTimerTick(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
UpdateControl();
|
|
||||||
|
|
||||||
UpdatePlayback();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UpdateScrollBar()
|
private void UpdateScrollBar()
|
||||||
{
|
{
|
||||||
|
|||||||
Generated
-1
@@ -57,7 +57,6 @@ namespace GraphLib
|
|||||||
this.tb1.Size = new System.Drawing.Size(80, 26);
|
this.tb1.Size = new System.Drawing.Size(80, 26);
|
||||||
this.tb1.TabIndex = 1;
|
this.tb1.TabIndex = 1;
|
||||||
this.tb1.Visible = false;
|
this.tb1.Visible = false;
|
||||||
this.tb1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.tb1_ButtonClick);
|
|
||||||
//
|
//
|
||||||
// tbbSave
|
// tbbSave
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -1,490 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
#region License
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Based on the work of Leslie Sanford
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
namespace PrecisionTimer
|
|
||||||
{
|
|
||||||
public enum Mode
|
|
||||||
{
|
|
||||||
OneShot,
|
|
||||||
Periodic
|
|
||||||
};
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
|
||||||
public struct TimerCaps
|
|
||||||
{
|
|
||||||
public int periodMin;
|
|
||||||
public int periodMax;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public sealed class Timer : IComponent
|
|
||||||
{
|
|
||||||
private delegate void TimeProc(int id, int msg, int user, int param1, int param2);
|
|
||||||
|
|
||||||
private delegate void EventRaiser(EventArgs e);
|
|
||||||
|
|
||||||
[DllImport("winmm.dll")]
|
|
||||||
private static extern int timeGetDevCaps(ref TimerCaps caps,
|
|
||||||
int sizeOfTimerCaps);
|
|
||||||
|
|
||||||
[DllImport("winmm.dll")]
|
|
||||||
private static extern int timeSetEvent(int delay,
|
|
||||||
int resolution,
|
|
||||||
TimeProc proc,
|
|
||||||
int user,
|
|
||||||
int mode);
|
|
||||||
|
|
||||||
[DllImport("winmm.dll")]
|
|
||||||
private static extern int timeKillEvent(int id);
|
|
||||||
|
|
||||||
private const int TIMERR_NOERROR = 0;
|
|
||||||
|
|
||||||
private int timerID;
|
|
||||||
|
|
||||||
private volatile Mode mode;
|
|
||||||
|
|
||||||
private volatile int period;
|
|
||||||
|
|
||||||
private volatile int resolution;
|
|
||||||
|
|
||||||
private TimeProc timeProcPeriodic;
|
|
||||||
|
|
||||||
private TimeProc timeProcOneShot;
|
|
||||||
|
|
||||||
private EventRaiser tickRaiser;
|
|
||||||
|
|
||||||
private bool running = false;
|
|
||||||
|
|
||||||
private volatile bool disposed = false;
|
|
||||||
|
|
||||||
private ISynchronizeInvoke synchronizingObject = null;
|
|
||||||
|
|
||||||
private ISite site = null;
|
|
||||||
|
|
||||||
private static TimerCaps caps;
|
|
||||||
|
|
||||||
public event EventHandler Started;
|
|
||||||
|
|
||||||
public event EventHandler Stopped;
|
|
||||||
|
|
||||||
public event EventHandler Tick;
|
|
||||||
|
|
||||||
static Timer()
|
|
||||||
{
|
|
||||||
// Get multimedia timer capabilities.
|
|
||||||
timeGetDevCaps(ref caps, Marshal.SizeOf(caps));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Timer(IContainer container)
|
|
||||||
{
|
|
||||||
|
|
||||||
container.Add(this);
|
|
||||||
|
|
||||||
Initialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Timer()
|
|
||||||
{
|
|
||||||
Initialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
~Timer()
|
|
||||||
{
|
|
||||||
if(IsRunning)
|
|
||||||
{
|
|
||||||
// Stop and destroy timer.
|
|
||||||
timeKillEvent(timerID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Initialize()
|
|
||||||
{
|
|
||||||
this.mode = Mode.Periodic;
|
|
||||||
this.period = Capabilities.periodMin;
|
|
||||||
this.resolution = 1;
|
|
||||||
|
|
||||||
running = false;
|
|
||||||
|
|
||||||
timeProcPeriodic = new TimeProc(TimerPeriodicEventCallback);
|
|
||||||
timeProcOneShot = new TimeProc(TimerOneShotEventCallback);
|
|
||||||
tickRaiser = new EventRaiser(OnTick);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void Start()
|
|
||||||
{
|
|
||||||
|
|
||||||
if(disposed)
|
|
||||||
{
|
|
||||||
throw new ObjectDisposedException("Timer");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(IsRunning)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(Mode == Mode.Periodic)
|
|
||||||
{
|
|
||||||
timerID = timeSetEvent(Period, Resolution, timeProcPeriodic, 0, (int)Mode);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
timerID = timeSetEvent(Period, Resolution, timeProcOneShot, 0, (int)Mode);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(timerID != 0)
|
|
||||||
{
|
|
||||||
running = true;
|
|
||||||
|
|
||||||
if(SynchronizingObject != null && SynchronizingObject.InvokeRequired)
|
|
||||||
{
|
|
||||||
SynchronizingObject.BeginInvoke(
|
|
||||||
new EventRaiser(OnStarted),
|
|
||||||
new object[] { EventArgs.Empty });
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
OnStarted(EventArgs.Empty);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw new TimerException("Unable to start timer.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void Stop()
|
|
||||||
{
|
|
||||||
|
|
||||||
if(disposed)
|
|
||||||
{
|
|
||||||
throw new ObjectDisposedException("Timer");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!running)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int result = timeKillEvent(timerID);
|
|
||||||
|
|
||||||
Debug.Assert(result == TIMERR_NOERROR);
|
|
||||||
|
|
||||||
running = false;
|
|
||||||
|
|
||||||
if(SynchronizingObject != null && SynchronizingObject.InvokeRequired)
|
|
||||||
{
|
|
||||||
SynchronizingObject.BeginInvoke(
|
|
||||||
new EventRaiser(OnStopped),
|
|
||||||
new object[] { EventArgs.Empty });
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
OnStopped(EventArgs.Empty);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void TimerPeriodicEventCallback(int id, int msg, int user, int param1, int param2)
|
|
||||||
{
|
|
||||||
if(synchronizingObject != null)
|
|
||||||
{
|
|
||||||
synchronizingObject.BeginInvoke(tickRaiser, new object[] { EventArgs.Empty });
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
OnTick(EventArgs.Empty);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TimerOneShotEventCallback(int id, int msg, int user, int param1, int param2)
|
|
||||||
{
|
|
||||||
if(synchronizingObject != null)
|
|
||||||
{
|
|
||||||
synchronizingObject.BeginInvoke(tickRaiser, new object[] { EventArgs.Empty });
|
|
||||||
Stop();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
OnTick(EventArgs.Empty);
|
|
||||||
Stop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Raises the Disposed event.
|
|
||||||
private void OnDisposed(EventArgs e)
|
|
||||||
{
|
|
||||||
EventHandler handler = Disposed;
|
|
||||||
|
|
||||||
if(handler != null)
|
|
||||||
{
|
|
||||||
handler(this, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Raises the Started event.
|
|
||||||
private void OnStarted(EventArgs e)
|
|
||||||
{
|
|
||||||
EventHandler handler = Started;
|
|
||||||
|
|
||||||
if(handler != null)
|
|
||||||
{
|
|
||||||
handler(this, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Raises the Stopped event.
|
|
||||||
private void OnStopped(EventArgs e)
|
|
||||||
{
|
|
||||||
EventHandler handler = Stopped;
|
|
||||||
|
|
||||||
if(handler != null)
|
|
||||||
{
|
|
||||||
handler(this, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Raises the Tick event.
|
|
||||||
private void OnTick(EventArgs e)
|
|
||||||
{
|
|
||||||
EventHandler handler = Tick;
|
|
||||||
|
|
||||||
if(handler != null)
|
|
||||||
{
|
|
||||||
handler(this, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the object used to marshal event-handler calls.
|
|
||||||
/// </summary>
|
|
||||||
public ISynchronizeInvoke SynchronizingObject
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
#region Require
|
|
||||||
|
|
||||||
if(disposed)
|
|
||||||
{
|
|
||||||
throw new ObjectDisposedException("Timer");
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
return synchronizingObject;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
#region Require
|
|
||||||
|
|
||||||
if(disposed)
|
|
||||||
{
|
|
||||||
throw new ObjectDisposedException("Timer");
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
synchronizingObject = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public int Period
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
#region Require
|
|
||||||
|
|
||||||
if(disposed)
|
|
||||||
{
|
|
||||||
throw new ObjectDisposedException("Timer");
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
return period;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
#region Require
|
|
||||||
|
|
||||||
if(disposed)
|
|
||||||
{
|
|
||||||
throw new ObjectDisposedException("Timer");
|
|
||||||
}
|
|
||||||
else if(value < Capabilities.periodMin || value > Capabilities.periodMax)
|
|
||||||
{
|
|
||||||
throw new ArgumentOutOfRangeException("Period", value,
|
|
||||||
"Multimedia Timer period out of range.");
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
period = value;
|
|
||||||
|
|
||||||
if(IsRunning)
|
|
||||||
{
|
|
||||||
Stop();
|
|
||||||
Start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public int Resolution
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
|
|
||||||
if(disposed)
|
|
||||||
{
|
|
||||||
throw new ObjectDisposedException("Timer");
|
|
||||||
}
|
|
||||||
|
|
||||||
return resolution;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if(disposed)
|
|
||||||
{
|
|
||||||
throw new ObjectDisposedException("Timer");
|
|
||||||
}
|
|
||||||
else if(value < 0)
|
|
||||||
{
|
|
||||||
throw new ArgumentOutOfRangeException("Resolution", value,
|
|
||||||
"timer resolution out of range.");
|
|
||||||
}
|
|
||||||
|
|
||||||
resolution = value;
|
|
||||||
|
|
||||||
if(IsRunning)
|
|
||||||
{
|
|
||||||
Stop();
|
|
||||||
Start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Mode Mode
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
|
|
||||||
if(disposed)
|
|
||||||
{
|
|
||||||
throw new ObjectDisposedException("Timer");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return mode;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
|
|
||||||
if(disposed)
|
|
||||||
{
|
|
||||||
throw new ObjectDisposedException("Timer");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
mode = value;
|
|
||||||
|
|
||||||
if(IsRunning)
|
|
||||||
{
|
|
||||||
Stop();
|
|
||||||
Start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets a value indicating whether the Timer is running.
|
|
||||||
/// </summary>
|
|
||||||
public bool IsRunning
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return running;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the timer capabilities.
|
|
||||||
/// </summary>
|
|
||||||
public static TimerCaps Capabilities
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return caps;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public event System.EventHandler Disposed;
|
|
||||||
|
|
||||||
public ISite Site
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return site;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
site = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
|
|
||||||
if(disposed)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(IsRunning)
|
|
||||||
{
|
|
||||||
Stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
disposed = true;
|
|
||||||
|
|
||||||
OnDisposed(EventArgs.Empty);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class TimerException : ApplicationException
|
|
||||||
{
|
|
||||||
public TimerException(string message) : base(message)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace MonitoringDB.Entities
|
|
||||||
{
|
|
||||||
public class Process
|
|
||||||
{
|
|
||||||
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; }
|
|
||||||
public virtual ReleaseStatus ReleaseStatus { get; set; }
|
|
||||||
public virtual DateTime TimeStamp { get; set; }
|
|
||||||
public virtual string UserName { get; set; }
|
|
||||||
|
|
||||||
public virtual IList<Part> Parts { get; set; }
|
|
||||||
public virtual IList<Workstep> Worksteps { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Default (private) constructor inicializing lists
|
|
||||||
/// </summary>
|
|
||||||
protected Process()
|
|
||||||
{
|
|
||||||
Parts = new List<Part>();
|
|
||||||
Worksteps = new List<Workstep>();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Constructor used when this process is created
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="name"></param>
|
|
||||||
public Process(string name)
|
|
||||||
: this()
|
|
||||||
{
|
|
||||||
Name = name;
|
|
||||||
Description = string.Empty;
|
|
||||||
ReleaseStatus = ReleaseStatus.In_preparation;
|
|
||||||
TimeStamp = DateTime.Now;
|
|
||||||
UserName = "admin";
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Create a copy of a process with a new name
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="name"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public virtual Process Clone(string name)
|
|
||||||
{
|
|
||||||
Process rslt = new Process(name);
|
|
||||||
rslt.Description = Description;
|
|
||||||
|
|
||||||
foreach (var part in Parts) rslt.Parts.Add(part.Clone(rslt));
|
|
||||||
foreach (var workstep in Worksteps) rslt.Worksteps.Add(workstep.Clone(rslt));
|
|
||||||
|
|
||||||
return rslt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string ToString()
|
|
||||||
{
|
|
||||||
return string.Format("{0} '{1}' ({2}) {3} {4}",
|
|
||||||
ItemNr,
|
|
||||||
Name,
|
|
||||||
TimeStamp.Date.ToShortDateString(),
|
|
||||||
(Description == null) ? string.Empty : Description,
|
|
||||||
ReleaseStatus);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,94 +0,0 @@
|
|||||||
namespace MonitoringDB
|
|
||||||
{
|
|
||||||
public enum CodeType
|
|
||||||
{
|
|
||||||
UniqueNr,
|
|
||||||
FlowtubeNr, /// prvé 3 znaky sa zhodujú s poslednými 3 znakmi názvu
|
|
||||||
FlowtubeNrLU, /// začiatok kódu sa zhoduje s názvom
|
|
||||||
BatchNr,
|
|
||||||
BatchNrContainingPartName,
|
|
||||||
DateMMYY,
|
|
||||||
QualityCheck,
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum CodeForm
|
|
||||||
{
|
|
||||||
Barcode,
|
|
||||||
QRCode,
|
|
||||||
Keyboard,
|
|
||||||
OkNok,
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum CodeLocation
|
|
||||||
{
|
|
||||||
OnPart,
|
|
||||||
OnPallet,
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum LifetimeManagement
|
|
||||||
{
|
|
||||||
None,
|
|
||||||
OneYear,
|
|
||||||
Count,
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum ReleaseStatus
|
|
||||||
{
|
|
||||||
In_preparation,
|
|
||||||
Released,
|
|
||||||
ReleasedActive,
|
|
||||||
Deactivated,
|
|
||||||
Count,
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum Mode
|
|
||||||
{
|
|
||||||
Debug, // Debug mode - no Oracle database used
|
|
||||||
Test, // Test database used
|
|
||||||
Production, // Production database used
|
|
||||||
Count,
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum LoginLevel
|
|
||||||
{
|
|
||||||
None,
|
|
||||||
TeamLeader,
|
|
||||||
Administrator,
|
|
||||||
MH,
|
|
||||||
Count,
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum ItemSpecID
|
|
||||||
{
|
|
||||||
RefRecordID = 0,
|
|
||||||
|
|
||||||
TimeStamp,
|
|
||||||
Workstep,
|
|
||||||
Workplace,
|
|
||||||
UserName,
|
|
||||||
Barcode,
|
|
||||||
PartBarcode,
|
|
||||||
|
|
||||||
TimeStamp2,
|
|
||||||
Workstep2,
|
|
||||||
Workplace2,
|
|
||||||
UserName2,
|
|
||||||
Barcode2,
|
|
||||||
PartBarcode2,
|
|
||||||
|
|
||||||
SerialNr,
|
|
||||||
PurchaseOrder,
|
|
||||||
TestResult,
|
|
||||||
MaxPruefindex,
|
|
||||||
|
|
||||||
Process,
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum ItemSpecCaps
|
|
||||||
{
|
|
||||||
None = 0,
|
|
||||||
ReferenceRecord = 1,
|
|
||||||
AssociatedRecord = 2,
|
|
||||||
OracleQuery = 4,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
namespace MonitoringDB.Forms
|
|
||||||
{
|
|
||||||
public partial class SettingsDlg : Form
|
|
||||||
{
|
|
||||||
public string WorkplaceName
|
|
||||||
{
|
|
||||||
set { workplaceNameTextBox.Text = value; }
|
|
||||||
get { return workplaceNameTextBox.Text; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public string ConnectionString
|
|
||||||
{
|
|
||||||
set { connectionStringTextBox.Text = value; }
|
|
||||||
get { return connectionStringTextBox.Text; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public string UsersDBConnString
|
|
||||||
{
|
|
||||||
set { usersDBConnStringTextBox.Text = value; }
|
|
||||||
get { return usersDBConnStringTextBox.Text; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool OracleBattery
|
|
||||||
{
|
|
||||||
set { oracleBatteryCheckBox.Checked = value; }
|
|
||||||
get { return oracleBatteryCheckBox.Checked; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool CheckPcbIsInOracle
|
|
||||||
{
|
|
||||||
set { checkPcbIsInOracleCheckBox.Checked = value; }
|
|
||||||
get { return checkPcbIsInOracleCheckBox.Checked; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int ExtraBatterLifetime
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
int extraLifetime;
|
|
||||||
if (int.TryParse(extraBatteryLifetimeTextBox.Text, out extraLifetime) && extraLifetime >= 0) return extraLifetime;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public MonitoringDB.Mode Mode
|
|
||||||
{
|
|
||||||
set
|
|
||||||
{
|
|
||||||
radioButton1.Checked = (value == MonitoringDB.Mode.Test);
|
|
||||||
radioButton2.Checked = (value == MonitoringDB.Mode.Production);
|
|
||||||
}
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return radioButton1.Checked ? MonitoringDB.Mode.Test : MonitoringDB.Mode.Production;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Basic configuration dialog
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="isWorkplace">false = Konfiguracia pracovisk, true = Pracovisko</param>
|
|
||||||
public SettingsDlg(bool isWorkplace)
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
if (isWorkplace)
|
|
||||||
{
|
|
||||||
oracleGroupBox.Visible = true;
|
|
||||||
}
|
|
||||||
extraBatteryLifetimeTextBox.Text = "0";
|
|
||||||
}
|
|
||||||
|
|
||||||
private void saveButton_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
DialogResult = DialogResult.OK;
|
|
||||||
Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void cancelButton_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
DialogResult = DialogResult.Cancel;
|
|
||||||
Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
namespace MonitoringDB.Forms
|
|
||||||
{
|
|
||||||
public partial class TrivialLoginDlg : Form
|
|
||||||
{
|
|
||||||
public LoginLevel LoginLevel;
|
|
||||||
|
|
||||||
public TrivialLoginDlg()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
LoginLevel = LoginLevel.None;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void okButton_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (passwordTextBox.Text.ToLower().Equals("barcode"))
|
|
||||||
{
|
|
||||||
LoginLevel = LoginLevel.Administrator;
|
|
||||||
DialogResult = DialogResult.OK;
|
|
||||||
Close();
|
|
||||||
}
|
|
||||||
else if (passwordTextBox.Text.ToLower().Equals("teamleader"))
|
|
||||||
{
|
|
||||||
LoginLevel = LoginLevel.TeamLeader;
|
|
||||||
DialogResult = DialogResult.OK;
|
|
||||||
Close();
|
|
||||||
}
|
|
||||||
else if (passwordTextBox.Text.ToLower().Equals("kremik"))
|
|
||||||
{
|
|
||||||
LoginLevel = LoginLevel.MH;
|
|
||||||
DialogResult = DialogResult.OK;
|
|
||||||
Close();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DialogResult = DialogResult.Cancel;
|
|
||||||
Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void cancelButton_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
DialogResult = DialogResult.Cancel;
|
|
||||||
Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-105
@@ -1,105 +0,0 @@
|
|||||||
namespace MonitoringDB.Forms
|
|
||||||
{
|
|
||||||
partial class TrivialLoginDlg
|
|
||||||
{
|
|
||||||
/// <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.passwordGroupBox = new System.Windows.Forms.GroupBox();
|
|
||||||
this.passwordTextBox = new System.Windows.Forms.TextBox();
|
|
||||||
this.okButton = new System.Windows.Forms.Button();
|
|
||||||
this.cancelButton = new System.Windows.Forms.Button();
|
|
||||||
this.passwordGroupBox.SuspendLayout();
|
|
||||||
this.SuspendLayout();
|
|
||||||
//
|
|
||||||
// passwordGroupBox
|
|
||||||
//
|
|
||||||
this.passwordGroupBox.Controls.Add(this.passwordTextBox);
|
|
||||||
this.passwordGroupBox.Location = new System.Drawing.Point(12, 10);
|
|
||||||
this.passwordGroupBox.Name = "passwordGroupBox";
|
|
||||||
this.passwordGroupBox.Size = new System.Drawing.Size(200, 49);
|
|
||||||
this.passwordGroupBox.TabIndex = 0;
|
|
||||||
this.passwordGroupBox.TabStop = false;
|
|
||||||
this.passwordGroupBox.Text = "Heslo";
|
|
||||||
//
|
|
||||||
// passwordTextBox
|
|
||||||
//
|
|
||||||
this.passwordTextBox.Location = new System.Drawing.Point(51, 18);
|
|
||||||
this.passwordTextBox.Name = "passwordTextBox";
|
|
||||||
this.passwordTextBox.PasswordChar = '*';
|
|
||||||
this.passwordTextBox.Size = new System.Drawing.Size(100, 20);
|
|
||||||
this.passwordTextBox.TabIndex = 0;
|
|
||||||
//
|
|
||||||
// okButton
|
|
||||||
//
|
|
||||||
this.okButton.Location = new System.Drawing.Point(237, 18);
|
|
||||||
this.okButton.Name = "okButton";
|
|
||||||
this.okButton.Size = new System.Drawing.Size(75, 39);
|
|
||||||
this.okButton.TabIndex = 1;
|
|
||||||
this.okButton.Text = "OK";
|
|
||||||
this.okButton.UseVisualStyleBackColor = true;
|
|
||||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
|
||||||
//
|
|
||||||
// cancelButton
|
|
||||||
//
|
|
||||||
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
|
||||||
this.cancelButton.Location = new System.Drawing.Point(330, 18);
|
|
||||||
this.cancelButton.Name = "cancelButton";
|
|
||||||
this.cancelButton.Size = new System.Drawing.Size(75, 39);
|
|
||||||
this.cancelButton.TabIndex = 2;
|
|
||||||
this.cancelButton.Text = "Cancel";
|
|
||||||
this.cancelButton.UseVisualStyleBackColor = true;
|
|
||||||
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
|
|
||||||
//
|
|
||||||
// LoginDlg
|
|
||||||
//
|
|
||||||
this.AcceptButton = this.okButton;
|
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
|
||||||
this.CancelButton = this.cancelButton;
|
|
||||||
this.ClientSize = new System.Drawing.Size(426, 73);
|
|
||||||
this.Controls.Add(this.cancelButton);
|
|
||||||
this.Controls.Add(this.okButton);
|
|
||||||
this.Controls.Add(this.passwordGroupBox);
|
|
||||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
|
||||||
this.MaximizeBox = false;
|
|
||||||
this.MinimizeBox = false;
|
|
||||||
this.Name = "LoginDlg";
|
|
||||||
this.Text = "LoginDlg";
|
|
||||||
this.passwordGroupBox.ResumeLayout(false);
|
|
||||||
this.passwordGroupBox.PerformLayout();
|
|
||||||
this.ResumeLayout(false);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
private System.Windows.Forms.GroupBox passwordGroupBox;
|
|
||||||
private System.Windows.Forms.TextBox passwordTextBox;
|
|
||||||
private System.Windows.Forms.Button okButton;
|
|
||||||
private System.Windows.Forms.Button cancelButton;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
using FluentNHibernate.Mapping;
|
|
||||||
|
|
||||||
namespace MonitoringDB.Mappings
|
|
||||||
{
|
|
||||||
class ProcessMap : ClassMap<Entities.Process>
|
|
||||||
{
|
|
||||||
public ProcessMap()
|
|
||||||
{
|
|
||||||
Id(x => x.Id);
|
|
||||||
Map(x => x.ItemNr);
|
|
||||||
Map(x => x.Name);
|
|
||||||
Map(x => x.Description);
|
|
||||||
Map(x => x.ReleaseStatus);
|
|
||||||
Map(x => x.TimeStamp);
|
|
||||||
Map(x => x.UserName);
|
|
||||||
|
|
||||||
HasMany(x => x.Parts)
|
|
||||||
.OrderBy("Name")
|
|
||||||
.Cascade.All();
|
|
||||||
HasMany(x => x.Worksteps)
|
|
||||||
.OrderBy("WorkstepNr")
|
|
||||||
.Cascade.All();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+13
-5
@@ -27,8 +27,8 @@ namespace Results
|
|||||||
public Batch Batch;
|
public Batch Batch;
|
||||||
public WaterMeter[] WaterMeters;
|
public WaterMeter[] WaterMeters;
|
||||||
|
|
||||||
public static BatchResults NewFromProcedure(int batchNr, int benchId, string user, int userNr, string programVer,
|
public static BatchResults NewFromProcedure(int batchNr, int benchId, string benchName, string a1, string a2, string a3, string a4, string a5,
|
||||||
Config.Entities.Procedure procedure,
|
string user, int userNr, string programVer, Config.Entities.Procedure procedure,
|
||||||
WaterMeterData[] waterMeterDatas, int[] waterMeterParts, double densityCorr)
|
WaterMeterData[] waterMeterDatas, int[] waterMeterParts, double densityCorr)
|
||||||
{
|
{
|
||||||
BatchResults d = new BatchResults(waterMeterDatas.Length);
|
BatchResults d = new BatchResults(waterMeterDatas.Length);
|
||||||
@@ -37,8 +37,14 @@ namespace Results
|
|||||||
/// Create new batch
|
/// Create new batch
|
||||||
d.Batch = new Batch()
|
d.Batch = new Batch()
|
||||||
{
|
{
|
||||||
TestBenchId = benchId,
|
BatchNr = batchNr,
|
||||||
BatchNr = batchNr,
|
TestBenchId = benchId,
|
||||||
|
TestBenchName = benchName,
|
||||||
|
Address1 = a1,
|
||||||
|
Address2 = a2,
|
||||||
|
Address3 = a3,
|
||||||
|
Address4 = a4,
|
||||||
|
Address5 = a5,
|
||||||
ProgramVersion = programVer,
|
ProgramVersion = programVer,
|
||||||
UserName = user,
|
UserName = user,
|
||||||
UserNumber = userNr,
|
UserNumber = userNr,
|
||||||
@@ -199,8 +205,10 @@ namespace Results
|
|||||||
{
|
{
|
||||||
foreach (var mtr in WaterMeters[i].MeterTestRslts)
|
foreach (var mtr in WaterMeters[i].MeterTestRslts)
|
||||||
{
|
{
|
||||||
if (mtr.TestData().Name.ToLower().Contains("adj"))
|
if (mtr.TestData().Name.ToLower().Contains("adj") || mtr.TestData().Name.ToLower().Contains("just"))
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-8
@@ -296,13 +296,13 @@ namespace Results
|
|||||||
ISession session = DB.CreateSession();
|
ISession session = DB.CreateSession();
|
||||||
if (session == null) return null;
|
if (session == null) return null;
|
||||||
|
|
||||||
TestDataList = session.QueryOver<TestData>().List();
|
|
||||||
ComponentsList = session.QueryOver<Components>().List();
|
|
||||||
WaterMeterDataList = session.QueryOver<WaterMeterData>().List();
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
batches = session.QueryOver<Batch>()
|
TestDataList = session.QueryOver<TestData>().List();
|
||||||
|
ComponentsList = session.QueryOver<Components>().List();
|
||||||
|
WaterMeterDataList = session.QueryOver<WaterMeterData>().List();
|
||||||
|
|
||||||
|
batches = session.QueryOver<Batch>()
|
||||||
.Where(x => (x.BatchNr == batchNr))
|
.Where(x => (x.BatchNr == batchNr))
|
||||||
.List();
|
.List();
|
||||||
|
|
||||||
@@ -315,14 +315,14 @@ namespace Results
|
|||||||
.Where(x => (x.Batch.Id == batch.Id))
|
.Where(x => (x.Batch.Id == batch.Id))
|
||||||
.List();
|
.List();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
return (batches.Count > 0) ? batches[0] : null;
|
||||||
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
log.FatalFormat("Cannot load batch #{0}: {1}", batchNr, exc.Message);
|
log.FatalFormat("Cannot load batch #{0}: {1}", batchNr, exc.Message);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (batches.Count > 0) ? batches[0] : null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,13 @@ namespace Results.Entities
|
|||||||
public virtual int Id { get; protected set; }
|
public virtual int Id { get; protected set; }
|
||||||
public virtual int BatchNr { get; set; }
|
public virtual int BatchNr { get; set; }
|
||||||
public virtual int TestBenchId { get; set; }
|
public virtual int TestBenchId { get; set; }
|
||||||
public virtual string ProgramVersion { get; set; }
|
public virtual string TestBenchName { get; set; } /// CEVAK, not mapped to DB
|
||||||
|
public virtual string Address1 { get; set; } /// CEVAK, not mapped to DB
|
||||||
|
public virtual string Address2 { get; set; } /// CEVAK, not mapped to DB
|
||||||
|
public virtual string Address3 { get; set; } /// CEVAK, not mapped to DB
|
||||||
|
public virtual string Address4 { get; set; } /// CEVAK, not mapped to DB
|
||||||
|
public virtual string Address5 { get; set; } /// CEVAK, not mapped to DB
|
||||||
|
public virtual string ProgramVersion { get; set; }
|
||||||
public virtual string UserName { get; set; }
|
public virtual string UserName { get; set; }
|
||||||
public virtual int UserNumber { get; set; }
|
public virtual int UserNumber { get; set; }
|
||||||
public virtual string ProcedureName { get; set; }
|
public virtual string ProcedureName { get; set; }
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace Results.Entities
|
|||||||
public virtual int Id { get; protected set; }
|
public virtual int Id { get; protected set; }
|
||||||
|
|
||||||
public virtual byte CompoundMeterId { get; set; } /// 0=single, 1=compound/main, 2=compound/aux., 3=compound/overal, 4=heat meter volume, 5=heat meter energy
|
public virtual byte CompoundMeterId { get; set; } /// 0=single, 1=compound/main, 2=compound/aux., 3=compound/overal, 4=heat meter volume, 5=heat meter energy
|
||||||
public virtual string RegReaderClass { get; set; } /// Not mapped to the DB, does not depent on localisation and customer
|
public virtual int RegReaderType { get; set; } /// Not mapped to the DB, does not depent on localisation and customer
|
||||||
|
|
||||||
public virtual double PulsesMeter { get; set; } /// # of water meter or heat meter pulses
|
public virtual double PulsesMeter { get; set; } /// # of water meter or heat meter pulses
|
||||||
public virtual double PulsesMaster { get; set; } /// # of reference flowmeter pulses (gated by this water meter pulses)
|
public virtual double PulsesMaster { get; set; } /// # of reference flowmeter pulses (gated by this water meter pulses)
|
||||||
@@ -28,6 +28,9 @@ namespace Results.Entities
|
|||||||
public virtual double KorrErrQ { get; set; } /// [%] not mapped to results DB, saved to Oracle DB
|
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 TestDone { get; set; } /// true = test was completed
|
||||||
public virtual bool Passed { get; set; } /// true = test passed, water meter is OK
|
public virtual bool Passed { get; set; } /// true = test passed, water meter is OK
|
||||||
|
#if ORACLE_DB
|
||||||
|
public virtual double LastError { get; set; } /// [%] Previous test error at this Q in case Pruefindex > 1
|
||||||
|
#endif
|
||||||
|
|
||||||
public virtual WaterMeter WaterMeter { get; set; } /// reference to the WaterMeter entity
|
public virtual WaterMeter WaterMeter { get; set; } /// reference to the WaterMeter entity
|
||||||
public virtual TestRslt TestRslt { get; set; } /// reference to the TestRslt entity
|
public virtual TestRslt TestRslt { get; set; } /// reference to the TestRslt entity
|
||||||
@@ -75,10 +78,23 @@ namespace Results.Entities
|
|||||||
(CompoundMeterId == (byte)Config.Entities.CompoundMeterId.HeatMeterEnergy);
|
(CompoundMeterId == (byte)Config.Entities.CompoundMeterId.HeatMeterEnergy);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual string PassedColorStr()
|
public virtual bool IsPulses() { return (RegReaderType == (int)Config.Entities.RegisterReaderType.Pulses || RegReaderType == (int)Config.Entities.RegisterReaderType.Unknown); }
|
||||||
|
public virtual bool IsCamera() { return (RegReaderType == (int)Config.Entities.RegisterReaderType.Camera); }
|
||||||
|
public virtual bool IsDataStream() { return (RegReaderType == (int)Config.Entities.RegisterReaderType.DataStream); }
|
||||||
|
public virtual bool IsManual() { return (RegReaderType == (int)Config.Entities.RegisterReaderType.Manual); }
|
||||||
|
|
||||||
|
public virtual string PassedColorStr(string yesNoFormatOrEmpty)
|
||||||
{
|
{
|
||||||
return Utils.PassedColorStr(Passed, Evaluate());
|
if (string.IsNullOrEmpty(yesNoFormatOrEmpty))
|
||||||
}
|
{
|
||||||
|
return Utils.PassedColorStr(Passed, Evaluate());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string[] yesNo = yesNoFormatOrEmpty.Split(new char[] { '~' });
|
||||||
|
return Passed ? yesNo[0] : ((yesNo.Length >= 2) ? yesNo[1] : Results.Resources.Strings.No);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public MeterTestRslt()
|
public MeterTestRslt()
|
||||||
{
|
{
|
||||||
@@ -99,7 +115,7 @@ namespace Results.Entities
|
|||||||
if (src == null) return;
|
if (src == null) return;
|
||||||
|
|
||||||
CompoundMeterId = src.CompoundMeterId;
|
CompoundMeterId = src.CompoundMeterId;
|
||||||
RegReaderClass = src.RegReaderClass;
|
RegReaderType = src.RegReaderType;
|
||||||
PulsesMeter = src.PulsesMeter;
|
PulsesMeter = src.PulsesMeter;
|
||||||
PulsesMaster = src.PulsesMaster;
|
PulsesMaster = src.PulsesMaster;
|
||||||
PulsesPerLiter = src.PulsesPerLiter;
|
PulsesPerLiter = src.PulsesPerLiter;
|
||||||
|
|||||||
@@ -25,9 +25,13 @@ namespace Results.Entities
|
|||||||
public virtual DateTime EndTime { get; set; } /// Date and time of the test end
|
public virtual DateTime EndTime { get; set; } /// Date and time of the test end
|
||||||
public virtual int FlowSetTime { get; set; } /// [s] Measurement time in seconds
|
public virtual int FlowSetTime { get; set; } /// [s] Measurement time in seconds
|
||||||
public virtual double TestTime { get; set; } /// [s] Measurement time in seconds
|
public virtual double TestTime { get; set; } /// [s] Measurement time in seconds
|
||||||
public virtual double PulsesMaster { get; set; }
|
public virtual double PulsesMaster { get; set; } /// [pls] FlyingStartMassCollectionProlonged: MID pulses of the water to the tank
|
||||||
public virtual double ConstMaster { get; set; } /// [pls/l] Pulses per liter master flow meter
|
public virtual double TotalPulsesMstr { get; set; } /// [pls] FlyingStartMassCollectionProlonged: MID pulses of the complete test (not mapped to DB)
|
||||||
public virtual double MassStartRaw { get; set; } /// [kg]
|
public virtual double ConstMasterRaw { get; set; } /// [l/pls] Liters per pulse of the master flow meter uncorrected.
|
||||||
|
public virtual double ConstMasterCorr { get; set; } /// [l/pls] Liters per pulse of the master flow meter corrected by a correction table.
|
||||||
|
public virtual double ConstMaster { get; set; } /// [l/pls] Liters per pulse of the master flow meter calculated from a mass measurement.
|
||||||
|
/// When mass measurement is not available, corrected by a correction table.
|
||||||
|
public virtual double MassStartRaw { get; set; } /// [kg]
|
||||||
public virtual double MassStart { get; set; } /// [kg]
|
public virtual double MassStart { get; set; } /// [kg]
|
||||||
public virtual double MassEndRaw { get; set; } /// [kg]
|
public virtual double MassEndRaw { get; set; } /// [kg]
|
||||||
public virtual double MassEnd { get; set; } /// [kg]
|
public virtual double MassEnd { get; set; } /// [kg]
|
||||||
@@ -39,7 +43,7 @@ namespace Results.Entities
|
|||||||
public virtual double FlowVolume { get; set; } /// [m3/h]
|
public virtual double FlowVolume { get; set; } /// [m3/h]
|
||||||
public virtual double VolumeCTV { get; set; } /// [l] Volume conventional true value
|
public virtual double VolumeCTV { get; set; } /// [l] Volume conventional true value
|
||||||
public virtual double VolumeMaster { get; set; } /// [l] Volume from the master flow meter
|
public virtual double VolumeMaster { get; set; } /// [l] Volume from the master flow meter
|
||||||
public virtual double ErrorMaster { get; set; } /// [%]
|
public virtual double ErrorMaster { get; set; } /// [%] Error of the master flow meter
|
||||||
|
|
||||||
public virtual float DiverterStart { get; set; } /// [s] Diverter switch time when test starts
|
public virtual float DiverterStart { get; set; } /// [s] Diverter switch time when test starts
|
||||||
public virtual float DivStart10 { get; set; } /// [s] Diverter switch time when test starts at level 10 (e.g. 10%) (not mapped to DB)
|
public virtual float DivStart10 { get; set; } /// [s] Diverter switch time when test starts at level 10 (e.g. 10%) (not mapped to DB)
|
||||||
@@ -106,7 +110,7 @@ namespace Results.Entities
|
|||||||
public virtual float FlowMean { get; set; } /// [m3/h] mean flow from the reference flowmeter
|
public virtual float FlowMean { get; set; } /// [m3/h] mean flow from the reference flowmeter
|
||||||
public virtual float FlowStart { get; set; } /// [m3/h] flow at the start of test from the reference flowmeter
|
public virtual float FlowStart { get; set; } /// [m3/h] flow at the start of test from the reference flowmeter
|
||||||
public virtual float FlowEnd { get; set; } /// [m3/h] flow at the end of test from the reference flowmeter
|
public virtual float FlowEnd { get; set; } /// [m3/h] flow at the end of test from the reference flowmeter
|
||||||
public virtual float FlowMin { get; set; } /// [m3/h] not mapped to DB
|
public virtual float FlowMin { get; set; } /// [m3/h]
|
||||||
public virtual float FlowMax { get; set; } /// [m3/h]
|
public virtual float FlowMax { get; set; } /// [m3/h]
|
||||||
|
|
||||||
public virtual float Custom1 { get; set; } /// [°C] T ref hi mean
|
public virtual float Custom1 { get; set; } /// [°C] T ref hi mean
|
||||||
@@ -128,6 +132,10 @@ namespace Results.Entities
|
|||||||
public virtual double TargetVolume() { return TestData.TargetVolume; }
|
public virtual double TargetVolume() { return TestData.TargetVolume; }
|
||||||
public virtual double TargetTime() { return TestData.TargetTime; }
|
public virtual double TargetTime() { return TestData.TargetTime; }
|
||||||
public virtual string Method() { return TestData.Method; }
|
public virtual string Method() { return TestData.Method; }
|
||||||
|
public virtual bool IsRelErrTest() { return (MethodClass != null) ? (MethodClass.Contains("FixedStart") || MethodClass.Contains("FlyingStart") || MethodClass.Contains("CombinedWithDetection")) : true; }
|
||||||
|
public virtual bool IsPMaxTest() { return (MethodClass != null) ? (MethodClass.Contains("PMaxTest") || MethodClass.Contains("LeakTest")) : 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")) : true; }
|
||||||
|
|
||||||
public virtual double ErrLimLo()
|
public virtual double ErrLimLo()
|
||||||
{
|
{
|
||||||
@@ -212,6 +220,7 @@ namespace Results.Entities
|
|||||||
FlowSetTime = src.FlowSetTime;
|
FlowSetTime = src.FlowSetTime;
|
||||||
TestTime = src.TestTime;
|
TestTime = src.TestTime;
|
||||||
PulsesMaster = src.PulsesMaster;
|
PulsesMaster = src.PulsesMaster;
|
||||||
|
ConstMasterRaw = src.ConstMasterRaw;
|
||||||
ConstMaster = src.ConstMaster;
|
ConstMaster = src.ConstMaster;
|
||||||
MassStartRaw = src.MassStartRaw;
|
MassStartRaw = src.MassStartRaw;
|
||||||
MassStart = src.MassStart;
|
MassStart = src.MassStart;
|
||||||
@@ -302,7 +311,12 @@ namespace Results.Entities
|
|||||||
/// <summary> Wrapper </summary>
|
/// <summary> Wrapper </summary>
|
||||||
public virtual string ErrorFlagsStr()
|
public virtual string ErrorFlagsStr()
|
||||||
{
|
{
|
||||||
return Utils.ErrorFlagsStr(ErrorFlags);
|
string eFlags = Utils.ErrorFlagsStr(ErrorFlags);
|
||||||
|
#if LANG_PL
|
||||||
|
return string.IsNullOrEmpty(eFlags) ? "brak" : eFlags;
|
||||||
|
#else
|
||||||
|
return eFlags;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
|
|||||||
@@ -58,13 +58,15 @@ namespace Results.Entities
|
|||||||
|
|
||||||
#if IPERL
|
#if IPERL
|
||||||
public virtual int SerialNrEx { get; set; } /// Aux s/n for compound meters, Serial number for iPerl water meter
|
public virtual int SerialNrEx { get; set; } /// Aux s/n for compound meters, Serial number for iPerl water meter
|
||||||
public virtual double OrigCalibFactor { get; set; } /// iPerl calibration factor used during the test
|
public virtual double OrigCalibFactor { get; set; } /// Original iPerl calibration factor used during the test
|
||||||
public virtual double CalibFactor { get; set; } /// iPerl calibration factor used during the test
|
public virtual double CalibFactor { get; set; } /// iPerl calibration factor used during the test
|
||||||
public virtual double Q2ErrWOCorrection { get; set; }
|
public virtual double OrigCalibFactorLNA{ get; set; } /// Original iPerl LNA calibration factor used during the test
|
||||||
|
public virtual double CalibFactorLNA { get; set; } /// iPerl LNA calibration factor used during the test
|
||||||
|
public virtual double Q2ErrWOCorrection { get; set; }
|
||||||
public virtual bool Q2CorrectionDone { get; set; } /// true = iPerl Q2 correction was done
|
public virtual bool Q2CorrectionDone { get; set; } /// true = iPerl Q2 correction was done
|
||||||
public virtual double Q2Correction { get; set; } /// !!! obsolete
|
public virtual double Q2Correction { get; set; } /// !!! obsolete
|
||||||
public virtual int Q2CorrRFlow { get; set; } /// iPerl Q2 correction for the R-flow written to iPerl
|
public virtual int Q2CorrRL { get; set; } /// iPerl Q2 correction for the R-flow written to iPerl
|
||||||
public virtual int Q2CorrLFlow { get; set; } /// iPerl Q2 correction for the L-flow written to iPerl
|
public virtual int Q2CorrLR { get; set; } /// iPerl Q2 correction for the L-flow written to iPerl
|
||||||
public virtual int Q2CorrFlowRight { get; set; } /// 1 = right to left
|
public virtual int Q2CorrFlowRight { get; set; } /// 1 = right to left
|
||||||
public virtual double Diff2Hz8Hz { get; set; }
|
public virtual double Diff2Hz8Hz { get; set; }
|
||||||
public virtual bool Hz2CorrectionDone { get; set; } /// true = iPerl Q2 correction was done
|
public virtual bool Hz2CorrectionDone { get; set; } /// true = iPerl Q2 correction was done
|
||||||
@@ -117,7 +119,7 @@ namespace Results.Entities
|
|||||||
ErrorFlagsMode eFlagsMode = 0; /// = ErrorFlagsMode.Off;
|
ErrorFlagsMode eFlagsMode = 0; /// = ErrorFlagsMode.Off;
|
||||||
foreach (var mtr in MeterTestRslts)
|
foreach (var mtr in MeterTestRslts)
|
||||||
{
|
{
|
||||||
if (mtr.TestDone) errorFlags |= mtr.TestRslt.ErrorFlags;
|
if (mtr.Evaluate() && mtr.TestDone) errorFlags |= mtr.TestRslt.ErrorFlags;
|
||||||
if ((int)mtr.TestRslt.ErrorFlagsMode() > (int)eFlagsMode) eFlagsMode = mtr.TestRslt.ErrorFlagsMode();
|
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)
|
errorFlagsMode = eFlagsMode; /// Maximum from all tests (=ErrorFlagsMode.On if at least one test is ErrorFlagsMode.On)
|
||||||
@@ -130,10 +132,48 @@ namespace Results.Entities
|
|||||||
return (errorFlagsMode != ErrorFlagsMode.Off) ? (eFlagsFromTests | ErrorFlags) : 0;
|
return (errorFlagsMode != ErrorFlagsMode.Off) ? (eFlagsFromTests | ErrorFlags) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual string ErrorFlagstStr()
|
/// <summary>
|
||||||
|
/// Convert combined errorFlags of all tests to string
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>ErrorFlags string</returns>
|
||||||
|
public virtual string ErrorFlagsStr()
|
||||||
{
|
{
|
||||||
ErrorFlagsMode errorFlagsMode;
|
ErrorFlagsMode errorFlagsMode;
|
||||||
return Utils.ErrorFlagsStr(ErrorFlagsFromTestsAndWM(out errorFlagsMode));
|
string eFlags = Utils.ErrorFlagsStr(ErrorFlagsFromTestsAndWM(out errorFlagsMode));
|
||||||
|
#if LANG_PL
|
||||||
|
return string.IsNullOrEmpty(eFlags) ? "brak" : eFlags;
|
||||||
|
#else
|
||||||
|
return eFlags;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual string PassedOrErrorFlagsStr()
|
||||||
|
{
|
||||||
|
ErrorFlagsMode errorFlagsMode;
|
||||||
|
string eFlags = Utils.ErrorFlagsStr(ErrorFlagsFromTestsAndWM(out errorFlagsMode));
|
||||||
|
return string.IsNullOrEmpty(eFlags) ? (WaterMeterData.Text4 + PassedColorStr(null)) : eFlags;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Convert failed tests and combined errorFlags of all tests to string
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>ErrorFlagsEx string</returns>
|
||||||
|
public virtual string ErrorFlagsStrEx()
|
||||||
|
{
|
||||||
|
StringBuilder errFlgsStr = new StringBuilder();
|
||||||
|
foreach (var mtr in MeterTestRslts)
|
||||||
|
{
|
||||||
|
if (mtr.Evaluate() && mtr.TestDone && !mtr.Passed)
|
||||||
|
{
|
||||||
|
errFlgsStr.Append(mtr.Name());
|
||||||
|
errFlgsStr.Append(" ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ErrorFlagsMode errorFlagsMode;
|
||||||
|
errFlgsStr.Append(Utils.ErrorFlagsStr(ErrorFlagsFromTestsAndWM(out errorFlagsMode)));
|
||||||
|
|
||||||
|
return errFlgsStr.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool PassedFromTests()
|
public virtual bool PassedFromTests()
|
||||||
@@ -171,12 +211,22 @@ namespace Results.Entities
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public virtual string PassedColorStr()
|
public virtual string PassedColorStr(string yesNoFormatOrEmpty)
|
||||||
{
|
{
|
||||||
return Utils.PassedColorStr(Passed, true);
|
if (string.IsNullOrEmpty(yesNoFormatOrEmpty))
|
||||||
|
{
|
||||||
|
return Utils.PassedColorStr(Passed, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string[] yesNo = yesNoFormatOrEmpty.Split(new char[] { '~' });
|
||||||
|
return Passed ? yesNo[0] : ((yesNo.Length >= 2) ? yesNo[1] : Results.Resources.Strings.No);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Not mapped to the database
|
/// Not mapped to the database
|
||||||
///
|
///
|
||||||
@@ -224,6 +274,21 @@ namespace Results.Entities
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual bool TryGetTestRslt(string testName, out TestRslt testRslt)
|
||||||
|
{
|
||||||
|
MeterTestRslt mtr = GetMeterTestRslt(testName);
|
||||||
|
if (mtr != null)
|
||||||
|
{
|
||||||
|
testRslt = mtr.TestRslt;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
testRslt = null;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public virtual TestData GetTestData(string testName)
|
public virtual TestData GetTestData(string testName)
|
||||||
{
|
{
|
||||||
foreach (var mtr in MeterTestRslts)
|
foreach (var mtr in MeterTestRslts)
|
||||||
@@ -236,6 +301,21 @@ namespace Results.Entities
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual bool TryGetTestData(string testName, out TestData testData)
|
||||||
|
{
|
||||||
|
foreach (var mtr in MeterTestRslts)
|
||||||
|
{
|
||||||
|
if (mtr.TestRslt.TestData.Name == testName)
|
||||||
|
{
|
||||||
|
testData = mtr.TestRslt.TestData;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
testData = null;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -272,8 +352,8 @@ namespace Results.Entities
|
|||||||
Q2ErrWOCorrection = src.Q2ErrWOCorrection;
|
Q2ErrWOCorrection = src.Q2ErrWOCorrection;
|
||||||
Q2CorrectionDone = src.Q2CorrectionDone;
|
Q2CorrectionDone = src.Q2CorrectionDone;
|
||||||
Q2Correction = src.Q2Correction;
|
Q2Correction = src.Q2Correction;
|
||||||
Q2CorrRFlow = src.Q2CorrRFlow;
|
Q2CorrRL = src.Q2CorrRL;
|
||||||
Q2CorrLFlow = src.Q2CorrLFlow;
|
Q2CorrLR = src.Q2CorrLR;
|
||||||
Q2CorrFlowRight = src.Q2CorrFlowRight;
|
Q2CorrFlowRight = src.Q2CorrFlowRight;
|
||||||
Diff2Hz8Hz = src.Diff2Hz8Hz;
|
Diff2Hz8Hz = src.Diff2Hz8Hz;
|
||||||
Hz2CorrectionDone = src.Hz2CorrectionDone;
|
Hz2CorrectionDone = src.Hz2CorrectionDone;
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ namespace Results.Entities
|
|||||||
public virtual string MetrologicalClassAux { get; set; }
|
public virtual string MetrologicalClassAux { get; set; }
|
||||||
public virtual string ApprovalInfoAux { get; set; }
|
public virtual string ApprovalInfoAux { get; set; }
|
||||||
|
|
||||||
|
public virtual Config.Entities.Medium Medium { get; set; }
|
||||||
|
|
||||||
public virtual string Text1 { get; set; }
|
public virtual string Text1 { get; set; }
|
||||||
public virtual string Text2 { get; set; }
|
public virtual string Text2 { get; set; }
|
||||||
public virtual string Text3 { get; set; }
|
public virtual string Text3 { get; set; }
|
||||||
@@ -96,6 +98,8 @@ namespace Results.Entities
|
|||||||
if (MetrologicalClassAux != wmd.MetrologicalClassAux) return false;
|
if (MetrologicalClassAux != wmd.MetrologicalClassAux) return false;
|
||||||
if (ApprovalInfoAux != wmd.ApprovalInfoAux) return false;
|
if (ApprovalInfoAux != wmd.ApprovalInfoAux) return false;
|
||||||
|
|
||||||
|
if (Medium != wmd.Medium) return false;
|
||||||
|
|
||||||
if (Text1 != wmd.Text1) return false;
|
if (Text1 != wmd.Text1) return false;
|
||||||
if (Text2 != wmd.Text2) return false;
|
if (Text2 != wmd.Text2) return false;
|
||||||
if (Text3 != wmd.Text3) return false;
|
if (Text3 != wmd.Text3) return false;
|
||||||
|
|||||||
@@ -0,0 +1,104 @@
|
|||||||
|
using System;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace Results.Forms
|
||||||
|
{
|
||||||
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
|
public static class ListViewExtensions
|
||||||
|
{
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
public struct HDITEM
|
||||||
|
{
|
||||||
|
public Mask mask;
|
||||||
|
public int cxy;
|
||||||
|
[MarshalAs(UnmanagedType.LPTStr)]
|
||||||
|
public string pszText;
|
||||||
|
public IntPtr hbm;
|
||||||
|
public int cchTextMax;
|
||||||
|
public Format fmt;
|
||||||
|
public IntPtr lParam;
|
||||||
|
// _WIN32_IE >= 0x0300
|
||||||
|
public int iImage;
|
||||||
|
public int iOrder;
|
||||||
|
// _WIN32_IE >= 0x0500
|
||||||
|
public uint type;
|
||||||
|
public IntPtr pvFilter;
|
||||||
|
// _WIN32_WINNT >= 0x0600
|
||||||
|
public uint state;
|
||||||
|
|
||||||
|
[Flags]
|
||||||
|
public enum Mask
|
||||||
|
{
|
||||||
|
Format = 0x4, // HDI_FORMAT
|
||||||
|
};
|
||||||
|
|
||||||
|
[Flags]
|
||||||
|
public enum Format
|
||||||
|
{
|
||||||
|
SortDown = 0x200, // HDF_SORTDOWN
|
||||||
|
SortUp = 0x400, // HDF_SORTUP
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
public const int LVM_FIRST = 0x1000;
|
||||||
|
public const int LVM_GETHEADER = LVM_FIRST + 31;
|
||||||
|
|
||||||
|
public const int HDM_FIRST = 0x1200;
|
||||||
|
public const int HDM_GETITEM = HDM_FIRST + 11;
|
||||||
|
public const int HDM_SETITEM = HDM_FIRST + 12;
|
||||||
|
|
||||||
|
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||||
|
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam);
|
||||||
|
|
||||||
|
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||||
|
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 msg, IntPtr wParam, ref HDITEM lParam);
|
||||||
|
|
||||||
|
public static void SetSortIcon(this ListViewEx listViewControl, int columnIndex, SortOrder order)
|
||||||
|
{
|
||||||
|
IntPtr columnHeader = SendMessage(listViewControl.Handle, LVM_GETHEADER, IntPtr.Zero, IntPtr.Zero);
|
||||||
|
for (int columnNumber = 0; columnNumber <= listViewControl.Columns.Count - 1; columnNumber++)
|
||||||
|
{
|
||||||
|
var columnPtr = new IntPtr(columnNumber);
|
||||||
|
var item = new HDITEM
|
||||||
|
{
|
||||||
|
mask = HDITEM.Mask.Format
|
||||||
|
};
|
||||||
|
|
||||||
|
if (SendMessage(columnHeader, HDM_GETITEM, columnPtr, ref item) == IntPtr.Zero)
|
||||||
|
{
|
||||||
|
throw new Win32Exception();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (order != SortOrder.None && columnNumber == columnIndex)
|
||||||
|
{
|
||||||
|
switch (order)
|
||||||
|
{
|
||||||
|
case SortOrder.Ascending:
|
||||||
|
item.fmt &= ~HDITEM.Format.SortDown;
|
||||||
|
item.fmt |= HDITEM.Format.SortUp;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SortOrder.Descending:
|
||||||
|
item.fmt &= ~HDITEM.Format.SortUp;
|
||||||
|
item.fmt |= HDITEM.Format.SortDown;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
item.fmt &= ~HDITEM.Format.SortDown & ~HDITEM.Format.SortUp;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SendMessage(columnHeader, HDM_SETITEM, columnPtr, ref item) == IntPtr.Zero)
|
||||||
|
{
|
||||||
|
throw new Win32Exception();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace Results.Forms
|
||||||
|
{
|
||||||
|
public class LviIntColumnComparer : IComparer
|
||||||
|
{
|
||||||
|
int column;
|
||||||
|
SortOrder order;
|
||||||
|
|
||||||
|
public LviIntColumnComparer()
|
||||||
|
{
|
||||||
|
column = 0;
|
||||||
|
order = SortOrder.Ascending;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LviIntColumnComparer(int column, SortOrder order)
|
||||||
|
{
|
||||||
|
this.column = column;
|
||||||
|
this.order = order;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int Compare(object x, object y)
|
||||||
|
{
|
||||||
|
int valX = int.Parse(((ListViewItem)x).SubItems[column].Text);
|
||||||
|
int valY = int.Parse(((ListViewItem)y).SubItems[column].Text);
|
||||||
|
return (order == SortOrder.Descending) ? (valY - valX) : (valX - valY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace Results.Forms
|
||||||
|
{
|
||||||
|
public class LviTextColumnComparer : IComparer
|
||||||
|
{
|
||||||
|
private int column;
|
||||||
|
SortOrder order;
|
||||||
|
|
||||||
|
public LviTextColumnComparer()
|
||||||
|
{
|
||||||
|
column = 0;
|
||||||
|
order = SortOrder.Ascending;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LviTextColumnComparer(int column, SortOrder order)
|
||||||
|
{
|
||||||
|
this.column = column;
|
||||||
|
this.order = order;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int Compare(object x, object y)
|
||||||
|
{
|
||||||
|
string txtX = ((ListViewItem)x).SubItems[column].Text;
|
||||||
|
string txtY = ((ListViewItem)y).SubItems[column].Text;
|
||||||
|
return (order == SortOrder.Descending) ? String.Compare(txtY, txtX) : String.Compare(txtX, txtY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+56
-5
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2016-2017 Sensus Metering Systems
|
/// Copyright (c) 2016-2018 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ namespace Results
|
|||||||
Flow_profile_sensitivity_class, /// 46
|
Flow_profile_sensitivity_class, /// 46
|
||||||
Approval_info, /// 47
|
Approval_info, /// 47
|
||||||
Certificate, /// 48
|
Certificate, /// 48
|
||||||
Pulses_per_liter, /// 49
|
Pulses_per_liter, /// 49 Water meter constant (water meter data, not used in calculations)
|
||||||
Text1, /// 50
|
Text1, /// 50
|
||||||
Text2, /// 51
|
Text2, /// 51
|
||||||
Text3, /// 52
|
Text3, /// 52
|
||||||
@@ -68,10 +68,10 @@ namespace Results
|
|||||||
WM_Position, /// 58
|
WM_Position, /// 58
|
||||||
End_state, /// 59
|
End_state, /// 59
|
||||||
Pulses, /// 60
|
Pulses, /// 60
|
||||||
Pulses__liter, /// 61
|
Pulse__liter, /// 61 Water meter constant (pulses per liter) specific for one test
|
||||||
Reference_pulses, /// 62
|
Reference_pulses_ni, /// 62 Reference pulses gated for specific meter (synchro method)
|
||||||
Reference_energy, /// 63
|
Reference_energy, /// 63
|
||||||
Test_bench_ID, /// 64
|
Bench_ID, /// 64 Test bench ID (int) obtained from a component implementing IBenchInfo
|
||||||
Program_version, /// 65
|
Program_version, /// 65
|
||||||
User_name, /// 66
|
User_name, /// 66
|
||||||
User_nr, /// 67
|
User_nr, /// 67
|
||||||
@@ -220,6 +220,57 @@ namespace Results
|
|||||||
T_line_min, /// 190
|
T_line_min, /// 190
|
||||||
T_line_max, /// 191
|
T_line_max, /// 191
|
||||||
|
|
||||||
|
ErrorFlagsEx, /// 192
|
||||||
|
RhoDistilledWtrAtMeLineTemp, /// 193
|
||||||
|
ConstMaster, /// 194
|
||||||
|
Reference_pulses, /// 195 Reference pulses not gated
|
||||||
|
spare,
|
||||||
|
Separator, /// 197
|
||||||
|
Test_time_ni, /// 198 Test time for a specific meter (gated in case of a synchro method OR a difference of 2 time stamps)
|
||||||
|
PMax_test_time, /// 199 Pressure test time
|
||||||
|
Start_valve_open_time, /// 200
|
||||||
|
Start_valve_close_time, /// 201
|
||||||
|
Qc, /// 202 Flow for a water meter
|
||||||
|
Degree__liter, /// 203 Water meter constant (degree per liter) specific for one test with camera
|
||||||
|
Camera_angle, /// 204
|
||||||
|
Camera_angle_start, /// 205
|
||||||
|
Camera_angle_end, /// 206
|
||||||
|
|
||||||
|
P_delta_mean_per_mtr, /// 207
|
||||||
|
P_delta_mean_from_up_down, /// 208
|
||||||
|
P_delta_mean_from_up_down_per_mtr, /// 209
|
||||||
|
Timestamp_start, /// 210
|
||||||
|
Timestamp_end, /// 211
|
||||||
|
P_PMax_test_mean, /// 212 PMax test pressure mean of (Pup + Pdown)/2
|
||||||
|
|
||||||
|
Medium, /// 213 Woda zimna/ciepla
|
||||||
|
|
||||||
|
Flow_ctv, /// 214
|
||||||
|
Flow_ctv_min, /// 215
|
||||||
|
Flow_ctv_max, /// 216
|
||||||
|
Flow_ctv_start, /// 217
|
||||||
|
Flow_ctv_end, /// 218
|
||||||
|
ConstMasterRaw, /// 219 ConstMaster (like 194) uncorrected
|
||||||
|
Reference_error_corr, /// 220 Reference flow meter error after correction using correction curve
|
||||||
|
|
||||||
|
Proc_description, /// 221 Procedure description (CEVAK, not mapped to DB)
|
||||||
|
Bench_name, /// 222 'Test bench name' (string) obtained from a component implementing IBenchInfo
|
||||||
|
Bench_address1, /// 223 'Address 1' from IBenchInfo
|
||||||
|
Bench_address2, /// 224 'Address 2' from IBenchInfo
|
||||||
|
Bench_address3, /// 225 'Address 3' from IBenchInfo
|
||||||
|
Bench_address4, /// 226 'Address 4' from IBenchInfo
|
||||||
|
Bench_address5, /// 227 'Address 5' from IBenchInfo
|
||||||
|
|
||||||
|
Max_test_index, /// 228 MaxPruefindex % 100
|
||||||
|
VolumeCTV, /// 229
|
||||||
|
|
||||||
|
/// iPerl
|
||||||
|
LastError, /// 230 For iPerl previous test result (test with Proefindex-1)
|
||||||
|
OrigCalibFactorLNA, /// 231
|
||||||
|
CalibFactorLNA, /// 232
|
||||||
|
|
||||||
|
WM_remark, /// 233
|
||||||
|
|
||||||
Count,
|
Count,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,244 +0,0 @@
|
|||||||
///
|
|
||||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
|
||||||
///
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Results.Entities;
|
|
||||||
using Results.Resources;
|
|
||||||
|
|
||||||
namespace Results
|
|
||||||
{
|
|
||||||
public class ItemSpec
|
|
||||||
{
|
|
||||||
///
|
|
||||||
/// Public fields
|
|
||||||
///
|
|
||||||
public readonly string Name; /// Name-s of all items must be unique
|
|
||||||
public readonly string ClmnHeaderText; /// Text printed in the column header
|
|
||||||
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Function to pick a MeterTestResult field and convert it into a string
|
|
||||||
///
|
|
||||||
public delegate string PrintDlgt(MeterTestRslt meterTestRslt);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Function to pick a MeterTestResult field and convert it into a string
|
|
||||||
///
|
|
||||||
public delegate string PrintCompoundDlgt(MeterTestRslt mainMtrTestResult,
|
|
||||||
MeterTestRslt auxMtrTestResult,
|
|
||||||
MeterTestRslt compoundMtrTestResult);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Function to pick a MeterTestResult field and convert it into a string
|
|
||||||
///
|
|
||||||
public delegate string PrintHeatMeterDlgt(MeterTestRslt volumeTestResult,
|
|
||||||
MeterTestRslt energyTestResult);
|
|
||||||
|
|
||||||
private readonly PrintDlgt printDlgt;
|
|
||||||
private readonly PrintCompoundDlgt printCompoundDlgt;
|
|
||||||
private readonly PrintHeatMeterDlgt printHeatMeterDlgt;
|
|
||||||
|
|
||||||
public bool CanPrintSingle { get { return (printDlgt != null); } }
|
|
||||||
public bool CanPrintCompoundMeter { get { return (printCompoundDlgt != null); } }
|
|
||||||
public bool CanPrintHeatMeter { get { return (printHeatMeterDlgt != null); } }
|
|
||||||
|
|
||||||
/// <summary> Safe wrapper which replaces null-s by empty strings </summary>
|
|
||||||
public string Print(MeterTestRslt meterTestRslt)
|
|
||||||
{
|
|
||||||
string str = null;
|
|
||||||
if (printDlgt != null) str = printDlgt(meterTestRslt);
|
|
||||||
return (str == null) ? string.Empty : str;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary> Safe wrapper which replaces null-s by empty strings </summary>
|
|
||||||
public string PrintCombined(MeterTestRslt mainMtrTestResult,
|
|
||||||
MeterTestRslt auxMtrTestResult,
|
|
||||||
MeterTestRslt compoundMtrTestResult)
|
|
||||||
{
|
|
||||||
string str = null;
|
|
||||||
if (printCompoundDlgt != null) str = printCompoundDlgt(mainMtrTestResult, auxMtrTestResult, compoundMtrTestResult);
|
|
||||||
return (str == null) ? string.Empty : str;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary> Safe wrapper which replaces null-s by empty strings </summary>
|
|
||||||
public string PrintHeatMeter(MeterTestRslt volumeTestResult,
|
|
||||||
MeterTestRslt energyTestResult)
|
|
||||||
{
|
|
||||||
string str = null;
|
|
||||||
if (printHeatMeterDlgt != null) str = printHeatMeterDlgt(volumeTestResult, energyTestResult);
|
|
||||||
return (str == null) ? string.Empty : str;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Public constructor
|
|
||||||
///
|
|
||||||
public ItemSpec(string name, string clmnHeaderText, PrintDlgt printDlgt, PrintCompoundDlgt printCombinedDlgt, PrintHeatMeterDlgt printHeatMeterDlgt)
|
|
||||||
{
|
|
||||||
Name = name;
|
|
||||||
ClmnHeaderText = clmnHeaderText;
|
|
||||||
this.printDlgt = printDlgt;
|
|
||||||
this.printCompoundDlgt = printCombinedDlgt;
|
|
||||||
this.printHeatMeterDlgt = printHeatMeterDlgt;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// Static list of all available items
|
|
||||||
public static readonly IList<ItemSpec> AllItems;
|
|
||||||
|
|
||||||
/// Static constructor that initializes the list of all items
|
|
||||||
static ItemSpec()
|
|
||||||
{
|
|
||||||
AllItems = new List<ItemSpec>();
|
|
||||||
|
|
||||||
/// Common
|
|
||||||
|
|
||||||
//AllItems.Add(new ResultItemSpec("Bench ID", "Bench ID", x => x.BenchID, (x, y, z) => x.BenchID));
|
|
||||||
AllItems.Add(new ItemSpec("Test name", Strings.Test, x => x.Name(), (x, y, z) => z.Name(), (x, z) => z.Name()));
|
|
||||||
AllItems.Add(new ItemSpec("Procedure name", Strings.Procedure, x => x.ProcedureName(), (x, y, z) => z.ProcedureName(), (x, z) => z.ProcedureName()));
|
|
||||||
AllItems.Add(new ItemSpec("Batch number", Strings.Batch_nr, x => x.BatchNr().ToString(), (x, y, z) => z.BatchNr().ToString(), (x, z) => z.BatchNr().ToString()));
|
|
||||||
AllItems.Add(new ItemSpec("Test method", Strings.Test_method, x => x.Method(), (x, y, z) => z.Method(), (x, z) => z.Method()));
|
|
||||||
AllItems.Add(new ItemSpec("Density", Strings.Density, x => x.DensityLine().ToString("F1"), (x, y, z) => z.DensityLine().ToString("F1"), (x, z) => z.DensityLine().ToString("F1"))); /// [kg/m3]
|
|
||||||
|
|
||||||
/// Target values
|
|
||||||
AllItems.Add(new ItemSpec("Q from", Strings.Q_from + " [m3/h]", x => x.Qfrom().ToString("F3"), (x, y, z) => z.Qfrom().ToString("F3"), (x, z) => z.Qfrom().ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("Q to", Strings.Q_to + " [m3/h]", x => x.Qto().ToString("F3"), (x, y, z) => z.Qto().ToString("F3"), (x, z) => z.Qto().ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("Test volume", Strings.Test_vol + " [l]", x => x.TargetVolume().ToString("F1"), (x, y, z) => z.TargetVolume().ToString("F1"), (x, z) => z.TargetVolume().ToString("F1")));
|
|
||||||
AllItems.Add(new ItemSpec("Error limit Lo", Strings.ErrLimLo + " [%]", x => x.ErrLimLo().ToString("F1"), (x, y, z) => z.ErrLimLo().ToString("F1"), (x, z) => z.ErrLimLo().ToString("F1")));
|
|
||||||
AllItems.Add(new ItemSpec("Error limit Hi", Strings.ErrLimHi + " [%]", x => x.ErrLimHi().ToString("F1"), (x, y, z) => z.ErrLimHi().ToString("F1"), (x, z) => z.ErrLimHi().ToString("F1")));
|
|
||||||
AllItems.Add(new ItemSpec("Uncertainty", Strings.Uncertainty + " [%]", x => x.Uncertainty().ToString("F2"), (x, y, z) => z.Uncertainty().ToString("F2"), (x, z) => z.Uncertainty().ToString("F2")));
|
|
||||||
|
|
||||||
/// Test results
|
|
||||||
AllItems.Add(new ItemSpec("Test start time", Strings.T_start, x => x.StartTime().ToShortTimeString(), (x, y, z) => z.StartTime().ToShortTimeString(), (x, z) => z.StartTime().ToShortTimeString()));
|
|
||||||
AllItems.Add(new ItemSpec("Test end time", Strings.T_end, x => x.EndTime().ToShortTimeString(), (x, y, z) => z.EndTime().ToShortTimeString(), (x, z) => z.EndTime().ToShortTimeString()));
|
|
||||||
AllItems.Add(new ItemSpec("Test time", Strings.T_s, x => x.TestTime.ToString("F2"), (x, y, z) => z.TestTime.ToString("F2"), (x, z) => z.TestTime.ToString("F2")));
|
|
||||||
AllItems.Add(new ItemSpec("Flow", Strings.Flow + " [m3/h]", x => Utils.DoubleToStr(x.FlowVolume(), 4), (x, y, z) => Utils.DoubleToStr(z.FlowVolume(), 4), (x, z) => Utils.DoubleToStr(x.FlowVolume(), 4)));
|
|
||||||
AllItems.Add(new ItemSpec("T in", Strings.T_in + " [°C]", x => x.TestRslt.TempUpMean.ToString("F2"), (x, y, z) => z.TestRslt.TempUpMean.ToString("F2"), (x, z) => z.TestRslt.TempUpMean.ToString("F2")));
|
|
||||||
AllItems.Add(new ItemSpec("T out", Strings.T_out + " [°C]", x => x.TestRslt.TempDownMean.ToString("F2"), (x, y, z) => z.TestRslt.TempDownMean.ToString("F2"), (x, z) => z.TestRslt.TempDownMean.ToString("F2")));
|
|
||||||
AllItems.Add(new ItemSpec("T div", Strings.T_div + " [°C]", x => x.TestRslt.TempDivMean.ToString("F2"), (x, y, z) => z.TestRslt.TempDivMean.ToString("F2"), (x, z) => z.TestRslt.TempDivMean.ToString("F2")));
|
|
||||||
AllItems.Add(new ItemSpec("P up", Strings.P_up + " [kPa]", x => (100 * x.TestRslt.PressUpMean).ToString("F3"), (x, y, z) => z.TestRslt.PressUpMean.ToString("F3"), (x, z) => z.TestRslt.PressUpMean.ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("P up start", Strings.P_up_start + " [kPa]", x => (100 * x.TestRslt.PressUpStart).ToString("F3"), (x, y, z) => z.TestRslt.PressUpStart.ToString("F3"), (x, z) => z.TestRslt.PressUpStart.ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("P up end", Strings.P_up_end + " [kPa]", x => (100 * x.TestRslt.PressUpEnd).ToString("F3"), (x, y, z) => z.TestRslt.PressUpEnd.ToString("F3"), (x, z) => z.TestRslt.PressUpEnd.ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("P down", Strings.P_dn + " [kPa]", x => (100 * x.TestRslt.PressDownMean).ToString("F3"), (x, y, z) => z.TestRslt.PressDownMean.ToString("F3"), (x, z) => z.TestRslt.PressDownMean.ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("P down start", Strings.P_dn_start + " [kPa]", x => (100 * x.TestRslt.PressDownStart).ToString("F3"), (x, y, z) => z.TestRslt.PressDownStart.ToString("F3"), (x, z) => z.TestRslt.PressDownStart.ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("P down end", Strings.P_dn_end + " [kPa]", x => (100 * x.TestRslt.PressDownEnd).ToString("F3"), (x, y, z) => z.TestRslt.PressDownEnd.ToString("F3"), (x, z) => z.TestRslt.PressDownEnd.ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("P delta", Strings.P_delta + " [kPa]", x => (100 * x.TestRslt.PressDeltaMean).ToString("F3"), (x, y, z) => z.TestRslt.PressDeltaMean.ToString("F3"), (x, z) => z.TestRslt.PressDeltaMean.ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("P delta start", Strings.P_delta_start + " [kPa]", x => (100 * x.TestRslt.PressDeltaStart).ToString("F3"), (x, y, z) => z.TestRslt.PressDeltaStart.ToString("F3"), (x, z) => z.TestRslt.PressDeltaStart.ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("P delta end", Strings.P_delta_end + " [kPa]", x => (100 * x.TestRslt.PressDeltaEnd).ToString("F3"), (x, y, z) => z.TestRslt.PressDeltaEnd.ToString("F3"), (x, z) => z.TestRslt.PressDeltaEnd.ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("Reference error", Strings.ErrRef + " [%]", x => x.TestRslt.ErrorMaster.ToString("F3"), (x, y, z) => z.TestRslt.ErrorMaster.ToString("F3"), (x, z) => z.TestRslt.ErrorMaster.ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("Ambient temperature", Strings.T_amb + " [°C]", x => x.TestRslt.AmbTempMean.ToString("F1"), (x, y, z) => z.TestRslt.AmbTempMean.ToString("F1"), (x, z) => z.TestRslt.AmbTempMean.ToString("F1")));
|
|
||||||
AllItems.Add(new ItemSpec("Ambient pressure", Strings.P_amb + " [mbar]", x => (1000 * x.TestRslt.AmbPressMean).ToString("F0"), (x, y, z) => (1000 * z.TestRslt.AmbPressMean).ToString("F0"), (x, z) => (1000 * z.TestRslt.AmbPressMean).ToString("F0")));
|
|
||||||
AllItems.Add(new ItemSpec("Ambient humidity", Strings.H_amb + " [%]", x => x.TestRslt.AmbHumiMean.ToString("F1"), (x, y, z) => z.TestRslt.AmbHumiMean.ToString("F1"), (x, z) => z.TestRslt.AmbHumiMean.ToString("F1")));
|
|
||||||
|
|
||||||
/// Single and combined meter results
|
|
||||||
AllItems.Add(new ItemSpec("Start volume", Strings.Start_volume + " [l]", x => x.VolumeStart.ToString("F3"), (x, y, z) => z.VolumeStart.ToString("F3"), (x, z) => z.VolumeStart.ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("End volume", Strings.End_volume + " [l]", x => x.VolumeEnd.ToString("F3"), (x, y, z) => z.VolumeEnd.ToString("F3"), (x, z) => z.VolumeEnd.ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("Volume", Strings.Volume + " [l]", x => x.VolumeMeter.ToString("F3"), (x, y, z) => z.VolumeMeter.ToString("F3"), (x, z) => x.VolumeMeter.ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("Reference volume", Strings.VolRef + " [l]", x => x.VolumeRef.ToString("F3"), (x, y, z) => z.VolumeRef.ToString("F3"), (x, z) => x.VolumeRef.ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("Error", Strings.Error + " [%]", x => x.Error.ToString("F2"), (x, y, z) => z.Error.ToString("F2"), null));
|
|
||||||
AllItems.Add(new ItemSpec("Passed", Strings.Result, x => x.PassedColorStr(), (x, y, z) => z.PassedColorStr(), null));
|
|
||||||
AllItems.Add(new ItemSpec("Volume Error", "Volume Error" + " [%]", null, null, (x, z) => x.Error.ToString("F2")));
|
|
||||||
AllItems.Add(new ItemSpec("Volume Passed", "Volume Passed", null, null, (x, z) => x.PassedColorStr()));
|
|
||||||
AllItems.Add(new ItemSpec("Energy Error", "Energy Error" + " [%]", null, null, (x, z) => z.Error.ToString("F2")));
|
|
||||||
AllItems.Add(new ItemSpec("Energy Passed", "Energy Passed", null, null, (x, z) => z.PassedColorStr()));
|
|
||||||
|
|
||||||
/// Water meter info
|
|
||||||
AllItems.Add(new ItemSpec("Watermeter type", Strings.WM_Type, x => x.WaterMeterData().ProductName, (x, y, z) => z.WaterMeterData().ProductName, (x, z) => z.WaterMeterData().ProductName));
|
|
||||||
AllItems.Add(new ItemSpec("Producer", Strings.Producer, x => x.WaterMeterData().Producer, (x, y, z) => z.WaterMeterData().Producer, (x, z) => z.WaterMeterData().Producer));
|
|
||||||
AllItems.Add(new ItemSpec("Metrological class", Strings.MClass, x => x.WaterMeterData().MetrologicalClass, (x, y, z) => z.WaterMeterData().MetrologicalClass, (x, z) => z.WaterMeterData().MetrologicalClass));
|
|
||||||
AllItems.Add(new ItemSpec("Approval info", Strings.Approval, x => x.WaterMeterData().ApprovalInfo, (x, y, z) => z.WaterMeterData().ApprovalInfo, (x, z) => z.WaterMeterData().ApprovalInfo));
|
|
||||||
AllItems.Add(new ItemSpec("Q4", "Q4 [m3/h]", x => x.WaterMeterData().Q4_Qmax.ToString(), (x, y, z) => z.WaterMeterData().Q4_Qmax.ToString(), null));
|
|
||||||
AllItems.Add(new ItemSpec("Q3", "Q3 [m3/h]", x => x.WaterMeterData().Q3_Qn.ToString(), (x, y, z) => z.WaterMeterData().Q3_Qn.ToString(), null));
|
|
||||||
AllItems.Add(new ItemSpec("Q2", "Q2 [m3/h]", x => x.WaterMeterData().Q2_Qt.ToString(), (x, y, z) => z.WaterMeterData().Q2_Qt.ToString(), null));
|
|
||||||
AllItems.Add(new ItemSpec("Q1", "Q1 [m3/h]", x => x.WaterMeterData().Q1_Qmin.ToString(), (x, y, z) => z.WaterMeterData().Q1_Qmin.ToString(), null));
|
|
||||||
AllItems.Add(new ItemSpec("Qmax", "Qmax [m3/h]", x => x.WaterMeterData().Q4_Qmax.ToString(), (x, y, z) => z.WaterMeterData().Q4_Qmax.ToString(), null));
|
|
||||||
AllItems.Add(new ItemSpec("Qn", "Qn [m3/h]", x => x.WaterMeterData().Q3_Qn.ToString(), (x, y, z) => z.WaterMeterData().Q3_Qn.ToString(), null));
|
|
||||||
AllItems.Add(new ItemSpec("Qt", "Qt [m3/h]", x => x.WaterMeterData().Q2_Qt.ToString(), (x, y, z) => z.WaterMeterData().Q2_Qt.ToString(), null));
|
|
||||||
AllItems.Add(new ItemSpec("Qmin", "Qmin [m3/h]", x => x.WaterMeterData().Q1_Qmin.ToString(), (x, y, z) => z.WaterMeterData().Q1_Qmin.ToString(), null));
|
|
||||||
|
|
||||||
/// Water meters results
|
|
||||||
AllItems.Add(new ItemSpec("Serial Nr", Strings.sn, x => x.WaterMeter.SerialNr, (x, y, z) => z.WaterMeter.SerialNr, (x, z) => z.WaterMeter.SerialNr));
|
|
||||||
AllItems.Add(new ItemSpec("Purchase order", Strings.PO, x => x.WaterMeter.PurchaseOrder, (x, y, z) => z.WaterMeter.PurchaseOrder, (x, z) => z.WaterMeter.PurchaseOrder));
|
|
||||||
AllItems.Add(new ItemSpec("Year of production", Strings.Year, x => x.WaterMeter.YearOfProduction.ToString(), (x, y, z) => z.WaterMeter.YearOfProduction.ToString(), (x, z) => z.WaterMeter.YearOfProduction.ToString()));
|
|
||||||
AllItems.Add(new ItemSpec("WM Position", Strings.Pos, x => x.WaterMeter.WMPosition.ToString(), (x, y, z) => z.WaterMeter.WMPosition.ToString(), (x, z) => z.WaterMeter.WMPosition.ToString()));
|
|
||||||
|
|
||||||
/// Water meters results (single)
|
|
||||||
AllItems.Add(new ItemSpec("End state", Strings.End_state, x => x.EndState(), null, null));
|
|
||||||
AllItems.Add(new ItemSpec("Pulses", Strings.Pulses, x => x.PulsesMeter.ToString(), null, null));
|
|
||||||
AllItems.Add(new ItemSpec("Pulses/liter", Strings.PulsesLiter, x => x.PulsesPerLiter.ToString(), null, null));
|
|
||||||
AllItems.Add(new ItemSpec("Reference pulses", Strings.RefPulses, x => x.PulsesMaster.ToString(), null, null));
|
|
||||||
|
|
||||||
/// Water meters results (combined)
|
|
||||||
AllItems.Add(new ItemSpec("Q rise", Strings.Q_rise + " [m3/h]", null, (x, y, z) => (z.QRise() == 0) ? "-" : Utils.DoubleToStr(z.QRise(), 4), null));
|
|
||||||
AllItems.Add(new ItemSpec("Q fall", Strings.Q_fall + " [m3/h]", null, (x, y, z) => (z.QFall() == 0) ? "-" : Utils.DoubleToStr(z.QFall(), 4), null));
|
|
||||||
AllItems.Add(new ItemSpec("Error large WM", Strings.Err_main + " [%]", null, (x, y, z) => x.Error.ToString("F2"), null));
|
|
||||||
AllItems.Add(new ItemSpec("Error small WM", Strings.Err_aux + " [%]", null, (x, y, z) => y.Error.ToString("F2"), null));
|
|
||||||
AllItems.Add(new ItemSpec("Serial Nr large WM", Strings.sn_main, null, (x, y, z) => x.SerialNr(), null));
|
|
||||||
AllItems.Add(new ItemSpec("Serial Nr small WM", Strings.sn_aux, null, (x, y, z) => y.SerialNr(), null));
|
|
||||||
AllItems.Add(new ItemSpec("End state large WM", Strings.EndState_main, null, (x, y, z) => x.EndState(), null));
|
|
||||||
AllItems.Add(new ItemSpec("End state small WM", Strings.EndState_aux, null, (x, y, z) => y.EndState(), null));
|
|
||||||
AllItems.Add(new ItemSpec("Start volume main", Strings.Start_volume_main + " [l]",x => x.VolumeMeter.ToString("F3"), (x, y, z) => x.VolumeStart.ToString("F3"), null));
|
|
||||||
AllItems.Add(new ItemSpec("End volume main", Strings.End_volume_main + " [l]", x => x.VolumeMeter.ToString("F3"), (x, y, z) => x.VolumeEnd.ToString("F3"), null));
|
|
||||||
AllItems.Add(new ItemSpec("Volume main", Strings.Volume_main + " [l]", x => x.VolumeMeter.ToString("F3"), (x, y, z) => x.VolumeMeter.ToString("F3"), null));
|
|
||||||
AllItems.Add(new ItemSpec("Start volume aux", Strings.Start_volume_aux + " [l]", x => x.VolumeMeter.ToString("F3"), (x, y, z) => y.VolumeStart.ToString("F3"), null));
|
|
||||||
AllItems.Add(new ItemSpec("End volume aux", Strings.End_volume_aux + " [l]", x => x.VolumeMeter.ToString("F3"), (x, y, z) => y.VolumeEnd.ToString("F3"), null));
|
|
||||||
AllItems.Add(new ItemSpec("Volume aux", Strings.Volume_aux + " [l]", x => x.VolumeMeter.ToString("F3"), (x, y, z) => y.VolumeMeter.ToString("F3"), null));
|
|
||||||
|
|
||||||
/// Batch info
|
|
||||||
AllItems.Add(new ItemSpec("Batch number", Strings.Batch_nr, x => x.Batch().BatchNr.ToString(), (x, y, z) => x.Batch().BatchNr.ToString(), (x, z) => x.Batch().BatchNr.ToString()));
|
|
||||||
AllItems.Add(new ItemSpec("Test bench ID", Strings.Bench, x => x.Batch().TestBenchId.ToString(), (x, y, z) => x.Batch().TestBenchId.ToString(), (x, z) => x.Batch().TestBenchId.ToString()));
|
|
||||||
AllItems.Add(new ItemSpec("Program version", Strings.Ver, x => x.Batch().ProgramVersion, (x, y, z) => x.Batch().ProgramVersion, (x, z) => x.Batch().ProgramVersion));
|
|
||||||
AllItems.Add(new ItemSpec("User name", Strings.User, x => x.Batch().UserName, (x, y, z) => x.Batch().UserName, (x, z) => x.Batch().UserName));
|
|
||||||
AllItems.Add(new ItemSpec("User nr.", Strings.User_nr, x => x.Batch().UserNumber.ToString(), (x, y, z) => x.Batch().UserNumber.ToString(), (x, z) => x.Batch().UserNumber.ToString()));
|
|
||||||
AllItems.Add(new ItemSpec("Procedure name", Strings.Procedure, x => x.Batch().ProcedureName, (x, y, z) => x.Batch().ProcedureName, (x, z) => x.Batch().ProcedureName));
|
|
||||||
AllItems.Add(new ItemSpec("Watermeters", Strings.WMs, x => x.Batch().WatermetersStr, (x, y, z) => x.Batch().WatermetersStr, (x, z) => x.Batch().WatermetersStr));
|
|
||||||
AllItems.Add(new ItemSpec("Protocol title", Strings.Protocol, x => x.Batch().ProtocolTitle, (x, y, z) => x.Batch().ProtocolTitle, (x, z) => x.Batch().ProtocolTitle));
|
|
||||||
AllItems.Add(new ItemSpec("Batch start time", Strings.Start, x => x.Batch().StartTime.ToShortTimeString(), (x, y, z) => x.Batch().StartTime.ToShortTimeString(), (x, z) => x.Batch().StartTime.ToShortTimeString()));
|
|
||||||
AllItems.Add(new ItemSpec("Batch end time", Strings.End, x => x.Batch().EndTime.ToShortTimeString(), (x, y, z) => x.Batch().EndTime.ToShortTimeString(), (x, z) => x.Batch().EndTime.ToShortTimeString()));
|
|
||||||
|
|
||||||
/// Heat meters results
|
|
||||||
AllItems.Add(new ItemSpec("Energy", Strings.Energy, null, null, (x, z) => z.VolumeMeter.ToString()));
|
|
||||||
AllItems.Add(new ItemSpec("Reference energy", Strings.Energy_ref, null, null, (x, z) => z.VolumeRef.ToString()));
|
|
||||||
AllItems.Add(new ItemSpec("Temp hi me", "T hi me", null, null, (x, z) => z.TestRslt.Custom1.ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("Temp hi st", "T hi st", null, null, (x, z) => z.TestRslt.Custom2.ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("Temp hi en", "T hi en", null, null, (x, z) => z.TestRslt.Custom3.ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("Temp hi av", "T hi av", null, null, (x, z) => ((z.TestRslt.Custom2 + z.TestRslt.Custom3) / 2).ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("Temp lo me", "T lo me", null, null, (x, z) => z.TestRslt.Custom6.ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("Temp lo st", "T lo st", null, null, (x, z) => z.TestRslt.Custom7.ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("Temp lo en", "T lo en", null, null, (x, z) => z.TestRslt.Custom8.ToString("F3")));
|
|
||||||
AllItems.Add(new ItemSpec("Temp lo av", "T lo av", null, null, (x, z) => ((z.TestRslt.Custom7 + z.TestRslt.Custom8) / 2).ToString("F3")));
|
|
||||||
|
|
||||||
AllItems.Add(new ItemSpec("Start mass", Strings.Start_mass + " [kg]", x => x.TestRslt.MassStart.ToString("F4"), (x, y, z) => z.TestRslt.MassStart.ToString("F4"), (x, z) => z.TestRslt.MassStart.ToString("F4")));
|
|
||||||
AllItems.Add(new ItemSpec("End mass", Strings.End_mass + " [kg]", x => x.TestRslt.MassEnd.ToString("F4"), (x, y, z) => z.TestRslt.MassEnd.ToString("F4"), (x, z) => z.TestRslt.MassEnd.ToString("F4")));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ItemSpec GetItem(string name)
|
|
||||||
{
|
|
||||||
foreach (var item in AllItems) if (item.Name.Equals(name)) return item;
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string[] ToStrArray(IList<ItemSpec> items)
|
|
||||||
{
|
|
||||||
int count = (items != null) ? items.Count : 0;
|
|
||||||
string[] result = new string[count];
|
|
||||||
for (int i = 0; i < count; i++) result[i] = items[i].Name;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IList<ItemSpec> FromStrArray(string[] strArray)
|
|
||||||
{
|
|
||||||
IList<ItemSpec> result = new List<ItemSpec>();
|
|
||||||
if (strArray != null)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < strArray.Length; i++)
|
|
||||||
{
|
|
||||||
ItemSpec item = GetItem(strArray[i]);
|
|
||||||
if (item != null) result.Add(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -25,8 +25,10 @@ namespace Results.Mappings
|
|||||||
Map(x => x.Error);
|
Map(x => x.Error);
|
||||||
Map(x => x.TestDone);
|
Map(x => x.TestDone);
|
||||||
Map(x => x.Passed);
|
Map(x => x.Passed);
|
||||||
|
#if ORACLE_DB
|
||||||
References(x => x.WaterMeter);
|
Map(x => x.LastError);
|
||||||
|
#endif
|
||||||
|
References(x => x.WaterMeter);
|
||||||
References(x => x.TestRslt);
|
References(x => x.TestRslt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2015-2017 Sensus Metering Systems
|
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using FluentNHibernate.Mapping;
|
using FluentNHibernate.Mapping;
|
||||||
using Results.Entities;
|
using Results.Entities;
|
||||||
|
|||||||
@@ -31,18 +31,24 @@ namespace Results.Mappings
|
|||||||
Map(x => x.SerialNrEx);
|
Map(x => x.SerialNrEx);
|
||||||
Map(x => x.OrigCalibFactor);
|
Map(x => x.OrigCalibFactor);
|
||||||
Map(x => x.CalibFactor);
|
Map(x => x.CalibFactor);
|
||||||
Map(x => x.Q2ErrWOCorrection);
|
Map(x => x.OrigCalibFactorLNA);
|
||||||
|
Map(x => x.CalibFactorLNA);
|
||||||
|
Map(x => x.Q2ErrWOCorrection);
|
||||||
Map(x => x.Q2CorrectionDone);
|
Map(x => x.Q2CorrectionDone);
|
||||||
Map(x => x.Q2Correction);
|
Map(x => x.Q2Correction);
|
||||||
Map(x => x.Q2CorrRFlow);
|
Map(x => x.Q2CorrRL).Column("Q2CorrRFlow");
|
||||||
Map(x => x.Q2CorrLFlow);
|
Map(x => x.Q2CorrLR).Column("Q2CorrLFlow");
|
||||||
Map(x => x.Q2CorrFlowRight);
|
Map(x => x.Q2CorrFlowRight);
|
||||||
Map(x => x.Diff2Hz8Hz);
|
Map(x => x.Diff2Hz8Hz);
|
||||||
Map(x => x.Hz2CorrectionDone);
|
Map(x => x.Hz2CorrectionDone);
|
||||||
Map(x => x.Hz2Correction);
|
Map(x => x.Hz2Correction);
|
||||||
Map(x => x.FWVersion);
|
Map(x => x.FWVersion);
|
||||||
#endif
|
#endif
|
||||||
References(x => x.WaterMeterData);
|
#if ORACLE_DB
|
||||||
|
Map(x => x.Pruefindex);
|
||||||
|
Map(x => x.HydrPruefung);
|
||||||
|
#endif
|
||||||
|
References(x => x.WaterMeterData);
|
||||||
References(x => x.Batch);
|
References(x => x.Batch);
|
||||||
HasMany(x => x.MeterTestRslts)
|
HasMany(x => x.MeterTestRslts)
|
||||||
.Cascade.All();
|
.Cascade.All();
|
||||||
|
|||||||
@@ -1,446 +0,0 @@
|
|||||||
///
|
|
||||||
/// Copyright (c) 2013-2016 Sensus Metering Systems
|
|
||||||
///
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Drawing.Printing;
|
|
||||||
using System.IO;
|
|
||||||
using Config.Entities;
|
|
||||||
using Results.Resources;
|
|
||||||
|
|
||||||
namespace Results.Output.Printers.Cevak
|
|
||||||
{
|
|
||||||
enum DocumentSection
|
|
||||||
{
|
|
||||||
FirstPage,
|
|
||||||
OtherPages,
|
|
||||||
Appendix1,
|
|
||||||
Appendix2,
|
|
||||||
Count,
|
|
||||||
}
|
|
||||||
|
|
||||||
public class PrintDocumentCevak : PrintDocument
|
|
||||||
{
|
|
||||||
const string FontFamilyName = "Arial"; //"Times New Roman";
|
|
||||||
|
|
||||||
const int SpacingOne = 18;
|
|
||||||
const int SpacingOneAndHalf = (3 * SpacingOne) / 2;
|
|
||||||
|
|
||||||
readonly int topMargin;
|
|
||||||
readonly int bottomMargin;
|
|
||||||
readonly int leftMargin;
|
|
||||||
readonly int TitleX;
|
|
||||||
readonly int TitleY; /// Depends on the size of the header
|
|
||||||
readonly int HdrTop; /// = TitleY + 60
|
|
||||||
readonly int BodyTop; /// = HdrTop + 160
|
|
||||||
|
|
||||||
/// Size of the printed area without margins, after taking into account 'pageOrientation'
|
|
||||||
int printHeight;
|
|
||||||
int printWidth;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Property variable for the Font the user wishes to use
|
|
||||||
/// </summary>
|
|
||||||
Font font;
|
|
||||||
Font boldFont;
|
|
||||||
Font titleFont;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Data to print
|
|
||||||
///
|
|
||||||
Results.Entities.Batch batch;
|
|
||||||
|
|
||||||
string testBenchName;
|
|
||||||
string address1;
|
|
||||||
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Items to print
|
|
||||||
///
|
|
||||||
readonly IList<Results.ItemSpec> rsltItems;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Layout and status
|
|
||||||
///
|
|
||||||
DocumentSection documentSection;
|
|
||||||
|
|
||||||
int nrWMsOnFirstPage;
|
|
||||||
int nrWMsOnNextPage;
|
|
||||||
int nextWMNr; /// nr. of watermeter to be printed as the first one on the next page
|
|
||||||
int nrPages;
|
|
||||||
int pageNr; /// Page number to be printed at the bottom of the page
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Constructor
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="textToPrint">Text to be printed</param>
|
|
||||||
public PrintDocumentCevak(Results.Entities.Batch batch,
|
|
||||||
PageOrientation pageOrientation,
|
|
||||||
int topMargin, int bottomMargin, int leftMargin,
|
|
||||||
string testBenchName, string address1)
|
|
||||||
{
|
|
||||||
this.batch = batch;
|
|
||||||
|
|
||||||
DefaultPageSettings.Landscape = (pageOrientation == PageOrientation.Landscape);
|
|
||||||
|
|
||||||
this.topMargin = topMargin;
|
|
||||||
this.bottomMargin = bottomMargin;
|
|
||||||
this.leftMargin = leftMargin;
|
|
||||||
|
|
||||||
this.testBenchName = testBenchName;
|
|
||||||
this.address1 = address1;
|
|
||||||
|
|
||||||
TitleX = leftMargin;
|
|
||||||
TitleY = topMargin; /// Depends on the size of the header
|
|
||||||
HdrTop = TitleY + 60;
|
|
||||||
BodyTop = HdrTop + 250;
|
|
||||||
|
|
||||||
rsltItems = Results.ItemSpec.FromStrArray(new string[] {
|
|
||||||
"Test name",
|
|
||||||
"Volume",
|
|
||||||
"Reference volume",
|
|
||||||
"Test time",
|
|
||||||
"Flow",
|
|
||||||
"Error",
|
|
||||||
"Passed",
|
|
||||||
//"Reference error", // ?
|
|
||||||
});
|
|
||||||
|
|
||||||
/// Set print area size and margins (in dots using 100 dpi)
|
|
||||||
if (DefaultPageSettings.Landscape)
|
|
||||||
{
|
|
||||||
printHeight = base.DefaultPageSettings.PaperSize.Width - topMargin - bottomMargin;
|
|
||||||
printWidth = base.DefaultPageSettings.PaperSize.Height - leftMargin - leftMargin;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
printHeight = base.DefaultPageSettings.PaperSize.Height - topMargin - bottomMargin;
|
|
||||||
printWidth = base.DefaultPageSettings.PaperSize.Width - leftMargin - leftMargin;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int testsCount = 0;
|
|
||||||
foreach (var mtr in batch.WaterMeters[0].MeterTestRslts)
|
|
||||||
{
|
|
||||||
if (mtr.Publish() == Config.Entities.Publish.Always) testsCount++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (batch.WaterMeters[0].Compound()) testsCount /= 3;
|
|
||||||
|
|
||||||
int wmSectionHeight = (testsCount + 4) * SpacingOne;
|
|
||||||
|
|
||||||
nrWMsOnFirstPage = (printHeight - BodyTop + TitleY - 2 * SpacingOne) / wmSectionHeight;
|
|
||||||
nrWMsOnNextPage = (printHeight - 2 * SpacingOne) / wmSectionHeight;
|
|
||||||
nrWMsOnNextPage = Math.Max(nrWMsOnNextPage, 1); /// Prevent division by zero if there are too many WM tests
|
|
||||||
|
|
||||||
nrPages = 1 + (batch.WaterMeters.Count - nrWMsOnFirstPage + nrWMsOnNextPage - 1) / nrWMsOnNextPage;
|
|
||||||
|
|
||||||
pageNr = 1;
|
|
||||||
nextWMNr = 0;
|
|
||||||
documentSection = DocumentSection.FirstPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Override the default onbeginPrint method of the PrintDocument Object
|
|
||||||
/// </summary>
|
|
||||||
/// <param name=e></param>
|
|
||||||
/// <remarks></remarks>
|
|
||||||
protected override void OnBeginPrint(System.Drawing.Printing.PrintEventArgs e)
|
|
||||||
{
|
|
||||||
base.OnBeginPrint(e);
|
|
||||||
|
|
||||||
if (font == null) { font = new Font(FontFamilyName, 10, FontStyle.Regular); }
|
|
||||||
if (boldFont == null) { boldFont = new Font(FontFamilyName, 10, FontStyle.Bold); }
|
|
||||||
if (titleFont == null) { titleFont = new Font(FontFamilyName, 18, FontStyle.Bold); }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Override the default OnPrintPage method of the PrintDocument.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name=e></param>
|
|
||||||
/// <remarks>This provides the print logic for our document</remarks>
|
|
||||||
protected override void OnPrintPage(System.Drawing.Printing.PrintPageEventArgs e)
|
|
||||||
{
|
|
||||||
/// Run base code
|
|
||||||
base.OnPrintPage(e);
|
|
||||||
|
|
||||||
/// Use the StringFormat class for the text layout of our document
|
|
||||||
StringFormat format = new StringFormat(StringFormatFlags.LineLimit);
|
|
||||||
|
|
||||||
|
|
||||||
if (documentSection != DocumentSection.OtherPages)
|
|
||||||
{
|
|
||||||
///----------
|
|
||||||
/// Header
|
|
||||||
///----------
|
|
||||||
if (documentSection == DocumentSection.FirstPage)
|
|
||||||
{
|
|
||||||
RectangleF printArea = new RectangleF(TitleX, TitleY, printWidth, 40);
|
|
||||||
e.Graphics.DrawString(batch.ProtocolTitle, titleFont, Brushes.Black, printArea);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
PrintAt(e, TitleX, TitleY, batch.ProtocolTitle);
|
|
||||||
}
|
|
||||||
|
|
||||||
string[] leftColumn = new string[]
|
|
||||||
{
|
|
||||||
"Protokol č.: ",
|
|
||||||
"Zákazník: ",
|
|
||||||
"Datum a čas: ",
|
|
||||||
"Procedura: ",
|
|
||||||
"Popis procedury: ",
|
|
||||||
"Typ vodoměru: ",
|
|
||||||
"Zkoušející: ",
|
|
||||||
"Název zkušební stanice: ",
|
|
||||||
"Zkušební SW, č. verze: ",
|
|
||||||
"Metodika: ", /// BenchAdresa 1
|
|
||||||
//"Okolní teplota: ", // Disabled, see email dated 25.11.2016
|
|
||||||
//"Okolní tlak: ",
|
|
||||||
//"Relativní vlhkost: ",
|
|
||||||
};
|
|
||||||
|
|
||||||
string[] rightColumn = new string[]
|
|
||||||
{
|
|
||||||
batch.BatchNr.ToString(),
|
|
||||||
batch.WaterMeters[0].PurchaseOrder,
|
|
||||||
//batch.EndTime.ToShortDateString() + " " + batch.EndTime.ToShortTimeString(),
|
|
||||||
string.Format("{0}.{1}.{2} {3}:{4}", batch.EndTime.Year.ToString("D4"),
|
|
||||||
batch.EndTime.Month.ToString("D2"),
|
|
||||||
batch.EndTime.Day.ToString("D2"),
|
|
||||||
batch.EndTime.Hour.ToString("D2"),
|
|
||||||
batch.EndTime.Minute.ToString("D2")),
|
|
||||||
string.IsNullOrEmpty(batch.ProcedureName) ? "" : batch.ProcedureName,
|
|
||||||
string.IsNullOrEmpty(batch.ProcedureDescription) ? "" : batch.ProcedureDescription,
|
|
||||||
string.IsNullOrEmpty(batch.WatermetersStr) ? "" : batch.WatermetersStr,
|
|
||||||
string.IsNullOrEmpty(batch.UserName) ? "" : batch.UserName,
|
|
||||||
string.IsNullOrEmpty(testBenchName) ? "" : testBenchName,
|
|
||||||
string.Format("Test Bench Framework ver.{0}", batch.ProgramVersion),
|
|
||||||
string.IsNullOrEmpty(address1) ? "" : address1,
|
|
||||||
//batch.AmbientTempAve().ToString("F1") + " °C", // Disabled, see email dated 25.11.2016
|
|
||||||
//Config.Units.ConvertTo(Config.Unit.mbar, batch.AmbientPressAve()).ToString("F0") + " mbar",
|
|
||||||
//batch.AmbientHumiAve().ToString("F0") + " %",
|
|
||||||
};
|
|
||||||
|
|
||||||
/// Determine max. left column width in characters
|
|
||||||
int maxLen = 0;
|
|
||||||
foreach (var s in leftColumn) if (s.Length > maxLen) maxLen = s.Length;
|
|
||||||
|
|
||||||
/// Write aligned columns
|
|
||||||
for (int i = 0; i < Math.Min(leftColumn.Length, rightColumn.Length); i++)
|
|
||||||
{
|
|
||||||
PrintAt(e, leftMargin, HdrTop + SpacingOne * i, leftColumn[i]);
|
|
||||||
PrintAt(e, 300, HdrTop + SpacingOne * i, rightColumn[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (documentSection == DocumentSection.FirstPage || documentSection == DocumentSection.OtherPages)
|
|
||||||
{
|
|
||||||
///--------
|
|
||||||
/// Body
|
|
||||||
///--------
|
|
||||||
|
|
||||||
/// This variable represents the top coordinate of the area where WM results are printed
|
|
||||||
/// and it is updated (increased by) the value returned by PrintWM() - the section size.
|
|
||||||
int nextWmTop = (pageNr == 1) ? BodyTop : TitleY;
|
|
||||||
|
|
||||||
int nrWMsOnPage = (pageNr == 1) ? nrWMsOnFirstPage : nrWMsOnNextPage;
|
|
||||||
|
|
||||||
for (int wmNr = nextWMNr; wmNr < Math.Min(nextWMNr + nrWMsOnPage, batch.WaterMeters.Count); wmNr++) /// wmNr is 0-based
|
|
||||||
{
|
|
||||||
int wmPosition = true ? batch.WaterMeters[wmNr].WMPosition : (wmNr + 1);
|
|
||||||
nextWmTop += PrintWM(e, batch.WaterMeters[wmNr], wmPosition, nextWmTop);
|
|
||||||
}
|
|
||||||
|
|
||||||
nextWMNr += nrWMsOnPage;
|
|
||||||
e.HasMorePages = true;
|
|
||||||
if (nextWMNr < batch.WaterMeters.Count)
|
|
||||||
{
|
|
||||||
documentSection = DocumentSection.OtherPages;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
documentSection = DocumentSection.Appendix1;
|
|
||||||
}
|
|
||||||
|
|
||||||
///----------
|
|
||||||
/// Footer
|
|
||||||
///----------
|
|
||||||
string footerText = string.Format("{0} {1}/{2}", Strings.Page, pageNr++, nrPages);
|
|
||||||
int footerWidth = (int)e.Graphics.MeasureString(footerText, font).Width;
|
|
||||||
PrintAt(e, leftMargin + (printWidth - footerWidth) / 2, topMargin + printHeight - SpacingOne, footerText);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
///-------------------------------
|
|
||||||
/// List of passed water meters
|
|
||||||
///-------------------------------
|
|
||||||
|
|
||||||
int nextWmTop = BodyTop;
|
|
||||||
|
|
||||||
foreach (var wm in batch.WaterMeters)
|
|
||||||
{
|
|
||||||
if (wm.Passed)
|
|
||||||
{
|
|
||||||
PrintAt(e, leftMargin, nextWmTop, string.Format("Vodoměr {0}: s/n {1}", wm.WMPosition, wm.SerialNr));
|
|
||||||
nextWmTop += SpacingOne;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (documentSection == DocumentSection.Appendix1)
|
|
||||||
{
|
|
||||||
documentSection = DocumentSection.Appendix2;
|
|
||||||
e.HasMorePages = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
e.HasMorePages = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Print one water meter results
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="wm">Water meter</param>
|
|
||||||
/// <param name="printedWMNr">Number of the water meter printed</param>
|
|
||||||
/// <param name="top">Top coordinate of watermeter data</param>
|
|
||||||
/// <returns>The height of the printed section</returns>
|
|
||||||
int PrintWM(System.Drawing.Printing.PrintPageEventArgs e,
|
|
||||||
Results.Entities.WaterMeter wm, int printedWMNr, int top)
|
|
||||||
{
|
|
||||||
/// Determin column widths
|
|
||||||
float[] columnPos = new float[rsltItems.Count + 1];
|
|
||||||
columnPos[0] = (float)leftMargin;
|
|
||||||
|
|
||||||
for (int i = 0; i < rsltItems.Count; i++)
|
|
||||||
{
|
|
||||||
float columnWidth = e.Graphics.MeasureString(rsltItems[i].ClmnHeaderText, font).Width;
|
|
||||||
foreach (var mtr in wm.MeterTestRslts)
|
|
||||||
{
|
|
||||||
string itemText;
|
|
||||||
|
|
||||||
if (!wm.Compound())
|
|
||||||
{
|
|
||||||
itemText = rsltItems[i].Print(mtr);
|
|
||||||
}
|
|
||||||
else if (mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
|
|
||||||
{
|
|
||||||
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
|
|
||||||
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
|
|
||||||
itemText = rsltItems[i].PrintCombined(mainMtr, auxMtr, mtr);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Strip color information
|
|
||||||
string[] texts = itemText.Split(new char[] { '|' });
|
|
||||||
if (texts.Length == 2) { itemText = texts[0]; }
|
|
||||||
|
|
||||||
float width = e.Graphics.MeasureString(itemText, font).Width;
|
|
||||||
if (width > columnWidth) columnWidth = width;
|
|
||||||
}
|
|
||||||
columnPos[i + 1] = columnPos[i] + columnWidth + 20.0f;
|
|
||||||
}
|
|
||||||
int tableLeftX = (int)columnPos[0];
|
|
||||||
int tableRightX = (int)columnPos[rsltItems.Count] - 20;
|
|
||||||
|
|
||||||
string wmText = string.Format("Vodoměr {0}", printedWMNr);
|
|
||||||
PrintAt(e, leftMargin, top, wmText);
|
|
||||||
if (!string.IsNullOrEmpty(wm.SerialNr))
|
|
||||||
{
|
|
||||||
PrintAt(e, leftMargin + (int)e.Graphics.MeasureString(wmText, font).Width, top,
|
|
||||||
string.Format(" s/n = {0}", wm.SerialNr));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Horizontal line
|
|
||||||
int horY = top + 25;
|
|
||||||
e.Graphics.DrawLine(new Pen(Color.Black, 2), new Point(tableLeftX, horY), new Point(tableRightX, horY));
|
|
||||||
|
|
||||||
for (int i = 0; i < rsltItems.Count; i++)
|
|
||||||
{
|
|
||||||
PrintAt(e, (int)columnPos[i], top + 27, rsltItems[i].ClmnHeaderText);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Horizontal line
|
|
||||||
horY = top + 27 + SpacingOne;
|
|
||||||
e.Graphics.DrawLine(new Pen(Color.Black, 2), new Point(tableLeftX, horY), new Point(tableRightX, horY));
|
|
||||||
|
|
||||||
int testsCount = 0;
|
|
||||||
foreach (var mtr in wm.MeterTestRslts)
|
|
||||||
{
|
|
||||||
if (mtr.Publish() == Config.Entities.Publish.Always)
|
|
||||||
{
|
|
||||||
testsCount++;
|
|
||||||
for (int i = 0; i < rsltItems.Count; i++)
|
|
||||||
{
|
|
||||||
string itemText;
|
|
||||||
|
|
||||||
if (!wm.Compound())
|
|
||||||
{
|
|
||||||
/// Single water meter
|
|
||||||
itemText = rsltItems[i].Print(mtr);
|
|
||||||
}
|
|
||||||
else if (mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
|
|
||||||
{
|
|
||||||
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
|
|
||||||
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
|
|
||||||
itemText = rsltItems[i].PrintCombined(mainMtr, auxMtr, mtr);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Strip color information
|
|
||||||
string[] texts = itemText.Split(new char[] { '|' });
|
|
||||||
if (texts.Length == 2)
|
|
||||||
{
|
|
||||||
itemText = texts[0];
|
|
||||||
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
|
|
||||||
/// TODO: How to print colors?
|
|
||||||
}
|
|
||||||
|
|
||||||
PrintAt(e, (int)columnPos[i], top + 30 + SpacingOne * testsCount, itemText);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Horizontal line
|
|
||||||
horY = top + 30 + SpacingOne * (testsCount + 1);
|
|
||||||
e.Graphics.DrawLine(new Pen(Color.Black, 2), new Point(tableLeftX, horY), new Point(tableRightX, horY));
|
|
||||||
|
|
||||||
return (testsCount + 4) * SpacingOne;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text)
|
|
||||||
{
|
|
||||||
PrintAt(e, p.X, p.Y, text);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
|
|
||||||
{
|
|
||||||
RectangleF printArea = new RectangleF(x, y, 667, SpacingOne);
|
|
||||||
e.Graphics.DrawString(text, this.font, Brushes.Black, printArea);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void PrintBoldAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text)
|
|
||||||
{
|
|
||||||
PrintBoldAt(e, p.X, p.Y, text);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void PrintBoldAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
|
|
||||||
{
|
|
||||||
RectangleF printArea = new RectangleF(x, y, 667, SpacingOne);
|
|
||||||
e.Graphics.DrawString(text, this.boldFont, Brushes.Black, printArea);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -44,6 +44,8 @@ namespace Results.Output.Printers.Enhanced
|
|||||||
Font font;
|
Font font;
|
||||||
Font footerFont;
|
Font footerFont;
|
||||||
|
|
||||||
|
TableStyle style;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Data to print
|
/// Data to print
|
||||||
///
|
///
|
||||||
@@ -75,7 +77,7 @@ namespace Results.Output.Printers.Enhanced
|
|||||||
/// <param name="textToPrint">Text to be printed</param>
|
/// <param name="textToPrint">Text to be printed</param>
|
||||||
public EnhancedPrintDocument(Results.Entities.Batch batch, EnhancedPrinterCfg cfg, string documentName)
|
public EnhancedPrintDocument(Results.Entities.Batch batch, EnhancedPrinterCfg cfg, string documentName)
|
||||||
{
|
{
|
||||||
this.batch = batch;
|
this.batch = batch;
|
||||||
this.cfg = cfg;
|
this.cfg = cfg;
|
||||||
DocumentName = documentName;
|
DocumentName = documentName;
|
||||||
|
|
||||||
@@ -94,7 +96,20 @@ namespace Results.Output.Printers.Enhanced
|
|||||||
font = new Font((cfg.BodyFntFml != null ? cfg.BodyFntFml : "Arial"), (cfg.BodyFntSz > 0 ? cfg.BodyFntSz : 10), (FontStyle)cfg.BodyFntSty);
|
font = new Font((cfg.BodyFntFml != null ? cfg.BodyFntFml : "Arial"), (cfg.BodyFntSz > 0 ? cfg.BodyFntSz : 10), (FontStyle)cfg.BodyFntSty);
|
||||||
footerFont = new Font((cfg.FooterFntFml != null ? cfg.FooterFntFml : "Arial"), (cfg.FooterFntSz > 0 ? cfg.FooterFntSz : 10), (FontStyle)cfg.FooterFntSty);
|
footerFont = new Font((cfg.FooterFntFml != null ? cfg.FooterFntFml : "Arial"), (cfg.FooterFntSz > 0 ? cfg.FooterFntSz : 10), (FontStyle)cfg.FooterFntSty);
|
||||||
|
|
||||||
/// Set print area size and margins (in dots using 100 dpi)
|
/// Table style of one water meter table where tests are rows
|
||||||
|
style = new TableStyle
|
||||||
|
{
|
||||||
|
Font = font,
|
||||||
|
HeaderFont = headerFont,
|
||||||
|
MarginX = 5,
|
||||||
|
MarginY = 3,
|
||||||
|
LineWidth = 1,
|
||||||
|
TopHeadersCount = 1,
|
||||||
|
HorizLines = TableLines.FirstSecondAndLast,
|
||||||
|
VertLines = TableLines.All
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Set print area size and margins (in dots using 100 dpi)
|
||||||
DefaultPageSettings.Landscape = (cfg.PageOrientation == PageOrientation.Landscape);
|
DefaultPageSettings.Landscape = (cfg.PageOrientation == PageOrientation.Landscape);
|
||||||
///
|
///
|
||||||
if (DefaultPageSettings.Landscape)
|
if (DefaultPageSettings.Landscape)
|
||||||
@@ -108,39 +123,15 @@ namespace Results.Output.Printers.Enhanced
|
|||||||
printWidth = base.DefaultPageSettings.PaperSize.Width - leftMargin - leftMargin;
|
printWidth = base.DefaultPageSettings.PaperSize.Width - leftMargin - leftMargin;
|
||||||
}
|
}
|
||||||
|
|
||||||
SpacingOne = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", font).Height;
|
/// Document outline preliminary calculations
|
||||||
SpacingOneAndHalf = (3 * SpacingOne) / 2;
|
SpacingOne = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", font).Height;
|
||||||
SpacingOne4Header = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", headerFont).Height;
|
SpacingOneAndHalf = (3 * SpacingOne) / 2;
|
||||||
SpacingOneAndHalf4Header = (3 * SpacingOne4Header) / 2;
|
SpacingOne4Header = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", headerFont).Height;
|
||||||
|
SpacingOneAndHalf4Header = (3 * SpacingOne4Header) / 2;
|
||||||
SpacingOne4Footer = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", footerFont).Height;
|
SpacingOne4Footer = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", footerFont).Height;
|
||||||
|
|
||||||
/// Calculate the tests count
|
TitleX = cfg.LeftMargin;
|
||||||
int testsCount = 0;
|
TitleY = cfg.TopMargin;
|
||||||
if (batch.WaterMeters.Count > 0)
|
|
||||||
{
|
|
||||||
foreach (var mtr in batch.WaterMeters[0].MeterTestRslts)
|
|
||||||
{
|
|
||||||
if (mtr.Publish() == Config.Entities.Publish.Always && mtr.IsPilotRslt()) testsCount++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Prepare document outline
|
|
||||||
TitleX = cfg.LeftMargin;
|
|
||||||
TitleY = cfg.TopMargin;
|
|
||||||
|
|
||||||
titleHeight = System.Windows.Forms.TextRenderer.MeasureText(header, titleFont).Height;
|
|
||||||
CommonTop = TitleY + titleHeight + SpacingOne4Header;
|
|
||||||
|
|
||||||
commonHeight = commonItems.Count * SpacingOne;
|
|
||||||
BodyTop = CommonTop + commonHeight + SpacingOne4Header;
|
|
||||||
|
|
||||||
int wmSectionHeight = (testsCount + 1) * SpacingOne + 3 * SpacingOne4Header;
|
|
||||||
|
|
||||||
nrWMsOnFirstPage = (printHeight - BodyTop + TitleY - 2 * SpacingOne) / wmSectionHeight;
|
|
||||||
nrWMsOnNextPage = (printHeight - 2 * SpacingOne) / wmSectionHeight;
|
|
||||||
nrWMsOnNextPage = Math.Max(nrWMsOnNextPage, 1); /// Prevent division by zero if there are too many WM tests
|
|
||||||
|
|
||||||
nrPages = 1 + (batch.WaterMeters.Count - nrWMsOnFirstPage + nrWMsOnNextPage - 1) / nrWMsOnNextPage;
|
|
||||||
|
|
||||||
pageNr = 1;
|
pageNr = 1;
|
||||||
nextWMNr = 0;
|
nextWMNr = 0;
|
||||||
@@ -183,7 +174,27 @@ namespace Results.Output.Printers.Enhanced
|
|||||||
|
|
||||||
if (pageNr == 1)
|
if (pageNr == 1)
|
||||||
{
|
{
|
||||||
///----------
|
///----------
|
||||||
|
/// Prepare document outline
|
||||||
|
///----------
|
||||||
|
titleHeight = System.Windows.Forms.TextRenderer.MeasureText(header, titleFont).Height;
|
||||||
|
CommonTop = TitleY + titleHeight + SpacingOne4Header;
|
||||||
|
|
||||||
|
commonHeight = commonItems.Count * SpacingOne;
|
||||||
|
BodyTop = CommonTop + commonHeight + SpacingOne4Header;
|
||||||
|
|
||||||
|
Table table0 = Table.Create_TestsAreRows(batch.WaterMeters[0], testItems, style);
|
||||||
|
SizeF tableSize = table0.Measure(e);
|
||||||
|
int wmSectionHeight = (int)tableSize.Height + SpacingOne4Header * ((tableSize.Height > 0) ? 3 : 2);
|
||||||
|
|
||||||
|
nrWMsOnFirstPage = (printHeight - BodyTop + TitleY - 2 * SpacingOne) / wmSectionHeight;
|
||||||
|
nrWMsOnNextPage = (printHeight - 2 * SpacingOne) / wmSectionHeight;
|
||||||
|
nrWMsOnNextPage = Math.Max(nrWMsOnNextPage, 1); /// Prevent division by zero if there are too many WM tests
|
||||||
|
|
||||||
|
nrPages = 1 + (batch.WaterMeters.Count - nrWMsOnFirstPage + nrWMsOnNextPage - 1) / nrWMsOnNextPage;
|
||||||
|
|
||||||
|
|
||||||
|
///----------
|
||||||
/// Title
|
/// Title
|
||||||
///----------
|
///----------
|
||||||
RectangleF printArea = new RectangleF(TitleX, TitleY, printWidth, titleHeight);
|
RectangleF printArea = new RectangleF(TitleX, TitleY, printWidth, titleHeight);
|
||||||
@@ -228,8 +239,10 @@ namespace Results.Output.Printers.Enhanced
|
|||||||
for (int wmNr = nextWMNr; wmNr < Math.Min(nextWMNr + nrWMsOnPage, batch.WaterMeters.Count); wmNr++) /// wmNr is 0-based
|
for (int wmNr = nextWMNr; wmNr < Math.Min(nextWMNr + nrWMsOnPage, batch.WaterMeters.Count); wmNr++) /// wmNr is 0-based
|
||||||
{
|
{
|
||||||
int wmPosition = true ? batch.WaterMeters[wmNr].WMPosition : (wmNr + 1);
|
int wmPosition = true ? batch.WaterMeters[wmNr].WMPosition : (wmNr + 1);
|
||||||
int sectionHght = PrintWM(e, batch.WaterMeters[wmNr], wmPosition, nextWmTop);
|
if (!cfg.GoodOnly || batch.WaterMeters[wmNr].Passed)
|
||||||
nextWmTop += sectionHght;
|
{
|
||||||
|
nextWmTop = (int)PrintWM(e, batch.WaterMeters[wmNr], wmPosition, nextWmTop) + SpacingOneAndHalf4Header;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nextWMNr += nrWMsOnPage;
|
nextWMNr += nrWMsOnPage;
|
||||||
@@ -254,88 +267,28 @@ namespace Results.Output.Printers.Enhanced
|
|||||||
/// <param name="printedWMNr">Number of the water meter printed</param>
|
/// <param name="printedWMNr">Number of the water meter printed</param>
|
||||||
/// <param name="top">Top coordinate of watermeter data</param>
|
/// <param name="top">Top coordinate of watermeter data</param>
|
||||||
/// <returns>The height of the printed section</returns>
|
/// <returns>The height of the printed section</returns>
|
||||||
int PrintWM(System.Drawing.Printing.PrintPageEventArgs e,
|
float PrintWM(System.Drawing.Printing.PrintPageEventArgs e,
|
||||||
Results.Entities.WaterMeter wm, int printedWMNr, int top)
|
Results.Entities.WaterMeter wm, int printedWMNr, int top)
|
||||||
{
|
{
|
||||||
/// Determin column widths
|
/// Print the water meter number and the serial number
|
||||||
float[] columnPos = new float[testItems.Count + 1];
|
string wmText = string.Format("{0} {1}", Strings.Water_Meter, printedWMNr);
|
||||||
columnPos[0] = (float)leftMargin;
|
PrintHeaderAt(e, leftMargin, top, wmText);
|
||||||
|
if (!string.IsNullOrEmpty(wm.SerialNr))
|
||||||
|
{
|
||||||
|
PrintHeaderAt(e, leftMargin + (int)e.Graphics.MeasureString(wmText, headerFont).Width, top,
|
||||||
|
string.Format(" {0} = {1}", Strings.sn, wm.SerialNr));
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < testItems.Count; i++)
|
Table table = Table.Create_TestsAreRows(wm, testItems, style);
|
||||||
{
|
|
||||||
float columnWidth = e.Graphics.MeasureString(testItems[i].Caption, headerFont).Width;
|
|
||||||
foreach (var mtr in wm.MeterTestRslts)
|
|
||||||
{
|
|
||||||
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
|
|
||||||
{
|
|
||||||
string itemText = testItems[i].Print(wm, mtr.Name());
|
|
||||||
|
|
||||||
/// Strip color information
|
if (table.IsEmpty())
|
||||||
string[] texts = itemText.Split(new char[] { '|' });
|
{
|
||||||
if (texts.Length == 2) { itemText = texts[0]; }
|
return top;
|
||||||
|
}
|
||||||
float width = e.Graphics.MeasureString(itemText, font).Width;
|
else
|
||||||
if (width > columnWidth) columnWidth = width;
|
{
|
||||||
}
|
return table.Draw(e, leftMargin, top + SpacingOneAndHalf4Header);
|
||||||
}
|
}
|
||||||
columnPos[i + 1] = columnPos[i] + columnWidth + 20.0f;
|
|
||||||
}
|
|
||||||
int tableLeftX = (int)columnPos[0];
|
|
||||||
int tableRightX = (int)columnPos[testItems.Count] - 20;
|
|
||||||
|
|
||||||
string wmText = string.Format("{0} {1}", Strings.Water_Meter, printedWMNr);
|
|
||||||
PrintHeaderAt(e, leftMargin, top, wmText);
|
|
||||||
if (!string.IsNullOrEmpty(wm.SerialNr))
|
|
||||||
{
|
|
||||||
PrintHeaderAt(e, leftMargin + (int)e.Graphics.MeasureString(wmText, headerFont).Width, top,
|
|
||||||
string.Format(" {0} = {1}", Strings.sn, wm.SerialNr));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Horizontal line
|
|
||||||
int horY = top + SpacingOneAndHalf4Header;
|
|
||||||
e.Graphics.DrawLine(new Pen(Color.Black, 2), new Point(tableLeftX, horY), new Point(tableRightX, horY));
|
|
||||||
|
|
||||||
for (int i = 0; i < testItems.Count; i++)
|
|
||||||
{
|
|
||||||
PrintHeaderAt(e, (int)columnPos[i], top + (int)(1.6 * SpacingOne4Header), testItems[i].Caption);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Horizontal line
|
|
||||||
horY = top + (int)(2.8 * SpacingOne4Header);
|
|
||||||
e.Graphics.DrawLine(new Pen(Color.Black, 2), new Point(tableLeftX, horY), new Point(tableRightX, horY));
|
|
||||||
|
|
||||||
int testsCount = 0;
|
|
||||||
foreach (var mtr in wm.MeterTestRslts)
|
|
||||||
{
|
|
||||||
if ((mtr != null) && (mtr.Publish() == Config.Entities.Publish.Always))
|
|
||||||
{
|
|
||||||
WMeterRsltItemSpec.TableRowNr = ++testsCount;
|
|
||||||
|
|
||||||
for (int i = 0; i < testItems.Count; i++)
|
|
||||||
{
|
|
||||||
WMeterRsltItemSpec.TableColumnNr = i + 1;
|
|
||||||
|
|
||||||
string itemText = testItems[i].Print(wm, mtr.Name());
|
|
||||||
|
|
||||||
/// Strip color information
|
|
||||||
string[] texts = itemText.Split(new char[] { '|' });
|
|
||||||
if (texts.Length == 2)
|
|
||||||
{
|
|
||||||
itemText = texts[0];
|
|
||||||
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
|
|
||||||
/// TODO: How to print colors?
|
|
||||||
}
|
|
||||||
|
|
||||||
PrintAt(e, (int)columnPos[i], top + 2 * SpacingOne4Header + SpacingOne * testsCount, itemText);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Horizontal line
|
|
||||||
horY = top + 2 * SpacingOneAndHalf4Header + SpacingOne * testsCount;
|
|
||||||
e.Graphics.DrawLine(new Pen(Color.Black, 2), new Point(tableLeftX, horY), new Point(tableRightX, horY));
|
|
||||||
|
|
||||||
return (testsCount + 1) * SpacingOne + 3 * SpacingOne4Header;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2016-2017 Sensus Metering Systems
|
/// Copyright (c) 2016-2018 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Printing;
|
using System.Drawing.Printing;
|
||||||
using Config.Entities;
|
using Config.Entities;
|
||||||
|
using System.IO;
|
||||||
|
using Results.Resources;
|
||||||
|
|
||||||
namespace Results.Output.Printers.Munich
|
namespace Results.Output.Printers.Munich
|
||||||
{
|
{
|
||||||
@@ -38,11 +40,16 @@ namespace Results.Output.Printers.Munich
|
|||||||
readonly int resultsCount;
|
readonly int resultsCount;
|
||||||
readonly bool compound; /// true when MetersKind is MetersKind.Combined
|
readonly bool compound; /// true when MetersKind is MetersKind.Combined
|
||||||
|
|
||||||
/// Top coordinate of the table
|
|
||||||
int nrPages;
|
int pageNr; /// Current page number
|
||||||
int pageNr;
|
int nrPages; /// Total number of pages
|
||||||
int firstTblTop;
|
float tableTop; /// Top coordinate of the table
|
||||||
int secondTblTop;
|
|
||||||
|
int[] firstTblRowsOnPage;
|
||||||
|
int[] secondTblRowsOnPage;
|
||||||
|
|
||||||
|
|
||||||
|
PageOrientation pageOrientation;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Property variable for the Font the user wishes to use
|
/// Property variable for the Font the user wishes to use
|
||||||
@@ -51,7 +58,34 @@ namespace Results.Output.Printers.Munich
|
|||||||
Font boldFont;
|
Font boldFont;
|
||||||
Font fontTitle;
|
Font fontTitle;
|
||||||
|
|
||||||
/// <summary>
|
///
|
||||||
|
/// Table style
|
||||||
|
///
|
||||||
|
static TableStyle tableStyle = new TableStyle
|
||||||
|
{
|
||||||
|
Font = new Font(FontFamilyName, 10, FontStyle.Regular),
|
||||||
|
HeaderFont = new Font(FontFamilyName, 10, FontStyle.Regular),
|
||||||
|
MarginX = 7,
|
||||||
|
MarginY = 5,
|
||||||
|
LineWidth = 1,
|
||||||
|
TopHeadersCount = 1,
|
||||||
|
HorizLines = TableLines.FirstSecondAndLast,
|
||||||
|
VertLines = TableLines.All,
|
||||||
|
ColumnWidths = new float[] { 150, 70, 75, 75, 70, 75, 75 },
|
||||||
|
};
|
||||||
|
static Alignment[] horizontalAlignment = new Alignment[] /// Horizontal alignment of items of one row
|
||||||
|
{
|
||||||
|
Alignment.Left, Alignment.Left, Alignment.Left,
|
||||||
|
Alignment.Left, Alignment.Left, Alignment.Left, Alignment.Left
|
||||||
|
};
|
||||||
|
static VertAlignment[] verticalAlignment = new VertAlignment[] /// Vertical alignment of items of one row
|
||||||
|
{
|
||||||
|
VertAlignment.Middle, VertAlignment.Middle, VertAlignment.Middle,
|
||||||
|
VertAlignment.Middle, VertAlignment.Middle, VertAlignment.Middle, VertAlignment.Middle
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
/// Constructor
|
/// Constructor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="textToPrint">Text to be printed</param>
|
/// <param name="textToPrint">Text to be printed</param>
|
||||||
@@ -61,7 +95,8 @@ namespace Results.Output.Printers.Munich
|
|||||||
{
|
{
|
||||||
this.docVersion = docVersion;
|
this.docVersion = docVersion;
|
||||||
this.wm = wm;
|
this.wm = wm;
|
||||||
compound = wm.Compound();
|
this.compound = wm.Compound();
|
||||||
|
this.pageOrientation = pageOrientation;
|
||||||
|
|
||||||
string[] info = wm.ProductName().Split(new char[] { ';' });
|
string[] info = wm.ProductName().Split(new char[] { ';' });
|
||||||
if (info.Length >= 2)
|
if (info.Length >= 2)
|
||||||
@@ -81,13 +116,88 @@ namespace Results.Output.Printers.Munich
|
|||||||
}
|
}
|
||||||
|
|
||||||
results = wm.MeterTestRslts;
|
results = wm.MeterTestRslts;
|
||||||
this.resultsCount = compound ? (results.Count / 3) : results.Count;
|
|
||||||
|
|
||||||
int resultsCount = wm.MeterTestRslts.Count;
|
resultsCount = 0;
|
||||||
if (compound) resultsCount /= 3;
|
foreach (var mtr in wm.MeterTestRslts)
|
||||||
|
{
|
||||||
|
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always) resultsCount++;
|
||||||
|
}
|
||||||
|
|
||||||
pageNr = 1;
|
pageNr = 1;
|
||||||
nrPages = (compound ? (resultsCount > 7) : (resultsCount > 9)) ? 2 : 1;
|
if (compound)
|
||||||
|
{
|
||||||
|
/// Compound meter results
|
||||||
|
const int MaxOnFirstPage = 23;
|
||||||
|
const int MaxOnPage = 45;
|
||||||
|
if (resultsCount <= 7)
|
||||||
|
{
|
||||||
|
nrPages = 1;
|
||||||
|
firstTblRowsOnPage = new int[] { resultsCount };
|
||||||
|
secondTblRowsOnPage = new int[] { resultsCount };
|
||||||
|
}
|
||||||
|
else if (resultsCount <= MaxOnFirstPage)
|
||||||
|
{
|
||||||
|
nrPages = 2;
|
||||||
|
firstTblRowsOnPage = new int[] { resultsCount, 0 };
|
||||||
|
secondTblRowsOnPage = new int[] { 0, int.MaxValue };
|
||||||
|
}
|
||||||
|
else if (resultsCount <= MaxOnPage)
|
||||||
|
{
|
||||||
|
nrPages = 3;
|
||||||
|
firstTblRowsOnPage = new int[] { MaxOnFirstPage, (resultsCount - MaxOnFirstPage), 0 };
|
||||||
|
int secondTblRowsOn2ndPage = Math.Max(0, MaxOnFirstPage + MaxOnPage - 2 - resultsCount);
|
||||||
|
secondTblRowsOnPage = new int[] { 0, secondTblRowsOn2ndPage, resultsCount - secondTblRowsOn2ndPage };
|
||||||
|
}
|
||||||
|
else if (resultsCount <= MaxOnFirstPage + MaxOnPage)
|
||||||
|
{
|
||||||
|
nrPages = 4;
|
||||||
|
firstTblRowsOnPage = new int[] { MaxOnFirstPage, MaxOnPage, 0, 0 };
|
||||||
|
secondTblRowsOnPage = new int[] { 0, 0, MaxOnPage, MaxOnFirstPage };
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nrPages = 5;
|
||||||
|
firstTblRowsOnPage = new int[] { MaxOnFirstPage, MaxOnPage, (resultsCount - MaxOnFirstPage - MaxOnPage), 0 };
|
||||||
|
secondTblRowsOnPage = new int[] { 0, 0, Math.Max(0, MaxOnFirstPage + 2 * MaxOnPage - 2 - resultsCount), MaxOnPage, MaxOnFirstPage };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/// Regular (single) meter results
|
||||||
|
const int MaxOnFirstPage = 27;
|
||||||
|
const int MaxOnPage = 45;
|
||||||
|
if (resultsCount <= 9)
|
||||||
|
{
|
||||||
|
nrPages = 1;
|
||||||
|
firstTblRowsOnPage = new int[] { resultsCount };
|
||||||
|
secondTblRowsOnPage = new int[] { resultsCount };
|
||||||
|
}
|
||||||
|
else if (resultsCount <= MaxOnFirstPage)
|
||||||
|
{
|
||||||
|
nrPages = 2;
|
||||||
|
firstTblRowsOnPage = new int[] { resultsCount, 0 };
|
||||||
|
secondTblRowsOnPage = new int[] { 0, int.MaxValue };
|
||||||
|
}
|
||||||
|
else if (resultsCount <= MaxOnPage)
|
||||||
|
{
|
||||||
|
nrPages = 3;
|
||||||
|
firstTblRowsOnPage = new int[] { MaxOnFirstPage, (resultsCount - MaxOnFirstPage), 0 };
|
||||||
|
int secondTblRowsOn2ndPage = Math.Max(0, MaxOnFirstPage + MaxOnPage - 2 - resultsCount);
|
||||||
|
secondTblRowsOnPage = new int[] { 0, secondTblRowsOn2ndPage, resultsCount - secondTblRowsOn2ndPage };
|
||||||
|
}
|
||||||
|
else if (resultsCount <= MaxOnFirstPage + MaxOnPage)
|
||||||
|
{
|
||||||
|
nrPages = 4;
|
||||||
|
firstTblRowsOnPage = new int[] { MaxOnFirstPage, MaxOnPage, 0, 0 };
|
||||||
|
secondTblRowsOnPage = new int[] { 0, 0, MaxOnPage, MaxOnFirstPage };
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nrPages = 5;
|
||||||
|
firstTblRowsOnPage = new int[] { MaxOnFirstPage, MaxOnPage, (resultsCount - MaxOnFirstPage - MaxOnPage), 0 };
|
||||||
|
secondTblRowsOnPage = new int[] { 0, 0, Math.Max(0, MaxOnFirstPage + 2 * MaxOnPage - 2 - resultsCount), MaxOnPage, MaxOnFirstPage };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DefaultPageSettings.Landscape = (pageOrientation == PageOrientation.Landscape);
|
DefaultPageSettings.Landscape = (pageOrientation == PageOrientation.Landscape);
|
||||||
}
|
}
|
||||||
@@ -116,8 +226,30 @@ namespace Results.Output.Printers.Munich
|
|||||||
/// Run base code
|
/// Run base code
|
||||||
base.OnPrintPage(e);
|
base.OnPrintPage(e);
|
||||||
|
|
||||||
/// Draw 2550 x 3507 'headpic' scaled to A4 at 100 DPI
|
if (pageOrientation == PageOrientation.Portrait)
|
||||||
e.Graphics.DrawImage(Results.Properties.Resources.Headpic, new Rectangle(0, 0, 827, 1137));
|
{
|
||||||
|
string[] templatePaths = new string[] { "C:\\TBF\\Templates\\MunichP.jpg", "C:\\TBF\\Templates\\MunichP.png", "C:\\TBF\\Templates\\MunichP.tif" };
|
||||||
|
foreach (var t in templatePaths)
|
||||||
|
{
|
||||||
|
if (File.Exists(t))
|
||||||
|
{
|
||||||
|
e.Graphics.DrawImage(new Bitmap(Image.FromFile(t), 827, 1169), new Rectangle(0, 0, 827, 1169));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string[] templatePaths = new string[] { "C:\\TBF\\Templates\\MunichL.jpg", "C:\\TBF\\Templates\\MunichL.png", "C:\\TBF\\Templates\\MunichL.tif" };
|
||||||
|
foreach (var t in templatePaths)
|
||||||
|
{
|
||||||
|
if (File.Exists(t))
|
||||||
|
{
|
||||||
|
e.Graphics.DrawImage(new Bitmap(Image.FromFile(t), 1169, 827), new Rectangle(0, 0, 1169, 827));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Set print area size and margins (in dots using 80 dpi)
|
/// Set print area size and margins (in dots using 80 dpi)
|
||||||
int printHeight = base.DefaultPageSettings.PaperSize.Height - base.DefaultPageSettings.Margins.Top - base.DefaultPageSettings.Margins.Bottom;
|
int printHeight = base.DefaultPageSettings.PaperSize.Height - base.DefaultPageSettings.Margins.Top - base.DefaultPageSettings.Margins.Bottom;
|
||||||
@@ -144,27 +276,21 @@ namespace Results.Output.Printers.Munich
|
|||||||
|
|
||||||
if (pageNr == 1)
|
if (pageNr == 1)
|
||||||
{
|
{
|
||||||
RectangleF printArea = new RectangleF(TitleX, TitleY, 667, 50);
|
/// This is the first page, drad the title, common part and the 1st table
|
||||||
|
|
||||||
|
RectangleF printArea = new RectangleF(TitleX, TitleY, 667, 50);
|
||||||
e.Graphics.DrawString(wm.Batch.ProtocolTitle, this.fontTitle, Brushes.Black, printArea);
|
e.Graphics.DrawString(wm.Batch.ProtocolTitle, this.fontTitle, Brushes.Black, printArea);
|
||||||
|
|
||||||
///
|
DrawCommonTop(e, ref lineNr, wm, pruefvorlage, docVersion);
|
||||||
/// Common
|
|
||||||
///
|
|
||||||
PrintAt(e, Tab1, lineNr * SpacingOne, docVersion);
|
|
||||||
lineNr++;
|
|
||||||
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Prüfstand Nr :");
|
|
||||||
PrintBoldAt(e, Tab2, lineNr * SpacingOne, wm.BenchId().ToString());
|
|
||||||
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Datum :");
|
|
||||||
PrintBoldAt(e, Tab4, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
|
|
||||||
lineNr++;
|
|
||||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Zählertyp :");
|
|
||||||
PrintAt(e, Tab2, lineNr * SpacingOne, zaehlertyp);
|
|
||||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Eichjahr :");
|
|
||||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.YearOfProduction.ToString());
|
|
||||||
lineNr++;
|
|
||||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Prüfvorlage :");
|
|
||||||
PrintAt(e, Tab2, lineNr * SpacingOne, pruefvorlage);
|
|
||||||
lineNr += 2;
|
lineNr += 2;
|
||||||
|
tableTop = SpacingOne * lineNr;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/// This appears on the top of the 2nd and every subsequent page.
|
||||||
|
/// 2nd table starts from the top of the page.
|
||||||
|
lineNr -= 3;
|
||||||
|
|
||||||
if (compound)
|
if (compound)
|
||||||
{
|
{
|
||||||
@@ -189,228 +315,294 @@ namespace Results.Output.Printers.Munich
|
|||||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Seriennummer :");
|
PrintAt(e, Tab3, lineNr * SpacingOne, "Seriennummer :");
|
||||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.SerialNrAux);
|
PrintAt(e, Tab4, lineNr * SpacingOne, wm.SerialNrAux);
|
||||||
}
|
}
|
||||||
lineNr++;
|
lineNr += ((resultsCount + 2) * SpacingOneAndHalf) / SpacingOne + 2;
|
||||||
|
|
||||||
PrintAt(e, Tab1, lineNr * SpacingOne, wm.NewQnames() ? "Q3 :" : "Qn :");
|
tableTop = TitleY + (compound ? 5 : 4) * SpacingOne;
|
||||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Q3_Qn().ToString());
|
|
||||||
if (compound)
|
|
||||||
{
|
|
||||||
PrintAt(e, Tab3, lineNr * SpacingOne, wm.NewQnames() ? "Q3 :" : "Qn :");
|
|
||||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.Q3_Qn_Aux().ToString());
|
|
||||||
}
|
|
||||||
lineNr++;
|
|
||||||
|
|
||||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Zulassungszeichen :");
|
|
||||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.ApprovalInfo());
|
|
||||||
if (compound)
|
|
||||||
{
|
|
||||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Zulassungszeichen :");
|
|
||||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.ApprovalInfoAux());
|
|
||||||
}
|
|
||||||
lineNr++;
|
|
||||||
|
|
||||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Metr. klasse :");
|
|
||||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.MetrologicalClass());
|
|
||||||
if (compound)
|
|
||||||
{
|
|
||||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Metr. klasse :");
|
|
||||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.MetrologicalClassAux());
|
|
||||||
}
|
|
||||||
lineNr++;
|
|
||||||
|
|
||||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Stand :");
|
|
||||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.EndState);
|
|
||||||
if (compound)
|
|
||||||
{
|
|
||||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Stand :");
|
|
||||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.EndStateAux);
|
|
||||||
|
|
||||||
lineNr += 2;
|
|
||||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Umschaltpunkte :");
|
|
||||||
lineNr++;
|
|
||||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Qsteig");
|
|
||||||
PrintAt(e, Tab2, lineNr * SpacingOne, (1000.0 * wm.QRise).ToString("F1") + " l/h");
|
|
||||||
lineNr++;
|
|
||||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Qfall");
|
|
||||||
PrintAt(e, Tab2, lineNr * SpacingOne, (1000.0 * wm.QFall).ToString("F1") + " l/h");
|
|
||||||
}
|
|
||||||
|
|
||||||
lineNr += 2;
|
|
||||||
firstTblTop = SpacingOne * lineNr;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Table 1
|
|
||||||
///
|
|
||||||
PrintTableOne(e, firstTblTop);
|
|
||||||
DrawTableFrame(e, resultsCount + 1, firstTblTop);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (firstTblRowsOnPage[pageNr - 1] > 0)
|
||||||
|
{
|
||||||
|
int from = 0;
|
||||||
|
for (int pN = 0; pN < pageNr - 1; pN++) from += firstTblRowsOnPage[pN];
|
||||||
|
Table table1 = PrepareTableOne(from, from + firstTblRowsOnPage[pageNr - 1] - 1);
|
||||||
|
tableTop = table1.Draw(e, Tab1, tableTop) + SpacingOneAndHalf;
|
||||||
|
}
|
||||||
|
|
||||||
if (pageNr == nrPages)
|
|
||||||
{
|
|
||||||
if (pageNr == 1)
|
|
||||||
{
|
|
||||||
secondTblTop = firstTblTop + (resultsCount + 2) * SpacingOneAndHalf;
|
|
||||||
lineNr += ((resultsCount + 2) * SpacingOneAndHalf * 2) / SpacingOne;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lineNr -= 3;
|
|
||||||
|
|
||||||
if (compound)
|
if (secondTblRowsOnPage[pageNr - 1] > 0)
|
||||||
{
|
{
|
||||||
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Hauptzahler");
|
int from = 0;
|
||||||
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Nebenzahler");
|
for (int pN = 0; pN < pageNr - 1; pN++) from += secondTblRowsOnPage[pN];
|
||||||
lineNr++;
|
Table table2 = PrepareTableTwo(from, from + secondTblRowsOnPage[pageNr - 1] - 1);
|
||||||
}
|
tableTop = table2.Draw(e, Tab1, tableTop) + SpacingOneAndHalf;
|
||||||
|
}
|
||||||
|
|
||||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Hersteller :");
|
if (pageNr == nrPages)
|
||||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Producer());
|
{
|
||||||
if (compound)
|
int top = topMargin + printHeight - 8 * SpacingOne;
|
||||||
{
|
DrawCommonBottom(e, top, wm);
|
||||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Hersteller :");
|
}
|
||||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.ProducerAux());
|
else
|
||||||
}
|
{
|
||||||
lineNr++;
|
e.HasMorePages = true;
|
||||||
|
}
|
||||||
|
|
||||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Seriennummer :");
|
///
|
||||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.SerialNr);
|
/// Draw a footer and increment the page number
|
||||||
if (compound)
|
///
|
||||||
{
|
string pageNrText = string.Format("{0} {1}/{2}", Strings.Page, pageNr++, nrPages);
|
||||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Seriennummer :");
|
int pageNrWidth = (int)e.Graphics.MeasureString(pageNrText, font).Width;
|
||||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.SerialNrAux);
|
PrintAt(e, leftMargin + (printWidth - pageNrWidth) / 2, topMargin + printHeight - SpacingOne, pageNrText);
|
||||||
}
|
}
|
||||||
lineNr += ((resultsCount + 2) * SpacingOneAndHalf) / SpacingOne + 2;
|
|
||||||
|
|
||||||
secondTblTop = TitleY + (compound ? 5 : 4) * SpacingOne;
|
|
||||||
}
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Table 2
|
|
||||||
///
|
|
||||||
PrintTableTwo(e, secondTblTop);
|
|
||||||
DrawTableFrame(e, resultsCount + 1, secondTblTop);
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Footer
|
|
||||||
///
|
|
||||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Temperatur");
|
|
||||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbTempMean().ToString("F1") + " \x00b0C");
|
|
||||||
lineNr++;
|
|
||||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Feuchtigkeit");
|
|
||||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbHumiMean().ToString("F0") + " %");
|
|
||||||
lineNr++;
|
|
||||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Luftdruck");
|
|
||||||
PrintAt(e, Tab2, lineNr * SpacingOne, Config.Units.ConvertTo(Config.Unit.mbar, wm.Batch.AmbPressMean()).ToString("F0") + " mbar");
|
|
||||||
|
|
||||||
lineNr++;
|
|
||||||
PrintAt(e, Tab3, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
|
|
||||||
lineNr++;
|
|
||||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Datum");
|
|
||||||
PrintAt(e, Tab4, lineNr * SpacingOne, "Unterschrift");
|
|
||||||
}
|
|
||||||
|
|
||||||
e.HasMorePages = (pageNr != nrPages);
|
|
||||||
pageNr++;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Print table texts.
|
/// Prepares content and style of the first table.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void PrintTableOne(System.Drawing.Printing.PrintPageEventArgs e, int tblTop)
|
/// <param name="from">0-based index fo the first result to print</param>
|
||||||
|
/// <param name="to">0-based index fo the last result to print</param>
|
||||||
|
/// <returns>Prepared table</returns>
|
||||||
|
Table PrepareTableOne(int from = 0, int to = int.MaxValue)
|
||||||
{
|
{
|
||||||
PrintAt(e, GetTabItemPos(0, 0, tblTop), "Prüflauf");
|
Table table = new Table(7);
|
||||||
PrintAt(e, GetTabItemPos(0, 1, tblTop), "Q [l/h]");
|
table.Style = tableStyle;
|
||||||
PrintAt(e, GetTabItemPos(0, 2, tblTop), "Prüf-Vol.[l]");
|
|
||||||
PrintAt(e, GetTabItemPos(0, 3, tblTop), compound ? "HZ-Vol.[l]" : "Z-Vol.[l]");
|
|
||||||
PrintAt(e, GetTabItemPos(0, 4, tblTop), compound ? "NZ-Vol.[l]" : "-");
|
|
||||||
PrintAt(e, GetTabItemPos(0, 5, tblTop), "Fehler [%]");
|
|
||||||
PrintAt(e, GetTabItemPos(0, 6, tblTop), "Ergebnis");
|
|
||||||
|
|
||||||
int rowCnt = 1;
|
string[] tableHeader = new string[]
|
||||||
|
{
|
||||||
|
"Prüflauf",
|
||||||
|
"Q [l/h]",
|
||||||
|
"Prüf-Vol.[l]",
|
||||||
|
compound ? "HZ-Vol.[l]" : "Z-Vol.[l]",
|
||||||
|
compound ? "NZ-Vol.[l]" : "-",
|
||||||
|
"Fehler [%]",
|
||||||
|
"Ergebnis",
|
||||||
|
};
|
||||||
|
table.AddRow(tableHeader, horizontalAlignment, verticalAlignment);
|
||||||
|
|
||||||
|
int rowCount = 0;
|
||||||
foreach (var mtr in wm.MeterTestRslts)
|
foreach (var mtr in wm.MeterTestRslts)
|
||||||
{
|
{
|
||||||
if (!compound || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
|
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
|
||||||
{
|
{
|
||||||
PrintAt(e, GetTabItemPos(rowCnt, 0, tblTop), mtr.Name());
|
if (from <= rowCount && rowCount <= to)
|
||||||
PrintAt(e, GetTabItemPos(rowCnt, 1, tblTop), mtr.TestRslt.FlowMass.ToString("F1"));
|
{
|
||||||
PrintAt(e, GetTabItemPos(rowCnt, 2, tblTop), mtr.TestRslt.VolumeCTV.ToString("F2"));
|
double flow_ctv = (mtr.TestRslt.TestTime != 0) ? (3.6 * mtr.TestRslt.VolumeCTV / mtr.TestRslt.TestTime) : 0;
|
||||||
if (compound)
|
|
||||||
{
|
|
||||||
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
|
|
||||||
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
|
|
||||||
|
|
||||||
PrintAt(e, GetTabItemPos(rowCnt, 3, tblTop), mainMtr.VolumeMeter.ToString("F2"));
|
if (compound)
|
||||||
PrintAt(e, GetTabItemPos(rowCnt, 4, tblTop), auxMtr.VolumeMeter.ToString("F2"));
|
{
|
||||||
PrintAt(e, GetTabItemPos(rowCnt, 5, tblTop), mtr.Error.ToString("F2"));
|
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
|
||||||
PrintAt(e, GetTabItemPos(rowCnt, 6, tblTop), mtr.Passed ? "iO" : "NiO");
|
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
PrintAt(e, GetTabItemPos(rowCnt, 3, tblTop), mtr.VolumeMeter.ToString("F2"));
|
|
||||||
PrintAt(e, GetTabItemPos(rowCnt, 4, tblTop), "-");
|
|
||||||
PrintAt(e, GetTabItemPos(rowCnt, 5, tblTop), mtr.Error.ToString("F2"));
|
|
||||||
PrintAt(e, GetTabItemPos(rowCnt, 6, tblTop), mtr.Passed ? "iO" : "NiO");
|
|
||||||
}
|
|
||||||
|
|
||||||
rowCnt++;
|
table.AddRow(new string[] { mtr.Name(),
|
||||||
|
Config.Units.ConvertTo(Config.Unit.lph, flow_ctv).ToString("F1"),
|
||||||
|
mtr.TestRslt.VolumeCTV.ToString("F2"),
|
||||||
|
mainMtr.VolumeMeter.ToString("F2"),
|
||||||
|
auxMtr.VolumeMeter.ToString("F2"),
|
||||||
|
mtr.Error.ToString("F2"),
|
||||||
|
mtr.Passed ? "iO" : "NiO" },
|
||||||
|
horizontalAlignment,
|
||||||
|
verticalAlignment);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
table.AddRow(new string[] { mtr.Name(),
|
||||||
|
Config.Units.ConvertTo(Config.Unit.lph, flow_ctv).ToString("F1"),
|
||||||
|
mtr.TestRslt.VolumeCTV.ToString("F2"),
|
||||||
|
mtr.VolumeMeter.ToString("F2"),
|
||||||
|
"-",
|
||||||
|
mtr.Error.ToString("F2"),
|
||||||
|
mtr.Passed ? "iO" : "NiO" },
|
||||||
|
|
||||||
|
horizontalAlignment,
|
||||||
|
verticalAlignment);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rowCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return table;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintTableTwo(System.Drawing.Printing.PrintPageEventArgs e, int tblTop)
|
/// <summary>
|
||||||
|
/// Prepares content and style of the second table.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="from">0-based index fo the first result to print</param>
|
||||||
|
/// <param name="to">0-based index fo the last result to print</param>
|
||||||
|
/// <returns>Prepared table</returns>
|
||||||
|
Table PrepareTableTwo(int from = 0, int to = int.MaxValue)
|
||||||
{
|
{
|
||||||
PrintAt(e, GetTabItemPos(0, 1, tblTop), "Q [l/h]");
|
Table table = new Table(7);
|
||||||
PrintAt(e, GetTabItemPos(0, 2, tblTop), "Temperatur");
|
table.Style = tableStyle;
|
||||||
PrintAt(e, GetTabItemPos(0, 3, tblTop), "Dichte");
|
|
||||||
PrintAt(e, GetTabItemPos(0, 4, tblTop), "Prüfzeit");
|
|
||||||
PrintAt(e, GetTabItemPos(0, 5, tblTop), "Druck Eing.");
|
|
||||||
PrintAt(e, GetTabItemPos(0, 6, tblTop), "Druck Ausg.");
|
|
||||||
|
|
||||||
int rowCnt = 1;
|
string[] tableHeader = new string[]
|
||||||
|
{
|
||||||
|
"",
|
||||||
|
"Q [l/h]",
|
||||||
|
"Temperatur",
|
||||||
|
"Dichte",
|
||||||
|
"Prüfzeit",
|
||||||
|
"Druck Eing.",
|
||||||
|
"Druck Ausg.",
|
||||||
|
};
|
||||||
|
table.AddRow(tableHeader, horizontalAlignment, verticalAlignment);
|
||||||
|
|
||||||
|
int rowCount = 0;
|
||||||
foreach (var mtr in wm.MeterTestRslts)
|
foreach (var mtr in wm.MeterTestRslts)
|
||||||
{
|
{
|
||||||
if (!compound || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
|
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
|
||||||
{
|
{
|
||||||
Point p = GetTabItemPos(rowCnt, 0, tblTop);
|
if (from <= rowCount && rowCount <= to)
|
||||||
PrintAt(e, p.X, p.Y, mtr.Name());
|
{
|
||||||
|
double flow_ctv = (mtr.TestRslt.TestTime != 0) ? (3.6 * mtr.TestRslt.VolumeCTV / mtr.TestRslt.TestTime) : 0;
|
||||||
|
|
||||||
PrintAt(e, GetTabItemPos(rowCnt, 1, tblTop), mtr.TestRslt.FlowMass.ToString("F1"));
|
table.AddRow(new string[] { mtr.Name(),
|
||||||
PrintAt(e, GetTabItemPos(rowCnt, 2, tblTop), mtr.TestRslt.TempDownMean.ToString("F2"));
|
Config.Units.ConvertTo(Config.Unit.lph, flow_ctv).ToString("F1"),
|
||||||
PrintAt(e, GetTabItemPos(rowCnt, 3, tblTop), mtr.TestRslt.DensityDiv.ToString("F2"));
|
mtr.TestRslt.TempDownMean.ToString("F2"),
|
||||||
PrintAt(e, GetTabItemPos(rowCnt, 4, tblTop), mtr.TestTime.ToString("F1"));
|
mtr.TestRslt.DensityDiv.ToString("F2"),
|
||||||
PrintAt(e, GetTabItemPos(rowCnt, 5, tblTop), Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressUpMean).ToString("F3"));
|
mtr.TestTime.ToString("F1"),
|
||||||
PrintAt(e, GetTabItemPos(rowCnt, 6, tblTop), Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressDownMean).ToString("F3"));
|
Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressUpMean).ToString("F3"),
|
||||||
|
Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressDownMean).ToString("F3") },
|
||||||
rowCnt++;
|
horizontalAlignment,
|
||||||
}
|
verticalAlignment);
|
||||||
|
}
|
||||||
|
rowCount++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return table;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Draw table lines.
|
/// Prints text on the top of the first page (title, common information).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void DrawTableFrame(System.Drawing.Printing.PrintPageEventArgs e, int rowsCount, int tblTop)
|
/// <param name="e"></param>
|
||||||
{
|
/// <param name="lineNr"></param>
|
||||||
int t = tblTop;
|
/// <param name="wm"></param>
|
||||||
int m = tblTop + SpacingOneAndHalf;
|
/// <param name="pruefvorlage"></param>
|
||||||
int b = tblTop + rowsCount * SpacingOneAndHalf;
|
/// <param name="docVersion"></param>
|
||||||
|
void DrawCommonTop(PrintPageEventArgs e, ref int lineNr, Entities.WaterMeter wm, string pruefvorlage, string docVersion)
|
||||||
|
{
|
||||||
|
///
|
||||||
|
///
|
||||||
|
///
|
||||||
|
PrintAt(e, Tab1, lineNr * SpacingOne, docVersion);
|
||||||
|
lineNr++;
|
||||||
|
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Prüfstand Nr :");
|
||||||
|
PrintBoldAt(e, Tab2, lineNr * SpacingOne, wm.BenchId().ToString());
|
||||||
|
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Datum :");
|
||||||
|
PrintBoldAt(e, Tab4, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
|
||||||
|
lineNr++;
|
||||||
|
PrintAt(e, Tab1, lineNr * SpacingOne, "Zählertyp :");
|
||||||
|
PrintAt(e, Tab2, lineNr * SpacingOne, zaehlertyp);
|
||||||
|
PrintAt(e, Tab3, lineNr * SpacingOne, "Eichjahr :");
|
||||||
|
PrintAt(e, Tab4, lineNr * SpacingOne, wm.YearOfProduction.ToString());
|
||||||
|
lineNr++;
|
||||||
|
PrintAt(e, Tab1, lineNr * SpacingOne, "Prüfvorlage :");
|
||||||
|
PrintAt(e, Tab2, lineNr * SpacingOne, pruefvorlage);
|
||||||
|
lineNr += 2;
|
||||||
|
|
||||||
// Horizontal lines
|
if (compound)
|
||||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, t), new Point(747, t));
|
{
|
||||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, m), new Point(747, m));
|
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Hauptzahler");
|
||||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, b), new Point(747, b));
|
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Nebenzahler");
|
||||||
|
lineNr++;
|
||||||
|
}
|
||||||
|
|
||||||
// Vertical lines
|
PrintAt(e, Tab1, lineNr * SpacingOne, "Hersteller :");
|
||||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point( 80, t), new Point( 80, b));
|
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Producer());
|
||||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(267, t), new Point(267, b));
|
if (compound)
|
||||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(347, t), new Point(347, b));
|
{
|
||||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(427, t), new Point(427, b));
|
PrintAt(e, Tab3, lineNr * SpacingOne, "Hersteller :");
|
||||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(507, t), new Point(507, b));
|
PrintAt(e, Tab4, lineNr * SpacingOne, wm.ProducerAux());
|
||||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(587, t), new Point(587, b));
|
}
|
||||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(667, t), new Point(667, b));
|
lineNr++;
|
||||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(747, t), new Point(747, b));
|
|
||||||
}
|
PrintAt(e, Tab1, lineNr * SpacingOne, "Seriennummer :");
|
||||||
|
PrintAt(e, Tab2, lineNr * SpacingOne, wm.SerialNr);
|
||||||
|
if (compound)
|
||||||
|
{
|
||||||
|
PrintAt(e, Tab3, lineNr * SpacingOne, "Seriennummer :");
|
||||||
|
PrintAt(e, Tab4, lineNr * SpacingOne, wm.SerialNrAux);
|
||||||
|
}
|
||||||
|
lineNr++;
|
||||||
|
|
||||||
|
PrintAt(e, Tab1, lineNr * SpacingOne, wm.NewQnames() ? "Q3 :" : "Qn :");
|
||||||
|
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Q3_Qn().ToString());
|
||||||
|
if (compound)
|
||||||
|
{
|
||||||
|
PrintAt(e, Tab3, lineNr * SpacingOne, wm.NewQnames() ? "Q3 :" : "Qn :");
|
||||||
|
PrintAt(e, Tab4, lineNr * SpacingOne, wm.Q3_Qn_Aux().ToString());
|
||||||
|
}
|
||||||
|
lineNr++;
|
||||||
|
|
||||||
|
PrintAt(e, Tab1, lineNr * SpacingOne, "Zulassungszeichen :");
|
||||||
|
PrintAt(e, Tab2, lineNr * SpacingOne, wm.ApprovalInfo());
|
||||||
|
if (compound)
|
||||||
|
{
|
||||||
|
PrintAt(e, Tab3, lineNr * SpacingOne, "Zulassungszeichen :");
|
||||||
|
PrintAt(e, Tab4, lineNr * SpacingOne, wm.ApprovalInfoAux());
|
||||||
|
}
|
||||||
|
lineNr++;
|
||||||
|
|
||||||
|
PrintAt(e, Tab1, lineNr * SpacingOne, "Metr. klasse :");
|
||||||
|
PrintAt(e, Tab2, lineNr * SpacingOne, wm.MetrologicalClass());
|
||||||
|
if (compound)
|
||||||
|
{
|
||||||
|
PrintAt(e, Tab3, lineNr * SpacingOne, "Metr. klasse :");
|
||||||
|
PrintAt(e, Tab4, lineNr * SpacingOne, wm.MetrologicalClassAux());
|
||||||
|
}
|
||||||
|
lineNr++;
|
||||||
|
|
||||||
|
PrintAt(e, Tab1, lineNr * SpacingOne, "Stand :");
|
||||||
|
PrintAt(e, Tab2, lineNr * SpacingOne, wm.EndState);
|
||||||
|
if (compound)
|
||||||
|
{
|
||||||
|
PrintAt(e, Tab3, lineNr * SpacingOne, "Stand :");
|
||||||
|
PrintAt(e, Tab4, lineNr * SpacingOne, wm.EndStateAux);
|
||||||
|
|
||||||
|
lineNr += 2;
|
||||||
|
PrintAt(e, Tab1, lineNr * SpacingOne, "Umschaltpunkte :");
|
||||||
|
lineNr++;
|
||||||
|
PrintAt(e, Tab1, lineNr * SpacingOne, "Qsteig");
|
||||||
|
PrintAt(e, Tab2, lineNr * SpacingOne, (1000.0 * wm.QRise).ToString("F1") + " l/h");
|
||||||
|
lineNr++;
|
||||||
|
PrintAt(e, Tab1, lineNr * SpacingOne, "Qfall");
|
||||||
|
PrintAt(e, Tab2, lineNr * SpacingOne, (1000.0 * wm.QFall).ToString("F1") + " l/h");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Prints text at the bottom of the last page (footer).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
/// <param name="lineNr"></param>
|
||||||
|
/// <param name="wm"></param>
|
||||||
|
void DrawCommonBottom(PrintPageEventArgs e, float top, Entities.WaterMeter wm)
|
||||||
|
{
|
||||||
|
int iTop = (int)top;
|
||||||
|
|
||||||
|
PrintAt(e, Tab1, iTop, "Temperatur");
|
||||||
|
PrintAt(e, Tab2, iTop, wm.Batch.AmbTempMean().ToString("F1") + " \x00b0C");
|
||||||
|
|
||||||
|
iTop += SpacingOne;
|
||||||
|
|
||||||
|
PrintAt(e, Tab1, iTop, "Feuchtigkeit");
|
||||||
|
PrintAt(e, Tab2, iTop, wm.Batch.AmbHumiMean().ToString("F0") + " %");
|
||||||
|
|
||||||
|
iTop += SpacingOne;
|
||||||
|
|
||||||
|
PrintAt(e, Tab1, iTop, "Luftdruck");
|
||||||
|
PrintAt(e, Tab2, iTop, Config.Units.ConvertTo(Config.Unit.mbar, wm.Batch.AmbPressMean()).ToString("F0") + " mbar");
|
||||||
|
|
||||||
|
iTop += SpacingOne;
|
||||||
|
|
||||||
|
PrintAt(e, Tab3, iTop, wm.Batch.EndTime.Date.ToString("d"));
|
||||||
|
|
||||||
|
iTop += SpacingOne;
|
||||||
|
|
||||||
|
PrintAt(e, Tab3, iTop, "Datum");
|
||||||
|
PrintAt(e, Tab4, iTop, "Unterschrift");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text)
|
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text)
|
||||||
@@ -434,18 +626,5 @@ namespace Results.Output.Printers.Munich
|
|||||||
RectangleF printArea = new RectangleF(x, y, 667, SpacingOne);
|
RectangleF printArea = new RectangleF(x, y, 667, SpacingOne);
|
||||||
e.Graphics.DrawString(text, this.boldFont, Brushes.Black, printArea);
|
e.Graphics.DrawString(text, this.boldFont, Brushes.Black, printArea);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get text position form a number of the test and a number of the parameter.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="row"></param>
|
|
||||||
/// <param name="column">Table column (0-based)</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Point GetTabItemPos(int row, int column, int tblTop)
|
|
||||||
{
|
|
||||||
int x = MarginLeft + ((column == 0) ? 80 : 187) + column * 80; /// leftmost column is wider
|
|
||||||
int y = MarginTop + tblTop + (row * SpacingOneAndHalf) - 2;
|
|
||||||
return new Point(x, y);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,11 +29,7 @@ namespace Results.Output.Printers.OnePerMeter
|
|||||||
readonly int spacingOne;
|
readonly int spacingOne;
|
||||||
readonly int spacingOne4Header;
|
readonly int spacingOne4Header;
|
||||||
|
|
||||||
float commonTop; /// = TitleY + 60
|
float titleHeight;
|
||||||
float bodyTop; /// = HdrTop + 160
|
|
||||||
///
|
|
||||||
float titleHeight;
|
|
||||||
float commonHeight;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Property variable for the Font the user wishes to use
|
/// Property variable for the Font the user wishes to use
|
||||||
@@ -54,9 +50,14 @@ namespace Results.Output.Printers.OnePerMeter
|
|||||||
/// Items to print
|
/// Items to print
|
||||||
///
|
///
|
||||||
string header;
|
string header;
|
||||||
IList<WMeterRsltItemSpec> commonItems;
|
IList<WMeterRsltItemSpec> commonItems1;
|
||||||
|
IList<WMeterRsltItemSpec> commonItems2;
|
||||||
|
IList<WMeterRsltItemSpec> commonItems3;
|
||||||
IList<WMeterRsltItemSpec> testItems;
|
IList<WMeterRsltItemSpec> testItems;
|
||||||
IList<WMeterRsltItemSpec> testItems2;
|
IList<WMeterRsltItemSpec> testItems2;
|
||||||
|
IList<WMeterRsltItemSpec> belowItems1;
|
||||||
|
IList<WMeterRsltItemSpec> belowItems2;
|
||||||
|
IList<WMeterRsltItemSpec> belowItems3;
|
||||||
string footer;
|
string footer;
|
||||||
|
|
||||||
int nrPages;
|
int nrPages;
|
||||||
@@ -78,9 +79,14 @@ namespace Results.Output.Printers.OnePerMeter
|
|||||||
leftMargin = cfg.LeftMargin;
|
leftMargin = cfg.LeftMargin;
|
||||||
|
|
||||||
header = string.IsNullOrEmpty(cfg.Header) ? string.Empty : cfg.Header.Replace("~", Environment.NewLine);
|
header = string.IsNullOrEmpty(cfg.Header) ? string.Empty : cfg.Header.Replace("~", Environment.NewLine);
|
||||||
commonItems = Results.WMeterRsltItemSpec.FromStrArray(cfg.CommonItems);
|
commonItems1 = Results.WMeterRsltItemSpec.FromStrArray(cfg.CommonItems1);
|
||||||
testItems = Results.WMeterRsltItemSpec.FromStrArray(cfg.TestItems); /// TestID info will be overwritten later on
|
commonItems2 = Results.WMeterRsltItemSpec.FromStrArray(cfg.CommonItems2);
|
||||||
|
commonItems3 = Results.WMeterRsltItemSpec.FromStrArray(cfg.CommonItems3);
|
||||||
|
testItems = Results.WMeterRsltItemSpec.FromStrArray(cfg.TestItems); /// TestID info will be overwritten later on
|
||||||
testItems2 = Results.WMeterRsltItemSpec.FromStrArray(cfg.TestItems2); /// TestID info will be overwritten later on
|
testItems2 = Results.WMeterRsltItemSpec.FromStrArray(cfg.TestItems2); /// TestID info will be overwritten later on
|
||||||
|
belowItems1 = Results.WMeterRsltItemSpec.FromStrArray(cfg.BelowItems1);
|
||||||
|
belowItems2 = Results.WMeterRsltItemSpec.FromStrArray(cfg.BelowItems2);
|
||||||
|
belowItems3 = Results.WMeterRsltItemSpec.FromStrArray(cfg.BelowItems3);
|
||||||
footer = string.IsNullOrEmpty(cfg.Footer) ? string.Empty : cfg.Footer.Replace("~", Environment.NewLine);
|
footer = string.IsNullOrEmpty(cfg.Footer) ? string.Empty : cfg.Footer.Replace("~", Environment.NewLine);
|
||||||
|
|
||||||
/// Initialize fonts
|
/// Initialize fonts
|
||||||
@@ -146,8 +152,12 @@ namespace Results.Output.Printers.OnePerMeter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float tableTop = cfg.TopMargin;
|
||||||
|
|
||||||
if (pageNr == 1)
|
if (pageNr == 1)
|
||||||
{
|
{
|
||||||
|
/// First page
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Print water meter picture
|
/// Print water meter picture
|
||||||
///
|
///
|
||||||
@@ -168,66 +178,156 @@ namespace Results.Output.Printers.OnePerMeter
|
|||||||
e.Graphics.DrawString(header, titleFont, Brushes.Black, printArea);
|
e.Graphics.DrawString(header, titleFont, Brushes.Black, printArea);
|
||||||
|
|
||||||
titleHeight = System.Windows.Forms.TextRenderer.MeasureText(header, titleFont).Height;
|
titleHeight = System.Windows.Forms.TextRenderer.MeasureText(header, titleFont).Height;
|
||||||
commonTop = TitleY + titleHeight + spacingOne4Header;
|
float commonTop = TitleY + titleHeight;
|
||||||
|
|
||||||
|
///----------------
|
||||||
|
/// Common items
|
||||||
|
///----------------
|
||||||
|
commonTop += spacingOne4Header; /// Space above common part
|
||||||
|
float leftMarginCommon1 = leftMargin + printWidth * 0.01f * cfg.ColW0Pct;
|
||||||
|
float leftMarginCommon2 = leftMargin + printWidth * 0.01f * (cfg.ColW0Pct + cfg.ColW1Pct);
|
||||||
|
float leftMarginCommon3 = leftMargin + printWidth * 0.01f * (cfg.ColW0Pct + cfg.ColW1Pct + cfg.ColW2Pct);
|
||||||
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Common items
|
|
||||||
///
|
|
||||||
Table table = new Table(2);
|
|
||||||
table.Style = new TableStyle { Font = font, MarginX = 5, MarginY = 3 };
|
|
||||||
Alignment[] horizAlgn = new Alignment[] { Alignment.Left, Alignment.Left };
|
Alignment[] horizAlgn = new Alignment[] { Alignment.Left, Alignment.Left };
|
||||||
VertAlignment[] vertAlgn = new VertAlignment[] { VertAlignment.Top, VertAlignment.Top };
|
VertAlignment[] vertAlgn = new VertAlignment[] { VertAlignment.Top, VertAlignment.Top };
|
||||||
///
|
TableStyle commonTableStyle = new TableStyle { Font = font, MarginX = 5, MarginY = 3 };
|
||||||
foreach (var v in commonItems)
|
|
||||||
{
|
|
||||||
string[] row = new string[] { v.Caption, (batch.WaterMeters.Count > 0) ? v.Print(batch.WaterMeters[0]) : string.Empty };
|
|
||||||
table.AddRow(row, horizAlgn, vertAlgn);
|
|
||||||
}
|
|
||||||
|
|
||||||
bodyTop = table.Draw(e, (float)leftMargin, commonTop) + spacingOne4Header;
|
Table table1 = new Table(2) { Style = commonTableStyle };
|
||||||
|
foreach (var item in commonItems1)
|
||||||
|
{
|
||||||
|
string[] row = new string[] { item.Caption, item.Print(wm).Split(new char[] { '|' })[0] };
|
||||||
|
table1.AddRow(row, horizAlgn, vertAlgn);
|
||||||
|
}
|
||||||
|
float bodyTop1 = table1.Draw(e, leftMarginCommon1, commonTop);
|
||||||
|
|
||||||
|
|
||||||
|
table1 = new Table(2) { Style = commonTableStyle };
|
||||||
|
foreach (var item in commonItems2)
|
||||||
|
{
|
||||||
|
string[] row = new string[] { item.Caption, item.Print(wm).Split(new char[] { '|' })[0] };
|
||||||
|
table1.AddRow(row, horizAlgn, vertAlgn);
|
||||||
|
}
|
||||||
|
float bodyTop2 = table1.Draw(e, leftMarginCommon2, commonTop);
|
||||||
|
|
||||||
|
|
||||||
|
table1 = new Table(2) { Style = commonTableStyle };
|
||||||
|
foreach (var item in commonItems3)
|
||||||
|
{
|
||||||
|
string[] row = new string[] { item.Caption, item.Print(wm).Split(new char[] { '|' })[0] };
|
||||||
|
table1.AddRow(row, horizAlgn, vertAlgn);
|
||||||
|
}
|
||||||
|
float bodyTop3 = table1.Draw(e, leftMarginCommon3, commonTop);
|
||||||
|
|
||||||
|
float bodyTop12 = (bodyTop1 > bodyTop2) ? bodyTop1 : bodyTop2;
|
||||||
|
tableTop = (bodyTop12 > bodyTop3) ? bodyTop12 : bodyTop3; /// Max. of all three bodyTop-s
|
||||||
|
tableTop += spacingOne4Header; /// Space between the common part and the table
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Draw table
|
/// Draw table (on the 1st, as well as on the 2nd page)
|
||||||
///
|
///
|
||||||
if (cfg.TestsAreRows)
|
float belowTop;
|
||||||
|
TableStyle style;
|
||||||
|
Table table;
|
||||||
|
switch (cfg.Form)
|
||||||
{
|
{
|
||||||
TableStyle style = new TableStyle
|
default:
|
||||||
{
|
case TableForm.Rows:
|
||||||
Font = font,
|
|
||||||
HeaderFont = headerFont,
|
|
||||||
MarginX = 5,
|
|
||||||
MarginY = 3,
|
|
||||||
LineWidth = 1,
|
|
||||||
TopHeadersCount = 1,
|
|
||||||
HorizLines = TableLines.All,
|
|
||||||
VertLines = TableLines.FirstSecondAndLast
|
|
||||||
};
|
|
||||||
|
|
||||||
GetTable_TestsAreRows(wm, (pageNr == 1) ? testItems : testItems2, style).Draw(e, (float)leftMargin, bodyTop);
|
style = new TableStyle
|
||||||
}
|
{
|
||||||
else
|
Font = font,
|
||||||
{
|
HeaderFont = headerFont,
|
||||||
TableStyle style = new TableStyle
|
MarginX = 5,
|
||||||
{
|
MarginY = 3,
|
||||||
Font = font,
|
LineWidth = 1,
|
||||||
HeaderFont = headerFont,
|
TopHeadersCount = 1,
|
||||||
MarginX = 5,
|
HorizLines = TableLines.All,
|
||||||
MarginY = 3,
|
VertLines = TableLines.All
|
||||||
LineWidth = 1,
|
};
|
||||||
LeftHeadersCount = 1,
|
table = Table.Create_TestsAreRows(wm, (pageNr == 1) ? testItems : testItems2, style);
|
||||||
HorizLines = TableLines.FirstSecondAndLast,
|
break;
|
||||||
VertLines = TableLines.All
|
|
||||||
};
|
|
||||||
|
|
||||||
GetTable_TestsAreColumns(wm, (pageNr == 1) ? testItems : testItems2, style).Draw(e, (float)leftMargin, bodyTop);
|
case TableForm.Columns:
|
||||||
|
|
||||||
|
style = new TableStyle
|
||||||
|
{
|
||||||
|
Font = font,
|
||||||
|
HeaderFont = headerFont,
|
||||||
|
MarginX = 5,
|
||||||
|
MarginY = 3,
|
||||||
|
LineWidth = 1,
|
||||||
|
LeftHeadersCount = 1,
|
||||||
|
HorizLines = TableLines.FirstSecondAndLast,
|
||||||
|
VertLines = TableLines.All
|
||||||
|
};
|
||||||
|
table = Table.Create_TestsAreColumns(wm, (pageNr == 1) ? testItems : testItems2, style);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TableForm.ColumnsPL:
|
||||||
|
|
||||||
|
style = new TableStyle
|
||||||
|
{
|
||||||
|
Font = font,
|
||||||
|
HeaderFont = headerFont,
|
||||||
|
MarginX = 5,
|
||||||
|
MarginY = 3,
|
||||||
|
LineWidth = 1,
|
||||||
|
TopHeadersCount = 1,
|
||||||
|
HorizLines = TableLines.FirstSecondAndLast,
|
||||||
|
VertLines = TableLines.All
|
||||||
|
};
|
||||||
|
table = Table.Create_TestsAreColumnsPL(wm, (pageNr == 1) ? testItems : testItems2, style);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SizeF size = table.Measure(e);
|
||||||
|
float tableLeft = (float)leftMargin + ((float)printWidth - size.Width) / 2;
|
||||||
|
belowTop = table.Draw(e, tableLeft, tableTop);
|
||||||
|
|
||||||
if (pageNr == nrPages)
|
if (pageNr == nrPages)
|
||||||
{
|
{
|
||||||
///
|
///----------------
|
||||||
|
/// Common items
|
||||||
|
///----------------
|
||||||
|
belowTop += spacingOne4Header; /// Space between the table and the bottom common part
|
||||||
|
float leftMarginBelow1 = leftMargin + printWidth * 0.01f * cfg.BelowW0Pct;
|
||||||
|
float leftMarginBelow2 = leftMargin + printWidth * 0.01f * (cfg.BelowW0Pct + cfg.BelowW1Pct);
|
||||||
|
float leftMarginBelow3 = leftMargin + printWidth * 0.01f * (cfg.BelowW0Pct + cfg.BelowW1Pct + cfg.BelowW2Pct);
|
||||||
|
|
||||||
|
Alignment[] horizAlgn = new Alignment[] { Alignment.Left, Alignment.Left };
|
||||||
|
VertAlignment[] vertAlgn = new VertAlignment[] { VertAlignment.Top, VertAlignment.Top };
|
||||||
|
TableStyle commonTableStyle = new TableStyle { Font = font, MarginX = 5, MarginY = 3 };
|
||||||
|
|
||||||
|
Table table2 = new Table(2) { Style = commonTableStyle };
|
||||||
|
foreach (var item in belowItems1)
|
||||||
|
{
|
||||||
|
string[] row = new string[] { item.Caption, item.Print(wm).Split(new char[] { '|' })[0] };
|
||||||
|
table2.AddRow(row, horizAlgn, vertAlgn);
|
||||||
|
}
|
||||||
|
table2.Draw(e, leftMarginBelow1, belowTop);
|
||||||
|
|
||||||
|
|
||||||
|
table2 = new Table(2) { Style = commonTableStyle };
|
||||||
|
foreach (var item in belowItems2)
|
||||||
|
{
|
||||||
|
string[] row = new string[] { item.Caption, item.Print(wm).Split(new char[] { '|' })[0] };
|
||||||
|
table2.AddRow(row, horizAlgn, vertAlgn);
|
||||||
|
}
|
||||||
|
table2.Draw(e, leftMarginBelow2, belowTop);
|
||||||
|
|
||||||
|
|
||||||
|
table2 = new Table(2) { Style = commonTableStyle };
|
||||||
|
foreach (var item in belowItems3)
|
||||||
|
{
|
||||||
|
string[] row = new string[] { item.Caption, item.Print(wm).Split(new char[] { '|' })[0] };
|
||||||
|
table2.AddRow(row, horizAlgn, vertAlgn);
|
||||||
|
}
|
||||||
|
table2.Draw(e, leftMarginBelow3, belowTop);
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
/// Footer on the last page
|
/// Footer on the last page
|
||||||
///
|
///
|
||||||
float footerWidth = e.Graphics.MeasureString(footer, footerFont).Width;
|
float footerWidth = e.Graphics.MeasureString(footer, footerFont).Width;
|
||||||
@@ -245,107 +345,5 @@ namespace Results.Output.Printers.OnePerMeter
|
|||||||
|
|
||||||
pageNr++;
|
pageNr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Table GetTable_TestsAreRows(Results.Entities.WaterMeter wm, IList<WMeterRsltItemSpec> items, TableStyle style)
|
|
||||||
{
|
|
||||||
/// Top row contains column captions
|
|
||||||
|
|
||||||
Table table = new Table(items.Count);
|
|
||||||
table.Style = style;
|
|
||||||
|
|
||||||
string[] tableHeader = new string[table.ColumnsCount];
|
|
||||||
Alignment[] horizAlignment = new Alignment[table.ColumnsCount];
|
|
||||||
VertAlignment[] vertAlignment = new VertAlignment[table.ColumnsCount];
|
|
||||||
for (int i = 0; i < table.ColumnsCount; i++)
|
|
||||||
{
|
|
||||||
tableHeader[i] = items[i].Caption;
|
|
||||||
horizAlignment[i] = Alignment.Center;
|
|
||||||
vertAlignment[i] = VertAlignment.Middle;
|
|
||||||
}
|
|
||||||
table.AddRow(tableHeader, horizAlignment, vertAlignment);
|
|
||||||
|
|
||||||
WMeterRsltItemSpec.TableRowNr = 1;
|
|
||||||
foreach (var mtr in wm.MeterTestRslts)
|
|
||||||
{
|
|
||||||
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
|
|
||||||
{
|
|
||||||
string[] oneTableRow = new string[table.ColumnsCount];
|
|
||||||
horizAlignment = new Alignment[table.ColumnsCount];
|
|
||||||
vertAlignment = new VertAlignment[table.ColumnsCount];
|
|
||||||
|
|
||||||
for (int i = 0; i < table.ColumnsCount; i++)
|
|
||||||
{
|
|
||||||
WMeterRsltItemSpec.TableColumnNr = i + 1;
|
|
||||||
oneTableRow[i] = items[i].Print(wm, mtr.Name()).Split(new char[] { '|' })[0];
|
|
||||||
horizAlignment[i] = items[i].Alignment;
|
|
||||||
vertAlignment[i] = VertAlignment.Middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.AddRow(oneTableRow, horizAlignment, vertAlignment);
|
|
||||||
|
|
||||||
WMeterRsltItemSpec.TableRowNr++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return table;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Table GetTable_TestsAreColumns(Results.Entities.WaterMeter wm, IList<WMeterRsltItemSpec> items, TableStyle style)
|
|
||||||
{
|
|
||||||
/// Left column contains row captions
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Calculate columns count
|
|
||||||
///
|
|
||||||
int columnsCount = 1; /// Left column contains item caption
|
|
||||||
foreach (var mtr in wm.MeterTestRslts)
|
|
||||||
{
|
|
||||||
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
|
|
||||||
{
|
|
||||||
columnsCount++; /// One additional column for each test to be published
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Table table = new Table(columnsCount);
|
|
||||||
table.Style = style;
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Table content
|
|
||||||
///
|
|
||||||
WMeterRsltItemSpec.TableRowNr = 1;
|
|
||||||
for (int i = 0; i < items.Count; i++)
|
|
||||||
{
|
|
||||||
string[] oneTableRow = new string[columnsCount];
|
|
||||||
Alignment[] horizAlignment = new Alignment[columnsCount];
|
|
||||||
VertAlignment[] vertAlignment = new VertAlignment[columnsCount];
|
|
||||||
|
|
||||||
oneTableRow[0] = items[i].Caption;
|
|
||||||
horizAlignment[0] = Alignment.Center;
|
|
||||||
vertAlignment[0] = VertAlignment.Middle;
|
|
||||||
|
|
||||||
WMeterRsltItemSpec.TableColumnNr = 1;
|
|
||||||
foreach (var mtr in wm.MeterTestRslts)
|
|
||||||
{
|
|
||||||
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
|
|
||||||
{
|
|
||||||
/// Strip color information
|
|
||||||
oneTableRow[WMeterRsltItemSpec.TableColumnNr] =
|
|
||||||
items[i].Print(wm, mtr.Name()).Split(new char[] { '|' })[0];
|
|
||||||
horizAlignment[WMeterRsltItemSpec.TableColumnNr] = items[i].Alignment;
|
|
||||||
vertAlignment[WMeterRsltItemSpec.TableColumnNr] = VertAlignment.Middle;
|
|
||||||
|
|
||||||
WMeterRsltItemSpec.TableColumnNr++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
table.AddRow(oneTableRow, horizAlignment, vertAlignment);
|
|
||||||
|
|
||||||
WMeterRsltItemSpec.TableRowNr++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return table;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,10 +27,23 @@ namespace Results.Output.Printers.OnePerMeter
|
|||||||
public bool SupressPrinting; /// Bypass printing when true
|
public bool SupressPrinting; /// Bypass printing when true
|
||||||
public System.Globalization.CultureInfo CultureInfo;
|
public System.Globalization.CultureInfo CultureInfo;
|
||||||
public string Header; /// =Title
|
public string Header; /// =Title
|
||||||
public string[] CommonItems;
|
public int ColW0Pct;
|
||||||
public string[] TestItems;
|
public int ColW1Pct;
|
||||||
|
public int ColW2Pct;
|
||||||
|
public string[] CommonItems1;
|
||||||
|
public string[] CommonItems2;
|
||||||
|
public string[] CommonItems3;
|
||||||
|
public Config.Entities.TableForm Form;
|
||||||
|
public string[] TestItems;
|
||||||
|
public Config.Entities.TableForm Form2;
|
||||||
public string[] TestItems2;
|
public string[] TestItems2;
|
||||||
public string Footer;
|
public int BelowW0Pct;
|
||||||
|
public int BelowW1Pct;
|
||||||
|
public int BelowW2Pct;
|
||||||
|
public string[] BelowItems1;
|
||||||
|
public string[] BelowItems2;
|
||||||
|
public string[] BelowItems3;
|
||||||
|
public string Footer;
|
||||||
public bool TestsAreRows;
|
public bool TestsAreRows;
|
||||||
public string ImgFullPathName;
|
public string ImgFullPathName;
|
||||||
public int ImgLeft;
|
public int ImgLeft;
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
using System;
|
///
|
||||||
|
/// Copyright (c) 2018 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Printing;
|
using System.Drawing.Printing;
|
||||||
@@ -25,6 +28,7 @@ namespace Results.Output.Printers
|
|||||||
public float LineWidth;
|
public float LineWidth;
|
||||||
public TableLines HorizLines;
|
public TableLines HorizLines;
|
||||||
public TableLines VertLines;
|
public TableLines VertLines;
|
||||||
|
public float[] ColumnWidths; /// null = automatic
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Table
|
public class Table
|
||||||
@@ -57,10 +61,21 @@ namespace Results.Output.Printers
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns true when table has either rows or columns count == 0
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>true when empty</returns>
|
||||||
|
public bool IsEmpty()
|
||||||
|
{
|
||||||
|
return (Rows == null || RowsCount == 0 || Rows[0] == null || Rows[0].Length == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public SizeF Measure(System.Drawing.Printing.PrintPageEventArgs e)
|
public SizeF Measure(System.Drawing.Printing.PrintPageEventArgs e)
|
||||||
{
|
{
|
||||||
SizeF retVal = new SizeF(0, 0);
|
SizeF retVal = new SizeF(0, 0);
|
||||||
if (RowsCount == 0) return retVal;
|
|
||||||
|
if (IsEmpty()) return retVal; /// Empty table => zero Size
|
||||||
|
|
||||||
float[] columnWidth = new float[ColumnsCount];
|
float[] columnWidth = new float[ColumnsCount];
|
||||||
float[] rowHeight = new float[RowsCount];
|
float[] rowHeight = new float[RowsCount];
|
||||||
@@ -72,10 +87,17 @@ namespace Results.Output.Printers
|
|||||||
{
|
{
|
||||||
for (int rowIx = 0; rowIx < RowsCount; rowIx++)
|
for (int rowIx = 0; rowIx < RowsCount; rowIx++)
|
||||||
{
|
{
|
||||||
bool isHeader = (colIx < Style.LeftHeadersCount) || (rowIx < Style.TopHeadersCount);
|
if (Rows[rowIx] == null)
|
||||||
SizeF size = PrintersCommon.Measure(e, Rows[rowIx][colIx], isHeader ? Style.HeaderFont : Style.Font);
|
{
|
||||||
if (size.Width > columnWidth[colIx]) columnWidth[colIx] = size.Width;
|
/// Separator row -> do nothing
|
||||||
if (size.Height > rowHeight[rowIx]) rowHeight[rowIx] = size.Height;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bool isHeader = (colIx < Style.LeftHeadersCount) || (rowIx < Style.TopHeadersCount);
|
||||||
|
SizeF size = PrintersCommon.Measure(e, Rows[rowIx][colIx], isHeader ? Style.HeaderFont : Style.Font);
|
||||||
|
if (size.Width > columnWidth[colIx]) columnWidth[colIx] = size.Width;
|
||||||
|
if (size.Height > rowHeight[rowIx]) rowHeight[rowIx] = size.Height;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasLineToTheLeft = (Style.VertLines == TableLines.All)
|
bool hasLineToTheLeft = (Style.VertLines == TableLines.All)
|
||||||
@@ -86,11 +108,19 @@ namespace Results.Output.Printers
|
|||||||
}
|
}
|
||||||
for (int rowIx = 0; rowIx < RowsCount; rowIx++)
|
for (int rowIx = 0; rowIx < RowsCount; rowIx++)
|
||||||
{
|
{
|
||||||
bool hasLineAbove = (Style.HorizLines == TableLines.All)
|
if (Rows[rowIx] == null)
|
||||||
|| ((Style.HorizLines == TableLines.FirstAndLast) && (rowIx == 0))
|
{
|
||||||
|| ((Style.HorizLines == TableLines.FirstSecondAndLast) && (rowIx <= 1));
|
/// Separator row -> do nothing
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bool hasLineAbove = (Style.HorizLines == TableLines.All)
|
||||||
|
|| ((Style.HorizLines == TableLines.FirstAndLast) && (rowIx == 0))
|
||||||
|
|| ((Style.HorizLines == TableLines.FirstSecondAndLast) && (rowIx <= 1))
|
||||||
|
|| ((rowIx >= 1) && (Rows[rowIx - 1] == null));
|
||||||
|
|
||||||
retVal.Height += rowHeight[rowIx] + (hasLineAbove ? (Style.LineWidth + Style.MarginY) : 0) + Style.MarginY;
|
retVal.Height += rowHeight[rowIx] + (hasLineAbove ? (Style.LineWidth + Style.MarginY) : 0) + Style.MarginY;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Style.VertLines == TableLines.None) retVal.Width -= Style.MarginX;
|
if (Style.VertLines == TableLines.None) retVal.Width -= Style.MarginX;
|
||||||
@@ -102,10 +132,10 @@ namespace Results.Output.Printers
|
|||||||
|
|
||||||
public float Draw(System.Drawing.Printing.PrintPageEventArgs e, float left, float top)
|
public float Draw(System.Drawing.Printing.PrintPageEventArgs e, float left, float top)
|
||||||
{
|
{
|
||||||
if (RowsCount == 0) return top;
|
if (IsEmpty()) return top; /// Empty table
|
||||||
|
|
||||||
int tblColumnsCount = Rows[0].Length;
|
int tblColumnsCount = Rows[0].Length;
|
||||||
|
|
||||||
float[] columnWidth = new float[tblColumnsCount];
|
float[] columnWidth = new float[tblColumnsCount];
|
||||||
float[] columnPos = new float[tblColumnsCount];
|
float[] columnPos = new float[tblColumnsCount];
|
||||||
float[] vertLinePos = new float[tblColumnsCount + 1];
|
float[] vertLinePos = new float[tblColumnsCount + 1];
|
||||||
@@ -123,10 +153,23 @@ namespace Results.Output.Printers
|
|||||||
{
|
{
|
||||||
for (int rowIx = 0; rowIx < RowsCount; rowIx++)
|
for (int rowIx = 0; rowIx < RowsCount; rowIx++)
|
||||||
{
|
{
|
||||||
bool isHeader = (colIx < Style.LeftHeadersCount) || (rowIx < Style.TopHeadersCount);
|
if (Rows[rowIx] != null)
|
||||||
SizeF size = PrintersCommon.Measure(e, Rows[rowIx][colIx], isHeader ? Style.HeaderFont : Style.Font);
|
{
|
||||||
if (size.Width > columnWidth[colIx]) columnWidth[colIx] = size.Width;
|
/// In not a separator line
|
||||||
if (size.Height > rowHeight[rowIx]) rowHeight[rowIx] = size.Height;
|
bool isHeader = (colIx < Style.LeftHeadersCount) || (rowIx < Style.TopHeadersCount);
|
||||||
|
SizeF size = PrintersCommon.Measure(e, Rows[rowIx][colIx], isHeader ? Style.HeaderFont : Style.Font);
|
||||||
|
if ((Style.ColumnWidths != null) && (Style.ColumnWidths.Length > colIx))
|
||||||
|
{
|
||||||
|
size.Width = Style.ColumnWidths[colIx]; /// Override measurement if column width is defined
|
||||||
|
}
|
||||||
|
if (size.Width > columnWidth[colIx]) columnWidth[colIx] = size.Width;
|
||||||
|
if (size.Height > rowHeight[rowIx]) rowHeight[rowIx] = size.Height;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/// Separator line -> do nothing
|
||||||
|
rowHeight[rowIx] = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasLineToTheLeft = (Style.VertLines == TableLines.All)
|
bool hasLineToTheLeft = (Style.VertLines == TableLines.All)
|
||||||
@@ -138,12 +181,23 @@ namespace Results.Output.Printers
|
|||||||
}
|
}
|
||||||
for (int rowIx = 0; rowIx < RowsCount; rowIx++)
|
for (int rowIx = 0; rowIx < RowsCount; rowIx++)
|
||||||
{
|
{
|
||||||
bool hasLineAbove = (Style.HorizLines == TableLines.All)
|
if (Rows[rowIx] != null)
|
||||||
|| ((Style.HorizLines == TableLines.FirstAndLast) && (rowIx == 0))
|
{
|
||||||
|| ((Style.HorizLines == TableLines.FirstSecondAndLast) && (rowIx <= 1));
|
/// In not a separator line
|
||||||
|
bool hasLineAbove = (Style.HorizLines == TableLines.All)
|
||||||
|
|| ((Style.HorizLines == TableLines.FirstAndLast) && (rowIx == 0))
|
||||||
|
|| ((Style.HorizLines == TableLines.FirstSecondAndLast) && (rowIx <= 1))
|
||||||
|
|| ((rowIx >= 1) && (Rows[rowIx - 1] == null));
|
||||||
|
|
||||||
rowPos[rowIx] = horizLinePos[rowIx] + (hasLineAbove ? Style.MarginY : 0);
|
rowPos[rowIx] = horizLinePos[rowIx] + (hasLineAbove ? Style.MarginY : 0);
|
||||||
horizLinePos[rowIx + 1] = rowPos[rowIx] + rowHeight[rowIx] + Style.LineWidth + Style.MarginY;
|
horizLinePos[rowIx + 1] = rowPos[rowIx] + rowHeight[rowIx] + Style.LineWidth + Style.MarginY;
|
||||||
|
}
|
||||||
|
else if (rowIx > 0)
|
||||||
|
{
|
||||||
|
/// Separator line
|
||||||
|
rowPos[rowIx] = rowPos[rowIx - 1];
|
||||||
|
horizLinePos[rowIx + 1] = horizLinePos[rowIx];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Horizontal lines
|
/// Horizontal lines
|
||||||
@@ -153,7 +207,10 @@ namespace Results.Output.Printers
|
|||||||
{
|
{
|
||||||
for (int rowIx = 0; rowIx <= RowsCount; rowIx++)
|
for (int rowIx = 0; rowIx <= RowsCount; rowIx++)
|
||||||
{
|
{
|
||||||
if (Style.HorizLines == TableLines.All || rowIx == 0 || rowIx == RowsCount || (Style.HorizLines == TableLines.FirstSecondAndLast && rowIx == 1))
|
if (Style.HorizLines == TableLines.All || rowIx == 0
|
||||||
|
|| rowIx == RowsCount
|
||||||
|
|| (Style.HorizLines == TableLines.FirstSecondAndLast && rowIx == 1)
|
||||||
|
|| ((rowIx >= 1) && (Rows[rowIx - 1] == null)))
|
||||||
{
|
{
|
||||||
e.Graphics.DrawLine(new Pen(Color.Black, Style.LineWidth), new PointF(tableLeftX, horizLinePos[rowIx] + Style.LineWidth / 2), new PointF(tableRightX, horizLinePos[rowIx] + Style.LineWidth / 2));
|
e.Graphics.DrawLine(new Pen(Color.Black, Style.LineWidth), new PointF(tableLeftX, horizLinePos[rowIx] + Style.LineWidth / 2), new PointF(tableRightX, horizLinePos[rowIx] + Style.LineWidth / 2));
|
||||||
}
|
}
|
||||||
@@ -167,7 +224,7 @@ namespace Results.Output.Printers
|
|||||||
{
|
{
|
||||||
for (int colIx = 0; colIx <= tblColumnsCount; colIx++)
|
for (int colIx = 0; colIx <= tblColumnsCount; colIx++)
|
||||||
{
|
{
|
||||||
if (Style.VertLines == TableLines.All || colIx == 0 || colIx == RowsCount || (Style.VertLines == TableLines.FirstSecondAndLast && colIx == 1))
|
if (Style.VertLines == TableLines.All || colIx == 0 || colIx == ColumnsCount || (Style.VertLines == TableLines.FirstSecondAndLast && colIx == 1))
|
||||||
{
|
{
|
||||||
e.Graphics.DrawLine(new Pen(Color.Black, Style.LineWidth), new PointF(vertLinePos[colIx] + Style.LineWidth / 2, tableTopY), new PointF(vertLinePos[colIx] + Style.LineWidth / 2, tableBottomY));
|
e.Graphics.DrawLine(new Pen(Color.Black, Style.LineWidth), new PointF(vertLinePos[colIx] + Style.LineWidth / 2, tableTopY), new PointF(vertLinePos[colIx] + Style.LineWidth / 2, tableBottomY));
|
||||||
}
|
}
|
||||||
@@ -180,23 +237,196 @@ namespace Results.Output.Printers
|
|||||||
for (int rowIndex = 0; rowIndex < RowsCount; rowIndex++)
|
for (int rowIndex = 0; rowIndex < RowsCount; rowIndex++)
|
||||||
{
|
{
|
||||||
string[] oneTableRow = Rows[rowIndex];
|
string[] oneTableRow = Rows[rowIndex];
|
||||||
Alignment[] horizAlignment = HorizAlignments[(RowsCount > rowIndex) ? rowIndex : 0];
|
if (oneTableRow != null)
|
||||||
VertAlignment[] vertAlignment = VertAlignments[(RowsCount > rowIndex) ? rowIndex : 0];
|
|
||||||
for (int colIndex = 0; colIndex < tblColumnsCount; colIndex++)
|
|
||||||
{
|
{
|
||||||
bool isHeader = (colIndex < Style.LeftHeadersCount) || (rowIndex < Style.TopHeadersCount);
|
Alignment[] horizAlignment = HorizAlignments[(RowsCount > rowIndex) ? rowIndex : 0];
|
||||||
PrintersCommon.PrintAt(e, oneTableRow[colIndex],
|
VertAlignment[] vertAlignment = VertAlignments[(RowsCount > rowIndex) ? rowIndex : 0];
|
||||||
isHeader ? Style.HeaderFont : Style.Font,
|
for (int colIndex = 0; colIndex < tblColumnsCount; colIndex++)
|
||||||
columnPos[colIndex],
|
{
|
||||||
rowPos[rowIndex],
|
bool isHeader = (colIndex < Style.LeftHeadersCount) || (rowIndex < Style.TopHeadersCount);
|
||||||
columnWidth[colIndex],
|
PrintersCommon.PrintAt(e, oneTableRow[colIndex],
|
||||||
rowHeight[rowIndex],
|
isHeader ? Style.HeaderFont : Style.Font,
|
||||||
horizAlignment[colIndex],
|
columnPos[colIndex],
|
||||||
vertAlignment[colIndex]);
|
rowPos[rowIndex],
|
||||||
|
columnWidth[colIndex],
|
||||||
|
rowHeight[rowIndex],
|
||||||
|
horizAlignment[colIndex],
|
||||||
|
vertAlignment[colIndex]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return tableBottomY;
|
return tableBottomY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Table Create_TestsAreRows(Results.Entities.WaterMeter wm, IList<WMeterRsltItemSpec> items, TableStyle style)
|
||||||
|
{
|
||||||
|
/// Top row contains column captions
|
||||||
|
|
||||||
|
Table table = new Table(items.Count);
|
||||||
|
table.Style = style;
|
||||||
|
|
||||||
|
string[] tableHeader = new string[table.ColumnsCount];
|
||||||
|
Alignment[] horizAlignment = new Alignment[table.ColumnsCount];
|
||||||
|
VertAlignment[] vertAlignment = new VertAlignment[table.ColumnsCount];
|
||||||
|
for (int i = 0; i < table.ColumnsCount; i++)
|
||||||
|
{
|
||||||
|
tableHeader[i] = items[i].Caption;
|
||||||
|
horizAlignment[i] = Alignment.Center;
|
||||||
|
vertAlignment[i] = VertAlignment.Middle;
|
||||||
|
}
|
||||||
|
table.AddRow(tableHeader, horizAlignment, vertAlignment);
|
||||||
|
|
||||||
|
WMeterRsltItemSpec.TableRowNr = 1;
|
||||||
|
foreach (var mtr in wm.MeterTestRslts)
|
||||||
|
{
|
||||||
|
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
|
||||||
|
{
|
||||||
|
string[] oneTableRow = new string[table.ColumnsCount];
|
||||||
|
horizAlignment = new Alignment[table.ColumnsCount];
|
||||||
|
vertAlignment = new VertAlignment[table.ColumnsCount];
|
||||||
|
|
||||||
|
for (int i = 0; i < table.ColumnsCount; i++)
|
||||||
|
{
|
||||||
|
WMeterRsltItemSpec.TableColumnNr = i + 1;
|
||||||
|
oneTableRow[i] = items[i].Print(wm, mtr.Name()).Split(new char[] { '|' })[0];
|
||||||
|
horizAlignment[i] = items[i].Alignment;
|
||||||
|
vertAlignment[i] = VertAlignment.Middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.AddRow(oneTableRow, horizAlignment, vertAlignment);
|
||||||
|
|
||||||
|
WMeterRsltItemSpec.TableRowNr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return table;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Table Create_TestsAreColumns(Results.Entities.WaterMeter wm, IList<WMeterRsltItemSpec> items, TableStyle style)
|
||||||
|
{
|
||||||
|
/// Left column contains row captions
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Calculate columns count
|
||||||
|
///
|
||||||
|
int columnsCount = 1; /// Left column contains item caption
|
||||||
|
foreach (var mtr in wm.MeterTestRslts)
|
||||||
|
{
|
||||||
|
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
|
||||||
|
{
|
||||||
|
columnsCount++; /// One additional column for each test to be published
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Table table = new Table(columnsCount);
|
||||||
|
table.Style = style;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Table content
|
||||||
|
///
|
||||||
|
WMeterRsltItemSpec.TableRowNr = 1;
|
||||||
|
for (int i = 0; i < items.Count; i++)
|
||||||
|
{
|
||||||
|
string[] oneTableRow = new string[columnsCount];
|
||||||
|
Alignment[] horizAlignment = new Alignment[columnsCount];
|
||||||
|
VertAlignment[] vertAlignment = new VertAlignment[columnsCount];
|
||||||
|
|
||||||
|
oneTableRow[0] = items[i].Caption;
|
||||||
|
horizAlignment[0] = Alignment.Center;
|
||||||
|
vertAlignment[0] = VertAlignment.Middle;
|
||||||
|
|
||||||
|
WMeterRsltItemSpec.TableColumnNr = 1;
|
||||||
|
foreach (var mtr in wm.MeterTestRslts)
|
||||||
|
{
|
||||||
|
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
|
||||||
|
{
|
||||||
|
/// Strip color information
|
||||||
|
oneTableRow[WMeterRsltItemSpec.TableColumnNr] =
|
||||||
|
items[i].Print(wm, mtr.Name()).Split(new char[] { '|' })[0];
|
||||||
|
horizAlignment[WMeterRsltItemSpec.TableColumnNr] = items[i].Alignment;
|
||||||
|
vertAlignment[WMeterRsltItemSpec.TableColumnNr] = VertAlignment.Middle;
|
||||||
|
|
||||||
|
WMeterRsltItemSpec.TableColumnNr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
table.AddRow(oneTableRow, horizAlignment, vertAlignment);
|
||||||
|
|
||||||
|
WMeterRsltItemSpec.TableRowNr++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return table;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Table Create_TestsAreColumnsPL(Results.Entities.WaterMeter wm, IList<WMeterRsltItemSpec> items, TableStyle style)
|
||||||
|
{
|
||||||
|
/// Left column contains row captions
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Calculate columns count
|
||||||
|
///
|
||||||
|
int columnsCount = 2; /// Left two columns contain item caption and units
|
||||||
|
foreach (var mtr in wm.MeterTestRslts)
|
||||||
|
{
|
||||||
|
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
|
||||||
|
{
|
||||||
|
columnsCount++; /// One additional column for each test to be published
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Table table = new Table(columnsCount);
|
||||||
|
table.Style = style;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Table content
|
||||||
|
///
|
||||||
|
WMeterRsltItemSpec.TableRowNr = 1;
|
||||||
|
for (int i = 0; i < items.Count; i++)
|
||||||
|
{
|
||||||
|
if (items[i].Uid == (int)ItemID.Separator)
|
||||||
|
{
|
||||||
|
table.AddRow(null, null, null); /// 'separator' row
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string[] oneTableRow = new string[columnsCount];
|
||||||
|
Alignment[] horizAlignment = new Alignment[columnsCount];
|
||||||
|
VertAlignment[] vertAlignment = new VertAlignment[columnsCount];
|
||||||
|
|
||||||
|
oneTableRow[0] = items[i].Caption;
|
||||||
|
horizAlignment[0] = Alignment.Center;
|
||||||
|
vertAlignment[0] = VertAlignment.Middle;
|
||||||
|
|
||||||
|
oneTableRow[1] = (i == 0) ? "Jednostka" : items[i].Units.ToDescription();
|
||||||
|
horizAlignment[1] = Alignment.Center;
|
||||||
|
vertAlignment[1] = VertAlignment.Middle;
|
||||||
|
|
||||||
|
WMeterRsltItemSpec.TableColumnNr = 1;
|
||||||
|
foreach (var mtr in wm.MeterTestRslts)
|
||||||
|
{
|
||||||
|
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
|
||||||
|
{
|
||||||
|
int colIx = WMeterRsltItemSpec.TableColumnNr + 1;
|
||||||
|
|
||||||
|
/// Strip color information
|
||||||
|
oneTableRow[colIx] = items[i].Print(wm, mtr.Name()).Split(new char[] { '|' })[0];
|
||||||
|
horizAlignment[colIx] = items[i].Alignment;
|
||||||
|
vertAlignment[colIx] = VertAlignment.Middle;
|
||||||
|
|
||||||
|
WMeterRsltItemSpec.TableColumnNr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
table.AddRow(oneTableRow, horizAlignment, vertAlignment);
|
||||||
|
}
|
||||||
|
WMeterRsltItemSpec.TableRowNr++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return table;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("2.18.844.0")]
|
[assembly: AssemblyVersion("2.18.1093.0")]
|
||||||
[assembly: AssemblyFileVersion("2.18.844.0")]
|
[assembly: AssemblyFileVersion("2.18.1093.0")]
|
||||||
|
|||||||
Generated
+64
-1
@@ -69,6 +69,15 @@ namespace Results.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Address.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Address {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Address", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Alignment.
|
/// Looks up a localized string similar to Alignment.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -105,6 +114,15 @@ namespace Results.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Batch.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Batch {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Batch", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Batch nr..
|
/// Looks up a localized string similar to Batch nr..
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -123,6 +141,24 @@ namespace Results.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Bench ID.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Bench_ID {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Bench_ID", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Bench name.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Bench_name {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Bench_name", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Cancel.
|
/// Looks up a localized string similar to Cancel.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -636,6 +672,15 @@ namespace Results.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Procedure description.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Procedure_description {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Procedure_description", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Producer.
|
/// Looks up a localized string similar to Producer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1023,6 +1068,15 @@ namespace Results.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Relative error of a meter in previous test/in production.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Tooltip_E_rel_last {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Tooltip_E_rel_last", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Relative error of the master meter.
|
/// Looks up a localized string similar to Relative error of the master meter.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1303,7 +1357,7 @@ namespace Results.Resources {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Flow calculated from conventional true volume and the time.
|
/// Looks up a localized string similar to Flow measured by the reference flow meter.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string Tooltip_Q_v_r {
|
internal static string Tooltip_Q_v_r {
|
||||||
get {
|
get {
|
||||||
@@ -1644,6 +1698,15 @@ namespace Results.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Unit.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Unit {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Unit", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Units.
|
/// Looks up a localized string similar to Units.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -210,4 +210,49 @@
|
|||||||
<data name="to" xml:space="preserve">
|
<data name="to" xml:space="preserve">
|
||||||
<value>do</value>
|
<value>do</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Unit" xml:space="preserve">
|
||||||
|
<value>Jednotka</value>
|
||||||
|
</data>
|
||||||
|
<data name="Approval" xml:space="preserve">
|
||||||
|
<value>Schválení</value>
|
||||||
|
</data>
|
||||||
|
<data name="Bench" xml:space="preserve">
|
||||||
|
<value>Stanice</value>
|
||||||
|
</data>
|
||||||
|
<data name="Density" xml:space="preserve">
|
||||||
|
<value>Hustota</value>
|
||||||
|
</data>
|
||||||
|
<data name="Density_correction" xml:space="preserve">
|
||||||
|
<value>Korekce hustoty</value>
|
||||||
|
</data>
|
||||||
|
<data name="End" xml:space="preserve">
|
||||||
|
<value>Konec</value>
|
||||||
|
</data>
|
||||||
|
<data name="Procedure" xml:space="preserve">
|
||||||
|
<value>Procedura</value>
|
||||||
|
</data>
|
||||||
|
<data name="Procedure_description" xml:space="preserve">
|
||||||
|
<value>Popis procedury</value>
|
||||||
|
</data>
|
||||||
|
<data name="Start" xml:space="preserve">
|
||||||
|
<value>Začátek</value>
|
||||||
|
</data>
|
||||||
|
<data name="User" xml:space="preserve">
|
||||||
|
<value>Uživatel</value>
|
||||||
|
</data>
|
||||||
|
<data name="User_description" xml:space="preserve">
|
||||||
|
<value>Popis uživatele</value>
|
||||||
|
</data>
|
||||||
|
<data name="Bench_ID" xml:space="preserve">
|
||||||
|
<value>ID stanice</value>
|
||||||
|
</data>
|
||||||
|
<data name="Bench_name" xml:space="preserve">
|
||||||
|
<value>Jméno stanice</value>
|
||||||
|
</data>
|
||||||
|
<data name="Address" xml:space="preserve">
|
||||||
|
<value>Adresa</value>
|
||||||
|
</data>
|
||||||
|
<data name="Batch" xml:space="preserve">
|
||||||
|
<value>Dávka</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -438,4 +438,7 @@
|
|||||||
<data name="to" xml:space="preserve">
|
<data name="to" xml:space="preserve">
|
||||||
<value>do</value>
|
<value>do</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Unit" xml:space="preserve">
|
||||||
|
<value>Jednostka</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -514,7 +514,7 @@
|
|||||||
<value>Flow obtained from the master meter - mean</value>
|
<value>Flow obtained from the master meter - mean</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Tooltip_Q_v_r" xml:space="preserve">
|
<data name="Tooltip_Q_v_r" xml:space="preserve">
|
||||||
<value>Flow calculated from conventional true volume and the time</value>
|
<value>Flow measured by the reference flow meter</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Tooltip_T_di_ac" xml:space="preserve">
|
<data name="Tooltip_T_di_ac" xml:space="preserve">
|
||||||
<value>Actual temperature at the diverter</value>
|
<value>Actual temperature at the diverter</value>
|
||||||
@@ -720,4 +720,25 @@
|
|||||||
<data name="Tooltip_T_ln_st" xml:space="preserve">
|
<data name="Tooltip_T_ln_st" xml:space="preserve">
|
||||||
<value>Temperature in the line at start of the test – first 4 measurements after the start</value>
|
<value>Temperature in the line at start of the test – first 4 measurements after the start</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Unit" xml:space="preserve">
|
||||||
|
<value>Unit</value>
|
||||||
|
</data>
|
||||||
|
<data name="Procedure_description" xml:space="preserve">
|
||||||
|
<value>Procedure description</value>
|
||||||
|
</data>
|
||||||
|
<data name="Bench_ID" xml:space="preserve">
|
||||||
|
<value>Bench ID</value>
|
||||||
|
</data>
|
||||||
|
<data name="Bench_name" xml:space="preserve">
|
||||||
|
<value>Bench name</value>
|
||||||
|
</data>
|
||||||
|
<data name="Address" xml:space="preserve">
|
||||||
|
<value>Address</value>
|
||||||
|
</data>
|
||||||
|
<data name="Tooltip_E_rel_last" xml:space="preserve">
|
||||||
|
<value>Relative error of a meter in previous test/in production</value>
|
||||||
|
</data>
|
||||||
|
<data name="Batch" xml:space="preserve">
|
||||||
|
<value>Batch</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
|
<DefineConstants>TRACE;DEBUG;ZODINO;LANG_RU</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
<DefineConstants>TRACE;MUNICH</DefineConstants>
|
<DefineConstants>TRACE;ZODINO;LANG_RU</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@@ -77,6 +77,9 @@
|
|||||||
<Compile Include="Forms\ListViewEx.cs">
|
<Compile Include="Forms\ListViewEx.cs">
|
||||||
<SubType>Component</SubType>
|
<SubType>Component</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Forms\ListViewExtensions.cs" />
|
||||||
|
<Compile Include="Forms\LviIntColumnComparer.cs" />
|
||||||
|
<Compile Include="Forms\LviTextColumnComparer.cs" />
|
||||||
<Compile Include="Forms\ResultsConfigCtrl.cs">
|
<Compile Include="Forms\ResultsConfigCtrl.cs">
|
||||||
<SubType>UserControl</SubType>
|
<SubType>UserControl</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -97,9 +100,6 @@
|
|||||||
<Compile Include="Mappings\TestRsltMap.cs" />
|
<Compile Include="Mappings\TestRsltMap.cs" />
|
||||||
<Compile Include="Mappings\WaterMeterDataMap.cs" />
|
<Compile Include="Mappings\WaterMeterDataMap.cs" />
|
||||||
<Compile Include="Mappings\WaterMeterMap.cs" />
|
<Compile Include="Mappings\WaterMeterMap.cs" />
|
||||||
<Compile Include="Output\Printers\Cevak\PrintDocumentCevak.cs">
|
|
||||||
<SubType>Component</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Output\Printers\Enhanced\EnhancedPrintDocument.cs">
|
<Compile Include="Output\Printers\Enhanced\EnhancedPrintDocument.cs">
|
||||||
<SubType>Component</SubType>
|
<SubType>Component</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -120,7 +120,6 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Output\Printers\Zapiska\ZapiskaPrinterCfg.cs" />
|
<Compile Include="Output\Printers\Zapiska\ZapiskaPrinterCfg.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="ItemSpec.cs" />
|
|
||||||
<Compile Include="Properties\Resources.Designer.cs">
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
|
|||||||
+3
-108
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2016 Sensus Metering Systems
|
/// Copyright (c) 2016-2018 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -31,110 +31,6 @@ namespace Results
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Converts float number to a string with the specified number of significant digits
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="value">Float value to be converted to a string</param>
|
|
||||||
/// <param name="validDigits">Number of significant digits: 4, 3, or 2 (otherwise a full precision number is printed)</param>
|
|
||||||
/// <returns>String representation of the float number</returns>
|
|
||||||
public static string DoubleToStr(double value, int validDigits)
|
|
||||||
{
|
|
||||||
if (-float.Epsilon <= value && value <= float.Epsilon)
|
|
||||||
{
|
|
||||||
return "0";
|
|
||||||
}
|
|
||||||
else if (validDigits == 4)
|
|
||||||
{
|
|
||||||
if (value >= 999.5 || value < -999.5) return value.ToString("F0");
|
|
||||||
else if (value >= 99.95 || value < -99.95) return value.ToString("F1");
|
|
||||||
else if (value >= 9.995 || value < -9.995) return value.ToString("F2");
|
|
||||||
else if (value >= 0.9995 || value < -0.9995) return value.ToString("F3");
|
|
||||||
else if (value >= 0.09995 || value < -0.09995) return value.ToString("F4");
|
|
||||||
else if (value >= 0.009995 || value < -0.009995) return value.ToString("F5");
|
|
||||||
else return value.ToString("F6");
|
|
||||||
}
|
|
||||||
else if (validDigits == 3)
|
|
||||||
{
|
|
||||||
if (value >= 99.5 || value < -99.5) return value.ToString("F0");
|
|
||||||
else if (value >= 9.95 || value < -9.95) return value.ToString("F1");
|
|
||||||
else if (value >= 0.995 || value < -0.995) return value.ToString("F2");
|
|
||||||
else if (value >= 0.0995 || value < -0.0995) return value.ToString("F3");
|
|
||||||
else if (value >= 0.00995 || value < -0.00995) return value.ToString("F4");
|
|
||||||
else if (value >= 0.000995 || value < -0.000995) return value.ToString("F5");
|
|
||||||
else return value.ToString("F6");
|
|
||||||
}
|
|
||||||
else if (validDigits == 2)
|
|
||||||
{
|
|
||||||
if (value >= 9.5 || value < -9.5) return value.ToString("F0");
|
|
||||||
else if (value >= 0.95 || value < -0.95) return value.ToString("F1");
|
|
||||||
else if (value >= 0.095 || value < -0.095) return value.ToString("F2");
|
|
||||||
else if (value >= 0.0095 || value < -0.0095) return value.ToString("F3");
|
|
||||||
else if (value >= 0.00095 || value < -0.00095) return value.ToString("F4");
|
|
||||||
else return value.ToString("F5");
|
|
||||||
}
|
|
||||||
else return value.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static string SignificantDigitsToFmt(double value, int sigDigits)
|
|
||||||
{
|
|
||||||
if (sigDigits == 5)
|
|
||||||
{
|
|
||||||
if (value >= 9999.5 || value < -9999.5) return "F0";
|
|
||||||
else if (value >= 999.95 || value < -999.95) return "F1";
|
|
||||||
else if (value >= 99.995 || value < -99.995) return "F2";
|
|
||||||
else if (value >= 9.9995 || value < -9.9995) return "F3";
|
|
||||||
else if (value >= 0.99995 || value < -0.99995) return "F4";
|
|
||||||
else if (value >= 0.099995 || value < -0.099995) return "F5";
|
|
||||||
else if (value >= 0.0099995 || value < -0.0099995) return "F6";
|
|
||||||
else if (value >= 0.00099995 || value < -0.00099995) return "F7";
|
|
||||||
else if (value >= 0.000099995 || value < -0.000099995) return "F8";
|
|
||||||
else return "F9";
|
|
||||||
}
|
|
||||||
else if (sigDigits == 4)
|
|
||||||
{
|
|
||||||
if (value >= 999.5 || value < -999.5) return "F0";
|
|
||||||
else if (value >= 99.95 || value < -99.95) return "F1";
|
|
||||||
else if (value >= 9.995 || value < -9.995) return "F2";
|
|
||||||
else if (value >= 0.9995 || value < -0.9995) return "F3";
|
|
||||||
else if (value >= 0.09995 || value < -0.09995) return "F4";
|
|
||||||
else if (value >= 0.009995 || value < -0.009995) return "F5";
|
|
||||||
else if (value >= 0.0009995 || value < -0.0009995) return "F6";
|
|
||||||
else if (value >= 0.00009995 || value < -0.00009995) return "F7";
|
|
||||||
else return "F8";
|
|
||||||
}
|
|
||||||
else if (sigDigits == 3)
|
|
||||||
{
|
|
||||||
if (value >= 99.5 || value < -99.5) return "F0";
|
|
||||||
else if (value >= 9.95 || value < -9.95) return "F1";
|
|
||||||
else if (value >= 0.995 || value < -0.995) return "F2";
|
|
||||||
else if (value >= 0.0995 || value < -0.0995) return "F3";
|
|
||||||
else if (value >= 0.00995 || value < -0.00995) return "F4";
|
|
||||||
else if (value >= 0.000995 || value < -0.000995) return "F5";
|
|
||||||
else if (value >= 0.0000995 || value < -0.0000995) return "F6";
|
|
||||||
else return "F7";
|
|
||||||
}
|
|
||||||
else if (sigDigits == 2)
|
|
||||||
{
|
|
||||||
if (value >= 9.5 || value < -9.5) return "F0";
|
|
||||||
else if (value >= 0.95 || value < -0.95) return "F1";
|
|
||||||
else if (value >= 0.095 || value < -0.095) return "F2";
|
|
||||||
else if (value >= 0.0095 || value < -0.0095) return "F3";
|
|
||||||
else if (value >= 0.00095 || value < -0.00095) return "F4";
|
|
||||||
else if (value >= 0.000095 || value < -0.000095) return "F5";
|
|
||||||
else return "F6";
|
|
||||||
}
|
|
||||||
else /// if (sigDigits == 1)
|
|
||||||
{
|
|
||||||
if (value >= 0.95 || value < -0.95) return "F0";
|
|
||||||
else if (value >= 0.095 || value < -0.095) return "F1";
|
|
||||||
else if (value >= 0.0095 || value < -0.0095) return "F2";
|
|
||||||
else if (value >= 0.00095 || value < -0.00095) return "F3";
|
|
||||||
else if (value >= 0.000095 || value < -0.000095) return "F4";
|
|
||||||
else return "F5";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converts ErrorFlags integer to string. Supports up to 31 flags (E1..E31).
|
/// Converts ErrorFlags integer to string. Supports up to 31 flags (E1..E31).
|
||||||
@@ -158,9 +54,9 @@ namespace Results
|
|||||||
|
|
||||||
public static string PassedColorStr(bool passed, bool useRedGreenColor)
|
public static string PassedColorStr(bool passed, bool useRedGreenColor)
|
||||||
{
|
{
|
||||||
#if PUCHONG_PT200
|
#if PUCHONG_200
|
||||||
return (useRedGreenColor) ? (passed ? "OK|Green" : "NG|Red") : (passed ? "OK|White" : "NG|White");
|
return (useRedGreenColor) ? (passed ? "OK|Green" : "NG|Red") : (passed ? "OK|White" : "NG|White");
|
||||||
#elif BAHRAIN_50
|
#elif BAHRAIN_50 || DUBAJ_50
|
||||||
return (useRedGreenColor) ? (passed ? "PASSED|Green" : "FAILED|Red") : (passed ? "PASSED|White" : "FAILED|White");
|
return (useRedGreenColor) ? (passed ? "PASSED|Green" : "FAILED|Red") : (passed ? "PASSED|White" : "FAILED|White");
|
||||||
#elif LANG_PL
|
#elif LANG_PL
|
||||||
return (useRedGreenColor) ? (passed ? "+|Green" : "-|Red") : (passed ? "+|White" : "-|White");
|
return (useRedGreenColor) ? (passed ? "+|Green" : "-|Red") : (passed ? "+|White" : "-|White");
|
||||||
@@ -170,6 +66,5 @@ namespace Results
|
|||||||
return (useRedGreenColor) ? (passed ? "OK|Green" : "NOK|Red") : (passed ? "OK|White" : "NOK|White");
|
return (useRedGreenColor) ? (passed ? "OK|Green" : "NOK|Red") : (passed ? "OK|White" : "NOK|White");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+122
-61
@@ -1,5 +1,5 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -132,25 +132,31 @@ namespace Results
|
|||||||
/// Static list of all available items
|
/// Static list of all available items
|
||||||
public static readonly IList<WMeterRsltItemSpec> AllItems;
|
public static readonly IList<WMeterRsltItemSpec> AllItems;
|
||||||
|
|
||||||
/// Static constructor that initializes the list of all items
|
/// <summary>
|
||||||
|
/// Initializes the <see cref="WMeterRsltItemSpec"/> class.
|
||||||
|
/// </summary>
|
||||||
|
/// Static constructor that initializes the list of all items
|
||||||
static WMeterRsltItemSpec()
|
static WMeterRsltItemSpec()
|
||||||
{
|
{
|
||||||
AllItems = new List<WMeterRsltItemSpec>();
|
AllItems = new List<WMeterRsltItemSpec>();
|
||||||
|
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.String, "String", "", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => f));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.String, "String", "", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => f));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Separator, "Separator", "", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => string.Empty));
|
||||||
|
|
||||||
/// Common
|
/// Common
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_name, Strings.Test + "()", Quantity.String, ItemCategory.TestData, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Name())));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_name, Strings.Test + "()", Quantity.String, ItemCategory.TestData, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Name())));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Procedure_name, Strings.Procedure, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.ProcedureName())));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Procedure_name, Strings.Procedure, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.ProcedureName())));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_number, Strings.Batch_nr, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.BatchNr())));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Proc_description, Strings.Procedure_description, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.ProcedureDescription)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_method, Strings.Test_method + "()", Quantity.String, ItemCategory.TestData, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Method())));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_number, Strings.Batch_nr, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.BatchNr())));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_method, Strings.Test_method + "()", Quantity.String, ItemCategory.TestData, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Method())));
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Volume
|
/// Volume
|
||||||
///
|
///
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_volume, Strings.Test_vol + "()", Quantity.Volume, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).TargetVolume())));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_volume, Strings.Test_vol + "()", Quantity.Volume, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).TargetVolume())));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume, string.Format("{0} Mt. ()", Strings.VName_Vol), Strings.Tooltip_Vol_Mt, Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeMeter)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.VolumeCTV, string.Format("{0} CTV ()", Strings.VName_Vol), Quantity.Volume, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetTestRslt(t).VolumeCTV)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_volume, string.Format("{0} rm ()", Strings.VName_Vol), Strings.Tooltip_Vol_rm, Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeRef)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume, string.Format("{0} Mt. ()", Strings.VName_Vol), Strings.Tooltip_Vol_Mt, Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeMeter)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_volume, string.Format("{0} rm ()", Strings.VName_Vol), Strings.Tooltip_Vol_rm, Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeRef)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_main, string.Format("{0} {1} ()", Strings.VName_Vol, Strings.main), Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeMeter)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_main, string.Format("{0} {1} ()", Strings.VName_Vol, Strings.main), Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeMeter)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_aux, string.Format("{0} {1} ()", Strings.VName_Vol, Strings.aux), Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeMeter)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_aux, string.Format("{0} {1} ()", Strings.VName_Vol, Strings.aux), Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeMeter)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume, Strings.Start_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeStart)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume, Strings.Start_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeStart)));
|
||||||
@@ -175,6 +181,7 @@ namespace Results
|
|||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Density, Strings.Density + " ()", Quantity.Density, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetTestRslt(t).DensityLine)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Density, Strings.Density + " ()", Quantity.Density, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetTestRslt(t).DensityLine)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Density_correction, Strings.Density_correction + " ()", Quantity.Density, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", (w.Batch.DensityCorr))));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Density_correction, Strings.Density_correction + " ()", Quantity.Density, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", (w.Batch.DensityCorr))));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Rho_Wa_calc, string.Format("{0} of sample", Strings.Density), Quantity.Density, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V4", RealDensity)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Rho_Wa_calc, string.Format("{0} of sample", Strings.Density), Quantity.Density, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V4", RealDensity)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.RhoDistilledWtrAtMeLineTemp, string.Format("{0} of distilled water at T line", Strings.Density), Quantity.Density, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V4", (w.GetTestRslt(t) == null) ? 0 : Config.Formulas.DistilledWaterDensityFromTemp((w.GetTestRslt(t).TempUpMean + w.GetTestRslt(t).TempDownMean) / 2))));
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Date and time
|
/// Date and time
|
||||||
@@ -185,24 +192,39 @@ namespace Results
|
|||||||
///
|
///
|
||||||
/// Time (duration)
|
/// Time (duration)
|
||||||
///
|
///
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_time, Strings.T_s + "()", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TestTime)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Timestamp_start, "Timestamp start ()", Quantity.Time, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).TimestampStart)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Diverter_start_time, "Diverter start time ()", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).DiverterStart)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Timestamp_end, "Timestamp end ()", Quantity.Time, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).TimestampEnd)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Diverter_end_time, "Diverter end time ()", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).DiverterEnd)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_time_ni, Strings.T_s + "_ni()", Quantity.Time, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u, f, p, "V3", w.GetMeterTestRslt(t).TestTime)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_time, Strings.T_s + "()", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TestTime)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.PMax_test_time, "Pressure test time ()", "Pressure test time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsPMaxTest()) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TestTime)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Diverter_start_time, "Diverter start time ()", "Diverter start time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsDiverter()) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).DiverterStart)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Diverter_end_time, "Diverter end time ()", "Diverter end time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsDiverter()) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).DiverterEnd)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_valve_open_time, "Start valve open time ()", "Start valve open time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsStartStop()) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).DiverterStart)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_valve_close_time, "Start valve close time ()", "Start valve close time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsStartStop()) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).DiverterEnd)));
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Flow
|
/// Flow
|
||||||
///
|
///
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_from, string.Format("{0} {1}", Strings.VName_Flow, Strings.from), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qfrom())));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_from, string.Format("{0} {1}", Strings.VName_Flow, Strings.from), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qfrom())));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_to, string.Format("{0} {1}", Strings.VName_Flow, Strings.to), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qto())));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_to, string.Format("{0} {1}", Strings.VName_Flow, Strings.to), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qto())));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow, string.Format("{0} v r", Strings.VName_Flow), Strings.Tooltip_Q_v_r, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowVolume)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow, string.Format("{0} v r", Strings.VName_Flow), Strings.Tooltip_Q_v_r, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowVolume)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_mean, string.Format("{0} rim ()", Strings.VName_Flow), Strings.Tooltip_Q_rim, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMean)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Qc, string.Format("Qc"), "Calculated water meter flow", Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).VolumeCTV / w.GetMeterTestRslt(t).TestTime * 3.6 * w.GetMeterTestRslt(t).PulsesMaster / w.GetTestRslt(t).PulsesMaster)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_min, string.Format("{0} ref min ()", Strings.VName_Flow), Strings.Tooltip_Q_min, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMin)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_mean, string.Format("{0} rim ()", Strings.VName_Flow), Strings.Tooltip_Q_rim, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMean)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_max, string.Format("{0} ref max ()", Strings.VName_Flow), Strings.Tooltip_Q_max, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMax)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_min, string.Format("{0} ref min ()", Strings.VName_Flow), Strings.Tooltip_Q_min, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMin)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_start, string.Format("{0} ref start ()", Strings.VName_Flow), Strings.Tooltip_Q_start, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowStart)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_max, string.Format("{0} ref max ()", Strings.VName_Flow), Strings.Tooltip_Q_max, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMax)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_end, string.Format("{0} ref end ()", Strings.VName_Flow), Strings.Tooltip_Q_end, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowEnd)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_start, string.Format("{0} ref start ()",Strings.VName_Flow),Strings.Tooltip_Q_start, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowStart)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_rise, string.Format("{0} {1}", Strings.VName_Flow, Strings.rise), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QRise == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QRise)) : ""));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_end, string.Format("{0} ref end ()", Strings.VName_Flow), Strings.Tooltip_Q_end, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowEnd)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_fall, string.Format("{0} {1}", Strings.VName_Flow, Strings.fall), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QFall == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QFall)) : ""));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv, string.Format("{0} ctv ()", Strings.VName_Flow), "CTV of the flow (mean val.)",Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).TestTime == 0) ? 0 : 3.6 * w.GetTestRslt(t).VolumeCTV / w.GetTestRslt(t).TestTime)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_sensitivity, string.Format("{0} {1}", Strings.VName_Flow, Strings.sensitivity), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QRise == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QRise)) : ""));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_min, string.Format("{0} ctv min ()", Strings.VName_Flow), "Min. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowMin / w.GetTestRslt(t).VolumeMaster)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_max, string.Format("{0} ctv max ()", Strings.VName_Flow), "Max. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowMax / w.GetTestRslt(t).VolumeMaster)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_start, string.Format("{0} ctv start ()", Strings.VName_Flow), "Start flow CTV", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowStart / w.GetTestRslt(t).VolumeMaster)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_end, string.Format("{0} ctv end ()", Strings.VName_Flow), "End flow CTV", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowEnd / w.GetTestRslt(t).VolumeMaster)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_rise, string.Format("{0} {1}", Strings.VName_Flow, Strings.rise), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QRise == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QRise)) : ""));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_fall, string.Format("{0} {1}", Strings.VName_Flow, Strings.fall), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QFall == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QFall)) : ""));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_sensitivity, string.Format("{0} {1}", Strings.VName_Flow, Strings.sensitivity), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QRise == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QRise)) : ""));
|
||||||
|
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.ConstMaster, string.Format("k MID ()"), "Const. of the reference flow meter", Quantity.PulsePerLtr, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", ((w.GetTestRslt(t).ConstMaster < float.Epsilon) ? 0 : (1 / w.GetTestRslt(t).ConstMaster)))));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.ConstMasterRaw, string.Format("k MID raw ()"), "Const. of the ref. flow meter uncorrected",Quantity.PulsePerLtr, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", ((w.GetTestRslt(t).ConstMasterRaw < float.Epsilon) ? 0 : (1 / w.GetTestRslt(t).ConstMasterRaw)))));
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Temperature
|
/// Temperature
|
||||||
@@ -233,14 +255,14 @@ namespace Results
|
|||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_max, string.Format("{0} DI max ()", Strings.VName_Temp), Strings.Tooltip_T_di_max, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempDivMax)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_max, string.Format("{0} DI max ()", Strings.VName_Temp), Strings.Tooltip_T_di_max, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempDivMax)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_rho_0, string.Format("{0} RO0", Strings.VName_Temp), Strings.Tooltip_T_rho_0, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", AtTemperature)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_rho_0, string.Format("{0} RO0", Strings.VName_Temp), Strings.Tooltip_T_rho_0, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", AtTemperature)));
|
||||||
#if HEAT_METERS
|
#if HEAT_METERS
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_mean, string.Format("{0} hi me", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (w.GetTestRslt(t).Custom1).ToString(GetPr(p, "F3"))));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_mean, string.Format("{0} hi me", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).Custom1)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_start, string.Format("{0} hi st", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (w.GetTestRslt(t).Custom2).ToString(GetPr(p, "F3"))));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_start, string.Format("{0} hi st", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).Custom2)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_end, string.Format("{0} hi en", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (w.GetTestRslt(t).Custom3).ToString(GetPr(p, "F3"))));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_end, string.Format("{0} hi en", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).Custom3)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_avg, string.Format("{0} hi av", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : ((w.GetTestRslt(t).Custom2 + w.GetTestRslt(t).Custom3) / 2).ToString(GetPr(p, "F3"))));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_avg, string.Format("{0} hi av", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", (w.GetTestRslt(t).Custom2 + w.GetTestRslt(t).Custom3) / 2)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_mean, string.Format("{0} lo me", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (w.GetTestRslt(t).Custom6).ToString(GetPr(p, "F3"))));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_mean, string.Format("{0} lo me", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).Custom6)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_start, string.Format("{0} lo st", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (w.GetTestRslt(t).Custom7).ToString(GetPr(p, "F3"))));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_start, string.Format("{0} lo st", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).Custom7)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_end, string.Format("{0} lo en", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (w.GetTestRslt(t).Custom8).ToString(GetPr(p, "F3"))));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_end, string.Format("{0} lo en", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).Custom8)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_avg, string.Format("{0} lo av", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : ((w.GetTestRslt(t).Custom7 + w.GetTestRslt(t).Custom8) / 2).ToString(GetPr(p, "F3"))));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_avg, string.Format("{0} lo av", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", (w.GetTestRslt(t).Custom7 + w.GetTestRslt(t).Custom8) / 2)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -264,6 +286,10 @@ namespace Results
|
|||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_avg, string.Format("{0} DE avg ()", Strings.VName_Press), Strings.Tooltip_P_de_avg, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).PressDeltaStart + w.GetTestRslt(t).PressDeltaEnd) / 2)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_avg, string.Format("{0} DE avg ()", Strings.VName_Press), Strings.Tooltip_P_de_avg, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).PressDeltaStart + w.GetTestRslt(t).PressDeltaEnd) / 2)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_min, string.Format("{0} DE min ()", Strings.VName_Press), Strings.Tooltip_P_de_min, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressDeltaMin)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_min, string.Format("{0} DE min ()", Strings.VName_Press), Strings.Tooltip_P_de_min, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressDeltaMin)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_max, string.Format("{0} DE max ()", Strings.VName_Press), Strings.Tooltip_P_de_max, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressDeltaMax)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_max, string.Format("{0} DE max ()", Strings.VName_Press), Strings.Tooltip_P_de_max, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressDeltaMax)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_mean_per_mtr, string.Format("{0} DE ME per mtr.()", Strings.VName_Press), "P delta mean per one meter", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressDeltaMean / Math.Max(1, w.GetTestRslt(t).Batch.WaterMeters.Count))));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_mean_from_up_down, string.Format("{0} UP-DW ME ()", Strings.VName_Press), "P delta mean from UP/DW", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressUpMean - w.GetTestRslt(t).PressDownMean)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_mean_from_up_down_per_mtr, string.Format("{0} UP-DW ME per mtr ()", Strings.VName_Press), "P delta mean from UP/DW per one meter", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).PressUpMean - w.GetTestRslt(t).PressDownMean) / Math.Max(1, w.GetTestRslt(t).Batch.WaterMeters.Count))));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_PMax_test_mean, string.Format("{0} PMax mean ()", Strings.VName_Press), "Mean PMax test pressure", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsPMaxTest()) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).PressUpMean + w.GetTestRslt(t).PressDownMean) / 2)));
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Ambient temperature/pressure/humidity/Buoyancy
|
/// Ambient temperature/pressure/humidity/Buoyancy
|
||||||
@@ -283,14 +309,17 @@ namespace Results
|
|||||||
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.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).Uncertainty())));
|
||||||
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, 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)));
|
||||||
#if TURA_IPERL || TURA_SPECIAL
|
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
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, string.Format("{0} rel. ()", Strings.VName_Error), Strings.Tooltip_E_rel, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "0" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).Error)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, string.Format("{0} rel. ()", Strings.VName_Error), Strings.Tooltip_E_rel, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "0" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).Error)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.LastError, string.Format("{0} rel. last ()", Strings.VName_Error), Strings.Tooltip_E_rel_last, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "0" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).LastError)));
|
||||||
#else
|
#else
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, string.Format("{0} rel. ()", Strings.VName_Error), Strings.Tooltip_E_rel, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).Error)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, string.Format("{0} rel. ()", Strings.VName_Error), Strings.Tooltip_E_rel, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).Error)));
|
||||||
#endif
|
#endif
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed, Strings.Result, Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => string.IsNullOrEmpty(t) ? w.PassedColorStr() : ((w.GetMeterTestRslt(t) == null) ? "" : w.GetMeterTestRslt(t).PassedColorStr())));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed, Strings.Result, Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => string.IsNullOrEmpty(t) ? w.PassedColorStr(f)
|
||||||
|
: ((w.GetMeterTestRslt(t) == null) ? "" : w.GetMeterTestRslt(t).PassedColorStr(f))));
|
||||||
|
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.ResultOrErrorFlags, "Winiki lub E", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, string.IsNullOrEmpty(w.ErrorFlagstStr()) ? (w.WaterMeterData.Text4 + w.PassedColorStr()) : w.ErrorFlagstStr()))); /// PL specific result
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.ResultOrErrorFlags, "Winiki lub E", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.PassedOrErrorFlagsStr()))); /// PL specific result
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Water meter info
|
/// Water meter info
|
||||||
@@ -313,8 +342,7 @@ namespace Results
|
|||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_profile_sensitivity_class, "Flow profile sensitivity class", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.FlowProfileSensitivityClass.ToDescription())));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_profile_sensitivity_class, "Flow profile sensitivity class", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.FlowProfileSensitivityClass.ToDescription())));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Approval_info, Strings.Approval, Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.ApprovalInfo)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Approval_info, Strings.Approval, Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.ApprovalInfo)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Certificate, "Certificate", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Certificate)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Certificate, "Certificate", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Certificate)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Medium, "Water cold/hot", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Medium.ToDescription())));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulses_per_liter, Strings.PulsesLiter, Quantity.PulsePerLtr, ItemCategory.MeterData, (w, t, u, f, p) => FormatDbl(u, f, p, "V4", w.WaterMeterData.PulsesPerLtr)));
|
|
||||||
|
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text1, "Text1", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Text1)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text1, "Text1", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Text1)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text2, "Text2", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Text2)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text2, "Text2", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Text2)));
|
||||||
@@ -330,10 +358,17 @@ namespace Results
|
|||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Formatted_WM_ID, "Formatted WM ID", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? string.Format("{0}-{1}", w.BatchNr(), w.WMPosition) : string.Format(f, w.StartTime(), w.EndTime(), w.BatchNr(), w.WMPosition, w.SerialNr)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Formatted_WM_ID, "Formatted WM ID", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? string.Format("{0}-{1}", w.BatchNr(), w.WMPosition) : string.Format(f, w.StartTime(), w.EndTime(), w.BatchNr(), w.WMPosition, w.SerialNr)));
|
||||||
|
|
||||||
/// Water meters results (single)
|
/// Water meters results (single)
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state, Strings.End_state, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.EndState)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state, Strings.End_state, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.EndState)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulses, Strings.Pulses + "()", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F0", w.GetMeterTestRslt(t).PulsesMeter)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulses, Strings.Pulses + "()", Quantity.Pulses, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F0", w.GetMeterTestRslt(t).IsPulses() ? w.GetMeterTestRslt(t).PulsesMeter : 0)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_pulses, Strings.RefPulses + "()", Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t).PulsesMaster)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_pulses_ni, Strings.RefPulses + "_ni()", Quantity.Pulses, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F0", w.GetMeterTestRslt(t).PulsesMaster)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulses__liter, Strings.PulsesLiter + "()", Quantity.PulsePerLtr, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).PulsesPerLiter)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_pulses, Strings.RefPulses + "()", Quantity.Pulses, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F0", w.GetTestRslt(t).PulsesMaster)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Camera_angle, "Angle ()", "Angle measured by a camera", Quantity.Pulses, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F0", w.GetMeterTestRslt(t).IsCamera() ? w.GetMeterTestRslt(t).PulsesMeter : 0)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Camera_angle_start, "Start angle ()", "Start angle measured by a camera", Quantity.Pulses, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F0", w.GetMeterTestRslt(t).IsCamera() ? w.GetMeterTestRslt(t).VolumeStart * w.GetMeterTestRslt(t).PulsesPerLiter : 0)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Camera_angle_end, "End angle ()", "End angle measured by a camera", Quantity.Pulses, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F0", w.GetMeterTestRslt(t).IsCamera() ? w.GetMeterTestRslt(t).VolumeEnd * w.GetMeterTestRslt(t).PulsesPerLiter : 0)));
|
||||||
|
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulses_per_liter, Strings.PulsesLiter, Quantity.PulsePerLtr, ItemCategory.MeterData, (w, t, u, f, p) => FormatDbl(u, f, p, "V4", w.WaterMeterData.PulsesPerLtr)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulse__liter, Strings.PulsesLiter + "()", Quantity.PulsePerLtr, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).IsCamera() ? 0 : w.GetMeterTestRslt(t).PulsesPerLiter)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Degree__liter, "Degree per liter ()", Quantity.PulsePerLtr, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).IsCamera() ? w.GetMeterTestRslt(t).PulsesPerLiter : 0)));
|
||||||
|
|
||||||
/// Water meters results (combined)
|
/// Water meters results (combined)
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_main, Strings.Err_main + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).Error)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_main, Strings.Err_main + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).Error)));
|
||||||
@@ -344,8 +379,14 @@ namespace Results
|
|||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state_aux, Strings.EndState_aux, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.EndStateAux)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state_aux, Strings.EndState_aux, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.EndStateAux)));
|
||||||
|
|
||||||
/// Batch info
|
/// Batch info
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_bench_ID, Strings.Bench, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.TestBenchId.ToString())));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_ID, Strings.Bench_ID, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.TestBenchId.ToString())));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Program_version, Strings.Ver, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.ProgramVersion)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_name, Strings.Bench_name, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.TestBenchName) ? w.Batch.TestBenchName : "")));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address1, Strings.Address + " 1", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address1) ? w.Batch.Address1 : "")));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address2, Strings.Address + " 2", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address2) ? w.Batch.Address2 : "")));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address3, Strings.Address + " 3", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address3) ? w.Batch.Address3 : "")));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address4, Strings.Address + " 4", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address4) ? w.Batch.Address4 : "")));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address5, Strings.Address + " 5", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address5) ? w.Batch.Address5 : "")));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Program_version, Strings.Ver, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.ProgramVersion)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_nr, Strings.User_nr, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.Batch.UserNumber)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_nr, Strings.User_nr, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.Batch.UserNumber)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_name, Strings.User, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, Users.Entities.User.EncodedStrToUserName(w.Batch.UserName))));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_name, Strings.User, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, Users.Entities.User.EncodedStrToUserName(w.Batch.UserName))));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_description, Strings.User_description, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, Users.Entities.User.EncodedStrToFullName(w.Batch.UserName))));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_description, Strings.User_description, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, Users.Entities.User.EncodedStrToFullName(w.Batch.UserName))));
|
||||||
@@ -360,29 +401,36 @@ namespace Results
|
|||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed_seals_count, "Seals count of passed meters", Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.Batch.PassedMetersCount() * int.Parse(w.WaterMeterData.Text5))));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed_seals_count, "Seals count of passed meters", Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.Batch.PassedMetersCount() * int.Parse(w.WaterMeterData.Text5))));
|
||||||
|
|
||||||
/// Extra water meter data
|
/// Extra water meter data
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Result_code, Strings.Result_code, Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.ResultCode)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Result_code, Strings.Result_code, Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.ResultCode)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Remark, Strings.Remark, Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => FormatStr(f, w.Batch.Remark)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.WM_remark, string.Format("{0} {1}", Strings.Water_Meter, Strings.Remark), Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.Remark)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Remark, string.Format("{0} {1}", Strings.Batch, Strings.Remark), Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => FormatStr(f, w.Batch.Remark)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Meter_type, Strings.Meter_type, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Compound ? Strings.Compound : (w.WaterMeterData.HeatMeter ? Strings.Heat_meter : Strings.Single))));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Meter_type, Strings.Meter_type, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Compound ? Strings.Compound : (w.WaterMeterData.HeatMeter ? Strings.Heat_meter : Strings.Single))));
|
||||||
|
|
||||||
#if HEAT_METERS
|
#if HEAT_METERS
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy, Strings.Energy + "()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) == null) ? "" : (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeMeter).ToString(GetPr(p, "F1"))));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy, Strings.Energy + "()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) == null) ? "" : FormatDbl(u, f, p, "F1", (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeMeter))));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_energy, Strings.Energy_ref + "()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) == null) ? "" : (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeRef).ToString(GetPr(p, "F1"))));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_energy, Strings.Energy_ref + "()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) == null) ? "" : FormatDbl(u, f, p, "F1", (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeRef))));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if IPERL
|
#if IPERL
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.OrigCalibFactor, "iPerl OrigCalibFactor", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.OrigCalibFactor)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.OrigCalibFactor, "iPerl OrigCalibFactor", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.OrigCalibFactor)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.CalibFactor, "iPerl CalibFactor", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.CalibFactor)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.CalibFactor, "iPerl CalibFactor", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.CalibFactor)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2ErrWOCorrection, "iPerl Q2ErrWOCorrection", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.Q2ErrWOCorrection)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.OrigCalibFactorLNA,"iPerl OrigCalibFactorLNA",Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.OrigCalibFactorLNA)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrectionDone, "iPerl Q2CorrectionDone", Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => (w.Q2CorrectionDone ? Strings.Yes : Strings.No)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.CalibFactorLNA, "iPerl CalibFactorLNA", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.CalibFactorLNA)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrRFlow, "iPerl Q2CorrRFlow", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrRFlow)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2ErrWOCorrection, "iPerl Q2ErrWOCorrection", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.Q2ErrWOCorrection)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrLFlow, "iPerl Q2CorrLFlow", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrLFlow)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrectionDone, "iPerl Q2CorrectionDone", Quantity.Boolean,ItemCategory.MeterResult, (w, t, u, f, p) => (w.Q2CorrectionDone ? Strings.Yes : Strings.No)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrFlowRight, "iPerl Q2CorrFlowRight", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrFlowRight)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrRFlow, "iPerl Q2CorrRFlow", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrRL)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.FW_Version, "iPerl FW version", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.FWVersion)));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrLFlow, "iPerl Q2CorrLFlow", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrLR)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrFlowRight, "iPerl Q2CorrFlowRight", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrFlowRight)));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.FW_Version, "iPerl FW version", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.FWVersion)));
|
||||||
|
#if ORACLE_DB
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.Max_test_index, "iPerl test index", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, (w.Pruefindex % 100))));
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestDone, Strings.Test_done + "()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) != null && w.GetMeterTestRslt(t).TestDone) ? Strings.Yes : Strings.No));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestDone, Strings.Test_done + "()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => FormatBool(f, (w.GetMeterTestRslt(t) != null) && w.GetMeterTestRslt(t).TestDone)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestPassed, Strings.Test_passed + "()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) != null && w.GetMeterTestRslt(t).Passed) ? Strings.Yes : Strings.No));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestPassed, Strings.Test_passed + "()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => FormatBool(f, (w.GetMeterTestRslt(t) != null) && w.GetMeterTestRslt(t).Passed)));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.ErrorFlags, Strings.Error_flags + "()", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) != null) ? w.GetTestRslt(t).ErrorFlagsStr() : w.ErrorFlagstStr())));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.ErrorFlags, Strings.Error_flags + "()", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) != null) ? w.GetTestRslt(t).ErrorFlagsStr() : w.ErrorFlagsStr())));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E1, "E1 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0001) != 0) ? Strings.Yes : Strings.No));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.ErrorFlagsEx, Strings.Error_flags + "Ex", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.ErrorFlagsStrEx())));
|
||||||
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.E1, "E1 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0001) != 0) ? Strings.Yes : Strings.No));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E2, "E2 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0002) != 0) ? Strings.Yes : Strings.No));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.E2, "E2 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0002) != 0) ? Strings.Yes : Strings.No));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E3, "E3 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0004) != 0) ? Strings.Yes : Strings.No));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.E3, "E3 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0004) != 0) ? Strings.Yes : Strings.No));
|
||||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E4, "E4 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0008) != 0) ? Strings.Yes : Strings.No));
|
AllItems.Add(new WMeterRsltItemSpec(ItemID.E4, "E4 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0008) != 0) ? Strings.Yes : Strings.No));
|
||||||
@@ -415,9 +463,22 @@ namespace Results
|
|||||||
return string.IsNullOrEmpty(format) ? value : string.Format(format, value);
|
return string.IsNullOrEmpty(format) ? value : string.Format(format, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string FormatBool(string format, bool value)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(format))
|
||||||
|
{
|
||||||
|
return value ? Strings.Yes : Strings.No;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string[] yesNo = format.Split(new char[] { '~' });
|
||||||
|
return value ? yesNo[0] : ((yesNo.Length >= 2) ? yesNo[1] : Strings.No);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static string FormatInt(string format, int value)
|
public static string FormatInt(string format, int value)
|
||||||
{
|
{
|
||||||
return string.IsNullOrEmpty(format) ? value.ToString() : string.Format(format, value);
|
return string.IsNullOrEmpty(format) ? value.ToString() : string.Format(format, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string FormatDbl(Config.Unit units, string format, string precisionOrEmpty, string dfltPrecision, double v)
|
public static string FormatDbl(Config.Unit units, string format, string precisionOrEmpty, string dfltPrecision, double v)
|
||||||
@@ -437,7 +498,7 @@ namespace Results
|
|||||||
int significantDigits;
|
int significantDigits;
|
||||||
if (int.TryParse(precision.Substring(1), out significantDigits))
|
if (int.TryParse(precision.Substring(1), out significantDigits))
|
||||||
{
|
{
|
||||||
precision = Utils.SignificantDigitsToFmt(val, significantDigits);
|
precision = Config.Utils.SignificantDigitsToFmt(val, significantDigits);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -475,7 +536,7 @@ namespace Results
|
|||||||
int significantDigits;
|
int significantDigits;
|
||||||
if (int.TryParse(precision.Substring(1), out significantDigits))
|
if (int.TryParse(precision.Substring(1), out significantDigits))
|
||||||
{
|
{
|
||||||
precision = Utils.SignificantDigitsToFmt(val1, significantDigits);
|
precision = Config.Utils.SignificantDigitsToFmt(val1, significantDigits);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+83
-70
@@ -28,76 +28,88 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.printerClassComboBox = new System.Windows.Forms.ComboBox();
|
this.printerClassComboBox = new System.Windows.Forms.ComboBox();
|
||||||
this.changePrinterClassButton = new System.Windows.Forms.Button();
|
this.changePrinterClassButton = new System.Windows.Forms.Button();
|
||||||
this.label1 = new System.Windows.Forms.Label();
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
this.configureButton = new System.Windows.Forms.Button();
|
this.configureButton = new System.Windows.Forms.Button();
|
||||||
this.cancelButton = new System.Windows.Forms.Button();
|
this.cancelButton = new System.Windows.Forms.Button();
|
||||||
this.SuspendLayout();
|
this.importButton = new System.Windows.Forms.Button();
|
||||||
//
|
this.SuspendLayout();
|
||||||
// printerClassComboBox
|
//
|
||||||
//
|
// printerClassComboBox
|
||||||
this.printerClassComboBox.Enabled = false;
|
//
|
||||||
this.printerClassComboBox.FormattingEnabled = true;
|
this.printerClassComboBox.Enabled = false;
|
||||||
this.printerClassComboBox.Location = new System.Drawing.Point(12, 29);
|
this.printerClassComboBox.FormattingEnabled = true;
|
||||||
this.printerClassComboBox.Name = "printerClassComboBox";
|
this.printerClassComboBox.Location = new System.Drawing.Point(12, 29);
|
||||||
this.printerClassComboBox.Size = new System.Drawing.Size(389, 21);
|
this.printerClassComboBox.Name = "printerClassComboBox";
|
||||||
this.printerClassComboBox.TabIndex = 0;
|
this.printerClassComboBox.Size = new System.Drawing.Size(457, 21);
|
||||||
//
|
this.printerClassComboBox.TabIndex = 0;
|
||||||
// changePrinterClassButton
|
//
|
||||||
//
|
// changePrinterClassButton
|
||||||
this.changePrinterClassButton.Location = new System.Drawing.Point(15, 67);
|
//
|
||||||
this.changePrinterClassButton.Name = "changePrinterClassButton";
|
this.changePrinterClassButton.Location = new System.Drawing.Point(12, 67);
|
||||||
this.changePrinterClassButton.Size = new System.Drawing.Size(161, 43);
|
this.changePrinterClassButton.Name = "changePrinterClassButton";
|
||||||
this.changePrinterClassButton.TabIndex = 1;
|
this.changePrinterClassButton.Size = new System.Drawing.Size(161, 43);
|
||||||
this.changePrinterClassButton.Text = "Change printer type (configuration will be deleted)";
|
this.changePrinterClassButton.TabIndex = 1;
|
||||||
this.changePrinterClassButton.UseVisualStyleBackColor = true;
|
this.changePrinterClassButton.Text = "Change printer type (configuration will be deleted)";
|
||||||
this.changePrinterClassButton.Click += new System.EventHandler(this.changePrinterClassButton_Click);
|
this.changePrinterClassButton.UseVisualStyleBackColor = true;
|
||||||
//
|
this.changePrinterClassButton.Click += new System.EventHandler(this.changePrinterClassButton_Click);
|
||||||
// label1
|
//
|
||||||
//
|
// label1
|
||||||
this.label1.AutoSize = true;
|
//
|
||||||
this.label1.Location = new System.Drawing.Point(12, 9);
|
this.label1.AutoSize = true;
|
||||||
this.label1.Name = "label1";
|
this.label1.Location = new System.Drawing.Point(12, 9);
|
||||||
this.label1.Size = new System.Drawing.Size(60, 13);
|
this.label1.Name = "label1";
|
||||||
this.label1.TabIndex = 2;
|
this.label1.Size = new System.Drawing.Size(60, 13);
|
||||||
this.label1.Text = "Printer type";
|
this.label1.TabIndex = 2;
|
||||||
//
|
this.label1.Text = "Printer type";
|
||||||
// configureButton
|
//
|
||||||
//
|
// configureButton
|
||||||
this.configureButton.Location = new System.Drawing.Point(196, 67);
|
//
|
||||||
this.configureButton.Name = "configureButton";
|
this.configureButton.Location = new System.Drawing.Point(188, 67);
|
||||||
this.configureButton.Size = new System.Drawing.Size(95, 43);
|
this.configureButton.Name = "configureButton";
|
||||||
this.configureButton.TabIndex = 3;
|
this.configureButton.Size = new System.Drawing.Size(83, 43);
|
||||||
this.configureButton.Text = "Configure";
|
this.configureButton.TabIndex = 3;
|
||||||
this.configureButton.UseVisualStyleBackColor = true;
|
this.configureButton.Text = "Configure";
|
||||||
this.configureButton.Click += new System.EventHandler(this.configureButton_Click);
|
this.configureButton.UseVisualStyleBackColor = true;
|
||||||
//
|
this.configureButton.Click += new System.EventHandler(this.configureButton_Click);
|
||||||
// cancelButton
|
//
|
||||||
//
|
// cancelButton
|
||||||
this.cancelButton.Location = new System.Drawing.Point(306, 67);
|
//
|
||||||
this.cancelButton.Name = "cancelButton";
|
this.cancelButton.Location = new System.Drawing.Point(383, 67);
|
||||||
this.cancelButton.Size = new System.Drawing.Size(95, 43);
|
this.cancelButton.Name = "cancelButton";
|
||||||
this.cancelButton.TabIndex = 4;
|
this.cancelButton.Size = new System.Drawing.Size(84, 43);
|
||||||
this.cancelButton.Text = "Cancel";
|
this.cancelButton.TabIndex = 4;
|
||||||
this.cancelButton.UseVisualStyleBackColor = true;
|
this.cancelButton.Text = "Cancel";
|
||||||
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
|
this.cancelButton.UseVisualStyleBackColor = true;
|
||||||
//
|
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
|
||||||
// PrinterConfigDlg
|
//
|
||||||
//
|
// importButton
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
//
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.importButton.Location = new System.Drawing.Point(285, 67);
|
||||||
this.ClientSize = new System.Drawing.Size(416, 122);
|
this.importButton.Name = "importButton";
|
||||||
this.Controls.Add(this.cancelButton);
|
this.importButton.Size = new System.Drawing.Size(83, 43);
|
||||||
this.Controls.Add(this.configureButton);
|
this.importButton.TabIndex = 5;
|
||||||
this.Controls.Add(this.label1);
|
this.importButton.Text = "Import";
|
||||||
this.Controls.Add(this.changePrinterClassButton);
|
this.importButton.UseVisualStyleBackColor = true;
|
||||||
this.Controls.Add(this.printerClassComboBox);
|
this.importButton.Click += new System.EventHandler(this.importButton_Click);
|
||||||
this.Name = "PrinterConfigDlg";
|
//
|
||||||
this.Text = "Printer configuration";
|
// PrinterConfigDlg
|
||||||
this.Load += new System.EventHandler(this.PrinterClassDlg_Load);
|
//
|
||||||
this.ResumeLayout(false);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.PerformLayout();
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(481, 122);
|
||||||
|
this.Controls.Add(this.importButton);
|
||||||
|
this.Controls.Add(this.cancelButton);
|
||||||
|
this.Controls.Add(this.configureButton);
|
||||||
|
this.Controls.Add(this.label1);
|
||||||
|
this.Controls.Add(this.changePrinterClassButton);
|
||||||
|
this.Controls.Add(this.printerClassComboBox);
|
||||||
|
this.Name = "PrinterConfigDlg";
|
||||||
|
this.Text = "Printer configuration";
|
||||||
|
this.Load += new System.EventHandler(this.PrinterClassDlg_Load);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,5 +120,6 @@
|
|||||||
private System.Windows.Forms.Label label1;
|
private System.Windows.Forms.Label label1;
|
||||||
private System.Windows.Forms.Button configureButton;
|
private System.Windows.Forms.Button configureButton;
|
||||||
private System.Windows.Forms.Button cancelButton;
|
private System.Windows.Forms.Button cancelButton;
|
||||||
|
private System.Windows.Forms.Button importButton;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using Config.Entities;
|
||||||
using TBF.BenchControl;
|
using TBF.BenchControl;
|
||||||
using TBF.BenchControl.Generic;
|
using TBF.BenchControl.Generic;
|
||||||
|
|
||||||
@@ -90,7 +92,7 @@ namespace ResultsBrowser.Forms
|
|||||||
cfgControl.Config.ItemNr = 0;
|
cfgControl.Config.ItemNr = 0;
|
||||||
|
|
||||||
TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg();
|
TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg();
|
||||||
cfgForm.TbfComponents = new List<Config.Entities.Component>();
|
cfgForm.TbfComponents = new List<Component>();
|
||||||
|
|
||||||
cfgForm.ComponentCfgCtrl = cfgControl;
|
cfgForm.ComponentCfgCtrl = cfgControl;
|
||||||
cfgForm.UnlockAfterStart = true;
|
cfgForm.UnlockAfterStart = true;
|
||||||
@@ -104,23 +106,65 @@ namespace ResultsBrowser.Forms
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
private void importButton_Click(object sender, EventArgs e)
|
||||||
/// Updates component factory
|
{
|
||||||
/// </summary>
|
string oriClassName = PrinterClass;
|
||||||
/// <param name="className">Component class name</param>
|
|
||||||
/// <param name="factory">Reference to a factory</param>
|
|
||||||
/// <returns>true when factory changed</returns>
|
|
||||||
IComponentFactory GetFactory(string className)
|
|
||||||
{
|
|
||||||
if (!string.IsNullOrEmpty(className))
|
|
||||||
{
|
|
||||||
foreach (var fac in TbfComponents.Factories)
|
|
||||||
{
|
|
||||||
if (fac.ClassName == className) return fac;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
OpenFileDialog dlg = new OpenFileDialog();
|
||||||
}
|
if (dlg.ShowDialog() != DialogResult.OK) return;
|
||||||
}
|
|
||||||
|
/// Import a procedure from a file
|
||||||
|
Component newComponent = Component.Import(new StreamReader(dlg.FileName, System.Text.Encoding.UTF8));
|
||||||
|
|
||||||
|
bool classIsOK = false;
|
||||||
|
foreach (var pc in printerFactories)
|
||||||
|
{
|
||||||
|
if (newComponent.ClassName == pc.ClassName) { classIsOK = true; break; }
|
||||||
|
}
|
||||||
|
|
||||||
|
if (classIsOK)
|
||||||
|
{
|
||||||
|
printerClassComboBox.Text = newComponent.ClassName;
|
||||||
|
|
||||||
|
IComponentCfg printerCfg = TbfComponents.CmpntCfgFromCmpntEntity(newComponent);
|
||||||
|
if (printerCfg != null)
|
||||||
|
{
|
||||||
|
PrinterClass = newComponent.ClassName;
|
||||||
|
PrinterCfg = printerCfg.CreateDbEntity().Parameters;
|
||||||
|
DialogResult = DialogResult.OK;
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Importing printer configuration failed, file is corrupt.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Invalid class of the imported component.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates component factory
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="className">Component class name</param>
|
||||||
|
/// <param name="factory">Reference to a factory</param>
|
||||||
|
/// <returns>true when factory changed</returns>
|
||||||
|
IComponentFactory GetFactory(string className)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(className))
|
||||||
|
{
|
||||||
|
foreach (var fac in TbfComponents.Factories)
|
||||||
|
{
|
||||||
|
if (fac.ClassName == className) return fac;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+113
-97
@@ -28,103 +28,118 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||||
this.statisticsListView = new System.Windows.Forms.ListView();
|
this.statisticsListView = new System.Windows.Forms.ListView();
|
||||||
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
|
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
|
||||||
this.printButton = new System.Windows.Forms.Button();
|
this.printButton = new System.Windows.Forms.Button();
|
||||||
this.closeButton = new System.Windows.Forms.Button();
|
this.closeButton = new System.Windows.Forms.Button();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
this.exportButton = new System.Windows.Forms.Button();
|
||||||
this.splitContainer1.Panel1.SuspendLayout();
|
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||||
this.splitContainer1.Panel2.SuspendLayout();
|
this.splitContainer1.Panel1.SuspendLayout();
|
||||||
this.splitContainer1.SuspendLayout();
|
this.splitContainer1.Panel2.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
|
this.splitContainer1.SuspendLayout();
|
||||||
this.splitContainer2.Panel2.SuspendLayout();
|
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
|
||||||
this.splitContainer2.SuspendLayout();
|
this.splitContainer2.Panel2.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.splitContainer2.SuspendLayout();
|
||||||
//
|
this.SuspendLayout();
|
||||||
// splitContainer1
|
//
|
||||||
//
|
// splitContainer1
|
||||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
//
|
||||||
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||||
this.splitContainer1.Name = "splitContainer1";
|
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||||
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
this.splitContainer1.Name = "splitContainer1";
|
||||||
//
|
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||||
// splitContainer1.Panel1
|
//
|
||||||
//
|
// splitContainer1.Panel1
|
||||||
this.splitContainer1.Panel1.Controls.Add(this.statisticsListView);
|
//
|
||||||
//
|
this.splitContainer1.Panel1.Controls.Add(this.statisticsListView);
|
||||||
// splitContainer1.Panel2
|
//
|
||||||
//
|
// splitContainer1.Panel2
|
||||||
this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
|
//
|
||||||
this.splitContainer1.Size = new System.Drawing.Size(572, 409);
|
this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
|
||||||
this.splitContainer1.SplitterDistance = 320;
|
this.splitContainer1.Size = new System.Drawing.Size(572, 409);
|
||||||
this.splitContainer1.TabIndex = 0;
|
this.splitContainer1.SplitterDistance = 320;
|
||||||
//
|
this.splitContainer1.TabIndex = 0;
|
||||||
// statisticsListView
|
//
|
||||||
//
|
// statisticsListView
|
||||||
this.statisticsListView.Dock = System.Windows.Forms.DockStyle.Fill;
|
//
|
||||||
this.statisticsListView.GridLines = true;
|
this.statisticsListView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
this.statisticsListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
|
this.statisticsListView.GridLines = true;
|
||||||
this.statisticsListView.Location = new System.Drawing.Point(0, 0);
|
this.statisticsListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
|
||||||
this.statisticsListView.Name = "statisticsListView";
|
this.statisticsListView.Location = new System.Drawing.Point(0, 0);
|
||||||
this.statisticsListView.Size = new System.Drawing.Size(572, 320);
|
this.statisticsListView.Name = "statisticsListView";
|
||||||
this.statisticsListView.TabIndex = 0;
|
this.statisticsListView.Size = new System.Drawing.Size(572, 320);
|
||||||
this.statisticsListView.UseCompatibleStateImageBehavior = false;
|
this.statisticsListView.TabIndex = 0;
|
||||||
//
|
this.statisticsListView.UseCompatibleStateImageBehavior = false;
|
||||||
// splitContainer2
|
//
|
||||||
//
|
// splitContainer2
|
||||||
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
|
//
|
||||||
this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
|
this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||||
this.splitContainer2.Name = "splitContainer2";
|
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
|
||||||
//
|
this.splitContainer2.Name = "splitContainer2";
|
||||||
// splitContainer2.Panel2
|
//
|
||||||
//
|
// splitContainer2.Panel2
|
||||||
this.splitContainer2.Panel2.Controls.Add(this.printButton);
|
//
|
||||||
this.splitContainer2.Panel2.Controls.Add(this.closeButton);
|
this.splitContainer2.Panel2.Controls.Add(this.exportButton);
|
||||||
this.splitContainer2.Size = new System.Drawing.Size(572, 85);
|
this.splitContainer2.Panel2.Controls.Add(this.printButton);
|
||||||
this.splitContainer2.SplitterDistance = 249;
|
this.splitContainer2.Panel2.Controls.Add(this.closeButton);
|
||||||
this.splitContainer2.TabIndex = 0;
|
this.splitContainer2.Size = new System.Drawing.Size(572, 85);
|
||||||
//
|
this.splitContainer2.SplitterDistance = 249;
|
||||||
// printButton
|
this.splitContainer2.TabIndex = 0;
|
||||||
//
|
//
|
||||||
this.printButton.Location = new System.Drawing.Point(38, 22);
|
// printButton
|
||||||
this.printButton.Name = "printButton";
|
//
|
||||||
this.printButton.Size = new System.Drawing.Size(108, 41);
|
this.printButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.printButton.TabIndex = 0;
|
this.printButton.Location = new System.Drawing.Point(4, 21);
|
||||||
this.printButton.Text = "Print";
|
this.printButton.Name = "printButton";
|
||||||
this.printButton.UseVisualStyleBackColor = true;
|
this.printButton.Size = new System.Drawing.Size(94, 41);
|
||||||
this.printButton.Click += new System.EventHandler(this.printButton_Click);
|
this.printButton.TabIndex = 0;
|
||||||
//
|
this.printButton.Text = "Print";
|
||||||
// closeButton
|
this.printButton.UseVisualStyleBackColor = true;
|
||||||
//
|
this.printButton.Click += new System.EventHandler(this.printButton_Click);
|
||||||
this.closeButton.Location = new System.Drawing.Point(176, 22);
|
//
|
||||||
this.closeButton.Name = "closeButton";
|
// closeButton
|
||||||
this.closeButton.Size = new System.Drawing.Size(108, 41);
|
//
|
||||||
this.closeButton.TabIndex = 1;
|
this.closeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.closeButton.Text = "Close";
|
this.closeButton.Location = new System.Drawing.Point(203, 21);
|
||||||
this.closeButton.UseVisualStyleBackColor = true;
|
this.closeButton.Name = "closeButton";
|
||||||
this.closeButton.Click += new System.EventHandler(this.closeButton_Click);
|
this.closeButton.Size = new System.Drawing.Size(94, 41);
|
||||||
//
|
this.closeButton.TabIndex = 2;
|
||||||
// StatisticsDlg
|
this.closeButton.Text = "Close";
|
||||||
//
|
this.closeButton.UseVisualStyleBackColor = true;
|
||||||
this.AcceptButton = this.closeButton;
|
this.closeButton.Click += new System.EventHandler(this.closeButton_Click);
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
//
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
// exportButton
|
||||||
this.ClientSize = new System.Drawing.Size(572, 409);
|
//
|
||||||
this.Controls.Add(this.splitContainer1);
|
this.exportButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.Name = "StatisticsDlg";
|
this.exportButton.Location = new System.Drawing.Point(103, 21);
|
||||||
this.Text = "StatisticsDlg";
|
this.exportButton.Name = "exportButton";
|
||||||
this.Load += new System.EventHandler(this.StatisticsDlg_Load);
|
this.exportButton.Size = new System.Drawing.Size(94, 41);
|
||||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
this.exportButton.TabIndex = 1;
|
||||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
this.exportButton.Text = "Export";
|
||||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
this.exportButton.UseVisualStyleBackColor = true;
|
||||||
this.splitContainer1.ResumeLayout(false);
|
this.exportButton.Click += new System.EventHandler(this.exportButton_Click);
|
||||||
this.splitContainer2.Panel2.ResumeLayout(false);
|
//
|
||||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
|
// StatisticsDlg
|
||||||
this.splitContainer2.ResumeLayout(false);
|
//
|
||||||
this.ResumeLayout(false);
|
this.AcceptButton = this.closeButton;
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(572, 409);
|
||||||
|
this.Controls.Add(this.splitContainer1);
|
||||||
|
this.Name = "StatisticsDlg";
|
||||||
|
this.Text = "StatisticsDlg";
|
||||||
|
this.Load += new System.EventHandler(this.StatisticsDlg_Load);
|
||||||
|
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||||
|
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||||
|
this.splitContainer1.ResumeLayout(false);
|
||||||
|
this.splitContainer2.Panel2.ResumeLayout(false);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
|
||||||
|
this.splitContainer2.ResumeLayout(false);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,5 +150,6 @@
|
|||||||
private System.Windows.Forms.SplitContainer splitContainer2;
|
private System.Windows.Forms.SplitContainer splitContainer2;
|
||||||
private System.Windows.Forms.Button closeButton;
|
private System.Windows.Forms.Button closeButton;
|
||||||
private System.Windows.Forms.Button printButton;
|
private System.Windows.Forms.Button printButton;
|
||||||
|
private System.Windows.Forms.Button exportButton;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,7 @@ using System.Windows.Forms;
|
|||||||
using Results.Entities;
|
using Results.Entities;
|
||||||
using ResultsBrowser.Resources;
|
using ResultsBrowser.Resources;
|
||||||
using ResultsBrowser.Output.Printers.Statistics;
|
using ResultsBrowser.Output.Printers.Statistics;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace ResultsBrowser.Forms
|
namespace ResultsBrowser.Forms
|
||||||
{
|
{
|
||||||
@@ -217,5 +218,55 @@ namespace ResultsBrowser.Forms
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void exportButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (rowValues == null || columnValues == null || occurances == null) return;
|
||||||
|
|
||||||
|
SaveFileDialog dlg = new SaveFileDialog();
|
||||||
|
dlg.Filter = "CSV files (*.csv)|*.csv|All files (*.*)|*.*";
|
||||||
|
|
||||||
|
if (dlg.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
//IList<MonitoringDB.ItemSpec> items = currentQR.ProjectedItems;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (TextWriter writer = new StreamWriter(dlg.FileName, false, System.Text.Encoding.UTF8))
|
||||||
|
{
|
||||||
|
if (twoDim)
|
||||||
|
{
|
||||||
|
/// Write column headers
|
||||||
|
for (int i = 0; i < columnValues.Count; i++)
|
||||||
|
{
|
||||||
|
writer.Write(string.Format(";\"{0}\"", columnValues[i]));
|
||||||
|
}
|
||||||
|
writer.WriteLine();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
writer.WriteLine(string.Format("\"{0}\";\"{1}\"", rowItem.Caption, Strings.Count));
|
||||||
|
}
|
||||||
|
|
||||||
|
int nrColumns = Math.Max(1, columnValues.Count);
|
||||||
|
|
||||||
|
/// Write rows, row header first
|
||||||
|
for (int j = 0; j < rowValues.Count; j++)
|
||||||
|
{
|
||||||
|
writer.Write(string.Format("\"{0}\"", rowValues[j]));
|
||||||
|
for (int i = 0; i < nrColumns; i++)
|
||||||
|
{
|
||||||
|
writer.Write(string.Format(";{0}", occurances[j,i]));
|
||||||
|
}
|
||||||
|
writer.WriteLine();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
MessageBox.Show(exc.Message, Strings.Error_exporting_results, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
|
|||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("Sensus")]
|
[assembly: AssemblyCompany("Sensus")]
|
||||||
[assembly: AssemblyProduct("ResultsBrowser")]
|
[assembly: AssemblyProduct("ResultsBrowser")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2015 - 2017 Sensus Slovensko a.s.")]
|
[assembly: AssemblyCopyright("Copyright © 2015 - 2018 Sensus Slovensko a.s.")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("2.18.847.0")]
|
[assembly: AssemblyVersion("2.18.1098.0")]
|
||||||
[assembly: AssemblyFileVersion("2.18.847.0")]
|
[assembly: AssemblyFileVersion("2.18.1098.0")]
|
||||||
|
|||||||
@@ -237,4 +237,7 @@
|
|||||||
<data name="Print" xml:space="preserve">
|
<data name="Print" xml:space="preserve">
|
||||||
<value>Vytisknout</value>
|
<value>Vytisknout</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Add_data_from_Oracle" xml:space="preserve">
|
||||||
|
<value>Dohledej údaje z Oracle</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -637,7 +637,7 @@
|
|||||||
<value>zimna</value>
|
<value>zimna</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="hot" xml:space="preserve">
|
<data name="hot" xml:space="preserve">
|
||||||
<value>gorąca</value>
|
<value>ciepła</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Product_name" xml:space="preserve">
|
<data name="Product_name" xml:space="preserve">
|
||||||
<value>Nazwa produktu</value>
|
<value>Nazwa produktu</value>
|
||||||
|
|||||||
@@ -813,4 +813,19 @@
|
|||||||
<data name="Configure_printer" xml:space="preserve">
|
<data name="Configure_printer" xml:space="preserve">
|
||||||
<value>Configure printer</value>
|
<value>Configure printer</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="No_printer_defined" xml:space="preserve">
|
||||||
|
<value>No printer defined</value>
|
||||||
|
</data>
|
||||||
|
<data name="Printing_failed" xml:space="preserve">
|
||||||
|
<value>Printing failed</value>
|
||||||
|
</data>
|
||||||
|
<data name="Printing_completed" xml:space="preserve">
|
||||||
|
<value>Printing completed</value>
|
||||||
|
</data>
|
||||||
|
<data name="Error_exporting_results" xml:space="preserve">
|
||||||
|
<value>Error exporting results</value>
|
||||||
|
</data>
|
||||||
|
<data name="Add_data_from_Oracle" xml:space="preserve">
|
||||||
|
<value>Add data from Oracle</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
+45
@@ -105,6 +105,15 @@ namespace ResultsBrowser.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Add data from Oracle.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Add_data_from_Oracle {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Add_data_from_Oracle", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Add filter.
|
/// Looks up a localized string similar to Add filter.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1014,6 +1023,15 @@ namespace ResultsBrowser.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Error exporting results.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Error_exporting_results {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Error_exporting_results", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Error loading users from the database:.
|
/// Looks up a localized string similar to Error loading users from the database:.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1644,6 +1662,15 @@ namespace ResultsBrowser.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to No printer defined.
|
||||||
|
/// </summary>
|
||||||
|
internal static string No_printer_defined {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("No_printer_defined", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to No program settings found. .
|
/// Looks up a localized string similar to No program settings found. .
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1770,6 +1797,24 @@ namespace ResultsBrowser.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Printing completed.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Printing_completed {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Printing_completed", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Printing failed.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Printing_failed {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Printing_failed", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Procedure.
|
/// Looks up a localized string similar to Procedure.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
|
<DefineConstants>TRACE;DEBUG;ZODINO;LANG_RU</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
<DefineConstants>TRACE;MUNICH</DefineConstants>
|
<DefineConstants>TRACE;ZODINO;LANG_RU</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@@ -207,12 +207,17 @@
|
|||||||
<EmbeddedResource Include="Resources\Strings.cs.resx" />
|
<EmbeddedResource Include="Resources\Strings.cs.resx" />
|
||||||
<EmbeddedResource Include="Resources\Strings.de.resx" />
|
<EmbeddedResource Include="Resources\Strings.de.resx" />
|
||||||
<EmbeddedResource Include="Resources\Strings.it.resx" />
|
<EmbeddedResource Include="Resources\Strings.it.resx" />
|
||||||
<EmbeddedResource Include="Resources\Strings.pl.resx" />
|
<EmbeddedResource Include="Resources\Strings.pl.resx">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Resources\Strings.resx">
|
<EmbeddedResource Include="Resources\Strings.resx">
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
<LastGenOutput>Strings1.Designer.cs</LastGenOutput>
|
<LastGenOutput>Strings1.Designer.cs</LastGenOutput>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Resources\Strings.ru.resx">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Resources\Strings.ru.resx" />
|
|
||||||
<EmbeddedResource Include="ResultsBrowserWnd.resx">
|
<EmbeddedResource Include="ResultsBrowserWnd.resx">
|
||||||
<DependentUpon>ResultsBrowserWnd.cs</DependentUpon>
|
<DependentUpon>ResultsBrowserWnd.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using NHibernate;
|
|||||||
using Results.Entities;
|
using Results.Entities;
|
||||||
using TBF.BenchControl;
|
using TBF.BenchControl;
|
||||||
using TBF.BenchControl.Generic;
|
using TBF.BenchControl.Generic;
|
||||||
|
using TBF.BenchControl.GenericDevices;
|
||||||
using ResultsBrowser.Filters;
|
using ResultsBrowser.Filters;
|
||||||
using ResultsBrowser.Resources;
|
using ResultsBrowser.Resources;
|
||||||
|
|
||||||
@@ -25,6 +26,9 @@ namespace ResultsBrowser
|
|||||||
DateTime timePeriodStart;
|
DateTime timePeriodStart;
|
||||||
DateTime timePeriodEnd;
|
DateTime timePeriodEnd;
|
||||||
|
|
||||||
|
static IList<IComponent> tbfComponents;
|
||||||
|
static IList<IDevice> tbfDevices;
|
||||||
|
|
||||||
public ResultsBrowserWnd(string[] args)
|
public ResultsBrowserWnd(string[] args)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@@ -33,6 +37,9 @@ namespace ResultsBrowser
|
|||||||
filtersConfig = new FiltersConfig();
|
filtersConfig = new FiltersConfig();
|
||||||
this.args = args;
|
this.args = args;
|
||||||
|
|
||||||
|
tbfComponents = new List<TBF.BenchControl.Generic.IComponent>();
|
||||||
|
tbfDevices = new List<IDevice>();
|
||||||
|
|
||||||
timePeriodStart = new DateTime(0);
|
timePeriodStart = new DateTime(0);
|
||||||
timePeriodEnd = new DateTime(0);
|
timePeriodEnd = new DateTime(0);
|
||||||
}
|
}
|
||||||
@@ -337,13 +344,14 @@ namespace ResultsBrowser
|
|||||||
if (waterMeters == null || waterMeters.Count == 0 || items.Count == 0) return;
|
if (waterMeters == null || waterMeters.Count == 0 || items.Count == 0) return;
|
||||||
|
|
||||||
SaveFileDialog dlg = new SaveFileDialog();
|
SaveFileDialog dlg = new SaveFileDialog();
|
||||||
|
dlg.Filter = "CSV files (*.csv)|*.csv|All files (*.*)|*.*";
|
||||||
|
|
||||||
if (dlg.ShowDialog() == DialogResult.OK)
|
if (dlg.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
using (TextWriter writer = new StreamWriter(dlg.FileName))
|
try
|
||||||
{
|
{
|
||||||
try
|
using (TextWriter writer = new StreamWriter(dlg.FileName, false, System.Text.Encoding.UTF8))
|
||||||
{
|
{
|
||||||
for (int i = 0; i < items.Count; i++)
|
for (int i = 0; i < items.Count; i++)
|
||||||
{
|
{
|
||||||
writer.Write(items[i].Caption);
|
writer.Write(items[i].Caption);
|
||||||
@@ -372,14 +380,15 @@ namespace ResultsBrowser
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
|
||||||
{
|
|
||||||
MessageBox.Show(exc.Message, Strings.Error_displaying_results, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
MessageBox.Show(exc.Message, Strings.Error_exporting_results, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void printQueryResultsBtn_Click(object sender, EventArgs e)
|
private void printQueryResultsBtn_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (waterMeters == null || waterMeters.Count == 0) return;
|
if (waterMeters == null || waterMeters.Count == 0) return;
|
||||||
@@ -389,28 +398,80 @@ namespace ResultsBrowser
|
|||||||
{
|
{
|
||||||
new Results.Output.Printers.Munich.MunichPrintDocument(string.Format("4/13 - {0}", BenchName()), wm, Config.Entities.PageOrientation.Portrait).Print();
|
new Results.Output.Printers.Munich.MunichPrintDocument(string.Format("4/13 - {0}", BenchName()), wm, Config.Entities.PageOrientation.Portrait).Print();
|
||||||
}
|
}
|
||||||
#elif CEVAK_PT40_272
|
#elif CEVAK_40
|
||||||
IList<Results.Entities.Batch> batches = new List<Results.Entities.Batch>();
|
IList<Results.Entities.Batch> batches = new List<Results.Entities.Batch>();
|
||||||
foreach (var wm in waterMeters)
|
foreach (var wm in waterMeters)
|
||||||
{
|
{
|
||||||
if (!batches.Contains(wm.Batch)) batches.Add(wm.Batch);
|
if (!batches.Contains(wm.Batch)) batches.Add(wm.Batch);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var batch in batches)
|
//foreach (var batch in batches)
|
||||||
{
|
//{
|
||||||
new Results.Output.Printers.Cevak.PrintDocumentCevak(batch,
|
// new Results.Output.Printers.Cevak.PrintDocumentCevak(batch,
|
||||||
Config.Entities.PageOrientation.Portrait,
|
// Config.Entities.PageOrientation.Portrait,
|
||||||
60, 60, 60,
|
// 60, 60, 60,
|
||||||
"PT40 Z/E-35-A",
|
// "PT40 Z/E-35-A",
|
||||||
"0111-OOP-C035-13").Print();
|
// "0111-OOP-C035-13").Print();
|
||||||
}
|
//}
|
||||||
#else
|
#else
|
||||||
foreach (var wm in waterMeters)
|
if (string.IsNullOrEmpty(filtersConfig.PrinterClass))
|
||||||
{
|
{
|
||||||
new Results.Output.Printers.Munich.MunichPrintDocument(string.Format("4/13 - {0}", BenchName()), wm, Config.Entities.PageOrientation.Portrait).Print();
|
MessageBox.Show(Strings.No_printer_defined);
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Config.Entities.Component cmpnt = new Config.Entities.Component();
|
||||||
|
cmpnt.Name = "printer";
|
||||||
|
cmpnt.ClassName = filtersConfig.PrinterClass;
|
||||||
|
cmpnt.Parameters = filtersConfig.PrinterCfg;
|
||||||
|
|
||||||
|
IComponentFactory printerFactory = GetFactory(filtersConfig.PrinterClass);
|
||||||
|
IComponentCfg printerCfg = printerFactory.CmpntCfgFromCmpntEntity(cmpnt);
|
||||||
|
IComponent component = printerFactory.GetComponent(printerCfg, tbfComponents);
|
||||||
|
IResultsPrinter printer = component as IResultsPrinter;
|
||||||
|
|
||||||
|
if (printer== null)
|
||||||
|
{
|
||||||
|
MessageBox.Show(Strings.No_printer_defined);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
tbfComponents.Clear();
|
||||||
|
tbfDevices.Clear();
|
||||||
|
tbfComponents.Add(component);
|
||||||
|
IDevice dev = component as IDevice;
|
||||||
|
if (dev != null)
|
||||||
|
{
|
||||||
|
dev.Initialize();
|
||||||
|
tbfDevices.Add(dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Find batches
|
||||||
|
IList<Results.Entities.Batch> batches = new List<Results.Entities.Batch>();
|
||||||
|
foreach (var wm in waterMeters)
|
||||||
|
{
|
||||||
|
if (!batches.Contains(wm.Batch)) batches.Add(wm.Batch);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var batch in batches)
|
||||||
|
{
|
||||||
|
IOperation printOp = printer.PrintResultsOp(batch);
|
||||||
|
printOp.Start();
|
||||||
|
while (printOp.Run() != Event.ResultsPrinted) { }
|
||||||
|
printOp.Stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
MessageBox.Show(Strings.Printing_completed);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
MessageBox.Show(Strings.Printing_failed);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void statisticsBtn_Click(object sender, EventArgs e)
|
private void statisticsBtn_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@@ -436,6 +497,7 @@ namespace ResultsBrowser
|
|||||||
statisticsDlg.ShowDialog();
|
statisticsDlg.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates component factory
|
/// Updates component factory
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace Statistics
|
||||||
|
{
|
||||||
|
static class Program
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The main entry point for the application.
|
||||||
|
/// </summary>
|
||||||
|
[STAThread]
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
Application.EnableVisualStyles();
|
||||||
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
Application.Run(new StatisticsDlg());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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("Statistics")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("Statistics")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2018")]
|
||||||
|
[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("9e674819-ed89-4d9a-a4e8-3bf2cc69cfc2")]
|
||||||
|
|
||||||
|
// 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("2.18.1088.0")]
|
||||||
|
[assembly: AssemblyFileVersion("2.18.1088.0")]
|
||||||
Generated
+2
-2
@@ -8,7 +8,7 @@
|
|||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
namespace MonitoringDB.Properties {
|
namespace Statistics.Properties {
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ namespace MonitoringDB.Properties {
|
|||||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
get {
|
get {
|
||||||
if (object.ReferenceEquals(resourceMan, null)) {
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MonitoringDB.Properties.Resources", typeof(Resources).Assembly);
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Statistics.Properties.Resources", typeof(Resources).Assembly);
|
||||||
resourceMan = temp;
|
resourceMan = temp;
|
||||||
}
|
}
|
||||||
return resourceMan;
|
return resourceMan;
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
<?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.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="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
</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" 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>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Statistics.Properties {
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
|
||||||
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
|
public static Settings Default {
|
||||||
|
get {
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||||
|
<Profiles>
|
||||||
|
<Profile Name="(Default)" />
|
||||||
|
</Profiles>
|
||||||
|
<Settings />
|
||||||
|
</SettingsFile>
|
||||||
Generated
+117
@@ -0,0 +1,117 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Statistics.Resources {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
|
/// </summary>
|
||||||
|
// 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()]
|
||||||
|
internal class Strings {
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Strings() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 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 {
|
||||||
|
get {
|
||||||
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Statistics.Resources.Strings", typeof(Strings).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 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 {
|
||||||
|
get {
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Flow.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Flow {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Flow", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to From.
|
||||||
|
/// </summary>
|
||||||
|
internal static string From {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("From", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Statistics.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Statistics {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Statistics", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Time period.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Time_period {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Time_period", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to To.
|
||||||
|
/// </summary>
|
||||||
|
internal static string To {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("To", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Water meters.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Water_meters {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Water_meters", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,138 @@
|
|||||||
|
<?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="Flow" xml:space="preserve">
|
||||||
|
<value>Flow</value>
|
||||||
|
</data>
|
||||||
|
<data name="From" xml:space="preserve">
|
||||||
|
<value>From</value>
|
||||||
|
</data>
|
||||||
|
<data name="Statistics" xml:space="preserve">
|
||||||
|
<value>Statistics</value>
|
||||||
|
</data>
|
||||||
|
<data name="Time_period" xml:space="preserve">
|
||||||
|
<value>Time period</value>
|
||||||
|
</data>
|
||||||
|
<data name="To" xml:space="preserve">
|
||||||
|
<value>To</value>
|
||||||
|
</data>
|
||||||
|
<data name="Water_meters" xml:space="preserve">
|
||||||
|
<value>Water meters</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
@@ -0,0 +1,138 @@
|
|||||||
|
<?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="Flow" xml:space="preserve">
|
||||||
|
<value>Prietok</value>
|
||||||
|
</data>
|
||||||
|
<data name="From" xml:space="preserve">
|
||||||
|
<value>Od</value>
|
||||||
|
</data>
|
||||||
|
<data name="Statistics" xml:space="preserve">
|
||||||
|
<value>Štatistiky</value>
|
||||||
|
</data>
|
||||||
|
<data name="Time_period" xml:space="preserve">
|
||||||
|
<value>Časový úsek</value>
|
||||||
|
</data>
|
||||||
|
<data name="To" xml:space="preserve">
|
||||||
|
<value>Do</value>
|
||||||
|
</data>
|
||||||
|
<data name="Water_meters" xml:space="preserve">
|
||||||
|
<value>Vodomery</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
@@ -0,0 +1,137 @@
|
|||||||
|
<?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>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||||
|
<ProductVersion>8.0.30703</ProductVersion>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<ProjectGuid>{36755E1D-6FC3-4D9C-8DD3-0250D51532E0}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>Statistics</RootNamespace>
|
||||||
|
<AssemblyName>Statistics</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||||
|
<TargetFrameworkProfile>
|
||||||
|
</TargetFrameworkProfile>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="FluentNHibernate">
|
||||||
|
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Iesi.Collections">
|
||||||
|
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="MySql.Data">
|
||||||
|
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="NHibernate">
|
||||||
|
<HintPath>..\packages\NHibernate.4.0.4.4000\lib\net40\NHibernate.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.Deployment" />
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Resources\Strings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<DependentUpon>Strings.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="StatisticsDlg.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="StatisticsDlg.Designer.cs">
|
||||||
|
<DependentUpon>StatisticsDlg.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="UserControls\Enums.cs" />
|
||||||
|
<Compile Include="UserControls\MidOrWaterMetersCtrl.cs">
|
||||||
|
<SubType>UserControl</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="UserControls\MidOrWaterMetersCtrl.Designer.cs">
|
||||||
|
<DependentUpon>MidOrWaterMetersCtrl.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="UserControls\StatisticsCtrl.cs">
|
||||||
|
<SubType>UserControl</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="UserControls\StatisticsCtrl.Designer.cs">
|
||||||
|
<DependentUpon>StatisticsCtrl.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<EmbeddedResource Include="Resources\Strings.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Resources\Strings.sk.resx" />
|
||||||
|
<EmbeddedResource Include="StatisticsDlg.resx">
|
||||||
|
<DependentUpon>StatisticsDlg.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
</Compile>
|
||||||
|
<EmbeddedResource Include="UserControls\MidOrWaterMetersCtrl.resx">
|
||||||
|
<DependentUpon>MidOrWaterMetersCtrl.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="UserControls\StatisticsCtrl.resx">
|
||||||
|
<DependentUpon>StatisticsCtrl.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<None Include="app.config" />
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Results\Results.csproj">
|
||||||
|
<Project>{9D0DCC88-DC81-47EB-9FDD-4C3907871BFB}</Project>
|
||||||
|
<Name>Results</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
<Target Name="BeforeBuild">
|
||||||
|
</Target>
|
||||||
|
<Target Name="AfterBuild">
|
||||||
|
</Target>
|
||||||
|
-->
|
||||||
|
</Project>
|
||||||
Generated
+294
@@ -0,0 +1,294 @@
|
|||||||
|
namespace Statistics
|
||||||
|
{
|
||||||
|
partial class StatisticsDlg
|
||||||
|
{
|
||||||
|
/// <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.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||||
|
this.timePeriodGroupBox = new System.Windows.Forms.GroupBox();
|
||||||
|
this.timePeriodCheckBox = new System.Windows.Forms.CheckBox();
|
||||||
|
this.toLabel1 = new System.Windows.Forms.Label();
|
||||||
|
this.fromLabel1 = new System.Windows.Forms.Label();
|
||||||
|
this.dateTimeFromPicker = new System.Windows.Forms.DateTimePicker();
|
||||||
|
this.dateTimeToPicker = new System.Windows.Forms.DateTimePicker();
|
||||||
|
this.midsTabControl = new System.Windows.Forms.TabControl();
|
||||||
|
this.wr10TabPage = new System.Windows.Forms.TabPage();
|
||||||
|
this.wr11TabPage = new System.Windows.Forms.TabPage();
|
||||||
|
this.wr13TabPage = new System.Windows.Forms.TabPage();
|
||||||
|
this.wr14TabPage = new System.Windows.Forms.TabPage();
|
||||||
|
this.wr15TabPage = new System.Windows.Forms.TabPage();
|
||||||
|
this.wmsBenchesControl = new Statistics.UserControls.MidOrWaterMetersCtrl();
|
||||||
|
this.i1BenchesControl = new Statistics.UserControls.MidOrWaterMetersCtrl();
|
||||||
|
this.i2BbenchesControl = new Statistics.UserControls.MidOrWaterMetersCtrl();
|
||||||
|
this.i3BenchesControl = new Statistics.UserControls.MidOrWaterMetersCtrl();
|
||||||
|
this.i4BenchesControl = new Statistics.UserControls.MidOrWaterMetersCtrl();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||||
|
this.splitContainer1.Panel1.SuspendLayout();
|
||||||
|
this.splitContainer1.Panel2.SuspendLayout();
|
||||||
|
this.splitContainer1.SuspendLayout();
|
||||||
|
this.timePeriodGroupBox.SuspendLayout();
|
||||||
|
this.midsTabControl.SuspendLayout();
|
||||||
|
this.wr10TabPage.SuspendLayout();
|
||||||
|
this.wr11TabPage.SuspendLayout();
|
||||||
|
this.wr13TabPage.SuspendLayout();
|
||||||
|
this.wr14TabPage.SuspendLayout();
|
||||||
|
this.wr15TabPage.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// splitContainer1
|
||||||
|
//
|
||||||
|
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
|
||||||
|
this.splitContainer1.IsSplitterFixed = true;
|
||||||
|
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.splitContainer1.Name = "splitContainer1";
|
||||||
|
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||||
|
//
|
||||||
|
// splitContainer1.Panel1
|
||||||
|
//
|
||||||
|
this.splitContainer1.Panel1.Controls.Add(this.timePeriodGroupBox);
|
||||||
|
//
|
||||||
|
// splitContainer1.Panel2
|
||||||
|
//
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.midsTabControl);
|
||||||
|
this.splitContainer1.Size = new System.Drawing.Size(1368, 826);
|
||||||
|
this.splitContainer1.SplitterDistance = 90;
|
||||||
|
this.splitContainer1.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// timePeriodGroupBox
|
||||||
|
//
|
||||||
|
this.timePeriodGroupBox.Controls.Add(this.timePeriodCheckBox);
|
||||||
|
this.timePeriodGroupBox.Controls.Add(this.toLabel1);
|
||||||
|
this.timePeriodGroupBox.Controls.Add(this.fromLabel1);
|
||||||
|
this.timePeriodGroupBox.Controls.Add(this.dateTimeFromPicker);
|
||||||
|
this.timePeriodGroupBox.Controls.Add(this.dateTimeToPicker);
|
||||||
|
this.timePeriodGroupBox.Location = new System.Drawing.Point(12, 10);
|
||||||
|
this.timePeriodGroupBox.Name = "timePeriodGroupBox";
|
||||||
|
this.timePeriodGroupBox.Size = new System.Drawing.Size(296, 74);
|
||||||
|
this.timePeriodGroupBox.TabIndex = 2;
|
||||||
|
this.timePeriodGroupBox.TabStop = false;
|
||||||
|
//
|
||||||
|
// timePeriodCheckBox
|
||||||
|
//
|
||||||
|
this.timePeriodCheckBox.AutoSize = true;
|
||||||
|
this.timePeriodCheckBox.Location = new System.Drawing.Point(6, -2);
|
||||||
|
this.timePeriodCheckBox.Name = "timePeriodCheckBox";
|
||||||
|
this.timePeriodCheckBox.Size = new System.Drawing.Size(81, 17);
|
||||||
|
this.timePeriodCheckBox.TabIndex = 4;
|
||||||
|
this.timePeriodCheckBox.Text = "Time period";
|
||||||
|
this.timePeriodCheckBox.UseVisualStyleBackColor = true;
|
||||||
|
this.timePeriodCheckBox.CheckedChanged += new System.EventHandler(this.timePeriodCheckBox_CheckedChanged);
|
||||||
|
//
|
||||||
|
// toLabel1
|
||||||
|
//
|
||||||
|
this.toLabel1.AutoSize = true;
|
||||||
|
this.toLabel1.Location = new System.Drawing.Point(31, 48);
|
||||||
|
this.toLabel1.Name = "toLabel1";
|
||||||
|
this.toLabel1.Size = new System.Drawing.Size(20, 13);
|
||||||
|
this.toLabel1.TabIndex = 3;
|
||||||
|
this.toLabel1.Text = "To";
|
||||||
|
//
|
||||||
|
// fromLabel1
|
||||||
|
//
|
||||||
|
this.fromLabel1.AutoSize = true;
|
||||||
|
this.fromLabel1.Location = new System.Drawing.Point(31, 23);
|
||||||
|
this.fromLabel1.Name = "fromLabel1";
|
||||||
|
this.fromLabel1.Size = new System.Drawing.Size(30, 13);
|
||||||
|
this.fromLabel1.TabIndex = 2;
|
||||||
|
this.fromLabel1.Text = "From";
|
||||||
|
//
|
||||||
|
// dateTimeFromPicker
|
||||||
|
//
|
||||||
|
this.dateTimeFromPicker.Location = new System.Drawing.Point(81, 19);
|
||||||
|
this.dateTimeFromPicker.Name = "dateTimeFromPicker";
|
||||||
|
this.dateTimeFromPicker.Size = new System.Drawing.Size(200, 20);
|
||||||
|
this.dateTimeFromPicker.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// dateTimeToPicker
|
||||||
|
//
|
||||||
|
this.dateTimeToPicker.Location = new System.Drawing.Point(81, 44);
|
||||||
|
this.dateTimeToPicker.Name = "dateTimeToPicker";
|
||||||
|
this.dateTimeToPicker.Size = new System.Drawing.Size(200, 20);
|
||||||
|
this.dateTimeToPicker.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// midsTabControl
|
||||||
|
//
|
||||||
|
this.midsTabControl.Controls.Add(this.wr10TabPage);
|
||||||
|
this.midsTabControl.Controls.Add(this.wr11TabPage);
|
||||||
|
this.midsTabControl.Controls.Add(this.wr13TabPage);
|
||||||
|
this.midsTabControl.Controls.Add(this.wr14TabPage);
|
||||||
|
this.midsTabControl.Controls.Add(this.wr15TabPage);
|
||||||
|
this.midsTabControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.midsTabControl.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.midsTabControl.Name = "midsTabControl";
|
||||||
|
this.midsTabControl.SelectedIndex = 0;
|
||||||
|
this.midsTabControl.Size = new System.Drawing.Size(1368, 732);
|
||||||
|
this.midsTabControl.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// wr10TabPage
|
||||||
|
//
|
||||||
|
this.wr10TabPage.Controls.Add(this.wmsBenchesControl);
|
||||||
|
this.wr10TabPage.Location = new System.Drawing.Point(4, 22);
|
||||||
|
this.wr10TabPage.Name = "wr10TabPage";
|
||||||
|
this.wr10TabPage.Padding = new System.Windows.Forms.Padding(3);
|
||||||
|
this.wr10TabPage.Size = new System.Drawing.Size(1360, 706);
|
||||||
|
this.wr10TabPage.TabIndex = 0;
|
||||||
|
this.wr10TabPage.Text = "Water meters";
|
||||||
|
this.wr10TabPage.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// wr11TabPage
|
||||||
|
//
|
||||||
|
this.wr11TabPage.Controls.Add(this.i1BenchesControl);
|
||||||
|
this.wr11TabPage.Location = new System.Drawing.Point(4, 22);
|
||||||
|
this.wr11TabPage.Name = "wr11TabPage";
|
||||||
|
this.wr11TabPage.Padding = new System.Windows.Forms.Padding(3);
|
||||||
|
this.wr11TabPage.Size = new System.Drawing.Size(1360, 706);
|
||||||
|
this.wr11TabPage.TabIndex = 1;
|
||||||
|
this.wr11TabPage.Text = "I1";
|
||||||
|
this.wr11TabPage.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// wr13TabPage
|
||||||
|
//
|
||||||
|
this.wr13TabPage.Controls.Add(this.i2BbenchesControl);
|
||||||
|
this.wr13TabPage.Location = new System.Drawing.Point(4, 22);
|
||||||
|
this.wr13TabPage.Name = "wr13TabPage";
|
||||||
|
this.wr13TabPage.Padding = new System.Windows.Forms.Padding(3);
|
||||||
|
this.wr13TabPage.Size = new System.Drawing.Size(1360, 706);
|
||||||
|
this.wr13TabPage.TabIndex = 2;
|
||||||
|
this.wr13TabPage.Text = "I2";
|
||||||
|
this.wr13TabPage.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// wr14TabPage
|
||||||
|
//
|
||||||
|
this.wr14TabPage.Controls.Add(this.i3BenchesControl);
|
||||||
|
this.wr14TabPage.Location = new System.Drawing.Point(4, 22);
|
||||||
|
this.wr14TabPage.Name = "wr14TabPage";
|
||||||
|
this.wr14TabPage.Padding = new System.Windows.Forms.Padding(3);
|
||||||
|
this.wr14TabPage.Size = new System.Drawing.Size(1360, 706);
|
||||||
|
this.wr14TabPage.TabIndex = 3;
|
||||||
|
this.wr14TabPage.Text = "I3";
|
||||||
|
this.wr14TabPage.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// wr15TabPage
|
||||||
|
//
|
||||||
|
this.wr15TabPage.Controls.Add(this.i4BenchesControl);
|
||||||
|
this.wr15TabPage.Location = new System.Drawing.Point(4, 22);
|
||||||
|
this.wr15TabPage.Name = "wr15TabPage";
|
||||||
|
this.wr15TabPage.Padding = new System.Windows.Forms.Padding(3);
|
||||||
|
this.wr15TabPage.Size = new System.Drawing.Size(1360, 706);
|
||||||
|
this.wr15TabPage.TabIndex = 4;
|
||||||
|
this.wr15TabPage.Text = "I4";
|
||||||
|
this.wr15TabPage.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// wmsBenchesControl
|
||||||
|
//
|
||||||
|
this.wmsBenchesControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.wmsBenchesControl.Location = new System.Drawing.Point(3, 3);
|
||||||
|
this.wmsBenchesControl.Name = "wmsBenchesControl";
|
||||||
|
this.wmsBenchesControl.Size = new System.Drawing.Size(1354, 700);
|
||||||
|
this.wmsBenchesControl.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// i1BenchesControl
|
||||||
|
//
|
||||||
|
this.i1BenchesControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.i1BenchesControl.Location = new System.Drawing.Point(3, 3);
|
||||||
|
this.i1BenchesControl.Name = "i1BenchesControl";
|
||||||
|
this.i1BenchesControl.Size = new System.Drawing.Size(1354, 700);
|
||||||
|
this.i1BenchesControl.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// i2BbenchesControl
|
||||||
|
//
|
||||||
|
this.i2BbenchesControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.i2BbenchesControl.Location = new System.Drawing.Point(3, 3);
|
||||||
|
this.i2BbenchesControl.Name = "i2BbenchesControl";
|
||||||
|
this.i2BbenchesControl.Size = new System.Drawing.Size(1354, 700);
|
||||||
|
this.i2BbenchesControl.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// i3BenchesControl
|
||||||
|
//
|
||||||
|
this.i3BenchesControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.i3BenchesControl.Location = new System.Drawing.Point(3, 3);
|
||||||
|
this.i3BenchesControl.Name = "i3BenchesControl";
|
||||||
|
this.i3BenchesControl.Size = new System.Drawing.Size(1354, 700);
|
||||||
|
this.i3BenchesControl.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// i4BenchesControl
|
||||||
|
//
|
||||||
|
this.i4BenchesControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.i4BenchesControl.Location = new System.Drawing.Point(3, 3);
|
||||||
|
this.i4BenchesControl.Name = "i4BenchesControl";
|
||||||
|
this.i4BenchesControl.Size = new System.Drawing.Size(1354, 700);
|
||||||
|
this.i4BenchesControl.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// StatisticsDlg
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(1368, 826);
|
||||||
|
this.Controls.Add(this.splitContainer1);
|
||||||
|
this.Name = "StatisticsDlg";
|
||||||
|
this.Text = "Statistics";
|
||||||
|
this.Load += new System.EventHandler(this.StatisticsDlg_Load);
|
||||||
|
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||||
|
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||||
|
this.splitContainer1.ResumeLayout(false);
|
||||||
|
this.timePeriodGroupBox.ResumeLayout(false);
|
||||||
|
this.timePeriodGroupBox.PerformLayout();
|
||||||
|
this.midsTabControl.ResumeLayout(false);
|
||||||
|
this.wr10TabPage.ResumeLayout(false);
|
||||||
|
this.wr11TabPage.ResumeLayout(false);
|
||||||
|
this.wr13TabPage.ResumeLayout(false);
|
||||||
|
this.wr14TabPage.ResumeLayout(false);
|
||||||
|
this.wr15TabPage.ResumeLayout(false);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||||
|
private System.Windows.Forms.TabControl midsTabControl;
|
||||||
|
private System.Windows.Forms.TabPage wr10TabPage;
|
||||||
|
private System.Windows.Forms.TabPage wr11TabPage;
|
||||||
|
private System.Windows.Forms.TabPage wr13TabPage;
|
||||||
|
private System.Windows.Forms.TabPage wr14TabPage;
|
||||||
|
private System.Windows.Forms.TabPage wr15TabPage;
|
||||||
|
private System.Windows.Forms.GroupBox timePeriodGroupBox;
|
||||||
|
private System.Windows.Forms.DateTimePicker dateTimeFromPicker;
|
||||||
|
private System.Windows.Forms.DateTimePicker dateTimeToPicker;
|
||||||
|
private System.Windows.Forms.Label toLabel1;
|
||||||
|
private System.Windows.Forms.Label fromLabel1;
|
||||||
|
private System.Windows.Forms.CheckBox timePeriodCheckBox;
|
||||||
|
private UserControls.MidOrWaterMetersCtrl wmsBenchesControl;
|
||||||
|
private UserControls.MidOrWaterMetersCtrl i1BenchesControl;
|
||||||
|
private UserControls.MidOrWaterMetersCtrl i2BbenchesControl;
|
||||||
|
private UserControls.MidOrWaterMetersCtrl i3BenchesControl;
|
||||||
|
private UserControls.MidOrWaterMetersCtrl i4BenchesControl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using NHibernate;
|
||||||
|
using FluentNHibernate;
|
||||||
|
using FluentNHibernate.Cfg;
|
||||||
|
using FluentNHibernate.Cfg.Db;
|
||||||
|
using Results;
|
||||||
|
using Results.Entities;
|
||||||
|
using Statistics.Resources;
|
||||||
|
using Statistics.UserControls;
|
||||||
|
|
||||||
|
namespace Statistics
|
||||||
|
{
|
||||||
|
public partial class StatisticsDlg : Form
|
||||||
|
{
|
||||||
|
static string[] testBenchNames = new string[] { "WR10", "WR11", "WR13", "WR14", "WR15", "PT7" };
|
||||||
|
///
|
||||||
|
#if false
|
||||||
|
static string[] connectionStrings = new string[] {
|
||||||
|
"SERVER=10.42.128.197; DATABASE=st-wr10-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;", /// WR10
|
||||||
|
"SERVER=10.42.128.98; DATABASE=st-wr11-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;", /// WR11
|
||||||
|
"SERVER=10.42.128.152; DATABASE=st-wr13-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;", /// WR13
|
||||||
|
"SERVER=10.42.128.143; DATABASE=st-wr14-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;", /// WR14
|
||||||
|
"SERVER=10.42.128.63; DATABASE=st-wr15-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;", /// WR15
|
||||||
|
"" /// PT7
|
||||||
|
};
|
||||||
|
#else
|
||||||
|
static string[] connectionStrings = new string[] {
|
||||||
|
"SERVER=localhost; DATABASE=st-wr10-r; UID=root; PASSWORD=; CHARSET=utf8;", /// WR10
|
||||||
|
"SERVER=localhost; DATABASE=st-wr11-r; UID=root; PASSWORD=; CHARSET=utf8;", /// WR11
|
||||||
|
"SERVER=localhost; DATABASE=st-wr13-r; UID=root; PASSWORD=; CHARSET=utf8;", /// WR13
|
||||||
|
"SERVER=localhost; DATABASE=st-wr14-r; UID=root; PASSWORD=; CHARSET=utf8;", /// WR14
|
||||||
|
"SERVER=localhost; DATABASE=st-wr15-r; UID=root; PASSWORD=; CHARSET=utf8;", /// WR15
|
||||||
|
"" /// PT7
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
///
|
||||||
|
static ISessionFactory[] sessionFactories = new ISessionFactory[6];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public StatisticsDlg()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
ManageCheckGroupBox(timePeriodCheckBox, timePeriodGroupBox);
|
||||||
|
|
||||||
|
for (MidId midId = 0; midId < MidId.Count; midId++)
|
||||||
|
{
|
||||||
|
int i = (int)midId;
|
||||||
|
midsTabControl.TabPages[i].Text = midId.ToString();
|
||||||
|
(midsTabControl.TabPages[i].Controls[0] as MidOrWaterMetersCtrl).MidId = midId;
|
||||||
|
(midsTabControl.TabPages[i].Controls[0] as MidOrWaterMetersCtrl).Parent = this;
|
||||||
|
}
|
||||||
|
midsTabControl.TabPages[0].Text = Strings.Water_meters;
|
||||||
|
|
||||||
|
Localize();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Localize()
|
||||||
|
{
|
||||||
|
Text = Strings.Statistics;
|
||||||
|
timePeriodCheckBox.Text = Strings.Time_period;
|
||||||
|
fromLabel1.Text = Strings.From;
|
||||||
|
toLabel1.Text = Strings.To;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void StatisticsDlg_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < testBenchNames.Length; i++)
|
||||||
|
{
|
||||||
|
if ((i < connectionStrings.Length) && !string.IsNullOrEmpty(connectionStrings[i]))
|
||||||
|
{
|
||||||
|
sessionFactories[i] = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
sessionFactories[i] = Fluently.Configure()
|
||||||
|
.Database(MySQLConfiguration.Standard.ConnectionString(connectionStrings[i]))
|
||||||
|
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Results.Entities.Batch>())
|
||||||
|
.ExposeConfiguration(BuildSchema)
|
||||||
|
.BuildSessionFactory();
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
MessageBox.Show(string.Format("Cannot open one of database of {0}", testBenchNames[i]), "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BuildSchema(NHibernate.Cfg.Configuration config)
|
||||||
|
{
|
||||||
|
/// This NHibernate tool takes a configuration with mapping info and exports a database schema
|
||||||
|
new NHibernate.Tool.hbm2ddl.SchemaExport(config).SetOutputFile("db_schema");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ManageCheckGroupBox(CheckBox chk, GroupBox grp)
|
||||||
|
{
|
||||||
|
/// Make sure the CheckBox isn't in the GroupBox. This will only happen the first time.
|
||||||
|
if (chk.Parent == grp)
|
||||||
|
{
|
||||||
|
grp.Parent.Controls.Add(chk); /// Reparent the CheckBox so it's not in the GroupBox.
|
||||||
|
chk.Location = new Point(chk.Left + grp.Left, chk.Top + grp.Top); /// Adjust the CheckBox's location.
|
||||||
|
chk.BringToFront(); /// Move the CheckBox to the top of the stacking order.
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Enable or disable the GroupBox.
|
||||||
|
grp.Enabled = chk.Checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void timePeriodCheckBox_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ManageCheckGroupBox(timePeriodCheckBox, timePeriodGroupBox);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void UpdateRequest(int benchId, MidId midId)
|
||||||
|
{
|
||||||
|
if (benchId >= sessionFactories.Length || sessionFactories[benchId] == null || (midId == MidId.WaterMeters))
|
||||||
|
{
|
||||||
|
if (midId == MidId.WaterMeters)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Loading statistics of water meters is not implemented yet");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show(string.Format("Cannot load statistics of {0}", (benchId < testBenchNames.Length) ? testBenchNames[benchId] : "XY"));
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ISession session = sessionFactories[benchId].OpenSession();
|
||||||
|
var listOfComponentsWithFlowmeter = session.QueryOver<Components>()
|
||||||
|
.Where(x => (x.Flowmeter == midId.ToString()))
|
||||||
|
.List();
|
||||||
|
IList<TestRslt> testRslts = new List<TestRslt>();
|
||||||
|
foreach (var cmpnts in listOfComponentsWithFlowmeter)
|
||||||
|
{
|
||||||
|
var listOfRslts = session.QueryOver<TestRslt>()
|
||||||
|
.Where(x => ((x.EndTime >= dateTimeFromPicker.Value) && (x.EndTime <= dateTimeToPicker.Value)))
|
||||||
|
.And(x => (x.Components == cmpnts))
|
||||||
|
.List();
|
||||||
|
foreach (var tr in listOfRslts) testRslts.Add(tr);
|
||||||
|
}
|
||||||
|
|
||||||
|
session.Close();
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
MessageBox.Show(string.Format("Error loading statistics of {0}\r\n{1}", (benchId < testBenchNames.Length) ? testBenchNames[benchId] : "XY", exc.Message));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Statistics.UserControls
|
||||||
|
{
|
||||||
|
public enum MidId
|
||||||
|
{
|
||||||
|
/// When converted to 'int' it's the MID number, 0 = water meters
|
||||||
|
WaterMeters,
|
||||||
|
I1,
|
||||||
|
I2,
|
||||||
|
I3,
|
||||||
|
I4,
|
||||||
|
Count
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,619 @@
|
|||||||
|
namespace Statistics.UserControls
|
||||||
|
{
|
||||||
|
partial class MidOrWaterMetersCtrl
|
||||||
|
{
|
||||||
|
/// <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.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||||
|
this.flow3GroupBox = new System.Windows.Forms.GroupBox();
|
||||||
|
this.flow3ToExclamation = new System.Windows.Forms.Label();
|
||||||
|
this.flow3FromExclamation = new System.Windows.Forms.Label();
|
||||||
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
|
this.toLabel4 = new System.Windows.Forms.Label();
|
||||||
|
this.fromLabel4 = new System.Windows.Forms.Label();
|
||||||
|
this.flow3ToTextBox = new System.Windows.Forms.TextBox();
|
||||||
|
this.flow3FromTextBox = new System.Windows.Forms.TextBox();
|
||||||
|
this.flow3CheckBox = new System.Windows.Forms.CheckBox();
|
||||||
|
this.flow2GroupBox = new System.Windows.Forms.GroupBox();
|
||||||
|
this.flow2ToExclamation = new System.Windows.Forms.Label();
|
||||||
|
this.flow2FromExclamation = new System.Windows.Forms.Label();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
|
this.toLabel3 = new System.Windows.Forms.Label();
|
||||||
|
this.fromLabel3 = new System.Windows.Forms.Label();
|
||||||
|
this.flow2ToTextBox = new System.Windows.Forms.TextBox();
|
||||||
|
this.flow2FromTextBox = new System.Windows.Forms.TextBox();
|
||||||
|
this.flow2CheckBox = new System.Windows.Forms.CheckBox();
|
||||||
|
this.flow1GroupBox = new System.Windows.Forms.GroupBox();
|
||||||
|
this.flow1ToExclamation = new System.Windows.Forms.Label();
|
||||||
|
this.flow1FromExclamation = new System.Windows.Forms.Label();
|
||||||
|
this.m3hLabel2 = new System.Windows.Forms.Label();
|
||||||
|
this.m3hLabel1 = new System.Windows.Forms.Label();
|
||||||
|
this.toLabel2 = new System.Windows.Forms.Label();
|
||||||
|
this.fromLabel2 = new System.Windows.Forms.Label();
|
||||||
|
this.flow1ToTextBox = new System.Windows.Forms.TextBox();
|
||||||
|
this.flow1FromTextBox = new System.Windows.Forms.TextBox();
|
||||||
|
this.flow1CheckBox = new System.Windows.Forms.CheckBox();
|
||||||
|
this.benchesTabControl = new System.Windows.Forms.TabControl();
|
||||||
|
this.tabPage1 = new System.Windows.Forms.TabPage();
|
||||||
|
this.wr10StatisticsCtrl1 = new Statistics.UserControls.StatisticsCtrl();
|
||||||
|
this.tabPage2 = new System.Windows.Forms.TabPage();
|
||||||
|
this.wr11StatisticsCtrl = new Statistics.UserControls.StatisticsCtrl();
|
||||||
|
this.tabPage3 = new System.Windows.Forms.TabPage();
|
||||||
|
this.wr13StatisticsCtrl = new Statistics.UserControls.StatisticsCtrl();
|
||||||
|
this.tabPage4 = new System.Windows.Forms.TabPage();
|
||||||
|
this.wr14StatisticsCtrl = new Statistics.UserControls.StatisticsCtrl();
|
||||||
|
this.tabPage5 = new System.Windows.Forms.TabPage();
|
||||||
|
this.wr15StatisticsCtrl = new Statistics.UserControls.StatisticsCtrl();
|
||||||
|
this.tabPage6 = new System.Windows.Forms.TabPage();
|
||||||
|
this.pt7StatisticsCtrl = new Statistics.UserControls.StatisticsCtrl();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||||
|
this.splitContainer1.Panel1.SuspendLayout();
|
||||||
|
this.splitContainer1.Panel2.SuspendLayout();
|
||||||
|
this.splitContainer1.SuspendLayout();
|
||||||
|
this.flow3GroupBox.SuspendLayout();
|
||||||
|
this.flow2GroupBox.SuspendLayout();
|
||||||
|
this.flow1GroupBox.SuspendLayout();
|
||||||
|
this.benchesTabControl.SuspendLayout();
|
||||||
|
this.tabPage1.SuspendLayout();
|
||||||
|
this.tabPage2.SuspendLayout();
|
||||||
|
this.tabPage3.SuspendLayout();
|
||||||
|
this.tabPage4.SuspendLayout();
|
||||||
|
this.tabPage5.SuspendLayout();
|
||||||
|
this.tabPage6.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// splitContainer1
|
||||||
|
//
|
||||||
|
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
|
||||||
|
this.splitContainer1.IsSplitterFixed = true;
|
||||||
|
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.splitContainer1.Name = "splitContainer1";
|
||||||
|
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||||
|
//
|
||||||
|
// splitContainer1.Panel1
|
||||||
|
//
|
||||||
|
this.splitContainer1.Panel1.Controls.Add(this.flow3GroupBox);
|
||||||
|
this.splitContainer1.Panel1.Controls.Add(this.flow2GroupBox);
|
||||||
|
this.splitContainer1.Panel1.Controls.Add(this.flow1GroupBox);
|
||||||
|
//
|
||||||
|
// splitContainer1.Panel2
|
||||||
|
//
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.benchesTabControl);
|
||||||
|
this.splitContainer1.Size = new System.Drawing.Size(800, 450);
|
||||||
|
this.splitContainer1.SplitterDistance = 90;
|
||||||
|
this.splitContainer1.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// flow3GroupBox
|
||||||
|
//
|
||||||
|
this.flow3GroupBox.Controls.Add(this.flow3ToExclamation);
|
||||||
|
this.flow3GroupBox.Controls.Add(this.flow3FromExclamation);
|
||||||
|
this.flow3GroupBox.Controls.Add(this.label3);
|
||||||
|
this.flow3GroupBox.Controls.Add(this.label4);
|
||||||
|
this.flow3GroupBox.Controls.Add(this.toLabel4);
|
||||||
|
this.flow3GroupBox.Controls.Add(this.fromLabel4);
|
||||||
|
this.flow3GroupBox.Controls.Add(this.flow3ToTextBox);
|
||||||
|
this.flow3GroupBox.Controls.Add(this.flow3FromTextBox);
|
||||||
|
this.flow3GroupBox.Controls.Add(this.flow3CheckBox);
|
||||||
|
this.flow3GroupBox.Location = new System.Drawing.Point(473, 7);
|
||||||
|
this.flow3GroupBox.Name = "flow3GroupBox";
|
||||||
|
this.flow3GroupBox.Size = new System.Drawing.Size(221, 77);
|
||||||
|
this.flow3GroupBox.TabIndex = 6;
|
||||||
|
this.flow3GroupBox.TabStop = false;
|
||||||
|
//
|
||||||
|
// flow3ToExclamation
|
||||||
|
//
|
||||||
|
this.flow3ToExclamation.AutoSize = true;
|
||||||
|
this.flow3ToExclamation.ForeColor = System.Drawing.Color.Red;
|
||||||
|
this.flow3ToExclamation.Location = new System.Drawing.Point(167, 48);
|
||||||
|
this.flow3ToExclamation.Name = "flow3ToExclamation";
|
||||||
|
this.flow3ToExclamation.Size = new System.Drawing.Size(10, 13);
|
||||||
|
this.flow3ToExclamation.TabIndex = 9;
|
||||||
|
this.flow3ToExclamation.Text = "!";
|
||||||
|
this.flow3ToExclamation.Visible = false;
|
||||||
|
//
|
||||||
|
// flow3FromExclamation
|
||||||
|
//
|
||||||
|
this.flow3FromExclamation.AutoSize = true;
|
||||||
|
this.flow3FromExclamation.ForeColor = System.Drawing.Color.Red;
|
||||||
|
this.flow3FromExclamation.Location = new System.Drawing.Point(167, 24);
|
||||||
|
this.flow3FromExclamation.Name = "flow3FromExclamation";
|
||||||
|
this.flow3FromExclamation.Size = new System.Drawing.Size(10, 13);
|
||||||
|
this.flow3FromExclamation.TabIndex = 8;
|
||||||
|
this.flow3FromExclamation.Text = "!";
|
||||||
|
this.flow3FromExclamation.Visible = false;
|
||||||
|
//
|
||||||
|
// label3
|
||||||
|
//
|
||||||
|
this.label3.AutoSize = true;
|
||||||
|
this.label3.Location = new System.Drawing.Point(178, 48);
|
||||||
|
this.label3.Name = "label3";
|
||||||
|
this.label3.Size = new System.Drawing.Size(32, 13);
|
||||||
|
this.label3.TabIndex = 6;
|
||||||
|
this.label3.Text = "m3/h";
|
||||||
|
//
|
||||||
|
// label4
|
||||||
|
//
|
||||||
|
this.label4.AutoSize = true;
|
||||||
|
this.label4.Location = new System.Drawing.Point(177, 23);
|
||||||
|
this.label4.Name = "label4";
|
||||||
|
this.label4.Size = new System.Drawing.Size(32, 13);
|
||||||
|
this.label4.TabIndex = 5;
|
||||||
|
this.label4.Text = "m3/h";
|
||||||
|
//
|
||||||
|
// toLabel4
|
||||||
|
//
|
||||||
|
this.toLabel4.AutoSize = true;
|
||||||
|
this.toLabel4.Location = new System.Drawing.Point(14, 48);
|
||||||
|
this.toLabel4.Name = "toLabel4";
|
||||||
|
this.toLabel4.Size = new System.Drawing.Size(20, 13);
|
||||||
|
this.toLabel4.TabIndex = 4;
|
||||||
|
this.toLabel4.Text = "To";
|
||||||
|
//
|
||||||
|
// fromLabel4
|
||||||
|
//
|
||||||
|
this.fromLabel4.AutoSize = true;
|
||||||
|
this.fromLabel4.Location = new System.Drawing.Point(14, 23);
|
||||||
|
this.fromLabel4.Name = "fromLabel4";
|
||||||
|
this.fromLabel4.Size = new System.Drawing.Size(30, 13);
|
||||||
|
this.fromLabel4.TabIndex = 3;
|
||||||
|
this.fromLabel4.Text = "From";
|
||||||
|
//
|
||||||
|
// flow3ToTextBox
|
||||||
|
//
|
||||||
|
this.flow3ToTextBox.Location = new System.Drawing.Point(65, 45);
|
||||||
|
this.flow3ToTextBox.Name = "flow3ToTextBox";
|
||||||
|
this.flow3ToTextBox.Size = new System.Drawing.Size(100, 20);
|
||||||
|
this.flow3ToTextBox.TabIndex = 2;
|
||||||
|
this.flow3ToTextBox.TextChanged += new System.EventHandler(this.flow3ToTextBox_TextChanged);
|
||||||
|
//
|
||||||
|
// flow3FromTextBox
|
||||||
|
//
|
||||||
|
this.flow3FromTextBox.Location = new System.Drawing.Point(65, 20);
|
||||||
|
this.flow3FromTextBox.Name = "flow3FromTextBox";
|
||||||
|
this.flow3FromTextBox.Size = new System.Drawing.Size(100, 20);
|
||||||
|
this.flow3FromTextBox.TabIndex = 1;
|
||||||
|
this.flow3FromTextBox.TextChanged += new System.EventHandler(this.flow3FromTextBox_TextChanged);
|
||||||
|
//
|
||||||
|
// flow3CheckBox
|
||||||
|
//
|
||||||
|
this.flow3CheckBox.AutoSize = true;
|
||||||
|
this.flow3CheckBox.Location = new System.Drawing.Point(10, 0);
|
||||||
|
this.flow3CheckBox.Name = "flow3CheckBox";
|
||||||
|
this.flow3CheckBox.Size = new System.Drawing.Size(57, 17);
|
||||||
|
this.flow3CheckBox.TabIndex = 0;
|
||||||
|
this.flow3CheckBox.Text = "Flow 3";
|
||||||
|
this.flow3CheckBox.UseVisualStyleBackColor = true;
|
||||||
|
this.flow3CheckBox.CheckedChanged += new System.EventHandler(this.flow3CheckBox_CheckedChanged);
|
||||||
|
//
|
||||||
|
// flow2GroupBox
|
||||||
|
//
|
||||||
|
this.flow2GroupBox.Controls.Add(this.flow2ToExclamation);
|
||||||
|
this.flow2GroupBox.Controls.Add(this.flow2FromExclamation);
|
||||||
|
this.flow2GroupBox.Controls.Add(this.label1);
|
||||||
|
this.flow2GroupBox.Controls.Add(this.label2);
|
||||||
|
this.flow2GroupBox.Controls.Add(this.toLabel3);
|
||||||
|
this.flow2GroupBox.Controls.Add(this.fromLabel3);
|
||||||
|
this.flow2GroupBox.Controls.Add(this.flow2ToTextBox);
|
||||||
|
this.flow2GroupBox.Controls.Add(this.flow2FromTextBox);
|
||||||
|
this.flow2GroupBox.Controls.Add(this.flow2CheckBox);
|
||||||
|
this.flow2GroupBox.Location = new System.Drawing.Point(240, 7);
|
||||||
|
this.flow2GroupBox.Name = "flow2GroupBox";
|
||||||
|
this.flow2GroupBox.Size = new System.Drawing.Size(221, 77);
|
||||||
|
this.flow2GroupBox.TabIndex = 5;
|
||||||
|
this.flow2GroupBox.TabStop = false;
|
||||||
|
//
|
||||||
|
// flow2ToExclamation
|
||||||
|
//
|
||||||
|
this.flow2ToExclamation.AutoSize = true;
|
||||||
|
this.flow2ToExclamation.ForeColor = System.Drawing.Color.Red;
|
||||||
|
this.flow2ToExclamation.Location = new System.Drawing.Point(167, 49);
|
||||||
|
this.flow2ToExclamation.Name = "flow2ToExclamation";
|
||||||
|
this.flow2ToExclamation.Size = new System.Drawing.Size(10, 13);
|
||||||
|
this.flow2ToExclamation.TabIndex = 9;
|
||||||
|
this.flow2ToExclamation.Text = "!";
|
||||||
|
this.flow2ToExclamation.Visible = false;
|
||||||
|
//
|
||||||
|
// flow2FromExclamation
|
||||||
|
//
|
||||||
|
this.flow2FromExclamation.AutoSize = true;
|
||||||
|
this.flow2FromExclamation.ForeColor = System.Drawing.Color.Red;
|
||||||
|
this.flow2FromExclamation.Location = new System.Drawing.Point(167, 24);
|
||||||
|
this.flow2FromExclamation.Name = "flow2FromExclamation";
|
||||||
|
this.flow2FromExclamation.Size = new System.Drawing.Size(10, 13);
|
||||||
|
this.flow2FromExclamation.TabIndex = 8;
|
||||||
|
this.flow2FromExclamation.Text = "!";
|
||||||
|
this.flow2FromExclamation.Visible = false;
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(178, 48);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(32, 13);
|
||||||
|
this.label1.TabIndex = 6;
|
||||||
|
this.label1.Text = "m3/h";
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
this.label2.AutoSize = true;
|
||||||
|
this.label2.Location = new System.Drawing.Point(177, 23);
|
||||||
|
this.label2.Name = "label2";
|
||||||
|
this.label2.Size = new System.Drawing.Size(32, 13);
|
||||||
|
this.label2.TabIndex = 5;
|
||||||
|
this.label2.Text = "m3/h";
|
||||||
|
//
|
||||||
|
// toLabel3
|
||||||
|
//
|
||||||
|
this.toLabel3.AutoSize = true;
|
||||||
|
this.toLabel3.Location = new System.Drawing.Point(14, 48);
|
||||||
|
this.toLabel3.Name = "toLabel3";
|
||||||
|
this.toLabel3.Size = new System.Drawing.Size(20, 13);
|
||||||
|
this.toLabel3.TabIndex = 4;
|
||||||
|
this.toLabel3.Text = "To";
|
||||||
|
//
|
||||||
|
// fromLabel3
|
||||||
|
//
|
||||||
|
this.fromLabel3.AutoSize = true;
|
||||||
|
this.fromLabel3.Location = new System.Drawing.Point(14, 23);
|
||||||
|
this.fromLabel3.Name = "fromLabel3";
|
||||||
|
this.fromLabel3.Size = new System.Drawing.Size(30, 13);
|
||||||
|
this.fromLabel3.TabIndex = 3;
|
||||||
|
this.fromLabel3.Text = "From";
|
||||||
|
//
|
||||||
|
// flow2ToTextBox
|
||||||
|
//
|
||||||
|
this.flow2ToTextBox.Location = new System.Drawing.Point(65, 45);
|
||||||
|
this.flow2ToTextBox.Name = "flow2ToTextBox";
|
||||||
|
this.flow2ToTextBox.Size = new System.Drawing.Size(100, 20);
|
||||||
|
this.flow2ToTextBox.TabIndex = 2;
|
||||||
|
this.flow2ToTextBox.TextChanged += new System.EventHandler(this.flow2ToTextBox_TextChanged);
|
||||||
|
//
|
||||||
|
// flow2FromTextBox
|
||||||
|
//
|
||||||
|
this.flow2FromTextBox.Location = new System.Drawing.Point(65, 20);
|
||||||
|
this.flow2FromTextBox.Name = "flow2FromTextBox";
|
||||||
|
this.flow2FromTextBox.Size = new System.Drawing.Size(100, 20);
|
||||||
|
this.flow2FromTextBox.TabIndex = 1;
|
||||||
|
this.flow2FromTextBox.TextChanged += new System.EventHandler(this.flow2FromTextBox_TextChanged);
|
||||||
|
//
|
||||||
|
// flow2CheckBox
|
||||||
|
//
|
||||||
|
this.flow2CheckBox.AutoSize = true;
|
||||||
|
this.flow2CheckBox.Location = new System.Drawing.Point(6, 0);
|
||||||
|
this.flow2CheckBox.Name = "flow2CheckBox";
|
||||||
|
this.flow2CheckBox.Size = new System.Drawing.Size(57, 17);
|
||||||
|
this.flow2CheckBox.TabIndex = 0;
|
||||||
|
this.flow2CheckBox.Text = "Flow 2";
|
||||||
|
this.flow2CheckBox.UseVisualStyleBackColor = true;
|
||||||
|
this.flow2CheckBox.CheckedChanged += new System.EventHandler(this.flow2CheckBox_CheckedChanged);
|
||||||
|
//
|
||||||
|
// flow1GroupBox
|
||||||
|
//
|
||||||
|
this.flow1GroupBox.Controls.Add(this.flow1ToExclamation);
|
||||||
|
this.flow1GroupBox.Controls.Add(this.flow1FromExclamation);
|
||||||
|
this.flow1GroupBox.Controls.Add(this.m3hLabel2);
|
||||||
|
this.flow1GroupBox.Controls.Add(this.m3hLabel1);
|
||||||
|
this.flow1GroupBox.Controls.Add(this.toLabel2);
|
||||||
|
this.flow1GroupBox.Controls.Add(this.fromLabel2);
|
||||||
|
this.flow1GroupBox.Controls.Add(this.flow1ToTextBox);
|
||||||
|
this.flow1GroupBox.Controls.Add(this.flow1FromTextBox);
|
||||||
|
this.flow1GroupBox.Controls.Add(this.flow1CheckBox);
|
||||||
|
this.flow1GroupBox.Location = new System.Drawing.Point(7, 7);
|
||||||
|
this.flow1GroupBox.Name = "flow1GroupBox";
|
||||||
|
this.flow1GroupBox.Size = new System.Drawing.Size(221, 77);
|
||||||
|
this.flow1GroupBox.TabIndex = 4;
|
||||||
|
this.flow1GroupBox.TabStop = false;
|
||||||
|
//
|
||||||
|
// flow1ToExclamation
|
||||||
|
//
|
||||||
|
this.flow1ToExclamation.AutoSize = true;
|
||||||
|
this.flow1ToExclamation.ForeColor = System.Drawing.Color.Red;
|
||||||
|
this.flow1ToExclamation.Location = new System.Drawing.Point(167, 49);
|
||||||
|
this.flow1ToExclamation.Name = "flow1ToExclamation";
|
||||||
|
this.flow1ToExclamation.Size = new System.Drawing.Size(10, 13);
|
||||||
|
this.flow1ToExclamation.TabIndex = 8;
|
||||||
|
this.flow1ToExclamation.Text = "!";
|
||||||
|
this.flow1ToExclamation.Visible = false;
|
||||||
|
//
|
||||||
|
// flow1FromExclamation
|
||||||
|
//
|
||||||
|
this.flow1FromExclamation.AutoSize = true;
|
||||||
|
this.flow1FromExclamation.ForeColor = System.Drawing.Color.Red;
|
||||||
|
this.flow1FromExclamation.Location = new System.Drawing.Point(167, 24);
|
||||||
|
this.flow1FromExclamation.Name = "flow1FromExclamation";
|
||||||
|
this.flow1FromExclamation.Size = new System.Drawing.Size(10, 13);
|
||||||
|
this.flow1FromExclamation.TabIndex = 7;
|
||||||
|
this.flow1FromExclamation.Text = "!";
|
||||||
|
this.flow1FromExclamation.Visible = false;
|
||||||
|
//
|
||||||
|
// m3hLabel2
|
||||||
|
//
|
||||||
|
this.m3hLabel2.AutoSize = true;
|
||||||
|
this.m3hLabel2.Location = new System.Drawing.Point(178, 48);
|
||||||
|
this.m3hLabel2.Name = "m3hLabel2";
|
||||||
|
this.m3hLabel2.Size = new System.Drawing.Size(32, 13);
|
||||||
|
this.m3hLabel2.TabIndex = 6;
|
||||||
|
this.m3hLabel2.Text = "m3/h";
|
||||||
|
//
|
||||||
|
// m3hLabel1
|
||||||
|
//
|
||||||
|
this.m3hLabel1.AutoSize = true;
|
||||||
|
this.m3hLabel1.Location = new System.Drawing.Point(177, 23);
|
||||||
|
this.m3hLabel1.Name = "m3hLabel1";
|
||||||
|
this.m3hLabel1.Size = new System.Drawing.Size(32, 13);
|
||||||
|
this.m3hLabel1.TabIndex = 5;
|
||||||
|
this.m3hLabel1.Text = "m3/h";
|
||||||
|
//
|
||||||
|
// toLabel2
|
||||||
|
//
|
||||||
|
this.toLabel2.AutoSize = true;
|
||||||
|
this.toLabel2.Location = new System.Drawing.Point(14, 48);
|
||||||
|
this.toLabel2.Name = "toLabel2";
|
||||||
|
this.toLabel2.Size = new System.Drawing.Size(20, 13);
|
||||||
|
this.toLabel2.TabIndex = 4;
|
||||||
|
this.toLabel2.Text = "To";
|
||||||
|
//
|
||||||
|
// fromLabel2
|
||||||
|
//
|
||||||
|
this.fromLabel2.AutoSize = true;
|
||||||
|
this.fromLabel2.Location = new System.Drawing.Point(14, 23);
|
||||||
|
this.fromLabel2.Name = "fromLabel2";
|
||||||
|
this.fromLabel2.Size = new System.Drawing.Size(30, 13);
|
||||||
|
this.fromLabel2.TabIndex = 3;
|
||||||
|
this.fromLabel2.Text = "From";
|
||||||
|
//
|
||||||
|
// flow1ToTextBox
|
||||||
|
//
|
||||||
|
this.flow1ToTextBox.Location = new System.Drawing.Point(65, 45);
|
||||||
|
this.flow1ToTextBox.Name = "flow1ToTextBox";
|
||||||
|
this.flow1ToTextBox.Size = new System.Drawing.Size(100, 20);
|
||||||
|
this.flow1ToTextBox.TabIndex = 2;
|
||||||
|
this.flow1ToTextBox.TextChanged += new System.EventHandler(this.flow1ToTextBox_TextChanged);
|
||||||
|
//
|
||||||
|
// flow1FromTextBox
|
||||||
|
//
|
||||||
|
this.flow1FromTextBox.Location = new System.Drawing.Point(65, 20);
|
||||||
|
this.flow1FromTextBox.Name = "flow1FromTextBox";
|
||||||
|
this.flow1FromTextBox.Size = new System.Drawing.Size(100, 20);
|
||||||
|
this.flow1FromTextBox.TabIndex = 1;
|
||||||
|
this.flow1FromTextBox.TextChanged += new System.EventHandler(this.flow1FromTextBox_TextChanged);
|
||||||
|
//
|
||||||
|
// flow1CheckBox
|
||||||
|
//
|
||||||
|
this.flow1CheckBox.AutoSize = true;
|
||||||
|
this.flow1CheckBox.Location = new System.Drawing.Point(6, 0);
|
||||||
|
this.flow1CheckBox.Name = "flow1CheckBox";
|
||||||
|
this.flow1CheckBox.Size = new System.Drawing.Size(57, 17);
|
||||||
|
this.flow1CheckBox.TabIndex = 0;
|
||||||
|
this.flow1CheckBox.Text = "Flow 1";
|
||||||
|
this.flow1CheckBox.UseVisualStyleBackColor = true;
|
||||||
|
this.flow1CheckBox.CheckedChanged += new System.EventHandler(this.flow1CheckBox_CheckedChanged);
|
||||||
|
//
|
||||||
|
// benchesTabControl
|
||||||
|
//
|
||||||
|
this.benchesTabControl.Controls.Add(this.tabPage1);
|
||||||
|
this.benchesTabControl.Controls.Add(this.tabPage2);
|
||||||
|
this.benchesTabControl.Controls.Add(this.tabPage3);
|
||||||
|
this.benchesTabControl.Controls.Add(this.tabPage4);
|
||||||
|
this.benchesTabControl.Controls.Add(this.tabPage5);
|
||||||
|
this.benchesTabControl.Controls.Add(this.tabPage6);
|
||||||
|
this.benchesTabControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.benchesTabControl.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.benchesTabControl.Name = "benchesTabControl";
|
||||||
|
this.benchesTabControl.SelectedIndex = 0;
|
||||||
|
this.benchesTabControl.Size = new System.Drawing.Size(800, 356);
|
||||||
|
this.benchesTabControl.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// tabPage1
|
||||||
|
//
|
||||||
|
this.tabPage1.Controls.Add(this.wr10StatisticsCtrl1);
|
||||||
|
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(792, 330);
|
||||||
|
this.tabPage1.TabIndex = 0;
|
||||||
|
this.tabPage1.Text = "WR10";
|
||||||
|
this.tabPage1.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// wr10StatisticsCtrl1
|
||||||
|
//
|
||||||
|
this.wr10StatisticsCtrl1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.wr10StatisticsCtrl1.Location = new System.Drawing.Point(3, 3);
|
||||||
|
this.wr10StatisticsCtrl1.Name = "wr10StatisticsCtrl1";
|
||||||
|
this.wr10StatisticsCtrl1.Size = new System.Drawing.Size(786, 324);
|
||||||
|
this.wr10StatisticsCtrl1.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// tabPage2
|
||||||
|
//
|
||||||
|
this.tabPage2.Controls.Add(this.wr11StatisticsCtrl);
|
||||||
|
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(792, 320);
|
||||||
|
this.tabPage2.TabIndex = 1;
|
||||||
|
this.tabPage2.Text = "WR11";
|
||||||
|
this.tabPage2.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// wr11StatisticsCtrl
|
||||||
|
//
|
||||||
|
this.wr11StatisticsCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.wr11StatisticsCtrl.Location = new System.Drawing.Point(3, 3);
|
||||||
|
this.wr11StatisticsCtrl.Name = "wr11StatisticsCtrl";
|
||||||
|
this.wr11StatisticsCtrl.Size = new System.Drawing.Size(786, 314);
|
||||||
|
this.wr11StatisticsCtrl.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// tabPage3
|
||||||
|
//
|
||||||
|
this.tabPage3.Controls.Add(this.wr13StatisticsCtrl);
|
||||||
|
this.tabPage3.Location = new System.Drawing.Point(4, 22);
|
||||||
|
this.tabPage3.Name = "tabPage3";
|
||||||
|
this.tabPage3.Size = new System.Drawing.Size(792, 320);
|
||||||
|
this.tabPage3.TabIndex = 2;
|
||||||
|
this.tabPage3.Text = "WR13";
|
||||||
|
this.tabPage3.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// wr13StatisticsCtrl
|
||||||
|
//
|
||||||
|
this.wr13StatisticsCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.wr13StatisticsCtrl.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.wr13StatisticsCtrl.Name = "wr13StatisticsCtrl";
|
||||||
|
this.wr13StatisticsCtrl.Size = new System.Drawing.Size(792, 320);
|
||||||
|
this.wr13StatisticsCtrl.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// tabPage4
|
||||||
|
//
|
||||||
|
this.tabPage4.Controls.Add(this.wr14StatisticsCtrl);
|
||||||
|
this.tabPage4.Location = new System.Drawing.Point(4, 22);
|
||||||
|
this.tabPage4.Name = "tabPage4";
|
||||||
|
this.tabPage4.Size = new System.Drawing.Size(792, 320);
|
||||||
|
this.tabPage4.TabIndex = 3;
|
||||||
|
this.tabPage4.Text = "WR14";
|
||||||
|
this.tabPage4.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// wr14StatisticsCtrl
|
||||||
|
//
|
||||||
|
this.wr14StatisticsCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.wr14StatisticsCtrl.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.wr14StatisticsCtrl.Name = "wr14StatisticsCtrl";
|
||||||
|
this.wr14StatisticsCtrl.Size = new System.Drawing.Size(792, 320);
|
||||||
|
this.wr14StatisticsCtrl.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// tabPage5
|
||||||
|
//
|
||||||
|
this.tabPage5.Controls.Add(this.wr15StatisticsCtrl);
|
||||||
|
this.tabPage5.Location = new System.Drawing.Point(4, 22);
|
||||||
|
this.tabPage5.Name = "tabPage5";
|
||||||
|
this.tabPage5.Size = new System.Drawing.Size(792, 320);
|
||||||
|
this.tabPage5.TabIndex = 4;
|
||||||
|
this.tabPage5.Text = "WR15";
|
||||||
|
this.tabPage5.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// wr15StatisticsCtrl
|
||||||
|
//
|
||||||
|
this.wr15StatisticsCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.wr15StatisticsCtrl.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.wr15StatisticsCtrl.Name = "wr15StatisticsCtrl";
|
||||||
|
this.wr15StatisticsCtrl.Size = new System.Drawing.Size(792, 320);
|
||||||
|
this.wr15StatisticsCtrl.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// tabPage6
|
||||||
|
//
|
||||||
|
this.tabPage6.Controls.Add(this.pt7StatisticsCtrl);
|
||||||
|
this.tabPage6.Location = new System.Drawing.Point(4, 22);
|
||||||
|
this.tabPage6.Name = "tabPage6";
|
||||||
|
this.tabPage6.Size = new System.Drawing.Size(792, 320);
|
||||||
|
this.tabPage6.TabIndex = 5;
|
||||||
|
this.tabPage6.Text = "PT7";
|
||||||
|
this.tabPage6.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// pt7StatisticsCtrl
|
||||||
|
//
|
||||||
|
this.pt7StatisticsCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.pt7StatisticsCtrl.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.pt7StatisticsCtrl.Name = "pt7StatisticsCtrl";
|
||||||
|
this.pt7StatisticsCtrl.Size = new System.Drawing.Size(792, 320);
|
||||||
|
this.pt7StatisticsCtrl.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// MidOrWaterMetersCtrl
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.Controls.Add(this.splitContainer1);
|
||||||
|
this.Name = "MidOrWaterMetersCtrl";
|
||||||
|
this.Size = new System.Drawing.Size(800, 450);
|
||||||
|
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||||
|
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||||
|
this.splitContainer1.ResumeLayout(false);
|
||||||
|
this.flow3GroupBox.ResumeLayout(false);
|
||||||
|
this.flow3GroupBox.PerformLayout();
|
||||||
|
this.flow2GroupBox.ResumeLayout(false);
|
||||||
|
this.flow2GroupBox.PerformLayout();
|
||||||
|
this.flow1GroupBox.ResumeLayout(false);
|
||||||
|
this.flow1GroupBox.PerformLayout();
|
||||||
|
this.benchesTabControl.ResumeLayout(false);
|
||||||
|
this.tabPage1.ResumeLayout(false);
|
||||||
|
this.tabPage2.ResumeLayout(false);
|
||||||
|
this.tabPage3.ResumeLayout(false);
|
||||||
|
this.tabPage4.ResumeLayout(false);
|
||||||
|
this.tabPage5.ResumeLayout(false);
|
||||||
|
this.tabPage6.ResumeLayout(false);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||||
|
private System.Windows.Forms.TabControl benchesTabControl;
|
||||||
|
private System.Windows.Forms.TabPage tabPage1;
|
||||||
|
private System.Windows.Forms.TabPage tabPage2;
|
||||||
|
private System.Windows.Forms.TabPage tabPage3;
|
||||||
|
private System.Windows.Forms.TabPage tabPage4;
|
||||||
|
private System.Windows.Forms.TabPage tabPage5;
|
||||||
|
private System.Windows.Forms.TabPage tabPage6;
|
||||||
|
private StatisticsCtrl wr10StatisticsCtrl1;
|
||||||
|
private StatisticsCtrl wr11StatisticsCtrl;
|
||||||
|
private StatisticsCtrl wr13StatisticsCtrl;
|
||||||
|
private StatisticsCtrl wr14StatisticsCtrl;
|
||||||
|
private StatisticsCtrl wr15StatisticsCtrl;
|
||||||
|
private StatisticsCtrl pt7StatisticsCtrl;
|
||||||
|
private System.Windows.Forms.GroupBox flow3GroupBox;
|
||||||
|
private System.Windows.Forms.Label label3;
|
||||||
|
private System.Windows.Forms.Label label4;
|
||||||
|
private System.Windows.Forms.Label toLabel4;
|
||||||
|
private System.Windows.Forms.Label fromLabel4;
|
||||||
|
private System.Windows.Forms.TextBox flow3ToTextBox;
|
||||||
|
private System.Windows.Forms.TextBox flow3FromTextBox;
|
||||||
|
private System.Windows.Forms.CheckBox flow3CheckBox;
|
||||||
|
private System.Windows.Forms.GroupBox flow2GroupBox;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.Label label2;
|
||||||
|
private System.Windows.Forms.Label toLabel3;
|
||||||
|
private System.Windows.Forms.Label fromLabel3;
|
||||||
|
private System.Windows.Forms.TextBox flow2ToTextBox;
|
||||||
|
private System.Windows.Forms.TextBox flow2FromTextBox;
|
||||||
|
private System.Windows.Forms.CheckBox flow2CheckBox;
|
||||||
|
private System.Windows.Forms.GroupBox flow1GroupBox;
|
||||||
|
private System.Windows.Forms.Label m3hLabel2;
|
||||||
|
private System.Windows.Forms.Label m3hLabel1;
|
||||||
|
private System.Windows.Forms.Label toLabel2;
|
||||||
|
private System.Windows.Forms.Label fromLabel2;
|
||||||
|
private System.Windows.Forms.TextBox flow1ToTextBox;
|
||||||
|
private System.Windows.Forms.TextBox flow1FromTextBox;
|
||||||
|
private System.Windows.Forms.CheckBox flow1CheckBox;
|
||||||
|
private System.Windows.Forms.Label flow1ToExclamation;
|
||||||
|
private System.Windows.Forms.Label flow1FromExclamation;
|
||||||
|
private System.Windows.Forms.Label flow3ToExclamation;
|
||||||
|
private System.Windows.Forms.Label flow3FromExclamation;
|
||||||
|
private System.Windows.Forms.Label flow2ToExclamation;
|
||||||
|
private System.Windows.Forms.Label flow2FromExclamation;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,171 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using Statistics.Resources;
|
||||||
|
|
||||||
|
namespace Statistics.UserControls
|
||||||
|
{
|
||||||
|
public partial class MidOrWaterMetersCtrl : UserControl
|
||||||
|
{
|
||||||
|
public MidId MidId;
|
||||||
|
public StatisticsDlg Parent;
|
||||||
|
|
||||||
|
public bool Flow1Enabled { get { return flow1CheckBox.Checked; } }
|
||||||
|
public double Flow1From { get { return flow1From; } }
|
||||||
|
public double Flow1To { get { return flow1To; } }
|
||||||
|
|
||||||
|
public bool Flow2Enabled { get { return flow2CheckBox.Checked; } }
|
||||||
|
public double Flow2From { get { return flow2From; } }
|
||||||
|
public double Flow2To { get { return flow2To; } }
|
||||||
|
|
||||||
|
public bool Flow3Enabled { get { return flow3CheckBox.Checked; } }
|
||||||
|
public double Flow3From { get { return flow3From; } }
|
||||||
|
public double Flow3To { get { return flow3To; } }
|
||||||
|
|
||||||
|
/// All flows are in m3/h
|
||||||
|
double flow1From;
|
||||||
|
double flow1To;
|
||||||
|
double flow2From;
|
||||||
|
double flow2To;
|
||||||
|
double flow3From;
|
||||||
|
double flow3To;
|
||||||
|
|
||||||
|
|
||||||
|
StatisticsCtrl GetStatistics(int i)
|
||||||
|
{
|
||||||
|
if ((i >= 0) && (i < benchesTabControl.TabPages.Count) && benchesTabControl.TabPages[i].Controls.Count > 0)
|
||||||
|
{
|
||||||
|
return benchesTabControl.TabPages[i].Controls[0] as StatisticsCtrl;
|
||||||
|
}
|
||||||
|
else return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void UpdateRequest(int benchId)
|
||||||
|
{
|
||||||
|
Parent.UpdateRequest(benchId, MidId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public MidOrWaterMetersCtrl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
ManageCheckGroupBox(flow1CheckBox, flow1GroupBox);
|
||||||
|
ManageCheckGroupBox(flow2CheckBox, flow2GroupBox);
|
||||||
|
ManageCheckGroupBox(flow3CheckBox, flow3GroupBox);
|
||||||
|
|
||||||
|
for (int i = 0; i < benchesTabControl.TabPages.Count; i++ )
|
||||||
|
{
|
||||||
|
TabPage tp = benchesTabControl.TabPages[i];
|
||||||
|
if ((tp.Controls.Count > 0) && (tp.Controls[0] is StatisticsCtrl))
|
||||||
|
{
|
||||||
|
(tp.Controls[0] as StatisticsCtrl).Id = i;
|
||||||
|
(tp.Controls[0] as StatisticsCtrl).BenchesCtrl = this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Localize()
|
||||||
|
{
|
||||||
|
flow1CheckBox.Text = string.Format("{0} 1", Strings.Flow);
|
||||||
|
flow2CheckBox.Text = string.Format("{0} 2", Strings.Flow);
|
||||||
|
flow3CheckBox.Text = string.Format("{0} 3", Strings.Flow);
|
||||||
|
fromLabel2.Text = Strings.From;
|
||||||
|
fromLabel3.Text = Strings.From;
|
||||||
|
fromLabel4.Text = Strings.From;
|
||||||
|
toLabel2.Text = Strings.To;
|
||||||
|
toLabel3.Text = Strings.To;
|
||||||
|
toLabel4.Text = Strings.To;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void flow1CheckBox_CheckedChanged(object sender, EventArgs e) { ManageCheckGroupBox(flow1CheckBox, flow1GroupBox); }
|
||||||
|
private void flow2CheckBox_CheckedChanged(object sender, EventArgs e) { ManageCheckGroupBox(flow2CheckBox, flow2GroupBox); }
|
||||||
|
private void flow3CheckBox_CheckedChanged(object sender, EventArgs e) { ManageCheckGroupBox(flow3CheckBox, flow3GroupBox); }
|
||||||
|
|
||||||
|
private void ManageCheckGroupBox(CheckBox chk, GroupBox grp)
|
||||||
|
{
|
||||||
|
/// Make sure the CheckBox isn't in the GroupBox. This will only happen the first time.
|
||||||
|
if (chk.Parent == grp)
|
||||||
|
{
|
||||||
|
grp.Parent.Controls.Add(chk); /// Reparent the CheckBox so it's not in the GroupBox.
|
||||||
|
chk.Location = new Point(chk.Left + grp.Left, chk.Top + grp.Top); /// Adjust the CheckBox's location.
|
||||||
|
chk.BringToFront(); /// Move the CheckBox to the top of the stacking order.
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Enable or disable the GroupBox.
|
||||||
|
grp.Enabled = chk.Checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void flow1FromTextBox_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(flow1FromTextBox.Text))
|
||||||
|
{
|
||||||
|
flow1From = 0;
|
||||||
|
flow1FromExclamation.Visible = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
flow1FromExclamation.Visible = !(double.TryParse(flow1FromTextBox.Text, out flow1From) && (flow1From >= 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void flow1ToTextBox_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(flow1ToTextBox.Text))
|
||||||
|
{
|
||||||
|
flow1To = 0;
|
||||||
|
flow1ToExclamation.Visible = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
flow1ToExclamation.Visible = !(double.TryParse(flow1ToTextBox.Text, out flow1To) && (flow1To >= 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void flow2FromTextBox_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(flow2FromTextBox.Text))
|
||||||
|
{
|
||||||
|
flow2From = 0;
|
||||||
|
flow2FromExclamation.Visible = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
flow2FromExclamation.Visible = !(double.TryParse(flow2FromTextBox.Text, out flow2From) && (flow2From >= 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void flow2ToTextBox_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(flow2ToTextBox.Text))
|
||||||
|
{
|
||||||
|
flow2To = 0;
|
||||||
|
flow2ToExclamation.Visible = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
flow2ToExclamation.Visible = !(double.TryParse(flow2ToTextBox.Text, out flow2To) && (flow2To >= 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void flow3FromTextBox_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(flow3FromTextBox.Text))
|
||||||
|
{
|
||||||
|
flow3From = 0;
|
||||||
|
flow3FromExclamation.Visible = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
flow3FromExclamation.Visible = !(double.TryParse(flow3FromTextBox.Text, out flow3From) && (flow3From >= 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void flow3ToTextBox_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(flow3ToTextBox.Text))
|
||||||
|
{
|
||||||
|
flow3To = 0;
|
||||||
|
flow3ToExclamation.Visible = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
flow3ToExclamation.Visible = !(double.TryParse(flow3ToTextBox.Text, out flow3To) && (flow3To >= 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+60
@@ -0,0 +1,60 @@
|
|||||||
|
namespace Statistics.UserControls
|
||||||
|
{
|
||||||
|
partial class StatisticsCtrl
|
||||||
|
{
|
||||||
|
/// <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.updateButton = new System.Windows.Forms.Button();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// updateButton
|
||||||
|
//
|
||||||
|
this.updateButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.updateButton.Location = new System.Drawing.Point(255, 11);
|
||||||
|
this.updateButton.Name = "updateButton";
|
||||||
|
this.updateButton.Size = new System.Drawing.Size(122, 43);
|
||||||
|
this.updateButton.TabIndex = 4;
|
||||||
|
this.updateButton.Text = "Update";
|
||||||
|
this.updateButton.UseVisualStyleBackColor = true;
|
||||||
|
this.updateButton.Click += new System.EventHandler(this.updateButton_Click);
|
||||||
|
//
|
||||||
|
// StatisticsCtrl
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.Controls.Add(this.updateButton);
|
||||||
|
this.Name = "StatisticsCtrl";
|
||||||
|
this.Size = new System.Drawing.Size(388, 242);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Button updateButton;
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user