Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2fc29f5cb | ||
|
|
9805f816ff | ||
|
|
67a53909f8 | ||
|
|
fbfbbecca4 | ||
|
|
e8db0f46c3 | ||
|
|
c1705713df | ||
|
|
0fd1d9e141 | ||
|
|
5ee66205a9 | ||
|
|
03e8108704 | ||
|
|
ed4179be5f | ||
|
|
bedbecbcc3 | ||
|
|
e81de2267b | ||
|
|
3dfff4ad70 | ||
|
|
7a640621ac | ||
|
|
807daf2bcd | ||
|
|
ede1773b4f | ||
|
|
e3ae1b24f1 | ||
|
|
f6dc9d74fc | ||
|
|
51f3a6e6c2 | ||
|
|
f81d5111a9 | ||
|
|
b24ec4ea2d | ||
|
|
f3ed9a64f7 | ||
|
|
866939abbd | ||
|
|
248f51fa69 | ||
|
|
b4dc83e7fa | ||
|
|
0bb6a2cd8c | ||
|
|
c3d3a8c987 | ||
|
|
825230d9e9 | ||
|
|
cb13e3f108 | ||
|
|
2552949c59 | ||
|
|
317e0f16cb | ||
|
|
8e046046cd | ||
|
|
e440981068 | ||
|
|
299f3ecb68 | ||
|
|
39aa02f9ab | ||
|
|
d502873d17 | ||
|
|
da192a207c | ||
|
|
23560f1702 | ||
|
|
36a6fba408 | ||
|
|
2ca9c104d2 | ||
|
|
994568799d | ||
|
|
7f8a5c83ed | ||
|
|
99b68f1dd6 | ||
|
|
604c59723f | ||
|
|
886d87c03d | ||
|
|
d4eb52d70e | ||
|
|
e2650736cd | ||
|
|
77b71d5a7d | ||
|
|
bd65ff5420 | ||
|
|
0449c38de2 | ||
|
|
eb6f76d6f5 | ||
|
|
6fdb030b9f | ||
|
|
6079c8419f | ||
|
|
ef6f21eb9e | ||
|
|
50db69e5cb | ||
|
|
9194871508 | ||
|
|
5dde27bad9 | ||
|
|
e61e5c59cb | ||
|
|
ff3118068d | ||
|
|
c3d5e157ec | ||
|
|
ef5320917a | ||
|
|
e37dd87ece | ||
|
|
128d71bcd8 | ||
|
|
da220f4e7f | ||
|
|
2d42ae95f8 | ||
|
|
e0af6a5c20 | ||
|
|
838ec17b29 | ||
|
|
b2b0be4097 | ||
|
|
142da5cbec | ||
|
|
969c983d42 | ||
|
|
1d86a1289d | ||
|
|
d4518ac651 | ||
|
|
73aa148ded | ||
|
|
2041b7b3b1 | ||
|
|
d708e6e01f | ||
|
|
0580e04be4 | ||
|
|
59f1de4370 | ||
|
|
bb1efb122e | ||
|
|
375cea26a6 | ||
|
|
156cec5596 | ||
|
|
98a3730fa3 | ||
|
|
2f788adb7d | ||
|
|
e622718c27 | ||
|
|
e98d633d7f | ||
|
|
b83ffb9e9b | ||
|
|
1d31e5c4b7 | ||
|
|
1fbaccf4db | ||
|
|
c0c65f3381 | ||
|
|
d032d26c59 | ||
|
|
28a324be8d | ||
|
|
fa22b6a8c7 | ||
|
|
a89b134a5a | ||
|
|
ed21afd82e | ||
|
|
df5b240397 | ||
|
|
a6b8fade23 | ||
|
|
1fb6cf4717 | ||
|
|
4fbf471ea0 | ||
|
|
b57d22e276 | ||
|
|
9fa7079dc0 | ||
|
|
2a05126444 | ||
|
|
58d1c1e1ef | ||
|
|
430e897429 | ||
|
|
b9b86ecaff | ||
|
|
1c5c260a82 | ||
|
|
f46352e8fd | ||
|
|
096b649e40 | ||
|
|
4642abac2d | ||
|
|
721904dbae | ||
|
|
899caac18b | ||
|
|
a07c54186f | ||
|
|
e252e55197 | ||
|
|
b873dd5bf5 | ||
|
|
59eb1902f7 | ||
|
|
db6903e406 | ||
|
|
53bff92b21 | ||
|
|
f8458a4275 | ||
|
|
0c5003be7b | ||
|
|
05bdf0dc06 | ||
|
|
dfd8e879d1 | ||
|
|
2382ceea73 | ||
|
|
0c72e76ecc | ||
|
|
6226e069eb | ||
|
|
47b6bb4cf7 | ||
|
|
bbcbee894d | ||
|
|
944862dde0 | ||
|
|
14a5721649 | ||
|
|
93bcde2599 | ||
|
|
05c312fbb9 | ||
|
|
53795db720 | ||
|
|
156215bea6 | ||
|
|
48c021e9fb | ||
|
|
357a216b6b | ||
|
|
d6215178b1 | ||
|
|
1a122cfa12 | ||
|
|
59087474d9 | ||
|
|
3fceee156b | ||
|
|
55ed11ae58 | ||
|
|
39f44ad2e3 | ||
|
|
3075169fd1 | ||
|
|
d51edbfbfe | ||
|
|
7724c004a0 | ||
|
|
6b42dd091f | ||
|
|
4221de3b22 | ||
|
|
a4debe7ac0 | ||
|
|
c1cfc67cce | ||
|
|
7fa06079c2 | ||
|
|
a0818e3605 | ||
|
|
8197777e69 | ||
|
|
667f548101 | ||
|
|
fa1dc3cc62 | ||
|
|
fed11e6439 | ||
|
|
d197629cdb | ||
|
|
f8a2126c90 | ||
|
|
5955a47518 | ||
|
|
32a13ecf49 | ||
|
|
5936efcad2 | ||
|
|
04547306d0 | ||
|
|
d0bba74dff | ||
|
|
1e97a26863 | ||
|
|
6341d5a474 | ||
|
|
e9bda4f1b2 | ||
|
|
6cc10d221d | ||
|
|
3d243c0a19 | ||
|
|
e32a484e81 | ||
|
|
5dad80d031 | ||
|
|
24e23d01e8 | ||
|
|
b2ae78e0d9 | ||
|
|
79fe396a6d | ||
|
|
cfb29c8149 | ||
|
|
960dc9d53a | ||
|
|
03180392b0 | ||
|
|
03aa29cf75 | ||
|
|
d724dab388 | ||
|
|
208510921a | ||
|
|
51d28fc5a9 | ||
|
|
f8671ac516 | ||
|
|
556290abf6 | ||
|
|
e1e74e1588 | ||
|
|
fa7565e541 | ||
|
|
3c341d4d97 | ||
|
|
b8a16f1301 | ||
|
|
33947e383f | ||
|
|
6a61c9400b | ||
|
|
32d560d164 | ||
|
|
809b067260 | ||
|
|
b235f9ae20 | ||
|
|
e356934ede | ||
|
|
2c4c76343d | ||
|
|
b8c4f35b1a | ||
|
|
c855a18c61 | ||
|
|
d40f6a6c15 | ||
|
|
a2bb50117e | ||
|
|
8624f30f71 | ||
|
|
9fecf05b3f | ||
|
|
0041ec9616 | ||
|
|
77c26abc02 | ||
|
|
0c964fdb5b | ||
|
|
84322476d6 | ||
|
|
f1278dd9a5 | ||
|
|
e7164b98ff | ||
|
|
26d49eb4b7 | ||
|
|
b410f473e2 | ||
|
|
3e54204a17 | ||
|
|
70cba76ffd | ||
|
|
d45c3f96d6 | ||
|
|
684fed8fc0 | ||
|
|
99bb0cec57 | ||
|
|
263d990be4 | ||
|
|
5f6c1fe70a | ||
|
|
2e76d595c0 | ||
|
|
75e5b75d4d | ||
|
|
b47f5e32d4 | ||
|
|
771af696ae | ||
|
|
b10ab44fa9 | ||
|
|
13eb7138a3 | ||
|
|
02f6c9264a | ||
|
|
edb26ccf6e | ||
|
|
2574ce1aee | ||
|
|
5586f58c6e | ||
|
|
138e436645 | ||
|
|
ea7e727798 | ||
|
|
7a40cfb1f2 | ||
|
|
b2226ad779 | ||
|
|
ebf96f655c | ||
|
|
4134bf8875 | ||
|
|
fd7149e263 | ||
|
|
a40b4ff606 | ||
|
|
86c063caee | ||
|
|
bea3c04eb7 | ||
|
|
c5644d6999 | ||
|
|
29c4c869f2 | ||
|
|
707c093f0c | ||
|
|
abaf756980 | ||
|
|
32873ee2b0 | ||
|
|
dd8273798a | ||
|
|
0dae18e5e8 | ||
|
|
17063518ce | ||
|
|
a4998521f5 | ||
|
|
d2df1a678f | ||
|
|
f6aa6ba2d6 | ||
|
|
82743bac05 | ||
|
|
30df663634 | ||
|
|
f8ac27ba3c | ||
|
|
88496cf003 | ||
|
|
4e2c4c3bac | ||
|
|
9bed5e6682 | ||
|
|
c6e1d672e5 | ||
|
|
8b2d01a5ac | ||
|
|
2037f8bbe7 | ||
|
|
772cfc8e29 | ||
|
|
1eebb3b4a1 | ||
|
|
550fe20094 | ||
|
|
25e6a04a98 | ||
|
|
ab8f550bb3 | ||
|
|
c59d2cf52c | ||
|
|
23c9fadf86 | ||
|
|
f5926259a7 | ||
|
|
f180af692f | ||
|
|
d3ca871eb5 | ||
|
|
58f046ca34 | ||
|
|
e1c4da482a | ||
|
|
b7a079515c | ||
|
|
5849984381 | ||
|
|
a75a7d0a4a | ||
|
|
4fa2159e61 | ||
|
|
3f3a01857b | ||
|
|
c37f15bae2 | ||
|
|
2bce044cba | ||
|
|
1937850814 | ||
|
|
1703c5dcc2 | ||
|
|
6b803444f0 | ||
|
|
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 |
@@ -0,0 +1,2 @@
|
||||
# Set the default behavior, in case people don't have core.autocrlf set.
|
||||
* text=auto
|
||||
+9
-2
@@ -1,19 +1,25 @@
|
||||
Config/bin/
|
||||
Config/obj/
|
||||
Decrypt/bin/
|
||||
Decrypt/obj/
|
||||
DeviceTest/bin/
|
||||
DeviceTest/obj/
|
||||
Dirichlet.Numerics/bin
|
||||
Dirichlet.Numerics/obj
|
||||
Encrypt/bin/
|
||||
Encrypt/obj/
|
||||
GemCard/bin
|
||||
GemCard/obj
|
||||
GraphLib/bin
|
||||
GraphLib/obj
|
||||
MonitoringDB/bin
|
||||
MonitoringDB/obj
|
||||
TracingDB/bin
|
||||
TracingDB/obj
|
||||
Results/bin/
|
||||
Results/obj/
|
||||
ResultsBrowser/bin/
|
||||
ResultsBrowser/obj/
|
||||
Statistics/bin/
|
||||
Statistics/obj/
|
||||
TBF/bin/
|
||||
TBF/obj/
|
||||
TBFSetup/Debug/
|
||||
@@ -23,5 +29,6 @@ Users/obj/
|
||||
UserManagement/bin/
|
||||
UserManagement/obj/
|
||||
Doc/
|
||||
.vs/
|
||||
*.suo
|
||||
*.bak
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;RUM_MOB;LANG_RO</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
@@ -28,7 +28,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;MUNICH</DefineConstants>
|
||||
<DefineConstants>TRACE;RUM_MOB;LANG_RO</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
@@ -78,6 +78,7 @@
|
||||
<Compile Include="Entities\IHasName.cs" />
|
||||
<Compile Include="Entities\IHasValves.cs" />
|
||||
<Compile Include="Entities\IParamsProvider.cs" />
|
||||
<Compile Include="Entities\IperlEnums.cs" />
|
||||
<Compile Include="Entities\MeasurementCorrection.cs" />
|
||||
<Compile Include="Entities\MetersPath.cs" />
|
||||
<Compile Include="Entities\OutputPath.cs" />
|
||||
@@ -124,6 +125,7 @@
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Resources\Strings.cs.resx" />
|
||||
<EmbeddedResource Include="Resources\Strings.de.resx" />
|
||||
<EmbeddedResource Include="Resources\Strings.fr.resx" />
|
||||
<EmbeddedResource Include="Resources\Strings.it.resx" />
|
||||
<EmbeddedResource Include="Resources\Strings.pl.resx" />
|
||||
<EmbeddedResource Include="Resources\Strings.resx">
|
||||
|
||||
+37
-7
@@ -10,29 +10,59 @@ namespace Config
|
||||
|
||||
#if MUNICH
|
||||
public const int WMsCount = 3;
|
||||
public const int LineSize = 1;
|
||||
public const int CompoundWMsCount = 1;
|
||||
public const int LineSize = 3;
|
||||
public const int CompoundWMsCount = 3;
|
||||
public const int HeatMetersCount = 0;
|
||||
public const int MaxPartNr = 3;
|
||||
#elif DN100 || BADGER_STREDNA_TRAT || BADGER_VELKA_TRAT
|
||||
#elif DN100 || BADGER_STREDNA_TRAT || BADGER_VELKA_TRAT || CEVAK_200
|
||||
public const int WMsCount = 3;
|
||||
public const int LineSize = 3;
|
||||
public const int CompoundWMsCount = 1;
|
||||
public const int HeatMetersCount = 0;
|
||||
public const int MaxPartNr = WMsCount / LineSize;
|
||||
#elif FUZHOU300 || FUZHOU150 || PT200IL || PUCHONG_PT200 || GENESIS || SLM_150 || PETERSBURG_200
|
||||
#elif FUZHOU_300 || FUZHOU_150 || IZRAEL_200 || GENESIS || SLM_150 || PETERSBURG_200
|
||||
public const int WMsCount = 6;
|
||||
public const int LineSize = 6;
|
||||
public const int CompoundWMsCount = 1;
|
||||
public const int HeatMetersCount = 0;
|
||||
public const int MaxPartNr = 3;
|
||||
#elif PUCHONG_200
|
||||
public const int WMsCount = 6;
|
||||
public const int LineSize = 6;
|
||||
public const int CompoundWMsCount = 3;
|
||||
public const int HeatMetersCount = 0;
|
||||
public const int MaxPartNr = 3;
|
||||
#elif TORINO50 || BADGER_MALA_TRAT || BERLIN
|
||||
#elif DEWA_300
|
||||
public const int WMsCount = 10;
|
||||
public const int LineSize = 10;
|
||||
public const int CompoundWMsCount = 3;
|
||||
public const int HeatMetersCount = 0;
|
||||
public const int MaxPartNr = WMsCount / LineSize;
|
||||
#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 LineSize = 6;
|
||||
public const int CompoundWMsCount = 1;
|
||||
public const int HeatMetersCount = 0;
|
||||
public const int MaxPartNr = 1;
|
||||
#elif TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40 || FUZHOU_40 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA
|
||||
#elif TORUN_50 || CEVAK_40 || MURES_40 || FUZHOU_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || ALZIR_25
|
||||
public const int WMsCount = 20;
|
||||
public const int LineSize = 10;
|
||||
public const int CompoundWMsCount = 1;
|
||||
@@ -44,7 +74,7 @@ namespace Config
|
||||
public const int CompoundWMsCount = 1;
|
||||
public const int HeatMetersCount = 0;
|
||||
public const int MaxPartNr = WMsCount / LineSize;
|
||||
#elif TURA_IPERL
|
||||
#elif TURA_IPERL || TURA_IPERL_NEW
|
||||
public const int WMsCount = 40;
|
||||
public const int LineSize = 20;
|
||||
public const int CompoundWMsCount = 1;
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Config
|
||||
result.IsRealBench = IsRealBench;
|
||||
result.ProceduresDBSettings = (Users.DBSettings)ProceduresDBSettings.Clone();
|
||||
result.WaterMetersDBSettings = (Users.DBSettings)WaterMetersDBSettings.Clone();
|
||||
result.UsersDBSettings = (Users.DBSettings)ProceduresDBSettings.Clone();
|
||||
result.UsersDBSettings = (Users.DBSettings)UsersDBSettings.Clone();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
+129
-6
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -58,7 +58,7 @@ namespace Config.Entities
|
||||
[Description("Remote DB only")] RemoteDBOnly,
|
||||
[Description("Both DB-s, local 1st")] BothDBsLocalFirst,
|
||||
[Description("Both DB-s, remote 1st")] BothDBsRemoteFirst,
|
||||
Count,
|
||||
Count
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -90,6 +90,10 @@ namespace Config.Entities
|
||||
[Description("Wasserzähler")] Single,
|
||||
[Description("Verbundwasserzähler")] Combined,
|
||||
[Description("Wärmezähler")] HeatMeter,
|
||||
#elif LANG_FR
|
||||
[Description("Compteurs eau")] Single,
|
||||
[Description("Mètres composés")] Combined,
|
||||
[Description("Thermomètres")] HeatMeter,
|
||||
#elif LANG_CS
|
||||
[Description("Vodoměry")] Single,
|
||||
[Description("Kombinované vodoměry")] Combined,
|
||||
@@ -125,6 +129,9 @@ namespace Config.Entities
|
||||
#elif LANG_IT
|
||||
[Description("freddo")] ColdWater,
|
||||
[Description("caldo")] HotWater,
|
||||
#elif LANG_FR
|
||||
[Description("eau froide")] ColdWater,
|
||||
[Description("eau chaude")] HotWater,
|
||||
#else
|
||||
[Description("cold")] ColdWater,
|
||||
[Description("hot")] HotWater,
|
||||
@@ -224,6 +231,14 @@ namespace Config.Entities
|
||||
Count
|
||||
}
|
||||
|
||||
public enum MeretProtocol
|
||||
{
|
||||
[Description("<undefined>")] Undefined,
|
||||
[Description("Meret (obsolete)")] Meret,
|
||||
[Description("Modbus")] Modbus,
|
||||
Count
|
||||
}
|
||||
|
||||
public enum Publish : sbyte
|
||||
{
|
||||
#if LANG_DE
|
||||
@@ -232,6 +247,11 @@ namespace Config.Entities
|
||||
[Description("immer")] Always = 1,
|
||||
[Description("Bildschirm")] OnScreen = 2,
|
||||
[Description("intern")] Internal = 3,
|
||||
#elif LANG_FR
|
||||
[Description("jamais")] Never = 0,
|
||||
[Description("toujours")] Always = 1,
|
||||
[Description("À l'écran")] OnScreen = 2,
|
||||
[Description("interne")] Internal = 3,
|
||||
#elif LANG_CS
|
||||
/// czech
|
||||
[Description("nikdy")] Never = 0,
|
||||
@@ -273,6 +293,10 @@ namespace Config.Entities
|
||||
[Description("Waage")] Scale,
|
||||
[Description("Spanne")] Spread,
|
||||
[Description("Standardabw.")] StdDev,
|
||||
#elif LANG_FR
|
||||
[Description("Balance")] Scale,
|
||||
[Description("Envergure")] Spread,
|
||||
[Description("Déviation std.")] StdDev,
|
||||
#elif LANG_CS
|
||||
/// cesky
|
||||
[Description("váhou")] Scale,
|
||||
@@ -283,7 +307,7 @@ namespace Config.Entities
|
||||
[Description("Spread")] Spread,
|
||||
[Description("Std.dev.")] StdDev,
|
||||
#endif
|
||||
Count
|
||||
Count
|
||||
}
|
||||
|
||||
public enum TestRedType
|
||||
@@ -337,6 +361,14 @@ namespace Config.Entities
|
||||
[Description("Prüfpunktergebnisse")] TestResult,
|
||||
[Description("Wasserzelledaten")] MeterData,
|
||||
[Description("Wasserzelleergebnisse")] MeterResult,
|
||||
#elif LANG_FR
|
||||
[Description("Autres")] Other,
|
||||
[Description("Données de banc")] BenchData,
|
||||
[Description("Résultats du banc")] BenchResult,
|
||||
[Description("Données de test")] TestData,
|
||||
[Description("Résultats de test")] TestResult,
|
||||
[Description("Données du compteur d'eau")] MeterData,
|
||||
[Description("Résultats du compteur d'eau")] MeterResult,
|
||||
#else
|
||||
[Description("Other")] Other,
|
||||
[Description("Bench data")] BenchData,
|
||||
@@ -346,7 +378,7 @@ namespace Config.Entities
|
||||
[Description("Meter data")] MeterData,
|
||||
[Description("Meter result")] MeterResult,
|
||||
#endif
|
||||
Count,
|
||||
Count,
|
||||
}
|
||||
|
||||
/// <summary> Possible modes of operation of components and devices. </summary>
|
||||
@@ -363,6 +395,17 @@ namespace Config.Entities
|
||||
[Description("Reply")] Reply,
|
||||
[Description("Simuliert")] Simulate, /// Test bench simulation, this mode does not require any hardware
|
||||
[Description("Geerbt")] Inherit,
|
||||
#elif LANG_FR
|
||||
[Description("Détection automatique: Éteindre")] DetectedOff = -2,
|
||||
[Description("Détection automatique: Allumé")] DetectedOn = -1,
|
||||
[Description("Ordinaire")] Normal = 0,
|
||||
[Description("Détection automatique")] AutoDetect,
|
||||
[Description("Erreur d'exécution")] FailureDuringOperation,
|
||||
[Description("Éteindre")] Off,
|
||||
[Description("Record")] Record,
|
||||
[Description("Répondre")] Reply,
|
||||
[Description("Simuler")] Simulate,
|
||||
[Description("Hériter")] Inherit,
|
||||
#else
|
||||
[Description("Detected off")] DetectedOff = -2,
|
||||
[Description("Detected on")] DetectedOn = -1,
|
||||
@@ -375,7 +418,7 @@ namespace Config.Entities
|
||||
[Description("Simulate")] Simulate, /// Test bench simulation, this mode does not require any hardware
|
||||
[Description("Inherit")] Inherit,
|
||||
#endif
|
||||
Count,
|
||||
Count,
|
||||
}
|
||||
|
||||
public enum LogLevel
|
||||
@@ -422,6 +465,11 @@ namespace Config.Entities
|
||||
[Description("zentriert")] Center,
|
||||
[Description("rechts")] Right,
|
||||
[Description("angepasst")] Justified,
|
||||
#elif LANG_FR
|
||||
[Description("gauche")] Left,
|
||||
[Description("centré")] Center,
|
||||
[Description("droit")] Right,
|
||||
[Description("justifié")] Justified,
|
||||
#else
|
||||
[Description("Left")] Left,
|
||||
[Description("Center")] Center,
|
||||
@@ -471,6 +519,10 @@ namespace Config.Entities
|
||||
[Description("aus")] Off,
|
||||
[Description("info")] Info,
|
||||
[Description("ein")] On,
|
||||
#elif LANG_FR
|
||||
[Description("éteindre")] Off,
|
||||
[Description("info")] Info,
|
||||
[Description("allumé")] On,
|
||||
#elif LANG_CS
|
||||
[Description("vypnuto")] Off,
|
||||
[Description("info")] Info,
|
||||
@@ -488,6 +540,77 @@ namespace Config.Entities
|
||||
[Description("info")] Info,
|
||||
[Description("on")] On,
|
||||
#endif
|
||||
Count
|
||||
Count
|
||||
}
|
||||
|
||||
|
||||
public enum ErrorFlagShift
|
||||
{
|
||||
E1 = 0,
|
||||
E2,
|
||||
E3,
|
||||
E4,
|
||||
E5,
|
||||
E6,
|
||||
E7,
|
||||
E8,
|
||||
E9,
|
||||
E10,
|
||||
E11,
|
||||
E12,
|
||||
E13,
|
||||
E14,
|
||||
E15,
|
||||
E16,
|
||||
E17,
|
||||
E18,
|
||||
E19,
|
||||
E20,
|
||||
E21,
|
||||
E22,
|
||||
E23,
|
||||
E24,
|
||||
E25,
|
||||
E26,
|
||||
E27,
|
||||
E28,
|
||||
E29,
|
||||
E30,
|
||||
E31,
|
||||
}
|
||||
|
||||
public enum ErrorFlagMask
|
||||
{
|
||||
E1 = (1 << (int)ErrorFlagShift.E1),
|
||||
E2 = (1 << (int)ErrorFlagShift.E2),
|
||||
E3 = (1 << (int)ErrorFlagShift.E3),
|
||||
E4 = (1 << (int)ErrorFlagShift.E4),
|
||||
E5 = (1 << (int)ErrorFlagShift.E5),
|
||||
E6 = (1 << (int)ErrorFlagShift.E6),
|
||||
E7 = (1 << (int)ErrorFlagShift.E7),
|
||||
E8 = (1 << (int)ErrorFlagShift.E8),
|
||||
E9 = (1 << (int)ErrorFlagShift.E9),
|
||||
E10 = (1 << (int)ErrorFlagShift.E10),
|
||||
E11 = (1 << (int)ErrorFlagShift.E11),
|
||||
E12 = (1 << (int)ErrorFlagShift.E12),
|
||||
E13 = (1 << (int)ErrorFlagShift.E13),
|
||||
E14 = (1 << (int)ErrorFlagShift.E14),
|
||||
E15 = (1 << (int)ErrorFlagShift.E15),
|
||||
E16 = (1 << (int)ErrorFlagShift.E16),
|
||||
E17 = (1 << (int)ErrorFlagShift.E17),
|
||||
E18 = (1 << (int)ErrorFlagShift.E18),
|
||||
E19 = (1 << (int)ErrorFlagShift.E19),
|
||||
E20 = (1 << (int)ErrorFlagShift.E20),
|
||||
E21 = (1 << (int)ErrorFlagShift.E21),
|
||||
E22 = (1 << (int)ErrorFlagShift.E22),
|
||||
E23 = (1 << (int)ErrorFlagShift.E23),
|
||||
E24 = (1 << (int)ErrorFlagShift.E24),
|
||||
E25 = (1 << (int)ErrorFlagShift.E25),
|
||||
E26 = (1 << (int)ErrorFlagShift.E26),
|
||||
E27 = (1 << (int)ErrorFlagShift.E27),
|
||||
E28 = (1 << (int)ErrorFlagShift.E28),
|
||||
E29 = (1 << (int)ErrorFlagShift.E29),
|
||||
E30 = (1 << (int)ErrorFlagShift.E30),
|
||||
E31 = (1 << (int)ErrorFlagShift.E31),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,11 @@ namespace Config.Entities
|
||||
/// <param name="strValue">String representation of the parameter</param>
|
||||
CfgUpdateFlags UpdateParam(int ix, string strValue);
|
||||
|
||||
void UpdateEmbeddedDbEntity();
|
||||
/// <summary>
|
||||
/// Updates DB entities for related parameters
|
||||
/// </summary>
|
||||
/// <returns>true when successful</returns>
|
||||
bool UpdateEmbeddedDbEntity();
|
||||
|
||||
/// <summary>
|
||||
/// Creates an object copy
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
///
|
||||
/// 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 Counting
|
||||
{
|
||||
Arbitrary,
|
||||
Positive,
|
||||
Negative,
|
||||
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 Correction { get; set; }
|
||||
|
||||
public MeasurementCorrection() { }
|
||||
public MeasurementCorrection()
|
||||
{
|
||||
RangeIx = 0;
|
||||
}
|
||||
|
||||
public MeasurementCorrection(int rangeIx)
|
||||
{
|
||||
RangeIx = rangeIx;
|
||||
RangeIx = rangeIx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,6 +234,42 @@ namespace Config.Entities
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Processes the selection done by the bench control panel in the main sequence.
|
||||
/// </summary>
|
||||
/// <param name="selection">Selection.Q1, .Q2, .Q3 or .Test</param>
|
||||
/// <returns>The selected test or null</returns>
|
||||
public virtual Test GetTest(string expandedTestName, out int testIx, out int repetNr)
|
||||
{
|
||||
for (int ix = 0; ix < Tests.Count; ix++)
|
||||
{
|
||||
Test test = Tests[ix];
|
||||
if (test.Name.Equals(expandedTestName))
|
||||
{
|
||||
/// Name is not expanded => Repeats==1
|
||||
testIx = ix;
|
||||
repetNr = 1;
|
||||
return test;
|
||||
}
|
||||
|
||||
for (int r = 1; r <= test.Repeats; r++)
|
||||
{
|
||||
if (test.GetExpandedTestName(r).Equals(expandedTestName))
|
||||
{
|
||||
testIx = ix;
|
||||
repetNr = r;
|
||||
return test;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
testIx = 0;
|
||||
repetNr = 1;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0}, rev.{1}", Name, Revision);
|
||||
|
||||
+86
-22
@@ -25,12 +25,12 @@ namespace Config.Entities
|
||||
public virtual float Volume { get; set; } /// Test volume (target) in [l]
|
||||
public virtual float TstTime { get; set; } /// Test time (estimate) in [s]
|
||||
public virtual string Method { get; set; }
|
||||
public virtual float ErrLimLo { get; set; } /// in [%] (usually < 0) or 1=class1, 2=class2, 3=class3
|
||||
public virtual float ErrLimHi { get; set; } /// in [%] (usually > 0) or -Qn in m3/h
|
||||
public virtual float ErrLimLo { get; set; } /// in [%] usually < 0, in case of heat meters: 1=class1, 2=class2, 3=class3
|
||||
public virtual float ErrLimHi { get; set; } /// in [%] usually > 0, in case of heat meters: -Qn in m3/h
|
||||
public virtual float Uncertainty { get; set; } /// int [%] makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
|
||||
public virtual int Repeats { get; set; }
|
||||
public virtual bool DoDraining { get; set; }
|
||||
public virtual bool DoZeroing { get; set; }
|
||||
public virtual bool DoDrainingAfter { get; set; }
|
||||
public virtual bool DoControlWaterTemp { get; set; }
|
||||
public virtual float TempLimLo { get; set; } /// Lower limit for the controlled temperature
|
||||
public virtual float TempLimHi { get; set; } /// Upper limit for the controlled temperature
|
||||
@@ -56,6 +56,9 @@ namespace Config.Entities
|
||||
public virtual string RelTransAfter { get; set; }
|
||||
public virtual string TransitionAfter { get; set; }
|
||||
|
||||
public virtual bool IsOuterLoopStart { get; set; } /// Not mapped to database
|
||||
public virtual bool IsOuterLoopEnd { get; set; } /// Not mapped to database
|
||||
|
||||
public virtual IList<ComponentTest> MoreParams { get; set; }
|
||||
|
||||
public virtual Procedure Procedure { get; set; }
|
||||
@@ -73,7 +76,7 @@ namespace Config.Entities
|
||||
DoEvaluate = true;
|
||||
Repeats = 1;
|
||||
DoDraining = false;
|
||||
DoZeroing = false;
|
||||
DoDrainingAfter = false;
|
||||
DoControlWaterTemp = false;
|
||||
TempLimLo = 15.0f;
|
||||
TempLimHi = 25.0f;
|
||||
@@ -121,7 +124,7 @@ namespace Config.Entities
|
||||
result.Uncertainty = Uncertainty;
|
||||
result.Repeats = Repeats;
|
||||
result.DoDraining = DoDraining;
|
||||
result.DoZeroing = DoZeroing;
|
||||
result.DoDrainingAfter = DoDrainingAfter;
|
||||
result.DoControlWaterTemp = DoControlWaterTemp;
|
||||
result.TempLimLo = TempLimLo;
|
||||
result.TempLimHi = TempLimHi;
|
||||
@@ -169,7 +172,7 @@ namespace Config.Entities
|
||||
output.WriteLine(Uncertainty.ToString(ci));
|
||||
output.WriteLine(Repeats.ToString(ci));
|
||||
output.WriteLine(DoDraining.ToString());
|
||||
output.WriteLine(DoZeroing.ToString());
|
||||
output.WriteLine(DoDrainingAfter.ToString());
|
||||
output.WriteLine(DoControlWaterTemp.ToString());
|
||||
output.WriteLine(TempLimLo.ToString(ci));
|
||||
output.WriteLine(TempLimHi.ToString(ci));
|
||||
@@ -219,7 +222,7 @@ namespace Config.Entities
|
||||
tst.Uncertainty = float.Parse(input.ReadLine(), ci);
|
||||
tst.Repeats = int.Parse(input.ReadLine(), ci);
|
||||
tst.DoDraining = bool.Parse(input.ReadLine());
|
||||
tst.DoZeroing = bool.Parse(input.ReadLine());
|
||||
tst.DoDrainingAfter = bool.Parse(input.ReadLine());
|
||||
tst.DoControlWaterTemp = bool.Parse(input.ReadLine());
|
||||
tst.TempLimLo = float.Parse(input.ReadLine(), ci);
|
||||
tst.TempLimHi = float.Parse(input.ReadLine(), ci);
|
||||
@@ -277,7 +280,7 @@ namespace Config.Entities
|
||||
ln = inp.ReadLine(); if (ln != Uncertainty.ToString(ci)) { diff.AppendFormat(fmt, "Uncertainty", Uncertainty.ToString(ci), ln); };
|
||||
ln = inp.ReadLine(); if (ln != Repeats.ToString(ci)) { diff.AppendFormat(fmt, "Repeats", Repeats.ToString(ci), ln); };
|
||||
ln = inp.ReadLine(); if (ln != DoDraining.ToString(ci)) { diff.AppendFormat(fmt, "Draining", DoDraining.ToString(ci), ln); };
|
||||
ln = inp.ReadLine(); if (ln != DoZeroing.ToString(ci)) { diff.AppendFormat(fmt, "Zeroing", DoZeroing.ToString(ci), ln); };
|
||||
ln = inp.ReadLine(); if (ln != DoDrainingAfter.ToString(ci)) { diff.AppendFormat(fmt, "Zeroing", DoDrainingAfter.ToString(ci), ln); };
|
||||
ln = inp.ReadLine(); if (ln != DoControlWaterTemp.ToString()) { diff.AppendFormat(fmt, "DoControlWaterTemp", DoControlWaterTemp.ToString(ci), ln); };
|
||||
ln = inp.ReadLine(); if (ln != TempLimLo.ToString(ci)) { diff.AppendFormat(fmt, "TempLimLo", TempLimLo.ToString(ci), ln); };
|
||||
ln = inp.ReadLine(); if (ln != TempLimHi.ToString(ci)) { diff.AppendFormat(fmt, "TempLimHi", TempLimHi.ToString(ci), ln); };
|
||||
@@ -310,54 +313,115 @@ namespace Config.Entities
|
||||
return null;
|
||||
}
|
||||
|
||||
public virtual float GetErrLimLo(float flow)
|
||||
/// <summary>
|
||||
/// Return test title for a this test and a given repetition number
|
||||
/// </summary>
|
||||
/// <param name="repetitonNr">1 .. Nr. repetitions</param>
|
||||
/// <returns>Test title (string)</returns>
|
||||
public virtual string GetExpandedTestName(int repetitionNr)
|
||||
{
|
||||
if (Repeats == 1)
|
||||
{
|
||||
if (Part == 0)
|
||||
{
|
||||
/// Single test
|
||||
return Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
/// A part of a single test
|
||||
return string.Format("{0} ({1})", Name, Part);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/// More test repetitions
|
||||
return string.Format("{0} ({1}/{2})", Name, repetitionNr, Repeats);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual double GetErrLimLo(double volumeCTV, double testTime)
|
||||
{
|
||||
if (ErrLimLo <= ErrLimHi)
|
||||
{
|
||||
return ErrLimLo; /// Error limit of a water meter
|
||||
return ErrLimLo; /// Error limit of a water meter
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Metrological class and nominal flow of a heat meter
|
||||
int metrClass = (int)Math.Round(ErrLimLo);
|
||||
float Qp = Math.Abs(ErrLimHi);
|
||||
float Q = Math.Max(flow, 0.00001f); /// to avoid division by zero
|
||||
double Qp = Math.Abs(ErrLimHi);
|
||||
double Q = (testTime == 0) ? 1 : Math.Max(3.6 * volumeCTV / testTime, 0.00001); /// Div. by zero avoided
|
||||
|
||||
/// Calculate the error limit of a heat meter
|
||||
switch (metrClass)
|
||||
{
|
||||
default:
|
||||
case 1: return -Math.Min(3.5f, 1.0f + 0.01f * Qp / Q);
|
||||
case 2: return -Math.Min(5.0f, 2.0f + 0.02f * Qp / Q);
|
||||
case 3: return -Math.Min(5.0f, 3.0f + 0.05f * Qp / Q);
|
||||
case 1: return -Math.Min(3.5, 1.0 + 0.01 * Qp / Q);
|
||||
case 2: return -Math.Min(5.0, 2.0 + 0.02 * Qp / Q);
|
||||
case 3: return -Math.Min(5.0, 3.0 + 0.05 * Qp / Q);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual float GetErrLimHi(float flow)
|
||||
public virtual double GetErrLimHi(double volumeCTV, double testTime)
|
||||
{
|
||||
if (ErrLimLo <= ErrLimHi)
|
||||
{
|
||||
return ErrLimHi; /// Error limit of a water meter
|
||||
return ErrLimHi; /// Error limit of a water meter
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Metrological class and nominal flow of a heat meter
|
||||
int metrClass = (int)Math.Round(ErrLimLo);
|
||||
float Qp = Math.Abs(ErrLimHi);
|
||||
float Q = Math.Max(flow, 0.00001f); /// to avoid division by zero
|
||||
double Qp = Math.Abs(ErrLimHi);
|
||||
double Q = (testTime == 0) ? 1 : Math.Max(3.6 * volumeCTV / testTime, 0.00001); /// Div. by zero avoided
|
||||
|
||||
/// Calculate the error limit of a heat meter
|
||||
switch (metrClass)
|
||||
{
|
||||
default:
|
||||
case 1: return +Math.Min(3.5f, 1.0f + 0.01f * Qp / Q);
|
||||
case 2: return +Math.Min(5.0f, 2.0f + 0.02f * Qp / Q);
|
||||
case 3: return +Math.Min(5.0f, 3.0f + 0.05f * Qp / Q);
|
||||
case 1: return +Math.Min(3.5, 1.0 + 0.01 * Qp / Q);
|
||||
case 2: return +Math.Min(5.0, 2.0 + 0.02 * Qp / Q);
|
||||
case 3: return +Math.Min(5.0, 3.0 + 0.05 * Qp / Q);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool IsPartCompatible(int waterMeterPartNr)
|
||||
{
|
||||
if ((this.Part == 0) || (waterMeterPartNr == 0)) return true;
|
||||
|
||||
if ((this.Part % 10) == waterMeterPartNr) return true;
|
||||
if (((this.Part / 10) % 10) == waterMeterPartNr) return true;
|
||||
if (((this.Part / 100) % 10) == waterMeterPartNr) return true;
|
||||
if (((this.Part / 1000) % 10) == waterMeterPartNr) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether tests part number is OK.
|
||||
/// Examples of correct part number are:
|
||||
/// 1, 2, 12, 21 in case of max. part nr.== 2
|
||||
/// 1, 2, 3, 4, 12, 13, 14, 23, 24, 34, 123, 124, 134, 234, 1234 in case of max. part nr.== 4
|
||||
/// </summary>
|
||||
/// <param name="partNr">Tests par tnumber</param>
|
||||
/// <returns>true when Part number is OK</returns>
|
||||
public static bool IsGoodPartNr(int partNr)
|
||||
{
|
||||
bool firstDigitIsOK = ((partNr % 10) > 0) && ((partNr % 10) <= Config.Data.MaxPartNr);
|
||||
bool secondDigitIsOK = (((partNr/10) % 10) > 0) && (((partNr/10) % 10) <= Config.Data.MaxPartNr);
|
||||
bool thirdDigitIsOK = (((partNr/100) % 10) > 0) && (((partNr/100) % 10) <= Config.Data.MaxPartNr);
|
||||
bool fourthDigitIsOK = (((partNr/1000) % 10) > 0) && (((partNr/1000) % 10) <= Config.Data.MaxPartNr);
|
||||
|
||||
if (firstDigitIsOK && (partNr / 10 == 0)) return true;
|
||||
if (firstDigitIsOK && secondDigitIsOK && (partNr / 100 == 0)) return true;
|
||||
if (firstDigitIsOK && secondDigitIsOK && thirdDigitIsOK && (partNr / 1000 == 0)) return true;
|
||||
if (firstDigitIsOK && secondDigitIsOK && thirdDigitIsOK && fourthDigitIsOK && (partNr / 10000 == 0)) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
|
||||
namespace Config.Entities
|
||||
{
|
||||
@@ -37,5 +40,56 @@ namespace Config.Entities
|
||||
foreach (var step in TransitionSteps) { result.TransitionSteps.Add(step.Clone()); }
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Export(StreamWriter output)
|
||||
{
|
||||
output.WriteLine(ItemNr.ToString(CultureInfo.InvariantCulture));
|
||||
output.WriteLine(Name);
|
||||
output.WriteLine(Description);
|
||||
|
||||
foreach (var step in TransitionSteps) { step.Export(output); }
|
||||
output.WriteLine();
|
||||
|
||||
output.Close();
|
||||
}
|
||||
|
||||
public static TransitionSequence Import(StreamReader input)
|
||||
{
|
||||
TransitionSequence result = new TransitionSequence();
|
||||
|
||||
result.ItemNr = int.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
|
||||
result.Name = input.ReadLine();
|
||||
result.Description = input.ReadLine();
|
||||
|
||||
while (true)
|
||||
{
|
||||
TransitionStep step = TransitionStep.Import(input, result);
|
||||
if (step == null)
|
||||
break;
|
||||
else
|
||||
result.TransitionSteps.Add(step);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public virtual string Compare(StreamReader inp)
|
||||
{
|
||||
System.Text.StringBuilder diff = new System.Text.StringBuilder();
|
||||
const string fmt = "{0} = {1}\r\n (in the file {2})\r\n";
|
||||
string ln;
|
||||
|
||||
ln = inp.ReadLine(); /// skip ItemNr
|
||||
ln = inp.ReadLine(); if (ln != Name) { diff.AppendFormat(fmt, "Name", Name, ln); };
|
||||
ln = inp.ReadLine(); if (ln != Description) { diff.AppendFormat(fmt, "Description", Description, ln); };
|
||||
|
||||
//foreach (var step in TransitionSteps)
|
||||
//{
|
||||
// string testDiff = step.Compare(inp);
|
||||
// if (testDiff.Contains(
|
||||
//}
|
||||
|
||||
return diff.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015, 2017 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
|
||||
namespace Config.Entities
|
||||
{
|
||||
@@ -61,5 +63,64 @@ namespace Config.Entities
|
||||
result += indent + "PumpsWithFMPct = " + PumpWithFMPcts + Environment.NewLine;
|
||||
return result;
|
||||
}
|
||||
|
||||
public virtual void Export(StreamWriter output)
|
||||
{
|
||||
CultureInfo ci = CultureInfo.InvariantCulture;
|
||||
|
||||
output.WriteLine(ItemNr.ToString(ci));
|
||||
output.WriteLine(Duration.ToString(ci));
|
||||
output.WriteLine(Message);
|
||||
output.WriteLine(EndCondition);
|
||||
output.WriteLine(ValvesOpen);
|
||||
output.WriteLine(ValvesClose);
|
||||
output.WriteLine(RegulValvesPct);
|
||||
output.WriteLine(PumpWithFMPcts);
|
||||
}
|
||||
|
||||
public static TransitionStep Import(StreamReader input, TransitionSequence newSequence)
|
||||
{
|
||||
string firstLine = input.ReadLine();
|
||||
if (string.IsNullOrEmpty(firstLine))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
CultureInfo ci = CultureInfo.InvariantCulture;
|
||||
int itemNr = int.Parse(firstLine, ci);
|
||||
TransitionStep tst = new TransitionStep(itemNr, newSequence);
|
||||
|
||||
tst.Duration = int.Parse(input.ReadLine(), ci);
|
||||
tst.Message = input.ReadLine();
|
||||
tst.EndCondition = input.ReadLine();
|
||||
tst.ValvesOpen = input.ReadLine();
|
||||
tst.ValvesClose = input.ReadLine();
|
||||
tst.RegulValvesPct = input.ReadLine();
|
||||
tst.PumpWithFMPcts = input.ReadLine();
|
||||
|
||||
return tst;
|
||||
}
|
||||
|
||||
public virtual string Compare(StreamReader inp)
|
||||
{
|
||||
System.Text.StringBuilder diff = new System.Text.StringBuilder();
|
||||
string fmt = string.Format("Step {0} : ", ItemNr) + "{0} = {1}\r\n (in the file {2})\r\n";
|
||||
string ln;
|
||||
CultureInfo ci = CultureInfo.InvariantCulture;
|
||||
|
||||
string firstLine = inp.ReadLine();
|
||||
if (string.IsNullOrEmpty(firstLine)) return string.Format("TransitionStep {0} is missing in the compared file\r\n", ItemNr);
|
||||
|
||||
if (ItemNr.ToString() != firstLine) { diff.AppendFormat(fmt, "ItemNr", ItemNr, firstLine); };
|
||||
ln = inp.ReadLine(); if (ln != Duration.ToString(ci)) { diff.AppendFormat(fmt, "Duration", Duration.ToString(ci), ln); };
|
||||
ln = inp.ReadLine(); if (ln != Message) { diff.AppendFormat(fmt, "Message", Message, ln); };
|
||||
ln = inp.ReadLine(); if (ln != EndCondition) { diff.AppendFormat(fmt, "EndCondition", EndCondition, ln); };
|
||||
ln = inp.ReadLine(); if (ln != ValvesOpen) { diff.AppendFormat(fmt, "ValvesOpen", ValvesOpen, ln); };
|
||||
ln = inp.ReadLine(); if (ln != ValvesClose) { diff.AppendFormat(fmt, "ValvesClose", ValvesClose, ln); };
|
||||
ln = inp.ReadLine(); if (ln != RegulValvesPct) { diff.AppendFormat(fmt, "RegulValvesPct", RegulValvesPct, ln); };
|
||||
ln = inp.ReadLine(); if (ln != PumpWithFMPcts) { diff.AppendFormat(fmt, "PumpWithFMPcts", PumpWithFMPcts, ln); };
|
||||
|
||||
return diff.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -11,8 +11,11 @@ namespace Config.Entities
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual string UserName { get; set; } /// = name, alias, abbreviation
|
||||
public virtual string FullName { get; set; } /// = description
|
||||
public virtual int Number { get; set; }
|
||||
public virtual string Tag { get; set; }
|
||||
public virtual int Number { get; set; }
|
||||
public virtual string Password { get; set; }
|
||||
public virtual string Password2 { get; set; }
|
||||
public virtual string Password3 { get; set; }
|
||||
public virtual DateTime LastPwChange { get; set; }
|
||||
public virtual IList<Group> Groups { get; set; } //User can be a member of a list of groups
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace Config.Entities
|
||||
{
|
||||
@@ -35,5 +36,24 @@ namespace Config.Entities
|
||||
foreach (var step in VirtualBenchSteps) { result.VirtualBenchSteps.Add(step.Clone()); }
|
||||
return result;
|
||||
}
|
||||
|
||||
public virtual void Export(StreamWriter output)
|
||||
{
|
||||
/// TODO
|
||||
}
|
||||
|
||||
public static VirtualBenchSequence Import(StreamReader input)
|
||||
{
|
||||
VirtualBenchSequence result = new VirtualBenchSequence();
|
||||
/// TODO
|
||||
return result;
|
||||
}
|
||||
|
||||
public virtual string Compare(StreamReader inp)
|
||||
{
|
||||
System.Text.StringBuilder diff = new System.Text.StringBuilder();
|
||||
/// TODO
|
||||
return diff.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-61
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
@@ -127,41 +127,6 @@ namespace Config
|
||||
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>
|
||||
/// Create an empty users database.
|
||||
/// Database contains only the user 'admin' and the control board component 'CB'.
|
||||
@@ -218,30 +183,5 @@ namespace Config
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+50
-35
@@ -221,45 +221,60 @@ namespace Config
|
||||
return error;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates corrected value form a list of corrections by interpolation.
|
||||
/// It is assumed that values in the list 'corrections' are sorted.
|
||||
/// </summary>
|
||||
/// <param name="rawMeasurement">Raw uncorrected value</param>
|
||||
/// <param name="corrections">Sorted (value, correction) pairs</param>
|
||||
/// <returns>Corrected value</returns>
|
||||
public static double CorrectedValue(double rawValue, IList<Config.Entities.MeasurementCorrection> corrections)
|
||||
{
|
||||
if (corrections == null || corrections.Count == 0) return rawValue;
|
||||
|
||||
if (rawValue < corrections[0].Measurement)
|
||||
{
|
||||
return rawValue + corrections[0].Correction;
|
||||
}
|
||||
/// <summary>
|
||||
/// Calculates corrected value from a list of corrections by interpolation.
|
||||
/// It is assumed that values in the list 'corrections' are sorted.
|
||||
/// </summary>
|
||||
/// <param name="rawMeasurement">Raw uncorrected value</param>
|
||||
/// <param name="corrections">Sorted (value, correction) pairs</param>
|
||||
/// <returns>Corrected value</returns>
|
||||
public static double CorrectedValue(double rawValue, IList<Config.Entities.MeasurementCorrection> corrections)
|
||||
{
|
||||
return rawValue + GetCorrection(rawValue, corrections);
|
||||
}
|
||||
|
||||
int count = corrections.Count;
|
||||
for (int i = 1; i < count; i++)
|
||||
{
|
||||
if (rawValue < corrections[i].Measurement)
|
||||
{
|
||||
double d1 = rawValue - corrections[i-1].Measurement;
|
||||
double d2 = corrections[i].Measurement - rawValue;
|
||||
/// <summary>
|
||||
/// Get a correction from a list of corrections by interpolation.
|
||||
/// It is assumed that values in the list 'corrections' are sorted.
|
||||
/// </summary>
|
||||
/// <param name="rawMeasurement">Raw uncorrected value</param>
|
||||
/// <param name="corrections">Sorted (value, correction) pairs</param>
|
||||
/// <returns>Corrected value</returns>
|
||||
public static double GetCorrection(double rawValue, IList<Config.Entities.MeasurementCorrection> corrections)
|
||||
{
|
||||
if ((corrections == null) || (corrections.Count == 0)) return 0; /// No correction
|
||||
|
||||
double corr;
|
||||
if (d1 + d2 <= float.Epsilon)
|
||||
{
|
||||
corr = (corrections[i - 1].Correction + corrections[i].Correction) / 2.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
corr = (corrections[i - 1].Correction * d2 + corrections[i].Correction * d1) / (d1 + d2);
|
||||
}
|
||||
return rawValue + corr;
|
||||
}
|
||||
}
|
||||
if (rawValue < corrections[0].Measurement)
|
||||
{
|
||||
/// rawValue is below the lowest value in the correction table
|
||||
return corrections[0].Correction;
|
||||
}
|
||||
|
||||
return rawValue + corrections[count - 1].Correction;
|
||||
}
|
||||
int count = corrections.Count;
|
||||
for (int i = 1; i < count; i++)
|
||||
{
|
||||
if (rawValue < corrections[i].Measurement)
|
||||
{
|
||||
double d1 = rawValue - corrections[i - 1].Measurement;
|
||||
double d2 = corrections[i].Measurement - rawValue;
|
||||
|
||||
if (d1 + d2 <= float.Epsilon)
|
||||
{
|
||||
/// Neigboring values in the corection table are close to each other -> calculate the average
|
||||
return (corrections[i - 1].Correction + corrections[i].Correction) / 2.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Interpolate the correction from neigboring values in the corection table
|
||||
return (corrections[i - 1].Correction * d2 + corrections[i].Correction * d1) / (d1 + d2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// rawValue is above the highest value in the correction table
|
||||
return corrections[count - 1].Correction;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Config.Mappings
|
||||
Map(x => x.Repeats);
|
||||
Map(x => x.DoDraining)
|
||||
.Column("Emptying");
|
||||
Map(x => x.DoZeroing)
|
||||
Map(x => x.DoDrainingAfter)
|
||||
.Column("Zeroing");
|
||||
Map(x => x.DoControlWaterTemp);
|
||||
Map(x => x.TempLimLo);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2016-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
|
||||
@@ -12,6 +12,9 @@ namespace Config.Mappings
|
||||
Id(x => x.Id);
|
||||
Map(x => x.UserName).Column("Name");
|
||||
Map(x => x.Number);
|
||||
#if TURA_IPERL || TURA_IPERL_NEW || TURA_SPECIAL
|
||||
Map(x => x.Tag);
|
||||
#endif
|
||||
Map(x => x.Password);
|
||||
Map(x => x.FullName).Column("Description");
|
||||
Map(x => x.LastPwChange);
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.18.928.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.928.0")]
|
||||
[assembly: AssemblyVersion("2.18.1273.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1273.0")]
|
||||
|
||||
@@ -117,119 +117,37 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="benchTSMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>57, 20</value>
|
||||
<data name="Administrator" xml:space="preserve">
|
||||
<value>Administrateur</value>
|
||||
</data>
|
||||
<data name="Calibration_Specialist" xml:space="preserve">
|
||||
<value>Spécialiste en calibration</value>
|
||||
</data>
|
||||
<data name="Head_of_Lab" xml:space="preserve">
|
||||
<value>Chef de laboratoire</value>
|
||||
</data>
|
||||
<data name="Maintenance_Specialist" xml:space="preserve">
|
||||
<value>Spécialiste en maintenance</value>
|
||||
</data>
|
||||
<data name="Metrologist" xml:space="preserve">
|
||||
<value>Métrologue</value>
|
||||
</data>
|
||||
<data name="Tester" xml:space="preserve">
|
||||
<value>Testeur</value>
|
||||
</data>
|
||||
<data name="Testing_Specialist" xml:space="preserve">
|
||||
<value>Spécialiste d'essais</value>
|
||||
</data>
|
||||
<data name="Failed" xml:space="preserve">
|
||||
<value>Échoué</value>
|
||||
</data>
|
||||
<data name="Passed" xml:space="preserve">
|
||||
<value>Passé</value>
|
||||
</data>
|
||||
<data name="Cannot_open_DB_Cause_0" xml:space="preserve">
|
||||
<value>Impossible d'ouvrir la base de données Cause\\r\\n{0}</value>
|
||||
</data>
|
||||
<data name="Error" xml:space="preserve">
|
||||
<value>Erreur</value>
|
||||
</data>
|
||||
<data name="$this.Text" xml:space="preserve">
|
||||
<value>Testovací stolice Framework</value>
|
||||
</data>
|
||||
<data name="aboutTSMenuItem.Text" xml:space="preserve">
|
||||
<value>O</value>
|
||||
</data>
|
||||
<data name="activityGroupBox.Text" xml:space="preserve">
|
||||
<value>Proces</value>
|
||||
</data>
|
||||
<data name="activityStatusLabel.Text" xml:space="preserve">
|
||||
<value>Prosím, spusťte proceduru</value>
|
||||
</data>
|
||||
<data name="benchComponentsTSMenuItem.Text" xml:space="preserve">
|
||||
<value>Komponenty</value>
|
||||
</data>
|
||||
<data name="benchMetrologyTSMenuItem.Text" xml:space="preserve">
|
||||
<value>Metrologie</value>
|
||||
</data>
|
||||
<data name="benchPathsTSMenuItem.Text" xml:space="preserve">
|
||||
<value>Cesty</value>
|
||||
</data>
|
||||
<data name="benchTransitionsToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>Přechody</value>
|
||||
</data>
|
||||
<data name="benchTSMenuItem.Text" xml:space="preserve">
|
||||
<value>Stolice</value>
|
||||
</data>
|
||||
<data name="databaseSettingsTSMenuItem.Text" xml:space="preserve">
|
||||
<value>Databáze</value>
|
||||
</data>
|
||||
<data name="editTSMenuItem.Text" xml:space="preserve">
|
||||
<value>Nastavení</value>
|
||||
</data>
|
||||
<data name="exitToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>Výstup</value>
|
||||
</data>
|
||||
<data name="helpTSMenuItem.Text" xml:space="preserve">
|
||||
<value>Pomoc</value>
|
||||
</data>
|
||||
<data name="homeTabPage.Text" xml:space="preserve">
|
||||
<value>Hydraulika</value>
|
||||
</data>
|
||||
<data name="homeTSMenuItem.Text" xml:space="preserve">
|
||||
<value>Domů</value>
|
||||
</data>
|
||||
<data name="insertTabPage.Text" xml:space="preserve">
|
||||
<value>Vložit</value>
|
||||
</data>
|
||||
<data name="localSettingsTSMenuItem.Text" xml:space="preserve">
|
||||
<value>Jazyk</value>
|
||||
</data>
|
||||
<data name="logsTabPage.Text" xml:space="preserve">
|
||||
<value>Záznamy</value>
|
||||
</data>
|
||||
<data name="logsTSMenuItem.Text" xml:space="preserve">
|
||||
<value>Záznamy</value>
|
||||
</data>
|
||||
<data name="mainMenuStrip.Text" xml:space="preserve">
|
||||
<value>Záhlaví hlavního menu</value>
|
||||
</data>
|
||||
<data name="measurementTabPage.Text" xml:space="preserve">
|
||||
<value>Měření</value>
|
||||
</data>
|
||||
<data name="measurementTSMenuItem.Text" xml:space="preserve">
|
||||
<value>Měření</value>
|
||||
</data>
|
||||
<data name="passwortToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>Heslo</value>
|
||||
</data>
|
||||
<data name="picturesTabPage.Text" xml:space="preserve">
|
||||
<value>Obrázky</value>
|
||||
</data>
|
||||
<data name="picturesTSMItem.Text" xml:space="preserve">
|
||||
<value>Obrázky</value>
|
||||
</data>
|
||||
<data name="printToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>Vytisknout</value>
|
||||
</data>
|
||||
<data name="procedureGroupBox.Text" xml:space="preserve">
|
||||
<value>Postup</value>
|
||||
</data>
|
||||
<data name="proceduresToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>Postupy</value>
|
||||
</data>
|
||||
<data name="processTabPage.Text" xml:space="preserve">
|
||||
<value>Proces</value>
|
||||
</data>
|
||||
<data name="processToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>Proces</value>
|
||||
</data>
|
||||
<data name="progressGroupBox.Text" xml:space="preserve">
|
||||
<value>Probíhá</value>
|
||||
</data>
|
||||
<data name="resultsTabPage.Text" xml:space="preserve">
|
||||
<value>Výsledky</value>
|
||||
</data>
|
||||
<data name="resultsToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>Výsledky</value>
|
||||
</data>
|
||||
<data name="resultsTSMenuItem.Text" xml:space="preserve">
|
||||
<value>Výsledky</value>
|
||||
</data>
|
||||
<data name="statusStrip1.Text" xml:space="preserve">
|
||||
<value>Stavový pruh 1</value>
|
||||
</data>
|
||||
<data name="userInfoStatusLabel.Text" xml:space="preserve">
|
||||
<value>Uživatel : admin</value>
|
||||
</data>
|
||||
<data name="usersTSMenuItem.Text" xml:space="preserve">
|
||||
<value>Uživatelé</value>
|
||||
</data>
|
||||
</root>
|
||||
+75
-2
@@ -1,4 +1,7 @@
|
||||
using System;
|
||||
///
|
||||
/// Copyright (c) 2017-2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -9,7 +12,21 @@ namespace Config
|
||||
{
|
||||
public static string SignificantDigitsToFmt(double value, int sigDigits)
|
||||
{
|
||||
if (sigDigits == 5)
|
||||
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";
|
||||
@@ -65,5 +82,61 @@ namespace Config
|
||||
else return "F5";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Extract and return a DB server from a MySQL connection string.
|
||||
/// </summary>
|
||||
public static string GetDBServer(string connectionString)
|
||||
{
|
||||
return GetFromConnectionString(connectionString, new string[] { "SERVER=" });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extract and return a DB name from a MySQL connection string.
|
||||
/// </summary>
|
||||
public static string GetDBName(string connectionString)
|
||||
{
|
||||
return GetFromConnectionString(connectionString, new string[] { "DATABASE=" });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extract and return a username from a MySQL connection string
|
||||
/// </summary>
|
||||
public static string GetDBUser(string connectionString)
|
||||
{
|
||||
return GetFromConnectionString(connectionString, new string[] { "USER=", "UID=" });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extract and return a password from a MySQL connection string
|
||||
/// </summary>
|
||||
public static string GetDBPassword(string connectionString)
|
||||
{
|
||||
return GetFromConnectionString(connectionString, new string[] { "PASSWORD=", "PWD=" });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extract and return an element of a MySQL connection string
|
||||
/// (a host, a database, a user name or a password).
|
||||
/// Return an empty string on any error.
|
||||
/// </summary>
|
||||
public static string GetFromConnectionString(string connectionString, string[] patterns)
|
||||
{
|
||||
foreach (var pattern in patterns)
|
||||
{
|
||||
int startIx = connectionString.IndexOf(pattern);
|
||||
if (startIx >= 0)
|
||||
{
|
||||
/// pattern found, extract the subsequent element
|
||||
startIx += pattern.Length;
|
||||
int endIx = connectionString.IndexOf(';', startIx);
|
||||
return (endIx > 0) ? connectionString.Substring(startIx, endIx - startIx) : string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// pattern NOT found
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
<?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>{D476ABBE-A455-4476-8A8D-3F6151217B51}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Decrypt</RootNamespace>
|
||||
<AssemblyName>Decrypt</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>
|
||||
<PropertyGroup>
|
||||
<StartupObject>Decrypt.Program</StartupObject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
</ItemGroup>
|
||||
<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>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<StartArguments>config.xml</StartArguments>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<StartArguments>config.xml</StartArguments>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace Decrypt
|
||||
{
|
||||
/// <summary>
|
||||
/// See also:
|
||||
/// https://www.fluxbytes.com/csharp/encrypt-and-decrypt-files-in-c/
|
||||
/// </summary>
|
||||
class Program
|
||||
{
|
||||
static byte[] key = new byte[] { 83, 254, 105, 64, 184, 201, 195, 127, 52, 99, 77, 45, 252, 132, 163, 156 };
|
||||
static byte[] IV = new byte[] { 189, 23, 137, 56, 204, 241, 242, 118, 28, 89, 9, 198, 224, 111, 186, 125 };
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
if ((args.Length < 1) || !File.Exists(args[0]))
|
||||
{
|
||||
Console.WriteLine("Usage: Decode <file>");
|
||||
Console.ReadKey();
|
||||
return;
|
||||
}
|
||||
|
||||
string fileName = args[0];
|
||||
string intermediateFile = fileName + ".plain"; /// Intermediate file, output of cryptography decoding
|
||||
string backupFile = fileName + ".bak";
|
||||
|
||||
try
|
||||
{
|
||||
using (StreamReader reader = new StreamReader(fileName))
|
||||
{
|
||||
if (reader.ReadLine().StartsWith("<?xml version="))
|
||||
{
|
||||
Console.WriteLine(string.Format("File {0} is not encrypted.", fileName));
|
||||
Console.ReadKey();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bool successful = false;
|
||||
using (RijndaelManaged aes = new RijndaelManaged { Padding = PaddingMode.Zeros })
|
||||
{
|
||||
using (FileStream fsCrypt = new FileStream(fileName, FileMode.Open))
|
||||
{
|
||||
using (FileStream fsOut = new FileStream(intermediateFile, FileMode.Create))
|
||||
{
|
||||
using (ICryptoTransform decryptor = aes.CreateDecryptor(key, IV))
|
||||
{
|
||||
using (CryptoStream cs = new CryptoStream(fsCrypt, decryptor, CryptoStreamMode.Read))
|
||||
{
|
||||
int data;
|
||||
while ((data = cs.ReadByte()) != -1)
|
||||
{
|
||||
if (data != 0) fsOut.WriteByte((byte)data);
|
||||
}
|
||||
successful = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (successful)
|
||||
{
|
||||
/// File decryption successfuly completed => rotate files
|
||||
if (File.Exists(backupFile)) File.Delete(backupFile);
|
||||
File.Move(fileName, backupFile);
|
||||
File.Move(intermediateFile, fileName);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Failed(fileName, intermediateFile, "");
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Failed(fileName, intermediateFile, e.Message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static void Failed(string fileName, string toBeDeleted, string message)
|
||||
{
|
||||
if (File.Exists(toBeDeleted))
|
||||
{
|
||||
File.Delete(toBeDeleted);
|
||||
}
|
||||
Console.WriteLine(string.Format("Decryption of file {0} failed: {1}", fileName, message));
|
||||
Console.ReadKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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("Decrypt")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Decrypt")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("c17ec788-0e12-4f9c-aadf-ea4e83a9f373")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.1.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.1.0")]
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
||||
+85
-23
@@ -7,7 +7,6 @@ using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using TBF.BenchControl;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
|
||||
@@ -27,11 +26,11 @@ namespace DeviceTest
|
||||
IComponentCfg component2Cfg;
|
||||
IComponentCfg component3Cfg;
|
||||
|
||||
static IList<TBF.BenchControl.Generic.IDevice> tbfDevices;
|
||||
static IList<TBF.BenchControl.Generic.IComponent> tbfComponents;
|
||||
static TBF.BenchControl.Generic.IComponent tbfComponent1forOp;
|
||||
static TBF.BenchControl.Generic.IComponent tbfComponent2forOp;
|
||||
static TBF.BenchControl.Generic.IComponent tbfComponent3forOp;
|
||||
static IList<IDevice> tbfDevices;
|
||||
static IList<IComponent> tbfComponents;
|
||||
static IComponent tbfComponent1forOp;
|
||||
static IComponent tbfComponent2forOp;
|
||||
static IComponent tbfComponent3forOp;
|
||||
|
||||
static Thread workerThread;
|
||||
static bool workerThreadRunning;
|
||||
@@ -56,7 +55,10 @@ namespace DeviceTest
|
||||
|
||||
|
||||
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()
|
||||
@@ -273,7 +275,14 @@ namespace DeviceTest
|
||||
radioButton3.Text = "SelectTank 3";
|
||||
radioButton4.Text = "SelectTank -";
|
||||
}
|
||||
else radioButton1.Text = "spare";
|
||||
else if (className == "Modbus.QuidoRS")
|
||||
{
|
||||
radioButton1.Text = "Close relay 1";
|
||||
radioButton2.Text = "Close relay 2";
|
||||
radioButton3.Text = "Close relay 3";
|
||||
radioButton4.Text = "Open all relays";
|
||||
}
|
||||
else radioButton1.Text = "spare";
|
||||
}
|
||||
///
|
||||
void UpdateOperations2(string className)
|
||||
@@ -293,7 +302,14 @@ namespace DeviceTest
|
||||
radioButton23.Text = "SelectTank 3";
|
||||
radioButton24.Text = "SelectTank -";
|
||||
}
|
||||
else radioButton21.Text = "spare";
|
||||
else if (className == "Modbus.QuidoRS")
|
||||
{
|
||||
radioButton21.Text = "Close relay 1";
|
||||
radioButton22.Text = "Close relay 2";
|
||||
radioButton23.Text = "Close relay 3";
|
||||
radioButton24.Text = "Open all relays";
|
||||
}
|
||||
else radioButton21.Text = "spare";
|
||||
}
|
||||
///
|
||||
void UpdateOperations3(string className)
|
||||
@@ -313,7 +329,14 @@ namespace DeviceTest
|
||||
radioButton33.Text = "SelectTank 3";
|
||||
radioButton34.Text = "SelectTank -";
|
||||
}
|
||||
else radioButton31.Text = "spare";
|
||||
else if (className == "Modbus.QuidoRS")
|
||||
{
|
||||
radioButton31.Text = "Close relay 1";
|
||||
radioButton32.Text = "Close relay 2";
|
||||
radioButton33.Text = "Close relay 3";
|
||||
radioButton34.Text = "Open all relays";
|
||||
}
|
||||
else radioButton31.Text = "spare";
|
||||
}
|
||||
|
||||
|
||||
@@ -402,7 +425,7 @@ namespace DeviceTest
|
||||
cfgControl.Config = parentCfg;
|
||||
cfgControl.Config.ItemNr = 0;
|
||||
|
||||
TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg();
|
||||
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
|
||||
cfgForm.TbfComponents = new List<Config.Entities.Component>();
|
||||
|
||||
cfgForm.ComponentCfgCtrl = cfgControl;
|
||||
@@ -431,7 +454,7 @@ namespace DeviceTest
|
||||
cfgControl.Config = component1Cfg;
|
||||
cfgControl.Config.ItemNr = 1;
|
||||
|
||||
TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg();
|
||||
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
|
||||
///
|
||||
IList<Config.Entities.Component> compEntities = new List<Config.Entities.Component>();
|
||||
if (parentFactory != null && parentCfg != null) compEntities.Add(parentCfg.CreateDbEntity());
|
||||
@@ -465,7 +488,7 @@ namespace DeviceTest
|
||||
cfgControl.Config = component2Cfg;
|
||||
cfgControl.Config.ItemNr = 1;
|
||||
|
||||
TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg();
|
||||
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
|
||||
///
|
||||
IList<Config.Entities.Component> compEntities = new List<Config.Entities.Component>();
|
||||
if (parentFactory != null && parentCfg != null) compEntities.Add(parentCfg.CreateDbEntity());
|
||||
@@ -500,7 +523,7 @@ namespace DeviceTest
|
||||
cfgControl.Config = component3Cfg;
|
||||
cfgControl.Config.ItemNr = 1;
|
||||
|
||||
TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg();
|
||||
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
|
||||
///
|
||||
IList<Config.Entities.Component> compEntities = new List<Config.Entities.Component>();
|
||||
if (parentFactory != null && parentCfg != null) compEntities.Add(parentCfg.CreateDbEntity());
|
||||
@@ -657,13 +680,25 @@ namespace DeviceTest
|
||||
operation1 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
|
||||
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);
|
||||
//operation2 = (tbfComponent1forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(2);
|
||||
//operation3 = (tbfComponent1forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(3);
|
||||
//operation4 = (tbfComponent1forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(0);
|
||||
}
|
||||
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
|
||||
{
|
||||
operation1 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(1);
|
||||
operation2 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(2);
|
||||
operation3 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(4);
|
||||
operation4 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(0);
|
||||
}
|
||||
|
||||
|
||||
if (tbfComponent2forOp is TBF.BenchControl.Modbus.PressureMeter.Meret.PressureMeter)
|
||||
@@ -681,16 +716,28 @@ namespace DeviceTest
|
||||
}
|
||||
else if (tbfComponent2forOp is TBF.BenchControl.Modbus.Easytherm.Easytherm)
|
||||
{
|
||||
operation21 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
|
||||
operation22 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
|
||||
operation21 = (tbfComponent2forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
|
||||
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);
|
||||
//operation22 = (tbfComponent2forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(2);
|
||||
//operation23 = (tbfComponent2forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(3);
|
||||
//operation24 = (tbfComponent2forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(0);
|
||||
}
|
||||
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
|
||||
{
|
||||
operation21 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(1);
|
||||
operation22 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(2);
|
||||
operation23 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(4);
|
||||
operation24 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(0);
|
||||
}
|
||||
|
||||
|
||||
if (tbfComponent3forOp is TBF.BenchControl.Modbus.PressureMeter.Meret.PressureMeter)
|
||||
@@ -708,23 +755,38 @@ namespace DeviceTest
|
||||
}
|
||||
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.Easytherm.Easytherm)
|
||||
{
|
||||
operation31 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
|
||||
operation32 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
|
||||
operation31 = (tbfComponent3forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
|
||||
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);
|
||||
//operation32 = (tbfComponent3forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(2);
|
||||
//operation33 = (tbfComponent3forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(3);
|
||||
//operation34 = (tbfComponent3forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(0);
|
||||
}
|
||||
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
|
||||
{
|
||||
operation31 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(1);
|
||||
operation32 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(2);
|
||||
operation33 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(4);
|
||||
operation34 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(0);
|
||||
}
|
||||
|
||||
|
||||
while (workerThreadRunning)
|
||||
int time = 0;
|
||||
while (workerThreadRunning)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
|
||||
if (workerThreadRunning)
|
||||
StateMachine.Time = ++time;
|
||||
|
||||
if (workerThreadRunning)
|
||||
{
|
||||
foreach (var d in tbfDevices) d.RunDeviceBefore();
|
||||
|
||||
|
||||
@@ -72,10 +72,10 @@ namespace DeviceTest
|
||||
}
|
||||
|
||||
/// 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.Fatal("--------------------------------------------------------------------------------");
|
||||
log.Fatal(string.Format("TBF ver.{0}", Version));
|
||||
log.FatalFormat("DeviceTest ver.{0}", Version);
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
<?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>{DA9B09F3-A99D-4883-A954-537560453674}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Encrypt</RootNamespace>
|
||||
<AssemblyName>Encrypt</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>
|
||||
<PropertyGroup>
|
||||
<StartupObject>Encrypt.Program</StartupObject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
</ItemGroup>
|
||||
<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>
|
||||
@@ -0,0 +1,93 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace Encrypt
|
||||
{
|
||||
/// <summary>
|
||||
/// See also:
|
||||
/// https://www.fluxbytes.com/csharp/encrypt-and-decrypt-files-in-c/
|
||||
/// </summary>
|
||||
class Program
|
||||
{
|
||||
static byte[] key = new byte[] { 83, 254, 105, 64, 184, 201, 195, 127, 52, 99, 77, 45, 252, 132, 163, 156 };
|
||||
static byte[] IV = new byte[] { 189, 23, 137, 56, 204, 241, 242, 118, 28, 89, 9, 198, 224, 111, 186, 125 };
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
if ((args.Length < 1) || !File.Exists(args[0]))
|
||||
{
|
||||
Console.WriteLine("Usage: Encode <file>");
|
||||
Console.ReadKey();
|
||||
return;
|
||||
}
|
||||
|
||||
string fileName = args[0];
|
||||
string intermediateFile = fileName + ".encrypted"; /// Intermediate file, output of cryptography encoding
|
||||
string backupFile = fileName + ".bak";
|
||||
|
||||
try
|
||||
{
|
||||
using (StreamReader reader = new StreamReader(fileName))
|
||||
{
|
||||
if (!reader.ReadLine().StartsWith("<?xml version="))
|
||||
{
|
||||
Console.WriteLine(string.Format("File {0} is already encrypted.", fileName));
|
||||
Console.ReadKey();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bool successful = false;
|
||||
using (RijndaelManaged aes = new RijndaelManaged { Padding = PaddingMode.Zeros })
|
||||
{
|
||||
using (FileStream fsCrypt = new FileStream(intermediateFile, FileMode.Create))
|
||||
{
|
||||
using (ICryptoTransform encryptor = aes.CreateEncryptor(key, IV))
|
||||
{
|
||||
using (CryptoStream cs = new CryptoStream(fsCrypt, encryptor, CryptoStreamMode.Write))
|
||||
{
|
||||
using (FileStream fsIn = new FileStream(fileName, FileMode.Open))
|
||||
{
|
||||
int data;
|
||||
while ((data = fsIn.ReadByte()) != -1) cs.WriteByte((byte)data);
|
||||
successful = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (successful)
|
||||
{
|
||||
/// File encryption successfuly completed => rotate files
|
||||
if (File.Exists(backupFile)) File.Delete(backupFile);
|
||||
File.Move(fileName, backupFile);
|
||||
File.Move(intermediateFile, fileName);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Failed(fileName, intermediateFile);
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Failed(fileName, intermediateFile);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static void Failed(string fileName, string toBeDeleted)
|
||||
{
|
||||
if (File.Exists(toBeDeleted))
|
||||
{
|
||||
File.Delete(toBeDeleted);
|
||||
}
|
||||
Console.WriteLine(string.Format("Encryption of file {0} failed.", fileName));
|
||||
Console.ReadKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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("Encrypt")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Encrypt")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("0f602531-6f1f-416e-af4d-9242855715a8")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
||||
@@ -121,21 +121,6 @@
|
||||
<Reference Include="System.Xml">
|
||||
<Name>System.XML</Name>
|
||||
</Reference>
|
||||
<COMReference Include="GemCardExLib">
|
||||
<Guid>{F1FF634B-BEDF-461C-A409-5B88E05F5117}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
<COMReference Include="SCARDSSPLib">
|
||||
<Guid>{82C38704-19F1-11D3-A11F-00C04F79F800}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
</COMReference>
|
||||
<COMReference Include="stdole">
|
||||
<Guid>{00020430-0000-0000-C000-000000000046}</Guid>
|
||||
<VersionMajor>2</VersionMajor>
|
||||
|
||||
@@ -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,212 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using FluentNHibernate.Cfg;
|
||||
using FluentNHibernate.Cfg.Db;
|
||||
using NHibernate;
|
||||
using NHibernate.Cfg;
|
||||
using NHibernate.Tool.hbm2ddl;
|
||||
|
||||
namespace MonitoringDB
|
||||
{
|
||||
public static class FluentNH
|
||||
{
|
||||
/// <summary>
|
||||
/// Current session factory for the last used connection string or null
|
||||
/// </summary>
|
||||
public static ISessionFactory SessionFactory;
|
||||
|
||||
|
||||
/// <summary> Connection string for all sessions </summary>
|
||||
static string connectionString;
|
||||
///
|
||||
public static string ConnectionString
|
||||
{
|
||||
get { return connectionString; }
|
||||
set
|
||||
{
|
||||
if (value != connectionString)
|
||||
{
|
||||
connectionString = value;
|
||||
SessionFactory = null; /// Clear SessionFactory on connection string change
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// NHibernate session factory (to create the database session 'SessionFactory')
|
||||
/// </summary>
|
||||
/// <returns>A database session</returns>
|
||||
static ISessionFactory CreateSessionFactory()
|
||||
{
|
||||
return CreateSessionFactory(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// NHibernate session factory (to create the database session 'SessionFactory')
|
||||
/// </summary>
|
||||
/// <returns>A database session</returns>
|
||||
public static ISessionFactory CreateSessionFactory(bool createDB)
|
||||
{
|
||||
FluentConfiguration cfg = Fluently
|
||||
.Configure()
|
||||
.Database(MySQLConfiguration.Standard.ConnectionString(connectionString))
|
||||
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Entities.Process>());
|
||||
|
||||
if (createDB)
|
||||
{
|
||||
return cfg.ExposeConfiguration(BuildSchemaCreate).BuildSessionFactory();
|
||||
}
|
||||
else
|
||||
{
|
||||
return cfg.ExposeConfiguration(BuildSchema).BuildSessionFactory();
|
||||
}
|
||||
}
|
||||
|
||||
public delegate void BuildSchemaDlgt(Configuration config);
|
||||
|
||||
public static void BuildSchema(Configuration config)
|
||||
{
|
||||
/// This NHibernate tool takes a configuration (with mapping info in)
|
||||
/// and exports a database schema from it
|
||||
new SchemaExport(config).SetOutputFile("db_schema");
|
||||
}
|
||||
|
||||
static void BuildSchemaCreate(Configuration config)
|
||||
{
|
||||
/// This NHibernate tool takes a configuration (with mapping info in)
|
||||
/// and exports a database schema from it
|
||||
new SchemaExport(config).Create(true, true);
|
||||
}
|
||||
|
||||
/// Create a NHibernate session for the given database
|
||||
public static ISession CreateSession(string connectionString)
|
||||
{
|
||||
ConnectionString = connectionString; /// Clears session factory on connction string change
|
||||
|
||||
if (SessionFactory == null)
|
||||
SessionFactory = CreateSessionFactory();
|
||||
|
||||
return SessionFactory.OpenSession();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create an empty database.
|
||||
/// Database contains only the user 'admin' and the control board component 'CB'.
|
||||
/// </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 CreateEmptyDB(string connectionString)
|
||||
{
|
||||
ConnectionString = connectionString;
|
||||
|
||||
ISessionFactory sessionFactory = CreateSessionFactory(true);
|
||||
if (sessionFactory == null) return false;
|
||||
|
||||
/// Populate the database
|
||||
using (var session = sessionFactory.OpenSession())
|
||||
{
|
||||
//using (var transaction = session.BeginTransaction())
|
||||
//{
|
||||
// var part1 = new MonitoringDB.Entities.Part("flow tube", CodeType.UniqueNr, CodeForm.QRCode, 0);
|
||||
// session.SaveOrUpdate(part1);
|
||||
// transaction.Commit();
|
||||
//}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public static IList<WMPart> FindWMParts(string pcbNumber, string connString)
|
||||
{
|
||||
IList<WMPart> foundParts = new List<WMPart>(); /// initially empty
|
||||
|
||||
if (string.IsNullOrEmpty(pcbNumber)) return foundParts; /// return an empty list
|
||||
|
||||
try
|
||||
{
|
||||
ISession session = CreateSession(connString);
|
||||
|
||||
IList<Entities.ReferenceRecord> referenceRecords = session
|
||||
.QueryOver<Entities.ReferenceRecord>()
|
||||
.Where(x => (x.Code == pcbNumber))
|
||||
.OrderBy(x => x.TimeStamp).Desc
|
||||
.List<Entities.ReferenceRecord>();
|
||||
|
||||
if (referenceRecords.Count == 0) return foundParts;
|
||||
|
||||
foundParts.Add(new WMPart(referenceRecords[0]));
|
||||
Entities.Process process = referenceRecords[0].Process;
|
||||
///
|
||||
foreach (var refR in referenceRecords)
|
||||
{
|
||||
if (process != refR.Process)
|
||||
{
|
||||
continue; /// skip records obtained by another process
|
||||
}
|
||||
|
||||
IList<Entities.Record> relatedRecords = session
|
||||
.QueryOver<Entities.Record>()
|
||||
.Where(x => (x.ReferenceRecord == refR))
|
||||
.List<Entities.Record>();
|
||||
|
||||
|
||||
foreach (var relR in relatedRecords)
|
||||
{
|
||||
foundParts.Add(new WMPart(relR));
|
||||
foreach (var ws in process.Worksteps)
|
||||
{
|
||||
if (ws.ReferencePart == relR.Part)
|
||||
{
|
||||
FindWMPartsRecursively(process, ws.ReferencePart, relR.Code, session, ref foundParts);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
return foundParts;
|
||||
}
|
||||
|
||||
|
||||
static void FindWMPartsRecursively(Entities.Process process, Entities.Part refPart, string code, ISession session, ref IList<WMPart> foundParts)
|
||||
{
|
||||
IList<Entities.ReferenceRecord> referenceRecords = session
|
||||
.QueryOver<Entities.ReferenceRecord>()
|
||||
.Where(x => (x.Workstep.ReferencePart == refPart))
|
||||
.Where(x => (x.Code == code))
|
||||
.OrderBy(x => x.TimeStamp).Desc
|
||||
.List<Entities.ReferenceRecord>();
|
||||
|
||||
if (referenceRecords.Count == 0) return;
|
||||
|
||||
foreach (var refR in referenceRecords)
|
||||
{
|
||||
IList<Entities.Record> relatedRecords = session
|
||||
.QueryOver<Entities.Record>()
|
||||
.Where(x => (x.ReferenceRecord == refR))
|
||||
.List<Entities.Record>();
|
||||
|
||||
|
||||
foreach (var relR in relatedRecords)
|
||||
{
|
||||
foundParts.Add(new WMPart(relR));
|
||||
|
||||
foreach (var ws in process.Worksteps)
|
||||
{
|
||||
if (ws.ReferencePart == relR.Part)
|
||||
{
|
||||
FindWMPartsRecursively(process, ws.ReferencePart, relR.Code, session, ref foundParts);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-263
@@ -1,263 +0,0 @@
|
||||
namespace MonitoringDB.Forms
|
||||
{
|
||||
partial class SettingsDlg
|
||||
{
|
||||
/// <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.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.connectionStringTextBox = new System.Windows.Forms.TextBox();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.radioButton2 = new System.Windows.Forms.RadioButton();
|
||||
this.radioButton1 = new System.Windows.Forms.RadioButton();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
this.workplaceNameTextBox = new System.Windows.Forms.TextBox();
|
||||
this.saveButton = new System.Windows.Forms.Button();
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.groupBox4 = new System.Windows.Forms.GroupBox();
|
||||
this.extraBatteryLifetimeTextBox = new System.Windows.Forms.TextBox();
|
||||
this.oracleGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.checkPcbIsInOracleCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.oracleBatteryCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.groupBox5 = new System.Windows.Forms.GroupBox();
|
||||
this.usersDBConnStringTextBox = new System.Windows.Forms.TextBox();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.groupBox3.SuspendLayout();
|
||||
this.groupBox4.SuspendLayout();
|
||||
this.oracleGroupBox.SuspendLayout();
|
||||
this.groupBox5.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.connectionStringTextBox);
|
||||
this.groupBox1.Location = new System.Drawing.Point(12, 69);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(622, 50);
|
||||
this.groupBox1.TabIndex = 1;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Connection string pre záznamy z výroby";
|
||||
//
|
||||
// connectionStringTextBox
|
||||
//
|
||||
this.connectionStringTextBox.Location = new System.Drawing.Point(17, 18);
|
||||
this.connectionStringTextBox.Name = "connectionStringTextBox";
|
||||
this.connectionStringTextBox.Size = new System.Drawing.Size(586, 20);
|
||||
this.connectionStringTextBox.TabIndex = 0;
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.radioButton2);
|
||||
this.groupBox2.Controls.Add(this.radioButton1);
|
||||
this.groupBox2.Location = new System.Drawing.Point(12, 250);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(268, 70);
|
||||
this.groupBox2.TabIndex = 4;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Režim činnosti";
|
||||
//
|
||||
// radioButton2
|
||||
//
|
||||
this.radioButton2.AutoSize = true;
|
||||
this.radioButton2.Location = new System.Drawing.Point(101, 41);
|
||||
this.radioButton2.Name = "radioButton2";
|
||||
this.radioButton2.Size = new System.Drawing.Size(58, 17);
|
||||
this.radioButton2.TabIndex = 1;
|
||||
this.radioButton2.TabStop = true;
|
||||
this.radioButton2.Text = "Výroba";
|
||||
this.radioButton2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// radioButton1
|
||||
//
|
||||
this.radioButton1.AutoSize = true;
|
||||
this.radioButton1.Location = new System.Drawing.Point(101, 20);
|
||||
this.radioButton1.Name = "radioButton1";
|
||||
this.radioButton1.Size = new System.Drawing.Size(46, 17);
|
||||
this.radioButton1.TabIndex = 0;
|
||||
this.radioButton1.TabStop = true;
|
||||
this.radioButton1.Text = "Test";
|
||||
this.radioButton1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// groupBox3
|
||||
//
|
||||
this.groupBox3.Controls.Add(this.workplaceNameTextBox);
|
||||
this.groupBox3.Location = new System.Drawing.Point(12, 12);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(622, 50);
|
||||
this.groupBox3.TabIndex = 0;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "Meno pracoviska";
|
||||
//
|
||||
// workplaceNameTextBox
|
||||
//
|
||||
this.workplaceNameTextBox.Location = new System.Drawing.Point(17, 18);
|
||||
this.workplaceNameTextBox.Name = "workplaceNameTextBox";
|
||||
this.workplaceNameTextBox.Size = new System.Drawing.Size(586, 20);
|
||||
this.workplaceNameTextBox.TabIndex = 0;
|
||||
//
|
||||
// saveButton
|
||||
//
|
||||
this.saveButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.saveButton.Location = new System.Drawing.Point(348, 270);
|
||||
this.saveButton.Name = "saveButton";
|
||||
this.saveButton.Size = new System.Drawing.Size(104, 42);
|
||||
this.saveButton.TabIndex = 6;
|
||||
this.saveButton.Text = "Uložiť";
|
||||
this.saveButton.UseVisualStyleBackColor = true;
|
||||
this.saveButton.Click += new System.EventHandler(this.saveButton_Click);
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cancelButton.Location = new System.Drawing.Point(488, 270);
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.Size = new System.Drawing.Size(104, 42);
|
||||
this.cancelButton.TabIndex = 7;
|
||||
this.cancelButton.Text = "Zrušiť";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
|
||||
//
|
||||
// groupBox4
|
||||
//
|
||||
this.groupBox4.Controls.Add(this.extraBatteryLifetimeTextBox);
|
||||
this.groupBox4.Location = new System.Drawing.Point(12, 182);
|
||||
this.groupBox4.Name = "groupBox4";
|
||||
this.groupBox4.Size = new System.Drawing.Size(268, 62);
|
||||
this.groupBox4.TabIndex = 3;
|
||||
this.groupBox4.TabStop = false;
|
||||
this.groupBox4.Text = "Predĺženie životnosti baterky v mesiacoch";
|
||||
//
|
||||
// extraBatteryLifetimeTextBox
|
||||
//
|
||||
this.extraBatteryLifetimeTextBox.Location = new System.Drawing.Point(17, 25);
|
||||
this.extraBatteryLifetimeTextBox.Name = "extraBatteryLifetimeTextBox";
|
||||
this.extraBatteryLifetimeTextBox.Size = new System.Drawing.Size(230, 20);
|
||||
this.extraBatteryLifetimeTextBox.TabIndex = 0;
|
||||
//
|
||||
// oracleGroupBox
|
||||
//
|
||||
this.oracleGroupBox.Controls.Add(this.checkPcbIsInOracleCheckBox);
|
||||
this.oracleGroupBox.Controls.Add(this.oracleBatteryCheckBox);
|
||||
this.oracleGroupBox.Location = new System.Drawing.Point(297, 182);
|
||||
this.oracleGroupBox.Name = "oracleGroupBox";
|
||||
this.oracleGroupBox.Size = new System.Drawing.Size(337, 74);
|
||||
this.oracleGroupBox.TabIndex = 5;
|
||||
this.oracleGroupBox.TabStop = false;
|
||||
this.oracleGroupBox.Text = "Oracle";
|
||||
this.oracleGroupBox.Visible = false;
|
||||
//
|
||||
// checkPcbIsInOracleCheckBox
|
||||
//
|
||||
this.checkPcbIsInOracleCheckBox.AutoSize = true;
|
||||
this.checkPcbIsInOracleCheckBox.Location = new System.Drawing.Point(18, 45);
|
||||
this.checkPcbIsInOracleCheckBox.Name = "checkPcbIsInOracleCheckBox";
|
||||
this.checkPcbIsInOracleCheckBox.Size = new System.Drawing.Size(213, 17);
|
||||
this.checkPcbIsInOracleCheckBox.TabIndex = 0;
|
||||
this.checkPcbIsInOracleCheckBox.Text = "Skontrolovať či PCB už bola overovaná";
|
||||
this.checkPcbIsInOracleCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// oracleBatteryCheckBox
|
||||
//
|
||||
this.oracleBatteryCheckBox.AutoSize = true;
|
||||
this.oracleBatteryCheckBox.Location = new System.Drawing.Point(18, 19);
|
||||
this.oracleBatteryCheckBox.Name = "oracleBatteryCheckBox";
|
||||
this.oracleBatteryCheckBox.Size = new System.Drawing.Size(193, 17);
|
||||
this.oracleBatteryCheckBox.TabIndex = 0;
|
||||
this.oracleBatteryCheckBox.Text = "Uložiť informácie o batérii do Oracle";
|
||||
this.oracleBatteryCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// groupBox5
|
||||
//
|
||||
this.groupBox5.Controls.Add(this.usersDBConnStringTextBox);
|
||||
this.groupBox5.Location = new System.Drawing.Point(12, 125);
|
||||
this.groupBox5.Name = "groupBox5";
|
||||
this.groupBox5.Size = new System.Drawing.Size(622, 50);
|
||||
this.groupBox5.TabIndex = 2;
|
||||
this.groupBox5.TabStop = false;
|
||||
this.groupBox5.Text = "Connection string pre centrálnu databázu používateľov";
|
||||
//
|
||||
// usersDBConnStringTextBox
|
||||
//
|
||||
this.usersDBConnStringTextBox.Location = new System.Drawing.Point(17, 18);
|
||||
this.usersDBConnStringTextBox.Name = "usersDBConnStringTextBox";
|
||||
this.usersDBConnStringTextBox.Size = new System.Drawing.Size(586, 20);
|
||||
this.usersDBConnStringTextBox.TabIndex = 0;
|
||||
//
|
||||
// SettingsDlg
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(648, 333);
|
||||
this.Controls.Add(this.groupBox5);
|
||||
this.Controls.Add(this.oracleGroupBox);
|
||||
this.Controls.Add(this.groupBox4);
|
||||
this.Controls.Add(this.cancelButton);
|
||||
this.Controls.Add(this.saveButton);
|
||||
this.Controls.Add(this.groupBox3);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "SettingsDlg";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.Text = "SettingsDlg";
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
this.groupBox3.PerformLayout();
|
||||
this.groupBox4.ResumeLayout(false);
|
||||
this.groupBox4.PerformLayout();
|
||||
this.oracleGroupBox.ResumeLayout(false);
|
||||
this.oracleGroupBox.PerformLayout();
|
||||
this.groupBox5.ResumeLayout(false);
|
||||
this.groupBox5.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.TextBox connectionStringTextBox;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
private System.Windows.Forms.TextBox workplaceNameTextBox;
|
||||
private System.Windows.Forms.Button saveButton;
|
||||
private System.Windows.Forms.Button cancelButton;
|
||||
private System.Windows.Forms.RadioButton radioButton2;
|
||||
private System.Windows.Forms.RadioButton radioButton1;
|
||||
private System.Windows.Forms.GroupBox groupBox4;
|
||||
private System.Windows.Forms.TextBox extraBatteryLifetimeTextBox;
|
||||
private System.Windows.Forms.GroupBox oracleGroupBox;
|
||||
private System.Windows.Forms.CheckBox oracleBatteryCheckBox;
|
||||
private System.Windows.Forms.CheckBox checkPcbIsInOracleCheckBox;
|
||||
private System.Windows.Forms.GroupBox groupBox5;
|
||||
private System.Windows.Forms.TextBox usersDBConnStringTextBox;
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
+27
-13
@@ -27,8 +27,8 @@ namespace Results
|
||||
public Batch Batch;
|
||||
public WaterMeter[] WaterMeters;
|
||||
|
||||
public static BatchResults NewFromProcedure(int batchNr, int benchId, string user, int userNr, string programVer,
|
||||
Config.Entities.Procedure procedure,
|
||||
public static BatchResults NewFromProcedure(int batchNr, int benchId, string benchName, string a1, string a2, string a3, string a4, string a5,
|
||||
string user, int userNr, string programVer, Config.Entities.Procedure procedure,
|
||||
WaterMeterData[] waterMeterDatas, int[] waterMeterParts, double densityCorr)
|
||||
{
|
||||
BatchResults d = new BatchResults(waterMeterDatas.Length);
|
||||
@@ -37,8 +37,14 @@ namespace Results
|
||||
/// Create 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,
|
||||
UserName = user,
|
||||
UserNumber = userNr,
|
||||
@@ -90,7 +96,7 @@ namespace Results
|
||||
{
|
||||
if (d.WaterMeters[i] == null) continue;
|
||||
|
||||
if (t.Part != 0 && waterMeterParts[i] != 0 && t.Part != waterMeterParts[i]) continue;
|
||||
if (!t.IsPartCompatible(waterMeterParts[i])) continue;
|
||||
|
||||
///
|
||||
/// Create empty watermeter test results and add them to the list and to dictionaries
|
||||
@@ -124,13 +130,19 @@ namespace Results
|
||||
|
||||
public static BatchResults FromBatch(Batch batch)
|
||||
{
|
||||
int wmCount = batch.WaterMeters.Count;
|
||||
if (wmCount == 0) return null;
|
||||
if (batch.WaterMeters == null || batch.WaterMeters.Count == 0) return null;
|
||||
|
||||
BatchResults batchResults = new BatchResults(wmCount);
|
||||
int wmPosMax = 0;
|
||||
foreach (var wm in batch.WaterMeters) if (wm.WMPosition > wmPosMax) wmPosMax = wm.WMPosition;
|
||||
|
||||
BatchResults batchResults = new BatchResults(wmPosMax);
|
||||
batchResults.Batch = batch;
|
||||
batchResults.WaterMeters = new WaterMeter[wmCount];
|
||||
for (int i = 0; i < wmCount; i++) batchResults.WaterMeters[i] = batch.WaterMeters[i];
|
||||
batchResults.WaterMeters = new WaterMeter[wmPosMax];
|
||||
for (int i = 0; i < batch.WaterMeters.Count; i++)
|
||||
{
|
||||
WaterMeter wm = batch.WaterMeters[i];
|
||||
batchResults.WaterMeters[wm.WMPosition - 1] = wm;
|
||||
}
|
||||
|
||||
return batchResults;
|
||||
}
|
||||
@@ -158,11 +170,11 @@ namespace Results
|
||||
{
|
||||
for (int i = 0; i < WMPositionsCount; i++)
|
||||
{
|
||||
if (WaterMeters[i] != null)
|
||||
if ((WaterMeters[i] != null) && !WaterMeters[i].Disabled)
|
||||
{
|
||||
foreach (var mtr in WaterMeters[i].MeterTestRslts)
|
||||
{
|
||||
if (!mtr.TestDone) return false;
|
||||
if (!mtr.TestDone) return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -199,8 +211,10 @@ namespace Results
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,13 @@ namespace Results.Entities
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual int BatchNr { 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 int UserNumber { get; set; }
|
||||
public virtual string ProcedureName { get; set; }
|
||||
@@ -23,7 +29,17 @@ namespace Results.Entities
|
||||
public virtual float DensityCorr { get; set; } /// Density correction in [kg/m3]
|
||||
public virtual float Custom2 { get; set; }
|
||||
public virtual float Custom3 { get; set; }
|
||||
public virtual DateTime StartTime { get; set; }
|
||||
public virtual int Counter1 { get; set; }
|
||||
public virtual int Counter2 { get; set; }
|
||||
public virtual int Counter3 { get; set; }
|
||||
public virtual int Counter4 { get; set; }
|
||||
public virtual int Counter5 { get; set; }
|
||||
public virtual int Counter6 { get; set; }
|
||||
public virtual int Counter7 { get; set; }
|
||||
public virtual int Counter8 { get; set; }
|
||||
public virtual int Counter9 { get; set; }
|
||||
public virtual int Counter10 { get; set; }
|
||||
public virtual DateTime StartTime { get; set; }
|
||||
public virtual DateTime EndTime { get; set; }
|
||||
public virtual bool Dirty { get; set; }
|
||||
public virtual bool RsltsSent { get; set; }
|
||||
@@ -32,7 +48,7 @@ namespace Results.Entities
|
||||
public virtual IList<WaterMeter> WaterMeters { get; set; }
|
||||
public virtual IList<TestRslt> TestRslts { get; set; }
|
||||
public virtual bool Compound { get; set; } /// Not mapped to DB now
|
||||
public virtual bool HeatMeter { get; set; } /// Not mapped to DB now
|
||||
public virtual bool HeatMeter { get; set; } /// Not mapped to DB now ///
|
||||
|
||||
public Batch()
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Results.Entities
|
||||
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 int RegReaderType { 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 depend on localization and customer
|
||||
|
||||
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)
|
||||
@@ -25,9 +25,13 @@ namespace Results.Entities
|
||||
|
||||
/// Main result
|
||||
public virtual double Error { get; set; } /// [%]
|
||||
public virtual int ErrorIndicators { get; set; } /// Not mapped to DB !!!, bit24=E25, bit25=E26, bit26=E27, bit27=E28
|
||||
public virtual double KorrErrQ { get; set; } /// [%] not mapped to results DB, saved to Oracle DB
|
||||
public virtual bool TestDone { get; set; } /// true = test was completed
|
||||
public virtual bool Passed { get; set; } /// true = test passed, water meter is OK
|
||||
#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 TestRslt TestRslt { get; set; } /// reference to the TestRslt entity
|
||||
@@ -80,10 +84,18 @@ namespace Results.Entities
|
||||
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()
|
||||
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()
|
||||
{
|
||||
@@ -116,9 +128,13 @@ namespace Results.Entities
|
||||
TimestampEnd = src.TimestampEnd;
|
||||
TestTime = src.TestTime;
|
||||
Error = src.Error;
|
||||
ErrorIndicators = src.ErrorIndicators;
|
||||
KorrErrQ = src.KorrErrQ;
|
||||
TestDone = src.TestDone;
|
||||
Passed = src.Passed;
|
||||
#if ORACLE_DB
|
||||
LastError = src.LastError;
|
||||
#endif
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
|
||||
@@ -20,8 +20,8 @@ namespace Results.Entities
|
||||
public virtual double TargetVolume { get; set; } /// [l] target test volume
|
||||
public virtual double TargetTime { get; set; } /// [s] target test time
|
||||
public virtual string Method { get; set; }
|
||||
public virtual double ErrLimLo { get; set; } /// [%] (usually < 0)
|
||||
public virtual double ErrLimHi { get; set; } /// [%] (usually > 0)
|
||||
public virtual double ErrLimLo { get; set; } /// [%] usually < 0, in case of heat meters: 1=class1, 2=class2, 3=class3
|
||||
public virtual double ErrLimHi { get; set; } /// [%] usually > 0, in case of heat meters: -Qn in m3/h
|
||||
public virtual double Uncertainty { get; set; } /// [%] makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
|
||||
public virtual bool DoControlWaterTemp { get; set; }
|
||||
public virtual float TempLimLo { get; set; }
|
||||
|
||||
@@ -15,19 +15,24 @@ namespace Results.Entities
|
||||
public virtual TestData TestData { get; set; }
|
||||
public virtual Components Components { get; set; }
|
||||
public virtual int Part { get; set; }
|
||||
public virtual int RepetitionNr { get; set; } /// Repetition number from the set of repeated tests (1...)
|
||||
public virtual string MethodClass { get; set; } /// Not mapped to the DB, does not depent on localisation and customer
|
||||
public virtual int RepetitionNr { get; set; } /// Repetition number from the set of repeated tests (1...)
|
||||
public virtual string MethodClass { get; set; } /// Not mapped to DB, does not depend on localization and customer
|
||||
|
||||
/// Main results
|
||||
public virtual bool TestDone { get; set; }
|
||||
public virtual string Remark { get; set; }
|
||||
public virtual DateTime StartTime { get; set; } /// Date and time of the test start
|
||||
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 double TestTime { get; set; } /// [s] Measurement time in seconds
|
||||
public virtual double PulsesMaster { get; set; }
|
||||
public virtual double ConstMasterRaw { get; set; } /// [l/pls] Liters per pulse of the master flow meter uncorrected
|
||||
public virtual double ConstMaster { get; set; } /// [l/pls] Liters per pulse of the master flow meter
|
||||
public virtual DateTime StartTime { get; set; } /// Date and time of the test start
|
||||
public virtual DateTime EndTime { get; set; } /// Date and time of the test end
|
||||
public virtual int FlowSetTime { get; set; } /// [s] Flow set time in seconds
|
||||
public virtual int TimeBtwnMassMsrmnts { get; set; } /// [s] Time between two mass measurements in seconds (if applicable)
|
||||
public virtual double TestTime { get; set; } /// [s] Test time in seconds
|
||||
public virtual double TestTimeCorrection { get; set; } /// [s] Correction of the test time due to diverter (0 for methods w/o diverter or when there is no correction table)
|
||||
public virtual double PulsesMaster { get; set; } /// [pls] FlyingStartMassCollectionProlonged: MID pulses of the water to the tank
|
||||
public virtual double TotalPulsesMstr { get; set; } /// [pls] FlyingStartMassCollectionProlonged: MID pulses of the complete test (not mapped to DB)
|
||||
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 MassEndRaw { get; set; } /// [kg]
|
||||
@@ -40,7 +45,7 @@ namespace Results.Entities
|
||||
public virtual double FlowVolume { get; set; } /// [m3/h]
|
||||
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 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 DivStart10 { get; set; } /// [s] Diverter switch time when test starts at level 10 (e.g. 10%) (not mapped to DB)
|
||||
@@ -107,7 +112,7 @@ namespace Results.Entities
|
||||
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 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 Custom1 { get; set; } /// [°C] T ref hi mean
|
||||
@@ -129,10 +134,25 @@ namespace Results.Entities
|
||||
public virtual double TargetVolume() { return TestData.TargetVolume; }
|
||||
public virtual double TargetTime() { return TestData.TargetTime; }
|
||||
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 string RefFlowmeter() { return (Components != null) ? Components.Flowmeter : string.Empty; }
|
||||
public virtual bool IsRelErrTest() { return (MethodClass != null) ? (MethodClass.Contains("FixedStart") || MethodClass.Contains("FlyingStart") || MethodClass.Contains("CombinedWithDetection") || MethodClass.Contains("DiverterTest")) : true; }
|
||||
public virtual bool IsPMaxTest() { return (MethodClass != null) ? (MethodClass.Contains("PMaxTest") || MethodClass.Contains("LeakTest")) : true; }
|
||||
public virtual bool IsStartStop() { return (MethodClass != null) ? MethodClass.Contains("FixedStart") : true; }
|
||||
public virtual bool IsDiverter() { return (MethodClass != null) ? (MethodClass.Contains("FlyingStart") && MethodClass.Contains("MassColl")) : true; }
|
||||
public virtual bool IsDiverter() { return (MethodClass != null) ? ((MethodClass.Contains("FlyingStart") && MethodClass.Contains("MassColl")) || MethodClass.Contains("DiverterTest")) : true; }
|
||||
public virtual bool IsVolumeMethod() { return (MethodClass != null) ? (MethodClass.Contains("TestMethods.FixedStart.") || MethodClass.Contains("TestMethods.FlyingStart.")) : false; }
|
||||
|
||||
public virtual string MethodElde()
|
||||
{
|
||||
if (MethodClass == null) return string.Empty;
|
||||
else if (MethodClass.Contains("TestMethods.FlyingStartMassCollection.")) return "MS";
|
||||
else if (MethodClass.Contains("TestMethods.FlyingStartMassCollectionProlonged.")) return "MS";
|
||||
else if (MethodClass.Contains("TestMethods.FlyingStartMassCollectionComparative.")) return "MS";
|
||||
else if (MethodClass.Contains("TestMethods.FlyingStart.")) return "VS";
|
||||
else if (MethodClass.Contains("TestMethods.FixedStartMassCollection.")) return "MP";
|
||||
else if (MethodClass.Contains("TestMethods.FixedStartTankCollection.")) return "VP";
|
||||
else if (MethodClass.Contains("TestMethods.FixedStart.")) return "VP";
|
||||
else return string.Empty;
|
||||
}
|
||||
|
||||
public virtual double ErrLimLo()
|
||||
{
|
||||
@@ -145,7 +165,7 @@ namespace Results.Entities
|
||||
/// Metrological class and nominal flow of a heat meter
|
||||
int metrClass = (int)Math.Round(TestData.ErrLimLo);
|
||||
double Qp = Math.Abs(TestData.ErrLimHi);
|
||||
double Q = Math.Max(FlowMean, 0.00001); /// to avoid division by zero
|
||||
double Q = (TestTime == 0) ? 1 : Math.Max(3.6 * VolumeCTV / TestTime, 0.00001); /// Div. by zero avoided
|
||||
|
||||
/// Calculate the error limit of a heat meter
|
||||
switch (metrClass)
|
||||
@@ -169,7 +189,7 @@ namespace Results.Entities
|
||||
/// Metrological class and nominal flow of a heat meter
|
||||
int metrClass = (int)Math.Round(TestData.ErrLimLo);
|
||||
double Qp = Math.Abs(TestData.ErrLimHi);
|
||||
double Q = Math.Max(FlowMean, 0.00001); /// to avoid division by zero
|
||||
double Q = (TestTime == 0) ? 1 : Math.Max(3.6 * VolumeCTV / TestTime, 0.00001); /// Div. by zero avoided
|
||||
|
||||
/// Calculate the error limit of a heat meter
|
||||
switch (metrClass)
|
||||
@@ -215,10 +235,13 @@ namespace Results.Entities
|
||||
StartTime = src.StartTime;
|
||||
EndTime = src.EndTime;
|
||||
FlowSetTime = src.FlowSetTime;
|
||||
TimeBtwnMassMsrmnts = src.TimeBtwnMassMsrmnts;
|
||||
TestTime = src.TestTime;
|
||||
PulsesMaster = src.PulsesMaster;
|
||||
TotalPulsesMstr = src.TotalPulsesMstr;
|
||||
ConstMasterRaw = src.ConstMasterRaw;
|
||||
ConstMaster = src.ConstMaster;
|
||||
ConstMasterCorr = src.ConstMasterCorr;
|
||||
ConstMaster = src.ConstMaster;
|
||||
MassStartRaw = src.MassStartRaw;
|
||||
MassStart = src.MassStart;
|
||||
MassEndRaw = src.MassEndRaw;
|
||||
@@ -233,7 +256,13 @@ namespace Results.Entities
|
||||
VolumeMaster = src.VolumeMaster;
|
||||
ErrorMaster = src.ErrorMaster;
|
||||
DiverterStart = src.DiverterStart;
|
||||
DivStart10 = src.DivStart10;
|
||||
DivStart50 = src.DivStart50;
|
||||
DivStart90 = src.DivStart90;
|
||||
DiverterEnd = src.DiverterEnd;
|
||||
DivEnd10 = src.DivEnd10;
|
||||
DivEnd50 = src.DivEnd50;
|
||||
DivEnd90 = src.DivEnd90;
|
||||
ErrorFlags = src.ErrorFlags;
|
||||
ErrorFlagsMd = src.ErrorFlagsMd;
|
||||
RefEnergy = src.RefEnergy;
|
||||
@@ -316,6 +345,18 @@ namespace Results.Entities
|
||||
#endif
|
||||
}
|
||||
|
||||
public virtual bool IsPartCompatible(int waterMeterPartNr)
|
||||
{
|
||||
if ((this.Part == 0) || (waterMeterPartNr == 0)) return true;
|
||||
|
||||
if ((this.Part % 10) == waterMeterPartNr) return true;
|
||||
if (((this.Part / 10) % 10) == waterMeterPartNr) return true;
|
||||
if (((this.Part / 100) % 10) == waterMeterPartNr) return true;
|
||||
if (((this.Part / 1000) % 10) == waterMeterPartNr) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("batch={0}, procedure={1}, test={2}, {3} {4}", Batch.BatchNr, Batch.ProcedureName, Name(), StartTime.ToShortDateString(), StartTime.ToShortTimeString());
|
||||
|
||||
+221
-28
@@ -5,6 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Config.Entities;
|
||||
using Results.Resources;
|
||||
|
||||
namespace Results.Entities
|
||||
{
|
||||
@@ -41,8 +42,8 @@ namespace Results.Entities
|
||||
public class WaterMeter
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual string SerialNr { get; set; } /// Main s/n for compound meters, PCB Number for iPerl water meter
|
||||
public virtual string SerialNrAux { get; set; } /// Aux s/n for compound meters, Serial number for iPerl water meter
|
||||
public virtual string SerialNr { get; set; } /// S/N _or_ S/N of the main meter of a compound meter _or_ PCB Number of an iPerl water meter
|
||||
public virtual string SerialNrAux { get; set; } /// S/N of the aux. meter of a compound meter _or_ a complete assigned S/N of an iPerl water meter
|
||||
public virtual string PurchaseOrder { get; set; }
|
||||
public virtual int YearOfProduction { get; set; }
|
||||
public virtual int WMPosition { get; set; }
|
||||
@@ -57,25 +58,48 @@ namespace Results.Entities
|
||||
public virtual string Remark { get; set; }
|
||||
|
||||
#if IPERL
|
||||
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 CalibFactor { get; set; } /// iPerl 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 double Q2Correction { get; set; } /// !!! obsolete
|
||||
public virtual int Q2CorrRFlow { 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 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 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 int Q2CorrRL { get; set; } /// iPerl Q2 correction for the R-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 double Diff2Hz8Hz { get; set; }
|
||||
public virtual bool Hz2CorrectionDone { get; set; } /// true = iPerl Q2 correction was done
|
||||
public virtual int Hz2Correction { get; set; } /// iPerl Q2 correction used during the test
|
||||
public virtual string FWVersion { get; set; }
|
||||
#endif
|
||||
#if ORACLE_DB
|
||||
public virtual int Pruefindex { get; set; } /// Not mapped to DB !!! 0=unknown (saving to Oracle failed), >=1 ... pruefindex
|
||||
public virtual int HydrPruefung { get; set; } /// Not mapped to DB !!!
|
||||
#if TURA_SPECIAL
|
||||
/// <summary>
|
||||
/// Data from a production test bench (in case of tests on iPerl special)
|
||||
/// </summary>
|
||||
public virtual int AssignedSerialNr { get; set; }
|
||||
public virtual string CompleteSerialNr { get; set; }
|
||||
public virtual string RadioAddress { get; set; }
|
||||
public virtual int PaletteNr { get; set; }
|
||||
public virtual int UmkartonNr { get; set; }
|
||||
public virtual string ProdTestBench { get; set; }
|
||||
public virtual int ProdWMPosition { get; set; }
|
||||
public virtual string ProdUserName { get; set; }
|
||||
public virtual string ProdPurchaseOrder { get; set; }
|
||||
public virtual bool ProdPassed { get; set; }
|
||||
public virtual int ProdResultCode { get; set; }
|
||||
public virtual int ProdQ2CorrRL { get; set; } /// iPerl Q2 correction for the R-flow written to iPerl
|
||||
public virtual int ProdQ2CorrLR { get; set; } /// iPerl Q2 correction for the L-flow written to iPerl
|
||||
#endif
|
||||
public virtual WaterMeterData WaterMeterData { get; set; }
|
||||
#if ORACLE_DB
|
||||
public virtual int Pruefindex { get; set; } /// >= 1 ... pruefindex
|
||||
public virtual int HydrPruefung { get; set; }
|
||||
public virtual int WMTypeRevision { get; set; } /// Not mapped to DB !!!
|
||||
public virtual object RawTestInfos { get; set; } /// IList<SensusTestInfo> fetched from Oracle at the beginning of the cycle, not mapped to DB !!!
|
||||
public virtual object CompleteTestInfos { get; set; } /// SensusTestInfo[] obtained as a best match at the beginning of the cycle, not mapped to DB !!!
|
||||
#endif
|
||||
public virtual int ProcessId { get; set; } /// Not mapped to DB !!! Tracing DB Process ID
|
||||
public virtual bool LastRecordIsNok { get; set; } /// Not mapped to DB !!! Previous record verification result
|
||||
|
||||
public virtual WaterMeterData WaterMeterData { get; set; }
|
||||
public virtual Batch Batch { get; set; }
|
||||
public virtual IList<MeterTestRslt> MeterTestRslts { get; set; }
|
||||
|
||||
@@ -117,7 +141,7 @@ namespace Results.Entities
|
||||
ErrorFlagsMode eFlagsMode = 0; /// = ErrorFlagsMode.Off;
|
||||
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();
|
||||
}
|
||||
errorFlagsMode = eFlagsMode; /// Maximum from all tests (=ErrorFlagsMode.On if at least one test is ErrorFlagsMode.On)
|
||||
@@ -149,7 +173,7 @@ namespace Results.Entities
|
||||
{
|
||||
ErrorFlagsMode errorFlagsMode;
|
||||
string eFlags = Utils.ErrorFlagsStr(ErrorFlagsFromTestsAndWM(out errorFlagsMode));
|
||||
return string.IsNullOrEmpty(eFlags) ? (WaterMeterData.Text4 + PassedColorStr()) : eFlags;
|
||||
return string.IsNullOrEmpty(eFlags) ? (WaterMeterData.Text4 + PassedColorStr(null)) : eFlags;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -209,9 +233,17 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -252,7 +284,12 @@ namespace Results.Entities
|
||||
{
|
||||
return mtr;
|
||||
}
|
||||
}
|
||||
else if (meterId == Config.Entities.CompoundMeterId.SingleOrCompound &&
|
||||
mtr.CompoundMeterId == (byte)Config.Entities.CompoundMeterId.HeatMeterEnergy)
|
||||
{
|
||||
return mtr;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -264,6 +301,21 @@ namespace Results.Entities
|
||||
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)
|
||||
{
|
||||
foreach (var mtr in MeterTestRslts)
|
||||
@@ -276,6 +328,21 @@ namespace Results.Entities
|
||||
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>
|
||||
@@ -284,6 +351,16 @@ namespace Results.Entities
|
||||
public WaterMeter()
|
||||
{
|
||||
MeterTestRslts = new List<MeterTestRslt>();
|
||||
#if ORACLE_DB
|
||||
Pruefindex = 1;
|
||||
HydrPruefung = 0;
|
||||
WMTypeRevision = 0;
|
||||
RawTestInfos = null;
|
||||
CompleteTestInfos = null;
|
||||
#endif
|
||||
ProcessId = 0;
|
||||
ErrorFlags = 0;
|
||||
LastRecordIsNok = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -306,24 +383,44 @@ namespace Results.Entities
|
||||
ArchivePath = src.ArchivePath;
|
||||
Remark = src.Remark;
|
||||
#if IPERL
|
||||
SerialNrEx = src.SerialNrEx;
|
||||
OrigCalibFactor = src.OrigCalibFactor;
|
||||
CalibFactor = src.CalibFactor;
|
||||
OrigCalibFactorLNA = src.OrigCalibFactorLNA;
|
||||
CalibFactorLNA = src.CalibFactorLNA;
|
||||
Q2ErrWOCorrection = src.Q2ErrWOCorrection;
|
||||
Q2CorrectionDone = src.Q2CorrectionDone;
|
||||
Q2Correction = src.Q2Correction;
|
||||
Q2CorrRFlow = src.Q2CorrRFlow;
|
||||
Q2CorrLFlow = src.Q2CorrLFlow;
|
||||
Q2CorrRL = src.Q2CorrRL;
|
||||
Q2CorrLR = src.Q2CorrLR;
|
||||
Q2CorrFlowRight = src.Q2CorrFlowRight;
|
||||
Diff2Hz8Hz = src.Diff2Hz8Hz;
|
||||
Hz2CorrectionDone = src.Hz2CorrectionDone;
|
||||
Hz2Correction = src.Hz2Correction;
|
||||
FWVersion = src.FWVersion;
|
||||
#endif
|
||||
#if ORACLE_DB
|
||||
Pruefindex = src.Pruefindex;
|
||||
HydrPruefung = src.HydrPruefung;
|
||||
#if TURA_SPECIAL
|
||||
AssignedSerialNr = src.AssignedSerialNr;
|
||||
CompleteSerialNr = src.CompleteSerialNr;
|
||||
RadioAddress = src.RadioAddress;
|
||||
PaletteNr = src.PaletteNr;
|
||||
UmkartonNr = src.UmkartonNr;
|
||||
ProdTestBench = src.ProdTestBench;
|
||||
ProdWMPosition = src.ProdWMPosition;
|
||||
ProdUserName = src.ProdUserName;
|
||||
ProdPurchaseOrder = src.ProdPurchaseOrder;
|
||||
ProdPassed = src.ProdPassed;
|
||||
ProdResultCode = src.ProdResultCode;
|
||||
ProdQ2CorrRL = src.ProdQ2CorrRL;
|
||||
ProdQ2CorrLR = src.ProdQ2CorrLR;
|
||||
#endif
|
||||
#if ORACLE_DB
|
||||
Pruefindex = src.Pruefindex;
|
||||
HydrPruefung = src.HydrPruefung;
|
||||
WMTypeRevision = src.WMTypeRevision;
|
||||
RawTestInfos = src.RawTestInfos;
|
||||
CompleteTestInfos = src.CompleteTestInfos;
|
||||
#endif
|
||||
ProcessId = src.ProcessId;
|
||||
LastRecordIsNok = src.LastRecordIsNok;
|
||||
|
||||
foreach (var mtr in MeterTestRslts)
|
||||
{
|
||||
MeterTestRslt srcMtr = src.GetMeterTestRslt(mtr.Name(), (Config.Entities.CompoundMeterId)mtr.CompoundMeterId);
|
||||
@@ -339,7 +436,7 @@ namespace Results.Entities
|
||||
{
|
||||
StringBuilder sb = new StringBuilder(80);
|
||||
#if IPERL
|
||||
sb.AppendFormat("PCB:{0} S/N:{1} ", SerialNr, SerialNrEx);
|
||||
sb.AppendFormat("PCB:{0} S/N:{1} ", SerialNr, SerialNrAux);
|
||||
#else
|
||||
sb.AppendFormat("S/N:{0} ", SerialNr);
|
||||
#endif
|
||||
@@ -348,5 +445,101 @@ namespace Results.Entities
|
||||
sb.AppendFormat(" test start: {0} {1} batch={2}", StartTime().ToShortDateString(), StartTime().ToShortTimeString(), BatchNr());
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get decorated test names for a specified watermeter
|
||||
/// </summary>
|
||||
/// <param name="wMtr">Watermeter results entity</param>
|
||||
/// <returns>A list of strings</returns>
|
||||
public virtual IList<string> GetAllDecoratedTestNames()
|
||||
{
|
||||
IList<string> testNames = new List<string>();
|
||||
|
||||
if (MeterTestRslts != null)
|
||||
{
|
||||
foreach (var mtr in MeterTestRslts)
|
||||
{
|
||||
if ((mtr.CompoundMeterId == (byte)CompoundMeterId.Single || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound || mtr.CompoundMeterId == (byte)CompoundMeterId.HeatMeterEnergy)
|
||||
&& mtr.TestDone
|
||||
&& (mtr.Publish() != Config.Entities.Publish.Never)
|
||||
&& (mtr.Publish() != Config.Entities.Publish.Internal))
|
||||
{
|
||||
testNames.Add(mtr.Name());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return testNames;
|
||||
}
|
||||
|
||||
|
||||
static readonly System.Drawing.Color NotCompletedColor = System.Drawing.Color.White;
|
||||
static readonly System.Drawing.Color OkColor = System.Drawing.Color.LightGreen;
|
||||
static readonly System.Drawing.Color NokColor = System.Drawing.Color.LightPink;
|
||||
static readonly System.Drawing.Color RejectColor = System.Drawing.Color.Magenta;
|
||||
static readonly System.Drawing.Color ProductionErrorColor = System.Drawing.Color.RoyalBlue;
|
||||
static readonly System.Drawing.Color WrongDirectionColor = System.Drawing.Color.Gold;
|
||||
static readonly System.Drawing.Color WrongQ2FactorsColor = System.Drawing.Color.Red;
|
||||
|
||||
/// <summary>
|
||||
/// Get color for highlighting results and an apporpriate text message.
|
||||
/// </summary>
|
||||
/// <param name="wMtr">Water meter results entity</param>
|
||||
/// <param name="message">Appropriate message</param>
|
||||
/// <returns>Color for results</returns>
|
||||
public virtual System.Drawing.Color GetColorOfResults(bool maxRepeatsExceeded, out string message)
|
||||
{
|
||||
bool wmtrCompleted = CompletedFromTests();
|
||||
bool wmtrPassed = PassedFromTests();
|
||||
|
||||
if ((ErrorFlags & (int)ErrorFlagMask.E28) != 0)
|
||||
{
|
||||
message = Strings.Previous_step_is_missing_or_NOK;
|
||||
return ProductionErrorColor;
|
||||
}
|
||||
else if ((ErrorFlags & (int)ErrorFlagMask.E27) != 0)
|
||||
{
|
||||
message = Strings.Wrong_iPerl_counting_direction;
|
||||
return WrongDirectionColor;
|
||||
}
|
||||
else if ((ErrorFlags & (int)ErrorFlagMask.E26) != 0)
|
||||
{
|
||||
message = Strings.Invalid_Q2_correction_factors;
|
||||
return WrongQ2FactorsColor;
|
||||
}
|
||||
else if (wmtrPassed)
|
||||
{
|
||||
/// Water meter passed (therefore is was also completed)
|
||||
message = Strings.Passed;
|
||||
return OkColor;
|
||||
}
|
||||
else if (wmtrCompleted)
|
||||
{
|
||||
/// Water meter was completed but did not pass => Failed
|
||||
if (maxRepeatsExceeded)
|
||||
{
|
||||
message = Strings.Test_repetition_count_exceeded_upper_limit;
|
||||
return RejectColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
message = Strings.Failed;
|
||||
return NokColor;
|
||||
}
|
||||
}
|
||||
else if (Disabled)
|
||||
{
|
||||
/// Water meter was not completed yet => did not pass, did not fail
|
||||
message = Strings.This_position_is_disabled;
|
||||
return NotCompletedColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Water meter was not completed yet => did not pass, did not fail
|
||||
message = Strings.Test_in_progress;
|
||||
return NotCompletedColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,6 @@ namespace Results.Entities
|
||||
|
||||
#if ORACLE_DB
|
||||
public virtual int WMTypeId { get; set; }
|
||||
public virtual int WMTypeRev { get; set; }
|
||||
#endif
|
||||
|
||||
public WaterMeterData()
|
||||
@@ -111,7 +110,6 @@ namespace Results.Entities
|
||||
|
||||
#if ORACLE_DB
|
||||
if (WMTypeId != wmd.WMTypeId) return false;
|
||||
if (WMTypeRev != wmd.WMTypeRev) return false;
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
+221
-270
@@ -1,14 +1,11 @@
|
||||
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 log4net;
|
||||
using Config.Entities;
|
||||
using Results.Resources;
|
||||
using NHibernate;
|
||||
using TracingDB.Entities;
|
||||
|
||||
namespace Results.Forms
|
||||
{
|
||||
@@ -16,42 +13,33 @@ namespace Results.Forms
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(BatchResultsDlg));
|
||||
|
||||
DateTime lastRedraw;
|
||||
DateTime lastSizeChange;
|
||||
bool loaded;
|
||||
|
||||
///
|
||||
/// Public members
|
||||
///
|
||||
public Results.BatchResults Results;
|
||||
public IList<Results.WMeterRsltItemSpec> Items;
|
||||
public MetersArrangement MetersArrangement;
|
||||
public TestsArrangement TestsArrangement;
|
||||
public int NrMetersInOneGroup;
|
||||
|
||||
public IList<Results.WMeterRsltItemSpec> RsltItems_Screen_SingleWM;
|
||||
public IList<Results.WMeterRsltItemSpec> RsltItems_Screen_CombinedWM;
|
||||
public IList<Results.WMeterRsltItemSpec> RsltItems_Screen_HeatM;
|
||||
public int[] RsltsClmnWidths { set { rsltsClmnWidths = value; } }
|
||||
|
||||
public bool ShowDisabledPositions;
|
||||
public int MinWidth;
|
||||
public int MinHeight;
|
||||
public int PopupResultsLeft;
|
||||
public int PopupResultsTop;
|
||||
public int PopupResultsWidth;
|
||||
public int PopupResultsHeight;
|
||||
public int[] RsltsClmnWidths;
|
||||
|
||||
public Results.BatchResults Results { set { Display(value); } }
|
||||
|
||||
///
|
||||
/// Private members
|
||||
///
|
||||
Results.BatchResults results;
|
||||
MetersKind metersKind;
|
||||
|
||||
ListView firstListView;
|
||||
public int[] rsltsClmnWidths;
|
||||
int rsltsClmnCount { get { return (rsltsClmnWidths != null) ? rsltsClmnWidths.Length : 0; } }
|
||||
|
||||
int lvWidth;
|
||||
int lvHeight;
|
||||
|
||||
IOneWMResultsCtrl[] wmRsltsCtrl; /// An array of controls with water meter results.
|
||||
IOneWMResultsCtrl firstEnabledControl;
|
||||
DateTime lastRedraw;
|
||||
DateTime lastSizeChange;
|
||||
int metersInOneGroup;
|
||||
int nrGroups;
|
||||
|
||||
Timer timer;
|
||||
|
||||
@@ -59,291 +47,226 @@ namespace Results.Forms
|
||||
public BatchResultsDlg()
|
||||
{
|
||||
InitializeComponent();
|
||||
Text = Strings.Results;
|
||||
|
||||
firstEnabledControl = null;
|
||||
lastSizeChange = DateTime.Now;
|
||||
nrGroups = 1;
|
||||
metersInOneGroup = 1;
|
||||
|
||||
// Create a timer with a ten second interval.
|
||||
/// Create a timer with one second interval.
|
||||
timer = new Timer();
|
||||
timer.Interval = 500; /// ms
|
||||
timer.Interval = 1000; /// ms
|
||||
timer.Tick += new EventHandler(OnTimer);
|
||||
timer.Start();
|
||||
}
|
||||
|
||||
private void BatchResultsDlg_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (PopupResultsLeft != 0) Left = PopupResultsLeft;
|
||||
if (PopupResultsTop != 0) Top = PopupResultsTop;
|
||||
if (PopupResultsWidth != 0) Width = PopupResultsWidth;
|
||||
if (PopupResultsLeft != 0) Left = PopupResultsLeft;
|
||||
if (PopupResultsTop != 0) Top = PopupResultsTop;
|
||||
if (PopupResultsWidth != 0) Width = PopupResultsWidth;
|
||||
if (PopupResultsHeight != 0) Height = PopupResultsHeight;
|
||||
|
||||
loaded = true;
|
||||
if (results != null) Redraw();
|
||||
}
|
||||
|
||||
public void Display(Results.BatchResults results)
|
||||
{
|
||||
this.results = results;
|
||||
if (loaded) Redraw();
|
||||
CreateControlsAndFillPanel(Results);
|
||||
UpdateColumnWidths(RsltsClmnWidths);
|
||||
UpdateResults(Results);
|
||||
}
|
||||
|
||||
|
||||
IList<Results.WMeterRsltItemSpec> GetRsltItems(MetersKind metersKind)
|
||||
///
|
||||
/// Handle double-click inside a water meter results control
|
||||
///
|
||||
void OnDoubleClick(object sender, Results.Forms.WaterMeterEventArgs args)
|
||||
{
|
||||
IList<Results.WMeterRsltItemSpec> srcItems;
|
||||
switch (metersKind)
|
||||
if (Results.WaterMeters != null && args.WMPosition > 0)
|
||||
{
|
||||
default:
|
||||
case MetersKind.Single: srcItems = RsltItems_Screen_SingleWM; break;
|
||||
case MetersKind.Combined: srcItems = RsltItems_Screen_CombinedWM; break;
|
||||
case MetersKind.HeatMeter: srcItems = RsltItems_Screen_HeatM; break;
|
||||
foreach (var wm in Results.WaterMeters)
|
||||
{
|
||||
if ((wm != null) && (wm.WMPosition == args.WMPosition))
|
||||
{
|
||||
ShowMoreWMResults(wm);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IList<Results.WMeterRsltItemSpec> copiedItems = new List<Results.WMeterRsltItemSpec>();
|
||||
foreach (var it in srcItems) copiedItems.Add(it.Clone());
|
||||
return copiedItems;
|
||||
MessageBox.Show(Strings.No_water_meter);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void UpdateColumnWidths(int[] columnWidths)
|
||||
{
|
||||
foreach (var ctrl in wmRsltsCtrl) ctrl.Update(columnWidths);
|
||||
}
|
||||
|
||||
void UpdateScrollpositions(int scrollStart)
|
||||
{
|
||||
/// TODO
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Re-draw the results. Apply new settings if they changed.
|
||||
/// </summary>
|
||||
public void Redraw()
|
||||
void CreateControlsAndFillPanel(Results.BatchResults results)
|
||||
{
|
||||
lastRedraw = DateTime.Now;
|
||||
|
||||
this.SuspendLayout();
|
||||
|
||||
try
|
||||
if ((results == null) || (results.WMPositionsCount == 0))
|
||||
{
|
||||
/// Determine how many water meters were enabled for result evaluation and printing
|
||||
int enabledWMsCount = 0;
|
||||
for (int i = 0; i < results.WMPositionsCount; i++)
|
||||
/// There are no water meters at all
|
||||
flowLayoutPanel.Controls.Clear();
|
||||
wmRsltsCtrl = new OneWMResultsRowsCtrl[0];
|
||||
firstEnabledControl = null;
|
||||
return;
|
||||
}
|
||||
|
||||
///
|
||||
/// Determine water meter positions count
|
||||
///
|
||||
int displayedControlsCount = 0;
|
||||
for (int i = 0; i < results.WaterMeters.Length; i++)
|
||||
{
|
||||
if (((results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled) || ShowDisabledPositions)
|
||||
{
|
||||
if (results.WaterMeters[i] != null && !results.WaterMeters[i].Disabled)
|
||||
displayedControlsCount++;
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Calculate geometry
|
||||
///
|
||||
metersInOneGroup = Math.Max(1, Math.Min(displayedControlsCount, NrMetersInOneGroup));
|
||||
nrGroups = Math.Max(1, (displayedControlsCount + metersInOneGroup - 1) / metersInOneGroup);
|
||||
|
||||
int oneWidth;
|
||||
int oneHeight;
|
||||
///
|
||||
if (MetersArrangement == MetersArrangement.Horizontally)
|
||||
{
|
||||
flowLayoutPanel.FlowDirection = FlowDirection.LeftToRight;
|
||||
oneWidth = Math.Max(MinWidth, flowLayoutPanel.Width / metersInOneGroup - 6);
|
||||
oneHeight = Math.Max(MinHeight, flowLayoutPanel.Height / nrGroups - 6);
|
||||
}
|
||||
else
|
||||
{
|
||||
flowLayoutPanel.FlowDirection = FlowDirection.TopDown;
|
||||
oneWidth = Math.Max(MinWidth, flowLayoutPanel.Width / nrGroups - 6);
|
||||
oneHeight = Math.Max(MinHeight, flowLayoutPanel.Height / metersInOneGroup - 6);
|
||||
}
|
||||
|
||||
///
|
||||
/// Create controls and fill the FlowLayoutPanel
|
||||
///
|
||||
flowLayoutPanel.SuspendLayout();
|
||||
flowLayoutPanel.Controls.Clear();
|
||||
flowLayoutPanel.WrapContents = true;
|
||||
flowLayoutPanel.AutoScroll = true;
|
||||
|
||||
wmRsltsCtrl = new IOneWMResultsCtrl[displayedControlsCount];
|
||||
int ix = 0;
|
||||
firstEnabledControl = null;
|
||||
for (int i = 0; i < results.WaterMeters.Length; i++)
|
||||
{
|
||||
if (((results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled) || ShowDisabledPositions)
|
||||
{
|
||||
/// Create one water meter position / control
|
||||
wmRsltsCtrl[ix] = (TestsArrangement == TestsArrangement.Rows)
|
||||
? new OneWMResultsRowsCtrl() as IOneWMResultsCtrl
|
||||
: new OneWMResultsColumnsCtrl() as IOneWMResultsCtrl;
|
||||
wmRsltsCtrl[ix].Width = oneWidth;
|
||||
wmRsltsCtrl[ix].Height = oneHeight;
|
||||
|
||||
if ((results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled)
|
||||
{
|
||||
enabledWMsCount++;
|
||||
if ((firstEnabledControl == null) && (results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled)
|
||||
{
|
||||
firstEnabledControl = wmRsltsCtrl[ix];
|
||||
}
|
||||
|
||||
//wmRsltsCtrl[ix].Update(results.WaterMeters[i].WMPosition);
|
||||
wmRsltsCtrl[ix].Update(Items);
|
||||
wmRsltsCtrl[ix].WMResultsClickedHandler += delegate(object s, Results.Forms.WaterMeterEventArgs args)
|
||||
{
|
||||
if (InvokeRequired)
|
||||
{
|
||||
Invoke(new EventHandler<Results.Forms.WaterMeterEventArgs>(OnDoubleClick), s, args);
|
||||
}
|
||||
else
|
||||
{
|
||||
OnDoubleClick(s, args);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
flowLayoutPanel.Controls.Add(wmRsltsCtrl[ix] as UserControl);
|
||||
ix++;
|
||||
}
|
||||
}
|
||||
|
||||
flowLayoutPanel.ResumeLayout();
|
||||
|
||||
lastRedraw = DateTime.Now;
|
||||
}
|
||||
|
||||
|
||||
void UpdateResults(Results.BatchResults results)
|
||||
{
|
||||
if ((results != null) && (results.WaterMeters != null))
|
||||
{
|
||||
int ctrlIx = 0;
|
||||
for (int i = 0; i < results.WaterMeters.Length; i++)
|
||||
{
|
||||
if (((results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled) || ShowDisabledPositions)
|
||||
{
|
||||
if (ctrlIx < wmRsltsCtrl.Length) wmRsltsCtrl[ctrlIx++].Update(results.WaterMeters[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int metersInOneGroup = Math.Max(1, Math.Min(enabledWMsCount, NrMetersInOneGroup));
|
||||
int nrGroups = Math.Max(1, (enabledWMsCount + metersInOneGroup - 1) / metersInOneGroup);
|
||||
|
||||
if (MetersArrangement == MetersArrangement.Horizontally)
|
||||
void ShowMoreWMResults(Results.Entities.WaterMeter wm)
|
||||
{
|
||||
if ((TracingDB.DB.SessionFactory == null) || string.IsNullOrEmpty(wm.SerialNr))
|
||||
{
|
||||
new Results.Forms.MoreWMResultsDlg(wm, null).ShowDialog();
|
||||
}
|
||||
else
|
||||
{
|
||||
using (ISession session = TracingDB.DB.SessionFactory.OpenSession())
|
||||
{
|
||||
flowLayoutPanel.FlowDirection = FlowDirection.LeftToRight;
|
||||
lvWidth = flowLayoutPanel.Width / metersInOneGroup - 6;
|
||||
lvHeight = flowLayoutPanel.Height / nrGroups - 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
flowLayoutPanel.FlowDirection = FlowDirection.TopDown;
|
||||
lvWidth = flowLayoutPanel.Width / nrGroups - 6;
|
||||
lvHeight = flowLayoutPanel.Height / metersInOneGroup - 6;
|
||||
}
|
||||
flowLayoutPanel.Controls.Clear();
|
||||
flowLayoutPanel.WrapContents = true;
|
||||
flowLayoutPanel.AutoScroll = true;
|
||||
|
||||
bool first = true;
|
||||
for (int i = 0; i < results.WMPositionsCount; i++)
|
||||
{
|
||||
if (results.WaterMeters[i] != null && !results.WaterMeters[i].Disabled)
|
||||
IList<ReferenceRecord> refRecords = session.QueryOver<ReferenceRecord>()
|
||||
.Where(x => (x.Code == wm.SerialNr))
|
||||
.OrderBy(x => x.TimeStamp).Desc
|
||||
.List();
|
||||
for (int i = 0; i < refRecords.Count; i++)
|
||||
{
|
||||
ListView lview = (TestsArrangement == TestsArrangement.Rows)
|
||||
? GetResultsTestsAreRows(results.WaterMeters[i], i + 1)
|
||||
: GetResultsTestsAreColumns(results.WaterMeters[i], i + 1);
|
||||
if (lview != null)
|
||||
ReferenceRecord refR = refRecords[i];
|
||||
if ((refR.Records != null) && (refR.Records.Count > 0))
|
||||
{
|
||||
flowLayoutPanel.Controls.Add(lview);
|
||||
if (first)
|
||||
/// Reference record has additional records/parts (i.e. it is PCB assembly workflow step)
|
||||
///
|
||||
foreach (var rec in refR.Records)
|
||||
{
|
||||
firstListView = lview;
|
||||
first = false;
|
||||
if (rec.Part.OraDBType.ToLower().Contains("flowtube"))
|
||||
{
|
||||
/// rec.Part is a flowtube
|
||||
///
|
||||
IList<ReferenceRecord> flowtubeRRs = session.QueryOver<ReferenceRecord>()
|
||||
.Where(x => (x.Code == rec.Code))
|
||||
.OrderBy(x => x.TimeStamp).Desc
|
||||
.List();
|
||||
foreach (var rr in flowtubeRRs) refRecords.Add(rr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
new Results.Forms.MoreWMResultsDlg(wm, refRecords).ShowDialog();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.FatalFormat("Redrawing results failed : {0}", e.Message);
|
||||
if (e.InnerException != null)
|
||||
{
|
||||
log.FatalFormat("InnerMessage : {0}", e.InnerException.Message);
|
||||
}
|
||||
log.FatalFormat("StackTrace : {0}{1}", Environment.NewLine, e.StackTrace);
|
||||
}
|
||||
|
||||
this.ResumeLayout(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get an empty ListView control with appropriate parameters.
|
||||
/// </summary>
|
||||
/// <returns>ListView control</returns>
|
||||
ListView GetListView()
|
||||
{
|
||||
ListView lview = new ListView();
|
||||
lview.AllowColumnReorder = false;
|
||||
lview.Dock = System.Windows.Forms.DockStyle.None;
|
||||
lview.FullRowSelect = true;
|
||||
lview.GridLines = true;
|
||||
lview.Location = new System.Drawing.Point(0, 0);
|
||||
lview.Size = new System.Drawing.Size(lvWidth, lvHeight);
|
||||
lview.TabIndex = 0;
|
||||
lview.UseCompatibleStateImageBehavior = false;
|
||||
lview.View = System.Windows.Forms.View.Details;
|
||||
return lview;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get decorated test names for a specified watermeter
|
||||
/// </summary>
|
||||
/// <param name="wMtr">Watermeter results entity</param>
|
||||
/// <returns>A list of strings</returns>
|
||||
IList<string> GetAllDecoratedTestNames(Results.Entities.WaterMeter wMtr)
|
||||
{
|
||||
IList<string> testNames = new List<string>();
|
||||
|
||||
foreach (var mtr in wMtr.MeterTestRslts)
|
||||
{
|
||||
if (mtr.IsPilotRslt() && mtr.TestDone && (mtr.Publish() != Config.Entities.Publish.Never)
|
||||
&& (mtr.Publish() != Config.Entities.Publish.Internal))
|
||||
{
|
||||
testNames.Add(mtr.Name());
|
||||
}
|
||||
}
|
||||
|
||||
return testNames;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a ListView control filled with results of the meter 'mtr'
|
||||
/// </summary>
|
||||
/// <param name="mtr">Water meter number (1-based): 1 .. Config.Data.WMsCount</param>
|
||||
/// <returns>ListView object</returns>
|
||||
ListView GetResultsTestsAreRows(Results.Entities.WaterMeter wMtr, int printedWMNr)
|
||||
{
|
||||
metersKind = wMtr.Compound() ? MetersKind.Combined : (wMtr.HeatMeter() ? MetersKind.HeatMeter : MetersKind.Single);
|
||||
|
||||
ListView lview = GetListView();
|
||||
|
||||
IList<Results.WMeterRsltItemSpec> items = GetRsltItems(metersKind);
|
||||
|
||||
if (items == null || items.Count == 0) return lview;
|
||||
|
||||
// Header
|
||||
lview.Columns.Add(printedWMNr.ToString(), (rsltsClmnCount > 0) ? rsltsClmnWidths[0] : 40);
|
||||
int col = 1;
|
||||
foreach (var item in items)
|
||||
{
|
||||
lview.Columns.Add(item.Caption, (rsltsClmnCount > col) ? rsltsClmnWidths[col] : 70);
|
||||
col++;
|
||||
}
|
||||
|
||||
|
||||
IList<string> testNames = GetAllDecoratedTestNames(wMtr);
|
||||
int ix = 0;
|
||||
foreach (var mtr in wMtr.MeterTestRslts)
|
||||
{
|
||||
if (mtr != null && mtr.IsPilotRslt() && mtr.TestDone && mtr.Publish() != Config.Entities.Publish.Never
|
||||
&& mtr.Publish() != Config.Entities.Publish.Internal)
|
||||
{
|
||||
ListViewItem lvi = new ListViewItem(testNames[ix++]);
|
||||
|
||||
for (int i = 0; i < items.Count; i++)
|
||||
{
|
||||
string str = items[i].Print(wMtr, mtr.Name());
|
||||
|
||||
/// Extract and use color information
|
||||
string[] texts = str.Split(new char[] { '|' });
|
||||
if (texts.Length == 1)
|
||||
{
|
||||
lvi.SubItems.Add(str);
|
||||
}
|
||||
else if (texts.Length == 2)
|
||||
{
|
||||
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
|
||||
lvi.UseItemStyleForSubItems = false;
|
||||
lvi.SubItems.Add(texts[0]);
|
||||
lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
|
||||
}
|
||||
else
|
||||
{
|
||||
lvi.SubItems.Add(string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
lview.Items.Add(lvi);
|
||||
}
|
||||
}
|
||||
|
||||
return lview;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a ListView control filled with results of the meter 'mtr'
|
||||
/// </summary>
|
||||
/// <param name="mtr">Water meter number (1-based): 1 .. Config.Data.WMsCount</param>
|
||||
/// <returns>ListView object</returns>
|
||||
ListView GetResultsTestsAreColumns(Results.Entities.WaterMeter wMtr, int printedWMNr)
|
||||
{
|
||||
metersKind = wMtr.Compound() ? MetersKind.Combined : (wMtr.HeatMeter() ? MetersKind.HeatMeter : MetersKind.Single);
|
||||
|
||||
ListView lview = GetListView();
|
||||
|
||||
IList<Results.WMeterRsltItemSpec> items = GetRsltItems(metersKind);
|
||||
|
||||
if (items == null || items.Count == 0) return lview;
|
||||
|
||||
// Header
|
||||
lview.Columns.Add(printedWMNr.ToString(), (rsltsClmnCount > 0) ? rsltsClmnWidths[0] : 40);
|
||||
int i = 1;
|
||||
foreach (var str in GetAllDecoratedTestNames(wMtr))
|
||||
{
|
||||
lview.Columns.Add(str, (rsltsClmnCount > i) ? rsltsClmnWidths[i] : 70);
|
||||
i++;
|
||||
}
|
||||
|
||||
foreach (var item in items)
|
||||
{
|
||||
ListViewItem lvi = new ListViewItem(item.Caption);
|
||||
|
||||
foreach (var mtr in wMtr.MeterTestRslts)
|
||||
{
|
||||
if (mtr != null && mtr.IsPilotRslt() && mtr.TestDone && mtr.Publish() != Config.Entities.Publish.Never &&
|
||||
mtr.Publish() != Config.Entities.Publish.Internal)
|
||||
{
|
||||
string str = item.Print(wMtr, mtr.Name());
|
||||
|
||||
string[] texts = str.Split(new char[] { '|' });
|
||||
if (texts.Length == 1)
|
||||
{
|
||||
lvi.SubItems.Add(str);
|
||||
}
|
||||
else if (texts.Length == 2)
|
||||
{
|
||||
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
|
||||
lvi.UseItemStyleForSubItems = false;
|
||||
lvi.SubItems.Add(texts[0]);
|
||||
lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
|
||||
}
|
||||
else
|
||||
{
|
||||
lvi.SubItems.Add(string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lview.Items.Add(lvi);
|
||||
}
|
||||
|
||||
return lview;
|
||||
}
|
||||
|
||||
private void BatchResultsDlg_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
@@ -353,6 +276,7 @@ namespace Results.Forms
|
||||
PopupResultsHeight = Height;
|
||||
}
|
||||
|
||||
|
||||
private void flowLayoutPanel_SizeChanged(object sender, EventArgs e)
|
||||
{
|
||||
lastSizeChange = DateTime.Now;
|
||||
@@ -362,13 +286,40 @@ namespace Results.Forms
|
||||
{
|
||||
if (DateTime.Compare(lastSizeChange, lastRedraw) > 0)
|
||||
{
|
||||
/// The last size change was later then the last redraw
|
||||
/// The last size change was more recent then the last redraw
|
||||
|
||||
DateTime now = DateTime.Now;
|
||||
if (DateTime.Compare(lastSizeChange + new TimeSpan(0, 0, 1), now) < 0)
|
||||
{
|
||||
/// More then 1s since the last size change
|
||||
Redraw();
|
||||
/// More then 1 second since the last panel size change
|
||||
|
||||
/// Calculate geometry
|
||||
int oneWidth;
|
||||
int oneHeight;
|
||||
///
|
||||
if (MetersArrangement == MetersArrangement.Horizontally)
|
||||
{
|
||||
flowLayoutPanel.FlowDirection = FlowDirection.LeftToRight;
|
||||
oneWidth = Math.Max(MinWidth, flowLayoutPanel.Width / metersInOneGroup - 6);
|
||||
oneHeight = Math.Max(MinHeight, flowLayoutPanel.Height / nrGroups - 6);
|
||||
}
|
||||
else
|
||||
{
|
||||
flowLayoutPanel.FlowDirection = FlowDirection.TopDown;
|
||||
oneWidth = Math.Max(MinWidth, flowLayoutPanel.Width / nrGroups - 6);
|
||||
oneHeight = Math.Max(MinHeight, flowLayoutPanel.Height / metersInOneGroup - 6);
|
||||
}
|
||||
|
||||
/// Update size of controls
|
||||
flowLayoutPanel.SuspendLayout();
|
||||
///
|
||||
foreach (var oneCtrl in wmRsltsCtrl)
|
||||
{
|
||||
oneCtrl.Width = oneWidth;
|
||||
oneCtrl.Height = oneHeight;
|
||||
}
|
||||
///
|
||||
flowLayoutPanel.ResumeLayout();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Results.Forms
|
||||
{
|
||||
public interface IOneWMResultsCtrl
|
||||
{
|
||||
event EventHandler<WaterMeterEventArgs> WMResultsClickedHandler;
|
||||
|
||||
bool Disabled { get; } /// true when water meter position is disabled
|
||||
int WMPosition { get; } /// 1-based WM position
|
||||
int Width { get; set; } /// Control width
|
||||
int Height { get; set; } /// Control height
|
||||
ListView.ColumnHeaderCollection Columns { get; } /// Embedded ListView control columns
|
||||
|
||||
void Update(int[] columnWidths);
|
||||
void Update(IList<Results.WMeterRsltItemSpec> items);
|
||||
void Update(Results.Entities.WaterMeter wMtr);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
+164
@@ -0,0 +1,164 @@
|
||||
namespace Results.Forms
|
||||
{
|
||||
partial class MoreWMResultsDlg
|
||||
{
|
||||
/// <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.tabControl1 = new System.Windows.Forms.TabControl();
|
||||
this.graphsTabPage = new System.Windows.Forms.TabPage();
|
||||
this.productionTracingTabPage = new System.Windows.Forms.TabPage();
|
||||
this.productionTracingSplitContainer = new System.Windows.Forms.SplitContainer();
|
||||
this.messageLabel = new System.Windows.Forms.Label();
|
||||
this.tracingResultsListView = new System.Windows.Forms.ListView();
|
||||
this.allResultsTabPage = new System.Windows.Forms.TabPage();
|
||||
this.tabControl1.SuspendLayout();
|
||||
this.productionTracingTabPage.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.productionTracingSplitContainer)).BeginInit();
|
||||
this.productionTracingSplitContainer.Panel1.SuspendLayout();
|
||||
this.productionTracingSplitContainer.Panel2.SuspendLayout();
|
||||
this.productionTracingSplitContainer.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tabControl1
|
||||
//
|
||||
this.tabControl1.Controls.Add(this.allResultsTabPage);
|
||||
this.tabControl1.Controls.Add(this.graphsTabPage);
|
||||
this.tabControl1.Controls.Add(this.productionTracingTabPage);
|
||||
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tabControl1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tabControl1.Name = "tabControl1";
|
||||
this.tabControl1.SelectedIndex = 0;
|
||||
this.tabControl1.Size = new System.Drawing.Size(1195, 448);
|
||||
this.tabControl1.TabIndex = 0;
|
||||
//
|
||||
// graphsTabPage
|
||||
//
|
||||
this.graphsTabPage.Location = new System.Drawing.Point(4, 22);
|
||||
this.graphsTabPage.Name = "graphsTabPage";
|
||||
this.graphsTabPage.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.graphsTabPage.Size = new System.Drawing.Size(1187, 422);
|
||||
this.graphsTabPage.TabIndex = 1;
|
||||
this.graphsTabPage.Text = "Graphs";
|
||||
this.graphsTabPage.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// productionTracingTabPage
|
||||
//
|
||||
this.productionTracingTabPage.Controls.Add(this.productionTracingSplitContainer);
|
||||
this.productionTracingTabPage.Location = new System.Drawing.Point(4, 22);
|
||||
this.productionTracingTabPage.Name = "productionTracingTabPage";
|
||||
this.productionTracingTabPage.Size = new System.Drawing.Size(1187, 422);
|
||||
this.productionTracingTabPage.TabIndex = 2;
|
||||
this.productionTracingTabPage.Text = "Production tracing";
|
||||
this.productionTracingTabPage.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// productionTracingSplitContainer
|
||||
//
|
||||
this.productionTracingSplitContainer.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.productionTracingSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.productionTracingSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
|
||||
this.productionTracingSplitContainer.IsSplitterFixed = true;
|
||||
this.productionTracingSplitContainer.Location = new System.Drawing.Point(0, 0);
|
||||
this.productionTracingSplitContainer.Name = "productionTracingSplitContainer";
|
||||
this.productionTracingSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// productionTracingSplitContainer.Panel1
|
||||
//
|
||||
this.productionTracingSplitContainer.Panel1.Controls.Add(this.messageLabel);
|
||||
this.productionTracingSplitContainer.Panel1MinSize = 55;
|
||||
//
|
||||
// productionTracingSplitContainer.Panel2
|
||||
//
|
||||
this.productionTracingSplitContainer.Panel2.Controls.Add(this.tracingResultsListView);
|
||||
this.productionTracingSplitContainer.Panel2MinSize = 60;
|
||||
this.productionTracingSplitContainer.Size = new System.Drawing.Size(1187, 422);
|
||||
this.productionTracingSplitContainer.SplitterDistance = 55;
|
||||
this.productionTracingSplitContainer.SplitterWidth = 1;
|
||||
this.productionTracingSplitContainer.TabIndex = 0;
|
||||
//
|
||||
// messageLabel
|
||||
//
|
||||
this.messageLabel.AutoSize = true;
|
||||
this.messageLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.messageLabel.Location = new System.Drawing.Point(12, 9);
|
||||
this.messageLabel.Name = "messageLabel";
|
||||
this.messageLabel.Size = new System.Drawing.Size(152, 37);
|
||||
this.messageLabel.TabIndex = 1;
|
||||
this.messageLabel.Text = "Message";
|
||||
//
|
||||
// tracingResultsListView
|
||||
//
|
||||
this.tracingResultsListView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tracingResultsListView.GridLines = true;
|
||||
this.tracingResultsListView.Location = new System.Drawing.Point(0, 0);
|
||||
this.tracingResultsListView.Name = "tracingResultsListView";
|
||||
this.tracingResultsListView.Size = new System.Drawing.Size(1187, 366);
|
||||
this.tracingResultsListView.TabIndex = 0;
|
||||
this.tracingResultsListView.UseCompatibleStateImageBehavior = false;
|
||||
this.tracingResultsListView.View = System.Windows.Forms.View.Details;
|
||||
//
|
||||
// allResultsTabPage
|
||||
//
|
||||
this.allResultsTabPage.Location = new System.Drawing.Point(4, 22);
|
||||
this.allResultsTabPage.Name = "allResultsTabPage";
|
||||
this.allResultsTabPage.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.allResultsTabPage.Size = new System.Drawing.Size(1187, 422);
|
||||
this.allResultsTabPage.TabIndex = 0;
|
||||
this.allResultsTabPage.Text = "All results";
|
||||
this.allResultsTabPage.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// MoreWMResultsDlg
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1195, 448);
|
||||
this.Controls.Add(this.tabControl1);
|
||||
this.Name = "MoreWMResultsDlg";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Water meter results";
|
||||
this.tabControl1.ResumeLayout(false);
|
||||
this.productionTracingTabPage.ResumeLayout(false);
|
||||
this.productionTracingSplitContainer.Panel1.ResumeLayout(false);
|
||||
this.productionTracingSplitContainer.Panel1.PerformLayout();
|
||||
this.productionTracingSplitContainer.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.productionTracingSplitContainer)).EndInit();
|
||||
this.productionTracingSplitContainer.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TabControl tabControl1;
|
||||
private OneWMResultsRowsCtrl oneWMResultsCtrl;
|
||||
private System.Windows.Forms.TabPage graphsTabPage;
|
||||
private System.Windows.Forms.TabPage productionTracingTabPage;
|
||||
private System.Windows.Forms.SplitContainer productionTracingSplitContainer;
|
||||
private System.Windows.Forms.Label messageLabel;
|
||||
private System.Windows.Forms.ListView tracingResultsListView;
|
||||
private System.Windows.Forms.TabPage allResultsTabPage;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using TracingDB.Entities;
|
||||
using Results.Resources;
|
||||
using Config.Entities;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms.DataVisualization.Charting;
|
||||
|
||||
namespace Results.Forms
|
||||
{
|
||||
public partial class MoreWMResultsDlg : Form
|
||||
{
|
||||
public MoreWMResultsDlg(Results.Entities.WaterMeter wm, IList<ReferenceRecord> refRecords)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Localize();
|
||||
|
||||
ShowAllResults(wm);
|
||||
ShowChart(wm);
|
||||
|
||||
if (refRecords == null)
|
||||
{
|
||||
tabControl1.SelectTab(1);
|
||||
tabControl1.TabPages.RemoveAt(2);
|
||||
}
|
||||
else
|
||||
{
|
||||
tabControl1.SelectTab(2);
|
||||
ShowTracingResults(wm, refRecords);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Water_meter_results;
|
||||
tabControl1.TabPages[0].Text = Strings.All_results;
|
||||
tabControl1.TabPages[1].Text = Strings.Graphs;
|
||||
tabControl1.TabPages[2].Text = Strings.Production_tracing_results;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Display all results for this water meter in the 1st tab page
|
||||
/// </summary>
|
||||
/// <param name="wMtr">Water meter entity</param>
|
||||
void ShowAllResults(Results.Entities.WaterMeter wMtr)
|
||||
{
|
||||
// string message;
|
||||
// Color commonBackColor = wMtr.GetColorOfResults(false, out message); /// Ony message is used later on
|
||||
//#if ORACLE_DB
|
||||
// oneWMResultsCtrl.Caption = string.Format("{0} ({1}) {2}", (string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr), (wMtr.Pruefindex % 100), message);
|
||||
//#else
|
||||
// oneWMResultsCtrl.Caption = string.Format("s/n = {0}", string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr);
|
||||
//#endif
|
||||
|
||||
// IList<Results.WMeterRsltItemSpec> items = Results.WMeterRsltItemSpec.AllItems;
|
||||
|
||||
// // Header
|
||||
// oneWMResultsCtrl.Columns.Add(wMtr.WMPosition.ToString(), 100);
|
||||
// int i = 1;
|
||||
// foreach (var str in wMtr.GetAllDecoratedTestNames())
|
||||
// {
|
||||
// oneWMResultsCtrl.Columns.Add(str, 100);
|
||||
// i++;
|
||||
// }
|
||||
|
||||
// foreach (var item in items)
|
||||
// {
|
||||
// ListViewItem lvi = new ListViewItem(item.Name);
|
||||
|
||||
// foreach (var mtr in wMtr.MeterTestRslts)
|
||||
// {
|
||||
// if (mtr != null && mtr.IsPilotRslt() && mtr.TestDone && mtr.Publish() != Config.Entities.Publish.Never &&
|
||||
// mtr.Publish() != Config.Entities.Publish.Internal)
|
||||
// {
|
||||
// string str = item.Print(wMtr, mtr.Name());
|
||||
|
||||
// string[] texts = str.Split(new char[] { '|' });
|
||||
// if (texts.Length == 1)
|
||||
// {
|
||||
// lvi.SubItems.Add(str);
|
||||
// }
|
||||
// else if (texts.Length == 2)
|
||||
// {
|
||||
// Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
|
||||
// lvi.UseItemStyleForSubItems = false;
|
||||
// lvi.SubItems.Add(texts[0]);
|
||||
// lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// lvi.SubItems.Add(string.Empty);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// oneWMResultsCtrl.Items.Add(lvi);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
void ShowChart(Results.Entities.WaterMeter wm)
|
||||
{
|
||||
//chart.ChartAreas[0].AxisX.LabelStyle.Format = "dd.MM.yy";
|
||||
//chart.ChartAreas[0].AxisX.Interval = 1;
|
||||
//chart.ChartAreas[0].AxisX.IntervalType = ;
|
||||
|
||||
tabControl1.TabPages[1].Controls.Add(Results.Output.WMChart.GetChart(wm, false));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Display tracing results in the 3rd tab page
|
||||
/// </summary>
|
||||
/// <param name="wm">Water meter entity</param>
|
||||
/// <param name="refRecords">ReferenceRecord-s from tracing DB</param>
|
||||
void ShowTracingResults(Results.Entities.WaterMeter wm, IList<ReferenceRecord> refRecords)
|
||||
{
|
||||
tracingResultsListView.Columns.Add(Strings.Date_and_time, 110);
|
||||
tracingResultsListView.Columns.Add(Strings.Step, 100);
|
||||
tracingResultsListView.Columns.Add(Strings.Workplace, 100);
|
||||
tracingResultsListView.Columns.Add(Strings.Name, 100);
|
||||
tracingResultsListView.Columns.Add(Strings.Result, 70);
|
||||
tracingResultsListView.Columns.Add(Strings.Part, 90);
|
||||
tracingResultsListView.Columns.Add(Strings.Code, 150);
|
||||
tracingResultsListView.Columns.Add(Strings.Workflow, 450);
|
||||
|
||||
if (refRecords == null || refRecords.Count == 0)
|
||||
{
|
||||
messageLabel.Text = "V sledovaní výroby nie sú žiadne záznamy";
|
||||
}
|
||||
else
|
||||
{
|
||||
Process proc = refRecords[0].Process;
|
||||
bool[] isMissing = new bool[proc.Worksteps.Count];
|
||||
for (int i = 0; i < isMissing.Length; i++) isMissing[i] = true;
|
||||
|
||||
foreach (var rr in refRecords)
|
||||
{
|
||||
tracingResultsListView.Items.Add(new ListViewItem(new string[]
|
||||
{
|
||||
rr.TimeStamp.ToString("dd.MM.yyyy HH:mm"),
|
||||
rr.Workstep.Name,
|
||||
rr.Workplace,
|
||||
rr.UserName,
|
||||
rr.Result == 0 ? "OK" : "NOK",
|
||||
rr.Workstep.ReferencePart.Name,
|
||||
rr.Code,
|
||||
rr.Process.Name,
|
||||
}));
|
||||
|
||||
for (int i = 0; i < isMissing.Length; i++)
|
||||
{
|
||||
if (proc.Worksteps[i] == rr.Workstep) isMissing[i] = false;
|
||||
}
|
||||
}
|
||||
|
||||
string missingWorkplace = null;
|
||||
for (int i = 0; i < isMissing.Length; i++)
|
||||
{
|
||||
if (isMissing[i])
|
||||
{
|
||||
if (missingWorkplace == null)
|
||||
{
|
||||
missingWorkplace = proc.Worksteps[i].Name;
|
||||
messageLabel.Text = string.Format("Chýba záznam z pracoviska {0}", missingWorkplace);
|
||||
}
|
||||
else
|
||||
{
|
||||
messageLabel.Text = string.Format("Chýba záznam z pracoviska {0} aj z nasledujúcich pracovísk", missingWorkplace);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (missingWorkplace == null)
|
||||
{
|
||||
messageLabel.Text = "Všetko je OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
namespace Results.Forms
|
||||
{
|
||||
partial class OneWMResultsColumnsCtrl
|
||||
{
|
||||
/// <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.tBox = new System.Windows.Forms.TextBox();
|
||||
this.lView = new System.Windows.Forms.ListView();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
|
||||
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.tBox);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.lView);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(352, 318);
|
||||
this.splitContainer1.SplitterDistance = 25;
|
||||
this.splitContainer1.SplitterWidth = 1;
|
||||
this.splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// tBox
|
||||
//
|
||||
this.tBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tBox.Location = new System.Drawing.Point(0, 0);
|
||||
this.tBox.Name = "tBox";
|
||||
this.tBox.Size = new System.Drawing.Size(352, 20);
|
||||
this.tBox.TabIndex = 0;
|
||||
this.tBox.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.tBox_MouseDoubleClick);
|
||||
//
|
||||
// lView
|
||||
//
|
||||
this.lView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lView.FullRowSelect = true;
|
||||
this.lView.GridLines = true;
|
||||
this.lView.Location = new System.Drawing.Point(0, 0);
|
||||
this.lView.Name = "lView";
|
||||
this.lView.Size = new System.Drawing.Size(352, 292);
|
||||
this.lView.TabIndex = 0;
|
||||
this.lView.UseCompatibleStateImageBehavior = false;
|
||||
this.lView.View = System.Windows.Forms.View.Details;
|
||||
//
|
||||
// OneWMResultsCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.splitContainer1);
|
||||
this.Name = "OneWMResultsCtrl";
|
||||
this.Size = new System.Drawing.Size(352, 318);
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel1.PerformLayout();
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private System.Windows.Forms.TextBox tBox;
|
||||
private System.Windows.Forms.ListView lView;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Results.Forms
|
||||
{
|
||||
public partial class OneWMResultsColumnsCtrl : UserControl, IOneWMResultsCtrl
|
||||
{
|
||||
public event EventHandler<WaterMeterEventArgs> WMResultsClickedHandler;
|
||||
///
|
||||
private void tBox_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (WMResultsClickedHandler != null) WMResultsClickedHandler(sender, new WaterMeterEventArgs(wmPosition));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool disabled;
|
||||
int wmPosition; /// 1-based water meter position
|
||||
string caption;
|
||||
Color bkColor;
|
||||
int[] columnWidths;
|
||||
IList<Results.WMeterRsltItemSpec> items;
|
||||
|
||||
|
||||
public bool Disabled { get { return disabled; } } /// Read only
|
||||
public int WMPosition { get { return wmPosition; } } /// Read only
|
||||
public ListView.ColumnHeaderCollection Columns { get { return lView.Columns; } } /// Read only
|
||||
|
||||
|
||||
public OneWMResultsColumnsCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
disabled = false;
|
||||
wmPosition = 0;
|
||||
tBox.Text = caption = "---";
|
||||
tBox.BackColor = lView.BackColor = bkColor = Color.White;
|
||||
items = new List<Results.WMeterRsltItemSpec>();
|
||||
columnWidths = new int[0];
|
||||
}
|
||||
|
||||
public void Update(int[] columnWidths)
|
||||
{
|
||||
this.columnWidths = columnWidths;
|
||||
|
||||
/// Always update ListView column widths
|
||||
int col = 0;
|
||||
foreach (ColumnHeader column in lView.Columns)
|
||||
{
|
||||
column.Width = (columnWidths != null && columnWidths.Length > col) ? columnWidths[col] : ((col == 0) ? 40 : 70);
|
||||
col++;
|
||||
}
|
||||
}
|
||||
|
||||
public void Update(IList<Results.WMeterRsltItemSpec> items)
|
||||
{
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
public void Update(Results.Entities.WaterMeter wMtr)
|
||||
{
|
||||
if (wMtr == null || wMtr.Disabled)
|
||||
{
|
||||
/// Water meter position is disabled
|
||||
this.disabled = true;
|
||||
lView.Items.Clear();
|
||||
tBox.Text = caption = "---";
|
||||
tBox.BackColor = lView.BackColor = bkColor = Color.White;
|
||||
return;
|
||||
}
|
||||
|
||||
/// Update background color
|
||||
string message = string.Empty;
|
||||
Update(wMtr.GetColorOfResults(false, out message));
|
||||
|
||||
/// Update caption
|
||||
#if ORACLE_DB
|
||||
tBox.Text = caption = string.Format("{0} ({1}) {2}", (string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr), (wMtr.Pruefindex % 100), message);
|
||||
#else
|
||||
tBox.Text = caption = string.Format("s/n = {0}", string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr);
|
||||
#endif
|
||||
|
||||
/// Header
|
||||
lView.Columns.Add(wmPosition.ToString(), (columnWidths != null && columnWidths.Length > 0) ? columnWidths[0] : 40);
|
||||
int col = 1;
|
||||
foreach (var str in wMtr.GetAllDecoratedTestNames())
|
||||
{
|
||||
lView.Columns.Add(str, (columnWidths != null && columnWidths.Length > col) ? columnWidths[col] : 70);
|
||||
col++;
|
||||
}
|
||||
|
||||
lView.Items.Clear();
|
||||
if (items == null || items.Count == 0) return;
|
||||
|
||||
foreach (var item in items)
|
||||
{
|
||||
ListViewItem lvi = new ListViewItem(item.Caption);
|
||||
|
||||
foreach (var mtr in wMtr.MeterTestRslts)
|
||||
{
|
||||
if (mtr != null && mtr.IsPilotRslt() && mtr.TestDone && mtr.Publish() != Config.Entities.Publish.Never &&
|
||||
mtr.Publish() != Config.Entities.Publish.Internal)
|
||||
{
|
||||
string str = item.Print(wMtr, mtr.Name());
|
||||
|
||||
string[] texts = str.Split(new char[] { '|' });
|
||||
if (texts.Length == 1)
|
||||
{
|
||||
lvi.SubItems.Add(str);
|
||||
}
|
||||
else if (texts.Length == 2)
|
||||
{
|
||||
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
|
||||
lvi.UseItemStyleForSubItems = false;
|
||||
lvi.SubItems.Add(texts[0]);
|
||||
lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
|
||||
}
|
||||
else
|
||||
{
|
||||
lvi.SubItems.Add(string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lView.Items.Add(lvi);
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Private
|
||||
///
|
||||
|
||||
void Update(int wmPosition)
|
||||
{
|
||||
this.wmPosition = wmPosition;
|
||||
if (lView.Columns.Count > 0)
|
||||
{
|
||||
lView.Columns[0].Text = wmPosition.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
void Update(Color backColor)
|
||||
{
|
||||
if (this.bkColor != backColor)
|
||||
{
|
||||
tBox.BackColor = lView.BackColor = this.bkColor = backColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
namespace Results.Forms
|
||||
{
|
||||
partial class OneWMResultsRowsCtrl
|
||||
{
|
||||
/// <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.tBox = new System.Windows.Forms.TextBox();
|
||||
this.lView = new System.Windows.Forms.ListView();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
|
||||
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.tBox);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.lView);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(352, 318);
|
||||
this.splitContainer1.SplitterDistance = 25;
|
||||
this.splitContainer1.SplitterWidth = 1;
|
||||
this.splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// tBox
|
||||
//
|
||||
this.tBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tBox.Location = new System.Drawing.Point(0, 0);
|
||||
this.tBox.Name = "tBox";
|
||||
this.tBox.Size = new System.Drawing.Size(352, 20);
|
||||
this.tBox.TabIndex = 0;
|
||||
this.tBox.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.tBox_MouseDoubleClick);
|
||||
//
|
||||
// lView
|
||||
//
|
||||
this.lView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lView.FullRowSelect = true;
|
||||
this.lView.GridLines = true;
|
||||
this.lView.Location = new System.Drawing.Point(0, 0);
|
||||
this.lView.Name = "lView";
|
||||
this.lView.Size = new System.Drawing.Size(352, 292);
|
||||
this.lView.TabIndex = 0;
|
||||
this.lView.UseCompatibleStateImageBehavior = false;
|
||||
this.lView.View = System.Windows.Forms.View.Details;
|
||||
//
|
||||
// OneWMResultsCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.splitContainer1);
|
||||
this.Name = "OneWMResultsCtrl";
|
||||
this.Size = new System.Drawing.Size(352, 318);
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel1.PerformLayout();
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private System.Windows.Forms.TextBox tBox;
|
||||
private System.Windows.Forms.ListView lView;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Results.Forms
|
||||
{
|
||||
public partial class OneWMResultsRowsCtrl : UserControl, IOneWMResultsCtrl
|
||||
{
|
||||
public event EventHandler<WaterMeterEventArgs> WMResultsClickedHandler;
|
||||
///
|
||||
private void tBox_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (WMResultsClickedHandler != null) WMResultsClickedHandler(sender, new WaterMeterEventArgs(wmPosition));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool disabled;
|
||||
int wmPosition; /// 1-based water meter position
|
||||
string caption;
|
||||
Color bkColor;
|
||||
int[] columnWidths;
|
||||
IList<Results.WMeterRsltItemSpec> items;
|
||||
|
||||
|
||||
public bool Disabled { get { return disabled; } } /// Read only
|
||||
public int WMPosition { get { return wmPosition; } } /// Read only
|
||||
public ListView.ColumnHeaderCollection Columns { get { return lView.Columns; } } /// Read only
|
||||
|
||||
|
||||
public OneWMResultsRowsCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
disabled = false;
|
||||
wmPosition = 0;
|
||||
tBox.Text = caption = "---";
|
||||
tBox.BackColor = lView.BackColor = bkColor = Color.White;
|
||||
items = new List<Results.WMeterRsltItemSpec>();
|
||||
columnWidths = new int[0];
|
||||
}
|
||||
|
||||
public void Update(int[] columnWidths)
|
||||
{
|
||||
this.columnWidths = columnWidths;
|
||||
|
||||
/// Always update ListView column widths
|
||||
int col = 0;
|
||||
foreach (ColumnHeader column in lView.Columns)
|
||||
{
|
||||
column.Width = (columnWidths != null && columnWidths.Length > col) ? columnWidths[col] : ((col == 0) ? 40 : 70);
|
||||
col++;
|
||||
}
|
||||
}
|
||||
|
||||
public void Update(IList<Results.WMeterRsltItemSpec> items)
|
||||
{
|
||||
this.items = items;
|
||||
|
||||
/// Always draw ListView header
|
||||
lView.Columns.Clear();
|
||||
lView.Columns.Add(wmPosition.ToString(), (columnWidths != null && columnWidths.Length > 0) ? columnWidths[0] : 40);
|
||||
|
||||
if (items == null || items.Count == 0) return;
|
||||
int col = 1;
|
||||
foreach (var item in items)
|
||||
{
|
||||
lView.Columns.Add(item.Caption, (columnWidths != null && columnWidths.Length > col) ? columnWidths[col] : 70);
|
||||
col++;
|
||||
}
|
||||
}
|
||||
|
||||
public void Update(Results.Entities.WaterMeter wMtr)
|
||||
{
|
||||
if (wMtr == null || wMtr.Disabled)
|
||||
{
|
||||
/// Water meter position is disabled
|
||||
this.disabled = true;
|
||||
lView.Items.Clear();
|
||||
tBox.Text = caption = "---";
|
||||
tBox.BackColor = lView.BackColor = bkColor = Color.White;
|
||||
return;
|
||||
}
|
||||
|
||||
/// Update background color
|
||||
string message = string.Empty;
|
||||
Update(wMtr.GetColorOfResults(false, out message));
|
||||
|
||||
/// Update caption
|
||||
#if ORACLE_DB
|
||||
tBox.Text = caption = string.Format("{0} ({1}) {2}", (string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr), (wMtr.Pruefindex % 100), message);
|
||||
#else
|
||||
tBox.Text = caption = string.Format("s/n = {0}", string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr);
|
||||
#endif
|
||||
|
||||
Update(wMtr.WMPosition);
|
||||
|
||||
/// Update test results
|
||||
IList<string> testNames = wMtr.GetAllDecoratedTestNames();
|
||||
int ix = 0;
|
||||
lView.Items.Clear();
|
||||
foreach (var mtr in wMtr.MeterTestRslts)
|
||||
{
|
||||
if (mtr != null && mtr.IsPilotRslt() && mtr.TestDone && mtr.Publish() != Config.Entities.Publish.Never
|
||||
&& mtr.Publish() != Config.Entities.Publish.Internal)
|
||||
{
|
||||
ListViewItem lvi = new ListViewItem(testNames[ix++]);
|
||||
|
||||
if (items != null)
|
||||
{
|
||||
for (int i = 0; i < items.Count; i++)
|
||||
{
|
||||
string str = items[i].Print(wMtr, mtr.Name());
|
||||
|
||||
/// Extract and use color information
|
||||
string[] texts = str.Split(new char[] { '|' });
|
||||
if (texts.Length == 1)
|
||||
{
|
||||
lvi.SubItems.Add(str);
|
||||
}
|
||||
else if (texts.Length == 2)
|
||||
{
|
||||
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
|
||||
lvi.UseItemStyleForSubItems = false;
|
||||
lvi.SubItems.Add(texts[0]);
|
||||
lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
|
||||
}
|
||||
else
|
||||
{
|
||||
lvi.SubItems.Add(string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lView.Items.Add(lvi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Private
|
||||
///
|
||||
|
||||
void Update(int wmPosition)
|
||||
{
|
||||
this.wmPosition = wmPosition;
|
||||
if (lView.Columns.Count > 0)
|
||||
{
|
||||
lView.Columns[0].Text = wmPosition.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
void Update(Color backColor)
|
||||
{
|
||||
if (this.bkColor != backColor)
|
||||
{
|
||||
tBox.BackColor = lView.BackColor = this.bkColor = backColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
namespace Results.Forms
|
||||
{
|
||||
partial class TracingResultsDlg
|
||||
{
|
||||
/// <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.tracingResultsListView = new System.Windows.Forms.ListView();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tracingResultsListView
|
||||
//
|
||||
this.tracingResultsListView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tracingResultsListView.GridLines = true;
|
||||
this.tracingResultsListView.Location = new System.Drawing.Point(0, 0);
|
||||
this.tracingResultsListView.Name = "tracingResultsListView";
|
||||
this.tracingResultsListView.Size = new System.Drawing.Size(1228, 178);
|
||||
this.tracingResultsListView.TabIndex = 0;
|
||||
this.tracingResultsListView.UseCompatibleStateImageBehavior = false;
|
||||
this.tracingResultsListView.View = System.Windows.Forms.View.Details;
|
||||
//
|
||||
// TracingResultsDlg
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1228, 178);
|
||||
this.Controls.Add(this.tracingResultsListView);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "TracingResultsDlg";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "TracingResultsDlg";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.ListView tracingResultsListView;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using TracingDB.Entities;
|
||||
using Results.Resources;
|
||||
|
||||
namespace Results.Forms
|
||||
{
|
||||
public partial class TracingResultsDlg : Form
|
||||
{
|
||||
public TracingResultsDlg(IList<ReferenceRecord> rRecords)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Text = Strings.Production_tracing_results;
|
||||
|
||||
tracingResultsListView.Columns.Add(Strings.Date_and_time, 110);
|
||||
tracingResultsListView.Columns.Add(Strings.Step, 100);
|
||||
tracingResultsListView.Columns.Add(Strings.Workplace, 100);
|
||||
tracingResultsListView.Columns.Add(Strings.Name, 100);
|
||||
tracingResultsListView.Columns.Add(Strings.Result, 70);
|
||||
tracingResultsListView.Columns.Add(Strings.Part, 90);
|
||||
tracingResultsListView.Columns.Add(Strings.Code, 150);
|
||||
tracingResultsListView.Columns.Add(Strings.Workflow, 450);
|
||||
|
||||
foreach (var rr in rRecords)
|
||||
{
|
||||
tracingResultsListView.Items.Add(new ListViewItem(new string[] {
|
||||
rr.TimeStamp.ToString("dd.MM.yyyy HH:mm"),
|
||||
rr.Workstep.Name,
|
||||
rr.Workplace,
|
||||
rr.UserName,
|
||||
rr.Result == 0 ? "OK" : "NOK",
|
||||
rr.Workstep.ReferencePart.Name,
|
||||
rr.Code,
|
||||
rr.Process.Name,
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
|
||||
namespace Results.Forms
|
||||
{
|
||||
public class WaterMeterEventArgs : EventArgs
|
||||
{
|
||||
public int WMPosition;
|
||||
|
||||
public WaterMeterEventArgs(int wmPosition) { WMPosition = wmPosition; }
|
||||
}
|
||||
}
|
||||
+137
-71
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2016-2017 Sensus Metering Systems
|
||||
/// Copyright (c) 2016-2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Results
|
||||
Pulse__liter, /// 61 Water meter constant (pulses per liter) specific for one test
|
||||
Reference_pulses_ni, /// 62 Reference pulses gated for specific meter (synchro method)
|
||||
Reference_energy, /// 63
|
||||
Test_bench_ID, /// 64
|
||||
Bench_ID, /// 64 Test bench ID (int) obtained from a component implementing IBenchInfo
|
||||
Program_version, /// 65
|
||||
User_name, /// 66
|
||||
User_nr, /// 67
|
||||
@@ -91,85 +91,85 @@ namespace Results
|
||||
T_Lo_start, /// 81
|
||||
T_Lo_end, /// 82
|
||||
T_Lo_avg, /// 83
|
||||
P_delta_mean, /// 84
|
||||
P_delta_start, /// 85
|
||||
P_delta_end, /// 86
|
||||
Meter_type, /// 87 Single, Compound or HeatMeter
|
||||
Volume_main, /// 88
|
||||
Volume_aux, /// 89
|
||||
Start_volume, /// 90
|
||||
Start_volume_main, /// 91
|
||||
Start_volume_aux, /// 92
|
||||
End_volume, /// 93
|
||||
End_volume_main, /// 94
|
||||
End_volume_aux, /// 95
|
||||
Error_main, /// 96
|
||||
Error_aux, /// 97
|
||||
Serial_Nr_main, /// 98
|
||||
Serial_Nr_aux, /// 99
|
||||
End_state_main, /// 100
|
||||
End_state_aux, /// 101
|
||||
Q_rise, /// 102
|
||||
Q_fall, /// 103
|
||||
P_delta_mean, /// 84
|
||||
P_delta_start, /// 85
|
||||
P_delta_end, /// 86
|
||||
Meter_type, /// 87 Single, Compound or HeatMeter
|
||||
Volume_main, /// 88
|
||||
Volume_aux, /// 89
|
||||
Start_volume, /// 90
|
||||
Start_volume_main, /// 91
|
||||
Start_volume_aux, /// 92
|
||||
End_volume, /// 93
|
||||
End_volume_main, /// 94
|
||||
End_volume_aux, /// 95
|
||||
Error_main, /// 96
|
||||
Error_aux, /// 97
|
||||
Serial_Nr_main, /// 98
|
||||
Serial_Nr_aux, /// 99
|
||||
End_state_main, /// 100
|
||||
End_state_aux, /// 101
|
||||
Q_rise, /// 102
|
||||
Q_fall, /// 103
|
||||
|
||||
/// iPerl
|
||||
/// iPerl
|
||||
OrigCalibFactor, /// 104
|
||||
CalibFactor, /// 105
|
||||
Q2ErrWOCorrection, /// 106
|
||||
Q2CorrectionDone, /// 107
|
||||
CalibFactor, /// 105
|
||||
Q2ErrWOCorrection, /// 106
|
||||
Q2CorrectionDone, /// 107
|
||||
Q2CorrRFlow, /// 108
|
||||
Q2CorrLFlow, /// 109
|
||||
Q2CorrFlowRight, /// 110
|
||||
|
||||
Q_ref_mean, /// 111
|
||||
T_up_start, /// 112
|
||||
T_up_end, /// 113
|
||||
T_up_avg, /// 114
|
||||
T_down_start, /// 115
|
||||
T_down_end, /// 116
|
||||
T_down_avg, /// 117
|
||||
T_div_start, /// 118
|
||||
T_div_end, /// 119
|
||||
T_div_avg, /// 120
|
||||
P_up_avg, /// 121
|
||||
P_down_avg, /// 122
|
||||
P_delta_avg, /// 123
|
||||
|
||||
TestDone, /// 124
|
||||
TestPassed, /// 125
|
||||
Q_ref_mean, /// 111
|
||||
T_up_start, /// 112
|
||||
T_up_end, /// 113
|
||||
T_up_avg, /// 114
|
||||
T_down_start, /// 115
|
||||
T_down_end, /// 116
|
||||
T_down_avg, /// 117
|
||||
T_div_start, /// 118
|
||||
T_div_end, /// 119
|
||||
T_div_avg, /// 120
|
||||
P_up_avg, /// 121
|
||||
P_down_avg, /// 122
|
||||
P_delta_avg, /// 123
|
||||
|
||||
TestDone, /// 124
|
||||
TestPassed, /// 125
|
||||
|
||||
/// iPerl
|
||||
FW_Version, /// 126
|
||||
|
||||
Mass_start_raw, /// 127
|
||||
Mass_start, /// 128
|
||||
Mass_end_raw, /// 129
|
||||
Mass_end, /// 130
|
||||
Mass, /// 131
|
||||
Buoyancy, /// 132
|
||||
Density_correction, /// 133
|
||||
Mass_start_raw, /// 127
|
||||
Mass_start, /// 128
|
||||
Mass_end_raw, /// 129
|
||||
Mass_end, /// 130
|
||||
Mass, /// 131
|
||||
Buoyancy, /// 132
|
||||
Density_correction, /// 133
|
||||
|
||||
ErrorFlags, /// 134
|
||||
E1, /// 135
|
||||
E2, /// 136
|
||||
E3, /// 137
|
||||
E4, /// 138
|
||||
E5, /// 139
|
||||
E6, /// 140
|
||||
E7, /// 141
|
||||
E8, /// 142
|
||||
E9, /// 143
|
||||
E10, /// 144
|
||||
E11, /// 145
|
||||
E12, /// 146
|
||||
E13, /// 147
|
||||
E14, /// 148
|
||||
E15, /// 149
|
||||
E16, /// 150
|
||||
ErrorFlags, /// 134
|
||||
E1, /// 135
|
||||
E2, /// 136
|
||||
E3, /// 137
|
||||
E4, /// 138
|
||||
E5, /// 139
|
||||
E6, /// 140
|
||||
E7, /// 141
|
||||
E8, /// 142
|
||||
E9, /// 143
|
||||
E10, /// 144
|
||||
E11, /// 145
|
||||
E12, /// 146
|
||||
E13, /// 147
|
||||
E14, /// 148
|
||||
E15, /// 149
|
||||
E16, /// 150
|
||||
|
||||
Table_row_nr, /// 151
|
||||
Table_column_nr, /// 152
|
||||
WMRemark, /// 153
|
||||
Table_row_nr, /// 151
|
||||
Table_column_nr, /// 152
|
||||
WMRemark, /// 153
|
||||
|
||||
User_description, /// 154
|
||||
Legalizator, /// 155
|
||||
@@ -181,7 +181,7 @@ namespace Results
|
||||
Diverter_start_time, /// 159
|
||||
Diverter_end_time, /// 160
|
||||
Q_sensitivity, /// 161
|
||||
|
||||
|
||||
Q_ref_min, /// 162
|
||||
Q_ref_max, /// 163
|
||||
Q_ref_start, /// 164
|
||||
@@ -210,7 +210,7 @@ namespace Results
|
||||
Rho_Wa_calc, /// 183
|
||||
|
||||
Formatted_WM_ID, /// 184, Formated WM ID string:
|
||||
/// {0}=start DateTime {1}-end DateTime, {2}=batch nr., {3}=wm pos.(1..max), {4}=s/n string
|
||||
/// {0}=start DateTime {1}-end DateTime, {2}=batch nr., {3}=wm pos.(1..max), {4}=s/n string
|
||||
E21, /// 185
|
||||
|
||||
T_line_mean, /// 186
|
||||
@@ -251,6 +251,72 @@ namespace Results
|
||||
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
|
||||
|
||||
/// iPerl special
|
||||
Prod_AssignedSerialNr, /// 234
|
||||
Prod_CompleteSerialNr, /// 235
|
||||
Prod_RadioAddress, /// 236
|
||||
Prod_PaletteNr, /// 237
|
||||
Prod_UmkartonNr, /// 238
|
||||
Prod_TestBench, /// 239
|
||||
Prod_WMPosition, /// 240
|
||||
Prod_UserName, /// 241
|
||||
Prod_PurchaseOrder, /// 242
|
||||
Prod_Passed, /// 243
|
||||
Prod_ResultCode, /// 244
|
||||
Prod_Q2CorrRL, /// 245
|
||||
Prod_Q2CorrLR, /// 246
|
||||
|
||||
TestPartStr, /// 247
|
||||
|
||||
Error_heat_mtr_vol, /// 248
|
||||
Energy_start, /// 249
|
||||
Energy_end, /// 250
|
||||
|
||||
OraWMTypeID, /// 251
|
||||
OraWMTypeRev, /// 252
|
||||
|
||||
E25, /// 253
|
||||
E26, /// 254
|
||||
E27, /// 255
|
||||
E28, /// 256
|
||||
|
||||
RefFlowmeter, /// 257
|
||||
Test_Method_Elde, /// 258
|
||||
|
||||
Counter1, /// 259 counterIdx0 = 0
|
||||
Counter2, /// 260 counterIdx0 = 1
|
||||
Counter3, /// 261 counterIdx0 = 2
|
||||
Counter4, /// 262 counterIdx0 = 3
|
||||
Counter5, /// 263 counterIdx0 = 4
|
||||
Counter6, /// 264 counterIdx0 = 5
|
||||
Counter7, /// 265 counterIdx0 = 6
|
||||
Counter8, /// 266 counterIdx0 = 7
|
||||
Counter9, /// 267 counterIdx0 = 8
|
||||
Counter10, /// 268 counterIdx0 = 9
|
||||
|
||||
ConstMasterCorr, /// 269
|
||||
TimeBtwnMassMsrmnts, /// 270
|
||||
TestTimeCorrection, /// 271
|
||||
|
||||
Count,
|
||||
}
|
||||
|
||||
@@ -25,8 +25,10 @@ namespace Results.Mappings
|
||||
Map(x => x.Error);
|
||||
Map(x => x.TestDone);
|
||||
Map(x => x.Passed);
|
||||
|
||||
References(x => x.WaterMeter);
|
||||
#if ORACLE_DB
|
||||
Map(x => x.LastError);
|
||||
#endif
|
||||
References(x => x.WaterMeter);
|
||||
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 Results.Entities;
|
||||
|
||||
@@ -54,7 +54,6 @@ namespace Results.Mappings
|
||||
#endif
|
||||
#if ORACLE_DB
|
||||
Map(x => x.WMTypeId);
|
||||
Map(x => x.WMTypeRev);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,21 +28,39 @@ namespace Results.Mappings
|
||||
.CustomType("StringClob")
|
||||
.CustomSqlType("varchar(2000)");
|
||||
#if IPERL
|
||||
Map(x => x.SerialNrEx);
|
||||
Map(x => x.OrigCalibFactor);
|
||||
Map(x => x.CalibFactor);
|
||||
Map(x => x.Q2ErrWOCorrection);
|
||||
Map(x => x.Q2CorrectionDone);
|
||||
Map(x => x.Q2Correction);
|
||||
Map(x => x.Q2CorrRFlow);
|
||||
Map(x => x.Q2CorrLFlow);
|
||||
Map(x => x.OrigCalibFactorLNA);
|
||||
Map(x => x.CalibFactorLNA);
|
||||
Map(x => x.Q2ErrWOCorrection);
|
||||
Map(x => x.Q2CorrRL);
|
||||
Map(x => x.Q2CorrLR);
|
||||
Map(x => x.Q2CorrFlowRight);
|
||||
Map(x => x.Diff2Hz8Hz);
|
||||
Map(x => x.Hz2CorrectionDone);
|
||||
Map(x => x.Hz2Correction);
|
||||
Map(x => x.FWVersion);
|
||||
#endif
|
||||
References(x => x.WaterMeterData);
|
||||
#if TURA_SPECIAL
|
||||
Map(x => x.AssignedSerialNr);
|
||||
Map(x => x.CompleteSerialNr);
|
||||
Map(x => x.RadioAddress);
|
||||
Map(x => x.PaletteNr);
|
||||
Map(x => x.UmkartonNr);
|
||||
Map(x => x.ProdTestBench);
|
||||
Map(x => x.ProdWMPosition);
|
||||
Map(x => x.ProdUserName);
|
||||
Map(x => x.ProdPurchaseOrder);
|
||||
Map(x => x.ProdPassed);
|
||||
Map(x => x.ProdResultCode);
|
||||
Map(x => x.ProdQ2CorrRL);
|
||||
Map(x => x.ProdQ2CorrLR);
|
||||
#endif
|
||||
#if ORACLE_DB
|
||||
Map(x => x.Pruefindex);
|
||||
Map(x => x.HydrPruefung);
|
||||
#endif
|
||||
References(x => x.WaterMeterData);
|
||||
References(x => x.Batch);
|
||||
HasMany(x => x.MeterTestRslts)
|
||||
.Cascade.All();
|
||||
|
||||
@@ -185,7 +185,7 @@ namespace Results.Output.Printers.Enhanced
|
||||
|
||||
Table table0 = Table.Create_TestsAreRows(batch.WaterMeters[0], testItems, style);
|
||||
SizeF tableSize = table0.Measure(e);
|
||||
int wmSectionHeight = (int)tableSize.Height + 3 * SpacingOne4Header;
|
||||
int wmSectionHeight = (int)tableSize.Height + SpacingOne4Header * ((tableSize.Height > 0) ? 3 : 2);
|
||||
|
||||
nrWMsOnFirstPage = (printHeight - BodyTop + TitleY - 2 * SpacingOne) / wmSectionHeight;
|
||||
nrWMsOnNextPage = (printHeight - 2 * SpacingOne) / wmSectionHeight;
|
||||
@@ -239,7 +239,10 @@ namespace Results.Output.Printers.Enhanced
|
||||
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 = (int)PrintWM(e, batch.WaterMeters[wmNr], wmPosition, nextWmTop) + SpacingOneAndHalf4Header;
|
||||
if (!cfg.GoodOnly || batch.WaterMeters[wmNr].Passed)
|
||||
{
|
||||
nextWmTop = (int)PrintWM(e, batch.WaterMeters[wmNr], wmPosition, nextWmTop) + SpacingOneAndHalf4Header;
|
||||
}
|
||||
}
|
||||
|
||||
nextWMNr += nrWMsOnPage;
|
||||
@@ -265,7 +268,7 @@ namespace Results.Output.Printers.Enhanced
|
||||
/// <param name="top">Top coordinate of watermeter data</param>
|
||||
/// <returns>The height of the printed section</returns>
|
||||
float PrintWM(System.Drawing.Printing.PrintPageEventArgs e,
|
||||
Results.Entities.WaterMeter wm, int printedWMNr, int top)
|
||||
Results.Entities.WaterMeter wm, int printedWMNr, int top)
|
||||
{
|
||||
/// Print the water meter number and the serial number
|
||||
string wmText = string.Format("{0} {1}", Strings.Water_Meter, printedWMNr);
|
||||
@@ -278,7 +281,14 @@ namespace Results.Output.Printers.Enhanced
|
||||
|
||||
Table table = Table.Create_TestsAreRows(wm, testItems, style);
|
||||
|
||||
return table.Draw(e, leftMargin, top + SpacingOneAndHalf4Header);
|
||||
if (table.IsEmpty())
|
||||
{
|
||||
return top;
|
||||
}
|
||||
else
|
||||
{
|
||||
return table.Draw(e, leftMargin, top + SpacingOneAndHalf4Header);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
///
|
||||
/// Copyright (c) 2018 Sensus Slovensko a.s.
|
||||
///
|
||||
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.Label
|
||||
{
|
||||
public class LabelPrintDocument : PrintersCommon
|
||||
{
|
||||
/// Size of the printed area without margins, after taking into account 'pageOrientation'
|
||||
readonly int printHeight;
|
||||
readonly int printWidth;
|
||||
|
||||
/// Selected font
|
||||
readonly Font font;
|
||||
|
||||
/// Data to print
|
||||
Results.Entities.Batch batch;
|
||||
LabelPrinterCfg cfg;
|
||||
Results.Entities.WaterMeter wm;
|
||||
|
||||
/// Items to print
|
||||
IList<WMeterRsltItemSpec> itemsToPrint;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="textToPrint">Text to be printed</param>
|
||||
public LabelPrintDocument(Results.Entities.Batch batch, LabelPrinterCfg cfg, Results.Entities.WaterMeter wm, string documentName)
|
||||
{
|
||||
DocumentName = documentName;
|
||||
|
||||
this.batch = batch;
|
||||
this.cfg = cfg;
|
||||
this.wm = wm;
|
||||
this.itemsToPrint = Results.WMeterRsltItemSpec.FromStrArray(cfg.ItemsToPrint);
|
||||
|
||||
/// Initialize fonts
|
||||
font = new Font((cfg.FontFamily != null ? cfg.FontFamily : "Arial"),
|
||||
(cfg.FontSize > 0 ? cfg.FontSize : 10),
|
||||
(FontStyle)cfg.FontStyle);
|
||||
|
||||
/// Set print area size and margins (in dots using 100 dpi)
|
||||
DefaultPageSettings.Landscape = (cfg.PageOrientation == PageOrientation.Landscape);
|
||||
///
|
||||
printHeight = cfg.PaperHeight;
|
||||
printWidth = cfg.PaperWidth;
|
||||
}
|
||||
|
||||
/// <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);
|
||||
}
|
||||
|
||||
/// <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);
|
||||
|
||||
if (!string.IsNullOrEmpty(cfg.Template))
|
||||
{
|
||||
string templatePath = Path.Combine("C:\\TBF\\Templates\\", cfg.Template);
|
||||
if (File.Exists(templatePath))
|
||||
{
|
||||
e.Graphics.DrawImage(new Bitmap(Image.FromFile(templatePath), printWidth, printHeight), new Rectangle(0, 0, printWidth, printHeight));
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var item in itemsToPrint)
|
||||
{
|
||||
string[] coords = item.Caption.Split(new char[] { ';' });
|
||||
int x, y;
|
||||
if (coords.Length >= 2 && int.TryParse(coords[0].Trim(new char[] { ' ' }), out x)
|
||||
&& int.TryParse(coords[1].Trim(new char[] { ' ' }), out y))
|
||||
{
|
||||
RectangleF printArea = new RectangleF(x, y, printWidth, printHeight);
|
||||
e.Graphics.DrawString(item.Print(wm), this.font, Brushes.Black, printArea);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
///
|
||||
/// Copyright (c) 2018 Sensus Slovensko a.s.
|
||||
///
|
||||
|
||||
namespace Results.Output.Printers.Label
|
||||
{
|
||||
public class LabelPrinterCfg
|
||||
{
|
||||
public string Template; /// Full path to a 'png' file
|
||||
public Config.Entities.PageOrientation PageOrientation;
|
||||
public int PaperWidth; /// In 0,254 mm = 1/100 in = 100dpi pixels count
|
||||
public int PaperHeight; /// In 0,254 mm = 1/100 in = 100dpi pixels count
|
||||
public string[] ItemsToPrint;
|
||||
public string FontFamily;
|
||||
public int FontSize;
|
||||
public int FontStyle;
|
||||
public System.Globalization.CultureInfo CultureInfo;
|
||||
public bool GoodOnly;
|
||||
public bool SupressPrinting; /// true = Bypass printing
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
///
|
||||
/// Copyright (c) 2016-2017 Sensus Metering Systems
|
||||
/// Copyright (c) 2016-2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Printing;
|
||||
using Config.Entities;
|
||||
using System.IO;
|
||||
using Results.Resources;
|
||||
|
||||
namespace Results.Output.Printers.Munich
|
||||
{
|
||||
@@ -38,11 +40,16 @@ namespace Results.Output.Printers.Munich
|
||||
readonly int resultsCount;
|
||||
readonly bool compound; /// true when MetersKind is MetersKind.Combined
|
||||
|
||||
/// Top coordinate of the table
|
||||
int nrPages;
|
||||
int pageNr;
|
||||
int firstTblTop;
|
||||
int secondTblTop;
|
||||
|
||||
int pageNr; /// Current page number
|
||||
int nrPages; /// Total number of pages
|
||||
float tableTop; /// Top coordinate of the table
|
||||
|
||||
int[] firstTblRowsOnPage;
|
||||
int[] secondTblRowsOnPage;
|
||||
|
||||
|
||||
PageOrientation pageOrientation;
|
||||
|
||||
/// <summary>
|
||||
/// Property variable for the Font the user wishes to use
|
||||
@@ -51,7 +58,34 @@ namespace Results.Output.Printers.Munich
|
||||
Font boldFont;
|
||||
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
|
||||
/// </summary>
|
||||
/// <param name="textToPrint">Text to be printed</param>
|
||||
@@ -61,7 +95,8 @@ namespace Results.Output.Printers.Munich
|
||||
{
|
||||
this.docVersion = docVersion;
|
||||
this.wm = wm;
|
||||
compound = wm.Compound();
|
||||
this.compound = wm.Compound();
|
||||
this.pageOrientation = pageOrientation;
|
||||
|
||||
string[] info = wm.ProductName().Split(new char[] { ';' });
|
||||
if (info.Length >= 2)
|
||||
@@ -81,13 +116,88 @@ namespace Results.Output.Printers.Munich
|
||||
}
|
||||
|
||||
results = wm.MeterTestRslts;
|
||||
this.resultsCount = compound ? (results.Count / 3) : results.Count;
|
||||
|
||||
int resultsCount = wm.MeterTestRslts.Count;
|
||||
if (compound) resultsCount /= 3;
|
||||
resultsCount = 0;
|
||||
foreach (var mtr in wm.MeterTestRslts)
|
||||
{
|
||||
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always) resultsCount++;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -116,8 +226,30 @@ namespace Results.Output.Printers.Munich
|
||||
/// Run base code
|
||||
base.OnPrintPage(e);
|
||||
|
||||
/// Draw 2550 x 3507 'headpic' scaled to A4 at 100 DPI
|
||||
e.Graphics.DrawImage(Results.Properties.Resources.Headpic, new Rectangle(0, 0, 827, 1137));
|
||||
if (pageOrientation == PageOrientation.Portrait)
|
||||
{
|
||||
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)
|
||||
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)
|
||||
{
|
||||
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);
|
||||
|
||||
///
|
||||
/// 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);
|
||||
DrawCommonTop(e, ref lineNr, wm, pruefvorlage, docVersion);
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -189,228 +315,294 @@ namespace Results.Output.Printers.Munich
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Seriennummer :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.SerialNrAux);
|
||||
}
|
||||
lineNr++;
|
||||
lineNr += ((resultsCount + 2) * SpacingOneAndHalf) / SpacingOne + 2;
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
lineNr += 2;
|
||||
firstTblTop = SpacingOne * lineNr;
|
||||
|
||||
///
|
||||
/// Table 1
|
||||
///
|
||||
PrintTableOne(e, firstTblTop);
|
||||
DrawTableFrame(e, resultsCount + 1, firstTblTop);
|
||||
tableTop = TitleY + (compound ? 5 : 4) * SpacingOne;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Hauptzahler");
|
||||
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Nebenzahler");
|
||||
lineNr++;
|
||||
}
|
||||
if (secondTblRowsOnPage[pageNr - 1] > 0)
|
||||
{
|
||||
int from = 0;
|
||||
for (int pN = 0; pN < pageNr - 1; pN++) from += secondTblRowsOnPage[pN];
|
||||
Table table2 = PrepareTableTwo(from, from + secondTblRowsOnPage[pageNr - 1] - 1);
|
||||
tableTop = table2.Draw(e, Tab1, tableTop) + SpacingOneAndHalf;
|
||||
}
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Hersteller :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Producer());
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Hersteller :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.ProducerAux());
|
||||
}
|
||||
lineNr++;
|
||||
if (pageNr == nrPages)
|
||||
{
|
||||
int top = topMargin + printHeight - 8 * SpacingOne;
|
||||
DrawCommonBottom(e, top, wm);
|
||||
}
|
||||
else
|
||||
{
|
||||
e.HasMorePages = true;
|
||||
}
|
||||
|
||||
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 += ((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++;
|
||||
}
|
||||
///
|
||||
/// Draw a footer and increment the page number
|
||||
///
|
||||
string pageNrText = string.Format("{0} {1}/{2}", Strings.Page, pageNr++, nrPages);
|
||||
int pageNrWidth = (int)e.Graphics.MeasureString(pageNrText, font).Width;
|
||||
PrintAt(e, leftMargin + (printWidth - pageNrWidth) / 2, topMargin + printHeight - SpacingOne, pageNrText);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print table texts.
|
||||
/// Prepares content and style of the first table.
|
||||
/// </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");
|
||||
PrintAt(e, GetTabItemPos(0, 1, tblTop), "Q [l/h]");
|
||||
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");
|
||||
Table table = new Table(7);
|
||||
table.Style = tableStyle;
|
||||
|
||||
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)
|
||||
{
|
||||
if (!compound || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
|
||||
{
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 0, tblTop), mtr.Name());
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 1, tblTop), mtr.TestRslt.FlowMass.ToString("F1"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 2, tblTop), mtr.TestRslt.VolumeCTV.ToString("F2"));
|
||||
if (compound)
|
||||
{
|
||||
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
|
||||
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
|
||||
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
|
||||
{
|
||||
if (from <= rowCount && rowCount <= to)
|
||||
{
|
||||
double flow_ctv = (mtr.TestRslt.TestTime != 0) ? (3.6 * mtr.TestRslt.VolumeCTV / mtr.TestRslt.TestTime) : 0;
|
||||
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 3, tblTop), mainMtr.VolumeMeter.ToString("F2"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 4, tblTop), auxMtr.VolumeMeter.ToString("F2"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 5, tblTop), mtr.Error.ToString("F2"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 6, tblTop), mtr.Passed ? "iO" : "NiO");
|
||||
}
|
||||
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");
|
||||
}
|
||||
if (compound)
|
||||
{
|
||||
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
|
||||
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
|
||||
|
||||
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]");
|
||||
PrintAt(e, GetTabItemPos(0, 2, tblTop), "Temperatur");
|
||||
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.");
|
||||
Table table = new Table(7);
|
||||
table.Style = tableStyle;
|
||||
|
||||
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)
|
||||
{
|
||||
if (!compound || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
|
||||
{
|
||||
Point p = GetTabItemPos(rowCnt, 0, tblTop);
|
||||
PrintAt(e, p.X, p.Y, mtr.Name());
|
||||
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
|
||||
{
|
||||
if (from <= rowCount && rowCount <= to)
|
||||
{
|
||||
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"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 2, tblTop), mtr.TestRslt.TempDownMean.ToString("F2"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 3, tblTop), mtr.TestRslt.DensityDiv.ToString("F2"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 4, tblTop), mtr.TestTime.ToString("F1"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 5, tblTop), Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressUpMean).ToString("F3"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 6, tblTop), Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressDownMean).ToString("F3"));
|
||||
|
||||
rowCnt++;
|
||||
}
|
||||
table.AddRow(new string[] { mtr.Name(),
|
||||
Config.Units.ConvertTo(Config.Unit.lph, flow_ctv).ToString("F1"),
|
||||
mtr.TestRslt.TempDownMean.ToString("F2"),
|
||||
mtr.TestRslt.DensityDiv.ToString("F2"),
|
||||
mtr.TestTime.ToString("F1"),
|
||||
Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressUpMean).ToString("F3"),
|
||||
Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressDownMean).ToString("F3") },
|
||||
horizontalAlignment,
|
||||
verticalAlignment);
|
||||
}
|
||||
rowCount++;
|
||||
}
|
||||
}
|
||||
|
||||
return table;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draw table lines.
|
||||
/// </summary>
|
||||
void DrawTableFrame(System.Drawing.Printing.PrintPageEventArgs e, int rowsCount, int tblTop)
|
||||
{
|
||||
int t = tblTop;
|
||||
int m = tblTop + SpacingOneAndHalf;
|
||||
int b = tblTop + rowsCount * SpacingOneAndHalf;
|
||||
/// <summary>
|
||||
/// Prints text on the top of the first page (title, common information).
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
/// <param name="lineNr"></param>
|
||||
/// <param name="wm"></param>
|
||||
/// <param name="pruefvorlage"></param>
|
||||
/// <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
|
||||
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));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, b), new Point(747, b));
|
||||
if (compound)
|
||||
{
|
||||
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Hauptzahler");
|
||||
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Nebenzahler");
|
||||
lineNr++;
|
||||
}
|
||||
|
||||
// Vertical lines
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point( 80, t), new Point( 80, b));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(267, t), new Point(267, b));
|
||||
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));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(507, t), new Point(507, b));
|
||||
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));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(747, t), new Point(747, b));
|
||||
}
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Hersteller :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Producer());
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Hersteller :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.ProducerAux());
|
||||
}
|
||||
lineNr++;
|
||||
|
||||
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)
|
||||
@@ -434,18 +626,5 @@ namespace Results.Output.Printers.Munich
|
||||
RectangleF printArea = new RectangleF(x, y, 667, SpacingOne);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,6 +152,12 @@ namespace Results.Output.Printers.OnePerMeter
|
||||
}
|
||||
}
|
||||
|
||||
if ((cfg.GraphHgh != 0) && (cfg.GraphWid != 0))
|
||||
{
|
||||
Rectangle pos = new Rectangle(cfg.GraphLeft, cfg.GraphTop, cfg.GraphWid, cfg.GraphHgh);
|
||||
WMChart.GetChart(wm, true).Printing.PrintPaint(e.Graphics, pos);
|
||||
}
|
||||
|
||||
float tableTop = cfg.TopMargin;
|
||||
|
||||
if (pageNr == 1)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2017-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
|
||||
namespace Results.Output.Printers.OnePerMeter
|
||||
@@ -45,10 +45,14 @@ namespace Results.Output.Printers.OnePerMeter
|
||||
public string[] BelowItems3;
|
||||
public string Footer;
|
||||
public bool TestsAreRows;
|
||||
public string ImgFullPathName;
|
||||
public int GraphLeft;
|
||||
public int GraphTop;
|
||||
public int GraphWid;
|
||||
public int GraphHgh;
|
||||
public int ImgLeft;
|
||||
public int ImgTop;
|
||||
public int ImgWid;
|
||||
public int ImgHgh;
|
||||
public string ImgFullPathName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
using System;
|
||||
///
|
||||
/// Copyright (c) 2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Printing;
|
||||
using Config.Entities;
|
||||
|
||||
namespace Results.Output.Printers
|
||||
namespace Results.Output
|
||||
{
|
||||
public enum TableLines
|
||||
{
|
||||
@@ -25,6 +28,7 @@ namespace Results.Output.Printers
|
||||
public float LineWidth;
|
||||
public TableLines HorizLines;
|
||||
public TableLines VertLines;
|
||||
public float[] ColumnWidths; /// null = automatic
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
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[] rowHeight = new float[RowsCount];
|
||||
@@ -79,7 +94,7 @@ namespace Results.Output.Printers
|
||||
else
|
||||
{
|
||||
bool isHeader = (colIx < Style.LeftHeadersCount) || (rowIx < Style.TopHeadersCount);
|
||||
SizeF size = PrintersCommon.Measure(e, Rows[rowIx][colIx], isHeader ? Style.HeaderFont : Style.Font);
|
||||
SizeF size = Printers.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;
|
||||
}
|
||||
@@ -117,10 +132,10 @@ namespace Results.Output.Printers
|
||||
|
||||
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;
|
||||
|
||||
|
||||
float[] columnWidth = new float[tblColumnsCount];
|
||||
float[] columnPos = new float[tblColumnsCount];
|
||||
float[] vertLinePos = new float[tblColumnsCount + 1];
|
||||
@@ -142,7 +157,11 @@ namespace Results.Output.Printers
|
||||
{
|
||||
/// In not a separator line
|
||||
bool isHeader = (colIx < Style.LeftHeadersCount) || (rowIx < Style.TopHeadersCount);
|
||||
SizeF size = PrintersCommon.Measure(e, Rows[rowIx][colIx], isHeader ? Style.HeaderFont : Style.Font);
|
||||
SizeF size = Printers.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;
|
||||
}
|
||||
@@ -225,14 +244,14 @@ namespace Results.Output.Printers
|
||||
for (int colIndex = 0; colIndex < tblColumnsCount; colIndex++)
|
||||
{
|
||||
bool isHeader = (colIndex < Style.LeftHeadersCount) || (rowIndex < Style.TopHeadersCount);
|
||||
PrintersCommon.PrintAt(e, oneTableRow[colIndex],
|
||||
isHeader ? Style.HeaderFont : Style.Font,
|
||||
columnPos[colIndex],
|
||||
rowPos[rowIndex],
|
||||
columnWidth[colIndex],
|
||||
rowHeight[rowIndex],
|
||||
horizAlignment[colIndex],
|
||||
vertAlignment[colIndex]);
|
||||
Printers.PrintersCommon.PrintAt(e, oneTableRow[colIndex],
|
||||
isHeader ? Style.HeaderFont : Style.Font,
|
||||
columnPos[colIndex],
|
||||
rowPos[rowIndex],
|
||||
columnWidth[colIndex],
|
||||
rowHeight[rowIndex],
|
||||
horizAlignment[colIndex],
|
||||
vertAlignment[colIndex]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms.DataVisualization.Charting;
|
||||
using Config.Entities;
|
||||
using Results.Entities;
|
||||
using Results.Resources;
|
||||
|
||||
namespace Results.Output
|
||||
{
|
||||
public class WMChart
|
||||
{
|
||||
public static Chart GetChart(WaterMeter wm, bool isPrinter)
|
||||
{
|
||||
return GetChart(wm, isPrinter, Config.Unit.lph);
|
||||
}
|
||||
|
||||
public static Chart GetChart(WaterMeter wm, bool isPrinter, Config.Unit flowUnit)
|
||||
{
|
||||
double maxFlow_m3h = 0;
|
||||
IList<PointF> unsortedPoints = new List<PointF>();
|
||||
foreach (var mtr in wm.MeterTestRslts)
|
||||
{
|
||||
if (mtr.IsPilotRslt() && mtr.TestRslt.TestData.Evaluate && (mtr.TestRslt.TestTime > 0) && (mtr.TestRslt.PulsesMaster > 0))
|
||||
{
|
||||
double flow_m3h = mtr.TestRslt.FlowMean;
|
||||
// = (mtr.TestTime != 0)
|
||||
//? (3.6 * mtr.TestRslt.VolumeCTV / mtr.TestTime * mtr.PulsesMaster / mtr.TestRslt.PulsesMaster)
|
||||
//: (3.6 * mtr.TestRslt.VolumeCTV / mtr.TestRslt.TestTime);
|
||||
|
||||
if (flow_m3h > maxFlow_m3h) maxFlow_m3h = flow_m3h;
|
||||
|
||||
double flow = Config.Units.ConvertTo(flowUnit, flow_m3h); /// Convert to specified units
|
||||
|
||||
if (flow > 0)
|
||||
{
|
||||
unsortedPoints.Add(new PointF((float)flow, (float)mtr.Error));
|
||||
}
|
||||
}
|
||||
}
|
||||
IEnumerable<PointF> sortedPoints = unsortedPoints.OrderBy(x => x.X);
|
||||
|
||||
bool isQ4 = (maxFlow_m3h > 1.1 * wm.WaterMeterData.Q3_Qn);
|
||||
|
||||
Chart chart = new Chart
|
||||
{
|
||||
Name = "chart",
|
||||
Text = "chart",
|
||||
Dock = System.Windows.Forms.DockStyle.Fill,
|
||||
TabIndex = 0,
|
||||
Size = new System.Drawing.Size(5, 5),
|
||||
Location = new System.Drawing.Point(3, 3),
|
||||
};
|
||||
|
||||
ChartArea chArea = new ChartArea { Name = "ChartArea1" };
|
||||
chArea.AxisX.Title = Strings.Flow;
|
||||
chArea.AxisX.IsLogarithmic = true;
|
||||
chArea.AxisX.LogarithmBase = 10;
|
||||
chArea.AxisX.IsLabelAutoFit = true;
|
||||
|
||||
List<double> xs = new List<double>() { 0.0001, 0.0002, 0.0005,
|
||||
0.001, 0.002, 0.005,
|
||||
0.01, 0.02, 0.05,
|
||||
0.1, 0.2, 0.5,
|
||||
1, 2, 5,
|
||||
10, 20, 50,
|
||||
100, 200, 500,
|
||||
1000, 2000, 5000,
|
||||
10000, 20000, 50000,
|
||||
100000, 200000, 500000,
|
||||
1000000, 2000000, 5000000,
|
||||
10000000 };
|
||||
double spacer = 0.8;
|
||||
double from = Config.Units.ConvertTo(flowUnit, wm.WaterMeterData.Q1_Qmin);
|
||||
double to = Config.Units.ConvertTo(flowUnit, isQ4 ? wm.WaterMeterData.Q4_Qmax : wm.WaterMeterData.Q3_Qn);
|
||||
bool inRange = false;
|
||||
for (int i = 0; i < xs.Count - 3; i += 3)
|
||||
{
|
||||
if (xs[i] <= from && from < xs[i + 3])
|
||||
{
|
||||
chArea.AxisX.Minimum = xs[i];
|
||||
inRange = true;
|
||||
}
|
||||
|
||||
if (inRange)
|
||||
{
|
||||
for (int j = i; j < i + 3; j++)
|
||||
{
|
||||
CustomLabel cl = new CustomLabel();
|
||||
cl.Text = string.Format("{0} {1}", xs[j], flowUnit.ToDescription());
|
||||
cl.FromPosition = Math.Log10(xs[j] * spacer);
|
||||
cl.ToPosition = Math.Log10(xs[j] / spacer);
|
||||
chArea.AxisX.CustomLabels.Add(cl);
|
||||
}
|
||||
}
|
||||
|
||||
if (xs[i] < to && to <= xs[i + 3])
|
||||
{
|
||||
chArea.AxisX.Maximum = xs[i + 3];
|
||||
|
||||
CustomLabel cl = new CustomLabel();
|
||||
cl.Text = string.Format("{0} {1}", xs[i + 3], flowUnit.ToDescription());
|
||||
cl.FromPosition = Math.Log10(xs[i + 3] * spacer);
|
||||
cl.ToPosition = Math.Log10(xs[i + 3] / spacer);
|
||||
chArea.AxisX.CustomLabels.Add(cl);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
chArea.AxisY.Title = Strings.Relative_error;
|
||||
chArea.AxisY.Interval = 3;
|
||||
chArea.AxisY.LabelStyle.Format = "{#} %";
|
||||
|
||||
Legend legend1 = new Legend { Name = "Legend1" };
|
||||
|
||||
Series upperLimit = new Series { Name = Strings.Upper_limit, ChartArea = "ChartArea1", ChartType = SeriesChartType.Line, Color = Color.Red };
|
||||
upperLimit.Points.AddXY(Config.Units.ConvertTo(flowUnit, wm.WaterMeterData.Q1_Qmin), 5);
|
||||
upperLimit.Points.AddXY(Config.Units.ConvertTo(flowUnit, wm.WaterMeterData.Q2_Qt), 5);
|
||||
upperLimit.Points.AddXY(Config.Units.ConvertTo(flowUnit, wm.WaterMeterData.Q2_Qt), 2);
|
||||
upperLimit.Points.AddXY(Config.Units.ConvertTo(flowUnit, wm.WaterMeterData.Q3_Qn), 2);
|
||||
if (isQ4) upperLimit.Points.AddXY(Config.Units.ConvertTo(flowUnit, wm.WaterMeterData.Q4_Qmax), 2);
|
||||
|
||||
Series lowerLimit = new Series { Name = Strings.Lower_limit, ChartArea = "ChartArea1", ChartType = SeriesChartType.Line, Color = Color.Red };
|
||||
lowerLimit.Points.AddXY(Config.Units.ConvertTo(flowUnit, wm.WaterMeterData.Q1_Qmin), -5);
|
||||
lowerLimit.Points.AddXY(Config.Units.ConvertTo(flowUnit, wm.WaterMeterData.Q2_Qt), -5);
|
||||
lowerLimit.Points.AddXY(Config.Units.ConvertTo(flowUnit, wm.WaterMeterData.Q2_Qt), -2);
|
||||
lowerLimit.Points.AddXY(Config.Units.ConvertTo(flowUnit, wm.WaterMeterData.Q3_Qn), -2);
|
||||
if (isQ4) lowerLimit.Points.AddXY(Config.Units.ConvertTo(flowUnit, wm.WaterMeterData.Q4_Qmax), -2);
|
||||
|
||||
Series line = new Series { Name = Strings.Relative_error, ChartArea = "ChartArea1", ChartType = SeriesChartType.Line, Color = Color.DeepSkyBlue };
|
||||
Series dots = new Series { Name = Strings.Relative_error + " ", ChartArea = "ChartArea1", ChartType = SeriesChartType.Point, Color = Color.RoyalBlue };
|
||||
dots.MarkerStyle = MarkerStyle.Circle;
|
||||
if (isPrinter) dots.MarkerSize = 1;
|
||||
foreach (var point in sortedPoints)
|
||||
{
|
||||
line.Points.AddXY(point.X, point.Y);
|
||||
dots.Points.AddXY(point.X, point.Y);
|
||||
}
|
||||
|
||||
chart.ChartAreas.Add(chArea);
|
||||
chart.Legends.Add(legend1);
|
||||
chart.Series.Add(upperLimit);
|
||||
chart.Series.Add(lowerLimit);
|
||||
chart.Series.Add(dots);
|
||||
chart.Series.Add(line);
|
||||
|
||||
return chart;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Sensus")]
|
||||
[assembly: AssemblyProduct("Results")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2013 - 2018 Sensus Slovensko, a.s.")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2013 - 2019 Sensus Slovensko, a.s.")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.18.918.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.918.0")]
|
||||
[assembly: AssemblyVersion("2.18.1340.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1340.0")]
|
||||
|
||||
Generated
+288
@@ -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>
|
||||
/// Looks up a localized string similar to Alignment.
|
||||
/// </summary>
|
||||
@@ -78,6 +87,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to All results.
|
||||
/// </summary>
|
||||
internal static string All_results {
|
||||
get {
|
||||
return ResourceManager.GetString("All_results", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Approval.
|
||||
/// </summary>
|
||||
@@ -105,6 +123,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>
|
||||
/// Looks up a localized string similar to Batch nr..
|
||||
/// </summary>
|
||||
@@ -123,6 +150,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>
|
||||
/// Looks up a localized string similar to Cancel.
|
||||
/// </summary>
|
||||
@@ -150,6 +195,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Code.
|
||||
/// </summary>
|
||||
internal static string Code {
|
||||
get {
|
||||
return ResourceManager.GetString("Code", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Compound.
|
||||
/// </summary>
|
||||
@@ -168,6 +222,24 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Counter {0}.
|
||||
/// </summary>
|
||||
internal static string Counter_0 {
|
||||
get {
|
||||
return ResourceManager.GetString("Counter_0", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Date and time.
|
||||
/// </summary>
|
||||
internal static string Date_and_time {
|
||||
get {
|
||||
return ResourceManager.GetString("Date_and_time", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Density.
|
||||
/// </summary>
|
||||
@@ -348,6 +420,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to NOK.
|
||||
/// </summary>
|
||||
internal static string Failed {
|
||||
get {
|
||||
return ResourceManager.GetString("Failed", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Failed meters count.
|
||||
/// </summary>
|
||||
@@ -393,6 +474,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Graphs.
|
||||
/// </summary>
|
||||
internal static string Graphs {
|
||||
get {
|
||||
return ResourceManager.GetString("Graphs", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to H amb.
|
||||
/// </summary>
|
||||
@@ -411,6 +501,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Invalid Q2 correction factors.
|
||||
/// </summary>
|
||||
internal static string Invalid_Q2_correction_factors {
|
||||
get {
|
||||
return ResourceManager.GetString("Invalid_Q2_correction_factors", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Item.
|
||||
/// </summary>
|
||||
@@ -429,6 +528,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Lower limit.
|
||||
/// </summary>
|
||||
internal static string Lower_limit {
|
||||
get {
|
||||
return ResourceManager.GetString("Lower_limit", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to main.
|
||||
/// </summary>
|
||||
@@ -465,6 +573,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Name.
|
||||
/// </summary>
|
||||
internal static string Name {
|
||||
get {
|
||||
return ResourceManager.GetString("Name", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to No.
|
||||
/// </summary>
|
||||
@@ -474,6 +591,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to No water meter.
|
||||
/// </summary>
|
||||
internal static string No_water_meter {
|
||||
get {
|
||||
return ResourceManager.GetString("No_water_meter", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to OK.
|
||||
/// </summary>
|
||||
@@ -591,6 +717,24 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Part.
|
||||
/// </summary>
|
||||
internal static string Part {
|
||||
get {
|
||||
return ResourceManager.GetString("Part", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to OK.
|
||||
/// </summary>
|
||||
internal static string Passed {
|
||||
get {
|
||||
return ResourceManager.GetString("Passed", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Passed meters count.
|
||||
/// </summary>
|
||||
@@ -627,6 +771,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Previous step is missing or NOK.
|
||||
/// </summary>
|
||||
internal static string Previous_step_is_missing_or_NOK {
|
||||
get {
|
||||
return ResourceManager.GetString("Previous_step_is_missing_or_NOK", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Procedure.
|
||||
/// </summary>
|
||||
@@ -636,6 +789,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>
|
||||
/// Looks up a localized string similar to Producer.
|
||||
/// </summary>
|
||||
@@ -645,6 +807,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Production tracing results.
|
||||
/// </summary>
|
||||
internal static string Production_tracing_results {
|
||||
get {
|
||||
return ResourceManager.GetString("Production_tracing_results", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Protocol.
|
||||
/// </summary>
|
||||
@@ -726,6 +897,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Relative error.
|
||||
/// </summary>
|
||||
internal static string Relative_error {
|
||||
get {
|
||||
return ResourceManager.GetString("Relative_error", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Remark.
|
||||
/// </summary>
|
||||
@@ -753,6 +933,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to repetition.
|
||||
/// </summary>
|
||||
internal static string repetition {
|
||||
get {
|
||||
return ResourceManager.GetString("repetition", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Result.
|
||||
/// </summary>
|
||||
@@ -807,6 +996,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Serial number is missing.
|
||||
/// </summary>
|
||||
internal static string Serial_number_is_missing {
|
||||
get {
|
||||
return ResourceManager.GetString("Serial_number_is_missing", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Single.
|
||||
/// </summary>
|
||||
@@ -888,6 +1086,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Step.
|
||||
/// </summary>
|
||||
internal static string Step {
|
||||
get {
|
||||
return ResourceManager.GetString("Step", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to T amb.
|
||||
/// </summary>
|
||||
@@ -978,6 +1185,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Test in progress.
|
||||
/// </summary>
|
||||
internal static string Test_in_progress {
|
||||
get {
|
||||
return ResourceManager.GetString("Test_in_progress", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Test method.
|
||||
/// </summary>
|
||||
@@ -996,6 +1212,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Test repetition count exceeded upper limit.
|
||||
/// </summary>
|
||||
internal static string Test_repetition_count_exceeded_upper_limit {
|
||||
get {
|
||||
return ResourceManager.GetString("Test_repetition_count_exceeded_upper_limit", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Test vol..
|
||||
/// </summary>
|
||||
@@ -1005,6 +1230,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to This position is disabled.
|
||||
/// </summary>
|
||||
internal static string This_position_is_disabled {
|
||||
get {
|
||||
return ResourceManager.GetString("This_position_is_disabled", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to to.
|
||||
/// </summary>
|
||||
@@ -1023,6 +1257,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>
|
||||
/// Looks up a localized string similar to Relative error of the master meter.
|
||||
/// </summary>
|
||||
@@ -1671,6 +1914,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Upper limit.
|
||||
/// </summary>
|
||||
internal static string Upper_limit {
|
||||
get {
|
||||
return ResourceManager.GetString("Upper_limit", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to User.
|
||||
/// </summary>
|
||||
@@ -1833,6 +2085,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Water meter results.
|
||||
/// </summary>
|
||||
internal static string Water_meter_results {
|
||||
get {
|
||||
return ResourceManager.GetString("Water_meter_results", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Width.
|
||||
/// </summary>
|
||||
@@ -1860,6 +2121,33 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Workflow.
|
||||
/// </summary>
|
||||
internal static string Workflow {
|
||||
get {
|
||||
return ResourceManager.GetString("Workflow", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Workplace.
|
||||
/// </summary>
|
||||
internal static string Workplace {
|
||||
get {
|
||||
return ResourceManager.GetString("Workplace", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Wrong iPerl counting direction.
|
||||
/// </summary>
|
||||
internal static string Wrong_iPerl_counting_direction {
|
||||
get {
|
||||
return ResourceManager.GetString("Wrong_iPerl_counting_direction", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Year.
|
||||
/// </summary>
|
||||
|
||||
@@ -213,4 +213,127 @@
|
||||
<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>
|
||||
<data name="repetition" xml:space="preserve">
|
||||
<value>opakování</value>
|
||||
</data>
|
||||
<data name="Invalid_Q2_correction_factors" xml:space="preserve">
|
||||
<value>Nesprávne Q2 korekčné faktory</value>
|
||||
</data>
|
||||
<data name="Previous_step_is_missing_or_NOK" xml:space="preserve">
|
||||
<value>Predchádzajúci krok chýba alebo neprešiel</value>
|
||||
</data>
|
||||
<data name="Test_repetition_count_exceeded_upper_limit" xml:space="preserve">
|
||||
<value>Počet opakovaní testu prekročil dovolené maximum</value>
|
||||
</data>
|
||||
<data name="Wrong_iPerl_counting_direction" xml:space="preserve">
|
||||
<value>Nesprávny smer počítania iPerlu</value>
|
||||
</data>
|
||||
<data name="Failed" xml:space="preserve">
|
||||
<value>NOK</value>
|
||||
</data>
|
||||
<data name="Passed" xml:space="preserve">
|
||||
<value>OK</value>
|
||||
</data>
|
||||
<data name="Test_in_progress" xml:space="preserve">
|
||||
<value>Probíhá test</value>
|
||||
</data>
|
||||
<data name="Date_and_time" xml:space="preserve">
|
||||
<value>Datum a čas</value>
|
||||
</data>
|
||||
<data name="Name" xml:space="preserve">
|
||||
<value>Jméno</value>
|
||||
</data>
|
||||
<data name="Step" xml:space="preserve">
|
||||
<value>Krok</value>
|
||||
</data>
|
||||
<data name="Workplace" xml:space="preserve">
|
||||
<value>Pracovisko</value>
|
||||
</data>
|
||||
<data name="Workflow" xml:space="preserve">
|
||||
<value>Pracovný postup</value>
|
||||
</data>
|
||||
<data name="Production_tracing_results" xml:space="preserve">
|
||||
<value>Výsledky sledování výroby</value>
|
||||
</data>
|
||||
<data name="Code" xml:space="preserve">
|
||||
<value>Kód</value>
|
||||
</data>
|
||||
<data name="Part" xml:space="preserve">
|
||||
<value>Součástka</value>
|
||||
</data>
|
||||
<data name="All_results" xml:space="preserve">
|
||||
<value>Všechny výsledky</value>
|
||||
</data>
|
||||
<data name="Graphs" xml:space="preserve">
|
||||
<value>Grafy</value>
|
||||
</data>
|
||||
<data name="No_water_meter" xml:space="preserve">
|
||||
<value>Žádný vodoměr</value>
|
||||
</data>
|
||||
<data name="Serial_number_is_missing" xml:space="preserve">
|
||||
<value>Chybí sériové číslo</value>
|
||||
</data>
|
||||
<data name="Error" xml:space="preserve">
|
||||
<value>Chyba</value>
|
||||
</data>
|
||||
<data name="Lower_limit" xml:space="preserve">
|
||||
<value>Dolní hranice</value>
|
||||
</data>
|
||||
<data name="Upper_limit" xml:space="preserve">
|
||||
<value>Horní hranice</value>
|
||||
</data>
|
||||
<data name="Water_meter_results" xml:space="preserve">
|
||||
<value>Výsledky vodoměru</value>
|
||||
</data>
|
||||
<data name="Relative_error" xml:space="preserve">
|
||||
<value>Relativní chyba</value>
|
||||
</data>
|
||||
<data name="Flow" xml:space="preserve">
|
||||
<value>Průtok</value>
|
||||
</data>
|
||||
<data name="This_position_is_disabled" xml:space="preserve">
|
||||
<value>Taro pozice je vypnuta</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,807 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Add" xml:space="preserve">
|
||||
<value>Ajouter ></value>
|
||||
</data>
|
||||
<data name="Alignment" xml:space="preserve">
|
||||
<value>Alignement</value>
|
||||
</data>
|
||||
<data name="Approval" xml:space="preserve">
|
||||
<value>Approbation</value>
|
||||
</data>
|
||||
<data name="Available_results" xml:space="preserve">
|
||||
<value>Résultats disponibles</value>
|
||||
</data>
|
||||
<data name="Batch_nr" xml:space="preserve">
|
||||
<value>Numéro de lot</value>
|
||||
</data>
|
||||
<data name="Bench" xml:space="preserve">
|
||||
<value>Banc</value>
|
||||
</data>
|
||||
<data name="CancelBtnText" xml:space="preserve">
|
||||
<value>Annuler</value>
|
||||
</data>
|
||||
<data name="Caption" xml:space="preserve">
|
||||
<value>Légende</value>
|
||||
</data>
|
||||
<data name="Configuration" xml:space="preserve">
|
||||
<value>Configuration</value>
|
||||
</data>
|
||||
<data name="Density" xml:space="preserve">
|
||||
<value>Densité</value>
|
||||
</data>
|
||||
<data name="DownBtnText" xml:space="preserve">
|
||||
<value>Vers le bas</value>
|
||||
</data>
|
||||
<data name="End" xml:space="preserve">
|
||||
<value>Fin</value>
|
||||
</data>
|
||||
<data name="EndState_aux" xml:space="preserve">
|
||||
<value>État final aux</value>
|
||||
</data>
|
||||
<data name="EndState_main" xml:space="preserve">
|
||||
<value>État final principal</value>
|
||||
</data>
|
||||
<data name="End_state" xml:space="preserve">
|
||||
<value>État final</value>
|
||||
</data>
|
||||
<data name="ErrLimHi" xml:space="preserve">
|
||||
<value>Err LimHi</value>
|
||||
</data>
|
||||
<data name="ErrLimLo" xml:space="preserve">
|
||||
<value>Err LimLo</value>
|
||||
</data>
|
||||
<data name="Error" xml:space="preserve">
|
||||
<value>Erreur</value>
|
||||
</data>
|
||||
<data name="ErrRef" xml:space="preserve">
|
||||
<value>Err Ref</value>
|
||||
</data>
|
||||
<data name="Err_aux" xml:space="preserve">
|
||||
<value>Err aux</value>
|
||||
</data>
|
||||
<data name="Err_main" xml:space="preserve">
|
||||
<value>Err principale</value>
|
||||
</data>
|
||||
<data name="Flow" xml:space="preserve">
|
||||
<value>Couler</value>
|
||||
</data>
|
||||
<data name="Format" xml:space="preserve">
|
||||
<value>Format</value>
|
||||
</data>
|
||||
<data name="H_amb" xml:space="preserve">
|
||||
<value>Hamb</value>
|
||||
</data>
|
||||
<data name="Item" xml:space="preserve">
|
||||
<value>Article</value>
|
||||
</data>
|
||||
<data name="MClass" xml:space="preserve">
|
||||
<value>MClass</value>
|
||||
</data>
|
||||
<data name="OkBtnText" xml:space="preserve">
|
||||
<value>Oui</value>
|
||||
</data>
|
||||
<data name="PO" xml:space="preserve">
|
||||
<value>Commande</value>
|
||||
</data>
|
||||
<data name="Pos" xml:space="preserve">
|
||||
<value>Pos.</value>
|
||||
</data>
|
||||
<data name="Precision" xml:space="preserve">
|
||||
<value>Précision</value>
|
||||
</data>
|
||||
<data name="Procedure" xml:space="preserve">
|
||||
<value>Procédure</value>
|
||||
</data>
|
||||
<data name="Producer" xml:space="preserve">
|
||||
<value>Producteur</value>
|
||||
</data>
|
||||
<data name="Protocol" xml:space="preserve">
|
||||
<value>Protocole</value>
|
||||
</data>
|
||||
<data name="Pulses" xml:space="preserve">
|
||||
<value>Impulsion</value>
|
||||
</data>
|
||||
<data name="PulsesLiter" xml:space="preserve">
|
||||
<value>Impulsion/litre</value>
|
||||
</data>
|
||||
<data name="P_amb" xml:space="preserve">
|
||||
<value>P amb</value>
|
||||
</data>
|
||||
<data name="P_dn_end" xml:space="preserve">
|
||||
<value>P dn fin</value>
|
||||
</data>
|
||||
<data name="P_dn" xml:space="preserve">
|
||||
<value>P dn</value>
|
||||
</data>
|
||||
<data name="P_dn_start" xml:space="preserve">
|
||||
<value>P dn début</value>
|
||||
</data>
|
||||
<data name="P_up_end" xml:space="preserve">
|
||||
<value>P up fin</value>
|
||||
</data>
|
||||
<data name="P_up" xml:space="preserve">
|
||||
<value>P up</value>
|
||||
</data>
|
||||
<data name="P_up_start" xml:space="preserve">
|
||||
<value>P up début</value>
|
||||
</data>
|
||||
<data name="Q_fall" xml:space="preserve">
|
||||
<value>Q tomber</value>
|
||||
</data>
|
||||
<data name="Q_from" xml:space="preserve">
|
||||
<value>Q de</value>
|
||||
</data>
|
||||
<data name="Q_rise" xml:space="preserve">
|
||||
<value>Q monter</value>
|
||||
</data>
|
||||
<data name="Q_to" xml:space="preserve">
|
||||
<value>Q à</value>
|
||||
</data>
|
||||
<data name="RefPulses" xml:space="preserve">
|
||||
<value>Ref Puls</value>
|
||||
</data>
|
||||
<data name="Remove" xml:space="preserve">
|
||||
<value>< Retirer</value>
|
||||
</data>
|
||||
<data name="Remove_all" xml:space="preserve">
|
||||
<value>Enlever tout</value>
|
||||
</data>
|
||||
<data name="Result" xml:space="preserve">
|
||||
<value>Résultat</value>
|
||||
</data>
|
||||
<data name="Selected_results" xml:space="preserve">
|
||||
<value>Résultats sélectionnés</value>
|
||||
</data>
|
||||
<data name="sn" xml:space="preserve">
|
||||
<value>s/n</value>
|
||||
</data>
|
||||
<data name="sn_aux" xml:space="preserve">
|
||||
<value>s/n aux</value>
|
||||
</data>
|
||||
<data name="sn_main" xml:space="preserve">
|
||||
<value>s/n principale</value>
|
||||
</data>
|
||||
<data name="Start" xml:space="preserve">
|
||||
<value>Début</value>
|
||||
</data>
|
||||
<data name="Test" xml:space="preserve">
|
||||
<value>Test</value>
|
||||
</data>
|
||||
<data name="Test_ID" xml:space="preserve">
|
||||
<value>Test ID</value>
|
||||
</data>
|
||||
<data name="Test_method" xml:space="preserve">
|
||||
<value>Méthode d'essai</value>
|
||||
</data>
|
||||
<data name="Test_vol" xml:space="preserve">
|
||||
<value>Test vol</value>
|
||||
</data>
|
||||
<data name="T_amb" xml:space="preserve">
|
||||
<value>T amb</value>
|
||||
</data>
|
||||
<data name="T_div" xml:space="preserve">
|
||||
<value>T div</value>
|
||||
</data>
|
||||
<data name="T_end" xml:space="preserve">
|
||||
<value>T fin</value>
|
||||
</data>
|
||||
<data name="T_in" xml:space="preserve">
|
||||
<value>T dans</value>
|
||||
</data>
|
||||
<data name="T_out" xml:space="preserve">
|
||||
<value>T en dehors</value>
|
||||
</data>
|
||||
<data name="T_s" xml:space="preserve">
|
||||
<value>T [s]</value>
|
||||
</data>
|
||||
<data name="T_start" xml:space="preserve">
|
||||
<value>T début</value>
|
||||
</data>
|
||||
<data name="Uncertainty" xml:space="preserve">
|
||||
<value>Incertitude</value>
|
||||
</data>
|
||||
<data name="Units" xml:space="preserve">
|
||||
<value>Unités</value>
|
||||
</data>
|
||||
<data name="UpBtnText" xml:space="preserve">
|
||||
<value>En haut</value>
|
||||
</data>
|
||||
<data name="User" xml:space="preserve">
|
||||
<value>Utilisateur</value>
|
||||
</data>
|
||||
<data name="User_nr" xml:space="preserve">
|
||||
<value>N° Utilisateur</value>
|
||||
</data>
|
||||
<data name="Ver" xml:space="preserve">
|
||||
<value>Ver.</value>
|
||||
</data>
|
||||
<data name="VolRef" xml:space="preserve">
|
||||
<value>Vol ref.</value>
|
||||
</data>
|
||||
<data name="Volume" xml:space="preserve">
|
||||
<value>Le volume</value>
|
||||
</data>
|
||||
<data name="Width" xml:space="preserve">
|
||||
<value>Largeur</value>
|
||||
</data>
|
||||
<data name="WMs" xml:space="preserve">
|
||||
<value>CEs</value>
|
||||
</data>
|
||||
<data name="WM_Type" xml:space="preserve">
|
||||
<value>CE Type</value>
|
||||
</data>
|
||||
<data name="Year" xml:space="preserve">
|
||||
<value>Année</value>
|
||||
</data>
|
||||
<data name="Results" xml:space="preserve">
|
||||
<value>Résultats</value>
|
||||
</data>
|
||||
<data name="Remark" xml:space="preserve">
|
||||
<value>Remarque</value>
|
||||
</data>
|
||||
<data name="Result_code" xml:space="preserve">
|
||||
<value>Code de résultat</value>
|
||||
</data>
|
||||
<data name="Mounting" xml:space="preserve">
|
||||
<value>Montage</value>
|
||||
</data>
|
||||
<data name="Energy" xml:space="preserve">
|
||||
<value>Énergie</value>
|
||||
</data>
|
||||
<data name="Energy_ref" xml:space="preserve">
|
||||
<value>Énergie ref</value>
|
||||
</data>
|
||||
<data name="P_delta" xml:space="preserve">
|
||||
<value>P delta</value>
|
||||
</data>
|
||||
<data name="P_delta_end" xml:space="preserve">
|
||||
<value>P delta fin</value>
|
||||
</data>
|
||||
<data name="P_delta_mean" xml:space="preserve">
|
||||
<value>P delta moyenne</value>
|
||||
</data>
|
||||
<data name="P_delta_start" xml:space="preserve">
|
||||
<value>P delta début</value>
|
||||
</data>
|
||||
<data name="Meter_type" xml:space="preserve">
|
||||
<value>Type de compteur</value>
|
||||
</data>
|
||||
<data name="Compound" xml:space="preserve">
|
||||
<value>Composé</value>
|
||||
</data>
|
||||
<data name="Heat_meter" xml:space="preserve">
|
||||
<value>Thermomètre</value>
|
||||
</data>
|
||||
<data name="Single" xml:space="preserve">
|
||||
<value>Unique</value>
|
||||
</data>
|
||||
<data name="Page" xml:space="preserve">
|
||||
<value>Page</value>
|
||||
</data>
|
||||
<data name="End_volume" xml:space="preserve">
|
||||
<value>Volume fin</value>
|
||||
</data>
|
||||
<data name="Start_volume" xml:space="preserve">
|
||||
<value>Volume début</value>
|
||||
</data>
|
||||
<data name="End_volume_aux" xml:space="preserve">
|
||||
<value>Fin volume aux</value>
|
||||
</data>
|
||||
<data name="End_volume_main" xml:space="preserve">
|
||||
<value>Fin volume principale</value>
|
||||
</data>
|
||||
<data name="Start_volume_aux" xml:space="preserve">
|
||||
<value>Début volume aux</value>
|
||||
</data>
|
||||
<data name="Start_volume_main" xml:space="preserve">
|
||||
<value>Début volume principale</value>
|
||||
</data>
|
||||
<data name="Volume_aux" xml:space="preserve">
|
||||
<value>Volume aux</value>
|
||||
</data>
|
||||
<data name="Volume_main" xml:space="preserve">
|
||||
<value>Volume principale</value>
|
||||
</data>
|
||||
<data name="End_mass" xml:space="preserve">
|
||||
<value>Fin masse</value>
|
||||
</data>
|
||||
<data name="Start_mass" xml:space="preserve">
|
||||
<value>Début masse</value>
|
||||
</data>
|
||||
<data name="Category" xml:space="preserve">
|
||||
<value>Catégorie</value>
|
||||
</data>
|
||||
<data name="Quantity" xml:space="preserve">
|
||||
<value>Quantité</value>
|
||||
</data>
|
||||
<data name="Water_Meter" xml:space="preserve">
|
||||
<value>Compteur d'eau</value>
|
||||
</data>
|
||||
<data name="VName_Flow" xml:space="preserve">
|
||||
<value>Q</value>
|
||||
</data>
|
||||
<data name="VName_Press" xml:space="preserve">
|
||||
<value>Press.</value>
|
||||
</data>
|
||||
<data name="VName_Temp" xml:space="preserve">
|
||||
<value>Temp.</value>
|
||||
</data>
|
||||
<data name="VName_Dens" xml:space="preserve">
|
||||
<value>Ro</value>
|
||||
</data>
|
||||
<data name="VName_Humi" xml:space="preserve">
|
||||
<value>Hu.</value>
|
||||
</data>
|
||||
<data name="VName_Mass" xml:space="preserve">
|
||||
<value>Masse</value>
|
||||
</data>
|
||||
<data name="VName_TstTime" xml:space="preserve">
|
||||
<value>Tau</value>
|
||||
</data>
|
||||
<data name="VName_Vol" xml:space="preserve">
|
||||
<value>Vol.</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_de_ac" xml:space="preserve">
|
||||
<value>Différence de pression mesurée par delta P mètre - réelle</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_de_avg" xml:space="preserve">
|
||||
<value>Différence de pression mesurée par delta P mètre - moyenne</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_de_en" xml:space="preserve">
|
||||
<value>Différence de pression mesurée par delta P mètre - à la fin de l'essai</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_de_me" xml:space="preserve">
|
||||
<value>Différence de pression mesurée par delta P mètre - moyenne</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_de_st" xml:space="preserve">
|
||||
<value>Différence de pression mesurée par delta P mètre - au début de l'essai</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_dw_ac" xml:space="preserve">
|
||||
<value>Pression à la sortie réelle</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_dw_avg" xml:space="preserve">
|
||||
<value>Pression moyenne à la sortie</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_dw_en" xml:space="preserve">
|
||||
<value>Pression à la sortie à la fin du test</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_dw_me" xml:space="preserve">
|
||||
<value>Pression moyenne à la sortie</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_dw_st" xml:space="preserve">
|
||||
<value>Pression à la sortie au début du test</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_up_ac" xml:space="preserve">
|
||||
<value>Pression à l'entrée réelle</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_up_avg" xml:space="preserve">
|
||||
<value>Pression moyenne à l'entrée</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_up_en" xml:space="preserve">
|
||||
<value>Pression à l'entrée à la fin de l'essai</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_up_me" xml:space="preserve">
|
||||
<value>Pression moyenne à l'entrée</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_up_st" xml:space="preserve">
|
||||
<value>Pression à l'entrée au début de l'essai</value>
|
||||
</data>
|
||||
<data name="Tooltip_Q_m_r" xml:space="preserve">
|
||||
<value>Débit calculé à partir de la masse vraie et du temps conventionnels</value>
|
||||
</data>
|
||||
<data name="Tooltip_Q_riac" xml:space="preserve">
|
||||
<value>Débit obtenu à partir du compteur principal - réel</value>
|
||||
</data>
|
||||
<data name="Tooltip_Q_rim" xml:space="preserve">
|
||||
<value>Débit obtenu à partir du compteur principal - moyenne</value>
|
||||
</data>
|
||||
<data name="Tooltip_Q_v_r" xml:space="preserve">
|
||||
<value>Débit mesuré par le débitmètre de référence</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_di_ac" xml:space="preserve">
|
||||
<value>Température réelle au déviateur</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_di_avg" xml:space="preserve">
|
||||
<value>Température moyenne au déviateur</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_di_en" xml:space="preserve">
|
||||
<value>Température au déviateur à la fin du test - 4 dernières mesures avant la fin</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_di_me" xml:space="preserve">
|
||||
<value>Température moyenne au déviateur</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_di_st" xml:space="preserve">
|
||||
<value>Température au déviateur au début du test - 4 premières mesures après le début</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_dw_ac" xml:space="preserve">
|
||||
<value>Température réelle à la sortie</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_dw_avg" xml:space="preserve">
|
||||
<value>Température moyenne à la sortie</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_dw_en" xml:space="preserve">
|
||||
<value>Température à la sortie à la fin du test - 4 dernières mesures avant la fin</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_dw_me" xml:space="preserve">
|
||||
<value>Température moyenne à la sortie</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_dw_st" xml:space="preserve">
|
||||
<value>Température à la sortie au début du test - 4 premières mesures après le début</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_up_ac" xml:space="preserve">
|
||||
<value>Température réelle à l'entrée</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_up_avg" xml:space="preserve">
|
||||
<value>Température moyenne à l'entrée lors d'un test</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_up_en" xml:space="preserve">
|
||||
<value>Température à l'entrée à la fin de l'essai - 4 dernières mesures avant la fin</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_up_me" xml:space="preserve">
|
||||
<value>Température moyenne à l'entrée lors d'un test</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_up_st" xml:space="preserve">
|
||||
<value>Température d'entrée au début du test - 4 premières mesures après le début</value>
|
||||
</data>
|
||||
<data name="aux" xml:space="preserve">
|
||||
<value>aux.</value>
|
||||
</data>
|
||||
<data name="main" xml:space="preserve">
|
||||
<value>principale</value>
|
||||
</data>
|
||||
<data name="Tooltip_E_rel" xml:space="preserve">
|
||||
<value>Erreur relative d'un compteur</value>
|
||||
</data>
|
||||
<data name="Tooltip_E_rel_ref" xml:space="preserve">
|
||||
<value>Erreur relative du compteur maître</value>
|
||||
</data>
|
||||
<data name="Tooltip_sn" xml:space="preserve">
|
||||
<value>Numéro de série du compteur</value>
|
||||
</data>
|
||||
<data name="Tooltip_sn_aux" xml:space="preserve">
|
||||
<value>Numéro de série du compteur auxiliaire d'un compteur d'eau composé</value>
|
||||
</data>
|
||||
<data name="Tooltip_sn_main" xml:space="preserve">
|
||||
<value>Numéro de série du compteur principal d'un compteur d'eau composé</value>
|
||||
</data>
|
||||
<data name="Tooltip_Vol_Mt" xml:space="preserve">
|
||||
<value>Volume mesuré par le compteur testé</value>
|
||||
</data>
|
||||
<data name="Tooltip_Vol_rm" xml:space="preserve">
|
||||
<value>Volume de référence pour compteur testé</value>
|
||||
</data>
|
||||
<data name="VName_Error" xml:space="preserve">
|
||||
<value>E</value>
|
||||
</data>
|
||||
<data name="fall" xml:space="preserve">
|
||||
<value>tomber</value>
|
||||
</data>
|
||||
<data name="from" xml:space="preserve">
|
||||
<value>de</value>
|
||||
</data>
|
||||
<data name="rise" xml:space="preserve">
|
||||
<value>monter</value>
|
||||
</data>
|
||||
<data name="to" xml:space="preserve">
|
||||
<value>à</value>
|
||||
</data>
|
||||
<data name="Tooltip_Hu_Amb_M" xml:space="preserve">
|
||||
<value>Humidité ambiante pendant le test</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_Amb_M" xml:space="preserve">
|
||||
<value>Pression ambiante pendant le test</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_Amb_M" xml:space="preserve">
|
||||
<value>Température ambiante pendant le test</value>
|
||||
</data>
|
||||
<data name="Test_done" xml:space="preserve">
|
||||
<value>Test fait</value>
|
||||
</data>
|
||||
<data name="Test_passed" xml:space="preserve">
|
||||
<value>Test réussi</value>
|
||||
</data>
|
||||
<data name="No" xml:space="preserve">
|
||||
<value>Non</value>
|
||||
</data>
|
||||
<data name="Yes" xml:space="preserve">
|
||||
<value>Oui</value>
|
||||
</data>
|
||||
<data name="Density_correction" xml:space="preserve">
|
||||
<value>Correction densité</value>
|
||||
</data>
|
||||
<data name="Error_flags" xml:space="preserve">
|
||||
<value>Drapeaux erreur</value>
|
||||
</data>
|
||||
<data name="Legalizator" xml:space="preserve">
|
||||
<value>Légalisateur</value>
|
||||
</data>
|
||||
<data name="User_description" xml:space="preserve">
|
||||
<value>Description utilisateur</value>
|
||||
</data>
|
||||
<data name="Failed_meters_count" xml:space="preserve">
|
||||
<value>Compteur échoué</value>
|
||||
</data>
|
||||
<data name="Passed_meters_count" xml:space="preserve">
|
||||
<value>Mètres passés</value>
|
||||
</data>
|
||||
<data name="sensitivity" xml:space="preserve">
|
||||
<value>sensibilité</value>
|
||||
</data>
|
||||
<data name="Tooltip_Q_end" xml:space="preserve">
|
||||
<value>Débit obtenu à partir du compteur principal - fin</value>
|
||||
</data>
|
||||
<data name="Tooltip_Q_max" xml:space="preserve">
|
||||
<value>Débit obtenu à partir du compteur principal - max.</value>
|
||||
</data>
|
||||
<data name="Tooltip_Q_min" xml:space="preserve">
|
||||
<value>Débit obtenu à partir du compteur principal - min</value>
|
||||
</data>
|
||||
<data name="Tooltip_Q_start" xml:space="preserve">
|
||||
<value>Débit obtenu à partir du compteur principal - départ</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_dw_max" xml:space="preserve">
|
||||
<value>Pression maximale à la sortie pendant le test</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_dw_min" xml:space="preserve">
|
||||
<value>Pression minimale à la sortie pendant le test</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_up_max" xml:space="preserve">
|
||||
<value>Pression maximale à l'entrée pendant l'essai</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_up_min" xml:space="preserve">
|
||||
<value>Pression minimale à l'entrée lors de l'essai</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_di_max" xml:space="preserve">
|
||||
<value>Température maximale au déviateur pendant le test</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_di_min" xml:space="preserve">
|
||||
<value>Température minimale au déviateur pendant le test</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_dw_max" xml:space="preserve">
|
||||
<value>Température maximale à la sortie pendant le test</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_dw_min" xml:space="preserve">
|
||||
<value>Température minimale à la sortie pendant le test</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_up_max" xml:space="preserve">
|
||||
<value>Température maximale à l'entrée pendant le test</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_up_min" xml:space="preserve">
|
||||
<value>Température minimale à l'entrée pendant l'essai</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_de_max" xml:space="preserve">
|
||||
<value>Différence de pression mesurée par delta P mètre - maximum pendant le test</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_de_min" xml:space="preserve">
|
||||
<value>Différence de pression mesurée par delta P mètre - minimum pendant l'essai</value>
|
||||
</data>
|
||||
<data name="Tooltip_Rho_Wa_calc" xml:space="preserve">
|
||||
<value>Densité calculée de l'eau à partir d'une table ou d'une formule à la température d'étalonnage de la densité de l'eau (r)</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_rho_0" xml:space="preserve">
|
||||
<value>Température de l'échantillon d'eau lors de l'étalonnage de la densité de l'eau</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_ln_ac" xml:space="preserve">
|
||||
<value>Température réelle dans la ligne</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_ln_avg" xml:space="preserve">
|
||||
<value>Température moyenne dans la ligne pendant un test</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_ln_en" xml:space="preserve">
|
||||
<value>Température dans la ligne à la fin du test - 4 dernières mesures avant la fin</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_ln_max" xml:space="preserve">
|
||||
<value>Température maximale dans la ligne pendant le test</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_ln_me" xml:space="preserve">
|
||||
<value>Température moyenne dans la ligne pendant un test</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_ln_min" xml:space="preserve">
|
||||
<value>Température minimale dans la ligne pendant le test</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_ln_st" xml:space="preserve">
|
||||
<value>Température dans la ligne au début du test - 4 premières mesures après le début</value>
|
||||
</data>
|
||||
<data name="Unit" xml:space="preserve">
|
||||
<value>Unité</value>
|
||||
</data>
|
||||
<data name="Procedure_description" xml:space="preserve">
|
||||
<value>Description procédure</value>
|
||||
</data>
|
||||
<data name="Bench_ID" xml:space="preserve">
|
||||
<value>ID banc</value>
|
||||
</data>
|
||||
<data name="Bench_name" xml:space="preserve">
|
||||
<value>Nom banc</value>
|
||||
</data>
|
||||
<data name="Address" xml:space="preserve">
|
||||
<value>Adresse</value>
|
||||
</data>
|
||||
<data name="Tooltip_E_rel_last" xml:space="preserve">
|
||||
<value>Erreur relative d'un compteur dans un test précédent / en production</value>
|
||||
</data>
|
||||
<data name="Batch" xml:space="preserve">
|
||||
<value>Lot</value>
|
||||
</data>
|
||||
<data name="repetition" xml:space="preserve">
|
||||
<value>répétition</value>
|
||||
</data>
|
||||
<data name="Invalid_Q2_correction_factors" xml:space="preserve">
|
||||
<value>Facteurs correction Q2 non valides</value>
|
||||
</data>
|
||||
<data name="Previous_step_is_missing_or_NOK" xml:space="preserve">
|
||||
<value>L'étape précédente est manquante ou NOK</value>
|
||||
</data>
|
||||
<data name="Test_repetition_count_exceeded_upper_limit" xml:space="preserve">
|
||||
<value>nombre répétitions test dépasse limite supérieure</value>
|
||||
</data>
|
||||
<data name="Wrong_iPerl_counting_direction" xml:space="preserve">
|
||||
<value>Mauvais sens comptage iPerl</value>
|
||||
</data>
|
||||
<data name="Failed" xml:space="preserve">
|
||||
<value>Échoué</value>
|
||||
</data>
|
||||
<data name="Passed" xml:space="preserve">
|
||||
<value>Passé</value>
|
||||
</data>
|
||||
<data name="Test_in_progress" xml:space="preserve">
|
||||
<value>Test en cours</value>
|
||||
</data>
|
||||
<data name="Counter_0" xml:space="preserve">
|
||||
<value>Compteur {0}</value>
|
||||
</data>
|
||||
<data name="Date_and_time" xml:space="preserve">
|
||||
<value>Date et heure</value>
|
||||
</data>
|
||||
<data name="Name" xml:space="preserve">
|
||||
<value>Prénom</value>
|
||||
</data>
|
||||
<data name="Step" xml:space="preserve">
|
||||
<value>Étape</value>
|
||||
</data>
|
||||
<data name="Workplace" xml:space="preserve">
|
||||
<value>Lieu travail</value>
|
||||
</data>
|
||||
<data name="Workflow" xml:space="preserve">
|
||||
<value>Flux travail</value>
|
||||
</data>
|
||||
<data name="Production_tracing_results" xml:space="preserve">
|
||||
<value>Résultats production</value>
|
||||
</data>
|
||||
<data name="Code" xml:space="preserve">
|
||||
<value>Code</value>
|
||||
</data>
|
||||
<data name="Part" xml:space="preserve">
|
||||
<value>Partie</value>
|
||||
</data>
|
||||
<data name="All_results" xml:space="preserve">
|
||||
<value>Tous résultats</value>
|
||||
</data>
|
||||
<data name="Graphs" xml:space="preserve">
|
||||
<value>Graphiques</value>
|
||||
</data>
|
||||
<data name="No_water_meter" xml:space="preserve">
|
||||
<value>Pas de compteur</value>
|
||||
</data>
|
||||
<data name="Serial_number_is_missing" xml:space="preserve">
|
||||
<value>Numérotation en série</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -723,4 +723,100 @@
|
||||
<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>
|
||||
<data name="repetition" xml:space="preserve">
|
||||
<value>repetition</value>
|
||||
</data>
|
||||
<data name="Invalid_Q2_correction_factors" xml:space="preserve">
|
||||
<value>Invalid Q2 correction factors</value>
|
||||
</data>
|
||||
<data name="Previous_step_is_missing_or_NOK" xml:space="preserve">
|
||||
<value>Previous step is missing or NOK</value>
|
||||
</data>
|
||||
<data name="Test_repetition_count_exceeded_upper_limit" xml:space="preserve">
|
||||
<value>Test repetition count exceeded upper limit</value>
|
||||
</data>
|
||||
<data name="Wrong_iPerl_counting_direction" xml:space="preserve">
|
||||
<value>Wrong iPerl counting direction</value>
|
||||
</data>
|
||||
<data name="Failed" xml:space="preserve">
|
||||
<value>NOK</value>
|
||||
</data>
|
||||
<data name="Passed" xml:space="preserve">
|
||||
<value>OK</value>
|
||||
</data>
|
||||
<data name="Test_in_progress" xml:space="preserve">
|
||||
<value>Test in progress</value>
|
||||
</data>
|
||||
<data name="Counter_0" xml:space="preserve">
|
||||
<value>Counter {0}</value>
|
||||
</data>
|
||||
<data name="Date_and_time" xml:space="preserve">
|
||||
<value>Date and time</value>
|
||||
</data>
|
||||
<data name="Name" xml:space="preserve">
|
||||
<value>Name</value>
|
||||
</data>
|
||||
<data name="Step" xml:space="preserve">
|
||||
<value>Step</value>
|
||||
</data>
|
||||
<data name="Workplace" xml:space="preserve">
|
||||
<value>Workplace</value>
|
||||
</data>
|
||||
<data name="Workflow" xml:space="preserve">
|
||||
<value>Workflow</value>
|
||||
</data>
|
||||
<data name="Production_tracing_results" xml:space="preserve">
|
||||
<value>Production tracing results</value>
|
||||
</data>
|
||||
<data name="Code" xml:space="preserve">
|
||||
<value>Code</value>
|
||||
</data>
|
||||
<data name="Part" xml:space="preserve">
|
||||
<value>Part</value>
|
||||
</data>
|
||||
<data name="All_results" xml:space="preserve">
|
||||
<value>All results</value>
|
||||
</data>
|
||||
<data name="Graphs" xml:space="preserve">
|
||||
<value>Graphs</value>
|
||||
</data>
|
||||
<data name="No_water_meter" xml:space="preserve">
|
||||
<value>No water meter</value>
|
||||
</data>
|
||||
<data name="Serial_number_is_missing" xml:space="preserve">
|
||||
<value>Serial number is missing</value>
|
||||
</data>
|
||||
<data name="Lower_limit" xml:space="preserve">
|
||||
<value>Lower limit</value>
|
||||
</data>
|
||||
<data name="Upper_limit" xml:space="preserve">
|
||||
<value>Upper limit</value>
|
||||
</data>
|
||||
<data name="Water_meter_results" xml:space="preserve">
|
||||
<value>Water meter results</value>
|
||||
</data>
|
||||
<data name="Relative_error" xml:space="preserve">
|
||||
<value>Relative error</value>
|
||||
</data>
|
||||
<data name="This_position_is_disabled" xml:space="preserve">
|
||||
<value>This position is disabled</value>
|
||||
</data>
|
||||
</root>
|
||||
+55
-3
@@ -18,7 +18,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;RUM_MOB;LANG_RO</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
@@ -27,7 +27,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;MUNICH</DefineConstants>
|
||||
<DefineConstants>TRACE;RUM_MOB;LANG_RO</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
@@ -51,6 +51,7 @@
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Windows.Forms.DataVisualization" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
@@ -74,9 +75,31 @@
|
||||
<Compile Include="Forms\BatchResultsDlg.Designer.cs">
|
||||
<DependentUpon>BatchResultsDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\IOneWMResultsCtrl.cs" />
|
||||
<Compile Include="Forms\ListViewEx.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\ListViewExtensions.cs" />
|
||||
<Compile Include="Forms\LviIntColumnComparer.cs" />
|
||||
<Compile Include="Forms\LviTextColumnComparer.cs" />
|
||||
<Compile Include="Forms\MoreWMResultsDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\MoreWMResultsDlg.Designer.cs">
|
||||
<DependentUpon>MoreWMResultsDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\OneWMResultsColumnsCtrl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\OneWMResultsColumnsCtrl.designer.cs">
|
||||
<DependentUpon>OneWMResultsColumnsCtrl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\OneWMResultsRowsCtrl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\OneWMResultsRowsCtrl.Designer.cs">
|
||||
<DependentUpon>OneWMResultsRowsCtrl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\ResultsConfigCtrl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
@@ -89,6 +112,13 @@
|
||||
<Compile Include="Forms\ResultsConfigDlg.designer.cs">
|
||||
<DependentUpon>ResultsConfigDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\TracingResultsDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\TracingResultsDlg.Designer.cs">
|
||||
<DependentUpon>TracingResultsDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\WaterMeterEventArgs.cs" />
|
||||
<Compile Include="ItemID.cs" />
|
||||
<Compile Include="Mappings\BatchMap.cs" />
|
||||
<Compile Include="Mappings\ComponentsMap.cs" />
|
||||
@@ -101,6 +131,10 @@
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Output\Printers\Enhanced\EnhancedPrinterCfg.cs" />
|
||||
<Compile Include="Output\Printers\Label\LabelPrintDocument.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Output\Printers\Label\LabelPrinterCfg.cs" />
|
||||
<Compile Include="Output\Printers\PrintersCommon.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
@@ -111,11 +145,12 @@
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Output\Printers\OnePerMeter\OnePerMeterPrinterCfg.cs" />
|
||||
<Compile Include="Output\Printers\Table.cs" />
|
||||
<Compile Include="Output\Printers\Zapiska\ZapiskaPrintDocument.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Output\Printers\Zapiska\ZapiskaPrinterCfg.cs" />
|
||||
<Compile Include="Output\Table.cs" />
|
||||
<Compile Include="Output\WMChart.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
@@ -135,6 +170,10 @@
|
||||
<Project>{743DF7DB-C7B6-42EB-986D-0F485E5588E4}</Project>
|
||||
<Name>Config</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\TracingDB\TracingDB.csproj">
|
||||
<Project>{EFEC8A31-3022-4DA7-A8F6-16D30A94C3FF}</Project>
|
||||
<Name>TracingDB</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Users\Users.csproj">
|
||||
<Project>{6E5CB0E9-E1B6-4E5D-AC6E-B1049E180F2B}</Project>
|
||||
<Name>Users</Name>
|
||||
@@ -152,12 +191,24 @@
|
||||
<EmbeddedResource Include="Forms\ListViewEx.resx">
|
||||
<DependentUpon>ListViewEx.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\MoreWMResultsDlg.resx">
|
||||
<DependentUpon>MoreWMResultsDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\OneWMResultsColumnsCtrl.resx">
|
||||
<DependentUpon>OneWMResultsColumnsCtrl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\OneWMResultsRowsCtrl.resx">
|
||||
<DependentUpon>OneWMResultsRowsCtrl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\ResultsConfigCtrl.resx">
|
||||
<DependentUpon>ResultsConfigCtrl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\ResultsConfigDlg.resx">
|
||||
<DependentUpon>ResultsConfigDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\TracingResultsDlg.resx">
|
||||
<DependentUpon>TracingResultsDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
@@ -166,6 +217,7 @@
|
||||
<EmbeddedResource Include="Resources\Strings.de.resx">
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Resources\Strings.fr.resx" />
|
||||
<EmbeddedResource Include="Resources\Strings.it.resx" />
|
||||
<EmbeddedResource Include="Resources\Strings.pl.resx" />
|
||||
<EmbeddedResource Include="Resources\Strings.resx">
|
||||
|
||||
+48
-6
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2016-2018 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2016-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Text;
|
||||
@@ -11,6 +11,7 @@ namespace Results
|
||||
{
|
||||
public static string GetTestName(string name, int repeats, int repetitionNr)
|
||||
{
|
||||
if (name == null) return null;
|
||||
if (repeats == 1) return name;
|
||||
return string.Format("{0} ({1}/{2})", name, repetitionNr, repeats);
|
||||
}
|
||||
@@ -26,21 +27,44 @@ namespace Results
|
||||
case 7: return 29; /// PT7, special
|
||||
case 8: return 36; /// WR13
|
||||
case 9: return 37; /// WR15
|
||||
case 10: return 38; /// WR16
|
||||
case 10: return 38; /// WR14
|
||||
case 11: return 39; /// WR18
|
||||
case 12: return 40; /// WR19
|
||||
case 13: return 41; /// WR20
|
||||
case 14: return 42; /// WR21
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static string BenchNameFromOracleBenchID(int id)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case 4: return "WR9";
|
||||
case 5: return "WR10";
|
||||
case 6: return "WR11";
|
||||
case 7: return "PT7";
|
||||
case 8: return "WR13";
|
||||
case 9: return "WR15";
|
||||
case 10: return "WR14";
|
||||
case 11: return "WR18";
|
||||
case 12: return "WR19";
|
||||
case 13: return "WR20";
|
||||
case 14: return "WR21";
|
||||
default: return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <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, i.e. bit0..bit30).
|
||||
/// </summary>
|
||||
/// <param name="errorFlags">Input</param>
|
||||
/// <returns>Output string</returns>
|
||||
public static string ErrorFlagsStr(int errorFlags)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < 30; i++)
|
||||
for (int i = 0; i < 31; i++)
|
||||
{
|
||||
if ((errorFlags & (1 << i)) != 0)
|
||||
{
|
||||
@@ -54,9 +78,9 @@ namespace Results
|
||||
|
||||
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");
|
||||
#elif BAHRAIN_50
|
||||
#elif BAHRAIN_50 || DUBAJ_50
|
||||
return (useRedGreenColor) ? (passed ? "PASSED|Green" : "FAILED|Red") : (passed ? "PASSED|White" : "FAILED|White");
|
||||
#elif LANG_PL
|
||||
return (useRedGreenColor) ? (passed ? "+|Green" : "-|Red") : (passed ? "+|White" : "-|White");
|
||||
@@ -66,5 +90,23 @@ namespace Results
|
||||
return (useRedGreenColor) ? (passed ? "OK|Green" : "NOK|Red") : (passed ? "OK|White" : "NOK|White");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
public static void GetCounterStates(Results.Entities.Batch batch, int[] counters)
|
||||
{
|
||||
if (batch != null)
|
||||
{
|
||||
batch.Counter1 = ((counters != null) && (counters.Length >= 1)) ? counters[0] : 0;
|
||||
batch.Counter2 = ((counters != null) && (counters.Length >= 2)) ? counters[1] : 0;
|
||||
batch.Counter3 = ((counters != null) && (counters.Length >= 3)) ? counters[2] : 0;
|
||||
batch.Counter4 = ((counters != null) && (counters.Length >= 4)) ? counters[3] : 0;
|
||||
batch.Counter5 = ((counters != null) && (counters.Length >= 5)) ? counters[4] : 0;
|
||||
batch.Counter6 = ((counters != null) && (counters.Length >= 6)) ? counters[5] : 0;
|
||||
batch.Counter7 = ((counters != null) && (counters.Length >= 7)) ? counters[6] : 0;
|
||||
batch.Counter8 = ((counters != null) && (counters.Length >= 8)) ? counters[7] : 0;
|
||||
batch.Counter9 = ((counters != null) && (counters.Length >= 9)) ? counters[8] : 0;
|
||||
batch.Counter10 = ((counters != null) && (counters.Length >= 10)) ? counters[9] : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+155
-64
@@ -144,25 +144,28 @@ namespace Results
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Separator, "Separator", "", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => string.Empty));
|
||||
|
||||
/// 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.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.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.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.Proc_description, Strings.Procedure_description, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.ProcedureDescription)));
|
||||
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())));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_Method_Elde, Strings.Test_method + " Elde ()", Quantity.String, ItemCategory.TestData, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).MethodElde())));
|
||||
|
||||
///
|
||||
/// 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.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_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_main, Strings.Start_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeStart)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_aux, Strings.Start_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeStart)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume, Strings.End_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeEnd)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_main, Strings.End_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeEnd)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_aux, Strings.End_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeEnd)));
|
||||
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.Volume, string.Format("{0} Mt. ()", Strings.VName_Vol), Strings.Tooltip_Vol_Mt, Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeMeter) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeMeter) : string.Empty)));
|
||||
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, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeRef) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeRef) : string.Empty)));
|
||||
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, CompoundMeterId.CompoundMain).VolumeMeter) : string.Empty));
|
||||
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, CompoundMeterId.CompoundAux).VolumeMeter) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume, Strings.Start_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeStart) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeStart) : string.Empty)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_main, Strings.Start_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).VolumeStart) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_aux, Strings.Start_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).VolumeStart) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume, Strings.End_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeEnd) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeEnd) : string.Empty)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_main, Strings.End_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).VolumeEnd) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_aux, Strings.End_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).VolumeEnd) : string.Empty));
|
||||
|
||||
///
|
||||
/// Mass
|
||||
@@ -193,8 +196,10 @@ namespace Results
|
||||
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.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.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.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, "F1", w.GetTestRslt(t).TestTime)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestTimeCorrection, "Test time correction ()", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).TestTimeCorrection)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.TimeBtwnMassMsrmnts, "Time between mass measurements ()", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u, f, p, "F0", w.GetTestRslt(t).TimeBtwnMassMsrmnts)));
|
||||
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, "F0", 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)));
|
||||
@@ -206,13 +211,13 @@ namespace Results
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_from, string.Format("{0} {1}", Strings.VName_Flow, Strings.from), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qfrom())));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_to, string.Format("{0} {1}", Strings.VName_Flow, Strings.to), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qto())));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow, string.Format("{0} v r", Strings.VName_Flow), Strings.Tooltip_Q_v_r, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowVolume)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.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_mean, string.Format("{0} rim ()", Strings.VName_Flow), Strings.Tooltip_Q_rim, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMean)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_min, string.Format("{0} ref min ()", Strings.VName_Flow), Strings.Tooltip_Q_min, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMin)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_max, string.Format("{0} ref max ()", Strings.VName_Flow), Strings.Tooltip_Q_max, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMax)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_start, string.Format("{0} ref start ()",Strings.VName_Flow),Strings.Tooltip_Q_start, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowStart)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_end, string.Format("{0} ref end ()", Strings.VName_Flow), Strings.Tooltip_Q_end, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowEnd)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.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.Qc, string.Format("Qc"), "Calculated water meter flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V5", (w.GetMeterTestRslt(t).TestTime == 0 || w.GetTestRslt(t).PulsesMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV / w.GetMeterTestRslt(t).TestTime * 3.6 * w.GetMeterTestRslt(t).PulsesMaster / w.GetTestRslt(t).PulsesMaster)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv, string.Format("{0} ctv ()", Strings.VName_Flow), "CTV of the flow (mean val.)", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V5", (w.GetMeterTestRslt(t).TestTime == 0 || w.GetTestRslt(t).PulsesMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV / w.GetMeterTestRslt(t).TestTime * 3.6 * w.GetMeterTestRslt(t).PulsesMaster / w.GetTestRslt(t).PulsesMaster)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_min, string.Format("{0} ctv min ()", Strings.VName_Flow), "Min. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowMin / w.GetTestRslt(t).VolumeMaster)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_max, string.Format("{0} ctv max ()", Strings.VName_Flow), "Max. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowMax / w.GetTestRslt(t).VolumeMaster)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_start, string.Format("{0} ctv start ()", Strings.VName_Flow), "Start flow CTV", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowStart / w.GetTestRslt(t).VolumeMaster)));
|
||||
@@ -221,8 +226,9 @@ namespace Results
|
||||
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)))));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.ConstMaster, string.Format("k MID ()"), "Const. of the reference flow meter", Quantity.PulsePerLtr, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", ((w.GetTestRslt(t).ConstMaster < float.Epsilon) ? 0 : (1 / w.GetTestRslt(t).ConstMaster)))));
|
||||
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, "V4", ((w.GetTestRslt(t).ConstMasterRaw < float.Epsilon) ? 0 : (1 / w.GetTestRslt(t).ConstMasterRaw)))));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.ConstMasterCorr,string.Format("k MID corr ()"), "Const. of the ref. flow meter corrected", Quantity.PulsePerLtr, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", ((w.GetTestRslt(t).ConstMasterRaw < float.Epsilon) ? 0 : (1 / w.GetTestRslt(t).ConstMasterCorr)))));
|
||||
|
||||
///
|
||||
/// Temperature
|
||||
@@ -307,14 +313,19 @@ 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.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)));
|
||||
#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.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
|
||||
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) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_heat_mtr_vol, string.Format("{0} rel.hm.vol. ()", Strings.VName_Error), Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).Error) : string.Empty));
|
||||
#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, w.PassedOrErrorFlagsStr()))); /// PL specific result
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.RefFlowmeter, "Ref. flowmeter", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).RefFlowmeter()) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.ResultOrErrorFlags, "Winiki lub E", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.PassedOrErrorFlagsStr()))); /// PL specific result
|
||||
|
||||
///
|
||||
/// Water meter info
|
||||
@@ -366,16 +377,22 @@ namespace Results
|
||||
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)
|
||||
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_aux, Strings.Err_aux + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).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) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_aux, Strings.Err_aux + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).Error) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr_main, string.Format("{0} {1}", Strings.sn, Strings.main), Strings.Tooltip_sn_main, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.SerialNr)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr_aux, string.Format("{0} {1}", Strings.sn, Strings.aux), Strings.Tooltip_sn_aux, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.SerialNrAux)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state_main, Strings.EndState_main, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.EndState)));
|
||||
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
|
||||
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.Program_version, Strings.Ver, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.ProgramVersion)));
|
||||
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.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_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))));
|
||||
@@ -390,51 +407,94 @@ 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))));
|
||||
|
||||
/// 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.Remark, Strings.Remark, Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => FormatStr(f, w.Batch.Remark)));
|
||||
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.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))));
|
||||
|
||||
#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) ? "" : 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) ? "" : FormatDbl(u, f, p, "F1", (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeRef))));
|
||||
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) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy_start, Strings.Energy + " start ()", 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).VolumeStart) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy_end, Strings.Energy + " end ()", 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).VolumeEnd) : string.Empty));
|
||||
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) : string.Empty));
|
||||
#endif
|
||||
|
||||
#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.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.Q2CorrectionDone, "iPerl Q2CorrectionDone", Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => (w.Q2CorrectionDone ? Strings.Yes : Strings.No)));
|
||||
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.Q2CorrLFlow, "iPerl Q2CorrLFlow", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrLFlow)));
|
||||
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)));
|
||||
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.OrigCalibFactorLNA,"iPerl OrigCalibFactorLNA",Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.OrigCalibFactorLNA)));
|
||||
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.Q2ErrWOCorrection, "iPerl Q2ErrWOCorrection", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.Q2ErrWOCorrection)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrectionDone, "iPerl Q2CorrectionDone", Quantity.Boolean,ItemCategory.MeterResult, (w, t, u, f, p) => (((w.Q2CorrRL != 0) || (w.Q2CorrLR != 0)) ? Strings.Yes : Strings.No)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrRFlow, "iPerl Q2Corr RL", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrRL)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrLFlow, "iPerl Q2Corr LR", 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))));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.OraWMTypeID, "OraDB WM Type ID", Quantity.Number, ItemCategory.MeterData, (w, t, u, f, p) => FormatInt(f, w.WaterMeterData.WMTypeId)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.OraWMTypeRev, "OraDB WM Type Rev.", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.WMTypeRevision)));
|
||||
#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.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.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.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.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.E5, "E5 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0010) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E6, "E6 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0020) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E7, "E7 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0040) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E8, "E8 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0080) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E9, "E9 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0100) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E10, "E10 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0200) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E11, "E11 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0400) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E12, "E12 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0800) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E13, "E13 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x1000) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E14, "E14 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x2000) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E15, "E15 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x4000) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E16, "E16 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x8000) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E21, "E21 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x100000) != 0) ? Strings.Yes : Strings.No));
|
||||
|
||||
#if TURA_SPECIAL
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_AssignedSerialNr, "iPerl assigned s/n", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.AssignedSerialNr)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_CompleteSerialNr, "iPerl complete s/n", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.CompleteSerialNr)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_RadioAddress, "iPerl radio address", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.RadioAddress)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_PaletteNr, "iPerl palette nr.", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.PaletteNr)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_UmkartonNr, "iPerl umkarton nr.", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.UmkartonNr)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_TestBench, "Prod iPerl test bench", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.ProdTestBench)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_WMPosition, "Prod iPerl WM position", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.ProdWMPosition)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_UserName, "Prod iPerl user name", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.ProdUserName)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_PurchaseOrder, "Prod iPerl purchase order", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.ProdPurchaseOrder)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_Passed, "Prod iPerl passed", Quantity.Boolean,ItemCategory.MeterResult, (w, t, u, f, p) => FormatBool(f,w.ProdPassed)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_ResultCode, "Prod iPerl result code", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.ProdResultCode)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_Q2CorrRL, "Prod iPerl Q2Corr RL", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.ProdQ2CorrRL)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_Q2CorrLR, "Prod iPerl Q2Corr LR", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.ProdQ2CorrLR)));
|
||||
#endif
|
||||
|
||||
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) => 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.ErrorFlagsStr())));
|
||||
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 & (int)ErrorFlagMask.E1) != 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 & (int)ErrorFlagMask.E2) != 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 & (int)ErrorFlagMask.E3) != 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 & (int)ErrorFlagMask.E4) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E5, "E5 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E5) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E6, "E6 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E6) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E7, "E7 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E7) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E8, "E8 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E8) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E9, "E9 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E9) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E10, "E10 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E10) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E11, "E11 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E11) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E12, "E12 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E12) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E13, "E13 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E13) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E14, "E14 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E14) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E15, "E15 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E15) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E16, "E16 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E16) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E21, "E21 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E21) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E25, "E25 ()", Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => ((w.ErrorFlags & (int)ErrorFlagMask.E25) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E26, "E26 ()", Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => ((w.ErrorFlags & (int)ErrorFlagMask.E26) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E27, "E27 ()", Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => ((w.ErrorFlags & (int)ErrorFlagMask.E27) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.E28, "E28 ()", Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => ((w.ErrorFlags & (int)ErrorFlagMask.E28) != 0) ? Strings.Yes : Strings.No));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestPartStr, "Test part str.", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => FormatEnum(f, (w.GetMeterTestRslt(t) != null) ? w.GetMeterTestRslt(t).TestRslt.Part : 0)));
|
||||
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Table_row_nr, "Table row #", Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? TableRowNr.ToString() : string.Format(f, TableRowNr)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Table_column_nr, "Table column #", Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? TableColumnNr.ToString() : string.Format(f, TableColumnNr)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.WMRemark, 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.Counter1, string.Format(Strings.Counter_0, 1), Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.Batch.Counter1)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Counter2, string.Format(Strings.Counter_0, 2), Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.Batch.Counter2)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Counter3, string.Format(Strings.Counter_0, 3), Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.Batch.Counter3)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Counter4, string.Format(Strings.Counter_0, 4), Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.Batch.Counter4)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Counter5, string.Format(Strings.Counter_0, 5), Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.Batch.Counter5)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Counter6, string.Format(Strings.Counter_0, 6), Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.Batch.Counter6)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Counter7, string.Format(Strings.Counter_0, 7), Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.Batch.Counter7)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Counter8, string.Format(Strings.Counter_0, 8), Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.Batch.Counter8)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Counter9, string.Format(Strings.Counter_0, 9), Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.Batch.Counter9)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Counter10, string.Format(Strings.Counter_0, 10), Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.Batch.Counter10)));
|
||||
}
|
||||
|
||||
/// To be updated by Output.FileWriter or Output.Printer
|
||||
public static int TableRowNr;
|
||||
@@ -443,12 +503,43 @@ namespace Results
|
||||
|
||||
public static string FormatStr(string format, string value)
|
||||
{
|
||||
return string.IsNullOrEmpty(format) ? value : string.Format(format, value);
|
||||
string valueEx = string.IsNullOrEmpty(value) ? string.Empty : value;
|
||||
return string.IsNullOrEmpty(format) ? valueEx : string.Format(format, valueEx);
|
||||
}
|
||||
|
||||
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 FormatEnum(string format, int value)
|
||||
{
|
||||
if (string.IsNullOrEmpty(format))
|
||||
{
|
||||
return value.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] texts = format.Split(new char[] { '~' });
|
||||
|
||||
if (value >= 0 && value < texts.Length)
|
||||
return texts[value];
|
||||
else
|
||||
return value.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml.Serialization;
|
||||
using NHibernate;
|
||||
using Results.Entities;
|
||||
|
||||
namespace ResultsBrowser.Filters
|
||||
{
|
||||
public class BatchNrFilter : IFilter
|
||||
{
|
||||
public static string GetFilterID() { return "BatchNr"; }
|
||||
public static string GetFilterName() { return "Batch number"; }
|
||||
|
||||
///
|
||||
/// Obligatory wrappers
|
||||
///
|
||||
public string GetThisFilterID() { return GetFilterID(); }
|
||||
public void Save(StringBuilder sb) { (new XmlSerializer(this.GetType())).Serialize(new StringWriter(sb), this); }
|
||||
public void Data2UI() { userIface.Data2UI(); }
|
||||
public void UI2Data() { userIface.UI2Data(); }
|
||||
public UserControl GetFilterUI() { return userIface as UserControl; }
|
||||
|
||||
///
|
||||
/// Serialized filter data
|
||||
///
|
||||
public int BatchNr;
|
||||
|
||||
|
||||
private BatchNrFilterUI userIface;
|
||||
|
||||
public BatchNrFilter()
|
||||
{
|
||||
userIface = new BatchNrFilterUI(this);
|
||||
}
|
||||
|
||||
public IList<WaterMeter> ExecuteQuery(ISession[] sessions, IList<WaterMeter> waterMeters)
|
||||
{
|
||||
IList<WaterMeter> filteredWaterMeters = new List<WaterMeter>();
|
||||
|
||||
if (waterMeters == null)
|
||||
{
|
||||
foreach (var se in sessions)
|
||||
{
|
||||
IList<WaterMeter> wms = se.QueryOver<WaterMeter>().List<WaterMeter>();
|
||||
|
||||
foreach (var wm in wms)
|
||||
{
|
||||
if (wm.BatchNr() == BatchNr) filteredWaterMeters.Add(wm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var wm in waterMeters)
|
||||
{
|
||||
if (wm.BatchNr() == BatchNr) filteredWaterMeters.Add(wm);
|
||||
}
|
||||
}
|
||||
|
||||
return filteredWaterMeters;
|
||||
}
|
||||
}
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
namespace ResultsBrowser.Filters
|
||||
{
|
||||
partial class BatchNrFilterUI
|
||||
{
|
||||
/// <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.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.batchNrTextBox = new System.Windows.Forms.TextBox();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.batchNrTextBox);
|
||||
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.groupBox1.Location = new System.Drawing.Point(0, 0);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(835, 40);
|
||||
this.groupBox1.TabIndex = 0;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Batch number";
|
||||
//
|
||||
// batchNrTextBox
|
||||
//
|
||||
this.batchNrTextBox.Location = new System.Drawing.Point(132, 13);
|
||||
this.batchNrTextBox.Name = "batchNrTextBox";
|
||||
this.batchNrTextBox.Size = new System.Drawing.Size(80, 20);
|
||||
this.batchNrTextBox.TabIndex = 0;
|
||||
//
|
||||
// BatchNrFilterUI
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Name = "BatchNrFilterUI";
|
||||
this.Size = new System.Drawing.Size(835, 40);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.TextBox batchNrTextBox;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ResultsBrowser.Filters
|
||||
{
|
||||
public partial class BatchNrFilterUI : UserControl
|
||||
{
|
||||
BatchNrFilter data;
|
||||
|
||||
/// <summary> Used only by Designer </summary>
|
||||
public BatchNrFilterUI()
|
||||
{
|
||||
InitializeComponent();
|
||||
Localize();
|
||||
}
|
||||
|
||||
/// <summary> Used to create the control aby a filter </summary>
|
||||
public BatchNrFilterUI(BatchNrFilter data)
|
||||
{
|
||||
this.data = data;
|
||||
InitializeComponent();
|
||||
Localize();
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
groupBox1.Text = BatchNrFilter.GetFilterName();
|
||||
}
|
||||
|
||||
public void Data2UI()
|
||||
{
|
||||
batchNrTextBox.Text = data.BatchNr.ToString();
|
||||
}
|
||||
|
||||
public void UI2Data()
|
||||
{
|
||||
data.BatchNr = int.Parse(batchNrTextBox.Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,19 +18,23 @@ namespace ResultsBrowser.Filters
|
||||
IDs = new string[]
|
||||
{
|
||||
DateFilter.GetFilterID(),
|
||||
BatchNrFilter.GetFilterID(),
|
||||
ProcedureFilter.GetFilterID(),
|
||||
ProtocolFilter.GetFilterID(),
|
||||
QnFilter.GetFilterID(),
|
||||
SerialNrFilter.GetFilterID(),
|
||||
WMPositionFilter.GetFilterID(),
|
||||
};
|
||||
|
||||
Names = new string[]
|
||||
{
|
||||
DateFilter.GetFilterName(),
|
||||
BatchNrFilter.GetFilterName(),
|
||||
ProcedureFilter.GetFilterName(),
|
||||
ProtocolFilter.GetFilterName(),
|
||||
QnFilter.GetFilterName(),
|
||||
SerialNrFilter.GetFilterName(),
|
||||
WMPositionFilter.GetFilterName(),
|
||||
};
|
||||
|
||||
Count = IDs.Length;
|
||||
@@ -39,11 +43,13 @@ namespace ResultsBrowser.Filters
|
||||
|
||||
public static IFilter GetFilter(string filterID)
|
||||
{
|
||||
if (filterID == DateFilter.GetFilterID()) return new DateFilter();
|
||||
else if (filterID == ProcedureFilter.GetFilterID()) return new ProcedureFilter();
|
||||
else if (filterID == ProtocolFilter.GetFilterID()) return new ProtocolFilter();
|
||||
else if (filterID == QnFilter.GetFilterID()) return new QnFilter();
|
||||
else if (filterID == SerialNrFilter.GetFilterID()) return new SerialNrFilter();
|
||||
if (filterID == DateFilter.GetFilterID()) return new DateFilter();
|
||||
else if (filterID == BatchNrFilter.GetFilterID()) return new BatchNrFilter();
|
||||
else if (filterID == ProcedureFilter.GetFilterID()) return new ProcedureFilter();
|
||||
else if (filterID == ProtocolFilter.GetFilterID()) return new ProtocolFilter();
|
||||
else if (filterID == QnFilter.GetFilterID()) return new QnFilter();
|
||||
else if (filterID == SerialNrFilter.GetFilterID()) return new SerialNrFilter();
|
||||
else if (filterID == WMPositionFilter.GetFilterID()) return new WMPositionFilter();
|
||||
else return null;
|
||||
}
|
||||
|
||||
@@ -53,11 +59,13 @@ namespace ResultsBrowser.Filters
|
||||
try
|
||||
{
|
||||
Type type;
|
||||
if (filterID == DateFilter.GetFilterID()) type = typeof(DateFilter);
|
||||
else if (filterID == ProcedureFilter.GetFilterID()) type = typeof(ProcedureFilter);
|
||||
else if (filterID == ProtocolFilter.GetFilterID()) type = typeof(ProtocolFilter);
|
||||
else if (filterID == QnFilter.GetFilterID()) type = typeof(QnFilter);
|
||||
else if (filterID == SerialNrFilter.GetFilterID()) type = typeof(SerialNrFilter);
|
||||
if (filterID == DateFilter.GetFilterID()) type = typeof(DateFilter);
|
||||
else if (filterID == BatchNrFilter.GetFilterID()) type = typeof(BatchNrFilter);
|
||||
else if (filterID == ProcedureFilter.GetFilterID()) type = typeof(ProcedureFilter);
|
||||
else if (filterID == ProtocolFilter.GetFilterID()) type = typeof(ProtocolFilter);
|
||||
else if (filterID == QnFilter.GetFilterID()) type = typeof(QnFilter);
|
||||
else if (filterID == SerialNrFilter.GetFilterID()) type = typeof(SerialNrFilter);
|
||||
else if (filterID == WMPositionFilter.GetFilterID()) type = typeof(WMPositionFilter);
|
||||
else return null;
|
||||
|
||||
IFilter filter = (new XmlSerializer(type)).Deserialize(new StringReader(serializedText)) as IFilter;
|
||||
|
||||
+3
-3
@@ -48,15 +48,15 @@
|
||||
//
|
||||
this.procedureTextBox.Location = new System.Drawing.Point(132, 13);
|
||||
this.procedureTextBox.Name = "procedureTextBox";
|
||||
this.procedureTextBox.Size = new System.Drawing.Size(138, 20);
|
||||
this.procedureTextBox.Size = new System.Drawing.Size(360, 20);
|
||||
this.procedureTextBox.TabIndex = 0;
|
||||
//
|
||||
// ProcedureFilter
|
||||
// ProcedureFilterUI
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Name = "ProcedureFilter";
|
||||
this.Name = "ProcedureFilterUI";
|
||||
this.Size = new System.Drawing.Size(835, 40);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
|
||||
+3
-3
@@ -48,15 +48,15 @@
|
||||
//
|
||||
this.procedureTextBox.Location = new System.Drawing.Point(132, 13);
|
||||
this.procedureTextBox.Name = "procedureTextBox";
|
||||
this.procedureTextBox.Size = new System.Drawing.Size(138, 20);
|
||||
this.procedureTextBox.Size = new System.Drawing.Size(80, 20);
|
||||
this.procedureTextBox.TabIndex = 0;
|
||||
//
|
||||
// QnFilter
|
||||
// QnFilterUI
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Name = "QnFilter";
|
||||
this.Name = "QnFilterUI";
|
||||
this.Size = new System.Drawing.Size(835, 40);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
|
||||
@@ -30,7 +30,6 @@ namespace ResultsBrowser.Filters
|
||||
///
|
||||
public string SerialNr;
|
||||
|
||||
|
||||
private SerialNrFilterUI userIface;
|
||||
|
||||
public SerialNrFilter()
|
||||
@@ -42,21 +41,50 @@ namespace ResultsBrowser.Filters
|
||||
{
|
||||
IList<WaterMeter> filteredWaterMeters = new List<WaterMeter>();
|
||||
|
||||
if (string.IsNullOrEmpty(SerialNr)) return filteredWaterMeters; /// Empty s/n => Return an empty list of WM-s
|
||||
|
||||
IList<string> serialNumbers = new List<string>();
|
||||
///
|
||||
if (SerialNr[0] == '@')
|
||||
{
|
||||
try
|
||||
{
|
||||
TextReader rdr = new StreamReader(SerialNr.Substring(1));
|
||||
string line = rdr.ReadLine();
|
||||
while (!string.IsNullOrEmpty(line))
|
||||
{
|
||||
serialNumbers.Add(line);
|
||||
line = rdr.ReadLine();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return filteredWaterMeters;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
serialNumbers.Add(SerialNr);
|
||||
}
|
||||
|
||||
if (waterMeters == null)
|
||||
{
|
||||
foreach (var se in sessions)
|
||||
{
|
||||
IList<WaterMeter> wms = se.QueryOver<WaterMeter>()
|
||||
.Where(x => (x.SerialNr == SerialNr))
|
||||
.List<WaterMeter>();
|
||||
foreach (var wm in wms) filteredWaterMeters.Add(wm);
|
||||
foreach (var oneSerialNr in serialNumbers)
|
||||
{
|
||||
IList<WaterMeter> wms = se.QueryOver<WaterMeter>()
|
||||
.Where(x => (x.SerialNr == oneSerialNr))
|
||||
.List<WaterMeter>();
|
||||
foreach (var wm in wms) filteredWaterMeters.Add(wm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var wm in waterMeters)
|
||||
{
|
||||
if (wm.SerialNr == SerialNr) filteredWaterMeters.Add(wm);
|
||||
if (serialNumbers.Contains(wm.SerialNr)) filteredWaterMeters.Add(wm);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-3
@@ -48,15 +48,16 @@
|
||||
//
|
||||
this.serialNrTextBox.Location = new System.Drawing.Point(132, 13);
|
||||
this.serialNrTextBox.Name = "serialNrTextBox";
|
||||
this.serialNrTextBox.Size = new System.Drawing.Size(138, 20);
|
||||
this.serialNrTextBox.Size = new System.Drawing.Size(360, 20);
|
||||
this.serialNrTextBox.TabIndex = 0;
|
||||
this.serialNrTextBox.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.serialNrTextBox_MouseDoubleClick);
|
||||
//
|
||||
// SerialNrFilter
|
||||
// SerialNrFilterUI
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Name = "SerialNrFilter";
|
||||
this.Name = "SerialNrFilterUI";
|
||||
this.Size = new System.Drawing.Size(835, 40);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
|
||||
@@ -35,5 +35,14 @@ namespace ResultsBrowser.Filters
|
||||
{
|
||||
data.SerialNr = serialNrTextBox.Text;
|
||||
}
|
||||
|
||||
private void serialNrTextBox_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
OpenFileDialog dlg = new OpenFileDialog();
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
serialNrTextBox.Text = string.Format("@{0}", dlg.FileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml.Serialization;
|
||||
using NHibernate;
|
||||
using Results.Entities;
|
||||
using ResultsBrowser.Resources;
|
||||
|
||||
namespace ResultsBrowser.Filters
|
||||
{
|
||||
public class WMPositionFilter : IFilter
|
||||
{
|
||||
public static string GetFilterID() { return "WM_position"; }
|
||||
public static string GetFilterName() { return "WM Position"; }
|
||||
|
||||
///
|
||||
/// Obligatory wrappers
|
||||
///
|
||||
public string GetThisFilterID() { return GetFilterID(); }
|
||||
public void Save(StringBuilder sb) { (new XmlSerializer(this.GetType())).Serialize(new StringWriter(sb), this); }
|
||||
public void Data2UI() { userIface.Data2UI(); }
|
||||
public void UI2Data() { userIface.UI2Data(); }
|
||||
public UserControl GetFilterUI() { return userIface as UserControl; }
|
||||
|
||||
///
|
||||
/// Serialized filter data
|
||||
///
|
||||
public int WMPosition;
|
||||
|
||||
|
||||
private WMPositionFilterUI userIface;
|
||||
|
||||
public WMPositionFilter()
|
||||
{
|
||||
userIface = new WMPositionFilterUI(this);
|
||||
}
|
||||
|
||||
public IList<WaterMeter> ExecuteQuery(ISession[] sessions, IList<WaterMeter> waterMeters)
|
||||
{
|
||||
IList<WaterMeter> filteredWaterMeters = new List<WaterMeter>();
|
||||
|
||||
if (waterMeters == null)
|
||||
{
|
||||
foreach (var se in sessions)
|
||||
{
|
||||
IList<Batch> batches = se.QueryOver<Batch>()
|
||||
.List<Batch>();
|
||||
|
||||
foreach (var b in batches)
|
||||
{
|
||||
foreach (var wm in b.WaterMeters) if (wm.WMPosition == this.WMPosition) filteredWaterMeters.Add(wm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var wm in waterMeters)
|
||||
{
|
||||
if (wm.WMPosition == this.WMPosition) filteredWaterMeters.Add(wm);
|
||||
}
|
||||
}
|
||||
|
||||
return filteredWaterMeters;
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user