Compare commits
212
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24413482bc | ||
|
|
65b5164f0b | ||
|
|
b98af02b55 | ||
|
|
4e32d037ea | ||
|
|
5ea9c51f77 | ||
|
|
08c0a61110 | ||
|
|
fdb1e112dc | ||
|
|
870b49d8ad | ||
|
|
17c77758c6 | ||
|
|
3f0124825d | ||
|
|
5507a65170 | ||
|
|
b2099ad68c | ||
|
|
9d1698b462 | ||
|
|
847956f708 | ||
|
|
95d5d16c83 | ||
|
|
b36a76f413 | ||
|
|
1f05cc420c | ||
|
|
eeaf1e1682 | ||
|
|
1905d3644e | ||
|
|
39197ddd71 | ||
|
|
8b8198e298 | ||
|
|
b57ffac9bc | ||
|
|
1dc35e6135 | ||
|
|
5aec3c1ecc | ||
|
|
3603d31add | ||
|
|
be326dae5f | ||
|
|
ce3328fbf6 | ||
|
|
9724e8779a | ||
|
|
f33bc4f167 | ||
|
|
d84588650f | ||
|
|
02747a975a | ||
|
|
5d78f7428b | ||
|
|
d5544d3041 | ||
|
|
d02e06cb9a | ||
|
|
988bcd6387 | ||
|
|
56294bbffc | ||
|
|
3a8f9ea2e0 | ||
|
|
6d9a7e2385 | ||
|
|
dd24c8b073 | ||
|
|
4e12942f5f | ||
|
|
a81858ee9f | ||
|
|
3b211b8644 | ||
|
|
0732e8360f | ||
|
|
c53cb8ace0 | ||
|
|
a58fe1f997 | ||
|
|
cb1a66381f | ||
|
|
535038bce1 | ||
|
|
e651244601 | ||
|
|
b63408cc68 | ||
|
|
bb3a6ff4f3 | ||
|
|
ce0b8af4a0 | ||
|
|
1bc3e5d6eb | ||
|
|
08c2d3b0d8 | ||
|
|
4fda48f7e7 | ||
|
|
dd08ca770d | ||
|
|
c7e87c95da | ||
|
|
79e80e8b6d | ||
|
|
689841cd2d | ||
|
|
0cc21f40af | ||
|
|
e4da4929e4 | ||
|
|
8a846a774f | ||
|
|
51aa0f4e43 | ||
|
|
4e9d1c8281 | ||
|
|
5e790e5d07 | ||
|
|
931a4bcc00 | ||
|
|
d6ae50f4dd | ||
|
|
ef004ce92e | ||
|
|
df6741cf1a | ||
|
|
f083fe568e | ||
|
|
a8e808a510 | ||
|
|
27972aff64 | ||
|
|
0468d9abf5 | ||
|
|
bebb5e5909 | ||
|
|
71c4f8f32f | ||
|
|
1a8ef4f1be | ||
|
|
6be8af6d63 | ||
|
|
68ca5c4901 | ||
|
|
79e1fff45e | ||
|
|
eb142244e4 | ||
|
|
baf7f84343 | ||
|
|
0fc8bb4ea0 | ||
|
|
25856496d8 | ||
|
|
ebf7c97bc6 | ||
|
|
9bfa70d5c1 | ||
|
|
80beb9d54b | ||
|
|
aff25e307d | ||
|
|
ce6896b584 | ||
|
|
9b1a427369 | ||
|
|
78f9b10255 | ||
|
|
061ab99486 | ||
|
|
ef96c06328 | ||
|
|
8f5291332f | ||
|
|
747195fc10 | ||
|
|
0e8bbec3bc | ||
|
|
141b9a7b4c | ||
|
|
595f0c514e | ||
|
|
e1dfe758cd | ||
|
|
6eaa9dad90 | ||
|
|
be9d912489 | ||
|
|
d7e65ff04b | ||
|
|
ff70a11cad | ||
|
|
e201c0ea66 | ||
|
|
1c093caff3 | ||
|
|
48484e1dbb | ||
|
|
068c51157e | ||
|
|
e8e1be644b | ||
|
|
d971831ab8 | ||
|
|
a432bbb5c6 | ||
|
|
95a0cebcf8 | ||
|
|
d22158404d | ||
|
|
4770f3e393 | ||
|
|
d287902f62 | ||
|
|
f74fff9b51 | ||
|
|
bdefc0b8fa | ||
|
|
afa213f8d5 | ||
|
|
7af4e9465c | ||
|
|
6e1b02ebd5 | ||
|
|
93d5398f10 | ||
|
|
baae5655d4 | ||
|
|
b1862e2f02 | ||
|
|
3e7ad6c06c | ||
|
|
768fb69653 | ||
|
|
21183ca801 | ||
|
|
13b3aca95f | ||
|
|
a21766b944 | ||
|
|
6f701adb9e | ||
|
|
e4c6bf5aa6 | ||
|
|
a1edfcc71a | ||
|
|
e2a8d66e48 | ||
|
|
6cf3bd6160 | ||
|
|
84c8ec26b6 | ||
|
|
d27c1b89ad | ||
|
|
f87cbe9e54 | ||
|
|
2a96af3503 | ||
|
|
1e5e0508e4 | ||
|
|
1baba9ee6d | ||
|
|
724872eb43 | ||
|
|
69fde570ce | ||
|
|
9495b9f3a3 | ||
|
|
cdca702738 | ||
|
|
f5786ef93d | ||
|
|
1c27f0df4c | ||
|
|
3f9973f8b8 | ||
|
|
be07d04f67 | ||
|
|
c950cc231c | ||
|
|
8dc45484b0 | ||
|
|
35815fe78a | ||
|
|
b5f8d06e5b | ||
|
|
a9d6fa631c | ||
|
|
878e7be9fa | ||
|
|
4cf4192ebb | ||
|
|
5325d7f6ee | ||
|
|
f54430ccf6 | ||
|
|
71ae636410 | ||
|
|
3732d3255f | ||
|
|
56a9984626 | ||
|
|
29d64c69eb | ||
|
|
63a15fc1de | ||
|
|
d2f3a937ec | ||
|
|
8c15fe34ee | ||
|
|
57793ed382 | ||
|
|
fea9b01922 | ||
|
|
a33e4de467 | ||
|
|
5a1d77dd87 | ||
|
|
ea05871b19 | ||
|
|
229c87f920 | ||
|
|
dd8feaa963 | ||
|
|
8507511776 | ||
|
|
1e8d2975f0 | ||
|
|
1fb76a2167 | ||
|
|
34f8bb226f | ||
|
|
bc3fb0f8a0 | ||
|
|
9416b79b38 | ||
|
|
20171e99a6 | ||
|
|
822ef33da8 | ||
|
|
3bfb34a6ea | ||
|
|
c28828fcdd | ||
|
|
889a370f90 | ||
|
|
a369127850 | ||
|
|
82a3574222 | ||
|
|
f3fc3d3ba4 | ||
|
|
a5a139aff6 | ||
|
|
09da203962 | ||
|
|
77ad6a529d | ||
|
|
54658bdd38 | ||
|
|
809897342a | ||
|
|
70767de3fc | ||
|
|
d62c1ff106 | ||
|
|
bf583e3061 | ||
|
|
270a46982d | ||
|
|
659315c519 | ||
|
|
04db3f975e | ||
|
|
c0e18458aa | ||
|
|
d09316a34a | ||
|
|
8c0ebcb871 | ||
|
|
fcdf1ea16b | ||
|
|
d6261e4d80 | ||
|
|
9f5c4e7347 | ||
|
|
90e58266a9 | ||
|
|
5b5f0ac41e | ||
|
|
ddca028eb2 | ||
|
|
fea7d0dc85 | ||
|
|
1f67899a5c | ||
|
|
2945049288 | ||
|
|
070a76aade | ||
|
|
2c100c7150 | ||
|
|
19b23ea212 | ||
|
|
e5edb90bfd | ||
|
|
2ec611964f | ||
|
|
c007bca797 | ||
|
|
767796662e | ||
|
|
7b321abb30 |
@@ -22,14 +22,20 @@ GenCode128/bin
|
||||
GenCode128/obj
|
||||
GraphLib/bin
|
||||
GraphLib/obj
|
||||
MergeResultsDBs/bin
|
||||
MergeResultsDBs/obj
|
||||
TracingDB/bin
|
||||
TracingDB/obj
|
||||
ResetBatchNr/bin
|
||||
ResetBatchNr/obj
|
||||
RestClient/bin
|
||||
RestClient/obj
|
||||
Results/bin/
|
||||
Results/obj/
|
||||
ResultsBrowser/bin/
|
||||
ResultsBrowser/obj/
|
||||
SchematicDrawing/bin
|
||||
SchematicDrawing/obj
|
||||
Statistics/bin/
|
||||
Statistics/obj/
|
||||
TBF/bin/
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="SerializableDictionary.cs" />
|
||||
<Compile Include="Telegram.cs" />
|
||||
<Compile Include="UIControls\CoolButtonCtrl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using System;
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2019 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2021 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TBF.BenchControl
|
||||
namespace Common
|
||||
{
|
||||
public class Telegram
|
||||
{
|
||||
@@ -39,13 +39,29 @@ namespace TBF.BenchControl
|
||||
/// </summary>
|
||||
/// <param name="data">Data telegram</param>
|
||||
/// <returns>Calculated CRC</returns>
|
||||
public static UInt16 ClaculateTelegramCRC(byte[] data)
|
||||
public static UInt16 CalculateTelegramCRC(byte[] data, int enforcedLen = 0)
|
||||
{
|
||||
int len = (enforcedLen != 0) ? Math.Min(enforcedLen, data.Length) : data.Length;
|
||||
UInt16 crc = crcSeed;
|
||||
for (int i = 0; i < data.Length - 2; i++) UpdateCRC(data[i], ref crc);
|
||||
for (int i = 0; i < len - 2; i++) UpdateCRC(data[i], ref crc);
|
||||
return crc;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the CRC from a data telegram (an array of bytes).
|
||||
/// A complete telegram including two bytes reserved for the CRC
|
||||
/// must be supplied as an argument.
|
||||
/// </summary>
|
||||
/// <param name="data">Data telegram</param>
|
||||
/// <returns>Calculated CRC</returns>
|
||||
public static UInt16 CalculateTelegramCRC(int offset, byte[] data, int enforcedLen = 0)
|
||||
{
|
||||
int len = (enforcedLen != 0) ? Math.Min(enforcedLen, data.Length - offset) : data.Length - offset;
|
||||
UInt16 crc = crcSeed;
|
||||
for (int i = 0; i < len - 2; i++) UpdateCRC(data[offset + i], ref crc);
|
||||
return crc;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This function modifies the last 2 bytes in the message buffer
|
||||
/// by the CRC calculated from the remaining first (Lenght - 2) bytes.
|
||||
@@ -58,7 +74,7 @@ namespace TBF.BenchControl
|
||||
int len = data.Length;
|
||||
if (len < 2) return;
|
||||
|
||||
UInt16 crc = ClaculateTelegramCRC(data);
|
||||
UInt16 crc = CalculateTelegramCRC(data);
|
||||
|
||||
data[len - 2] = (byte)(crc & 0xFF);
|
||||
data[len - 1] = (byte)(crc >> 8);
|
||||
@@ -72,16 +88,38 @@ namespace TBF.BenchControl
|
||||
/// </summary>
|
||||
/// <param name="data">Data telegram</param>
|
||||
/// <returns>true if the CRC in the telegram is correct</returns>
|
||||
public static bool VerifyTelegramCRC(byte[] data)
|
||||
public static bool VerifyTelegramCRC(byte[] data, int enforcedLen = 0)
|
||||
{
|
||||
int len = data.Length;
|
||||
if (data == null || data.Length == 0 || enforcedLen > data.Length) return false;
|
||||
|
||||
int len = (enforcedLen != 0) ? enforcedLen : data.Length;
|
||||
if (len < 2) return false;
|
||||
|
||||
UInt16 crc = ClaculateTelegramCRC(data);
|
||||
UInt16 crc = CalculateTelegramCRC(data, len);
|
||||
|
||||
return (data[len - 2] == (byte)(crc & 0xFF)) && (data[len - 1] == (byte)(crc >> 8));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This function compares the last 2 bytes in the message buffer
|
||||
/// with the CRC calculated from the remaining first (Lenght - 2) bytes.
|
||||
/// A complete telegram including two bytes reserved for the CRC
|
||||
/// must be supplied as an argument.
|
||||
/// </summary>
|
||||
/// <param name="data">Data telegram</param>
|
||||
/// <returns>true if the CRC in the telegram is correct</returns>
|
||||
public static bool VerifyTelegramCRC(int offset, byte[] data, int enforcedLen = 0)
|
||||
{
|
||||
if (data == null || data.Length == 0 || enforcedLen > data.Length - offset) return false;
|
||||
|
||||
int len = (enforcedLen != 0) ? enforcedLen : data.Length - offset;
|
||||
if (len < 2) return false;
|
||||
|
||||
UInt16 crc = CalculateTelegramCRC(offset, data, len);
|
||||
|
||||
return (data[offset + len - 2] == (byte)(crc & 0xFF)) && (data[offset + len - 1] == (byte)(crc >> 8));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -173,7 +211,6 @@ namespace TBF.BenchControl
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static string LogTelegram(string intro, byte[] data, int from = 0, int len = -1)
|
||||
{
|
||||
System.Text.StringBuilder sb = new System.Text.StringBuilder(256);
|
||||
@@ -194,6 +231,7 @@ namespace TBF.BenchControl
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
|
||||
public static string LogTelegram(string intro, IList<byte> data, int from = 0, int len = -1)
|
||||
{
|
||||
System.Text.StringBuilder sb = new System.Text.StringBuilder(256);
|
||||
@@ -215,7 +253,6 @@ namespace TBF.BenchControl
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static string LogTelegram(string intro, string data)
|
||||
{
|
||||
System.Text.StringBuilder sb = new System.Text.StringBuilder(80);
|
||||
+10
-1
@@ -1,4 +1,7 @@
|
||||
using System;
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -8,5 +11,11 @@ namespace Common
|
||||
{
|
||||
public class Utils
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;JUZNA_AFRIKA_NEW</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
@@ -30,7 +30,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;MUNICH</DefineConstants>
|
||||
<DefineConstants>TRACE;JUZNA_AFRIKA_NEW</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
@@ -91,6 +91,7 @@
|
||||
<Compile Include="Entities\Profile.cs" />
|
||||
<Compile Include="Entities\PTest.cs" />
|
||||
<Compile Include="Entities\Test.cs" />
|
||||
<Compile Include="Entities\TestInstance.cs" />
|
||||
<Compile Include="Entities\TransitionSequence.cs" />
|
||||
<Compile Include="Entities\TransitionStep.cs" />
|
||||
<Compile Include="Entities\Uncertainty.cs" />
|
||||
@@ -141,6 +142,10 @@
|
||||
<EmbeddedResource Include="Resources\Strings.zh-CN.resx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Common\Common.csproj">
|
||||
<Project>{c8939821-ba5c-4988-a3d0-bf53b74865c7}</Project>
|
||||
<Name>Common</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Users\Users.csproj">
|
||||
<Project>{6E5CB0E9-E1B6-4E5D-AC6E-B1049E180F2B}</Project>
|
||||
<Name>Users</Name>
|
||||
|
||||
+3
-95
@@ -8,111 +8,19 @@ namespace Config
|
||||
public const string AdminPassword = "staratura";
|
||||
public const string SQLiteDbFName = "SQLite.db";
|
||||
|
||||
#if MUNICH
|
||||
public const int WMsCount = 3;
|
||||
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 || 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 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 DEWA_300 || ROMA_200
|
||||
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 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 || GELSENWASSER
|
||||
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_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;
|
||||
public const int HeatMetersCount = 0;
|
||||
public const int MaxPartNr = WMsCount / LineSize;
|
||||
#elif RUM_MOB
|
||||
public const int WMsCount = 8;
|
||||
public const int LineSize = 8;
|
||||
public const int CompoundWMsCount = 1;
|
||||
public const int HeatMetersCount = 0;
|
||||
public const int MaxPartNr = WMsCount / LineSize;
|
||||
#elif TURA_IPERL || TURA_IPERL_NEW
|
||||
public const int WMsCount = 40;
|
||||
public const int WMsCount = 20;
|
||||
public const int LineSize = 20;
|
||||
public const int CompoundWMsCount = 1;
|
||||
public const int HeatMetersCount = 0;
|
||||
public const int MaxPartNr = WMsCount / LineSize;
|
||||
#elif TURA_SPECIAL || SENTEC
|
||||
public const int WMsCount = 6;
|
||||
public const int LineSize = 6;
|
||||
public const int CompoundWMsCount = 1;
|
||||
public const int HeatMetersCount = 0;
|
||||
public const int MaxPartNr = WMsCount / LineSize;
|
||||
#elif SLM_50
|
||||
public const int WMsCount = 12;
|
||||
public const int LineSize = 12;
|
||||
public const int CompoundWMsCount = 1;
|
||||
public const int HeatMetersCount = 6;
|
||||
public const int MaxPartNr = WMsCount / LineSize;
|
||||
#elif SLM_END || WARSAW_END
|
||||
public const int WMsCount = 10;
|
||||
public const int LineSize = 5;
|
||||
public const int CompoundWMsCount = 1;
|
||||
public const int HeatMetersCount = 0;
|
||||
public const int MaxPartNr = 4;
|
||||
#elif MALTA_WSD25
|
||||
public const int WMsCount = 6;
|
||||
public const int LineSize = 6;
|
||||
public const int CompoundWMsCount = 0;
|
||||
public const int HeatMetersCount = 0;
|
||||
public const int MaxPartNr = WMsCount / LineSize;
|
||||
#endif
|
||||
|
||||
///
|
||||
/// Database related: This object reference is set after a successful user login
|
||||
///
|
||||
public static DatabaseSettings CurrentBench;
|
||||
|
||||
public static double RealDensity = 0; /// true water density [kg/m3]
|
||||
public static double AtTemperature = 0; /// measured at temperature [°C]
|
||||
public static double SampleDensity = 0; /// sample water density measured in an accredited labo [kg/m3]
|
||||
public static double SampleTemp = 0; /// sample temperature when density measured in an accredited labo [°C]
|
||||
public static double Buoyancy = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Config
|
||||
/// <summary>
|
||||
/// Test bench database settings, contains bench name and settings od several databases
|
||||
/// </summary>
|
||||
public class DatabaseSettings : ICloneable
|
||||
public class DatabaseSettings : ICloneable, IComparable
|
||||
{
|
||||
// Public fields
|
||||
public string BenchName;
|
||||
@@ -45,6 +45,12 @@ namespace Config
|
||||
return result;
|
||||
}
|
||||
|
||||
public int CompareTo(object dbs2)
|
||||
{
|
||||
if (!(dbs2 is DatabaseSettings)) return 0;
|
||||
return String.Compare(BenchName, (dbs2 as DatabaseSettings).BenchName);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0} config={1} results={2} events={3} users={4}",
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace Config.Entities
|
||||
public virtual string OriName { get; set; } /// Not mapped to database
|
||||
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
|
||||
public virtual float Qto { get; set; } /// Water flow in [m3/h]
|
||||
public virtual string Selector { get; set; }
|
||||
public virtual string TempMtrUp { get; set; }
|
||||
public virtual string TempMtrDown { get; set; }
|
||||
public virtual string PressMtrUp { get; set; }
|
||||
@@ -46,7 +47,8 @@ namespace Config.Entities
|
||||
|
||||
result.Qfrom = Qfrom;
|
||||
result.Qto = Qto;
|
||||
result.TempMtrUp = TempMtrUp;
|
||||
result.Selector = Selector;
|
||||
result.TempMtrUp = TempMtrUp;
|
||||
result.TempMtrDown = TempMtrDown;
|
||||
result.PressMtrUp = PressMtrUp;
|
||||
result.PressMtrDown = PressMtrDown;
|
||||
|
||||
@@ -13,9 +13,9 @@ namespace Config.Entities
|
||||
public virtual int ItemNr { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual string ClassName { get; set; }
|
||||
public virtual string ParentName { get; set; }
|
||||
public virtual DebugMode Mode { get; set; }
|
||||
public virtual LogLevel Logging { get; set; }
|
||||
public virtual string Parent { get; set; }
|
||||
public virtual DebugMode DebugMode { get; set; }
|
||||
public virtual LogLevel LogLevel { get; set; }
|
||||
public virtual string Parameters { get; set; }
|
||||
public virtual IList<MeasurementCorrection> Corrections { get; set; }
|
||||
public virtual IList<Uncertainty> Uncertainties { get; set; }
|
||||
@@ -37,9 +37,9 @@ namespace Config.Entities
|
||||
result.ItemNr = itemNr;
|
||||
result.Name = name;
|
||||
result.ClassName = className;
|
||||
result.ParentName = parentName;
|
||||
result.Mode = debugLevel;
|
||||
result.Logging = logLevel;
|
||||
result.Parent = parentName;
|
||||
result.DebugMode = debugLevel;
|
||||
result.LogLevel = logLevel;
|
||||
result.Parameters = parameters;
|
||||
return result;
|
||||
}
|
||||
@@ -51,9 +51,9 @@ namespace Config.Entities
|
||||
result.ItemNr = ItemNr;
|
||||
result.Name = Name;
|
||||
result.ClassName = ClassName;
|
||||
result.ParentName = ParentName;
|
||||
result.Mode = Mode;
|
||||
result.Logging = Logging;
|
||||
result.Parent = Parent;
|
||||
result.DebugMode = DebugMode;
|
||||
result.LogLevel = LogLevel;
|
||||
result.Parameters = Parameters;
|
||||
return result;
|
||||
}
|
||||
@@ -62,9 +62,9 @@ namespace Config.Entities
|
||||
{
|
||||
output.WriteLine(Name);
|
||||
output.WriteLine(ClassName);
|
||||
output.WriteLine(ParentName);
|
||||
output.WriteLine(Mode.ToString());
|
||||
output.WriteLine(Logging.ToString());
|
||||
output.WriteLine(Parent);
|
||||
output.WriteLine(DebugMode.ToString());
|
||||
output.WriteLine(LogLevel.ToString());
|
||||
output.Write(Parameters);
|
||||
|
||||
output.Close();
|
||||
@@ -76,28 +76,28 @@ namespace Config.Entities
|
||||
|
||||
result.Name = input.ReadLine();
|
||||
result.ClassName = input.ReadLine();
|
||||
result.ParentName = input.ReadLine();
|
||||
result.Parent = input.ReadLine();
|
||||
|
||||
string line = input.ReadLine();
|
||||
if (line.Equals(DebugMode.DetectedOff.ToString())) result.Mode = DebugMode.DetectedOff;
|
||||
else if (line.Equals(DebugMode.DetectedOn.ToString())) result.Mode = DebugMode.DetectedOn;
|
||||
else if (line.Equals(DebugMode.Normal.ToString())) result.Mode = DebugMode.Normal;
|
||||
else if (line.Equals(DebugMode.AutoDetect.ToString())) result.Mode = DebugMode.AutoDetect;
|
||||
else if (line.Equals(DebugMode.FailureDuringOperation.ToString())) result.Mode = DebugMode.FailureDuringOperation;
|
||||
else if (line.Equals(DebugMode.Off.ToString())) result.Mode = DebugMode.Off;
|
||||
else if (line.Equals(DebugMode.Record.ToString())) result.Mode = DebugMode.Record;
|
||||
else if (line.Equals(DebugMode.Reply.ToString())) result.Mode = DebugMode.Reply;
|
||||
else if (line.Equals(DebugMode.Simulate.ToString())) result.Mode = DebugMode.Simulate;
|
||||
else if (line.Equals(DebugMode.Inherit.ToString())) result.Mode = DebugMode.Inherit;
|
||||
if (line.Equals(DebugMode.DetectedOff.ToString())) result.DebugMode = DebugMode.DetectedOff;
|
||||
else if (line.Equals(DebugMode.DetectedOn.ToString())) result.DebugMode = DebugMode.DetectedOn;
|
||||
else if (line.Equals(DebugMode.Normal.ToString())) result.DebugMode = DebugMode.Normal;
|
||||
else if (line.Equals(DebugMode.AutoDetect.ToString())) result.DebugMode = DebugMode.AutoDetect;
|
||||
else if (line.Equals(DebugMode.FailureDuringOperation.ToString())) result.DebugMode = DebugMode.FailureDuringOperation;
|
||||
else if (line.Equals(DebugMode.Off.ToString())) result.DebugMode = DebugMode.Off;
|
||||
else if (line.Equals(DebugMode.Record.ToString())) result.DebugMode = DebugMode.Record;
|
||||
else if (line.Equals(DebugMode.Reply.ToString())) result.DebugMode = DebugMode.Reply;
|
||||
else if (line.Equals(DebugMode.Simulate.ToString())) result.DebugMode = DebugMode.Simulate;
|
||||
else if (line.Equals(DebugMode.Inherit.ToString())) result.DebugMode = DebugMode.Inherit;
|
||||
|
||||
line = input.ReadLine();
|
||||
if (line.Equals(LogLevel.Off.ToString())) result.Logging = LogLevel.Off;
|
||||
else if (line.Equals(LogLevel.Fatal.ToString())) result.Logging = LogLevel.Fatal;
|
||||
else if (line.Equals(LogLevel.Error.ToString())) result.Logging = LogLevel.Error;
|
||||
else if (line.Equals(LogLevel.Warn.ToString())) result.Logging = LogLevel.Warn;
|
||||
else if (line.Equals(LogLevel.Info.ToString())) result.Logging = LogLevel.Info;
|
||||
else if (line.Equals(LogLevel.Debug.ToString())) result.Logging = LogLevel.Debug;
|
||||
else if (line.Equals(LogLevel.All.ToString())) result.Logging = LogLevel.All;
|
||||
if (line.Equals(LogLevel.Off.ToString())) result.LogLevel = LogLevel.Off;
|
||||
else if (line.Equals(LogLevel.Fatal.ToString())) result.LogLevel = LogLevel.Fatal;
|
||||
else if (line.Equals(LogLevel.Error.ToString())) result.LogLevel = LogLevel.Error;
|
||||
else if (line.Equals(LogLevel.Warn.ToString())) result.LogLevel = LogLevel.Warn;
|
||||
else if (line.Equals(LogLevel.Info.ToString())) result.LogLevel = LogLevel.Info;
|
||||
else if (line.Equals(LogLevel.Debug.ToString())) result.LogLevel = LogLevel.Debug;
|
||||
else if (line.Equals(LogLevel.All.ToString())) result.LogLevel = LogLevel.All;
|
||||
|
||||
result.Parameters = string.Empty;
|
||||
line = input.ReadLine();
|
||||
@@ -118,12 +118,12 @@ namespace Config.Entities
|
||||
result += indent + "ItemNr = " + (ItemNr + 1).ToString() + Environment.NewLine;
|
||||
result += indent + "Name = " + Name + Environment.NewLine;
|
||||
result += indent + "ClassName = " + ClassName + Environment.NewLine;
|
||||
if (ParentName != null)
|
||||
if (Parent != null)
|
||||
{
|
||||
result += indent + "ParentName = " + ParentName + Environment.NewLine;
|
||||
result += indent + "ParentName = " + Parent + Environment.NewLine;
|
||||
}
|
||||
result += indent + "DebugLevel = " + Mode.ToString() + Environment.NewLine;
|
||||
result += indent + "LogLevel = " + Logging.ToString() + Environment.NewLine;
|
||||
result += indent + "DebugLevel = " + DebugMode.ToString() + Environment.NewLine;
|
||||
result += indent + "LogLevel = " + LogLevel.ToString() + Environment.NewLine;
|
||||
result += indent + "Parameters = " + Parameters + Environment.NewLine;
|
||||
|
||||
return result;
|
||||
|
||||
@@ -14,8 +14,9 @@ namespace Config.Entities
|
||||
public virtual string OriName { get; set; } /// Not mapped to database
|
||||
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
|
||||
public virtual float Qto { get; set; } /// Water flow in [m3/h]
|
||||
public virtual string Selector { get; set; }
|
||||
public virtual string Pump { get; set; }
|
||||
public virtual string RegulValvesPct { get; set; } /// Positions of regulation valves in % separated by ';'
|
||||
public virtual string RegVPositions { get; set; } /// Positions of regulation valves in % separated by ';'
|
||||
|
||||
/// Valves
|
||||
public virtual string ValvesOpen { get; set; }
|
||||
@@ -40,12 +41,13 @@ namespace Config.Entities
|
||||
{
|
||||
FeedingPath result = new FeedingPath(name, itemNr);
|
||||
|
||||
result.Qfrom = Qfrom;
|
||||
result.Qto = Qto;
|
||||
result.Pump = Pump;
|
||||
result.RegulValvesPct = RegulValvesPct;
|
||||
result.ValvesOpen = ValvesOpen;
|
||||
result.ValvesClose = ValvesClose;
|
||||
result.Qfrom = Qfrom;
|
||||
result.Qto = Qto;
|
||||
result.Selector = Selector;
|
||||
result.Pump = Pump;
|
||||
result.RegVPositions = RegVPositions;
|
||||
result.ValvesOpen = ValvesOpen;
|
||||
result.ValvesClose = ValvesClose;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Config.Entities
|
||||
/// Returns a list of possible values of one parameter (ComboBox when editing) or null (Textbox when editing).
|
||||
/// </summary>
|
||||
/// <param name="ix">Zero based index of the parameter</param>
|
||||
IList<string> ParamValues(int ix);
|
||||
ICollection<string> ParamValues(int ix);
|
||||
|
||||
/// <summary>
|
||||
/// Returns a parameter value in the string form
|
||||
|
||||
@@ -14,14 +14,14 @@ namespace Config.Entities
|
||||
public virtual string OriName { get; set; } /// Not mapped to database
|
||||
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
|
||||
public virtual float Qto { get; set; } /// Water flow in [m3/h]
|
||||
public virtual string RegulValve { get; set; }
|
||||
public virtual string Selector { get; set; }
|
||||
public virtual string RegValve { get; set; }
|
||||
public virtual string FlowMeter { get; set; }
|
||||
public virtual float PidCoef { get; set; } /// PID coefficient for the regulation path
|
||||
public virtual string StartValve { get; set; }
|
||||
public virtual string Diverter { get; set; }
|
||||
public virtual string TempDiv { get; set; }
|
||||
public virtual string TempMtrDiv { get; set; }
|
||||
public virtual string Scale { get; set; }
|
||||
public virtual string EmptyTankValve { get; set; } /// Not used anywhere
|
||||
|
||||
/// Valves
|
||||
public virtual string ValvesOpen { get; set; }
|
||||
@@ -46,18 +46,18 @@ namespace Config.Entities
|
||||
{
|
||||
OutputPath result = new OutputPath(name, itemNr);
|
||||
|
||||
result.Name = Name;
|
||||
result.Qfrom = Qfrom;
|
||||
result.Qto = Qto;
|
||||
result.RegulValve = RegulValve;
|
||||
result.FlowMeter = FlowMeter;
|
||||
result.PidCoef = PidCoef;
|
||||
result.StartValve = StartValve;
|
||||
result.Diverter = Diverter;
|
||||
result.TempDiv = TempDiv;
|
||||
result.Scale = Scale;
|
||||
result.EmptyTankValve = EmptyTankValve;
|
||||
result.ValvesOpen = ValvesOpen;
|
||||
result.Name = Name;
|
||||
result.Qfrom = Qfrom;
|
||||
result.Qto = Qto;
|
||||
result.Selector = Selector;
|
||||
result.RegValve = RegValve;
|
||||
result.FlowMeter = FlowMeter;
|
||||
result.PidCoef = PidCoef;
|
||||
result.StartValve = StartValve;
|
||||
result.Diverter = Diverter;
|
||||
result.TempMtrDiv = TempMtrDiv;
|
||||
result.Scale = Scale;
|
||||
result.ValvesOpen = ValvesOpen;
|
||||
result.ValvesClose = ValvesClose;
|
||||
|
||||
return result;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2013-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -11,7 +11,7 @@ namespace Config.Entities
|
||||
/// <summary>
|
||||
/// Stores one test procedure, supports revisions and history log
|
||||
/// </summary>
|
||||
public class Procedure : IHasName, IHasItemNr
|
||||
public class Procedure : IHasName, IHasItemNr
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual int ItemNr { get; set; }
|
||||
@@ -53,14 +53,13 @@ namespace Config.Entities
|
||||
public virtual IList<ComponentProcedure> MoreParams { get; set; }
|
||||
public virtual IList<Test> Tests { get; set; }
|
||||
|
||||
TestInstance[] testInstances;
|
||||
|
||||
/// Wrapper
|
||||
public virtual IList<Test> RegularTests()
|
||||
{
|
||||
IList<Test> rslt = new List<Test>();
|
||||
foreach (var t in Tests)
|
||||
{
|
||||
if ((t.Name.Length > 0 && t.Name[0] != '[') || !t.Name.Contains("]")) rslt.Add(t);
|
||||
}
|
||||
foreach (var t in Tests) if (t.IsRegular()) rslt.Add(t);
|
||||
return rslt;
|
||||
}
|
||||
|
||||
@@ -70,6 +69,7 @@ namespace Config.Entities
|
||||
{
|
||||
MoreParams = new List<ComponentProcedure>();
|
||||
Tests = new List<Test>();
|
||||
testInstances = null;
|
||||
|
||||
///
|
||||
/// Default values
|
||||
@@ -96,6 +96,70 @@ namespace Config.Entities
|
||||
ItemNr = itemNr;
|
||||
}
|
||||
|
||||
public virtual TestInstance[] UpdateTestInstances(IList<string> loopStartNames, IList<string> loopEndNames, IList<string> autoTests = null)
|
||||
{
|
||||
List<TestInstance> instances = new List<TestInstance>();
|
||||
|
||||
if (Tests != null)
|
||||
{
|
||||
int i = 0;
|
||||
while (i < Tests.Count)
|
||||
{
|
||||
if (!loopStartNames.Contains(Tests[i].Method) && !loopEndNames.Contains(Tests[i].Method)) /// Loop.End is ignored outside a loop
|
||||
{
|
||||
///
|
||||
/// Outside a loop
|
||||
///
|
||||
for (int j = 1; j <= Tests[i].Repeats; j++)
|
||||
if (Tests[i].BelongsTo(autoTests))
|
||||
instances.Add(new TestInstance(Tests[i], j));
|
||||
}
|
||||
else if (loopStartNames.Contains(Tests[i].Method))
|
||||
{
|
||||
///
|
||||
/// Entering a loop
|
||||
///
|
||||
int loopsCount = Tests[i].Repeats;
|
||||
List<Test> testsInsideLoop = new List<Test>();
|
||||
i++;
|
||||
|
||||
while (i < Tests.Count && !loopEndNames.Contains(Tests[i].Method))
|
||||
{
|
||||
///
|
||||
/// Inside a loop
|
||||
///
|
||||
if (Tests[i].Repeats == loopsCount && !loopStartNames.Contains(Tests[i].Method)) /// Loop.Start is ignored inside a loop
|
||||
{
|
||||
if (Tests[i].BelongsTo(autoTests))
|
||||
testsInsideLoop.Add(Tests[i]);
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
///
|
||||
/// Append instances of tests inside the last loop to the list
|
||||
///
|
||||
for (int j = 1; j <= loopsCount; j++)
|
||||
{
|
||||
foreach (var t in testsInsideLoop)
|
||||
instances.Add(new TestInstance(t, j));
|
||||
}
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
testInstances = instances.ToArray();
|
||||
return testInstances;
|
||||
}
|
||||
|
||||
public virtual TestInstance[] GetTestInstances()
|
||||
{
|
||||
return testInstances;
|
||||
}
|
||||
|
||||
public virtual Procedure Clone()
|
||||
{
|
||||
Procedure result = new Procedure();
|
||||
|
||||
+49
-33
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2013-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -25,7 +25,7 @@ namespace Config.Entities
|
||||
public virtual float Qfrom { get; set; } /// Water flow low limit in [m3/h]
|
||||
public virtual float Qto { get; set; } /// Water flow high limit in [m3/h]
|
||||
public virtual float Volume { get; set; } /// Test volume (target) in [l]
|
||||
public virtual float TstTime { get; set; } /// Test time (estimate) in [s]
|
||||
public virtual float TestTime { get; set; } /// Test time (estimate) in [s]
|
||||
public virtual string Method { get; set; }
|
||||
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
|
||||
@@ -44,8 +44,7 @@ namespace Config.Entities
|
||||
public virtual int TimeFlow2Mass { get; set; } /// Delay time from the flow stable to the 1st mass measurement in [s]
|
||||
public virtual int TimePump2StartV { get; set; } /// Delay time from the start of the pump to opening the start valve in [s]
|
||||
public virtual int TimeStop2Mass { get; set; } /// Delay time from the test end (diverted) to the 2nd mass measuremen in [s]
|
||||
public virtual double TolerRed { get; set; } /// = Filter
|
||||
public virtual string RedType { get; set; }
|
||||
public virtual int ShortPulses { get; set; } /// Short pulses
|
||||
public virtual string FeedingPath { get; set; }
|
||||
public virtual string BenchPath { get; set; }
|
||||
public virtual string OutputPath { get; set; }
|
||||
@@ -53,9 +52,9 @@ namespace Config.Entities
|
||||
#if HEAT_METERS
|
||||
public virtual string HeatMetersPath { get; set; }
|
||||
#endif
|
||||
public virtual string RelTransBefore { get; set; }
|
||||
public virtual string RelTransBetween { get; set; }
|
||||
public virtual string TransitionAfter { get; set; }
|
||||
public virtual string TransBefore { get; set; }
|
||||
public virtual string TransBetween { get; set; }
|
||||
public virtual string TransAfter { get; set; }
|
||||
|
||||
public virtual bool IsOuterLoopStart { get; set; } /// Not mapped to database
|
||||
public virtual bool IsOuterLoopEnd { get; set; } /// Not mapped to database
|
||||
@@ -89,15 +88,15 @@ namespace Config.Entities
|
||||
PumpPower = 60.0f; /// [%]
|
||||
MassRepeats = 0; /// default
|
||||
MassSpread = 0; /// default
|
||||
MassMethod = MassMethod.Scale; /// default
|
||||
MassMethod = MassMethod.Scale; /// default
|
||||
TimeBeforeFlow = 10; /// [s] time before the start of flow control in [s]
|
||||
TimeFlow2Mass = 5; /// [s] time from the flow stable to the 1st mass measurement in [s]
|
||||
TimePump2StartV = 1; /// [s] time from the 1st mass measurement to the test start in [s]
|
||||
TimeStop2Mass = 5; /// [s] between the test end and the final mass measurement
|
||||
TolerRed = 0; /// = Filter parameter
|
||||
RelTransBefore = string.Empty;
|
||||
RelTransBetween = string.Empty;
|
||||
TransitionAfter = string.Empty;
|
||||
ShortPulses = 0; /// Short pulses parameter (0 or 1)
|
||||
TransBefore = string.Empty;
|
||||
TransBetween = string.Empty;
|
||||
TransAfter = string.Empty;
|
||||
}
|
||||
|
||||
public Test(string name, int itemNr, Procedure procedure)
|
||||
@@ -108,6 +107,22 @@ namespace Config.Entities
|
||||
Procedure = procedure;
|
||||
}
|
||||
|
||||
public virtual bool IsRegular()
|
||||
{
|
||||
/// Irregular / event triggered test names have form "[event] TestName"
|
||||
return (Name.Length > 0 && Name[0] != '[') || !Name.Contains("]");
|
||||
}
|
||||
|
||||
public virtual bool BelongsTo(IList<string> autoTests)
|
||||
{
|
||||
if (IsRegular()) return true;
|
||||
|
||||
if (autoTests == null) return false;
|
||||
|
||||
string action = Name.Substring(1, Name.IndexOf(']') - 1);
|
||||
return autoTests.Contains(action);
|
||||
}
|
||||
|
||||
// Makes a new copy of this object (not just a reference)
|
||||
public virtual Test Clone()
|
||||
{
|
||||
@@ -121,7 +136,7 @@ namespace Config.Entities
|
||||
result.Qfrom = Qfrom;
|
||||
result.Qto = Qto;
|
||||
result.Volume = Volume;
|
||||
result.TstTime = TstTime;
|
||||
result.TestTime = TestTime;
|
||||
result.Method = Method;
|
||||
result.ErrLimLo = ErrLimLo;
|
||||
result.ErrLimHi = ErrLimHi;
|
||||
@@ -140,8 +155,7 @@ namespace Config.Entities
|
||||
result.TimeFlow2Mass = TimeFlow2Mass;
|
||||
result.TimePump2StartV = TimePump2StartV;
|
||||
result.TimeStop2Mass = TimeStop2Mass;
|
||||
result.TolerRed = TolerRed;
|
||||
result.RedType = RedType;
|
||||
result.ShortPulses = ShortPulses;
|
||||
result.FeedingPath = FeedingPath;
|
||||
result.BenchPath = BenchPath;
|
||||
result.OutputPath = OutputPath;
|
||||
@@ -149,9 +163,9 @@ namespace Config.Entities
|
||||
#if HEAT_METERS
|
||||
result.HeatMetersPath = HeatMetersPath;
|
||||
#endif
|
||||
result.RelTransBefore = RelTransBefore;
|
||||
result.RelTransBetween = RelTransBetween;
|
||||
result.TransitionAfter = TransitionAfter;
|
||||
result.TransBefore = TransBefore;
|
||||
result.TransBetween = TransBetween;
|
||||
result.TransAfter = TransAfter;
|
||||
foreach (var prms in MoreParams) { result.MoreParams.Add(prms.Clone()); }
|
||||
|
||||
return result;
|
||||
@@ -169,7 +183,7 @@ namespace Config.Entities
|
||||
output.WriteLine(Qfrom.ToString(ci));
|
||||
output.WriteLine(Qto.ToString(ci));
|
||||
output.WriteLine(Volume.ToString(ci));
|
||||
output.WriteLine(TstTime.ToString(ci));
|
||||
output.WriteLine(TestTime.ToString(ci));
|
||||
output.WriteLine(Method);
|
||||
output.WriteLine(ErrLimLo.ToString(ci));
|
||||
output.WriteLine(ErrLimHi.ToString(ci));
|
||||
@@ -188,14 +202,15 @@ namespace Config.Entities
|
||||
output.WriteLine(TimeFlow2Mass.ToString(ci));
|
||||
output.WriteLine(TimePump2StartV.ToString(ci));
|
||||
output.WriteLine(TimeStop2Mass.ToString(ci));
|
||||
output.WriteLine(ShortPulses.ToString(ci));
|
||||
output.WriteLine(FeedingPath);
|
||||
output.WriteLine(BenchPath);
|
||||
output.WriteLine(OutputPath);
|
||||
output.WriteLine(MetersPath);
|
||||
output.WriteLine(RelTransBefore);
|
||||
output.WriteLine(RelTransBetween);
|
||||
output.WriteLine(TransBefore);
|
||||
output.WriteLine(TransBetween);
|
||||
output.WriteLine(Profile);
|
||||
output.WriteLine(TransitionAfter);
|
||||
output.WriteLine(TransAfter);
|
||||
|
||||
foreach (var prms in MoreParams) { prms.Export(output); }
|
||||
output.WriteLine();
|
||||
@@ -220,7 +235,7 @@ namespace Config.Entities
|
||||
tst.Qfrom = float.Parse(input.ReadLine(), ci);
|
||||
tst.Qto = float.Parse(input.ReadLine(), ci);
|
||||
tst.Volume = float.Parse(input.ReadLine(), ci);
|
||||
tst.TstTime = float.Parse(input.ReadLine(), ci);
|
||||
tst.TestTime = float.Parse(input.ReadLine(), ci);
|
||||
tst.Method = input.ReadLine();
|
||||
tst.ErrLimLo = float.Parse(input.ReadLine(), ci);
|
||||
tst.ErrLimHi = float.Parse(input.ReadLine(), ci);
|
||||
@@ -239,17 +254,18 @@ namespace Config.Entities
|
||||
tst.TimeFlow2Mass = int.Parse(input.ReadLine(), ci);
|
||||
tst.TimePump2StartV = int.Parse(input.ReadLine(), ci);
|
||||
tst.TimeStop2Mass = int.Parse(input.ReadLine(), ci);
|
||||
tst.ShortPulses = int.Parse(input.ReadLine(), ci);
|
||||
tst.FeedingPath = input.ReadLine();
|
||||
tst.BenchPath = input.ReadLine();
|
||||
tst.OutputPath = input.ReadLine();
|
||||
tst.MetersPath = input.ReadLine();
|
||||
tst.RelTransBefore = input.ReadLine();
|
||||
tst.RelTransBetween = input.ReadLine();
|
||||
tst.TransBefore = input.ReadLine();
|
||||
tst.TransBetween = input.ReadLine();
|
||||
string line = input.ReadLine();
|
||||
tst.Profile = line.Equals(TestProfile.ProtectedHeatMeter.ToString()) ? TestProfile.ProtectedHeatMeter
|
||||
: line.Equals(TestProfile.UserDefinedHeatMeter.ToString()) ? TestProfile.UserDefinedHeatMeter
|
||||
: line.Equals(TestProfile.Protected.ToString()) ? TestProfile.Protected : TestProfile.UserDefined; /// UserDefined is the default
|
||||
tst.TransitionAfter = input.ReadLine();
|
||||
tst.TransAfter = input.ReadLine();
|
||||
|
||||
while (true)
|
||||
{
|
||||
@@ -282,14 +298,14 @@ namespace Config.Entities
|
||||
ln = inp.ReadLine(); if (ln != Qfrom.ToString(ci)) { diff.AppendFormat(fmt, "Qfrom", Qfrom.ToString(ci), ln); };
|
||||
ln = inp.ReadLine(); if (ln != Qto.ToString(ci)) { diff.AppendFormat(fmt, "Qto", Qto.ToString(ci), ln); };
|
||||
ln = inp.ReadLine(); if (ln != Volume.ToString(ci)) { diff.AppendFormat(fmt, "Volume", Volume.ToString(ci), ln); };
|
||||
ln = inp.ReadLine(); if (ln != TstTime.ToString(ci)) { diff.AppendFormat(fmt, "TstTime", TstTime.ToString(ci), ln); };
|
||||
ln = inp.ReadLine(); if (ln != TestTime.ToString(ci)) { diff.AppendFormat(fmt, "TstTime", TestTime.ToString(ci), ln); };
|
||||
ln = inp.ReadLine(); if (ln != Method) { diff.AppendFormat(fmt, "Method", Method, ln); };
|
||||
ln = inp.ReadLine(); if (ln != ErrLimLo.ToString(ci)) { diff.AppendFormat(fmt, "ErrLimLo", ErrLimLo.ToString(ci), ln); };
|
||||
ln = inp.ReadLine(); if (ln != ErrLimHi.ToString(ci)) { diff.AppendFormat(fmt, "ErrLimHi", ErrLimHi.ToString(ci), ln); };
|
||||
ln = inp.ReadLine(); if (ln != 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 != DoDrainingAfter.ToString(ci)) { diff.AppendFormat(fmt, "Zeroing", DoDrainingAfter.ToString(ci), ln); };
|
||||
ln = inp.ReadLine(); if (ln != DoDraining.ToString(ci)) { diff.AppendFormat(fmt, "DoDraining", DoDraining.ToString(ci), ln); };
|
||||
ln = inp.ReadLine(); if (ln != DoDrainingAfter.ToString(ci)) { diff.AppendFormat(fmt, "DoDrainingAfter", 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); };
|
||||
@@ -305,10 +321,10 @@ namespace Config.Entities
|
||||
ln = inp.ReadLine(); if (ln != BenchPath) { diff.AppendFormat(fmt, "BenchPath", BenchPath, ln); };
|
||||
ln = inp.ReadLine(); if (ln != OutputPath) { diff.AppendFormat(fmt, "OutputPath", OutputPath, ln); };
|
||||
ln = inp.ReadLine(); if (ln != MetersPath) { diff.AppendFormat(fmt, "MetersPath", MetersPath, ln); };
|
||||
ln = inp.ReadLine(); if (ln != RelTransBefore) { diff.AppendFormat(fmt, "RelTransBefore", RelTransBefore, ln); };
|
||||
ln = inp.ReadLine(); if (ln != RelTransBetween) { diff.AppendFormat(fmt, "RelTransBetween", RelTransBetween, ln); };
|
||||
ln = inp.ReadLine(); if (ln != Profile.ToString()) { diff.AppendFormat(fmt, "RelTransAfter", Profile, ln); };
|
||||
ln = inp.ReadLine(); if (ln != TransitionAfter) { diff.AppendFormat(fmt, "TransitionAfter", TransitionAfter, ln); };
|
||||
ln = inp.ReadLine(); if (ln != TransBefore) { diff.AppendFormat(fmt, "TransBefore", TransBefore, ln); };
|
||||
ln = inp.ReadLine(); if (ln != TransBetween) { diff.AppendFormat(fmt, "TransBetween", TransBetween, ln); };
|
||||
ln = inp.ReadLine(); if (ln != Profile.ToString()) { diff.AppendFormat(fmt, "Profile", Profile, ln); };
|
||||
ln = inp.ReadLine(); if (ln != TransAfter) { diff.AppendFormat(fmt, "TransAfter", TransAfter, ln); };
|
||||
|
||||
return diff.ToString();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
|
||||
namespace Config.Entities
|
||||
{
|
||||
public class TestInstance
|
||||
{
|
||||
public Test Test;
|
||||
public int Repetition;
|
||||
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return (Test != null) ? Common.Utils.GetTestName(Test.Name, Test.Repeats, Repetition) : string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public TestInstance(Test test, int repetition)
|
||||
{
|
||||
Test = test;
|
||||
Repetition = repetition;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -15,8 +15,8 @@ namespace Config
|
||||
///
|
||||
/// Wrappers
|
||||
///
|
||||
public static double RealDensity() { return Data.RealDensity; }
|
||||
public static double AtTemperature() { return Data.AtTemperature; }
|
||||
public static double RealDensity() { return Data.SampleDensity; }
|
||||
public static double AtTemperature() { return Data.SampleTemp; }
|
||||
public static double Buoyancy() { return Data.Buoyancy; }
|
||||
|
||||
|
||||
|
||||
@@ -15,10 +15,11 @@ namespace Config.Mappings
|
||||
Map(x => x.Name);
|
||||
Map(x => x.Qfrom);
|
||||
Map(x => x.Qto);
|
||||
Map(x => x.TempMtrUp).Column("TempIn");
|
||||
Map(x => x.TempMtrDown).Column("TempOut");
|
||||
Map(x => x.PressMtrUp).Column("PressIn");
|
||||
Map(x => x.PressMtrDown).Column("PressOut");
|
||||
Map(x => x.Selector);
|
||||
Map(x => x.TempMtrUp);
|
||||
Map(x => x.TempMtrDown);
|
||||
Map(x => x.PressMtrUp);
|
||||
Map(x => x.PressMtrDown);
|
||||
Map(x => x.PressMtrDelta);
|
||||
Map(x => x.StopBFValve);
|
||||
Map(x => x.ValvesOpen)
|
||||
|
||||
@@ -13,10 +13,10 @@ namespace Config.Mappings
|
||||
Id(x => x.Id);
|
||||
Map(x => x.Name);
|
||||
Map(x => x.ClassName);
|
||||
Map(x => x.ParentName);
|
||||
Map(x => x.Parent);
|
||||
Map(x => x.ItemNr);
|
||||
Map(x => x.Mode);
|
||||
Map(x => x.Logging);
|
||||
Map(x => x.DebugMode);
|
||||
Map(x => x.LogLevel);
|
||||
Map(x => x.Parameters)
|
||||
.CustomType("StringClob")
|
||||
.CustomSqlType("varchar(8000)");
|
||||
|
||||
@@ -15,8 +15,9 @@ namespace Config.Mappings
|
||||
Map(x => x.Name);
|
||||
Map(x => x.Qfrom);
|
||||
Map(x => x.Qto);
|
||||
Map(x => x.Selector);
|
||||
Map(x => x.Pump);
|
||||
Map(x => x.RegulValvesPct);
|
||||
Map(x => x.RegVPositions);
|
||||
Map(x => x.ValvesOpen)
|
||||
.CustomType("StringClob")
|
||||
.CustomSqlType("varchar(8000)");
|
||||
|
||||
@@ -15,15 +15,14 @@ namespace Config.Mappings
|
||||
Map(x => x.Name);
|
||||
Map(x => x.Qfrom);
|
||||
Map(x => x.Qto);
|
||||
Map(x => x.RegulValve);
|
||||
Map(x => x.Selector);
|
||||
Map(x => x.RegValve);
|
||||
Map(x => x.FlowMeter);
|
||||
Map(x => x.PidCoef);
|
||||
Map(x => x.StartValve);
|
||||
Map(x => x.Diverter);
|
||||
Map(x => x.TempDiv);
|
||||
Map(x => x.Scale)
|
||||
.Column("Balance");
|
||||
Map(x => x.EmptyTankValve);
|
||||
Map(x => x.TempMtrDiv);
|
||||
Map(x => x.Scale);
|
||||
Map(x => x.ValvesOpen)
|
||||
.CustomType("StringClob")
|
||||
.CustomSqlType("varchar(8000)");
|
||||
|
||||
+10
-19
@@ -16,18 +16,15 @@ namespace Config.Mappings
|
||||
Map(x => x.Part);
|
||||
Map(x => x.Profile);
|
||||
Map(x => x.Publish);
|
||||
Map(x => x.DoEvaluate)
|
||||
.Column("Evaluate");
|
||||
Map(x => x.DoEvaluate);
|
||||
Map(x => x.Qtg);
|
||||
Map(x => x.Qfrom);
|
||||
Map(x => x.Qto);
|
||||
Map(x => x.Volume);
|
||||
Map(x => x.TstTime);
|
||||
Map(x => x.TestTime);
|
||||
Map(x => x.Repeats);
|
||||
Map(x => x.DoDraining)
|
||||
.Column("Emptying");
|
||||
Map(x => x.DoDrainingAfter)
|
||||
.Column("Zeroing");
|
||||
Map(x => x.DoDraining);
|
||||
Map(x => x.DoDrainingAfter);
|
||||
Map(x => x.DoControlWaterTemp);
|
||||
Map(x => x.TempLimLo);
|
||||
Map(x => x.TempLimHi);
|
||||
@@ -35,19 +32,16 @@ namespace Config.Mappings
|
||||
Map(x => x.MassRepeats);
|
||||
Map(x => x.MassSpread);
|
||||
Map(x => x.MassMethod)
|
||||
.CustomType<byte>();
|
||||
.CustomType<byte>();
|
||||
Map(x => x.TimeBeforeFlow);
|
||||
Map(x => x.TimeFlow2Mass);
|
||||
Map(x => x.TimePump2StartV)
|
||||
.Column("TimeMass2Start");
|
||||
Map(x => x.TimePump2StartV);
|
||||
Map(x => x.TimeStop2Mass);
|
||||
Map(x => x.Method);
|
||||
Map(x => x.ErrLimLo);
|
||||
Map(x => x.ErrLimHi);
|
||||
Map(x => x.Uncertainty);
|
||||
Map(x => x.TolerRed)
|
||||
.Column("TolerRed"); /// ???
|
||||
Map(x => x.RedType);
|
||||
Map(x => x.ShortPulses);
|
||||
Map(x => x.FeedingPath);
|
||||
Map(x => x.BenchPath);
|
||||
Map(x => x.OutputPath);
|
||||
@@ -55,12 +49,9 @@ namespace Config.Mappings
|
||||
#if HEAT_METERS
|
||||
Map(x => x.HeatMetersPath);
|
||||
#endif
|
||||
Map(x => x.RelTransBefore)
|
||||
.Column("RelTransBefore");
|
||||
Map(x => x.RelTransBetween)
|
||||
.Column("RelTransBetween");
|
||||
Map(x => x.TransitionAfter)
|
||||
.Column("TransitionAfter");
|
||||
Map(x => x.TransBefore);
|
||||
Map(x => x.TransBetween);
|
||||
Map(x => x.TransAfter);
|
||||
|
||||
HasMany(x => x.MoreParams)
|
||||
.Cascade.All();
|
||||
|
||||
@@ -10,14 +10,16 @@ namespace Config.Mappings
|
||||
public UserMap()
|
||||
{
|
||||
Id(x => x.Id);
|
||||
Map(x => x.UserName).Column("Name");
|
||||
Map(x => x.UserName)
|
||||
.Column("Name");
|
||||
Map(x => x.Number);
|
||||
Map(x => x.Tag);
|
||||
Map(x => x.Password);
|
||||
Map(x => x.Password2);
|
||||
Map(x => x.Password3);
|
||||
Map(x => x.Password4);
|
||||
Map(x => x.FullName).Column("Description");
|
||||
Map(x => x.FullName)
|
||||
.Column("Description");
|
||||
Map(x => x.LastPwChange);
|
||||
HasManyToMany(x => x.Groups)
|
||||
.Cascade.SaveUpdate()
|
||||
|
||||
@@ -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.26.1458.0")]
|
||||
[assembly: AssemblyFileVersion("2.26.1458.0")]
|
||||
[assembly: AssemblyVersion("3.1.1464.0")]
|
||||
[assembly: AssemblyFileVersion("3.1.1464.0")]
|
||||
|
||||
@@ -118,15 +118,15 @@
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Failed" xml:space="preserve">
|
||||
<value>NiO</value>
|
||||
<value>Nicht OK</value>
|
||||
</data>
|
||||
<data name="Passed" xml:space="preserve">
|
||||
<value>iO</value>
|
||||
<value>OK</value>
|
||||
</data>
|
||||
<data name="Error" xml:space="preserve">
|
||||
<value>Fehler</value>
|
||||
</data>
|
||||
<data name="Cannot_open_DB_Cause_0" xml:space="preserve">
|
||||
<value>Datenbank kann nicht geöffnet.\\r\\nUrsache:\\r\\n{0}</value>
|
||||
<value>Datenbank kann nicht geöffnet werden.\\r\\nUrsache:\\r\\n{0}</value>
|
||||
</data>
|
||||
</root>
|
||||
+178
-130
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2016-2018 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2016-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Reflection;
|
||||
@@ -17,24 +17,34 @@ namespace Config
|
||||
#else
|
||||
[Description("degree")] degree,
|
||||
#endif
|
||||
[Description("ml")] ml, /// 1 ml = 0.001 l
|
||||
[Description("l")] l, /// * 1 liter
|
||||
[Description("dm3")] dm3, /// 1 dm3 = 1 liter
|
||||
[Description("m3")] m3, /// 1000 l
|
||||
[Description("gal(UK)")] gal_UK, /// 1 gal(UK) = 4.54609 l
|
||||
[Description("gal(US)")] gal_US, /// 1 gal(US) = 3.78541178 l
|
||||
[Description("dm3")] dm3, /// 1 dm3 = 1 l
|
||||
[Description("US gal")] USgal, /// 1 US gallon = 3.78541178 l
|
||||
[Description("imper.gal")] UKgal, /// 1 imperial gallon = 4.54609 l
|
||||
[Description("cf")] cf, /// 1 cubic foot = 28.316846592 l
|
||||
[Description("m3")] m3, /// 1 m3 = 1000 l
|
||||
|
||||
[Description("l/h")] lph, /// 1 liter/h
|
||||
[Description("m3/h")] m3ph, /// * 1 m3/h = 1000 l/h
|
||||
[Description("l/h")] lph, /// 1 l/h = 0.001 m3/h
|
||||
[Description("cf/h")] cfph, /// 1 cf/h = 0.028316846592 m3/h
|
||||
[Description("l/m")] lpm, /// 1 l/m = 60 l/h = 0.06 m3/h
|
||||
[Description("US gal/m")] USgalpm, /// 1 US gallon per minute = 0.2271247068 m3/h
|
||||
[Description("m3/h")] m3ph, /// * 1 m3/h
|
||||
[Description("l/s")] lps, /// 1 liter/s = 3.6 m3/h
|
||||
[Description("US gal/s")] USgalps, /// 1 US gallon per second = 13.627482408 m3/h
|
||||
[Description("m3/m")] m3pm, /// 1 m3/m = 60 m3/h
|
||||
[Description("cf/s")] cfs, /// 1 cubic foot per second = 101.9406477312 m3/h
|
||||
|
||||
[Description("g")] g, /// 0.001 kg
|
||||
[Description("oz")] oz, /// 0.0283495231 kg
|
||||
[Description("lb")] lb, /// 0.45359237 kg
|
||||
[Description("kg")] kg, /// * 1 kilogram
|
||||
[Description("t")] t, /// 1000 kg
|
||||
[Description("lb")] lb, /// 0.45359237 kg
|
||||
|
||||
[Description("ms")] ms, /// 1 ms = 0.001 s
|
||||
[Description("s")] s, /// * 1 second
|
||||
[Description("min")] min, /// 1 min = 60 s
|
||||
[Description("hr")] hour, /// 1 hour = 60 min = 3600 s
|
||||
[Description("ms")] ms, /// 1 ms = 0.001 s
|
||||
|
||||
[Description("°C")] C, /// * degree Celsius (°C)
|
||||
[Description("°F")] F, /// degree Fahrenheit
|
||||
@@ -42,21 +52,25 @@ namespace Config
|
||||
|
||||
[Description("Pa")] Pa, /// 1 Pa = 0.01 hPa
|
||||
[Description("hPa")] hPa, /// 1 hPa = 100 Pa
|
||||
[Description("kPa")] kPa, /// 1 kPa = 10 HPa
|
||||
[Description("MPa")] MPa, /// 1 MPa = 10000 hPa
|
||||
[Description("mbar")] mbar, /// 1 mbar = 1 hPa = 100 Pa
|
||||
[Description("bar")] bar, /// * 1 Bar = 1000 mbar = 0.1 MPa = 100000 Pa
|
||||
[Description("kPa")] kPa, /// 1 kPa = 10 hPa = 1000 Pa
|
||||
[Description("inHg")] inHg, /// 1 inHg = 33.864 hPa
|
||||
[Description("psi")] psi, /// 1 psi = 0.0689475729 bar
|
||||
[Description("bar")] bar, /// * 1 Bar = 1000 mbar = 0.1 MPa = 100000 Pa
|
||||
[Description("MPa")] MPa, /// 1 MPa = 10000 hPa
|
||||
|
||||
[Description("R%")] RPct, /// * 1 R%
|
||||
|
||||
[Description("%")] Pct, /// * 1 %
|
||||
[Description("promile")] Promile, /// 1 promile = 0.1 %
|
||||
[Description("%")] Pct, /// * 1 %
|
||||
|
||||
[Description("mm")] mm, /// * 1 millimeter
|
||||
[Description("cm")] cm, /// 1 cm = 10 mm
|
||||
[Description("m")] m, /// 1 m = 1000 mm
|
||||
[Description("in")] inch, /// 1 inch = 25.4 mm
|
||||
[Description("dm")] dm, /// 1 dm = 100 mm
|
||||
[Description("ft")] foot, /// 1 foot = 304.8 mm
|
||||
[Description("yd")] yard, /// 1 yard = 914.4 mm
|
||||
[Description("m")] m, /// 1 m = 1000 mm
|
||||
|
||||
[Description("kg/m3")] kgpm3, /// * 1 kg/m3 = 0.001 kg/l
|
||||
[Description("kg/l")] kgpl, /// 1 kg/l = 1000 kg/m3
|
||||
@@ -69,6 +83,7 @@ namespace Config
|
||||
[Description("MWh")] MWh, /// 1 MWh = 3600000000 J
|
||||
|
||||
[Description("uS/cm")] uSpcm, /// * 1 uS/cm
|
||||
[Description("mS/m")] mSpm, /// 1 mS/m = 10 uS/cm
|
||||
|
||||
#if LANG_PL
|
||||
[Description("imp/l")] ppl, /// * 1 pulse/l
|
||||
@@ -81,17 +96,17 @@ namespace Config
|
||||
[Description("dm3/stopień")] dm3pdeg, /// * 1 dm3/degree
|
||||
#else
|
||||
[Description("pulse/l")] ppl, /// * 1 pulse/l
|
||||
[Description("pulse/dm3")] ppdm3, /// * 1 pulse/dm3
|
||||
[Description("degree/l")] degpl, /// * 1 degree/l
|
||||
[Description("degree/dm3")] degpdm3, /// * 1 degree/dm3
|
||||
[Description("l/pulse")] lpp, /// * 1 l/pulse
|
||||
[Description("dm3/pulse")] dm3pp, /// * 1 dm3/pulse
|
||||
[Description("l/degree")] lpdeg, /// * 1 l/degree
|
||||
[Description("dm3/degree")] dm3pdeg, /// * 1 dm3/degree
|
||||
[Description("pulse/dm3")] ppdm3, /// 1 pulse/dm3
|
||||
[Description("degree/l")] degpl, /// 1 degree/l
|
||||
[Description("degree/dm3")] degpdm3, /// 1 degree/dm3
|
||||
[Description("l/pulse")] lpp, /// 1 l/pulse
|
||||
[Description("dm3/pulse")] dm3pp, /// 1 dm3/pulse
|
||||
[Description("l/degree")] lpdeg, /// 1 l/degree
|
||||
[Description("dm3/degree")] dm3pdeg, /// 1 dm3/degree
|
||||
#endif
|
||||
///
|
||||
[Description("pulse/kWh")] ppkWh, /// * 1 pulse/kWh
|
||||
[Description("kWh/pulse")] kWhpp, /// * 1 kWh/pulse
|
||||
[Description("kWh/pulse")] kWhpp, /// 1 kWh/pulse
|
||||
|
||||
Count
|
||||
}
|
||||
@@ -121,6 +136,7 @@ namespace Config
|
||||
[Description("Text")] String,
|
||||
[Description("Boolean")] Boolean,
|
||||
[Description("Datum und Uhrzeit")] DateTime,
|
||||
[Description("Aufgezählt")] Enumerated,
|
||||
#elif LANG_PL
|
||||
[Description("Objętość")] Volume,
|
||||
[Description("Przepływ")] Flow,
|
||||
@@ -143,6 +159,7 @@ namespace Config
|
||||
[Description("Tekst")] String,
|
||||
[Description("Boolean")] Boolean,
|
||||
[Description("Data i czas")] DateTime,
|
||||
[Description("Wyliczone")] Enumerated,
|
||||
#elif LANG_CS
|
||||
[Description("Objem")] Volume,
|
||||
[Description("Průtok")] Flow,
|
||||
@@ -165,6 +182,7 @@ namespace Config
|
||||
[Description("Text")] String,
|
||||
[Description("Boolean")] Boolean,
|
||||
[Description("Datum a čas")] DateTime,
|
||||
[Description("Vyjmenované")] Enumerated,
|
||||
#elif LANG_IT
|
||||
[Description("Volume")] Volume,
|
||||
[Description("Flusso")] Flow,
|
||||
@@ -187,6 +205,7 @@ namespace Config
|
||||
[Description("Stringa")] String,
|
||||
[Description("Boolean")] Boolean,
|
||||
[Description("Data e ora")] DateTime,
|
||||
[Description("Enumerato")] Enumerated,
|
||||
#else
|
||||
[Description("Volume")] Volume,
|
||||
[Description("Flow")] Flow,
|
||||
@@ -209,7 +228,7 @@ namespace Config
|
||||
[Description("String")] String,
|
||||
[Description("Boolean")] Boolean,
|
||||
[Description("Date and time")] DateTime,
|
||||
[Description("Enum")] Enum,
|
||||
[Description("Enumerated")] Enumerated,
|
||||
#endif
|
||||
Count,
|
||||
}
|
||||
@@ -223,8 +242,9 @@ namespace Config
|
||||
|
||||
public static bool IsDefaultUnit(Unit unit)
|
||||
{
|
||||
return unit == Unit.l || unit == Unit.m3ph || unit == Unit.kg || unit == Unit.s || unit == Unit.C || unit == Unit.bar || unit == Unit.RPct ||
|
||||
unit == Unit.Pct || unit == Unit.mm || unit == Unit.kgpm3 || unit == Unit.J || unit == Unit.ppl || unit == Unit.ppkWh || unit == Unit.uSpcm;
|
||||
return unit == Unit.l || unit == Unit.m3ph || unit == Unit.kg || unit == Unit.s || unit == Unit.C ||
|
||||
unit == Unit.bar || unit == Unit.RPct || unit == Unit.Pct || unit == Unit.mm || unit == Unit.kgpm3 ||
|
||||
unit == Unit.J || unit == Unit.uSpcm || unit == Unit.ppl || unit == Unit.ppkWh;
|
||||
}
|
||||
|
||||
public static bool IsQuantity(Unit units, Quantity quantity)
|
||||
@@ -238,61 +258,75 @@ namespace Config
|
||||
{
|
||||
case Unit.pulse:
|
||||
case Unit.degree:
|
||||
return Config.Quantity.Pulses;
|
||||
return Quantity.Pulses;
|
||||
|
||||
case Unit.ml:
|
||||
case Unit.l:
|
||||
case Unit.dm3:
|
||||
case Unit.USgal:
|
||||
case Unit.UKgal:
|
||||
case Unit.cf:
|
||||
case Unit.m3:
|
||||
case Unit.gal_UK:
|
||||
case Unit.gal_US:
|
||||
return Config.Quantity.Volume;
|
||||
return Quantity.Volume;
|
||||
|
||||
case Unit.lph:
|
||||
case Unit.cfph:
|
||||
case Unit.lpm:
|
||||
case Unit.USgalpm:
|
||||
case Unit.m3ph:
|
||||
return Config.Quantity.Flow;
|
||||
case Unit.lps:
|
||||
case Unit.USgalps:
|
||||
case Unit.m3pm:
|
||||
case Unit.cfs:
|
||||
return Quantity.Flow;
|
||||
|
||||
case Unit.g:
|
||||
case Unit.oz:
|
||||
case Unit.lb:
|
||||
case Unit.kg:
|
||||
case Unit.t:
|
||||
case Unit.lb:
|
||||
return Config.Quantity.Mass;
|
||||
return Quantity.Mass;
|
||||
|
||||
case Unit.ms:
|
||||
case Unit.s:
|
||||
case Unit.min:
|
||||
case Unit.hour:
|
||||
case Unit.ms:
|
||||
return Config.Quantity.Time;
|
||||
return Quantity.Time;
|
||||
|
||||
case Unit.C:
|
||||
case Unit.F:
|
||||
case Unit.K:
|
||||
return Config.Quantity.Temperature;
|
||||
return Quantity.Temperature;
|
||||
|
||||
case Unit.Pa:
|
||||
case Unit.hPa:
|
||||
case Unit.mbar:
|
||||
case Unit.kPa:
|
||||
case Unit.inHg:
|
||||
case Unit.psi:
|
||||
case Unit.bar:
|
||||
case Unit.MPa:
|
||||
case Unit.inHg:
|
||||
return Config.Quantity.Pressure;
|
||||
return Quantity.Pressure;
|
||||
|
||||
case Unit.RPct:
|
||||
return Config.Quantity.Humidity;
|
||||
return Quantity.Humidity;
|
||||
|
||||
case Unit.Pct:
|
||||
case Unit.Promile:
|
||||
return Config.Quantity.Error;
|
||||
case Unit.Pct:
|
||||
return Quantity.Error;
|
||||
|
||||
case Unit.mm:
|
||||
case Unit.cm:
|
||||
case Unit.m:
|
||||
case Unit.inch:
|
||||
return Config.Quantity.Length;
|
||||
case Unit.dm:
|
||||
case Unit.foot:
|
||||
case Unit.yard:
|
||||
case Unit.m:
|
||||
return Quantity.Length;
|
||||
|
||||
case Unit.kgpm3:
|
||||
case Unit.kgpl:
|
||||
return Config.Quantity.Density;
|
||||
return Quantity.Density;
|
||||
|
||||
case Unit.J:
|
||||
case Unit.kJ:
|
||||
@@ -300,7 +334,11 @@ namespace Config
|
||||
case Unit.Wh:
|
||||
case Unit.kWh:
|
||||
case Unit.MWh:
|
||||
return Config.Quantity.Energy;
|
||||
return Quantity.Energy;
|
||||
|
||||
case Unit.uSpcm:
|
||||
case Unit.mSpm:
|
||||
return Quantity.Conductivity;
|
||||
|
||||
case Unit.ppl:
|
||||
case Unit.ppdm3:
|
||||
@@ -310,17 +348,14 @@ namespace Config
|
||||
case Unit.dm3pp:
|
||||
case Unit.lpdeg:
|
||||
case Unit.dm3pdeg:
|
||||
return Config.Quantity.PulsePerLtr;
|
||||
return Quantity.PulsePerLtr;
|
||||
|
||||
case Unit.ppkWh:
|
||||
case Unit.kWhpp:
|
||||
return Config.Quantity.PulsePerKWh;
|
||||
|
||||
case Unit.uSpcm:
|
||||
return Config.Quantity.Conductivity;
|
||||
return Quantity.PulsePerKWh;
|
||||
|
||||
default:
|
||||
return Config.Quantity.Number;
|
||||
return Quantity.Number;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,77 +376,83 @@ namespace Config
|
||||
public static bool IsConductivity(Unit units) { return IsQuantity(units, Config.Quantity.Conductivity); }
|
||||
|
||||
|
||||
|
||||
public static double ConvertTo(Unit units, double v)
|
||||
{
|
||||
switch (units)
|
||||
{
|
||||
/// Volume: internal representation in l
|
||||
case Unit.dm3:
|
||||
case Unit.l: return v; /// 1 liter
|
||||
case Unit.m3: return 0.001 * v; /// 1 m3 = 1000 l
|
||||
case Unit.gal_UK: return 0.21996925 * v; /// 1 gal(UK) = 4.54609 l
|
||||
case Unit.gal_US: return 0.26417205 * v; /// 1 gal(US) = 3.78541178 l
|
||||
case Unit.ml: return 1000 * v; /// 1 ml = 0.001 l
|
||||
case Unit.USgal: return 0.26417205 * v; /// 1 gal(US) = 3.78541178 l
|
||||
case Unit.UKgal: return 0.21996925 * v; /// 1 gal(UK) = 4.54609 l
|
||||
case Unit.cf: return 0.0353146667215 * v; /// 1 cubic foot = 28.316846592 l
|
||||
case Unit.m3: return 0.001 * v; /// 1 m3 = 1000 l
|
||||
|
||||
/// Flow: internal representation in m3/h
|
||||
case Unit.lph: return 1000 * v; /// 1 liter/h
|
||||
case Unit.m3ph: return v; /// 1 m3/h = 1000 l/h
|
||||
case Unit.lph: return 1000 * v; /// 1 l/h
|
||||
case Unit.cfph: return 35.3146667214886 * v;/// 1 cf/h
|
||||
case Unit.lpm: return v / 0.06; /// 1 l/m
|
||||
case Unit.USgalpm: return 4.40286754395493 * v;/// 1 US gallon per minute
|
||||
case Unit.lps: return v / 3.6; /// 1 l/s
|
||||
case Unit.USgalps: return 0.0733811257326 * v; /// 1 US gallon per second
|
||||
case Unit.m3pm: return v / 60; /// 1 m3/m
|
||||
case Unit.cfs: return 0.009809629644858 * v; /// 1 cubic foot per second
|
||||
|
||||
/// Mass: internal representation in kg
|
||||
case Unit.g: return 1000 * v; /// 1 g = 0.001 kg
|
||||
case Unit.kg: return v; /// 1 kilogram
|
||||
case Unit.t: return 0.001 * v; /// 1 t = 1000 kg
|
||||
case Unit.lb: return 2.2046226 * v; /// 1 lb = 0.45359237 kg
|
||||
case Unit.g: return 1000 * v; /// 1 g = 0.001 kg
|
||||
case Unit.oz: return 35.273962 * v; /// 1 oz = 0.0283495231 kg
|
||||
case Unit.lb: return 2.2046226 * v; /// 1 lb = 0.45359237 kg
|
||||
case Unit.t: return 0.001 * v; /// 1 t = 1000 kg
|
||||
|
||||
/// Time or duration: internal representation in seconds [s]
|
||||
case Unit.s: return v;
|
||||
case Unit.ms: return 1000 * v;
|
||||
case Unit.min: return v / 60;
|
||||
case Unit.hour: return v / 3600;
|
||||
case Unit.ms: return 1000 * v;
|
||||
|
||||
/// Temperature: internal representation in °C
|
||||
case Unit.C: return v; /// degree Celsius (°C)
|
||||
case Unit.F: return 1.8 * v + 32; /// degree Fahrenheit
|
||||
case Unit.K: return v + 273.15; /// degree Kelvin
|
||||
case Unit.F: return 1.8 * v + 32; /// degree Fahrenheit
|
||||
case Unit.K: return v + 273.15; /// degree Kelvin
|
||||
|
||||
/// Pressure: internal representation in bar = 0.1 MPa
|
||||
case Unit.Pa: return 100000 * v; /// 1 hPa = 100 Pa
|
||||
case Unit.hPa: return 1000 * v; /// 1 hPa = 100 Pa
|
||||
case Unit.mbar: return 1000 * v; /// 1 mbar = 1 hPa = 100 Pa
|
||||
case Unit.kPa: return 100 * v; /// 1 kPa = 10 HPa
|
||||
case Unit.bar: return v; /// 1 bar = 1000 mbar = 100000 Pa
|
||||
case Unit.MPa: return 0.1 * v; /// 1 MPa = 10000 hPa
|
||||
case Unit.inHg: return 29.53 * v; /// 1 inHg = 33.864 hPa
|
||||
case Unit.Pa: return 100000 * v; /// 1 hPa = 100 Pa
|
||||
case Unit.hPa: return 1000 * v; /// 1 hPa = 100 Pa
|
||||
case Unit.mbar: return 1000 * v; /// 1 mbar = 1 hPa = 100 Pa
|
||||
case Unit.kPa: return 100 * v; /// 1 kPa = 10 HPa
|
||||
case Unit.inHg: return 29.53 * v; /// 1 inHg =
|
||||
case Unit.psi: return 14.5037738 * v; /// 1 psi =
|
||||
case Unit.MPa: return 0.1 * v; /// 1 MPa = 10000 hPa
|
||||
|
||||
/// Error: internal representation in %
|
||||
case Unit.Pct: return v; /// 1 %
|
||||
case Unit.Promile: return 10 * v; /// 1 promile = 0.1 %
|
||||
/// Relative error: internal representation in %
|
||||
case Unit.Promile: return 10 * v; /// 1 promile = 0.1 %
|
||||
|
||||
/// Diameter, length: internal representation in mm
|
||||
case Unit.mm: return v; /// 1 mm
|
||||
case Unit.cm: return 0.1 * v; /// 1 cm = 10 mm
|
||||
case Unit.m: return 0.001 * v; /// 1 m = 1000 mm
|
||||
case Unit.inch: return v / 25.4; /// 1 inch = 25.4 mm
|
||||
|
||||
case Unit.cm: return 0.1 * v; /// 1 cm = 10 mm
|
||||
case Unit.inch: return v / 25.4; /// 1 inch = 25.4 mm
|
||||
case Unit.dm: return 0.01 * v; /// 1 dm = 100 mm
|
||||
case Unit.foot: return v / 304.8; /// 1 foot = 304.8 mm
|
||||
case Unit.yard: return v / 914.4; /// 1 yard = 914,4 mm
|
||||
case Unit.m: return 0.001 * v; /// 1 m = 1000 mm
|
||||
|
||||
/// Density: internal representation in kg/m3
|
||||
case Unit.kgpm3: return v;
|
||||
case Unit.kgpl: return 0.001 * v;
|
||||
|
||||
/// Energy, internal representation in Joul
|
||||
case Unit.J: return v; /// 1 Joul
|
||||
case Unit.kJ: return 0.001 * v; /// 1 kJ = 1000 J
|
||||
case Unit.MJ: return 0.000001 * v; /// 1 kJ = 1000000 J
|
||||
case Unit.Wh: return v / 3600.0; /// 1 Wh = 3600 J
|
||||
case Unit.kWh: return v / 3600000.0; /// 1 kWh = 3600000 J
|
||||
case Unit.MWh: return v / 3600000000.0;/// 1 MWh = 3600000000 J
|
||||
case Unit.kJ: return 0.001 * v; /// 1 kJ = 1000 J
|
||||
case Unit.MJ: return 0.000001 * v; /// 1 kJ = 1000000 J
|
||||
case Unit.Wh: return v / 3600.0; /// 1 Wh = 3600 J
|
||||
case Unit.kWh: return v / 3600000.0; /// 1 kWh = 3600000 J
|
||||
case Unit.MWh: return v / 3600000000.0; /// 1 MWh = 3600000000 J
|
||||
|
||||
/// Electrical conductivity
|
||||
case Unit.mSpm: return 0.1 * v;
|
||||
|
||||
/// Invert pulses
|
||||
case Unit.kWhpp:
|
||||
case Unit.lpp:
|
||||
case Unit.dm3pp:
|
||||
case Unit.lpdeg:
|
||||
case Unit.dm3pdeg: return ((v <= float.Epsilon) ? 0 : 1 / v);
|
||||
case Unit.dm3pdeg: return (v <= float.Epsilon) ? 0 : 1/v;
|
||||
|
||||
default: return v;
|
||||
default: return v; /// Do not convert
|
||||
}
|
||||
}
|
||||
|
||||
@@ -420,71 +461,78 @@ namespace Config
|
||||
switch (units)
|
||||
{
|
||||
/// Volume: internal representation in l
|
||||
case Unit.dm3:
|
||||
case Unit.l: return v; /// 1 liter
|
||||
case Unit.m3: return 1000 * v; /// 1000 l
|
||||
case Unit.gal_UK: return 4.54609 * v; /// 1 gal(UK) = 4.54609 l
|
||||
case Unit.gal_US: return 3.78541178 * v; /// 1 gal(US) = 3.78541178 l
|
||||
case Unit.ml: return 0.001 * v; /// 0.001 l
|
||||
case Unit.USgal: return 3.78541178 * v; /// 1 gal(US) = 3.78541178 l
|
||||
case Unit.UKgal: return 4.54609 * v; /// 1 gal(UK) = 4.54609 l
|
||||
case Unit.cf: return 28.316846592 * v; /// 1 cubic foot = 28.316846592 l
|
||||
case Unit.m3: return 1000 * v; /// 1000 l
|
||||
|
||||
/// Flow: internal representation in m3/h
|
||||
case Unit.lph: return 0.001 * v; /// 1 liter/h
|
||||
case Unit.m3ph: return v; /// 1 m3/h = 1000 l/h
|
||||
case Unit.lph: return 0.001 * v; /// 1 l/h
|
||||
case Unit.cfph: return 0.028316846592 * v; /// 1 cf/h
|
||||
case Unit.lpm: return 0.06 * v; /// 1 l/m
|
||||
case Unit.USgalpm: return 0.2271247068 * v; /// 1 US gallon per minute
|
||||
case Unit.lps: return 3.6 * v; /// 1 l/s
|
||||
case Unit.USgalps: return 13.627482408 * v; /// 1 US gallon per second
|
||||
case Unit.m3pm: return 60 * v; /// 1 m3/m
|
||||
case Unit.cfs: return 101.9406477312 * v; /// 1 cubic foot per second
|
||||
|
||||
/// Mass: internal representation in kg
|
||||
case Unit.g: return 0.001 * v; /// 1 g = 0.001 kg
|
||||
case Unit.kg: return v; /// 1 kilogram
|
||||
case Unit.t: return 1000 * v; /// 1 t = 1000 kg
|
||||
case Unit.lb: return 0.45359237 * v; /// 1 lb = 0.45359237 kg
|
||||
case Unit.g: return 0.001 * v; /// 1 g = 0.001 kg
|
||||
case Unit.oz: return 0.0283495231 * v; /// 1 oz = 0.0283495231 kg
|
||||
case Unit.lb: return 0.45359237 * v; /// 1 lb = 0.45359237 kg
|
||||
case Unit.t: return 1000 * v; /// 1 t = 1000 kg
|
||||
|
||||
/// Time or duration: internal representation in seconds [s]
|
||||
case Unit.s: return v;
|
||||
case Unit.ms: return 0.001 * v;
|
||||
case Unit.min: return 60 * v;
|
||||
case Unit.hour: return 3600 * v;
|
||||
case Unit.ms: return v / 1000;
|
||||
|
||||
/// Temperature: internal representation in °C
|
||||
case Unit.C: return v; /// degree Celsius (°C)
|
||||
case Unit.F: return 5 * (v-32) / 9; /// degree Fahrenheit
|
||||
case Unit.K: return v - 273.15; /// degree Kelvin
|
||||
case Unit.F: return 5 * (v - 32) / 9; /// degree Fahrenheit
|
||||
case Unit.K: return v - 273.15; /// degree Kelvin
|
||||
|
||||
/// Pressure: internal representation in bar = 0.1 MPa
|
||||
case Unit.Pa: return 0.00001 * v; /// 1 hPa = 100 Pa
|
||||
case Unit.hPa: return 0.001 * v; /// 1 hPa = 100 Pa
|
||||
case Unit.mbar: return 0.001 * v; /// 1 mbar = 1 hPa = 100 Pa
|
||||
case Unit.kPa: return 0.01 * v; /// 1 kPa = 10 HPa
|
||||
case Unit.bar: return v; /// 1 bar = 1000 mbar = 100000 Pa
|
||||
case Unit.MPa: return 10 * v; /// 1 MPa = 10000 hPa
|
||||
case Unit.inHg: return 0.033864 * v; /// 1 inHg = 33.864 hPa
|
||||
case Unit.Pa: return 0.00001 * v; /// 1 hPa = 100 Pa
|
||||
case Unit.hPa: return 0.001 * v; /// 1 hPa = 100 Pa
|
||||
case Unit.mbar: return 0.001 * v; /// 1 mbar = 1 hPa = 100 Pa
|
||||
case Unit.kPa: return 0.01 * v; /// 1 kPa = 10 HPa
|
||||
case Unit.inHg: return 0.033864 * v; /// 1 inHg = 33.864 hPa
|
||||
case Unit.psi: return 0.0689475729 * v; /// 1 psi = 0.0689475729 bar
|
||||
case Unit.MPa: return 10 * v; /// 1 MPa = 10000 hPa
|
||||
|
||||
/// Error: internal representation in %
|
||||
case Unit.Pct: return v; /// 1 %
|
||||
case Unit.Promile: return 0.1 * v; /// 1 promile = 0.1 %
|
||||
/// Relative error: internal representation in %
|
||||
case Unit.Promile: return 0.1 * v; /// 1 promile = 0.1 %
|
||||
|
||||
/// Diameter, length: internal representation in mm
|
||||
case Unit.mm: return v; /// 1 mm
|
||||
case Unit.cm: return 10 * v; /// 1 cm = 10 mm
|
||||
case Unit.m: return 1000 * v; /// 1 m = 1000 mm
|
||||
case Unit.inch: return 25.4 * v; /// 1 inch = 25.4 mm
|
||||
case Unit.cm: return 10 * v; /// 1 cm = 10 mm
|
||||
case Unit.inch: return 25.4 * v; /// 1 inch = 25.4 mm
|
||||
case Unit.dm: return 100 * v; /// 1 dm = 100 mm
|
||||
case Unit.foot: return 304.8 * v; /// 1 foot = 304.8 mm
|
||||
case Unit.yard: return 914.4 * v; /// 1 yard = 914,4 mm
|
||||
case Unit.m: return 1000 * v; /// 1 m = 1000 mm
|
||||
|
||||
/// Density: internal representation in kg/m3
|
||||
case Unit.kgpm3: return v;
|
||||
case Unit.kgpl: return 1000 * v;
|
||||
|
||||
/// Energy, internal representation in Joul
|
||||
case Unit.J: return v; /// 1 Joul
|
||||
case Unit.kJ: return 1000 * v; /// 1 kJ = 1000 J
|
||||
case Unit.MJ: return 1000000 * v; /// 1 kJ = 1000000 J
|
||||
case Unit.Wh: return 3600 * v; /// 1 Wh = 3600 J
|
||||
case Unit.kWh: return 3600000 * v; /// 1 kWh = 3600000 J
|
||||
case Unit.MWh: return 3600000000 * v; /// 1 kWh = 3600000000 J
|
||||
case Unit.kJ: return 1000 * v; /// 1 kJ = 1000 J
|
||||
case Unit.MJ: return 1000000 * v; /// 1 kJ = 1000000 J
|
||||
case Unit.Wh: return 3600 * v; /// 1 Wh = 3600 J
|
||||
case Unit.kWh: return 3600000 * v; /// 1 kWh = 3600000 J
|
||||
case Unit.MWh: return 3600000000 * v; /// 1 kWh = 3600000000 J
|
||||
|
||||
/// Electrical conductivity
|
||||
case Unit.mSpm: return 10 * v;
|
||||
|
||||
/// Invert
|
||||
case Unit.kWhpp:
|
||||
case Unit.lpp:
|
||||
case Unit.dm3pp:
|
||||
case Unit.lpdeg:
|
||||
case Unit.dm3pdeg: return ((v == 0) ? 0 : 1 / v);
|
||||
case Unit.dm3pdeg: return (v <= float.Epsilon) ? 0 : 1/v;
|
||||
|
||||
default: return v;
|
||||
default: return v; /// Do not convert
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+324
-18
@@ -13,22 +13,28 @@ namespace DataStreamInterface
|
||||
degree,
|
||||
|
||||
/// Volume
|
||||
ml, /// 0.001 l
|
||||
l, /// * 1 liter = 1 l
|
||||
ml, /// 1 ml = 0.001 l
|
||||
l, /// * 1 liter
|
||||
dm3, /// 1 dm3 = 1 l
|
||||
m3, /// 1000 l
|
||||
gal_UK, /// 1 gal(UK) = 4.54609 l
|
||||
gal_US, /// 1 gal(US) = 3.78541178 l
|
||||
USgal, /// 1 US gallon = 3.78541178 l
|
||||
UKgal, /// 1 imperial gallon = 4.54609 l
|
||||
cf, /// 1 cubic foot = 28.316846592 l
|
||||
m3, /// 1 m3 = 1000 l
|
||||
|
||||
/// Flow
|
||||
lph, /// 1 liter/h
|
||||
m3ph, /// * 1 m3/h = 1000 l/h
|
||||
lph, /// 1 l/h = 0.001 m3/h
|
||||
lpm, /// 1 l/m = 60 l/h = 0.06 m3/h
|
||||
m3ph, /// * 1 m3/h
|
||||
lps, /// 1 liter/s = 3.6 m3/h
|
||||
USgalps, /// 1 US gallon per second = 13.627482408 m3/h
|
||||
m3pm, /// 1 m3/m = 60 m3/h
|
||||
cfs, /// 1 cubic foot per second = 101.9406477312 m3/h
|
||||
|
||||
/// Mass
|
||||
g, /// 0.001 kg
|
||||
lb, /// 0.45359237 kg
|
||||
kg, /// * 1 kilogram
|
||||
t, /// 1000 kg
|
||||
lb, /// 0.45359237 kg
|
||||
|
||||
/// Time
|
||||
ms, /// 1 ms = 0.001 s
|
||||
@@ -47,6 +53,7 @@ namespace DataStreamInterface
|
||||
mbar, /// 1 mbar = 1 hPa = 100 Pa
|
||||
kPa, /// 1 kPa = 10 HPa
|
||||
inHg, /// 1 inHg = 33.864 hPa
|
||||
psi, /// 1 psi = 0.0689475729 bar
|
||||
bar, /// * 1 Bar = 1000 mbar = 0.1 MPa = 100000 Pa
|
||||
MPa, /// 1 MPa = 10000 hPa
|
||||
|
||||
@@ -61,7 +68,9 @@ namespace DataStreamInterface
|
||||
mm, /// * 1 millimeter
|
||||
cm, /// 1 cm = 10 mm
|
||||
inch, /// 1 inch = 25.4 mm
|
||||
dm, /// 1 dm = 100 mm
|
||||
foot, /// 1 foot = 304.8 mm
|
||||
yard, /// 1 yard = 914.4 mm
|
||||
m, /// 1 m = 1000 mm
|
||||
|
||||
/// Density
|
||||
@@ -76,20 +85,317 @@ namespace DataStreamInterface
|
||||
kWh, /// 1 kWh = 3600000 J
|
||||
MWh, /// 1 MWh = 3600000000 J
|
||||
|
||||
/// Electrical conductivity
|
||||
uSpcm, /// * 1 uS/cm
|
||||
mSpm, /// 1 mS/m = 10 uS/cm
|
||||
|
||||
/// Meter coefficient - volume
|
||||
ppl, /// * 1 pulse/l
|
||||
ppdm3, /// * 1 pulse/dm3
|
||||
degpl, /// * 1 degree/l
|
||||
degpdm3, /// * 1 degree/dm3
|
||||
lpp, /// * 1 l/pulse
|
||||
dm3pp, /// * 1 dm3/pulse
|
||||
lpdeg, /// * 1 l/degree
|
||||
dm3pdeg, /// * 1 dm3/degree
|
||||
ppdm3, /// 1 pulse/dm3
|
||||
degpl, /// 1 degree/l
|
||||
degpdm3, /// 1 degree/dm3
|
||||
lpp, /// 1 l/pulse
|
||||
dm3pp, /// 1 dm3/pulse
|
||||
lpdeg, /// 1 l/degree
|
||||
dm3pdeg, /// 1 dm3/degree
|
||||
|
||||
/// Meter coefficient - energy
|
||||
ppkWh, /// * 1 pulse/kWh
|
||||
kWhpp, /// * 1 kWh/pulse
|
||||
|
||||
Count
|
||||
kWhpp, /// 1 kWh/pulse
|
||||
}
|
||||
|
||||
public enum Quantity
|
||||
{
|
||||
/// Quantities with units and conversions (double -> double)
|
||||
Volume,
|
||||
Flow,
|
||||
Mass,
|
||||
Time,
|
||||
Temperature,
|
||||
Pressure,
|
||||
Humidity,
|
||||
Error,
|
||||
Length,
|
||||
Density,
|
||||
Energy,
|
||||
Pulses,
|
||||
PulsePerLtr,
|
||||
PulsePerKWh,
|
||||
Conductivity,
|
||||
|
||||
/// Quantities without units and conversions
|
||||
Number,
|
||||
String,
|
||||
Boolean,
|
||||
DateTime,
|
||||
Enumerated,
|
||||
}
|
||||
|
||||
public static class Units
|
||||
{
|
||||
public static bool IsDefaultUnit(Unit unit)
|
||||
{
|
||||
return unit == Unit.l || unit == Unit.m3ph || unit == Unit.kg || unit == Unit.s || unit == Unit.C ||
|
||||
unit == Unit.bar || unit == Unit.RPct || unit == Unit.Pct || unit == Unit.mm || unit == Unit.kgpm3 ||
|
||||
unit == Unit.J || unit == Unit.uSpcm || unit == Unit.ppl || unit == Unit.ppkWh;
|
||||
}
|
||||
|
||||
public static Quantity GetQuantity(Unit units)
|
||||
{
|
||||
switch (units)
|
||||
{
|
||||
case Unit.pulse:
|
||||
case Unit.degree:
|
||||
return Quantity.Pulses;
|
||||
|
||||
case Unit.ml:
|
||||
case Unit.l:
|
||||
case Unit.dm3:
|
||||
case Unit.USgal:
|
||||
case Unit.UKgal:
|
||||
case Unit.cf:
|
||||
case Unit.m3:
|
||||
return Quantity.Volume;
|
||||
|
||||
case Unit.lph:
|
||||
case Unit.lpm:
|
||||
case Unit.m3ph:
|
||||
case Unit.lps:
|
||||
case Unit.USgalps:
|
||||
case Unit.m3pm:
|
||||
case Unit.cfs:
|
||||
return Quantity.Flow;
|
||||
|
||||
case Unit.g:
|
||||
case Unit.lb:
|
||||
case Unit.kg:
|
||||
case Unit.t:
|
||||
return Quantity.Mass;
|
||||
|
||||
case Unit.ms:
|
||||
case Unit.s:
|
||||
case Unit.min:
|
||||
case Unit.hour:
|
||||
return Quantity.Time;
|
||||
|
||||
case Unit.C:
|
||||
case Unit.F:
|
||||
case Unit.K:
|
||||
return Quantity.Temperature;
|
||||
|
||||
case Unit.Pa:
|
||||
case Unit.hPa:
|
||||
case Unit.mbar:
|
||||
case Unit.kPa:
|
||||
case Unit.inHg:
|
||||
case Unit.psi:
|
||||
case Unit.bar:
|
||||
case Unit.MPa:
|
||||
return Quantity.Pressure;
|
||||
|
||||
case Unit.RPct:
|
||||
return Quantity.Humidity;
|
||||
|
||||
case Unit.Promile:
|
||||
case Unit.Pct:
|
||||
return Quantity.Error;
|
||||
|
||||
case Unit.mm:
|
||||
case Unit.cm:
|
||||
case Unit.inch:
|
||||
case Unit.dm:
|
||||
case Unit.foot:
|
||||
case Unit.yard:
|
||||
case Unit.m:
|
||||
return Quantity.Length;
|
||||
|
||||
case Unit.kgpm3:
|
||||
case Unit.kgpl:
|
||||
return Quantity.Density;
|
||||
|
||||
case Unit.J:
|
||||
case Unit.kJ:
|
||||
case Unit.MJ:
|
||||
case Unit.Wh:
|
||||
case Unit.kWh:
|
||||
case Unit.MWh:
|
||||
return Quantity.Energy;
|
||||
|
||||
case Unit.uSpcm:
|
||||
case Unit.mSpm:
|
||||
return Quantity.Conductivity;
|
||||
|
||||
case Unit.ppl:
|
||||
case Unit.ppdm3:
|
||||
case Unit.degpl:
|
||||
case Unit.degpdm3:
|
||||
case Unit.lpp:
|
||||
case Unit.dm3pp:
|
||||
case Unit.lpdeg:
|
||||
case Unit.dm3pdeg:
|
||||
return Quantity.PulsePerLtr;
|
||||
|
||||
case Unit.ppkWh:
|
||||
case Unit.kWhpp:
|
||||
return Quantity.PulsePerKWh;
|
||||
|
||||
default:
|
||||
return Quantity.Number;
|
||||
}
|
||||
}
|
||||
|
||||
public static double ConvertTo(Unit units, double v)
|
||||
{
|
||||
switch (units)
|
||||
{
|
||||
/// Volume: internal representation in l
|
||||
case Unit.ml: return 1000 * v; /// 1 l = 1000 ml
|
||||
case Unit.USgal: return 0.26417205 * v; /// 1 gal(US) = 3.78541178 l
|
||||
case Unit.UKgal: return 0.21996925 * v; /// 1 gal(UK) = 4.54609 l
|
||||
case Unit.cf: return 0.0353146667215 * v; /// 1 cubic foot = 28.316846592 l
|
||||
case Unit.m3: return 0.001 * v; /// 1 m3 = 1000 l
|
||||
|
||||
/// Flow: internal representation in m3/h
|
||||
case Unit.lph: return 1000 * v; /// 1 l/h
|
||||
case Unit.lpm: return v / 0.06; /// 1 l/m
|
||||
case Unit.lps: return v / 3.6; /// 1 l/s
|
||||
case Unit.USgalps: return 0.0733811257326 * v; /// 1 US gallon per second
|
||||
case Unit.m3pm: return v / 60; /// 1 m3/m
|
||||
case Unit.cfs: return 0.009809629644858 * v; /// 1 cubic foot per second
|
||||
|
||||
/// Mass: internal representation in kg
|
||||
case Unit.g: return 1000 * v; /// 1 g = 0.001 kg
|
||||
case Unit.lb: return 2.2046226 * v; /// 1 lb = 0.45359237 kg
|
||||
case Unit.t: return 0.001 * v; /// 1 t = 1000 kg
|
||||
|
||||
/// Time or duration: internal representation in seconds [s]
|
||||
case Unit.ms: return 1000 * v;
|
||||
case Unit.min: return v / 60;
|
||||
case Unit.hour: return v / 3600;
|
||||
|
||||
/// Temperature: internal representation in °C
|
||||
case Unit.F: return 1.8 * v + 32; /// degree Fahrenheit
|
||||
case Unit.K: return v + 273.15; /// degree Kelvin
|
||||
|
||||
/// Pressure: internal representation in bar = 0.1 MPa
|
||||
case Unit.Pa: return 100000 * v;
|
||||
case Unit.hPa: return 1000 * v; /// 1 hPa = 100 Pa
|
||||
case Unit.mbar: return 1000 * v; /// 1 mbar = 1 hPa = 100 Pa
|
||||
case Unit.kPa: return 100 * v; /// 1 kPa = 10 HPa
|
||||
case Unit.inHg: return 29.53 * v; /// 1 inHg =
|
||||
case Unit.psi: return 14.5037738 * v; /// 1 psi =
|
||||
case Unit.MPa: return 0.1 * v; /// 1 MPa = 10000 hPa
|
||||
|
||||
/// Relative error: internal representation in %
|
||||
case Unit.Promile: return 10 * v; /// 1 promile = 0.1 %
|
||||
|
||||
/// Diameter, length: internal representation in mm
|
||||
case Unit.cm: return 0.1 * v; /// 1 cm = 10 mm
|
||||
case Unit.inch: return v / 25.4; /// 1 inch = 25.4 mm
|
||||
case Unit.dm: return 0.01 * v; /// 1 dm = 100 mm
|
||||
case Unit.foot: return v / 304.8; /// 1 foot = 304.8 mm
|
||||
case Unit.yard: return v / 914.4; /// 1 yard = 914,4 mm
|
||||
case Unit.m: return 0.001 * v; /// 1 m = 1000 mm
|
||||
|
||||
/// Density: internal representation in kg/m3
|
||||
case Unit.kgpl: return 0.001 * v;
|
||||
|
||||
/// Energy, internal representation in Joul
|
||||
case Unit.kJ: return 0.001 * v; /// 1 kJ = 1000 J
|
||||
case Unit.MJ: return 0.000001 * v; /// 1 kJ = 1000000 J
|
||||
case Unit.Wh: return v / 3600.0; /// 1 Wh = 3600 J
|
||||
case Unit.kWh: return v / 3600000.0; /// 1 kWh = 3600000 J
|
||||
case Unit.MWh: return v / 3600000000.0; /// 1 MWh = 3600000000 J
|
||||
|
||||
/// Electrical conductivity
|
||||
case Unit.mSpm: return 0.1 * v;
|
||||
|
||||
/// Invert pulses
|
||||
case Unit.kWhpp:
|
||||
case Unit.lpp:
|
||||
case Unit.dm3pp:
|
||||
case Unit.lpdeg:
|
||||
case Unit.dm3pdeg: return (v <= float.Epsilon) ? 0 : 1/v;
|
||||
|
||||
default: return v; /// Do not convert
|
||||
}
|
||||
}
|
||||
|
||||
public static double ConvertFrom(Unit units, double v)
|
||||
{
|
||||
switch (units)
|
||||
{
|
||||
/// Volume: internal representation in l
|
||||
case Unit.ml: return 0.001 * v; /// 0.001 l
|
||||
case Unit.USgal: return 3.78541178 * v; /// 1 gal(US) = 3.78541178 l
|
||||
case Unit.UKgal: return 4.54609 * v; /// 1 gal(UK) = 4.54609 l
|
||||
case Unit.cf: return 28.316846592 * v; /// 1 cubic foot = 28.316846592 l
|
||||
case Unit.m3: return 1000 * v; /// 1000 l
|
||||
|
||||
/// Flow: internal representation in m3/h
|
||||
case Unit.lph: return 0.001 * v; /// 1 l/h
|
||||
case Unit.lpm: return 0.06 * v; /// 1 l/m
|
||||
case Unit.lps: return 3.6 * v; /// 1 l/s
|
||||
case Unit.USgalps: return 13.627482408 * v; /// 1 US gallon per second
|
||||
case Unit.m3pm: return 60 * v; /// 1 m3/m
|
||||
case Unit.cfs: return 101.9406477312 * v; /// 1 cubic foot per second
|
||||
|
||||
/// Mass: internal representation in kg
|
||||
case Unit.g: return 0.001 * v; /// 1 g = 0.001 kg
|
||||
case Unit.lb: return 0.45359237 * v; /// 1 lb = 0.45359237 kg
|
||||
case Unit.t: return 1000 * v; /// 1 t = 1000 kg
|
||||
|
||||
/// Time or duration: internal representation in seconds [s]
|
||||
case Unit.ms: return 0.001 * v;
|
||||
case Unit.min: return 60 * v;
|
||||
case Unit.hour: return 3600 * v;
|
||||
|
||||
/// Temperature: internal representation in °C
|
||||
case Unit.F: return 5 * (v - 32) / 9; /// degree Fahrenheit
|
||||
case Unit.K: return v - 273.15; /// degree Kelvin
|
||||
|
||||
/// Pressure: internal representation in bar = 0.1 MPa
|
||||
case Unit.Pa: return 0.00001 * v; /// 1 hPa = 100 Pa
|
||||
case Unit.hPa: return 0.001 * v; /// 1 hPa = 100 Pa
|
||||
case Unit.mbar: return 0.001 * v; /// 1 mbar = 1 hPa = 100 Pa
|
||||
case Unit.kPa: return 0.01 * v; /// 1 kPa = 10 HPa
|
||||
case Unit.inHg: return 0.033864 * v; /// 1 inHg = 33.864 hPa
|
||||
case Unit.psi: return 0.0689475729 * v; /// 1 psi = 0.0689475729 bar
|
||||
case Unit.MPa: return 10 * v; /// 1 MPa = 10000 hPa
|
||||
|
||||
/// Relative error: internal representation in %
|
||||
case Unit.Promile: return 0.1 * v; /// 1 promile = 0.1 %
|
||||
|
||||
/// Diameter, length: internal representation in mm
|
||||
case Unit.cm: return 10 * v; /// 1 cm = 10 mm
|
||||
case Unit.inch: return 25.4 * v; /// 1 inch = 25.4 mm
|
||||
case Unit.dm: return 100 * v; /// 1 dm = 100 mm
|
||||
case Unit.foot: return 304.8 * v; /// 1 foot = 304.8 mm
|
||||
case Unit.yard: return 914.4 * v; /// 1 yard = 914,4 mm
|
||||
case Unit.m: return 1000 * v; /// 1 m = 1000 mm
|
||||
|
||||
/// Density: internal representation in kg/m3
|
||||
case Unit.kgpl: return 1000 * v;
|
||||
|
||||
/// Energy, internal representation in Joul
|
||||
case Unit.kJ: return 1000 * v; /// 1 kJ = 1000 J
|
||||
case Unit.MJ: return 1000000 * v; /// 1 kJ = 1000000 J
|
||||
case Unit.Wh: return 3600 * v; /// 1 Wh = 3600 J
|
||||
case Unit.kWh: return 3600000 * v; /// 1 kWh = 3600000 J
|
||||
case Unit.MWh: return 3600000000 * v; /// 1 kWh = 3600000000 J
|
||||
|
||||
/// Electrical conductivity
|
||||
case Unit.mSpm: return 10 * v;
|
||||
|
||||
/// Invert
|
||||
case Unit.kWhpp:
|
||||
case Unit.lpp:
|
||||
case Unit.dm3pp:
|
||||
case Unit.lpdeg:
|
||||
case Unit.dm3pdeg: return (v <= float.Epsilon) ? 0 : 1/v;
|
||||
|
||||
default: return v; /// Do not convert
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,6 +94,10 @@
|
||||
<Project>{743DF7DB-C7B6-42EB-986D-0F485E5588E4}</Project>
|
||||
<Name>Config</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\SchematicDrawing\SchematicDrawing.csproj">
|
||||
<Project>{0f79ca69-9dbc-41f3-a6fc-5a2937365343}</Project>
|
||||
<Name>SchematicDrawing</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\TBF\TBF.csproj">
|
||||
<Project>{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}</Project>
|
||||
<Name>TBF</Name>
|
||||
|
||||
+104
-101
@@ -5,9 +5,10 @@ using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using TBF.BenchControl;
|
||||
using TBF.BenchControl.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using TBF.Rig;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.UI.Bench.Components;
|
||||
|
||||
|
||||
namespace DeviceTest
|
||||
@@ -79,7 +80,7 @@ namespace DeviceTest
|
||||
compClasses.Add(componentFactory.ClassName);
|
||||
}
|
||||
|
||||
tbfComponents = new List<TBF.BenchControl.Generic.IComponent>();
|
||||
tbfComponents = new List<TBF.Rig.Generic.IComponent>();
|
||||
tbfDevices = new List<IDevice>();
|
||||
}
|
||||
|
||||
@@ -421,13 +422,13 @@ namespace DeviceTest
|
||||
{
|
||||
parentCfg = parentFactory.DefaultConfig();
|
||||
}
|
||||
IComponentCfgCtrl cfgControl = parentCfg.GetControl();
|
||||
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
|
||||
cfgForm.CmpntEntities = new List<Config.Entities.Component>();
|
||||
|
||||
IComponentCfgCtrl cfgControl = parentCfg.GetControl(cfgForm.CmpntEntities);
|
||||
cfgControl.Config = parentCfg;
|
||||
cfgControl.Config.ItemNr = 0;
|
||||
|
||||
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
|
||||
cfgForm.TbfComponents = new List<Config.Entities.Component>();
|
||||
|
||||
cfgForm.ComponentCfgCtrl = cfgControl;
|
||||
cfgForm.UnlockAfterStart = true;
|
||||
DialogResult dr = cfgForm.ShowDialog();
|
||||
@@ -450,17 +451,17 @@ namespace DeviceTest
|
||||
{
|
||||
component1Cfg = component1Factory.DefaultConfig();
|
||||
}
|
||||
IComponentCfgCtrl cfgControl = component1Cfg.GetControl();
|
||||
cfgControl.Config = component1Cfg;
|
||||
cfgControl.Config.ItemNr = 1;
|
||||
|
||||
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
|
||||
///
|
||||
IList<Config.Entities.Component> compEntities = new List<Config.Entities.Component>();
|
||||
var compEntities = new List<Config.Entities.Component>();
|
||||
if (parentFactory != null && parentCfg != null) compEntities.Add(parentCfg.CreateDbEntity());
|
||||
cfgForm.TbfComponents = compEntities;
|
||||
cfgForm.CmpntEntities = compEntities;
|
||||
|
||||
cfgForm.ComponentCfgCtrl = cfgControl;
|
||||
IComponentCfgCtrl cfgControl = component1Cfg.GetControl(compEntities);
|
||||
cfgControl.Config = component1Cfg;
|
||||
cfgControl.Config.ItemNr = 1;
|
||||
|
||||
cfgForm.ComponentCfgCtrl = cfgControl;
|
||||
cfgForm.UnlockAfterStart = true;
|
||||
DialogResult dr = cfgForm.ShowDialog();
|
||||
if (dr != DialogResult.OK) return;
|
||||
@@ -484,18 +485,18 @@ namespace DeviceTest
|
||||
{
|
||||
component2Cfg = component2Factory.DefaultConfig();
|
||||
}
|
||||
IComponentCfgCtrl cfgControl = component2Cfg.GetControl();
|
||||
cfgControl.Config = component2Cfg;
|
||||
cfgControl.Config.ItemNr = 1;
|
||||
|
||||
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
|
||||
///
|
||||
IList<Config.Entities.Component> compEntities = new List<Config.Entities.Component>();
|
||||
var compEntities = new List<Config.Entities.Component>();
|
||||
if (parentFactory != null && parentCfg != null) compEntities.Add(parentCfg.CreateDbEntity());
|
||||
if (component1Factory != null && component1Cfg != null) compEntities.Add(component1Cfg.CreateDbEntity());
|
||||
cfgForm.TbfComponents = compEntities;
|
||||
cfgForm.CmpntEntities = compEntities;
|
||||
|
||||
cfgForm.ComponentCfgCtrl = cfgControl;
|
||||
IComponentCfgCtrl cfgControl = component2Cfg.GetControl(compEntities);
|
||||
cfgControl.Config = component2Cfg;
|
||||
cfgControl.Config.ItemNr = 1;
|
||||
|
||||
cfgForm.ComponentCfgCtrl = cfgControl;
|
||||
cfgForm.UnlockAfterStart = true;
|
||||
DialogResult dr = cfgForm.ShowDialog();
|
||||
if (dr != DialogResult.OK) return;
|
||||
@@ -519,19 +520,19 @@ namespace DeviceTest
|
||||
{
|
||||
component3Cfg = component3Factory.DefaultConfig();
|
||||
}
|
||||
IComponentCfgCtrl cfgControl = component3Cfg.GetControl();
|
||||
cfgControl.Config = component3Cfg;
|
||||
cfgControl.Config.ItemNr = 1;
|
||||
|
||||
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
|
||||
///
|
||||
IList<Config.Entities.Component> compEntities = new List<Config.Entities.Component>();
|
||||
var compEntities = new List<Config.Entities.Component>();
|
||||
if (parentFactory != null && parentCfg != null) compEntities.Add(parentCfg.CreateDbEntity());
|
||||
if (component1Factory != null && component1Cfg != null) compEntities.Add(component1Cfg.CreateDbEntity());
|
||||
if (component2Factory != null && component2Cfg != null) compEntities.Add(component2Cfg.CreateDbEntity());
|
||||
cfgForm.TbfComponents = compEntities;
|
||||
cfgForm.CmpntEntities = compEntities;
|
||||
|
||||
cfgForm.ComponentCfgCtrl = cfgControl;
|
||||
IComponentCfgCtrl cfgControl = component3Cfg.GetControl(compEntities);
|
||||
cfgControl.Config = component3Cfg;
|
||||
cfgControl.Config.ItemNr = 1;
|
||||
|
||||
cfgForm.ComponentCfgCtrl = cfgControl;
|
||||
cfgForm.UnlockAfterStart = true;
|
||||
DialogResult dr = cfgForm.ShowDialog();
|
||||
if (dr != DialogResult.OK) return;
|
||||
@@ -568,7 +569,7 @@ namespace DeviceTest
|
||||
{
|
||||
if (parentFactory != null && parentCfg != null)
|
||||
{
|
||||
TBF.BenchControl.Generic.IComponent component = parentFactory.GetComponent(parentCfg, tbfComponents);
|
||||
TBF.Rig.Generic.IComponent component = parentFactory.GetComponent(parentCfg, tbfComponents);
|
||||
tbfComponents.Add(component);
|
||||
IDevice dev = component as IDevice;
|
||||
if (dev != null)
|
||||
@@ -580,7 +581,7 @@ namespace DeviceTest
|
||||
}
|
||||
if (component1Factory != null && component1Cfg != null)
|
||||
{
|
||||
TBF.BenchControl.Generic.IComponent component = component1Factory.GetComponent(component1Cfg, tbfComponents);
|
||||
TBF.Rig.Generic.IComponent component = component1Factory.GetComponent(component1Cfg, tbfComponents);
|
||||
tbfComponents.Add(component);
|
||||
tbfComponent1forOp = component;
|
||||
IDevice dev = component as IDevice;
|
||||
@@ -593,7 +594,7 @@ namespace DeviceTest
|
||||
}
|
||||
if (component2Factory != null && component2Cfg != null)
|
||||
{
|
||||
TBF.BenchControl.Generic.IComponent component2 = component2Factory.GetComponent(component2Cfg, tbfComponents);
|
||||
TBF.Rig.Generic.IComponent component2 = component2Factory.GetComponent(component2Cfg, tbfComponents);
|
||||
tbfComponents.Add(component2);
|
||||
tbfComponent2forOp = component2;
|
||||
IDevice dev = component2 as IDevice;
|
||||
@@ -606,7 +607,7 @@ namespace DeviceTest
|
||||
}
|
||||
if (component3Factory != null && component3Cfg != null)
|
||||
{
|
||||
TBF.BenchControl.Generic.IComponent component3 = component3Factory.GetComponent(component3Cfg, tbfComponents);
|
||||
TBF.Rig.Generic.IComponent component3 = component3Factory.GetComponent(component3Cfg, tbfComponents);
|
||||
tbfComponents.Add(component3);
|
||||
tbfComponent3forOp = component3;
|
||||
IDevice dev = component3 as IDevice;
|
||||
@@ -645,6 +646,7 @@ namespace DeviceTest
|
||||
MessageBoxIcon.Exclamation);
|
||||
|
||||
foreach (var dev in tbfDevices) dev.StopDevice();
|
||||
foreach (var dev in tbfDevices) dev.StopDevice2();
|
||||
tbfDevices.Clear();
|
||||
|
||||
startButton.Enabled = true;
|
||||
@@ -662,120 +664,120 @@ namespace DeviceTest
|
||||
int previousOperation = 0;
|
||||
|
||||
|
||||
if (tbfComponent1forOp is TBF.BenchControl.Modbus.PressureMeter.Meret.PressureMeter)
|
||||
if (tbfComponent1forOp is TBF.Rig.Modbus.PressureMeter.Meret.PressureMeter)
|
||||
{
|
||||
operation1 = (tbfComponent1forOp as TBF.BenchControl.Modbus.PressureMeter.Meret.PressureMeter).ReadPressureOp(ref floatBox);
|
||||
operation1 = (tbfComponent1forOp as TBF.Rig.Modbus.PressureMeter.Meret.PressureMeter).ReadPressureOp(ref dblBox1);
|
||||
}
|
||||
else if (tbfComponent1forOp is TBF.BenchControl.Network.Camera.CLP1611.Camera)
|
||||
else if (tbfComponent1forOp is TBF.Rig.Network.Camera.CLP1611.Camera)
|
||||
{
|
||||
operation1 = (tbfComponent1forOp as TBF.BenchControl.Network.Camera.CLP1611.Camera).LiveStreamOp(false);
|
||||
operation2 = (tbfComponent1forOp as TBF.BenchControl.Network.Camera.CLP1611.Camera).LiveStreamOp(true);
|
||||
operation1 = (tbfComponent1forOp as TBF.Rig.Network.Camera.CLP1611.Camera).LiveStreamOp(false);
|
||||
operation2 = (tbfComponent1forOp as TBF.Rig.Network.Camera.CLP1611.Camera).LiveStreamOp(true);
|
||||
}
|
||||
else if (tbfComponent1forOp is TBF.BenchControl.Network.Camera.Roi.Roi)
|
||||
else if (tbfComponent1forOp is TBF.Rig.Network.Camera.Roi.Roi)
|
||||
{
|
||||
operation1 = (tbfComponent1forOp as TBF.BenchControl.Network.Camera.Roi.Roi).RoiDetectionOp();
|
||||
operation1 = (tbfComponent1forOp as TBF.Rig.Network.Camera.Roi.Roi).RoiDetectionOp();
|
||||
}
|
||||
else if (tbfComponent1forOp is TBF.BenchControl.Modbus.Easytherm.Easytherm)
|
||||
else if (tbfComponent1forOp is TBF.Rig.Modbus.Easytherm.Easytherm)
|
||||
{
|
||||
operation1 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
|
||||
operation2 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
|
||||
operation1 = (tbfComponent1forOp as TBF.Rig.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
|
||||
operation2 = (tbfComponent1forOp as TBF.Rig.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
|
||||
}
|
||||
else if (tbfComponent1forOp is TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter)
|
||||
else if (tbfComponent1forOp is TBF.Rig.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);
|
||||
operation1 = (tbfComponent1forOp as TBF.Rig.Modbus.UltrasoundLevelMeter.LevelMeter).ReadLevelOp(ref dblBox1);
|
||||
operation2 = (tbfComponent1forOp as TBF.Rig.Modbus.UltrasoundLevelMeter.LevelMeter).ReadTempOp(ref dblBox3);
|
||||
}
|
||||
else if (tbfComponent1forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
|
||||
else if (tbfComponent1forOp is TBF.Rig.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);
|
||||
//operation1 = (tbfComponent1forOp as TBF.Rig.Modbus.TankSelector.TankSelector).SelectTankOp(1);
|
||||
//operation2 = (tbfComponent1forOp as TBF.Rig.Modbus.TankSelector.TankSelector).SelectTankOp(2);
|
||||
//operation3 = (tbfComponent1forOp as TBF.Rig.Modbus.TankSelector.TankSelector).SelectTankOp(3);
|
||||
//operation4 = (tbfComponent1forOp as TBF.Rig.Modbus.TankSelector.TankSelector).SelectTankOp(0);
|
||||
}
|
||||
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
|
||||
else if (tbfComponent3forOp is TBF.Rig.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);
|
||||
operation1 = (tbfComponent3forOp as TBF.Rig.Modbus.QuidoRS.QuidoRS).SetOutputsOp(1);
|
||||
operation2 = (tbfComponent3forOp as TBF.Rig.Modbus.QuidoRS.QuidoRS).SetOutputsOp(2);
|
||||
operation3 = (tbfComponent3forOp as TBF.Rig.Modbus.QuidoRS.QuidoRS).SetOutputsOp(4);
|
||||
operation4 = (tbfComponent3forOp as TBF.Rig.Modbus.QuidoRS.QuidoRS).SetOutputsOp(0);
|
||||
}
|
||||
|
||||
|
||||
if (tbfComponent2forOp is TBF.BenchControl.Modbus.PressureMeter.Meret.PressureMeter)
|
||||
if (tbfComponent2forOp is TBF.Rig.Modbus.PressureMeter.Meret.PressureMeter)
|
||||
{
|
||||
operation21 = (tbfComponent2forOp as TBF.BenchControl.Modbus.PressureMeter.Meret.PressureMeter).ReadPressureOp(ref floatBox);
|
||||
operation21 = (tbfComponent2forOp as TBF.Rig.Modbus.PressureMeter.Meret.PressureMeter).ReadPressureOp(ref dblBox2);
|
||||
}
|
||||
else if (tbfComponent2forOp is TBF.BenchControl.Network.Camera.CLP1611.Camera)
|
||||
else if (tbfComponent2forOp is TBF.Rig.Network.Camera.CLP1611.Camera)
|
||||
{
|
||||
operation21 = (tbfComponent2forOp as TBF.BenchControl.Network.Camera.CLP1611.Camera).LiveStreamOp(false);
|
||||
operation22 = (tbfComponent2forOp as TBF.BenchControl.Network.Camera.CLP1611.Camera).LiveStreamOp(true);
|
||||
operation21 = (tbfComponent2forOp as TBF.Rig.Network.Camera.CLP1611.Camera).LiveStreamOp(false);
|
||||
operation22 = (tbfComponent2forOp as TBF.Rig.Network.Camera.CLP1611.Camera).LiveStreamOp(true);
|
||||
}
|
||||
else if (tbfComponent2forOp is TBF.BenchControl.Network.Camera.Roi.Roi)
|
||||
else if (tbfComponent2forOp is TBF.Rig.Network.Camera.Roi.Roi)
|
||||
{
|
||||
operation21 = (tbfComponent2forOp as TBF.BenchControl.Network.Camera.Roi.Roi).RoiDetectionOp();
|
||||
operation21 = (tbfComponent2forOp as TBF.Rig.Network.Camera.Roi.Roi).RoiDetectionOp();
|
||||
}
|
||||
else if (tbfComponent2forOp is TBF.BenchControl.Modbus.Easytherm.Easytherm)
|
||||
else if (tbfComponent2forOp is TBF.Rig.Modbus.Easytherm.Easytherm)
|
||||
{
|
||||
operation21 = (tbfComponent2forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
|
||||
operation22 = (tbfComponent2forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
|
||||
operation21 = (tbfComponent2forOp as TBF.Rig.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
|
||||
operation22 = (tbfComponent2forOp as TBF.Rig.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
|
||||
}
|
||||
else if (tbfComponent2forOp is TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter)
|
||||
else if (tbfComponent2forOp is TBF.Rig.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);
|
||||
operation21 = (tbfComponent2forOp as TBF.Rig.Modbus.UltrasoundLevelMeter.LevelMeter).ReadLevelOp(ref dblBox1);
|
||||
operation22 = (tbfComponent2forOp as TBF.Rig.Modbus.UltrasoundLevelMeter.LevelMeter).ReadTempOp(ref dblBox3);
|
||||
}
|
||||
else if (tbfComponent2forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
|
||||
else if (tbfComponent2forOp is TBF.Rig.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);
|
||||
//operation21 = (tbfComponent2forOp as TBF.Rig.Modbus.TankSelector.TankSelector).SelectTankOp(1);
|
||||
//operation22 = (tbfComponent2forOp as TBF.Rig.Modbus.TankSelector.TankSelector).SelectTankOp(2);
|
||||
//operation23 = (tbfComponent2forOp as TBF.Rig.Modbus.TankSelector.TankSelector).SelectTankOp(3);
|
||||
//operation24 = (tbfComponent2forOp as TBF.Rig.Modbus.TankSelector.TankSelector).SelectTankOp(0);
|
||||
}
|
||||
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
|
||||
else if (tbfComponent3forOp is TBF.Rig.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);
|
||||
operation21 = (tbfComponent3forOp as TBF.Rig.Modbus.QuidoRS.QuidoRS).SetOutputsOp(1);
|
||||
operation22 = (tbfComponent3forOp as TBF.Rig.Modbus.QuidoRS.QuidoRS).SetOutputsOp(2);
|
||||
operation23 = (tbfComponent3forOp as TBF.Rig.Modbus.QuidoRS.QuidoRS).SetOutputsOp(4);
|
||||
operation24 = (tbfComponent3forOp as TBF.Rig.Modbus.QuidoRS.QuidoRS).SetOutputsOp(0);
|
||||
}
|
||||
|
||||
|
||||
if (tbfComponent3forOp is TBF.BenchControl.Modbus.PressureMeter.Meret.PressureMeter)
|
||||
if (tbfComponent3forOp is TBF.Rig.Modbus.PressureMeter.Meret.PressureMeter)
|
||||
{
|
||||
operation31 = (tbfComponent3forOp as TBF.BenchControl.Modbus.PressureMeter.Meret.PressureMeter).ReadPressureOp(ref floatBox);
|
||||
operation31 = (tbfComponent3forOp as TBF.Rig.Modbus.PressureMeter.Meret.PressureMeter).ReadPressureOp(ref dblBox3);
|
||||
}
|
||||
else if (tbfComponent3forOp is TBF.BenchControl.Network.Camera.CLP1611.Camera)
|
||||
else if (tbfComponent3forOp is TBF.Rig.Network.Camera.CLP1611.Camera)
|
||||
{
|
||||
operation31 = (tbfComponent3forOp as TBF.BenchControl.Network.Camera.CLP1611.Camera).LiveStreamOp(false);
|
||||
operation33 = (tbfComponent3forOp as TBF.BenchControl.Network.Camera.CLP1611.Camera).LiveStreamOp(true);
|
||||
operation31 = (tbfComponent3forOp as TBF.Rig.Network.Camera.CLP1611.Camera).LiveStreamOp(false);
|
||||
operation33 = (tbfComponent3forOp as TBF.Rig.Network.Camera.CLP1611.Camera).LiveStreamOp(true);
|
||||
}
|
||||
else if (tbfComponent3forOp is TBF.BenchControl.Network.Camera.Roi.Roi)
|
||||
else if (tbfComponent3forOp is TBF.Rig.Network.Camera.Roi.Roi)
|
||||
{
|
||||
operation31 = (tbfComponent3forOp as TBF.BenchControl.Network.Camera.Roi.Roi).RoiDetectionOp();
|
||||
operation31 = (tbfComponent3forOp as TBF.Rig.Network.Camera.Roi.Roi).RoiDetectionOp();
|
||||
}
|
||||
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.Easytherm.Easytherm)
|
||||
else if (tbfComponent3forOp is TBF.Rig.Modbus.Easytherm.Easytherm)
|
||||
{
|
||||
operation31 = (tbfComponent3forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
|
||||
operation32 = (tbfComponent3forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
|
||||
operation31 = (tbfComponent3forOp as TBF.Rig.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
|
||||
operation32 = (tbfComponent3forOp as TBF.Rig.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
|
||||
}
|
||||
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter)
|
||||
else if (tbfComponent3forOp is TBF.Rig.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);
|
||||
operation31 = (tbfComponent3forOp as TBF.Rig.Modbus.UltrasoundLevelMeter.LevelMeter).ReadLevelOp(ref dblBox1);
|
||||
operation32 = (tbfComponent3forOp as TBF.Rig.Modbus.UltrasoundLevelMeter.LevelMeter).ReadTempOp(ref dblBox3);
|
||||
}
|
||||
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
|
||||
else if (tbfComponent3forOp is TBF.Rig.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);
|
||||
//operation31 = (tbfComponent3forOp as TBF.Rig.Modbus.TankSelector.TankSelector).SelectTankOp(1);
|
||||
//operation32 = (tbfComponent3forOp as TBF.Rig.Modbus.TankSelector.TankSelector).SelectTankOp(2);
|
||||
//operation33 = (tbfComponent3forOp as TBF.Rig.Modbus.TankSelector.TankSelector).SelectTankOp(3);
|
||||
//operation34 = (tbfComponent3forOp as TBF.Rig.Modbus.TankSelector.TankSelector).SelectTankOp(0);
|
||||
}
|
||||
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
|
||||
else if (tbfComponent3forOp is TBF.Rig.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);
|
||||
operation31 = (tbfComponent3forOp as TBF.Rig.Modbus.QuidoRS.QuidoRS).SetOutputsOp(1);
|
||||
operation32 = (tbfComponent3forOp as TBF.Rig.Modbus.QuidoRS.QuidoRS).SetOutputsOp(2);
|
||||
operation33 = (tbfComponent3forOp as TBF.Rig.Modbus.QuidoRS.QuidoRS).SetOutputsOp(4);
|
||||
operation34 = (tbfComponent3forOp as TBF.Rig.Modbus.QuidoRS.QuidoRS).SetOutputsOp(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -856,6 +858,7 @@ namespace DeviceTest
|
||||
}
|
||||
|
||||
foreach (var d in tbfDevices) d.StopDevice();
|
||||
foreach (var d in tbfDevices) d.StopDevice2();
|
||||
}
|
||||
|
||||
private void stopButton_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace Dirichlet.Numerics
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return ((BigInteger)this).ToString();
|
||||
return ((BigInteger)this).ToString("x");
|
||||
}
|
||||
|
||||
public string ToString(string format)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
@@ -21,6 +21,7 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace EventViewer
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception)
|
||||
{
|
||||
//log.ErrorFormat("Failed to load from '{0}': {1}", fileName, e.Message);
|
||||
return null;
|
||||
@@ -203,7 +203,7 @@ namespace EventViewer
|
||||
}
|
||||
#endif
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception)
|
||||
{
|
||||
//log.ErrorFormat("Failed to save to '{0}': {1}", Program.LocalSettingsFileName, e.Message);
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace EventViewer
|
||||
/// Open the main application window
|
||||
Application.Run(new EventViewerWnd());
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception)
|
||||
{
|
||||
//LogException(log, "Exception in Application.Run(new ResultsBrowserWnd(args))", e);
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ namespace GraphLib
|
||||
Samples = newSamples;
|
||||
return samplesCount;
|
||||
}
|
||||
catch (Exception exc)
|
||||
catch (Exception)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{9786D0A8-BA9A-41F6-9E61-C7B2B76D4C08}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MergeResultsDBs</RootNamespace>
|
||||
<AssemblyName>MergeResultsDBs</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</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|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="FluentNHibernate">
|
||||
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Iesi.Collections">
|
||||
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NHibernate">
|
||||
<HintPath>..\packages\NHibernate.4.0.4.4000\lib\net40\NHibernate.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<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>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Config\Config.csproj">
|
||||
<Project>{743df7db-c7b6-42eb-986d-0f485e5588e4}</Project>
|
||||
<Name>Config</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Results\Results.csproj">
|
||||
<Project>{9d0dcc88-dc81-47eb-9fdd-4c3907871bfb}</Project>
|
||||
<Name>Results</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,190 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using NHibernate;
|
||||
using FluentNHibernate;
|
||||
using Results;
|
||||
using Results.Entities;
|
||||
|
||||
namespace MergeResultsDBs
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("A range of records from the 2nd database will be appended to the 1st database.");
|
||||
Console.WriteLine("Enter the 1st (target) database name:");
|
||||
string firstDB = Console.ReadLine();
|
||||
Console.WriteLine("Enter the 2nd database name:");
|
||||
string secondDB = Console.ReadLine();
|
||||
Console.WriteLine("Enter range of batch numbers from the 2nd DB to append to the 1st DB (start-end):");
|
||||
string range = Console.ReadLine();
|
||||
|
||||
ISession session1;
|
||||
IList<Components> componentsList;
|
||||
int componentsListInitialCount;
|
||||
IList<TestData> testDataList;
|
||||
int testDataListInitialCount;
|
||||
IList<WaterMeterData> waterMeterDataList;
|
||||
int waterMeterDataListInitialCount;
|
||||
try
|
||||
{
|
||||
DB.ConnectionString = string.Format("SERVER=localhost; DATABASE={0}; UID=root; PASSWORD=kraken; CHARSET=utf8;", firstDB);
|
||||
session1 = DB.CreateSession();
|
||||
|
||||
componentsList = session1.QueryOver<Components>().List();
|
||||
componentsListInitialCount = componentsList.Count;
|
||||
|
||||
testDataList = session1.QueryOver<TestData>().List();
|
||||
testDataListInitialCount = testDataList.Count();
|
||||
|
||||
waterMeterDataList = session1.QueryOver<WaterMeterData>().List();
|
||||
waterMeterDataListInitialCount = waterMeterDataList.Count();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
MessageBox.Show(string.Format("Cannot open the 1st database:\r\n{0}", exc.Message));
|
||||
return;
|
||||
}
|
||||
|
||||
ISession session2;
|
||||
IList<Components> oriComponentsList;
|
||||
IList<TestData> oriTestDataList;
|
||||
IList<WaterMeterData> oriWMDataList;
|
||||
try
|
||||
{
|
||||
DB.ConnectionString = string.Format("SERVER=localhost; DATABASE={0}; UID=root; PASSWORD=kraken; CHARSET=utf8;", secondDB);
|
||||
session2 = DB.CreateSession();
|
||||
|
||||
oriComponentsList = session2.QueryOver<Components>().List();
|
||||
oriTestDataList = session2.QueryOver<TestData>().List();
|
||||
oriWMDataList = session2.QueryOver<WaterMeterData>().List();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
MessageBox.Show(string.Format("Cannot open the 2nd database:\r\n{0}", exc.Message));
|
||||
return;
|
||||
}
|
||||
|
||||
int batchNrStart;
|
||||
int batchNrEnd;
|
||||
string[] fields = range.Split(new char[] { '-' });
|
||||
if (fields.Length != 2 ||
|
||||
!int.TryParse(fields[0], out batchNrStart) ||
|
||||
!int.TryParse(fields[1], out batchNrEnd) ||
|
||||
batchNrEnd < batchNrStart)
|
||||
{
|
||||
MessageBox.Show("Invalid range of batch numbers");
|
||||
return;
|
||||
}
|
||||
|
||||
Console.WriteLine(string.Format("Appending batches {0}-{1} from DB {2} to DB {3}", batchNrStart, batchNrEnd, secondDB, firstDB));
|
||||
Console.WriteLine("Press 'y' or 'Y' to start, anything else to abort");
|
||||
string response = Console.ReadLine();
|
||||
if (response != "y" && response != "Y")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Console.WriteLine("PROCESSING DATABASES ...");
|
||||
|
||||
for (int batchNr = batchNrStart; batchNr <= batchNrEnd; batchNr++)
|
||||
{
|
||||
Console.Write(string.Format("{0} ", batchNr));
|
||||
|
||||
/// Copy one batch from the 2nd to the 1st database
|
||||
var oriBatches = session2.QueryOver<Batch>()
|
||||
.Where(x => (x.BatchNr == batchNr))
|
||||
.List();
|
||||
if (oriBatches.Count != 1) continue;
|
||||
|
||||
///---------------------------------------------------------------
|
||||
Batch oriBatch = oriBatches[0];
|
||||
|
||||
var transaction = session1.BeginTransaction();
|
||||
try
|
||||
{
|
||||
Batch batch = new Batch(oriBatch);
|
||||
|
||||
oriBatch.TestRslts = session2.QueryOver<TestRslt>()
|
||||
.Where(x => (x.Batch.Id == oriBatch.Id))
|
||||
.List();
|
||||
foreach (var oriTR in oriBatch.TestRslts)
|
||||
{
|
||||
/// Find appropriate Components
|
||||
Components components = oriTR.Components == null
|
||||
? null
|
||||
: Components.UpdateList(componentsList, new Components(oriTR.Components));
|
||||
if (components != null) session1.SaveOrUpdate(components);
|
||||
|
||||
/// Find appropriate TestData
|
||||
TestData testData = TestData.UpdateList(testDataList, new TestData(oriTR.TestData));
|
||||
session1.SaveOrUpdate(testData);
|
||||
|
||||
TestRslt tr = new TestRslt();
|
||||
tr.CopyContentFrom(oriTR);
|
||||
tr.Batch = batch;
|
||||
tr.Components = components;
|
||||
tr.TestData = testData;
|
||||
|
||||
batch.TestRslts.Add(tr);
|
||||
session1.SaveOrUpdate(tr);
|
||||
}
|
||||
|
||||
oriBatch.WaterMeters = session2.QueryOver<WaterMeter>()
|
||||
.Where(x => (x.Batch.Id == oriBatch.Id))
|
||||
.List();
|
||||
foreach (var oriWM in oriBatch.WaterMeters)
|
||||
{
|
||||
/// Find appropriate WaterMeterData
|
||||
WaterMeterData wmData = WaterMeterData.UpdateList(waterMeterDataList, new WaterMeterData(oriWM.WaterMeterData));
|
||||
session1.SaveOrUpdate(wmData);
|
||||
|
||||
WaterMeter wm = new WaterMeter();
|
||||
wm.CopyContentFrom(oriWM);
|
||||
wm.Batch = batch;
|
||||
wm.WaterMeterData = wmData;
|
||||
|
||||
foreach (var oriMTR in oriWM.MeterTestRslts)
|
||||
{
|
||||
MeterTestRslt mtr = new MeterTestRslt(oriMTR);
|
||||
mtr.WaterMeter = wm;
|
||||
mtr.TestRslt = batch.TestRslts.FirstOrDefault<TestRslt>(x => (x.Name() == oriMTR.TestRslt.Name() &&
|
||||
x.Part == oriMTR.TestRslt.Part &&
|
||||
x.RepetitionNr == oriMTR.TestRslt.RepetitionNr));
|
||||
if (mtr.TestRslt == null)
|
||||
{
|
||||
throw new Exception("Something strange happened");
|
||||
}
|
||||
|
||||
wm.MeterTestRslts.Add(mtr);
|
||||
session1.SaveOrUpdate(mtr);
|
||||
}
|
||||
|
||||
batch.WaterMeters.Add(wm);
|
||||
session1.SaveOrUpdate(wm);
|
||||
}
|
||||
|
||||
session1.SaveOrUpdate(batch);
|
||||
transaction.Commit();
|
||||
}
|
||||
catch
|
||||
{
|
||||
transaction.Rollback();
|
||||
throw new Exception("Commit failed - transaction reverted");
|
||||
}
|
||||
}
|
||||
Console.WriteLine();
|
||||
|
||||
session1.Flush();
|
||||
session1.Close();
|
||||
session2.Close();
|
||||
Console.WriteLine("Successfully completed");
|
||||
Console.ReadLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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("MergeResultsDBs")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("MergeResultsDBs")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2021")]
|
||||
[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("f7543f83-5414-4010-ac3f-3af4b6864812")]
|
||||
|
||||
// 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,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using TBF;
|
||||
|
||||
namespace ResetBatchNr
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static LocalSettings ls;
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
if (!Directory.Exists(TBF.Program.ConfigDir)) return;
|
||||
|
||||
Environment.CurrentDirectory = TBF.Program.ConfigDir;
|
||||
ls = LocalSettings.Load(TBF.Program.LocalSettingsFileName);
|
||||
if (ls == null || ls.TestBenches == null)
|
||||
{
|
||||
/// Loading local seetings from regular config file failed. Use the backup
|
||||
ls = LocalSettings.Load(TBF.Program.LocalSettingsBackupName);
|
||||
if (ls == null || ls.TestBenches == null)
|
||||
{
|
||||
/// Neither config.xml, nor config.backup.xml could be loaded
|
||||
Console.WriteLine(string.Format("Could not load file {0}, nor {1}.", TBF.Program.LocalSettingsFileName, TBF.Program.LocalSettingsBackupName));
|
||||
Console.ReadLine();
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Loading local seetings from the regular config file was successful. Update the backup
|
||||
File.Copy(TBF.Program.LocalSettingsFileName, TBF.Program.LocalSettingsBackupName, true);
|
||||
}
|
||||
|
||||
///
|
||||
/// Process local settings so that windows are shifted to the 1st monitor
|
||||
///
|
||||
ls.BatchNr = 1;
|
||||
ls.Save();
|
||||
|
||||
Console.WriteLine("BatchNr was reset to 1");
|
||||
Console.ReadLine();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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("ResetBatchNr")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("ResetBatchNr")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020")]
|
||||
[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("de8130eb-2f43-46a6-9f5b-bf96432a0c7c")]
|
||||
|
||||
// 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,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{D7F5A111-B2DF-4761-9574-AB730DF573A6}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ResetBatchNr</RootNamespace>
|
||||
<AssemblyName>ResetBatchNr</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<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>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</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>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Config\Config.csproj">
|
||||
<Project>{743df7db-c7b6-42eb-986d-0f485e5588e4}</Project>
|
||||
<Name>Config</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\TBF\TBF.csproj">
|
||||
<Project>{8648fd92-cda1-4c3a-b5f9-fe547ce1fa48}</Project>
|
||||
<Name>TBF</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Users\Users.csproj">
|
||||
<Project>{6e5cb0e9-e1b6-4e5d-ac6e-b1049e180f2b}</Project>
|
||||
<Name>Users</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -11,13 +11,10 @@ namespace RestClient
|
||||
{
|
||||
public class BaseClient
|
||||
{
|
||||
private string _token;
|
||||
|
||||
private string _baseUrl;
|
||||
|
||||
public string ErrorMessage { get; set; }
|
||||
|
||||
private readonly HttpClient client;
|
||||
private AuthenticationHeaderValue _authValue;
|
||||
|
||||
public BaseClient(string baseUrl)
|
||||
|
||||
+43
-43
@@ -1,4 +1,7 @@
|
||||
using System;
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -40,7 +43,7 @@ namespace Results
|
||||
|
||||
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)
|
||||
WaterMeterData[] waterMeterDatas, int[] waterMeterParts, double realDensity, double atTemperature, double buoyancy)
|
||||
{
|
||||
BatchResults d = new BatchResults(waterMeterDatas.Length);
|
||||
int year = DateTime.Now.Year;
|
||||
@@ -63,10 +66,11 @@ namespace Results
|
||||
ProcedureDescription = procedure.Description,
|
||||
WatermetersStr = procedure.Watermeters,
|
||||
ProcedureRevision = procedure.Revision,
|
||||
ProtocolTitle = string.Empty,
|
||||
StartTime = DateTime.Now,
|
||||
DensityCorr = (float)densityCorr,
|
||||
Compound = (procedure.MetersKind == Config.Entities.MetersKind.Combined),
|
||||
SampleDensity = realDensity,
|
||||
SampleTemp = atTemperature,
|
||||
Buoyancy = buoyancy,
|
||||
Compound = (procedure.MetersKind == Config.Entities.MetersKind.Combined),
|
||||
#if HEAT_METERS
|
||||
HeatMeter = (procedure.MetersKind == Config.Entities.MetersKind.HeatMeter),
|
||||
#endif
|
||||
@@ -96,45 +100,41 @@ namespace Results
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach (var t in procedure.Tests)
|
||||
foreach (var ti in procedure.GetTestInstances())
|
||||
{
|
||||
TestData td = TestData.UpdateList(d.TestDataList, new TestData(t));
|
||||
TestData td = TestData.UpdateList(d.TestDataList, new TestData(ti.Test));
|
||||
|
||||
for (int rnr = 1; rnr <= t.Repeats; rnr++)
|
||||
/// Create an empty test result and add it to the list
|
||||
TestRslt tr = new TestRslt(d.Batch, td, ti.Test.Part, ti.Repetition);
|
||||
d.Batch.TestRslts.Add(tr);
|
||||
|
||||
for (int i = 0; i < d.WMPositionsCount; i++)
|
||||
{
|
||||
/// Create an empty test result and add it to the list
|
||||
TestRslt tr = new TestRslt(d.Batch, td, t.Part, rnr);
|
||||
d.Batch.TestRslts.Add(tr);
|
||||
|
||||
for (int i = 0; i < d.WMPositionsCount; i++)
|
||||
{
|
||||
if (!d.Batch.WaterMeters[i].Disabled && t.IsPartCompatible(waterMeterParts[i]))
|
||||
if (!d.Batch.WaterMeters[i].Disabled && ti.Test.IsPartCompatible(waterMeterParts[i]))
|
||||
{
|
||||
///
|
||||
/// Create empty watermeter test results and add them to the list and to dictionaries
|
||||
///
|
||||
IList<MeterTestRslt> wmtrs = d.Batch.WaterMeters[i].MeterTestRslts;
|
||||
if (d.Batch.Compound)
|
||||
{
|
||||
///
|
||||
/// Create empty watermeter test results and add them to the list and to dictionaries
|
||||
///
|
||||
IList<MeterTestRslt> wmtrs = d.Batch.WaterMeters[i].MeterTestRslts;
|
||||
if (d.Batch.Compound)
|
||||
{
|
||||
/// Compound water meter
|
||||
wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, Config.Entities.CompoundMeterId.CompoundMain));
|
||||
wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, Config.Entities.CompoundMeterId.CompoundAux));
|
||||
wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, Config.Entities.CompoundMeterId.Compound));
|
||||
}
|
||||
else if (d.Batch.HeatMeter)
|
||||
{
|
||||
/// Heat meter
|
||||
wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, Config.Entities.CompoundMeterId.HeatMeterVolume));
|
||||
wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, Config.Entities.CompoundMeterId.HeatMeterEnergy));
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Water meter
|
||||
wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, Config.Entities.CompoundMeterId.Single));
|
||||
}
|
||||
/// Compound water meter
|
||||
wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, Config.Entities.CompoundMeterId.CompoundMain));
|
||||
wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, Config.Entities.CompoundMeterId.CompoundAux));
|
||||
wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, Config.Entities.CompoundMeterId.Compound));
|
||||
}
|
||||
}
|
||||
else if (d.Batch.HeatMeter)
|
||||
{
|
||||
/// Heat meter
|
||||
wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, Config.Entities.CompoundMeterId.HeatMeterVolume));
|
||||
wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, Config.Entities.CompoundMeterId.HeatMeterEnergy));
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Water meter
|
||||
wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, Config.Entities.CompoundMeterId.Single));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,10 +156,10 @@ namespace Results
|
||||
if (batch.WaterMeters[wmNr0].WMPosition > wmNr0 + 1)
|
||||
{
|
||||
batch.WaterMeters.Insert(wmNr0, new WaterMeter() { Batch = batch,
|
||||
WaterMeterData = null,
|
||||
WMPosition = wmNr0 + 1,
|
||||
YearOfProduction = 0,
|
||||
Disabled = true, });
|
||||
WaterMeterData = null,
|
||||
WMPosition = wmNr0 + 1,
|
||||
YearOfProduction = 0,
|
||||
Disabled = true, });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-4
@@ -66,13 +66,13 @@ namespace Results
|
||||
switch (dbType)
|
||||
{
|
||||
default:
|
||||
case Users.Entities.DBType.SQLite:
|
||||
cfg = cfg.Database(SQLiteConfiguration.Standard.UsingFile(connectionString));
|
||||
break;
|
||||
case Users.Entities.DBType.MySql:
|
||||
cfg = cfg.Database(MySQLConfiguration.Standard.ConnectionString(connectionString));
|
||||
break;
|
||||
}
|
||||
case Users.Entities.DBType.SQLite:
|
||||
cfg = cfg.Database(SQLiteConfiguration.Standard.UsingFile(connectionString));
|
||||
break;
|
||||
}
|
||||
|
||||
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Entities.WaterMeterData>());
|
||||
|
||||
@@ -311,6 +311,7 @@ namespace Results
|
||||
batch.TestRslts = session.QueryOver<TestRslt>()
|
||||
.Where(x => (x.Batch.Id == batch.Id))
|
||||
.List();
|
||||
|
||||
batch.WaterMeters = session.QueryOver<WaterMeter>()
|
||||
.Where(x => (x.Batch.Id == batch.Id))
|
||||
.List();
|
||||
|
||||
+62
-39
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2020 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2015-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -26,11 +26,10 @@ namespace Results.Entities
|
||||
public virtual string ProcedureDescription { get; set; } /// CEVAK, not mapped to DB
|
||||
public virtual int ProcedureRevision { get; set; }
|
||||
public virtual string WatermetersStr { get; set; } /// CEVAK, not mapped to DB
|
||||
public virtual string ProtocolTitle { get; set; }
|
||||
public virtual string Remark { get; set; }
|
||||
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 double SampleDensity { get; set; } /// Sample denisty in [kg/m3]
|
||||
public virtual double SampleTemp { get; set; } /// Sample temperature when density measured [°C]
|
||||
public virtual double Buoyancy { get; set; }
|
||||
public virtual int Counter6 { get; set; }
|
||||
public virtual int Counter7 { get; set; }
|
||||
public virtual int Counter8 { get; set; }
|
||||
@@ -41,11 +40,11 @@ namespace Results.Entities
|
||||
public virtual bool Dirty { get; set; }
|
||||
public virtual bool RsltsSent { get; set; }
|
||||
public virtual bool RsltsPrinted { get; set; }
|
||||
public virtual IList<TestData> Tests { 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 IList<TestData> Tests { get; set; }
|
||||
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 IList<TestData> RegularTests()
|
||||
{
|
||||
@@ -114,11 +113,56 @@ namespace Results.Entities
|
||||
IsRemoteProcedure = false;
|
||||
ProcedureDescription = string.Empty;
|
||||
WatermetersStr = string.Empty;
|
||||
ProtocolTitle = string.Empty;
|
||||
ProtocolTitle = string.Empty;
|
||||
Remark = string.Empty;
|
||||
SampleDensity = Config.Data.SampleDensity;
|
||||
SampleTemp = Config.Data.SampleTemp;
|
||||
Buoyancy = Config.Data.Buoyancy;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copy constructor, copies all except of Id.
|
||||
/// Lists Tests, WaterMeters and TestRslts are empty. Have to be copied elwhere.
|
||||
/// </summary>
|
||||
public Batch(Batch oriBatch)
|
||||
{
|
||||
BatchNr = oriBatch.BatchNr;
|
||||
ProgramVersion = oriBatch.ProgramVersion;
|
||||
TestBenchId = oriBatch.TestBenchId;
|
||||
TestBenchName = oriBatch.TestBenchName;
|
||||
Address1 = oriBatch.Address1;
|
||||
Address2 = oriBatch.Address2;
|
||||
Address3 = oriBatch.Address3;
|
||||
Address4 = oriBatch.Address4;
|
||||
Address5 = oriBatch.Address5;
|
||||
UserName = oriBatch.UserName;
|
||||
UserNumber = oriBatch.UserNumber;
|
||||
ProcedureName = oriBatch.ProcedureName;
|
||||
IsRemoteProcedure = oriBatch.IsRemoteProcedure;
|
||||
ProcedureDescription = oriBatch.ProcedureDescription;
|
||||
ProcedureRevision = oriBatch.ProcedureRevision;
|
||||
WatermetersStr = oriBatch.WatermetersStr;
|
||||
Remark = oriBatch.Remark;
|
||||
SampleDensity = oriBatch.SampleDensity;
|
||||
SampleTemp = oriBatch.SampleTemp;
|
||||
Buoyancy = oriBatch.Buoyancy;
|
||||
Counter6 = oriBatch.Counter6;
|
||||
Counter7 = oriBatch.Counter7;
|
||||
Counter8 = oriBatch.Counter8;
|
||||
Counter9 = oriBatch.Counter9;
|
||||
Counter10 = oriBatch.Counter10;
|
||||
StartTime = oriBatch.StartTime;
|
||||
EndTime = oriBatch.EndTime;
|
||||
Dirty = oriBatch.Dirty;
|
||||
RsltsSent = oriBatch.RsltsSent;
|
||||
RsltsPrinted = oriBatch.RsltsPrinted;
|
||||
Compound = oriBatch.Compound;
|
||||
HeatMeter = oriBatch.HeatMeter;
|
||||
|
||||
Tests = new List<TestData>();
|
||||
WaterMeters = new List<WaterMeter>();
|
||||
TestRslts = new List<TestRslt>();
|
||||
}
|
||||
|
||||
public virtual int PassedMetersCount()
|
||||
{
|
||||
int count = 0;
|
||||
@@ -263,24 +307,6 @@ namespace Results.Entities
|
||||
return 0;
|
||||
}
|
||||
|
||||
public virtual double Buoyancy()
|
||||
{
|
||||
double timeSum = 0;
|
||||
double sum = 0;
|
||||
|
||||
foreach (var tr in TestRslts)
|
||||
{
|
||||
if (tr.TestData.Evaluate && tr.TestDone)
|
||||
{
|
||||
double duration = (tr.EndTime - tr.StartTime).TotalSeconds;
|
||||
timeSum += duration;
|
||||
sum += (tr.Buoyancy * duration);
|
||||
}
|
||||
}
|
||||
|
||||
return (timeSum == 0) ? 0 : (sum / timeSum);
|
||||
}
|
||||
|
||||
public virtual TestRslt GetTestRslt(string name, int part)
|
||||
{
|
||||
foreach (var tr in TestRslts)
|
||||
@@ -297,11 +323,10 @@ namespace Results.Entities
|
||||
|
||||
public virtual string ToString(int i)
|
||||
{
|
||||
return string.Format("Batch: BatchNr={0} ProgramVersion={1} TestBenchId={2} UserName={3} UserNumber={4} ProcedureName={5}{6} ProcRev={7} ProtocolTitle={8} Remark={9} DensityCorr={10} Custom2={11} Custom3={12} StartTime={13} EndTime={14} Dirty={15} RsltsSent={16} RsltsPrinted={17}",
|
||||
return string.Format("Batch: BatchNr={0} ProgramVersion={1} TestBenchId={2} UserName={3} UserNumber={4} ProcedureName={5}{6} ProcRev={7} Remark={8} RealDensity={9} AtTemperature={10} Buoyancy={11} StartTime={12} EndTime={13} Dirty={14} RsltsSent={15} RsltsPrinted={16}",
|
||||
BatchNr, ProgramVersion, TestBenchId, UserName, UserNumber,
|
||||
ProcedureName, (IsRemoteProcedure ? "(R)" : ""), ProcedureRevision,
|
||||
ProtocolTitle, Remark, DensityCorr, Custom2, Custom3,
|
||||
StartTime, EndTime, Dirty, RsltsSent, RsltsPrinted);
|
||||
Remark, SampleDensity, SampleTemp, Buoyancy, StartTime, EndTime, Dirty, RsltsSent, RsltsPrinted);
|
||||
}
|
||||
|
||||
public virtual void WriteBinary(BinaryWriter writer)
|
||||
@@ -323,11 +348,10 @@ namespace Results.Entities
|
||||
writer.Write((ProcedureDescription != null) ? ProcedureDescription : string.Empty);
|
||||
writer.Write(ProcedureRevision);
|
||||
writer.Write((WatermetersStr != null) ? WatermetersStr : string.Empty);
|
||||
writer.Write((ProtocolTitle != null) ? ProtocolTitle : string.Empty);
|
||||
writer.Write((Remark != null) ? Remark : string.Empty);
|
||||
writer.Write(DensityCorr);
|
||||
writer.Write(Custom2);
|
||||
writer.Write(Custom3);
|
||||
writer.Write(SampleDensity);
|
||||
writer.Write(SampleTemp);
|
||||
writer.Write(Buoyancy);
|
||||
writer.Write(Counter6);
|
||||
writer.Write(Counter7);
|
||||
writer.Write(Counter8);
|
||||
@@ -390,11 +414,10 @@ namespace Results.Entities
|
||||
ProcedureDescription = reader.ReadString();
|
||||
ProcedureRevision = reader.ReadInt32();
|
||||
WatermetersStr = reader.ReadString();
|
||||
ProtocolTitle = reader.ReadString();
|
||||
Remark = reader.ReadString();
|
||||
DensityCorr = reader.ReadInt32();
|
||||
Custom2 = reader.ReadInt32();
|
||||
Custom3 = reader.ReadInt32();
|
||||
SampleDensity = reader.ReadDouble();
|
||||
SampleTemp = reader.ReadDouble();
|
||||
Buoyancy = reader.ReadDouble();
|
||||
Counter6 = reader.ReadInt32();
|
||||
Counter7 = reader.ReadInt32();
|
||||
Counter8 = reader.ReadInt32();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2016-2020 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2016-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -22,35 +22,55 @@ namespace Results.Entities
|
||||
public virtual string Custom2 { get; set; }
|
||||
public virtual string Custom3 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor, safe values
|
||||
/// </summary>
|
||||
public Components()
|
||||
{
|
||||
TestBenchId = 0;
|
||||
TestBenchName = string.Empty;
|
||||
Pump = string.Empty;
|
||||
RegValve = string.Empty;
|
||||
Flowmeter = string.Empty;
|
||||
Diverter = string.Empty;
|
||||
Scale = string.Empty;
|
||||
Custom1 = string.Empty;
|
||||
Custom2 = string.Empty;
|
||||
Custom3 = string.Empty;
|
||||
Pump = string.Empty;
|
||||
RegValve = string.Empty;
|
||||
Flowmeter = string.Empty;
|
||||
Diverter = string.Empty;
|
||||
Scale = string.Empty;
|
||||
Custom1 = string.Empty;
|
||||
Custom2 = string.Empty;
|
||||
Custom3 = string.Empty;
|
||||
}
|
||||
|
||||
public Components(int benchId, string benchName, string pump, string flowmeter,
|
||||
string scale, string regValve, string diverter)
|
||||
string scale, string regValve, string diverter)
|
||||
{
|
||||
TestBenchId = benchId;
|
||||
TestBenchId = benchId;
|
||||
TestBenchName = benchName;
|
||||
Pump = pump;
|
||||
RegValve = regValve;
|
||||
Flowmeter = flowmeter;
|
||||
Diverter = diverter;
|
||||
Scale = scale;
|
||||
Custom1 = string.Empty;
|
||||
Custom2 = string.Empty;
|
||||
Custom3 = string.Empty;
|
||||
Pump = pump;
|
||||
RegValve = regValve;
|
||||
Flowmeter = flowmeter;
|
||||
Diverter = diverter;
|
||||
Scale = scale;
|
||||
Custom1 = string.Empty;
|
||||
Custom2 = string.Empty;
|
||||
Custom3 = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copy constructor, copies all except of Id
|
||||
/// </summary>
|
||||
public Components(Components oriComponents)
|
||||
{
|
||||
TestBenchId = oriComponents.TestBenchId;
|
||||
TestBenchName = oriComponents.TestBenchName;
|
||||
Pump = oriComponents.Pump;
|
||||
RegValve = oriComponents.RegValve;
|
||||
Flowmeter = oriComponents.Flowmeter;
|
||||
Diverter = oriComponents.Diverter;
|
||||
Scale = oriComponents.Scale;
|
||||
Custom1 = oriComponents.Custom1;
|
||||
Custom2 = oriComponents.Custom2;
|
||||
Custom3 = oriComponents.Custom3;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Method to compare the content of two entities
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2013-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -12,7 +12,6 @@ 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 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)
|
||||
public virtual double PulsesPerLiter { get; set; } /// [l ^ -1], in case of heat meters (CompoundMeterId==5) pulses per kWh in [kWh ^ -1]
|
||||
@@ -114,29 +113,40 @@ namespace Results.Entities
|
||||
CompoundMeterId = (byte)compoundMeterId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copy constructor, copies all except of Id
|
||||
/// TestRslt and WaterMeter references arenot set.
|
||||
/// They have to be copied/ser manually.
|
||||
/// </summary>
|
||||
public MeterTestRslt(MeterTestRslt oriMTR)
|
||||
{
|
||||
CopyContentFrom(oriMTR);
|
||||
}
|
||||
|
||||
public virtual void CopyContentFrom(MeterTestRslt src)
|
||||
{
|
||||
if (src == null) return;
|
||||
|
||||
CompoundMeterId = src.CompoundMeterId;
|
||||
RegReaderType = src.RegReaderType;
|
||||
PulsesMeter = src.PulsesMeter;
|
||||
PulsesMaster = src.PulsesMaster;
|
||||
PulsesPerLiter = src.PulsesPerLiter;
|
||||
VolumeStart = src.VolumeStart;
|
||||
VolumeEnd = src.VolumeEnd;
|
||||
VolumeMeter = src.VolumeMeter;
|
||||
VolumeRef = src.VolumeRef;
|
||||
TimestampStart = src.TimestampStart;
|
||||
TimestampEnd = src.TimestampEnd;
|
||||
TestTime = src.TestTime;
|
||||
Error = src.Error;
|
||||
RegReaderType = src.RegReaderType;
|
||||
PulsesMeter = src.PulsesMeter;
|
||||
PulsesMaster = src.PulsesMaster;
|
||||
PulsesPerLiter = src.PulsesPerLiter;
|
||||
VolumeStart = src.VolumeStart;
|
||||
VolumeEnd = src.VolumeEnd;
|
||||
VolumeMeter = src.VolumeMeter;
|
||||
VolumeRef = src.VolumeRef;
|
||||
TimestampStart = src.TimestampStart;
|
||||
TimestampEnd = src.TimestampEnd;
|
||||
TestTime = src.TestTime;
|
||||
Error = src.Error;
|
||||
ErrorIndicators = src.ErrorIndicators;
|
||||
KorrErrQ = src.KorrErrQ;
|
||||
TestDone = src.TestDone;
|
||||
Passed = src.Passed;
|
||||
InfoIndicators = src.InfoIndicators;
|
||||
KorrErrQ = src.KorrErrQ;
|
||||
TestDone = src.TestDone;
|
||||
Passed = src.Passed;
|
||||
#if ORACLE_DB
|
||||
LastError = src.LastError;
|
||||
LastError = src.LastError;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -170,7 +180,7 @@ namespace Results.Entities
|
||||
writer.Write(LastError);
|
||||
#endif
|
||||
writer.Write((TestRslt != null && TestRslt.Name() != null) ? TestRslt.Name() : string.Empty);
|
||||
writer.Write(TestRslt.Part);
|
||||
writer.Write(TestRslt != null ? TestRslt.Part : 0);
|
||||
}
|
||||
|
||||
public virtual void ReadBinary(BinaryReader reader, IList<TestRslt> testResults)
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
///
|
||||
/// Copyright (c) 2016-2020 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2016-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using Config.Entities;
|
||||
|
||||
namespace Results.Entities
|
||||
{
|
||||
@@ -32,33 +33,59 @@ namespace Results.Entities
|
||||
public virtual bool Evaluate { get; set; }
|
||||
|
||||
|
||||
public TestData()
|
||||
/// <summary>
|
||||
/// Default constructor, safe values
|
||||
/// </summary>
|
||||
public TestData()
|
||||
{
|
||||
Name = string.Empty;
|
||||
Method = string.Empty;
|
||||
}
|
||||
|
||||
public TestData(Config.Entities.Test test)
|
||||
public TestData(Test test)
|
||||
: this()
|
||||
{
|
||||
Name = test.Name;
|
||||
Repeats = test.Repeats;
|
||||
Qtg = (double)test.Qtg;
|
||||
Qfrom = (double)test.Qfrom;
|
||||
Qto = (double)test.Qto;
|
||||
TargetVolume = (double)test.Volume;
|
||||
TargetTime = (double)test.TstTime;
|
||||
Method = test.Method;
|
||||
ErrLimLo = (double)test.ErrLimLo;
|
||||
ErrLimHi = (double)test.ErrLimHi;
|
||||
ErrLimMargin = (double)test.Uncertainty;
|
||||
DoControlWaterTemp = test.DoControlWaterTemp;
|
||||
TempLimLo = test.TempLimLo;
|
||||
TempLimHi = test.TempLimHi;
|
||||
Publish = test.Publish;
|
||||
Evaluate = test.DoEvaluate;
|
||||
Name = test.Name;
|
||||
Repeats = test.Repeats;
|
||||
Qtg = (double)test.Qtg;
|
||||
Qfrom = (double)test.Qfrom;
|
||||
Qto = (double)test.Qto;
|
||||
TargetVolume = (double)test.Volume;
|
||||
TargetTime = (double)test.TestTime;
|
||||
Method = test.Method;
|
||||
ErrLimLo = (double)test.ErrLimLo;
|
||||
ErrLimHi = (double)test.ErrLimHi;
|
||||
ErrLimMargin = (double)test.Uncertainty;
|
||||
DoControlWaterTemp = test.DoControlWaterTemp;
|
||||
TempLimLo = test.TempLimLo;
|
||||
TempLimHi = test.TempLimHi;
|
||||
Publish = test.Publish;
|
||||
Evaluate = test.DoEvaluate;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copy constructor, copies all except of Id
|
||||
/// </summary>
|
||||
public TestData(TestData oriTestData)
|
||||
{
|
||||
Name = oriTestData.Name;
|
||||
Repeats = oriTestData.Repeats;
|
||||
Qtg = oriTestData.Qtg;
|
||||
Qfrom = oriTestData.Qfrom;
|
||||
Qto = oriTestData.Qto;
|
||||
TargetVolume = oriTestData.TargetVolume;
|
||||
TargetTime = oriTestData.TargetTime;
|
||||
Method = oriTestData.Method;
|
||||
ErrLimLo = oriTestData.ErrLimLo;
|
||||
ErrLimHi = oriTestData.ErrLimHi;
|
||||
ErrLimMargin = oriTestData.ErrLimMargin;
|
||||
DoControlWaterTemp = oriTestData.DoControlWaterTemp;
|
||||
TempLimLo = oriTestData.TempLimLo;
|
||||
TempLimHi = oriTestData.TempLimHi;
|
||||
Publish = oriTestData.Publish;
|
||||
Evaluate = oriTestData.Evaluate;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Method to compare the content of two entities
|
||||
|
||||
+191
-170
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2020 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2015-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -11,138 +11,139 @@ namespace Results.Entities
|
||||
public class TestRslt
|
||||
{
|
||||
/// Identity
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual Batch Batch { get; set; }
|
||||
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 DB, does not depend on localization and customer
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual Batch Batch { get; set; }
|
||||
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 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] 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]
|
||||
public virtual double MassEnd { get; set; } /// [kg]
|
||||
public virtual double DensityIn { get; set; } /// [kg/m3]
|
||||
public virtual double DensityLine { get; set; } /// [kg/m3]
|
||||
public virtual double DensityDiv { get; set; } /// [kg/m3]
|
||||
public virtual double Buoyancy { get; set; }
|
||||
public virtual double FlowMass { get; set; } /// [kg/h] calculated from conventional true value
|
||||
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; } /// [%] Error of the master flow meter
|
||||
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] 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]
|
||||
public virtual double MassEnd { get; set; } /// [kg]
|
||||
public virtual double DensityIn { get; set; } /// [kg/m3]
|
||||
public virtual double DensityLine { get; set; } /// [kg/m3]
|
||||
public virtual double DensityDiv { get; set; } /// [kg/m3]
|
||||
public virtual double MassOfEvapWater { get; set; } /// [kg]
|
||||
public virtual double FlowMass { get; set; } /// [kg/h] calculated from conventional true value
|
||||
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; } /// [%] 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)
|
||||
public virtual float DivStart50 { get; set; } /// [s] Diverter switch time when test starts at level 50 (e.g. 50%) (not mapped to DB)
|
||||
public virtual float DivStart90 { get; set; } /// [s] Diverter switch time when test starts at level 90 (e.g. 90%) (not mapped to DB)
|
||||
public virtual float DiverterStart { get; set; } /// [s] Diverter switch time when test starts
|
||||
public virtual float DivStart10 { get; set; } /// [s] Diverter switch time when test starts at level 10 (e.g. 10%) (not mapped to DB)
|
||||
public virtual float DivStart50 { get; set; } /// [s] Diverter switch time when test starts at level 50 (e.g. 50%) (not mapped to DB)
|
||||
public virtual float DivStart90 { get; set; } /// [s] Diverter switch time when test starts at level 90 (e.g. 90%) (not mapped to DB)
|
||||
|
||||
public virtual float DiverterEnd { get; set; } /// [s] Diverter switch time when test ends
|
||||
public virtual float DivEnd90 { get; set; } /// [s] Diverter switch time when test starts at level 90 (e.g. 90%) (not mapped to DB)
|
||||
public virtual float DivEnd50 { get; set; } /// [s] Diverter switch time when test starts at level 50 (e.g. 50%) (not mapped to DB)
|
||||
public virtual float DivEnd10 { get; set; } /// [s] Diverter switch time when test starts at level 10 (e.g. 10%) (not mapped to DB)
|
||||
public virtual float DiverterEnd { get; set; } /// [s] Diverter switch time when test ends
|
||||
public virtual float DivEnd90 { get; set; } /// [s] Diverter switch time when test starts at level 90 (e.g. 90%) (not mapped to DB)
|
||||
public virtual float DivEnd50 { get; set; } /// [s] Diverter switch time when test starts at level 50 (e.g. 50%) (not mapped to DB)
|
||||
public virtual float DivEnd10 { get; set; } /// [s] Diverter switch time when test starts at level 10 (e.g. 10%) (not mapped to DB)
|
||||
|
||||
public virtual long ErrorFlags { get; set; } /// bitfield : bit0=E1, bit1=E2, bit2=E3, etc.
|
||||
public virtual long InfoFlags { get; set; } /// bitfield : bit0=E1, bit1=E2, bit2=E3, etc.
|
||||
public virtual long ErrorFlags { get; set; } /// bitfield : bit0=E1, bit1=E2, bit2=E3, etc.
|
||||
public virtual long InfoFlags { get; set; } /// bitfield : bit0=E1, bit1=E2, bit2=E3, etc.
|
||||
|
||||
/// Main results of heat meters
|
||||
public virtual double RefEnergy { get; set; } /// [J] Joul
|
||||
public virtual double RefEnergy { get; set; } /// [J] Joul
|
||||
|
||||
/// Auxiliary results
|
||||
public virtual float AmbTempMean { get; set; } /// [°C] Average ambient air temperature
|
||||
public virtual float AmbTempStart { get; set; } /// [°C] Ambient air temperature on test start
|
||||
public virtual float AmbTempEnd { get; set; } /// [°C] Ambient air temperature on test end
|
||||
public virtual float AmbTempMin { get; set; } /// [°C] Minimum ambient air temperature
|
||||
public virtual float AmbTempMax { get; set; } /// [°C] Maximum ambient air temperature
|
||||
public virtual float AmbPressMean { get; set; } /// [bar] Average ambient air pressure
|
||||
public virtual float AmbPressStart { get; set; } /// [bar] Ambient air pressure on test start
|
||||
public virtual float AmbPressEnd { get; set; } /// [bar] Ambient air pressure on test end
|
||||
public virtual float AmbPressMin { get; set; } /// [bar] Minimum ambient air pressure
|
||||
public virtual float AmbPressMax { get; set; } /// [bar] Maximum ambient air pressure
|
||||
public virtual float AmbHumiMean { get; set; } /// [%] Average ambient air relative humidity
|
||||
public virtual float AmbHumiStart { get; set; } /// [%] Ambient air relative humidity on test start
|
||||
public virtual float AmbHumiEnd { get; set; } /// [%] Ambient air relative humidity on test end
|
||||
public virtual float AmbHumiMin { get; set; } /// [%] Minimum ambient air relative humidity
|
||||
public virtual float AmbHumiMax { get; set; } /// [%] Maximum ambient air relative humidity
|
||||
public virtual float PressUpMean { get; set; } /// [bar] Input water pressure (average)
|
||||
public virtual float PressUpStart { get; set; } /// [bar]
|
||||
public virtual float PressUpEnd { get; set; } /// [bar]
|
||||
public virtual float PressUpMin { get; set; } /// [bar]
|
||||
public virtual float PressUpMax { get; set; } /// [bar]
|
||||
public virtual float PressDownMean { get; set; } /// [bar]
|
||||
public virtual float PressDownStart { get; set; } /// [bar]
|
||||
public virtual float PressDownEnd { get; set; } /// [bar]
|
||||
public virtual float PressDownMin { get; set; } /// [bar]
|
||||
public virtual float PressDownMax { get; set; } /// [bar]
|
||||
public virtual float PressDeltaMean { get; set; } /// [bar]
|
||||
public virtual float PressDeltaStart { get; set; } /// [bar]
|
||||
public virtual float PressDeltaEnd { get; set; } /// [bar]
|
||||
public virtual float PressDeltaMin { get; set; } /// [bar]
|
||||
public virtual float PressDeltaMax { get; set; } /// [bar]
|
||||
public virtual float TempUpMean { get; set; } /// [°C]
|
||||
public virtual float TempUpStart { get; set; } /// [°C]
|
||||
public virtual float TempUpEnd { get; set; } /// [°C]
|
||||
public virtual float TempUpMin { get; set; } /// [°C]
|
||||
public virtual float TempUpMax { get; set; } /// [°C]
|
||||
public virtual float TempDownMean { get; set; } /// [°C]
|
||||
public virtual float TempDownStart { get; set; } /// [°C]
|
||||
public virtual float TempDownEnd { get; set; } /// [°C]
|
||||
public virtual float TempDownMin { get; set; } /// [°C]
|
||||
public virtual float TempDownMax { get; set; } /// [°C]
|
||||
public virtual float TempDivMean { get; set; } /// [°C]
|
||||
public virtual float TempDivStart { get; set; } /// [°C]
|
||||
public virtual float TempDivEnd { get; set; } /// [°C]
|
||||
public virtual float TempDivMin { get; set; } /// [°C]
|
||||
public virtual float TempDivMax { get; set; } /// [°C]
|
||||
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]
|
||||
public virtual float FlowMax { get; set; } /// [m3/h]
|
||||
public virtual float ConductMean { get; set; } /// [uS/cm]
|
||||
public virtual float ConductStart { get; set; } /// [uS/cm]
|
||||
public virtual float ConductEnd { get; set; } /// [uS/cm]
|
||||
public virtual float ConductMin { get; set; } /// [uS/cm]
|
||||
public virtual float ConductMax { get; set; } /// [uS/cm]
|
||||
public virtual float AmbTempMean { get; set; } /// [°C] Average ambient air temperature
|
||||
public virtual float AmbTempStart { get; set; } /// [°C] Ambient air temperature on test start
|
||||
public virtual float AmbTempEnd { get; set; } /// [°C] Ambient air temperature on test end
|
||||
public virtual float AmbTempMin { get; set; } /// [°C] Minimum ambient air temperature
|
||||
public virtual float AmbTempMax { get; set; } /// [°C] Maximum ambient air temperature
|
||||
public virtual float AmbPressMean { get; set; } /// [bar] Average ambient air pressure
|
||||
public virtual float AmbPressStart { get; set; } /// [bar] Ambient air pressure on test start
|
||||
public virtual float AmbPressEnd { get; set; } /// [bar] Ambient air pressure on test end
|
||||
public virtual float AmbPressMin { get; set; } /// [bar] Minimum ambient air pressure
|
||||
public virtual float AmbPressMax { get; set; } /// [bar] Maximum ambient air pressure
|
||||
public virtual float AmbHumiMean { get; set; } /// [%] Average ambient air relative humidity
|
||||
public virtual float AmbHumiStart { get; set; } /// [%] Ambient air relative humidity on test start
|
||||
public virtual float AmbHumiEnd { get; set; } /// [%] Ambient air relative humidity on test end
|
||||
public virtual float AmbHumiMin { get; set; } /// [%] Minimum ambient air relative humidity
|
||||
public virtual float AmbHumiMax { get; set; } /// [%] Maximum ambient air relative humidity
|
||||
public virtual float PressUpMean { get; set; } /// [bar] Input water pressure (average)
|
||||
public virtual float PressUpStart { get; set; } /// [bar]
|
||||
public virtual float PressUpEnd { get; set; } /// [bar]
|
||||
public virtual float PressUpMin { get; set; } /// [bar]
|
||||
public virtual float PressUpMax { get; set; } /// [bar]
|
||||
public virtual float PressDownMean { get; set; } /// [bar]
|
||||
public virtual float PressDownStart { get; set; } /// [bar]
|
||||
public virtual float PressDownEnd { get; set; } /// [bar]
|
||||
public virtual float PressDownMin { get; set; } /// [bar]
|
||||
public virtual float PressDownMax { get; set; } /// [bar]
|
||||
public virtual float PressDeltaMean { get; set; } /// [bar]
|
||||
public virtual float PressDeltaStart { get; set; } /// [bar]
|
||||
public virtual float PressDeltaEnd { get; set; } /// [bar]
|
||||
public virtual float PressDeltaMin { get; set; } /// [bar]
|
||||
public virtual float PressDeltaMax { get; set; } /// [bar]
|
||||
public virtual float TempUpMean { get; set; } /// [°C]
|
||||
public virtual float TempUpStart { get; set; } /// [°C]
|
||||
public virtual float TempUpEnd { get; set; } /// [°C]
|
||||
public virtual float TempUpMin { get; set; } /// [°C]
|
||||
public virtual float TempUpMax { get; set; } /// [°C]
|
||||
public virtual float TempDownMean { get; set; } /// [°C]
|
||||
public virtual float TempDownStart { get; set; } /// [°C]
|
||||
public virtual float TempDownEnd { get; set; } /// [°C]
|
||||
public virtual float TempDownMin { get; set; } /// [°C]
|
||||
public virtual float TempDownMax { get; set; } /// [°C]
|
||||
public virtual float TempDivMean { get; set; } /// [°C]
|
||||
public virtual float TempDivStart { get; set; } /// [°C]
|
||||
public virtual float TempDivEnd { get; set; } /// [°C]
|
||||
public virtual float TempDivMin { get; set; } /// [°C]
|
||||
public virtual float TempDivMax { get; set; } /// [°C]
|
||||
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]
|
||||
public virtual float FlowMax { get; set; } /// [m3/h]
|
||||
public virtual float ConductMean { get; set; } /// [uS/cm]
|
||||
public virtual float ConductStart { get; set; } /// [uS/cm]
|
||||
public virtual float ConductEnd { get; set; } /// [uS/cm]
|
||||
public virtual float ConductMin { get; set; } /// [uS/cm]
|
||||
public virtual float ConductMax { get; set; } /// [uS/cm]
|
||||
|
||||
public virtual float Uncertnt { get; set; } /// [%] Relative error uncertainty
|
||||
public virtual float UncertntScale { get; set; } /// [%] Contribution to uncertainty from scale
|
||||
public virtual float UncertntDensity { get; set; } /// [%] Contribution to uncertainty from density
|
||||
public virtual float UncertntTemp { get; set; } /// [%] Contribution to uncertainty from temperature
|
||||
public virtual float UncertntPressure { get; set; } /// [%] Contribution to uncertainty from pressure
|
||||
public virtual float Uncertnt { get; set; } /// [%] Relative error uncertainty
|
||||
public virtual float UncertntScale { get; set; } /// [%] Contribution to uncertainty from scale
|
||||
public virtual float UncertntDensity { get; set; } /// [%] Contribution to uncertainty from density
|
||||
public virtual float UncertntTemp { get; set; } /// [%] Contribution to uncertainty from temperature
|
||||
public virtual float UncertntPressure { get; set; } /// [%] Contribution to uncertainty from pressure
|
||||
|
||||
public virtual float Custom1 { get; set; } /// [°C] T ref hi mean
|
||||
public virtual float Custom2 { get; set; } /// [°C] T ref hi start
|
||||
public virtual float Custom3 { get; set; } /// [°C] T ref hi end
|
||||
public virtual float Custom4 { get; set; } /// [°C] T ref hi min
|
||||
public virtual float Custom5 { get; set; } /// [°C] T ref hi max
|
||||
public virtual float Custom6 { get; set; } /// [°C] T ref lo mean
|
||||
public virtual float Custom7 { get; set; } /// [°C] T ref lo start
|
||||
public virtual float Custom8 { get; set; } /// [°C] T ref lo end
|
||||
public virtual float Custom9 { get; set; } /// [°C] T ref lo min
|
||||
public virtual float Custom10 { get; set; } /// [°C] T ref lo max
|
||||
public virtual float Custom1 { get; set; } /// [°C] T ref hi mean
|
||||
public virtual float Custom2 { get; set; } /// [°C] T ref hi start
|
||||
public virtual float Custom3 { get; set; } /// [°C] T ref hi end
|
||||
public virtual float Custom4 { get; set; } /// [°C] T ref hi min
|
||||
public virtual float Custom5 { get; set; } /// [°C] T ref hi max
|
||||
public virtual float Custom6 { get; set; } /// [°C] T ref lo mean
|
||||
public virtual float Custom7 { get; set; } /// [°C] T ref lo start
|
||||
public virtual float Custom8 { get; set; } /// [°C] T ref lo end
|
||||
public virtual float Custom9 { get; set; } /// [°C] T ref lo min
|
||||
public virtual float Custom10 { get; set; } /// [°C] T ref lo max
|
||||
|
||||
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 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; }
|
||||
|
||||
/// Wrappers
|
||||
public virtual string Name() { return Utils.GetTestName(TestData.Name, TestData.Repeats, RepetitionNr); }
|
||||
@@ -152,7 +153,10 @@ 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 string RefFlowmeter() { return (Components != null) ? Components.Flowmeter : string.Empty; }
|
||||
public virtual string RefFlowmeter() { return (Components != null && Components.Flowmeter != null) ? Components.Flowmeter : string.Empty; }
|
||||
public virtual string Scale() { return (Components != null && Components.Scale != null) ? Components.Scale : string.Empty; }
|
||||
public virtual string Diverter() { return (Components != null && Components.Diverter != null) ? Components.Diverter : string.Empty; }
|
||||
public virtual string RegValve() { return (Components != null && Components.RegValve != null) ? Components.RegValve : string.Empty; }
|
||||
public virtual bool IsRelErrTest() { return (MethodClass != null) ? (MethodClass.Contains("FixedStart") || MethodClass.Contains("FlyingStart") || MethodClass.Contains("CombinedWithDetection") || MethodClass.Contains("DiverterTest") || MethodClass.Contains("ManualEntry")) : true; }
|
||||
public virtual bool IsPMaxTest() { return (MethodClass != null) ? (MethodClass.Contains("PMaxTest") || MethodClass.Contains("LeakTest") || TestData.Method.ToLower().Contains("pmax")) : true; }
|
||||
public virtual bool IsStartStop() { return (MethodClass != null) ? MethodClass.Contains("FixedStart") : true; }
|
||||
@@ -246,46 +250,51 @@ namespace Results.Entities
|
||||
{
|
||||
if (src == null) return;
|
||||
|
||||
Components = src.Components; /// ???
|
||||
Part = src.Part;
|
||||
RepetitionNr = src.RepetitionNr;
|
||||
MethodClass = src.MethodClass;
|
||||
TestDone = src.TestDone;
|
||||
Remark = src.Remark;
|
||||
StartTime = src.StartTime;
|
||||
EndTime = src.EndTime;
|
||||
FlowSetTime = src.FlowSetTime;
|
||||
Components = src.Components; /// ???
|
||||
|
||||
Part = src.Part;
|
||||
RepetitionNr = src.RepetitionNr;
|
||||
MethodClass = src.MethodClass;
|
||||
TestDone = src.TestDone;
|
||||
Remark = src.Remark;
|
||||
StartTime = src.StartTime;
|
||||
EndTime = src.EndTime;
|
||||
FlowSetTime = src.FlowSetTime;
|
||||
TimeBtwnMassMsrmnts = src.TimeBtwnMassMsrmnts;
|
||||
TestTime = src.TestTime;
|
||||
PulsesMaster = src.PulsesMaster;
|
||||
TotalPulsesMstr = src.TotalPulsesMstr;
|
||||
ConstMasterRaw = src.ConstMasterRaw;
|
||||
ConstMasterCorr = src.ConstMasterCorr;
|
||||
ConstMaster = src.ConstMaster;
|
||||
MassStartRaw = src.MassStartRaw;
|
||||
MassStart = src.MassStart;
|
||||
MassEndRaw = src.MassEndRaw;
|
||||
MassEnd = src.MassEnd;
|
||||
DensityIn = src.DensityIn;
|
||||
DensityLine = src.DensityLine;
|
||||
DensityDiv = src.DensityDiv;
|
||||
Buoyancy = src.Buoyancy;
|
||||
FlowMass = src.FlowMass;
|
||||
FlowVolume = src.FlowVolume;
|
||||
VolumeCTV = src.VolumeCTV;
|
||||
VolumeMaster = src.VolumeMaster;
|
||||
ErrorMaster = src.ErrorMaster;
|
||||
TestTime = src.TestTime;
|
||||
TestTimeCorrection = src.TestTimeCorrection;
|
||||
PulsesMaster = src.PulsesMaster;
|
||||
TotalPulsesMstr = src.TotalPulsesMstr;
|
||||
ConstMasterRaw = src.ConstMasterRaw;
|
||||
ConstMasterCorr = src.ConstMasterCorr;
|
||||
ConstMaster = src.ConstMaster;
|
||||
MassStartRaw = src.MassStartRaw;
|
||||
MassStart = src.MassStart;
|
||||
MassEndRaw = src.MassEndRaw;
|
||||
MassEnd = src.MassEnd;
|
||||
DensityIn = src.DensityIn;
|
||||
DensityLine = src.DensityLine;
|
||||
DensityDiv = src.DensityDiv;
|
||||
MassOfEvapWater = src.MassOfEvapWater;
|
||||
FlowMass = src.FlowMass;
|
||||
FlowVolume = src.FlowVolume;
|
||||
VolumeCTV = src.VolumeCTV;
|
||||
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;
|
||||
DivStart10 = src.DivStart10;
|
||||
DivStart50 = src.DivStart50;
|
||||
DivStart90 = src.DivStart90;
|
||||
DiverterEnd = src.DiverterEnd;
|
||||
DivEnd10 = src.DivEnd10;
|
||||
DivEnd50 = src.DivEnd50;
|
||||
DivEnd90 = src.DivEnd90;
|
||||
|
||||
ErrorFlags = src.ErrorFlags;
|
||||
InfoFlags = src.InfoFlags;
|
||||
RefEnergy = src.RefEnergy;
|
||||
|
||||
AmbTempMean = src.AmbTempMean;
|
||||
AmbTempStart = src.AmbTempStart;
|
||||
AmbTempEnd = src.AmbTempEnd;
|
||||
@@ -342,15 +351,21 @@ namespace Results.Entities
|
||||
ConductMin = src.ConductMin;
|
||||
ConductMax = src.ConductMax;
|
||||
|
||||
Custom1 = src.Custom1;
|
||||
Custom2 = src.Custom2;
|
||||
Custom3 = src.Custom3;
|
||||
Custom4 = src.Custom4;
|
||||
Custom5 = src.Custom5;
|
||||
Custom6 = src.Custom6;
|
||||
Custom7 = src.Custom7;
|
||||
Custom8 = src.Custom8;
|
||||
Custom9 = src.Custom9;
|
||||
Uncertnt = src.Uncertnt;
|
||||
UncertntScale = src.UncertntScale;
|
||||
UncertntDensity = src.UncertntDensity;
|
||||
UncertntTemp = src.UncertntTemp;
|
||||
UncertntPressure = src.UncertntPressure;
|
||||
|
||||
Custom1 = src.Custom1;
|
||||
Custom2 = src.Custom2;
|
||||
Custom3 = src.Custom3;
|
||||
Custom4 = src.Custom4;
|
||||
Custom5 = src.Custom5;
|
||||
Custom6 = src.Custom6;
|
||||
Custom7 = src.Custom7;
|
||||
Custom8 = src.Custom8;
|
||||
Custom9 = src.Custom9;
|
||||
Custom10 = src.Custom10;
|
||||
|
||||
Counter1 = src.Counter1;
|
||||
@@ -371,6 +386,12 @@ namespace Results.Entities
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary> Wrapper </summary>
|
||||
public virtual string InfoFlagsStr()
|
||||
{
|
||||
return Utils.ErrorFlagsStr(InfoFlags);
|
||||
}
|
||||
|
||||
public virtual bool IsPartCompatible(int waterMeterPartNr)
|
||||
{
|
||||
if ((this.Part == 0) || (waterMeterPartNr == 0)) return true;
|
||||
@@ -390,10 +411,10 @@ namespace Results.Entities
|
||||
|
||||
public virtual string ToString(int i)
|
||||
{
|
||||
return string.Format("TestRslt: Part={0} RepetitionNr={1} TestDone={2} Remark={3} StartTime={4} EndTime={5} FlowSetTime={6} TestTime={7} PulsesMaster={8} ConstMaster={9} MassStartRaw={10} MassStart={11} MassEndRaw={12} MassEnd={13} DensityIn={14} DensityOut={15} DensityDiv={16} Buoyancy={17} FlowMass={18} FlowVolume={19} VolumeCTV={20} VolumeMaster={21} ErrorMaster={22} DiverterStart={85} DiverterEnd={86} ErrorFlags={23} InfoFlags={24} AmbTempMean={25} AmbTempStart={26} AmbTempEnd={27} AmbTempMin={28} AmbTempMax={29} AmbPressMean={30} AmbPressStart={31} AmbPressEnd={32} AmbPressMin={33} AmbPressMax={34} AmbHumiMean={35} AmbHumiStart={36} AmbHumiEnd={37} AmbHumiMin={38} AmbHumiMax={39} PressUpMean={40} PressUpStart={41} PressUpEnd={42} PressUpMin={43} PressUpMax={44} PressDownMean={45} PressDownStart={46} PressDownEnd={47} PressDownMin={48} PressDownMax={49} PressDeltaMean={50} PressDeltaStart={51} PressDeltaEnd={52} PressDeltaMin={53} PressDeltaMax={54} TempUpMean={55} TempUpStart={56} TempUpEnd={57} TempUpMin={58} TempUpMax={59} TempDownMean={60} TempDownStart={61} TempDownEnd={62} TempDownMin={63} TempDownMax={64} TempDivMean={65} TempDivStart={66} TempDivEnd={67} TempDivMin={68} TempDivMax={69} FlowMean={70} FlowStart={71} FlowEnd={72} FlowMin={73} FlowMax={74} Custom1={75} Custom2={76} Custom3={77} Custom4={78} Custom5={79} Custom6={80} Custom7={81} Custom8={82} Custom9={83} Custom10={84}",
|
||||
return string.Format("TestRslt: Part={0} RepetitionNr={1} TestDone={2} Remark={3} StartTime={4} EndTime={5} FlowSetTime={6} TestTime={7} PulsesMaster={8} ConstMaster={9} MassStartRaw={10} MassStart={11} MassEndRaw={12} MassEnd={13} DensityIn={14} DensityOut={15} DensityDiv={16} MassOfEvapWaater={17} FlowMass={18} FlowVolume={19} VolumeCTV={20} VolumeMaster={21} ErrorMaster={22} DiverterStart={85} DiverterEnd={86} ErrorFlags={23} InfoFlags={24} AmbTempMean={25} AmbTempStart={26} AmbTempEnd={27} AmbTempMin={28} AmbTempMax={29} AmbPressMean={30} AmbPressStart={31} AmbPressEnd={32} AmbPressMin={33} AmbPressMax={34} AmbHumiMean={35} AmbHumiStart={36} AmbHumiEnd={37} AmbHumiMin={38} AmbHumiMax={39} PressUpMean={40} PressUpStart={41} PressUpEnd={42} PressUpMin={43} PressUpMax={44} PressDownMean={45} PressDownStart={46} PressDownEnd={47} PressDownMin={48} PressDownMax={49} PressDeltaMean={50} PressDeltaStart={51} PressDeltaEnd={52} PressDeltaMin={53} PressDeltaMax={54} TempUpMean={55} TempUpStart={56} TempUpEnd={57} TempUpMin={58} TempUpMax={59} TempDownMean={60} TempDownStart={61} TempDownEnd={62} TempDownMin={63} TempDownMax={64} TempDivMean={65} TempDivStart={66} TempDivEnd={67} TempDivMin={68} TempDivMax={69} FlowMean={70} FlowStart={71} FlowEnd={72} FlowMin={73} FlowMax={74} Custom1={75} Custom2={76} Custom3={77} Custom4={78} Custom5={79} Custom6={80} Custom7={81} Custom8={82} Custom9={83} Custom10={84}",
|
||||
Part, RepetitionNr, TestDone, Remark, StartTime, EndTime, FlowSetTime, TestTime,
|
||||
PulsesMaster, ConstMaster, MassStartRaw, MassStart, MassEndRaw, MassEnd,
|
||||
DensityIn, DensityLine, DensityDiv, Buoyancy, FlowMass, FlowVolume,
|
||||
DensityIn, DensityLine, DensityDiv, MassOfEvapWater, FlowMass, FlowVolume,
|
||||
VolumeCTV, VolumeMaster, ErrorMaster, ErrorFlags, InfoFlags,
|
||||
AmbTempMean, AmbTempStart, AmbTempEnd, AmbTempMin, AmbTempMax,
|
||||
AmbPressMean, AmbPressStart, AmbPressEnd, AmbPressMin, AmbPressMax,
|
||||
@@ -461,7 +482,7 @@ namespace Results.Entities
|
||||
writer.Write(DensityIn);
|
||||
writer.Write(DensityLine);
|
||||
writer.Write(DensityDiv);
|
||||
writer.Write(Buoyancy);
|
||||
writer.Write(MassOfEvapWater);
|
||||
writer.Write(FlowMass);
|
||||
writer.Write(FlowVolume);
|
||||
writer.Write(VolumeCTV);
|
||||
@@ -602,7 +623,7 @@ namespace Results.Entities
|
||||
DensityIn = reader.ReadDouble();
|
||||
DensityLine = reader.ReadDouble();
|
||||
DensityDiv = reader.ReadDouble();
|
||||
Buoyancy = reader.ReadDouble();
|
||||
MassOfEvapWater = reader.ReadDouble();
|
||||
FlowMass = reader.ReadDouble();
|
||||
FlowVolume = reader.ReadDouble();
|
||||
VolumeCTV = reader.ReadDouble();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2020 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2015-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -59,7 +59,7 @@ namespace Results.Entities
|
||||
public virtual string Remark { get; set; }
|
||||
|
||||
#if IPERL
|
||||
public virtual double OrigCalibFactor { get; set; } /// Original iPerl calibration factor used during the test
|
||||
public virtual double OrigCalibFactor { get; set; } /// Original iPerl calibration factor used during the test
|
||||
public virtual double CalibFactor { get; set; } /// iPerl calibration factor used during the test
|
||||
public virtual double 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
|
||||
@@ -76,8 +76,6 @@ namespace Results.Entities
|
||||
/// <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; }
|
||||
@@ -91,13 +89,17 @@ namespace Results.Entities
|
||||
public virtual int ProdQ2CorrLR { get; set; } /// iPerl Q2 correction for the L-flow written to iPerl
|
||||
#endif
|
||||
#if ORACLE_DB
|
||||
public virtual int Pruefindex { get; set; } /// >= 1 ... pruefindex
|
||||
public virtual int AssignedSerialNr { get; set; }
|
||||
public virtual string Prefix { get; set; }
|
||||
public virtual string Suffix { get; set; }
|
||||
public virtual string CompleteSerialNr { get; set; }
|
||||
public virtual int WMTypeRevision { get; set; }
|
||||
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 int ProcessId { get; set; } /// Not mapped to DB !!! Tracing DB Process ID
|
||||
public virtual int SessionId { get; set; } /// Not mapped to DB !!! 1 (regular tracing DB session) or 2 (alternative tracing DB session)
|
||||
public virtual bool LastRecordIsNok { get; set; } /// Not mapped to DB !!! Previous record verification result
|
||||
|
||||
@@ -186,6 +188,30 @@ namespace Results.Entities
|
||||
#endif
|
||||
}
|
||||
|
||||
public virtual long InfoFlagsFromTests()
|
||||
{
|
||||
long infoFlags = 0;
|
||||
foreach (var mtr in MeterTestRslts)
|
||||
{
|
||||
if (mtr.Evaluate() && mtr.TestDone) infoFlags |= mtr.TestRslt.InfoFlags;
|
||||
}
|
||||
return infoFlags;
|
||||
}
|
||||
|
||||
public virtual long InfoFlagsFromTestsAndWM()
|
||||
{
|
||||
return InfoFlagsFromTests() | InfoFlags;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert combined errorFlags of all tests to string
|
||||
/// </summary>
|
||||
/// <returns>ErrorFlags string</returns>
|
||||
public virtual string InfoFlagsStr()
|
||||
{
|
||||
return Utils.ErrorFlagsStr(InfoFlagsFromTestsAndWM());
|
||||
}
|
||||
|
||||
public virtual string PassedOrErrorFlagsStr()
|
||||
{
|
||||
string eFlags = Utils.ErrorFlagsStr(ErrorFlagsFromTestsAndWM());
|
||||
@@ -395,9 +421,13 @@ namespace Results.Entities
|
||||
{
|
||||
MeterTestRslts = new List<MeterTestRslt>();
|
||||
#if ORACLE_DB
|
||||
AssignedSerialNr = 0;
|
||||
Prefix = string.Empty;
|
||||
Suffix = string.Empty;
|
||||
CompleteSerialNr = string.Empty;
|
||||
WMTypeRevision = 0;
|
||||
Pruefindex = 1;
|
||||
HydrPruefung = 0;
|
||||
WMTypeRevision = 0;
|
||||
RawTestInfos = null;
|
||||
CompleteTestInfos = null;
|
||||
#endif
|
||||
@@ -415,7 +445,6 @@ namespace Results.Entities
|
||||
ArchivePath = string.Empty;
|
||||
Remark = string.Empty;
|
||||
#if TURA_SPECIAL
|
||||
CompleteSerialNr = string.Empty;
|
||||
RadioAddress = string.Empty;
|
||||
ProdUserName = string.Empty;
|
||||
ProdPurchaseOrder = string.Empty;
|
||||
@@ -430,37 +459,36 @@ namespace Results.Entities
|
||||
{
|
||||
if (src == null) return;
|
||||
|
||||
SerialNr = src.SerialNr;
|
||||
SerialNrAux = src.SerialNrAux;
|
||||
PurchaseOrder = src.PurchaseOrder;
|
||||
YearOfProduction = src.YearOfProduction;
|
||||
// WMPosition skipped
|
||||
EndState = src.EndState;
|
||||
EndStateAux = src.EndStateAux;
|
||||
QRise = src.QRise;
|
||||
QFall = src.QFall;
|
||||
ErrorFlags = src.ErrorFlags;
|
||||
Passed = src.Passed;
|
||||
ResultCode = src.ResultCode;
|
||||
ArchivePath = src.ArchivePath;
|
||||
Remark = src.Remark;
|
||||
SerialNr = src.SerialNr;
|
||||
SerialNrAux = src.SerialNrAux;
|
||||
PurchaseOrder = src.PurchaseOrder;
|
||||
YearOfProduction = src.YearOfProduction;
|
||||
WMPosition = src.WMPosition;
|
||||
EndState = src.EndState;
|
||||
EndStateAux = src.EndStateAux;
|
||||
QRise = src.QRise;
|
||||
QFall = src.QFall;
|
||||
ErrorFlags = src.ErrorFlags;
|
||||
InfoFlags = src.InfoFlags;
|
||||
Passed = src.Passed;
|
||||
ResultCode = src.ResultCode;
|
||||
ArchivePath = src.ArchivePath;
|
||||
Remark = src.Remark;
|
||||
#if IPERL
|
||||
OrigCalibFactor = src.OrigCalibFactor;
|
||||
CalibFactor = src.CalibFactor;
|
||||
OrigCalibFactor = src.OrigCalibFactor;
|
||||
CalibFactor = src.CalibFactor;
|
||||
OrigCalibFactorLNA = src.OrigCalibFactorLNA;
|
||||
CalibFactorLNA = src.CalibFactorLNA;
|
||||
Q2ErrWOCorrection = src.Q2ErrWOCorrection;
|
||||
Q2CorrRL = src.Q2CorrRL;
|
||||
Q2CorrLR = src.Q2CorrLR;
|
||||
Q2CorrFlowRight = src.Q2CorrFlowRight;
|
||||
Diff2Hz8Hz = src.Diff2Hz8Hz;
|
||||
Hz2CorrectionDone = src.Hz2CorrectionDone;
|
||||
Hz2Correction = src.Hz2Correction;
|
||||
FWVersion = src.FWVersion;
|
||||
CalibFactorLNA = src.CalibFactorLNA;
|
||||
Q2ErrWOCorrection = src.Q2ErrWOCorrection;
|
||||
Q2CorrRL = src.Q2CorrRL;
|
||||
Q2CorrLR = src.Q2CorrLR;
|
||||
Q2CorrFlowRight = src.Q2CorrFlowRight;
|
||||
Diff2Hz8Hz = src.Diff2Hz8Hz;
|
||||
Hz2CorrectionDone = src.Hz2CorrectionDone;
|
||||
Hz2Correction = src.Hz2Correction;
|
||||
FWVersion = src.FWVersion;
|
||||
#endif
|
||||
#if TURA_SPECIAL
|
||||
AssignedSerialNr = src.AssignedSerialNr;
|
||||
CompleteSerialNr = src.CompleteSerialNr;
|
||||
RadioAddress = src.RadioAddress;
|
||||
PaletteNr = src.PaletteNr;
|
||||
UmkartonNr = src.UmkartonNr;
|
||||
@@ -474,15 +502,19 @@ namespace Results.Entities
|
||||
ProdQ2CorrLR = src.ProdQ2CorrLR;
|
||||
#endif
|
||||
#if ORACLE_DB
|
||||
Pruefindex = src.Pruefindex;
|
||||
HydrPruefung = src.HydrPruefung;
|
||||
WMTypeRevision = src.WMTypeRevision;
|
||||
RawTestInfos = src.RawTestInfos;
|
||||
CompleteTestInfos = src.CompleteTestInfos;
|
||||
AssignedSerialNr = src.AssignedSerialNr;
|
||||
Prefix = src.Prefix;
|
||||
Suffix = src.Suffix;
|
||||
CompleteSerialNr = src.CompleteSerialNr;
|
||||
WMTypeRevision = src.WMTypeRevision;
|
||||
Pruefindex = src.Pruefindex;
|
||||
HydrPruefung = src.HydrPruefung;
|
||||
RawTestInfos = src.RawTestInfos; /// Not mapped to DB
|
||||
CompleteTestInfos = src.CompleteTestInfos; /// Not mapped to DB
|
||||
#endif
|
||||
ProcessId = src.ProcessId;
|
||||
SessionId = src.SessionId;
|
||||
LastRecordIsNok = src.LastRecordIsNok;
|
||||
ProcessId = src.ProcessId; /// Not mapped to DB
|
||||
SessionId = src.SessionId; /// Not mapped to DB
|
||||
LastRecordIsNok = src.LastRecordIsNok; /// Not mapped to DB
|
||||
|
||||
foreach (var mtr in MeterTestRslts)
|
||||
{
|
||||
@@ -638,8 +670,6 @@ namespace Results.Entities
|
||||
writer.Write((FWVersion != null) ? FWVersion : string.Empty);
|
||||
#endif
|
||||
#if TURA_SPECIAL
|
||||
writer.Write(AssignedSerialNr);
|
||||
writer.Write((CompleteSerialNr != null) ? CompleteSerialNr : string.Empty);
|
||||
writer.Write((RadioAddress != null) ? RadioAddress : string.Empty);
|
||||
writer.Write(PaletteNr);
|
||||
writer.Write(UmkartonNr);
|
||||
@@ -653,9 +683,13 @@ namespace Results.Entities
|
||||
writer.Write(ProdQ2CorrLR);
|
||||
#endif
|
||||
#if ORACLE_DB
|
||||
writer.Write(AssignedSerialNr);
|
||||
writer.Write((Prefix != null) ? Prefix : string.Empty);
|
||||
writer.Write((Suffix != null) ? Suffix : string.Empty);
|
||||
writer.Write((CompleteSerialNr != null) ? CompleteSerialNr : string.Empty);
|
||||
writer.Write(WMTypeRevision);
|
||||
writer.Write(Pruefindex);
|
||||
writer.Write(HydrPruefung);
|
||||
writer.Write(WMTypeRevision);
|
||||
|
||||
/// Write RawTestInfos
|
||||
IList<Results.Output.SensusTestInfo> rawTestInfos = RawTestInfos as IList<Results.Output.SensusTestInfo>;
|
||||
@@ -731,8 +765,6 @@ namespace Results.Entities
|
||||
FWVersion = reader.ReadString();
|
||||
#endif
|
||||
#if TURA_SPECIAL
|
||||
AssignedSerialNr = reader.ReadInt32();
|
||||
CompleteSerialNr = reader.ReadString();
|
||||
RadioAddress = reader.ReadString();
|
||||
PaletteNr = reader.ReadInt32();
|
||||
UmkartonNr = reader.ReadInt32();
|
||||
@@ -746,9 +778,13 @@ namespace Results.Entities
|
||||
ProdQ2CorrLR = reader.ReadInt32();
|
||||
#endif
|
||||
#if ORACLE_DB
|
||||
AssignedSerialNr = reader.ReadInt32();
|
||||
Prefix = reader.ReadString();
|
||||
Suffix = reader.ReadString();
|
||||
CompleteSerialNr = reader.ReadString();
|
||||
WMTypeRevision = reader.ReadInt32();
|
||||
Pruefindex = reader.ReadInt32();
|
||||
HydrPruefung = reader.ReadInt32();
|
||||
WMTypeRevision = reader.ReadInt32();
|
||||
|
||||
/// Read RawTestInfos
|
||||
int rawTestInfosCount = reader.ReadInt32();
|
||||
|
||||
@@ -1,65 +1,101 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2020 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2015-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using Config.Entities;
|
||||
|
||||
namespace Results.Entities
|
||||
{
|
||||
public class WaterMeterData
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual string ProductName { get; set; }
|
||||
public virtual string Producer { get; set; }
|
||||
|
||||
public virtual double DN { get; set; } /// [mm]
|
||||
public virtual double L { get; set; } /// [mm]
|
||||
public virtual Config.Entities.Mounting Mounting { get; set; } /// H / V / S / F
|
||||
|
||||
public virtual bool NewQnames { get; set; } /// Yes = Q3... No = Qn...
|
||||
public virtual double Q4_Qmax { get; set; } /// [m3/h]
|
||||
public virtual double Q3_Qn { get; set; } /// [m3/h]
|
||||
public virtual double Q2_Qt { get; set; } /// [m3/h]
|
||||
public virtual double Q1_Qmin { get; set; } /// [m3/h]
|
||||
|
||||
public virtual string MetrologicalClass { get; set; }
|
||||
public virtual Config.Entities.TemperatureClass TemperatureClass { get; set; }
|
||||
public virtual Config.Entities.PressureLossClass PressureLossClass { get; set; }
|
||||
public virtual Config.Entities.MaxAdmissiblePressure MaxAdmissiblePressure { get; set; }
|
||||
public virtual Config.Entities.FlowProfileSensitivityClass FlowProfileSensitivityClass { get; set; }
|
||||
|
||||
public virtual string ApprovalInfo { get; set; }
|
||||
public virtual string Certificate { get; set; }
|
||||
|
||||
public virtual double PulsesPerLtr { get; set; }
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual string ProductName { get; set; }
|
||||
public virtual string Producer { get; set; }
|
||||
public virtual double DN { get; set; } /// [mm]
|
||||
public virtual double L { get; set; } /// [mm]
|
||||
public virtual Mounting Mounting { get; set; } /// H / V / S / F
|
||||
public virtual bool NewQnames { get; set; } /// Yes = Q3... No = Qn...
|
||||
public virtual double Q4_Qmax { get; set; } /// [m3/h]
|
||||
public virtual double Q3_Qn { get; set; } /// [m3/h]
|
||||
public virtual double Q2_Qt { get; set; } /// [m3/h]
|
||||
public virtual double Q1_Qmin { get; set; } /// [m3/h]
|
||||
public virtual string MetrologicalClass { get; set; }
|
||||
public virtual TemperatureClass TemperatureClass { get; set; }
|
||||
public virtual PressureLossClass PressureLossClass { get; set; }
|
||||
public virtual MaxAdmissiblePressure MaxAdmissiblePressure { get; set; }
|
||||
public virtual FlowProfileSensitivityClass FlowProfileSensitivityClass { get; set; }
|
||||
public virtual string ApprovalInfo { get; set; }
|
||||
public virtual string Certificate { get; set; }
|
||||
public virtual double PulsesPerLtr { get; set; }
|
||||
|
||||
/// Concerns compound water meters
|
||||
public virtual string ProducerAux { get; set; }
|
||||
public virtual double Q3_Qn_Aux { get; set; } /// [m3/h]
|
||||
public virtual string MetrologicalClassAux { get; set; }
|
||||
public virtual string ApprovalInfoAux { get; set; }
|
||||
|
||||
public virtual Config.Entities.Medium Medium { get; set; }
|
||||
|
||||
public virtual string Text1 { get; set; }
|
||||
public virtual string Text2 { get; set; }
|
||||
public virtual string Text3 { get; set; }
|
||||
public virtual string Text4 { get; set; }
|
||||
public virtual string Text5 { get; set; }
|
||||
|
||||
public virtual bool Compound { get; set; }
|
||||
public virtual bool HeatMeter { get; set; }
|
||||
public virtual string ProducerAux { get; set; }
|
||||
public virtual double Q3_Qn_Aux { get; set; } /// [m3/h]
|
||||
public virtual string MetrologicalClassAux { get; set; }
|
||||
public virtual string ApprovalInfoAux { get; set; }
|
||||
|
||||
public virtual Medium Medium { get; set; }
|
||||
public virtual string Text1 { get; set; }
|
||||
public virtual string Text2 { get; set; }
|
||||
public virtual string Text3 { get; set; }
|
||||
public virtual string Text4 { get; set; }
|
||||
public virtual string Text5 { get; set; }
|
||||
public virtual bool Compound { get; set; }
|
||||
public virtual bool HeatMeter { get; set; }
|
||||
#if ORACLE_DB
|
||||
public virtual int WMTypeId { get; set; }
|
||||
public virtual int WMTypeId { get; set; }
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor, safe values
|
||||
/// </summary>
|
||||
public WaterMeterData()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copy constructor, copies all except of Id
|
||||
/// </summary>
|
||||
public WaterMeterData(WaterMeterData oriWMData)
|
||||
{
|
||||
ProductName = oriWMData.ProductName;
|
||||
Producer = oriWMData.Producer;
|
||||
DN = oriWMData.DN;
|
||||
L = oriWMData.L;
|
||||
Mounting = oriWMData.Mounting;
|
||||
NewQnames = oriWMData.NewQnames;
|
||||
Q4_Qmax = oriWMData.Q4_Qmax;
|
||||
Q3_Qn = oriWMData.Q3_Qn;
|
||||
Q2_Qt = oriWMData.Q2_Qt;
|
||||
Q1_Qmin = oriWMData.Q1_Qmin;
|
||||
MetrologicalClass = oriWMData.MetrologicalClass;
|
||||
TemperatureClass = oriWMData.TemperatureClass;
|
||||
PressureLossClass = oriWMData.PressureLossClass;
|
||||
MaxAdmissiblePressure = oriWMData.MaxAdmissiblePressure;
|
||||
FlowProfileSensitivityClass = oriWMData.FlowProfileSensitivityClass;
|
||||
ApprovalInfo = oriWMData.ApprovalInfo;
|
||||
Certificate = oriWMData.Certificate;
|
||||
PulsesPerLtr = oriWMData.PulsesPerLtr;
|
||||
ProducerAux = oriWMData.ProducerAux;
|
||||
Q3_Qn_Aux = oriWMData.Q3_Qn_Aux;
|
||||
MetrologicalClassAux = oriWMData.MetrologicalClassAux;
|
||||
ApprovalInfoAux = oriWMData.ApprovalInfoAux;
|
||||
Medium = oriWMData.Medium;
|
||||
Text1 = oriWMData.Text1;
|
||||
Text2 = oriWMData.Text2;
|
||||
Text3 = oriWMData.Text3;
|
||||
Text4 = oriWMData.Text4;
|
||||
Text5 = oriWMData.Text5;
|
||||
Compound = oriWMData.Compound;
|
||||
HeatMeter = oriWMData.HeatMeter;
|
||||
#if ORACLE_DB
|
||||
WMTypeId = oriWMData.WMTypeId;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Method to compare the content of two entities
|
||||
@@ -70,44 +106,34 @@ namespace Results.Entities
|
||||
{
|
||||
if (ProductName != wmd.ProductName) return false;
|
||||
if (Producer != wmd.Producer) return false;
|
||||
|
||||
if (DN != wmd.DN) return false;
|
||||
if (L != wmd.L) return false;
|
||||
if (Mounting != wmd.Mounting) return false;
|
||||
|
||||
if (NewQnames != wmd.NewQnames) return false;
|
||||
if (Q4_Qmax != wmd.Q4_Qmax) return false;
|
||||
if (Q3_Qn != wmd.Q3_Qn) return false;
|
||||
if (Q2_Qt != wmd.Q2_Qt) return false;
|
||||
if (Q1_Qmin != wmd.Q1_Qmin) return false;
|
||||
|
||||
if (MetrologicalClass != wmd.MetrologicalClass) return false;
|
||||
if (TemperatureClass != wmd.TemperatureClass) return false;
|
||||
if (PressureLossClass != wmd.PressureLossClass) return false;
|
||||
if (MaxAdmissiblePressure != wmd.MaxAdmissiblePressure) return false;
|
||||
if (FlowProfileSensitivityClass != wmd.FlowProfileSensitivityClass) return false;
|
||||
|
||||
if (ApprovalInfo != wmd.ApprovalInfo) return false;
|
||||
if (Certificate != wmd.Certificate) return false;
|
||||
|
||||
if (PulsesPerLtr != wmd.PulsesPerLtr) return false;
|
||||
|
||||
if (ProducerAux != wmd.ProducerAux) return false;
|
||||
if (Q3_Qn_Aux != wmd.Q3_Qn_Aux) return false;
|
||||
if (MetrologicalClassAux != wmd.MetrologicalClassAux) return false;
|
||||
if (ApprovalInfoAux != wmd.ApprovalInfoAux) return false;
|
||||
|
||||
if (Medium != wmd.Medium) return false;
|
||||
|
||||
if (Text1 != wmd.Text1) return false;
|
||||
if (Text2 != wmd.Text2) return false;
|
||||
if (Text3 != wmd.Text3) return false;
|
||||
if (Text4 != wmd.Text4) return false;
|
||||
if (Text5 != wmd.Text5) return false;
|
||||
|
||||
if (Compound != wmd.Compound) return false;
|
||||
if (HeatMeter != wmd.HeatMeter) return false;
|
||||
|
||||
#if ORACLE_DB
|
||||
if (WMTypeId != wmd.WMTypeId) return false;
|
||||
#endif
|
||||
@@ -178,17 +204,17 @@ namespace Results.Entities
|
||||
Producer = reader.ReadString();
|
||||
DN = reader.ReadDouble();
|
||||
L = reader.ReadDouble();
|
||||
Mounting = (Config.Entities.Mounting)reader.ReadInt32();
|
||||
Mounting = (Mounting)reader.ReadInt32();
|
||||
NewQnames = reader.ReadBoolean();
|
||||
Q4_Qmax = reader.ReadDouble();
|
||||
Q3_Qn = reader.ReadDouble();
|
||||
Q2_Qt = reader.ReadDouble();
|
||||
Q1_Qmin = reader.ReadDouble();
|
||||
MetrologicalClass = reader.ReadString();
|
||||
TemperatureClass = (Config.Entities.TemperatureClass)reader.ReadInt32();
|
||||
PressureLossClass = (Config.Entities.PressureLossClass)reader.ReadInt32();
|
||||
MaxAdmissiblePressure = (Config.Entities.MaxAdmissiblePressure)reader.ReadInt32();
|
||||
FlowProfileSensitivityClass = (Config.Entities.FlowProfileSensitivityClass)reader.ReadInt32();
|
||||
TemperatureClass = (TemperatureClass)reader.ReadInt32();
|
||||
PressureLossClass = (PressureLossClass)reader.ReadInt32();
|
||||
MaxAdmissiblePressure = (MaxAdmissiblePressure)reader.ReadInt32();
|
||||
FlowProfileSensitivityClass = (FlowProfileSensitivityClass)reader.ReadInt32();
|
||||
ApprovalInfo = reader.ReadString();
|
||||
Certificate = reader.ReadString();
|
||||
PulsesPerLtr = reader.ReadDouble();
|
||||
@@ -196,7 +222,7 @@ namespace Results.Entities
|
||||
Q3_Qn_Aux = reader.ReadDouble();
|
||||
MetrologicalClassAux = reader.ReadString();
|
||||
ApprovalInfoAux = reader.ReadString();
|
||||
Medium = (Config.Entities.Medium)reader.ReadInt32();
|
||||
Medium = (Medium)reader.ReadInt32();
|
||||
Text1 = reader.ReadString();
|
||||
Text2 = reader.ReadString();
|
||||
Text3 = reader.ReadString();
|
||||
|
||||
-1
@@ -153,7 +153,6 @@
|
||||
#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;
|
||||
|
||||
@@ -327,6 +327,11 @@ namespace Results
|
||||
Conduct_min, /// 277
|
||||
Conduct_max, /// 278
|
||||
|
||||
InfoFlags, /// 279
|
||||
Scale, /// 280
|
||||
Diverter, /// 281
|
||||
RegValve, /// 282
|
||||
|
||||
Count,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2015-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using Results.Entities;
|
||||
@@ -18,14 +18,13 @@ namespace Results.Mappings
|
||||
Map(x => x.UserNumber);
|
||||
Map(x => x.ProcedureName);
|
||||
Map(x => x.ProcedureRevision);
|
||||
Map(x => x.ProtocolTitle);
|
||||
Map(x => x.Remark)
|
||||
.CustomType("StringClob")
|
||||
.CustomSqlType("varchar(2000)");
|
||||
Map(x => x.DensityCorr)
|
||||
.Column("Custom1"); ;
|
||||
Map(x => x.Custom2);
|
||||
Map(x => x.Custom3);
|
||||
|
||||
Map(x => x.SampleDensity);
|
||||
Map(x => x.SampleTemp);
|
||||
Map(x => x.Buoyancy);
|
||||
|
||||
Map(x => x.Counter6);
|
||||
Map(x => x.Counter7);
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Results.Mappings
|
||||
Map(x => x.Method);
|
||||
Map(x => x.ErrLimLo);
|
||||
Map(x => x.ErrLimHi);
|
||||
Map(x => x.ErrLimMargin).Column("Uncertainty");
|
||||
Map(x => x.ErrLimMargin);
|
||||
Map(x => x.Publish);
|
||||
Map(x => x.Evaluate);
|
||||
}
|
||||
|
||||
@@ -37,9 +37,10 @@ namespace Results.Mappings
|
||||
Map(x => x.MassEndRaw);
|
||||
Map(x => x.MassEnd);
|
||||
Map(x => x.DensityIn);
|
||||
Map(x => x.DensityLine).Column("DensityOut");
|
||||
Map(x => x.DensityLine);
|
||||
Map(x => x.DensityDiv);
|
||||
Map(x => x.Buoyancy);
|
||||
Map(x => x.MassOfEvapWater)
|
||||
.Column("Buoyancy");
|
||||
Map(x => x.FlowMass);
|
||||
Map(x => x.FlowVolume);
|
||||
Map(x => x.VolumeCTV);
|
||||
@@ -52,27 +53,27 @@ namespace Results.Mappings
|
||||
#if HEAT_METERS
|
||||
Map(x => x.RefEnergy);
|
||||
#endif
|
||||
Map(x => x.AmbTempMean).Column("AmbientTempAve");
|
||||
Map(x => x.AmbTempMean);
|
||||
Map(x => x.AmbTempStart);
|
||||
Map(x => x.AmbTempEnd);
|
||||
Map(x => x.AmbTempMin);
|
||||
Map(x => x.AmbTempMax);
|
||||
Map(x => x.AmbPressMean).Column("AmbientPressAve");
|
||||
Map(x => x.AmbPressMean);
|
||||
Map(x => x.AmbPressStart);
|
||||
Map(x => x.AmbPressEnd);
|
||||
Map(x => x.AmbPressMin);
|
||||
Map(x => x.AmbPressMax);
|
||||
Map(x => x.AmbHumiMean).Column("AmbientHumiAve");
|
||||
Map(x => x.AmbHumiMean);
|
||||
Map(x => x.AmbHumiStart);
|
||||
Map(x => x.AmbHumiEnd);
|
||||
Map(x => x.AmbHumiMin);
|
||||
Map(x => x.AmbHumiMax);
|
||||
Map(x => x.PressUpMean).Column("PressUpAvrg");
|
||||
Map(x => x.PressUpMean);
|
||||
Map(x => x.PressUpStart);
|
||||
Map(x => x.PressUpEnd);
|
||||
Map(x => x.PressUpMin);
|
||||
Map(x => x.PressUpMax);
|
||||
Map(x => x.PressDownMean).Column("PressDownAvrg");
|
||||
Map(x => x.PressDownMean);
|
||||
Map(x => x.PressDownStart);
|
||||
Map(x => x.PressDownEnd);
|
||||
Map(x => x.PressDownMin);
|
||||
@@ -82,17 +83,17 @@ namespace Results.Mappings
|
||||
Map(x => x.PressDeltaEnd);
|
||||
Map(x => x.PressDeltaMin);
|
||||
Map(x => x.PressDeltaMax);
|
||||
Map(x => x.TempUpMean).Column("TempInAvrg");
|
||||
Map(x => x.TempUpStart).Column("TempInStart");
|
||||
Map(x => x.TempUpEnd).Column("TempInEnd");
|
||||
Map(x => x.TempUpMin).Column("TempInMin");
|
||||
Map(x => x.TempUpMax).Column("TempInMax");
|
||||
Map(x => x.TempDownMean).Column("TempOutAvrg");
|
||||
Map(x => x.TempDownStart).Column("TempOutStart");
|
||||
Map(x => x.TempDownEnd).Column("TempOutEnd");
|
||||
Map(x => x.TempDownMin).Column("TempOutMin");
|
||||
Map(x => x.TempDownMax).Column("TempOutMax");
|
||||
Map(x => x.TempDivMean).Column("TempDivAvrg");
|
||||
Map(x => x.TempUpMean);
|
||||
Map(x => x.TempUpStart);
|
||||
Map(x => x.TempUpEnd);
|
||||
Map(x => x.TempUpMin);
|
||||
Map(x => x.TempUpMax);
|
||||
Map(x => x.TempDownMean);
|
||||
Map(x => x.TempDownStart);
|
||||
Map(x => x.TempDownEnd);
|
||||
Map(x => x.TempDownMin);
|
||||
Map(x => x.TempDownMax);
|
||||
Map(x => x.TempDivMean);
|
||||
Map(x => x.TempDivStart);
|
||||
Map(x => x.TempDivEnd);
|
||||
Map(x => x.TempDivMin);
|
||||
|
||||
@@ -43,8 +43,6 @@ namespace Results.Mappings
|
||||
Map(x => x.FWVersion);
|
||||
#endif
|
||||
#if TURA_SPECIAL
|
||||
Map(x => x.AssignedSerialNr);
|
||||
Map(x => x.CompleteSerialNr);
|
||||
Map(x => x.RadioAddress);
|
||||
Map(x => x.PaletteNr);
|
||||
Map(x => x.UmkartonNr);
|
||||
@@ -58,8 +56,13 @@ namespace Results.Mappings
|
||||
Map(x => x.ProdQ2CorrLR);
|
||||
#endif
|
||||
#if ORACLE_DB
|
||||
Map(x => x.AssignedSerialNr);
|
||||
Map(x => x.Prefix);
|
||||
Map(x => x.Suffix);
|
||||
Map(x => x.CompleteSerialNr);
|
||||
Map(x => x.Pruefindex);
|
||||
Map(x => x.HydrPruefung);
|
||||
Map(x => x.WMTypeRevision);
|
||||
#endif
|
||||
References(x => x.WaterMeterData);
|
||||
References(x => x.Batch);
|
||||
|
||||
@@ -1,19 +1,24 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
/// Copyright (c) 2017-2020 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Printing;
|
||||
using System.IO;
|
||||
using Config.Entities;
|
||||
using GenCode128;
|
||||
using Gma.QrCodeNet.Encoding;
|
||||
using Results.Resources;
|
||||
|
||||
namespace Results.Output.Printers.Enhanced
|
||||
{
|
||||
public class EnhancedPrintDocument : PrintDocument
|
||||
{
|
||||
/// Size of the printed area without margins, after taking into account 'pageOrientation'
|
||||
static QrEncoder encoder = new QrEncoder();
|
||||
|
||||
/// Size of the printed area without margins, after taking into account 'pageOrientation'
|
||||
readonly int printHeight;
|
||||
readonly int printWidth;
|
||||
|
||||
@@ -23,12 +28,14 @@ namespace Results.Output.Printers.Enhanced
|
||||
readonly int TitleX;
|
||||
readonly int TitleY; /// Depends on the size of the header
|
||||
|
||||
readonly int SpacingOne;
|
||||
readonly int SpacingOneAndHalf;
|
||||
readonly int SpacingOne4Header;
|
||||
readonly int SpacingOneAndHalf4Header;
|
||||
readonly int spacingOne;
|
||||
readonly int spacingOneAndHalf;
|
||||
readonly int spacingOne4Header;
|
||||
readonly int spacingOneAndHalf4Header;
|
||||
readonly int spacingOne4Footer;
|
||||
|
||||
readonly int SpacingOne4Footer;
|
||||
int spacingAboveTable;
|
||||
int spacingBelowTable;
|
||||
|
||||
int CommonTop; /// = TitleY + 60
|
||||
int BodyTop; /// = HdrTop + 160
|
||||
@@ -124,11 +131,11 @@ namespace Results.Output.Printers.Enhanced
|
||||
}
|
||||
|
||||
/// Document outline preliminary calculations
|
||||
SpacingOne = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", font).Height;
|
||||
SpacingOneAndHalf = (3 * SpacingOne) / 2;
|
||||
SpacingOne4Header = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", headerFont).Height;
|
||||
SpacingOneAndHalf4Header = (3 * SpacingOne4Header) / 2;
|
||||
SpacingOne4Footer = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", footerFont).Height;
|
||||
spacingOne = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", font).Height;
|
||||
spacingOneAndHalf = (3 * spacingOne) / 2;
|
||||
spacingOne4Header = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", headerFont).Height;
|
||||
spacingOneAndHalf4Header = (3 * spacingOne4Header) / 2;
|
||||
spacingOne4Footer = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", footerFont).Height;
|
||||
|
||||
TitleX = cfg.LeftMargin;
|
||||
TitleY = cfg.TopMargin;
|
||||
@@ -178,17 +185,27 @@ namespace Results.Output.Printers.Enhanced
|
||||
/// Prepare document outline
|
||||
///----------
|
||||
titleHeight = System.Windows.Forms.TextRenderer.MeasureText(header, titleFont).Height;
|
||||
CommonTop = TitleY + titleHeight + SpacingOne4Header;
|
||||
CommonTop = TitleY + titleHeight + spacingOne4Header;
|
||||
|
||||
commonHeight = commonItems.Count * SpacingOne;
|
||||
BodyTop = CommonTop + commonHeight + SpacingOne4Header;
|
||||
commonHeight = commonItems.Count * spacingOne;
|
||||
BodyTop = CommonTop + commonHeight + spacingOne4Header;
|
||||
|
||||
Table table0 = Table.Create_TestsAreRows(batch.WaterMeters[0], testItems, style);
|
||||
SizeF tableSize = table0.Measure(e);
|
||||
int wmSectionHeight = (int)tableSize.Height + SpacingOne4Header * ((tableSize.Height > 0) ? 3 : 2);
|
||||
|
||||
nrWMsOnFirstPage = (printHeight - BodyTop + TitleY - 2 * SpacingOne) / wmSectionHeight;
|
||||
nrWMsOnNextPage = (printHeight - 2 * SpacingOne) / wmSectionHeight;
|
||||
if (cfg.BarcodeType == BarcodeType.None)
|
||||
{
|
||||
spacingAboveTable = spacingOneAndHalf4Header;
|
||||
}
|
||||
else
|
||||
{
|
||||
spacingAboveTable = Math.Max(spacingOneAndHalf4Header, cfg.BarcodeHeight + spacingOne4Header / 2);
|
||||
}
|
||||
spacingBelowTable = (tableSize.Height > 0) ? spacingOneAndHalf4Header : (spacingOne4Header / 2);
|
||||
|
||||
int wmSectionHeight = (int)tableSize.Height + spacingAboveTable + spacingBelowTable;
|
||||
nrWMsOnFirstPage = (printHeight - BodyTop + TitleY - 2 * spacingOne) / wmSectionHeight;
|
||||
nrWMsOnNextPage = (printHeight - 2 * spacingOne) / wmSectionHeight;
|
||||
nrWMsOnNextPage = Math.Max(nrWMsOnNextPage, 1); /// Prevent division by zero if there are too many WM tests
|
||||
|
||||
nrPages = 1 + (batch.WaterMeters.Count - nrWMsOnFirstPage + nrWMsOnNextPage - 1) / nrWMsOnNextPage;
|
||||
@@ -221,8 +238,8 @@ namespace Results.Output.Printers.Enhanced
|
||||
/// Write aligned columns
|
||||
for (int i = 0; i < Math.Min(leftColumn.Length, rightColumn.Length); i++)
|
||||
{
|
||||
PrintAt(e, leftMargin, CommonTop + SpacingOne * i, leftColumn[i]);
|
||||
PrintAt(e, 300, CommonTop + SpacingOne * i, rightColumn[i]);
|
||||
PrintAt(e, leftMargin, CommonTop + spacingOne * i, leftColumn[i]);
|
||||
PrintAt(e, 300, CommonTop + spacingOne * i, rightColumn[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,7 +258,7 @@ namespace Results.Output.Printers.Enhanced
|
||||
int wmPosition = true ? batch.WaterMeters[wmNr].WMPosition : (wmNr + 1);
|
||||
if (!cfg.GoodOnly || batch.WaterMeters[wmNr].Passed)
|
||||
{
|
||||
nextWmTop = (int)PrintWM(e, batch.WaterMeters[wmNr], wmPosition, nextWmTop) + SpacingOneAndHalf4Header;
|
||||
nextWmTop = (int)PrintWM(e, batch.WaterMeters[wmNr], wmPosition, nextWmTop) + spacingBelowTable;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,11 +269,11 @@ namespace Results.Output.Printers.Enhanced
|
||||
/// Footer
|
||||
///----------
|
||||
int footerWidth = (int)e.Graphics.MeasureString(footer, footerFont).Width;
|
||||
PrintFooterAt(e, leftMargin + (printWidth - footerWidth) / 2, topMargin + printHeight - 2 * SpacingOne, footer);
|
||||
PrintFooterAt(e, leftMargin + (printWidth - footerWidth) / 2, topMargin + printHeight - 2 * spacingOne, footer);
|
||||
|
||||
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);
|
||||
PrintAt(e, leftMargin + (printWidth - pageNrWidth) / 2, topMargin + printHeight - spacingOne, pageNrText);
|
||||
}
|
||||
|
||||
|
||||
@@ -270,25 +287,48 @@ namespace Results.Output.Printers.Enhanced
|
||||
float PrintWM(System.Drawing.Printing.PrintPageEventArgs e,
|
||||
Results.Entities.WaterMeter wm, int printedWMNr, int top)
|
||||
{
|
||||
int tableTop = top + spacingAboveTable;
|
||||
|
||||
/// Print the water meter number and the serial number
|
||||
string wmText = string.Format("{0} {1}", Strings.Water_Meter, printedWMNr);
|
||||
PrintHeaderAt(e, leftMargin, top, wmText);
|
||||
if (!string.IsNullOrEmpty(wm.SerialNr))
|
||||
if (string.IsNullOrEmpty(wm.SerialNr))
|
||||
{
|
||||
PrintHeaderAt(e, leftMargin + (int)e.Graphics.MeasureString(wmText, headerFont).Width, top,
|
||||
string.Format(" {0} = {1}", Strings.sn, wm.SerialNr));
|
||||
string wmText = string.Format("{0} {1}", Strings.Water_Meter, printedWMNr);
|
||||
int wmTextWidth = (int)e.Graphics.MeasureString(wmText, headerFont).Width;
|
||||
PrintHeaderAt(e, leftMargin, tableTop - spacingOneAndHalf4Header, wmText);
|
||||
}
|
||||
else
|
||||
{
|
||||
string wmText = string.Format("{0} {1} {2} = {3}", Strings.Water_Meter, printedWMNr, Strings.sn, wm.SerialNr);
|
||||
int wmTextWidth = (int)e.Graphics.MeasureString(wmText, headerFont).Width;
|
||||
PrintHeaderAt(e, leftMargin, tableTop - spacingOneAndHalf4Header, wmText);
|
||||
|
||||
switch (cfg.BarcodeType)
|
||||
{
|
||||
case BarcodeType.Code_128_Horizontally:
|
||||
{
|
||||
Image img = Code128Rendering.MakeBarcodeImage(wm.SerialNr, 1, true);
|
||||
e.Graphics.DrawImage(img, leftMargin + wmTextWidth + spacingOne4Header, top, cfg.BarcodeWidth, cfg.BarcodeHeight);
|
||||
break;
|
||||
}
|
||||
case BarcodeType.Code_128_Vertically:
|
||||
{
|
||||
Image img = Code128Rendering.MakeBarcodeImage(wm.SerialNr, 1, true);
|
||||
img.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
e.Graphics.DrawImage(img, leftMargin + wmTextWidth + spacingOne4Header, top, cfg.BarcodeWidth, cfg.BarcodeHeight);
|
||||
break;
|
||||
}
|
||||
case BarcodeType.QR_Code:
|
||||
{
|
||||
QrCode qrCode = encoder.Encode(wm.SerialNr);
|
||||
DrawQR(e.Graphics, qrCode, leftMargin + wmTextWidth + spacingOne4Header, top, cfg.BarcodeWidth, cfg.BarcodeHeight);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Table table = Table.Create_TestsAreRows(wm, testItems, style);
|
||||
|
||||
if (table.IsEmpty())
|
||||
{
|
||||
return top;
|
||||
}
|
||||
else
|
||||
{
|
||||
return table.Draw(e, leftMargin, top + SpacingOneAndHalf4Header);
|
||||
}
|
||||
return table.IsEmpty() ? tableTop : table.Draw(e, leftMargin, tableTop);
|
||||
}
|
||||
|
||||
|
||||
@@ -298,7 +338,7 @@ namespace Results.Output.Printers.Enhanced
|
||||
}
|
||||
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
|
||||
{
|
||||
RectangleF printArea = new RectangleF(x, y, 2000, SpacingOne);
|
||||
RectangleF printArea = new RectangleF(x, y, 2000, spacingOne);
|
||||
e.Graphics.DrawString(text, this.font, Brushes.Black, printArea);
|
||||
}
|
||||
|
||||
@@ -309,7 +349,7 @@ namespace Results.Output.Printers.Enhanced
|
||||
}
|
||||
void PrintHeaderAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
|
||||
{
|
||||
RectangleF printArea = new RectangleF(x, y, 2000, SpacingOne4Header);
|
||||
RectangleF printArea = new RectangleF(x, y, 2000, spacingOne4Header);
|
||||
e.Graphics.DrawString(text, this.headerFont, Brushes.Black, printArea);
|
||||
}
|
||||
|
||||
@@ -320,8 +360,33 @@ namespace Results.Output.Printers.Enhanced
|
||||
}
|
||||
void PrintFooterAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
|
||||
{
|
||||
RectangleF printArea = new RectangleF(x, y, 2000, SpacingOne4Footer);
|
||||
RectangleF printArea = new RectangleF(x, y, 2000, spacingOne4Footer);
|
||||
e.Graphics.DrawString(text, this.footerFont, Brushes.Black, printArea);
|
||||
}
|
||||
|
||||
|
||||
public static void DrawQR(Graphics g, QrCode qrCode, float left, float top, float width, float height)
|
||||
{
|
||||
/// Assuming 100 dpi (printer)
|
||||
g.SmoothingMode = SmoothingMode.AntiAlias;
|
||||
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
|
||||
|
||||
float qrPixWidth = width / qrCode.Matrix.Width;
|
||||
float qrPixHeight = height / qrCode.Matrix.Height;
|
||||
for (int i = 0; i < qrCode.Matrix.Height; i++)
|
||||
{
|
||||
for (int j = 0; j < qrCode.Matrix.Width; j++)
|
||||
{
|
||||
if (qrCode.Matrix[j, i])
|
||||
{
|
||||
g.FillRectangle(Brushes.Black, new RectangleF(left + j * qrPixWidth,
|
||||
top + i * qrPixHeight,
|
||||
qrPixWidth,
|
||||
qrPixHeight));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
|
||||
///
|
||||
|
||||
namespace Results.Output.Printers.Enhanced
|
||||
@@ -30,5 +30,8 @@ namespace Results.Output.Printers.Enhanced
|
||||
public string[] CommonItems;
|
||||
public string[] TestItems;
|
||||
public string Footer;
|
||||
}
|
||||
public BarcodeType BarcodeType; /// s/n is printed as barcode when valid (BarcodeType.None < BarcodeType < BarcodeType.Count)
|
||||
public int BarcodeWidth;
|
||||
public int BarcodeHeight;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,630 +0,0 @@
|
||||
///
|
||||
/// 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
|
||||
{
|
||||
public class MunichPrintDocument : PrintDocument
|
||||
{
|
||||
const string FontFamilyName = "Arial"; ///"Times New Roman";
|
||||
|
||||
const int SpacingOne = 18;
|
||||
const int SpacingOneAndHalf = 24; /// was 27 before
|
||||
const int TitleX = 240;
|
||||
const int TitleY = 180; /// Depends on the size of the header
|
||||
const int FirstLineNr = 14; /// Depends on the size of the header
|
||||
const int Tab1 = 80; /// Positions of columns above the table
|
||||
const int Tab2 = 240;
|
||||
const int Tab3 = 430;
|
||||
const int Tab4 = 590;
|
||||
const int BorderW = 1; /// Table border line width
|
||||
const int MarginTop = 7; /// Margins of the text from table lines
|
||||
const int MarginLeft = 4; /// Margins of the text from table lines
|
||||
|
||||
///
|
||||
/// Data to print
|
||||
///
|
||||
readonly string docVersion;
|
||||
readonly Results.Entities.WaterMeter wm;
|
||||
string zaehlertyp;
|
||||
string pruefvorlage;
|
||||
|
||||
readonly IList<Results.Entities.MeterTestRslt> results;
|
||||
readonly int resultsCount;
|
||||
readonly bool compound; /// true when MetersKind is MetersKind.Combined
|
||||
|
||||
|
||||
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
|
||||
/// </summary>
|
||||
Font font;
|
||||
Font boldFont;
|
||||
Font fontTitle;
|
||||
|
||||
///
|
||||
/// 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>
|
||||
public MunichPrintDocument(string docVersion,
|
||||
Results.Entities.WaterMeter wm,
|
||||
PageOrientation pageOrientation)
|
||||
{
|
||||
this.docVersion = docVersion;
|
||||
this.wm = wm;
|
||||
this.compound = wm.Compound();
|
||||
this.pageOrientation = pageOrientation;
|
||||
|
||||
string[] info = wm.ProductName().Split(new char[] { ';' });
|
||||
if (info.Length >= 2)
|
||||
{
|
||||
pruefvorlage = info[0];
|
||||
zaehlertyp = info[1];
|
||||
}
|
||||
else if (info.Length == 1)
|
||||
{
|
||||
pruefvorlage = info[0];
|
||||
zaehlertyp = compound ? "Verbundzähler" : "Einzelzähler";
|
||||
}
|
||||
else
|
||||
{
|
||||
pruefvorlage = wm.ProcedureName();
|
||||
zaehlertyp = compound ? "Verbundzähler" : "Einzelzähler";
|
||||
}
|
||||
|
||||
results = wm.RegularMeterTestRslts();
|
||||
|
||||
resultsCount = 0;
|
||||
foreach (var mtr in wm.RegularMeterTestRslts())
|
||||
{
|
||||
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always) resultsCount++;
|
||||
}
|
||||
|
||||
pageNr = 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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Override the default onbeginPrint method of the PrintDocument Object.
|
||||
/// </summary>
|
||||
/// <param name=e></param>
|
||||
/// <remarks></remarks>
|
||||
protected override void OnBeginPrint(System.Drawing.Printing.PrintEventArgs e)
|
||||
{
|
||||
base.OnBeginPrint(e);
|
||||
|
||||
if (font == null) { font = new Font(FontFamilyName, 10, FontStyle.Regular); }
|
||||
if (boldFont == null) { boldFont = new Font(FontFamilyName, 10, FontStyle.Bold); }
|
||||
if (fontTitle == null) { fontTitle = new Font(FontFamilyName, 24, FontStyle.Bold); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Override the default OnPrintPage method of the PrintDocument.
|
||||
/// </summary>
|
||||
/// <param name=e></param>
|
||||
/// <remarks>This provides the print logic for our document</remarks>
|
||||
protected override void OnPrintPage(System.Drawing.Printing.PrintPageEventArgs e)
|
||||
{
|
||||
/// Run base code
|
||||
base.OnPrintPage(e);
|
||||
|
||||
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;
|
||||
int printWidth = base.DefaultPageSettings.PaperSize.Width - base.DefaultPageSettings.Margins.Left - base.DefaultPageSettings.Margins.Right;
|
||||
int leftMargin = base.DefaultPageSettings.Margins.Left; /// X
|
||||
int topMargin = base.DefaultPageSettings.Margins.Top; /// Y
|
||||
|
||||
/// Check if the user selected to print in Landscape mode
|
||||
/// if they did then we need to swap height/width parameters
|
||||
if (base.DefaultPageSettings.Landscape)
|
||||
{
|
||||
int tmp = printHeight;
|
||||
printHeight = printWidth;
|
||||
printWidth = tmp;
|
||||
}
|
||||
|
||||
int x = leftMargin;
|
||||
int y = topMargin;
|
||||
|
||||
/// Use the StringFormat class for the text layout of our document
|
||||
StringFormat format = new StringFormat(StringFormatFlags.LineLimit);
|
||||
|
||||
int lineNr = FirstLineNr;
|
||||
|
||||
if (pageNr == 1)
|
||||
{
|
||||
/// 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);
|
||||
|
||||
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)
|
||||
{
|
||||
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Hauptzahler");
|
||||
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Nebenzahler");
|
||||
lineNr++;
|
||||
}
|
||||
|
||||
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 += ((resultsCount + 2) * SpacingOneAndHalf) / SpacingOne + 2;
|
||||
|
||||
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 (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;
|
||||
}
|
||||
|
||||
if (pageNr == nrPages)
|
||||
{
|
||||
int top = topMargin + printHeight - 8 * SpacingOne;
|
||||
DrawCommonBottom(e, top, wm);
|
||||
}
|
||||
else
|
||||
{
|
||||
e.HasMorePages = true;
|
||||
}
|
||||
|
||||
///
|
||||
/// 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>
|
||||
/// Prepares content and style of the first 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 PrepareTableOne(int from = 0, int to = int.MaxValue)
|
||||
{
|
||||
Table table = new Table(7);
|
||||
table.Style = tableStyle;
|
||||
|
||||
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.RegularMeterTestRslts())
|
||||
{
|
||||
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;
|
||||
|
||||
if (compound)
|
||||
{
|
||||
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
|
||||
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/// <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)
|
||||
{
|
||||
Table table = new Table(7);
|
||||
table.Style = tableStyle;
|
||||
|
||||
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.RegularMeterTestRslts())
|
||||
{
|
||||
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;
|
||||
|
||||
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>
|
||||
/// 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;
|
||||
|
||||
if (compound)
|
||||
{
|
||||
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Hauptzahler");
|
||||
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Nebenzahler");
|
||||
lineNr++;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
PrintAt(e, p.X, p.Y, text);
|
||||
}
|
||||
|
||||
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
|
||||
{
|
||||
RectangleF printArea = new RectangleF(x, y, 667, SpacingOne);
|
||||
e.Graphics.DrawString(text, this.font, Brushes.Black, printArea);
|
||||
}
|
||||
|
||||
void PrintBoldAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text)
|
||||
{
|
||||
PrintBoldAt(e, p.X, p.Y, text);
|
||||
}
|
||||
|
||||
void PrintBoldAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
|
||||
{
|
||||
RectangleF printArea = new RectangleF(x, y, 667, SpacingOne);
|
||||
e.Graphics.DrawString(text, this.boldFont, Brushes.Black, printArea);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,15 @@
|
||||
///
|
||||
/// Copyright (c) 2017-2018 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Printing;
|
||||
using System.IO;
|
||||
using Config.Entities;
|
||||
using GenCode128;
|
||||
using Gma.QrCodeNet.Encoding;
|
||||
using Results.Resources;
|
||||
|
||||
namespace Results.Output.Printers.OnePerMeter
|
||||
@@ -16,7 +19,9 @@ namespace Results.Output.Printers.OnePerMeter
|
||||
const float GapBetweenTableColumns = 10;
|
||||
const float GapBetweenCommonColumns = 10;
|
||||
|
||||
/// Size of the printed area without margins, after taking into account 'pageOrientation'
|
||||
static QrEncoder encoder = new QrEncoder();
|
||||
|
||||
/// Size of the printed area without margins, after taking into account 'pageOrientation'
|
||||
readonly int printHeight;
|
||||
readonly int printWidth;
|
||||
|
||||
@@ -158,6 +163,30 @@ namespace Results.Output.Printers.OnePerMeter
|
||||
WMChart.GetChart(wm, true).Printing.PrintPaint(e.Graphics, pos);
|
||||
}
|
||||
|
||||
if (cfg.BarcodeType != BarcodeType.None && cfg.BarcodeType < BarcodeType.Count && !string.IsNullOrEmpty(wm.SerialNr))
|
||||
{
|
||||
try
|
||||
{
|
||||
if (cfg.BarcodeType == BarcodeType.QR_Code)
|
||||
{
|
||||
QrCode qrCode = encoder.Encode(wm.SerialNr);
|
||||
DrawQR(e.Graphics, qrCode, cfg.BarcodeLeft, cfg.BarcodeTop, cfg.BarcodeWidth, cfg.BarcodeHeight);
|
||||
}
|
||||
else if (cfg.BarcodeType == BarcodeType.Code_128_Horizontally || cfg.BarcodeType == BarcodeType.Code_128_Vertically)
|
||||
{
|
||||
Image img = Code128Rendering.MakeBarcodeImage(wm.SerialNr, 1, true);
|
||||
if (cfg.BarcodeType == BarcodeType.Code_128_Vertically)
|
||||
{
|
||||
img.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
}
|
||||
e.Graphics.DrawImage(img, cfg.BarcodeLeft, cfg.BarcodeTop, cfg.BarcodeWidth, cfg.BarcodeHeight);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
float tableTop = cfg.TopMargin;
|
||||
|
||||
if (pageNr == 1)
|
||||
@@ -351,5 +380,30 @@ namespace Results.Output.Printers.OnePerMeter
|
||||
|
||||
pageNr++;
|
||||
}
|
||||
|
||||
|
||||
public static void DrawQR(Graphics g, QrCode qrCode, float left, float top, float width, float height)
|
||||
{
|
||||
/// Assuming 100 dpi (printer)
|
||||
g.SmoothingMode = SmoothingMode.AntiAlias;
|
||||
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
|
||||
|
||||
float qrPixWidth = width / qrCode.Matrix.Width;
|
||||
float qrPixHeight = height / qrCode.Matrix.Height;
|
||||
for (int i = 0; i < qrCode.Matrix.Height; i++)
|
||||
{
|
||||
for (int j = 0; j < qrCode.Matrix.Width; j++)
|
||||
{
|
||||
if (qrCode.Matrix[j, i])
|
||||
{
|
||||
g.FillRectangle(Brushes.Black, new RectangleF(left + j * qrPixWidth,
|
||||
top + i * qrPixHeight,
|
||||
qrPixWidth,
|
||||
qrPixHeight));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2017-2019 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
|
||||
///
|
||||
|
||||
namespace Results.Output.Printers.OnePerMeter
|
||||
@@ -54,5 +54,10 @@ namespace Results.Output.Printers.OnePerMeter
|
||||
public int ImgWid;
|
||||
public int ImgHgh;
|
||||
public string ImgFullPathName;
|
||||
public BarcodeType BarcodeType; /// s/n is printed as barcode when valid (BarcodeType.None < BarcodeType < BarcodeType.Count)
|
||||
public int BarcodeLeft;
|
||||
public int BarcodeTop;
|
||||
public int BarcodeWidth;
|
||||
public int BarcodeHeight;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,20 +9,24 @@ namespace Results.Output
|
||||
{
|
||||
public enum LogType
|
||||
{
|
||||
Just_Q3Q2Q1, /// pNrs = 3,2,1
|
||||
Just_Q3Q2Q1_Alt, /// pNrs = 5,2,1
|
||||
Just_Q3Q2adjQ1, /// pNrs = 3,2,1
|
||||
Just_Q3Q2adjQ1_Alt, /// pNrs = 5,2,1
|
||||
DEWA, /// Q4, Q3, Q2adj, Q2, Q1
|
||||
DEWA_wo_Q2, /// Q4, Q3, Q2adj, Q1
|
||||
Suez, /// Two directions, with Q2 and Q2ac
|
||||
Suez_smart, /// There is only Q2ac in both directions
|
||||
Suez_Repeatability, /// 3xQ3, 3xQ2, 3xQ1
|
||||
Suez_EMP_DN15, /// EMP: 12 flow rates
|
||||
Suez_EMP_DN20, /// EMP: 12 flow rates
|
||||
Suez_EMP_DN32, /// EMP: 12 flow rates
|
||||
Suez_EMP_DN40, /// EMP: 12 flow rates
|
||||
Greece, /// Q3, Q2adj, Q2, Q1
|
||||
Just_Q3Q2Q1, /// pNrs = -1,3,2,1
|
||||
Just_Q3Q2Q1_Alt, /// pNrs = -1,5,2,1
|
||||
Just_Q3Q2adjQ1, /// pNrs = -1,3,2,1
|
||||
Just_Q3Q2adjQ1_Alt, /// pNrs = -1,5,2,1
|
||||
JustA0A4_Q3Q2adjQ1, /// pNrs = -2,-1,3,2,1 (Australia 169 MHz, raw data pNrs: -2,-1,4,3,2,1)
|
||||
DEWA, /// Q4, Q3, Q2adj, Q2, Q1
|
||||
DEWA_wo_Q2, /// Q4, Q3, Q2adj, Q1
|
||||
Suez, /// Two directions, with Q2 and Q2ac
|
||||
Suez_smart, /// There is only Q2ac in both directions
|
||||
Suez_Repeatability, /// 3xQ3, 3xQ2, 3xQ1
|
||||
Suez_EMP_DN15, /// EMP: 12 flow rates
|
||||
Suez_EMP_DN20, /// EMP: 12 flow rates
|
||||
Suez_EMP_DN32, /// EMP: 12 flow rates
|
||||
Suez_EMP_DN40, /// EMP: 12 flow rates
|
||||
Greece, /// Q3, Q2adj, Q2, Q1
|
||||
S620, /// Q3, Q100, Q2, Q1
|
||||
S620_Alt, /// Q3, Q100, Q2, Q1
|
||||
S620_Kiwa,
|
||||
Count,
|
||||
None,
|
||||
}
|
||||
@@ -263,6 +267,18 @@ namespace Results.Output
|
||||
new SensusTestInfo("Q1", 1, "Q1", 1, "01", 1, "Q1", Range.R100_110),
|
||||
};
|
||||
|
||||
case LogType.JustA0A4_Q3Q2adjQ1: /// Australia 169 MHz
|
||||
return new SensusTestInfo[]
|
||||
{
|
||||
/// TBF Oracle DB Opto RAW LU logfiles
|
||||
new SensusTestInfo("Q2adj", 0, "", 3, "03", 3,"Q2adj", Range.R100_110),
|
||||
new SensusTestInfo("Qjust_A0", -1, "Just", -1, "-1", -1, "Q-1", Range.R95_105),
|
||||
new SensusTestInfo("Qjust_A4", -2, "Just", -2, "-2", -2, "Q-2", Range.R95_105),
|
||||
new SensusTestInfo("Q3", 3, "Q3", 4, "04", 4, "Q3", Range.R90_100),
|
||||
new SensusTestInfo("Q2", 2, "Q2", 2, "02", 2, "Q2", Range.R100_110),
|
||||
new SensusTestInfo("Q1", 1, "Q1", 1, "01", 1, "Q1", Range.R100_110),
|
||||
};
|
||||
|
||||
case LogType.DEWA: /// DEWA (with Q4 and Q2 after correction)
|
||||
return new SensusTestInfo[]
|
||||
{
|
||||
@@ -414,6 +430,33 @@ namespace Results.Output
|
||||
new SensusTestInfo("Q2", 2, "Q2", 2, "02", 2, "Q2", Range.R100_110),
|
||||
new SensusTestInfo("Q1", 1, "Q1", 1, "01", 1, "Q1", Range.R100_110),
|
||||
};
|
||||
|
||||
case LogType.S620:
|
||||
return new SensusTestInfo[]
|
||||
{
|
||||
/// TBF Oracle DB Opto RAW LU logfiles
|
||||
new SensusTestInfo("Q3", 3, "Q3", 3, "04", 3, "Q3", Range.R90_100),
|
||||
new SensusTestInfo("Q2", 2, "Q2", 2, "02", 2, "Q2", Range.R100_110),
|
||||
new SensusTestInfo("Q1", 1, "Q1", 1, "01", 1, "Q1", Range.R100_110),
|
||||
};
|
||||
|
||||
case LogType.S620_Alt:
|
||||
return new SensusTestInfo[]
|
||||
{
|
||||
/// TBF Oracle DB Opto RAW LU logfiles
|
||||
new SensusTestInfo("Q3", 5, "Q3", 5, "04", 5, "Q3", Range.R90_100),
|
||||
new SensusTestInfo("Q2", 2, "Q2", 2, "02", 2, "Q2", Range.R100_110),
|
||||
new SensusTestInfo("Q1", 1, "Q1", 1, "01", 1, "Q1", Range.R100_110),
|
||||
};
|
||||
|
||||
case LogType.S620_Kiwa:
|
||||
return new SensusTestInfo[]
|
||||
{
|
||||
/// TBF Oracle DB Opto RAW LU logfiles
|
||||
new SensusTestInfo("Q4", 5, "Q4", 5, "04", 5, "Q4", Range.R90_100),
|
||||
new SensusTestInfo("Q2", 2, "Q2", 2, "02", 2, "Q2", Range.R100_110),
|
||||
new SensusTestInfo("Q1", 1, "Q1", 1, "01", 1, "Q1", Range.R100_110),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,7 +515,7 @@ namespace Results.Output
|
||||
///
|
||||
static bool TestShouldBeIncluded(Config.Entities.Test test)
|
||||
{
|
||||
return test.DoEvaluate && !test.Method.ToLower().Contains("iperlcommunication");
|
||||
return test.DoEvaluate && test.IsRegular() && !test.Method.ToLower().Contains("iperlcommunication");
|
||||
}
|
||||
///
|
||||
public static SensusTestInfo CreateFromTest(Config.Entities.Test test, int repetitionNr, int luID, string fullTestNameWoPart)
|
||||
@@ -501,7 +544,7 @@ namespace Results.Output
|
||||
QBezeichnungLog = fullTestNameWoPart, /// Flow name in Oracle database
|
||||
Range = range,
|
||||
Flow = (range == Range.R100_110) ? test.Qfrom : (range == Range.R90_100) ? test.Qto : (test.Qfrom + test.Qto) / 2,
|
||||
TestTime = (int)Math.Round(test.TstTime),
|
||||
TestTime = (int)Math.Round(test.TestTime),
|
||||
ErrLimLoFromDB = test.ErrLimLo,
|
||||
ErrLimHiFromDB = test.ErrLimHi,
|
||||
Uncertainty = test.Uncertainty,
|
||||
|
||||
@@ -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.26.1458.0")]
|
||||
[assembly: AssemblyFileVersion("2.26.1458.0")]
|
||||
[assembly: AssemblyVersion("3.1.1464.0")]
|
||||
[assembly: AssemblyFileVersion("3.1.1464.0")]
|
||||
|
||||
Generated
+9
@@ -510,6 +510,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Info flags.
|
||||
/// </summary>
|
||||
internal static string Info_flags {
|
||||
get {
|
||||
return ResourceManager.GetString("Info_flags", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Invalid Q2 correction factors.
|
||||
/// </summary>
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
<value>Ergebnisse</value>
|
||||
</data>
|
||||
<data name="Batch_nr" xml:space="preserve">
|
||||
<value>Stapel Nr.</value>
|
||||
<value>Los Nr.</value>
|
||||
</data>
|
||||
<data name="Bench" xml:space="preserve">
|
||||
<value>Prüfstand</value>
|
||||
@@ -154,13 +154,13 @@
|
||||
<value>Endzeit</value>
|
||||
</data>
|
||||
<data name="EndState_aux" xml:space="preserve">
|
||||
<value>Eindstand Nebenz.</value>
|
||||
<value>Endstand Nebenzähler</value>
|
||||
</data>
|
||||
<data name="EndState_main" xml:space="preserve">
|
||||
<value>Eindstand Hauptz.</value>
|
||||
<value>Endstand Hauptzähler</value>
|
||||
</data>
|
||||
<data name="End_state" xml:space="preserve">
|
||||
<value>Eindstand</value>
|
||||
<value>Endstand</value>
|
||||
</data>
|
||||
<data name="ErrLimHi" xml:space="preserve">
|
||||
<value>Fehlergrenze hoch</value>
|
||||
@@ -175,10 +175,10 @@
|
||||
<value>Referenzfehler</value>
|
||||
</data>
|
||||
<data name="Err_aux" xml:space="preserve">
|
||||
<value>Fehler Nebenz.</value>
|
||||
<value>Fehler Nebenzähler</value>
|
||||
</data>
|
||||
<data name="Err_main" xml:space="preserve">
|
||||
<value>Fehler Hauptz.</value>
|
||||
<value>Fehler Hauptzähler</value>
|
||||
</data>
|
||||
<data name="Flow" xml:space="preserve">
|
||||
<value>Durchfluss</value>
|
||||
@@ -187,13 +187,13 @@
|
||||
<value>Format</value>
|
||||
</data>
|
||||
<data name="H_amb" xml:space="preserve">
|
||||
<value>H umgebung</value>
|
||||
<value>Luftfeuchte Umgebung</value>
|
||||
</data>
|
||||
<data name="Item" xml:space="preserve">
|
||||
<value>Posten</value>
|
||||
<value>Objekt</value>
|
||||
</data>
|
||||
<data name="MClass" xml:space="preserve">
|
||||
<value>Metr. Klasse</value>
|
||||
<value>Metrologische Klasse</value>
|
||||
</data>
|
||||
<data name="OkBtnText" xml:space="preserve">
|
||||
<value>OK</value>
|
||||
@@ -220,34 +220,34 @@
|
||||
<value>Impulse/l</value>
|
||||
</data>
|
||||
<data name="P_amb" xml:space="preserve">
|
||||
<value>Dr umgebung</value>
|
||||
<value>Druck amb. (Umgebungsdruck)</value>
|
||||
</data>
|
||||
<data name="P_dn_end" xml:space="preserve">
|
||||
<value>Dr aus ende</value>
|
||||
<value>Druck Eingang Prüfungsende</value>
|
||||
</data>
|
||||
<data name="P_dn" xml:space="preserve">
|
||||
<value>Dr aus</value>
|
||||
<value>Druck Eingang</value>
|
||||
</data>
|
||||
<data name="P_dn_start" xml:space="preserve">
|
||||
<value>Dr aus start</value>
|
||||
<value>Druck Eingang Prüfungsbeginn</value>
|
||||
</data>
|
||||
<data name="P_up_end" xml:space="preserve">
|
||||
<value>Dr ein ende</value>
|
||||
<value>Druck Ausgang Prüfungsende</value>
|
||||
</data>
|
||||
<data name="P_up" xml:space="preserve">
|
||||
<value>Dr ein</value>
|
||||
<value>Druck Ausgang</value>
|
||||
</data>
|
||||
<data name="P_up_start" xml:space="preserve">
|
||||
<value>Dr ein start</value>
|
||||
<value>Druck Ausgang Prüfungsanfang</value>
|
||||
</data>
|
||||
<data name="Q_fall" xml:space="preserve">
|
||||
<value>Q fall</value>
|
||||
<value>Q Fall </value>
|
||||
</data>
|
||||
<data name="Q_from" xml:space="preserve">
|
||||
<value>Q von</value>
|
||||
</data>
|
||||
<data name="Q_rise" xml:space="preserve">
|
||||
<value>Q steig</value>
|
||||
<value>Q Steig</value>
|
||||
</data>
|
||||
<data name="Q_to" xml:space="preserve">
|
||||
<value>Q bis</value>
|
||||
@@ -292,13 +292,13 @@
|
||||
<value>Prüfvolumen</value>
|
||||
</data>
|
||||
<data name="T_amb" xml:space="preserve">
|
||||
<value>T umgebung</value>
|
||||
<value>T Umgebung</value>
|
||||
</data>
|
||||
<data name="T_div" xml:space="preserve">
|
||||
<value>T div</value>
|
||||
<value>T Umschaltung</value>
|
||||
</data>
|
||||
<data name="T_end" xml:space="preserve">
|
||||
<value>Endzeit</value>
|
||||
<value>T Ende</value>
|
||||
</data>
|
||||
<data name="T_in" xml:space="preserve">
|
||||
<value>T ein</value>
|
||||
@@ -364,13 +364,13 @@
|
||||
<value>Hersteller</value>
|
||||
</data>
|
||||
<data name="Meter_type" xml:space="preserve">
|
||||
<value>Typ</value>
|
||||
<value>WZ-Typ</value>
|
||||
</data>
|
||||
<data name="Compound" xml:space="preserve">
|
||||
<value>Verbund</value>
|
||||
<value>Verbundzähler</value>
|
||||
</data>
|
||||
<data name="Heat_meter" xml:space="preserve">
|
||||
<value />
|
||||
<value>Wärmezähler</value>
|
||||
</data>
|
||||
<data name="Single" xml:space="preserve">
|
||||
<value>Einzel</value>
|
||||
@@ -382,16 +382,16 @@
|
||||
<value>Größe</value>
|
||||
</data>
|
||||
<data name="Page" xml:space="preserve">
|
||||
<value>Blz.</value>
|
||||
<value>Seite</value>
|
||||
</data>
|
||||
<data name="Water_Meter" xml:space="preserve">
|
||||
<value>Wasserzähler</value>
|
||||
</data>
|
||||
<data name="aux" xml:space="preserve">
|
||||
<value>Nebenz.</value>
|
||||
<value>Nebenzähler</value>
|
||||
</data>
|
||||
<data name="main" xml:space="preserve">
|
||||
<value>Hauptz.</value>
|
||||
<value>Hauptzähler</value>
|
||||
</data>
|
||||
<data name="fall" xml:space="preserve">
|
||||
<value>fall</value>
|
||||
@@ -409,6 +409,420 @@
|
||||
<value>Masse</value>
|
||||
</data>
|
||||
<data name="Density_correction" xml:space="preserve">
|
||||
<value>Dichtekorektur</value>
|
||||
<value>Dichtekorrektur</value>
|
||||
</data>
|
||||
<data name="Energy" xml:space="preserve">
|
||||
<value>Energie</value>
|
||||
</data>
|
||||
<data name="Energy_ref" xml:space="preserve">
|
||||
<value>Energie ref.</value>
|
||||
</data>
|
||||
<data name="P_delta" xml:space="preserve">
|
||||
<value>Druckdifferenz </value>
|
||||
</data>
|
||||
<data name="P_delta_end" xml:space="preserve">
|
||||
<value>Druckdifferenz Ende Prüfung</value>
|
||||
</data>
|
||||
<data name="P_delta_mean" xml:space="preserve">
|
||||
<value>Druckdifferenz Delta Prüfung </value>
|
||||
</data>
|
||||
<data name="P_delta_start" xml:space="preserve">
|
||||
<value>Druckdifferenz Beginn Prüfung</value>
|
||||
</data>
|
||||
<data name="End_volume" xml:space="preserve">
|
||||
<value>Ende Volumen</value>
|
||||
</data>
|
||||
<data name="Start_volume" xml:space="preserve">
|
||||
<value>Start Volumen</value>
|
||||
</data>
|
||||
<data name="End_volume_aux" xml:space="preserve">
|
||||
<value>Ende Volumen Nebenzähler</value>
|
||||
</data>
|
||||
<data name="End_volume_main" xml:space="preserve">
|
||||
<value>Ende Volumen Hauptzähler</value>
|
||||
</data>
|
||||
<data name="Start_volume_aux" xml:space="preserve">
|
||||
<value>Start Volumen Nebenzähler</value>
|
||||
</data>
|
||||
<data name="Start_volume_main" xml:space="preserve">
|
||||
<value>Start Volumen Hauptzähler</value>
|
||||
</data>
|
||||
<data name="Volume_aux" xml:space="preserve">
|
||||
<value>Volumen Nebenzähler</value>
|
||||
</data>
|
||||
<data name="Volume_main" xml:space="preserve">
|
||||
<value>Volumen Hauptzähler</value>
|
||||
</data>
|
||||
<data name="End_mass" xml:space="preserve">
|
||||
<value>End Prüfung</value>
|
||||
</data>
|
||||
<data name="Start_mass" xml:space="preserve">
|
||||
<value>Start Prüfung</value>
|
||||
</data>
|
||||
<data name="VName_Flow" xml:space="preserve">
|
||||
<value>Q</value>
|
||||
</data>
|
||||
<data name="VName_Press" xml:space="preserve">
|
||||
<value>Druck</value>
|
||||
</data>
|
||||
<data name="VName_Temp" xml:space="preserve">
|
||||
<value>Temperatur</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_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>Druckdifferenz gemessen von Druckgeber aktuell</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_de_avg" xml:space="preserve">
|
||||
<value>Druckdifferenz gemessen von Druckgeber Mittelwert</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_de_en" xml:space="preserve">
|
||||
<value>Druckdifferenz gemessen von Druckgeber am Prüfungsende</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_de_me" xml:space="preserve">
|
||||
<value>Druckdifferenz gemessen von Druckgeber-Durchschnitt </value>
|
||||
</data>
|
||||
<data name="Tooltip_P_de_st" xml:space="preserve">
|
||||
<value>Druckdifferenz gemessen von Druckgeber am Prüfungsbeginn</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_dw_ac" xml:space="preserve">
|
||||
<value>Druck am Prüfstreckenausgang aktuell</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_dw_avg" xml:space="preserve">
|
||||
<value>Druck Mittelwert am Prüfstreckenausgang</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_dw_en" xml:space="preserve">
|
||||
<value>Druck am Prüfstreckenausgang am Ende der Prüfung</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_dw_me" xml:space="preserve">
|
||||
<value>Druck Durchnschnitt am Prüfstreckenausgang</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_dw_st" xml:space="preserve">
|
||||
<value>Hauptdruck am Ausgang bei Prüfbeginn</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_up_ac" xml:space="preserve">
|
||||
<value>Hauptdruck am Eingang aktuell</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_up_avg" xml:space="preserve">
|
||||
<value>Druck Mittelwert am Prüfstreckeneingang</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_up_en" xml:space="preserve">
|
||||
<value>Druck am Prüfstreckeneingang am Ende der Prüfung</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_up_me" xml:space="preserve">
|
||||
<value>Druck Durchnschnitt am Prüfstreckeneingang</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_up_st" xml:space="preserve">
|
||||
<value>Druck am Prüfstreckeneingang bei Prüfbeginn</value>
|
||||
</data>
|
||||
<data name="Tooltip_Q_m_r" xml:space="preserve">
|
||||
<value>Durchfluss berechnet von Masse der Waage und Zeit </value>
|
||||
</data>
|
||||
<data name="Tooltip_Q_riac" xml:space="preserve">
|
||||
<value>Durchfluss angezeigt von NHO/ aktuell</value>
|
||||
</data>
|
||||
<data name="Tooltip_Q_rim" xml:space="preserve">
|
||||
<value>Durchfluss von aktuellem NHO/ Durchnschnitt</value>
|
||||
</data>
|
||||
<data name="Tooltip_Q_v_r" xml:space="preserve">
|
||||
<value>Durchfluss von aktuellem Refferenzzähler</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_di_ac" xml:space="preserve">
|
||||
<value>Temperatur aktuell an der Umschaltung</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_di_avg" xml:space="preserve">
|
||||
<value>Temperatur-Mittelwert an der Umschaltung</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_di_en" xml:space="preserve">
|
||||
<value>Temperatur Umschaltung am Prüfungsende (4 letzten Messungen)</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_di_me" xml:space="preserve">
|
||||
<value>Temperatur-Durchschnitt an der Umschaltung</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_di_st" xml:space="preserve">
|
||||
<value>Temperatur Umschaltung am Prüfungsanfang (4 ersten Messungen)</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_dw_ac" xml:space="preserve">
|
||||
<value>Temperatur aktuell am Prüfstreckenausgang</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_dw_avg" xml:space="preserve">
|
||||
<value>Temperatur-Mittelwert am Prüstreckenausgang</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_dw_en" xml:space="preserve">
|
||||
<value>Temperatur Prüfstreckenausgang am Prüfungsende ( 4 letzten Messungen)</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_dw_me" xml:space="preserve">
|
||||
<value>Temperatur-Durchschnitt am Prüstreckenausgang</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_dw_st" xml:space="preserve">
|
||||
<value>Temperatur Prüfstreckenausgang am Prüfungsanfang( 4 ersten Messungen)</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_up_ac" xml:space="preserve">
|
||||
<value>Temperatur aktuell am Prüfstreckeneingang</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_up_avg" xml:space="preserve">
|
||||
<value>Temperatur-Mittelwert am Prüstreckeneingang während der Prüfung</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_up_en" xml:space="preserve">
|
||||
<value>Temperatur Prüfstreckeneingang und -Ausgang am Prüfungsanfang( 4 Messungen bevor Ende)</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_up_me" xml:space="preserve">
|
||||
<value>Temperatur-Durchschnitt am Prüfstreckeneingang wärend der Prüfung</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_up_st" xml:space="preserve">
|
||||
<value>Temperatur Prüstreckeneingang am Prüfungsbeginn (4 Messungen nach Beginn)</value>
|
||||
</data>
|
||||
<data name="Tooltip_E_rel" xml:space="preserve">
|
||||
<value>Relative Messabweichung eines WZ</value>
|
||||
</data>
|
||||
<data name="Tooltip_E_rel_ref" xml:space="preserve">
|
||||
<value>Relative Messabweichung des NHO</value>
|
||||
</data>
|
||||
<data name="Tooltip_sn" xml:space="preserve">
|
||||
<value>Serie Nr. des WZ</value>
|
||||
</data>
|
||||
<data name="Tooltip_sn_aux" xml:space="preserve">
|
||||
<value>Serie Nr. des Nebenzählers (Verbundzähler)</value>
|
||||
</data>
|
||||
<data name="Tooltip_sn_main" xml:space="preserve">
|
||||
<value>Serie Nr. des Hauptzählers (Verbundzähler)</value>
|
||||
</data>
|
||||
<data name="Tooltip_Vol_Mt" xml:space="preserve">
|
||||
<value>Volumen gemessen vom geprüften WZ</value>
|
||||
</data>
|
||||
<data name="Tooltip_Vol_rm" xml:space="preserve">
|
||||
<value>Refferenz-Volumen vom geprüften WZ</value>
|
||||
</data>
|
||||
<data name="VName_Error" xml:space="preserve">
|
||||
<value>E</value>
|
||||
</data>
|
||||
<data name="Tooltip_Hu_Amb_M" xml:space="preserve">
|
||||
<value>Umgebungs-Luftfeuchtigkeit während der Prüfung</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_Amb_M" xml:space="preserve">
|
||||
<value>Umgebungs-Druck während der Prüfung</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_Amb_M" xml:space="preserve">
|
||||
<value>Umgebungs-Temperatur während der Prüfung</value>
|
||||
</data>
|
||||
<data name="Test_done" xml:space="preserve">
|
||||
<value>Prüfung erledigt</value>
|
||||
</data>
|
||||
<data name="Test_passed" xml:space="preserve">
|
||||
<value>Prüfung beendet</value>
|
||||
</data>
|
||||
<data name="No" xml:space="preserve">
|
||||
<value>Nein</value>
|
||||
</data>
|
||||
<data name="Yes" xml:space="preserve">
|
||||
<value>Ja</value>
|
||||
</data>
|
||||
<data name="Error_flags" xml:space="preserve">
|
||||
<value>Fehlerflags</value>
|
||||
</data>
|
||||
<data name="Legalizator" xml:space="preserve">
|
||||
<value>Prüfstellenleiter</value>
|
||||
</data>
|
||||
<data name="User_description" xml:space="preserve">
|
||||
<value>Benutzerbeschreibung</value>
|
||||
</data>
|
||||
<data name="Failed_meters_count" xml:space="preserve">
|
||||
<value>WZ-Prüfung nicht bestanden</value>
|
||||
</data>
|
||||
<data name="Passed_meters_count" xml:space="preserve">
|
||||
<value>WZ-Prüfung bestanden</value>
|
||||
</data>
|
||||
<data name="sensitivity" xml:space="preserve">
|
||||
<value>Empfindlichkeit</value>
|
||||
</data>
|
||||
<data name="Tooltip_Q_end" xml:space="preserve">
|
||||
<value>Durchflusswert vom NHO-am Prüfungsende</value>
|
||||
</data>
|
||||
<data name="Tooltip_Q_max" xml:space="preserve">
|
||||
<value>Durchflusswert vom NHO-max</value>
|
||||
</data>
|
||||
<data name="Tooltip_Q_min" xml:space="preserve">
|
||||
<value>Durchflusswert vom NHO-min</value>
|
||||
</data>
|
||||
<data name="Tooltip_Q_start" xml:space="preserve">
|
||||
<value>Durchflusswert vom NHO-am Prüfungsanfang</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_dw_max" xml:space="preserve">
|
||||
<value>Druck max. am Prüfstandsausgang während der Prüfung</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_dw_min" xml:space="preserve">
|
||||
<value>Druck min. am Prüfstandsausgang während der Prüfung</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_up_max" xml:space="preserve">
|
||||
<value>Druck max. am Prüfstandseingang während der Prüfung</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_up_min" xml:space="preserve">
|
||||
<value>Druck min. am Prüfstandseingang während der Prüfung</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_di_max" xml:space="preserve">
|
||||
<value>Temp. max. an der Umschaltung während der Prüfung</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_di_min" xml:space="preserve">
|
||||
<value>Temp. min. an der Umschaltung während der Prüfung</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_dw_max" xml:space="preserve">
|
||||
<value>Temp. max am Prüfstandsausgang während der Prüfung</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_dw_min" xml:space="preserve">
|
||||
<value>Temp. min. am Prüfstandsausgang während der Prüfung</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_up_max" xml:space="preserve">
|
||||
<value>Temp. max am Prüfstandseingang während der Prüfung</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_up_min" xml:space="preserve">
|
||||
<value>Temp. min am Prüfstandseingang während der Prüfung</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_de_max" xml:space="preserve">
|
||||
<value>Druckdifferenz gemessen von Delta P /WZ max. während der Prüfung</value>
|
||||
</data>
|
||||
<data name="Tooltip_P_de_min" xml:space="preserve">
|
||||
<value>Druckdifferenz gemessen von Delta P /WZ min. während der Prüfung</value>
|
||||
</data>
|
||||
<data name="Tooltip_Rho_Wa_calc" xml:space="preserve">
|
||||
<value>Dichte vom Wasser aus Tabelle oder Formel</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_rho_0" xml:space="preserve">
|
||||
<value>Temperatur von der Wasserprobe bei der Dichtekalibrierung</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_ln_ac" xml:space="preserve">
|
||||
<value>Temperatur aktuell in der Prüfstrecke</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_ln_avg" xml:space="preserve">
|
||||
<value>Temperatur-Mittelwert in der Prüfstrecke während der Prüfung</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_ln_en" xml:space="preserve">
|
||||
<value>Temperatur in der Prüfstrecke am Ende der Prüfung -4 letzten Messungen</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_ln_max" xml:space="preserve">
|
||||
<value>Temperatur max. in der Prüfstrecke während der Prüfung</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_ln_me" xml:space="preserve">
|
||||
<value>Temperatur-Durchschnitt in der Prüfstrecke während der Prüfung</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_ln_min" xml:space="preserve">
|
||||
<value>Temperatur min. in der Prüfstrecke während der Prüfung</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_ln_st" xml:space="preserve">
|
||||
<value>Temperatur in der Prüfstrecke am Anfang der Prüfung -4 ersten Messungen</value>
|
||||
</data>
|
||||
<data name="Unit" xml:space="preserve">
|
||||
<value>Einheit</value>
|
||||
</data>
|
||||
<data name="Procedure_description" xml:space="preserve">
|
||||
<value>Prüfprozess Beschreibung</value>
|
||||
</data>
|
||||
<data name="Bench_ID" xml:space="preserve">
|
||||
<value>Prüfstand ID</value>
|
||||
</data>
|
||||
<data name="Bench_name" xml:space="preserve">
|
||||
<value>Prüfstamdsname</value>
|
||||
</data>
|
||||
<data name="Address" xml:space="preserve">
|
||||
<value>Adresse</value>
|
||||
</data>
|
||||
<data name="Tooltip_E_rel_last" xml:space="preserve">
|
||||
<value>Relativer Fehler vom WZ in vorheriger Prüfung/ in Produktion</value>
|
||||
</data>
|
||||
<data name="Batch" xml:space="preserve">
|
||||
<value>Zälerlos</value>
|
||||
</data>
|
||||
<data name="repetition" xml:space="preserve">
|
||||
<value>Wiederholung</value>
|
||||
</data>
|
||||
<data name="Invalid_Q2_correction_factors" xml:space="preserve">
|
||||
<value>Fehlerhafter Q2 Korrektur-Faktor</value>
|
||||
</data>
|
||||
<data name="Previous_step_is_missing_or_NOK" xml:space="preserve">
|
||||
<value>Vorgehender Schritt fehlt oder nicht OK</value>
|
||||
</data>
|
||||
<data name="Test_repetition_count_exceeded_upper_limit" xml:space="preserve">
|
||||
<value>Prüfungswiederholung Anzahl überschritten!</value>
|
||||
</data>
|
||||
<data name="Wrong_iPerl_counting_direction" xml:space="preserve">
|
||||
<value>Falsche iPERL Durchflussrichtung</value>
|
||||
</data>
|
||||
<data name="Failed" xml:space="preserve">
|
||||
<value>Nicht OK</value>
|
||||
</data>
|
||||
<data name="Passed" xml:space="preserve">
|
||||
<value>OK</value>
|
||||
</data>
|
||||
<data name="Test_in_progress" xml:space="preserve">
|
||||
<value>Prüfung läuft</value>
|
||||
</data>
|
||||
<data name="Counter_0" xml:space="preserve">
|
||||
<value>Zähler {0}</value>
|
||||
</data>
|
||||
<data name="Date_and_time" xml:space="preserve">
|
||||
<value>Datum und Zeit</value>
|
||||
</data>
|
||||
<data name="Name" xml:space="preserve">
|
||||
<value>Name</value>
|
||||
</data>
|
||||
<data name="Step" xml:space="preserve">
|
||||
<value>Schritt</value>
|
||||
</data>
|
||||
<data name="Workplace" xml:space="preserve">
|
||||
<value>Arbeitsplatz</value>
|
||||
</data>
|
||||
<data name="Workflow" xml:space="preserve">
|
||||
<value>Arbeitsablauf</value>
|
||||
</data>
|
||||
<data name="Production_tracing_results" xml:space="preserve">
|
||||
<value>Produktion Ergebnisse verfolgen</value>
|
||||
</data>
|
||||
<data name="Code" xml:space="preserve">
|
||||
<value>Code</value>
|
||||
</data>
|
||||
<data name="Part" xml:space="preserve">
|
||||
<value>Teil</value>
|
||||
</data>
|
||||
<data name="All_results" xml:space="preserve">
|
||||
<value>Alle Ergebnisse</value>
|
||||
</data>
|
||||
<data name="Graphs" xml:space="preserve">
|
||||
<value>Graphiken</value>
|
||||
</data>
|
||||
<data name="No_water_meter" xml:space="preserve">
|
||||
<value>Kein WZ</value>
|
||||
</data>
|
||||
<data name="Serial_number_is_missing" xml:space="preserve">
|
||||
<value>Serie Nr. fehlt.</value>
|
||||
</data>
|
||||
<data name="Lower_limit" xml:space="preserve">
|
||||
<value>Untere Grenze</value>
|
||||
</data>
|
||||
<data name="Upper_limit" xml:space="preserve">
|
||||
<value>Obere Grenze</value>
|
||||
</data>
|
||||
<data name="Water_meter_results" xml:space="preserve">
|
||||
<value>WZ Ergebnisse</value>
|
||||
</data>
|
||||
<data name="Relative_error" xml:space="preserve">
|
||||
<value>Relativer Fehler</value>
|
||||
</data>
|
||||
<data name="This_position_is_disabled" xml:space="preserve">
|
||||
<value>Position nicht aktiviert.</value>
|
||||
</data>
|
||||
<data name="Available_items" xml:space="preserve">
|
||||
<value>Verfügbare Positionen</value>
|
||||
</data>
|
||||
<data name="Selected_items" xml:space="preserve">
|
||||
<value>Ausgewählte Objekte</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -828,4 +828,7 @@
|
||||
<data name="VName_Conduct" xml:space="preserve">
|
||||
<value>Conduct.</value>
|
||||
</data>
|
||||
<data name="Info_flags" xml:space="preserve">
|
||||
<value>Info flags</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -19,7 +19,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;JUZNA_AFRIKA_NEW</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
@@ -29,7 +29,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;MUNICH</DefineConstants>
|
||||
<DefineConstants>TRACE;JUZNA_AFRIKA_NEW</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
@@ -166,9 +166,6 @@
|
||||
<Compile Include="Output\Printers\PrintersCommon.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Output\Printers\Munich\MunichPrintDocument.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Output\Printers\OnePerMeter\OnePerMeterPrintDocument.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
@@ -195,6 +192,10 @@
|
||||
<Compile Include="WMeterRsltItemSpec.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Common\Common.csproj">
|
||||
<Project>{c8939821-ba5c-4988-a3d0-bf53b74865c7}</Project>
|
||||
<Name>Common</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Config\Config.csproj">
|
||||
<Project>{743DF7DB-C7B6-42EB-986D-0F485E5588E4}</Project>
|
||||
<Name>Config</Name>
|
||||
|
||||
+2
-4
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2016-2019 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2016-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Text;
|
||||
@@ -11,9 +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);
|
||||
return Common.Utils.GetTestName(name, repeats, repetitionNr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -43,13 +43,6 @@ namespace Results
|
||||
return item2;
|
||||
}
|
||||
|
||||
|
||||
/// This is to show RealDensity and AtTemperatire in reports.
|
||||
public static double RealDensity; /// true water density [kg/m3]
|
||||
public static double AtTemperature; /// measured at temperature [°C]
|
||||
public static double Buoyancy;
|
||||
|
||||
|
||||
///
|
||||
/// Function to pick a MeterTestResult field and convert it into a string
|
||||
///
|
||||
@@ -182,9 +175,9 @@ namespace Results
|
||||
/// Density
|
||||
///
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Density, Strings.Density + " ()", Quantity.Density, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetTestRslt(t).DensityLine)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Density_correction, Strings.Density_correction + " ()", Quantity.Density, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", (w.Batch.DensityCorr))));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Rho_Wa_calc, string.Format("{0} of sample", Strings.Density), Quantity.Density, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V4", RealDensity)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.RhoDistilledWtrAtMeLineTemp, string.Format("{0} of distilled water at T line", Strings.Density), Quantity.Density, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V4", (w.GetTestRslt(t) == null) ? 0 : Config.Formulas.DistilledWaterDensityFromTemp((w.GetTestRslt(t).TempUpMean + w.GetTestRslt(t).TempDownMean) / 2))));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Density_correction, Strings.Density_correction + " ()", Quantity.Density, ItemCategory.BenchData, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", Config.Formulas.DensityCorrection(w.Batch.SampleDensity, w.Batch.SampleTemp))));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Rho_Wa_calc, string.Format("{0} of sample", Strings.Density), Quantity.Density, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V4", w.Batch.SampleDensity)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.RhoDistilledWtrAtMeLineTemp, string.Format("{0} of distilled water at T line", Strings.Density), Quantity.Density, ItemCategory.BenchData, (w, t, u, f, p) => FormatDbl(u, f, p, "V4", (w.GetTestRslt(t) == null) ? 0 : Config.Formulas.DistilledWaterDensityFromTemp((w.GetTestRslt(t).TempUpMean + w.GetTestRslt(t).TempDownMean) / 2))));
|
||||
|
||||
///
|
||||
/// Date and time
|
||||
@@ -259,7 +252,7 @@ namespace Results
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_avg, string.Format("{0} DI avg ()", Strings.VName_Temp), Strings.Tooltip_T_di_avg, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).TempDivStart + w.GetTestRslt(t).TempDivEnd) / 2)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_min, string.Format("{0} DI min ()", Strings.VName_Temp), Strings.Tooltip_T_di_min, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempDivMin)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_max, string.Format("{0} DI max ()", Strings.VName_Temp), Strings.Tooltip_T_di_max, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempDivMax)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_rho_0, string.Format("{0} RO0", Strings.VName_Temp), Strings.Tooltip_T_rho_0, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", AtTemperature)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_rho_0, string.Format("{0} RO0", Strings.VName_Temp), Strings.Tooltip_T_rho_0, Quantity.Temperature, ItemCategory.BenchData, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.Batch.SampleTemp)));
|
||||
#if HEAT_METERS
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_mean, string.Format("{0} hi me", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).Custom1)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_start, string.Format("{0} hi st", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).Custom2)));
|
||||
@@ -316,7 +309,7 @@ namespace Results
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Amb_temp_start_end, string.Format("{0} Amb ST/EN", Strings.VName_Temp), Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", (w.GetTestRslt(t) == null) ? w.Batch.AmbTempStart() : w.GetTestRslt(t).AmbTempStart, (w.GetTestRslt(t) == null) ? w.Batch.AmbTempEnd() : w.GetTestRslt(t).AmbTempEnd)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Amb_press_start_end, string.Format("{0} Amb ST/EN", Strings.VName_Press), Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V4", (w.GetTestRslt(t) == null) ? w.Batch.AmbPressStart(): w.GetTestRslt(t).AmbPressStart, (w.GetTestRslt(t) == null) ? w.Batch.AmbPressEnd() : w.GetTestRslt(t).AmbPressEnd)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Amb_humi_start_end, string.Format("{0} Amb ST/EN", Strings.VName_Humi), Quantity.Humidity, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V2", (w.GetTestRslt(t) == null) ? w.Batch.AmbHumiStart() : w.GetTestRslt(t).AmbHumiStart, (w.GetTestRslt(t) == null) ? w.Batch.AmbHumiEnd() : w.GetTestRslt(t).AmbHumiEnd)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Buoyancy, "Buoyancy ()", Quantity.Number, ItemCategory.TestResult, (w, t, u, f, p) => string.IsNullOrEmpty(t) ? FormatDbl(u, f, p, "V6", w.Batch.Buoyancy()) : ((w.GetTestRslt(t) != null) ? FormatDbl(u, f, p, "V6", (w.GetTestRslt(t).Buoyancy)) : "")));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Buoyancy, "Buoyancy", Quantity.Number, ItemCategory.BenchData, (w, t, u, f, p) => FormatDbl(u, f, p, "V6", w.Batch.Buoyancy)));
|
||||
|
||||
///
|
||||
/// Error
|
||||
@@ -336,10 +329,13 @@ namespace Results
|
||||
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.ThreeState, "Three state result", Quantity.Enum, ItemCategory.MeterResult, (w, t, u, f, p) => FormatThreeState(f, w.ThreeStateFromTests())));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.ThreeState, "Three state result", Quantity.Enumerated, ItemCategory.MeterResult, (w, t, u, f, p) => FormatThreeState(f, w.ThreeStateFromTests())));
|
||||
|
||||
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
|
||||
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.Scale, "Scale", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).Scale()) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Diverter, "Diverter", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).Diverter()) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.RegValve, "Reg. valve", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).RegValve()) : 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
|
||||
@@ -412,7 +408,6 @@ namespace Results
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_description, Strings.User_description, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, Users.Entities.User.EncodedStrToFullName(w.Batch.UserName))));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Legalizator, Strings.Legalizator, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, Users.Entities.User.EncodedStrToLegalizator(w.Batch.UserName))));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Watermeters, Strings.WMs, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.WatermetersStr)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Protocol_title, Strings.Protocol, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.ProtocolTitle)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_start_time, Strings.Start, Quantity.DateTime, ItemCategory.Other, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? w.Batch.StartTime.ToString() : string.Format(f, w.Batch.StartTime)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_end_time, Strings.End, Quantity.DateTime, ItemCategory.Other, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? w.Batch.EndTime.ToString() : string.Format(f, w.Batch.EndTime)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Lite_per_pulse_Read, "1 / PlsPerLtr_Read", Quantity.PulsePerLtr, ItemCategory.Other, (w, t, u, f, p) => FormatDbl(u, f, p, "V4", (w.WaterMeterData.PulsesPerLtr != 0) ? 1/w.WaterMeterData.PulsesPerLtr : 0)));
|
||||
@@ -451,9 +446,12 @@ namespace Results
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ORACLE_DB
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_AssignedSerialNr, "Assigned s/n", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.AssignedSerialNr)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_CompleteSerialNr, "Complete s/n", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.CompleteSerialNr)));
|
||||
#endif
|
||||
|
||||
#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)));
|
||||
@@ -471,6 +469,7 @@ namespace Results
|
||||
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.InfoFlags, Strings.Info_flags + "()", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) != null) ? w.GetTestRslt(t).InfoFlagsStr() : w.InfoFlagsStr())));
|
||||
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));
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace ResultsBrowser
|
||||
ListOfSerialNumbers,
|
||||
WZTypeIdAndTimePeriod,
|
||||
ProducedWithinTimePeriod,
|
||||
BenchAndBatchNr,
|
||||
Count,
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ namespace ResultsBrowser.Filters
|
||||
DateFilter.GetFilterID(),
|
||||
BatchNrFilter.GetFilterID(),
|
||||
ProcedureFilter.GetFilterID(),
|
||||
ProtocolFilter.GetFilterID(),
|
||||
QnFilter.GetFilterID(),
|
||||
SerialNrFilter.GetFilterID(),
|
||||
WMPositionFilter.GetFilterID(),
|
||||
@@ -31,7 +30,6 @@ namespace ResultsBrowser.Filters
|
||||
DateFilter.GetFilterName(),
|
||||
BatchNrFilter.GetFilterName(),
|
||||
ProcedureFilter.GetFilterName(),
|
||||
ProtocolFilter.GetFilterName(),
|
||||
QnFilter.GetFilterName(),
|
||||
SerialNrFilter.GetFilterName(),
|
||||
WMPositionFilter.GetFilterName(),
|
||||
@@ -46,7 +44,6 @@ namespace ResultsBrowser.Filters
|
||||
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();
|
||||
@@ -62,7 +59,6 @@ namespace ResultsBrowser.Filters
|
||||
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);
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
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 ProtocolFilter : IFilter
|
||||
{
|
||||
public static string GetFilterID() { return "Protocol"; }
|
||||
public static string GetFilterName() { return Strings.Protocol; }
|
||||
|
||||
///
|
||||
/// 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 string Protocol;
|
||||
|
||||
|
||||
private ProtocolFilterUI userIface;
|
||||
|
||||
public ProtocolFilter()
|
||||
{
|
||||
userIface = new ProtocolFilterUI(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>()
|
||||
.Where(x => (x.ProtocolTitle == Protocol))
|
||||
.List<Batch>();
|
||||
|
||||
foreach (var b in batches)
|
||||
{
|
||||
foreach (var wm in b.WaterMeters) filteredWaterMeters.Add(wm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var wm in waterMeters)
|
||||
{
|
||||
if (wm.Batch.ProtocolTitle == Protocol) filteredWaterMeters.Add(wm);
|
||||
}
|
||||
}
|
||||
|
||||
return filteredWaterMeters;
|
||||
}
|
||||
}
|
||||
}
|
||||
-72
@@ -1,72 +0,0 @@
|
||||
namespace ResultsBrowser.Filters
|
||||
{
|
||||
partial class ProtocolFilterUI
|
||||
{
|
||||
/// <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.protocolTextBox = new System.Windows.Forms.TextBox();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.protocolTextBox);
|
||||
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 = "Procedure";
|
||||
//
|
||||
// procedureTextBox
|
||||
//
|
||||
this.protocolTextBox.Location = new System.Drawing.Point(132, 13);
|
||||
this.protocolTextBox.Name = "procedureTextBox";
|
||||
this.protocolTextBox.Size = new System.Drawing.Size(138, 20);
|
||||
this.protocolTextBox.TabIndex = 0;
|
||||
//
|
||||
// ProcedureFilter
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Name = "ProcedureFilter";
|
||||
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 protocolTextBox;
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ResultsBrowser.Filters
|
||||
{
|
||||
public partial class ProtocolFilterUI : UserControl
|
||||
{
|
||||
ProtocolFilter data;
|
||||
|
||||
/// <summary> Used only by Designer </summary>
|
||||
public ProtocolFilterUI()
|
||||
{
|
||||
InitializeComponent();
|
||||
Localize();
|
||||
}
|
||||
|
||||
/// <summary> Used to create the control aby a filter </summary>
|
||||
public ProtocolFilterUI(ProtocolFilter data)
|
||||
{
|
||||
this.data = data;
|
||||
InitializeComponent();
|
||||
Localize();
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
groupBox1.Text = ProtocolFilter.GetFilterName();
|
||||
}
|
||||
|
||||
public void Data2UI()
|
||||
{
|
||||
protocolTextBox.Text = (data.Protocol != null) ? data.Protocol : string.Empty;
|
||||
}
|
||||
|
||||
public void UI2Data()
|
||||
{
|
||||
data.Protocol = protocolTextBox.Text;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,7 @@ namespace ResultsBrowser.Forms
|
||||
//queryTypeComboBox.Items.Add(new CQSelectionItem(CQCriteria.ListOfSerialNumbers, "Všetky vodomery so sériovými číslami podľa zadaného zoznamu"));
|
||||
queryTypeComboBox.Items.Add(new CQSelectionItem(CQCriteria.WZTypeIdAndTimePeriod, "Všetky vodomery so zadaným WZTypeID vyrobené v zadanom časovom období"));
|
||||
queryTypeComboBox.Items.Add(new CQSelectionItem(CQCriteria.ProducedWithinTimePeriod, "Všetky vodomery vyrobené v zadanom časovom období"));
|
||||
queryTypeComboBox.Items.Add(new CQSelectionItem(CQCriteria.BenchAndBatchNr, "Stanica a číslo dávky"));
|
||||
queryTypeComboBox.Text = "Všetky vodomery vyrobené v zadanom časovom období";
|
||||
|
||||
destinationFileTextBox.Text = string.Format("vysledky_hladania_{0:ddMMyyyy_HHmm}.csv", DateTime.Now);
|
||||
@@ -68,7 +69,8 @@ namespace ResultsBrowser.Forms
|
||||
/// Update UI elements visibility
|
||||
inputListGroupBox.Enabled = (CQCriteria == CQCriteria.ListOfOrders) ||
|
||||
(CQCriteria == CQCriteria.ListOfPcbNumbers) ||
|
||||
(CQCriteria == CQCriteria.ListOfSerialNumbers);
|
||||
(CQCriteria == CQCriteria.ListOfSerialNumbers) ||
|
||||
(CQCriteria == CQCriteria.BenchAndBatchNr);
|
||||
|
||||
timePeriodGroupBox.Enabled = (CQCriteria == CQCriteria.WZTypeIdAndTimePeriod) ||
|
||||
(CQCriteria == CQCriteria.ProducedWithinTimePeriod);
|
||||
@@ -78,6 +80,11 @@ namespace ResultsBrowser.Forms
|
||||
parameterGroupBox.Enabled = true;
|
||||
parameterNameLabel.Text = "WZ Type ID";
|
||||
}
|
||||
else if (CQCriteria == CQCriteria.BenchAndBatchNr)
|
||||
{
|
||||
parameterGroupBox.Enabled = true;
|
||||
parameterNameLabel.Text = "Test bench number (e.g. 10 for WR10)";
|
||||
}
|
||||
else
|
||||
{
|
||||
parameterGroupBox.Enabled = false;
|
||||
|
||||
@@ -3,8 +3,9 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Rig;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.UI.Bench.Components;
|
||||
|
||||
namespace ResultsBrowser.Forms
|
||||
{
|
||||
@@ -87,13 +88,13 @@ namespace ResultsBrowser.Forms
|
||||
printerCfg = printerFactory.CmpntCfgFromCmpntEntity(cmpnt);
|
||||
}
|
||||
|
||||
IComponentCfgCtrl cfgControl = printerCfg.GetControl();
|
||||
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
|
||||
cfgForm.CmpntEntities = new List<Component>();
|
||||
|
||||
IComponentCfgCtrl cfgControl = printerCfg.GetControl(cfgForm.CmpntEntities);
|
||||
cfgControl.Config = printerCfg;
|
||||
cfgControl.Config.ItemNr = 0;
|
||||
|
||||
TBF.BenchControl.ComponentParametersDlg cfgForm = new TBF.BenchControl.ComponentParametersDlg();
|
||||
cfgForm.TbfComponents = new List<Component>();
|
||||
|
||||
cfgForm.ComponentCfgCtrl = cfgControl;
|
||||
cfgForm.UnlockAfterStart = true;
|
||||
DialogResult dr = cfgForm.ShowDialog();
|
||||
|
||||
@@ -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.25.1440.0")]
|
||||
[assembly: AssemblyFileVersion("2.25.1440.0")]
|
||||
[assembly: AssemblyVersion("3.1.1464.0")]
|
||||
[assembly: AssemblyFileVersion("3.1.1464.0")]
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
<value>OK</value>
|
||||
</data>
|
||||
<data name="Print_query_results" xml:space="preserve">
|
||||
<value>Ergebnise drucken</value>
|
||||
<value>Ergebnisse Abfrage Drucken</value>
|
||||
</data>
|
||||
<data name="Procedure" xml:space="preserve">
|
||||
<value>Prüfvorlage</value>
|
||||
@@ -172,7 +172,7 @@
|
||||
<value>Protokoll</value>
|
||||
</data>
|
||||
<data name="Query_results" xml:space="preserve">
|
||||
<value>Ergebnisse</value>
|
||||
<value>Abfrageergebnisse</value>
|
||||
</data>
|
||||
<data name="Results_Browser" xml:space="preserve">
|
||||
<value>Analyse der Ergebnisse</value>
|
||||
@@ -199,7 +199,7 @@
|
||||
<value>Statistiken</value>
|
||||
</data>
|
||||
<data name="Test" xml:space="preserve">
|
||||
<value>Prüfpunkt</value>
|
||||
<value>Prüfung</value>
|
||||
</data>
|
||||
<data name="Test_bench" xml:space="preserve">
|
||||
<value>Prüfstand</value>
|
||||
@@ -231,4 +231,76 @@
|
||||
<data name="Print" xml:space="preserve">
|
||||
<value>Drucken</value>
|
||||
</data>
|
||||
<data name="Name" xml:space="preserve">
|
||||
<value>Name</value>
|
||||
</data>
|
||||
<data name="ConfigureDatabaseText" xml:space="preserve">
|
||||
<value>Password für Prüfstand configurieren</value>
|
||||
</data>
|
||||
<data name="ExitBtnText" xml:space="preserve">
|
||||
<value>Exit</value>
|
||||
</data>
|
||||
<data name="Component" xml:space="preserve">
|
||||
<value>Komponenten</value>
|
||||
</data>
|
||||
<data name="Configure" xml:space="preserve">
|
||||
<value>Konfigurieren</value>
|
||||
</data>
|
||||
<data name="Printer" xml:space="preserve">
|
||||
<value>Drucker</value>
|
||||
</data>
|
||||
<data name="Question" xml:space="preserve">
|
||||
<value>Fragen</value>
|
||||
</data>
|
||||
<data name="Add" xml:space="preserve">
|
||||
<value>&Hinzufügen</value>
|
||||
</data>
|
||||
<data name="Message" xml:space="preserve">
|
||||
<value>Nachricht</value>
|
||||
</data>
|
||||
<data name="Data" xml:space="preserve">
|
||||
<value>Daten</value>
|
||||
</data>
|
||||
<data name="All_files" xml:space="preserve">
|
||||
<value>Alle Dateien</value>
|
||||
</data>
|
||||
<data name="Query_files" xml:space="preserve">
|
||||
<value>Abfragedateien</value>
|
||||
</data>
|
||||
<data name="No_program_settings_found" xml:space="preserve">
|
||||
<value>Programmeinstellungen nicht gefunden</value>
|
||||
</data>
|
||||
<data name="Using_default_settings" xml:space="preserve">
|
||||
<value>Einstellungen Vorgaben benutzen.</value>
|
||||
</data>
|
||||
<data name="Selected_language_not_supported" xml:space="preserve">
|
||||
<value>Ausgewählte Sprache wird nicht unterstützt.</value>
|
||||
</data>
|
||||
<data name="Using_English" xml:space="preserve">
|
||||
<value>Englische Sprache benutzen!</value>
|
||||
</data>
|
||||
<data name="Warning" xml:space="preserve">
|
||||
<value>Warnung</value>
|
||||
</data>
|
||||
<data name="Format" xml:space="preserve">
|
||||
<value>Formatieren</value>
|
||||
</data>
|
||||
<data name="Configure_printer" xml:space="preserve">
|
||||
<value>Drucker konfigurieren.</value>
|
||||
</data>
|
||||
<data name="No_printer_defined" xml:space="preserve">
|
||||
<value>Kein Drucker ausgewählt.</value>
|
||||
</data>
|
||||
<data name="Printing_failed" xml:space="preserve">
|
||||
<value>Druck fehlgeschlagen</value>
|
||||
</data>
|
||||
<data name="Printing_completed" xml:space="preserve">
|
||||
<value>Druck vollständig</value>
|
||||
</data>
|
||||
<data name="Error_exporting_results" xml:space="preserve">
|
||||
<value>Fehler beim exportieren der Ergebnisse!</value>
|
||||
</data>
|
||||
<data name="Histograms" xml:space="preserve">
|
||||
<value>Histogramm</value>
|
||||
</data>
|
||||
</root>
|
||||
+1
-1
@@ -19,7 +19,7 @@ namespace ResultsBrowser.Resources {
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Strings {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;JUZNA_AFRIKA_NEW</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
@@ -32,7 +32,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;MUNICH</DefineConstants>
|
||||
<DefineConstants>TRACE;JUZNA_AFRIKA_NEW</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
@@ -96,13 +96,6 @@
|
||||
<Compile Include="Filters\ProcedureFilterUI.Designer.cs">
|
||||
<DependentUpon>ProcedureFilterUI.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Filters\ProtocolFilter.cs" />
|
||||
<Compile Include="Filters\ProtocolFilterUI.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Filters\ProtocolFilterUI.designer.cs">
|
||||
<DependentUpon>ProtocolFilterUI.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Filters\QnFilter.cs" />
|
||||
<Compile Include="Filters\QnFilterUI.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
@@ -219,9 +212,6 @@
|
||||
<EmbeddedResource Include="Filters\ProcedureFilterUI.resx">
|
||||
<DependentUpon>ProcedureFilterUI.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Filters\ProtocolFilterUI.resx">
|
||||
<DependentUpon>ProtocolFilterUI.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Filters\QnFilterUI.resx">
|
||||
<DependentUpon>QnFilterUI.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
||||
+175
-117
@@ -7,9 +7,9 @@ using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using NHibernate;
|
||||
using Results.Entities;
|
||||
using TBF.BenchControl;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
using TBF.Rig;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.Rig.GenericDevices;
|
||||
using ResultsBrowser.Filters;
|
||||
using ResultsBrowser.Resources;
|
||||
using Oracle;
|
||||
@@ -28,14 +28,14 @@ namespace ResultsBrowser
|
||||
|
||||
IList<WaterMeter> waterMeters;
|
||||
|
||||
DateTime timePeriodStart;
|
||||
DateTime timePeriodEnd;
|
||||
DateTime timePeriodStart;
|
||||
DateTime timePeriodEnd;
|
||||
|
||||
static IList<IComponent> tbfComponents;
|
||||
static IList<IDevice> tbfDevices;
|
||||
|
||||
#if IPERL
|
||||
OracleConnection oracleConnection; /// Oracle database connection
|
||||
|
||||
#endif
|
||||
public ResultsBrowserWnd(string[] args)
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -44,12 +44,12 @@ namespace ResultsBrowser
|
||||
filtersConfig = new FiltersConfig();
|
||||
this.args = args;
|
||||
|
||||
tbfComponents = new List<TBF.BenchControl.Generic.IComponent>();
|
||||
tbfComponents = new List<TBF.Rig.Generic.IComponent>();
|
||||
tbfDevices = new List<IDevice>();
|
||||
|
||||
timePeriodStart = new DateTime(0);
|
||||
timePeriodEnd = new DateTime(0);
|
||||
}
|
||||
timePeriodStart = new DateTime(0);
|
||||
timePeriodEnd = new DateTime(0);
|
||||
}
|
||||
|
||||
private void ResultsBrowserWnd_Load(object sender, EventArgs e)
|
||||
{
|
||||
@@ -102,15 +102,15 @@ namespace ResultsBrowser
|
||||
checkBox6.Visible = !string.IsNullOrEmpty(checkBox6.Text);
|
||||
}
|
||||
|
||||
string BenchName()
|
||||
{
|
||||
return checkBox1.Checked ? Program.LocalSettings.Bench1
|
||||
: checkBox2.Checked ? Program.LocalSettings.Bench2
|
||||
: checkBox3.Checked ? Program.LocalSettings.Bench3
|
||||
: checkBox4.Checked ? Program.LocalSettings.Bench4
|
||||
string BenchName()
|
||||
{
|
||||
return checkBox1.Checked ? Program.LocalSettings.Bench1
|
||||
: checkBox2.Checked ? Program.LocalSettings.Bench2
|
||||
: checkBox3.Checked ? Program.LocalSettings.Bench3
|
||||
: checkBox4.Checked ? Program.LocalSettings.Bench4
|
||||
: checkBox5.Checked ? Program.LocalSettings.Bench5
|
||||
: Program.LocalSettings.Bench6;
|
||||
}
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
@@ -118,19 +118,19 @@ namespace ResultsBrowser
|
||||
resultsGroupBox.Text = Strings.Query_results;
|
||||
settingsBtn.Text = Strings.Settings;
|
||||
testBenchesGroupBox.Text = Strings.Test_benches;
|
||||
|
||||
clearFiltersBtn.Text = Strings.Clear_filters;
|
||||
|
||||
clearFiltersBtn.Text = Strings.Clear_filters;
|
||||
addFilterBtn.Text = Strings.Add_filter;
|
||||
formatOfResultsBtn.Text = Strings.Format_of_results;
|
||||
printerConfigBtn.Text = Strings.Configure_printer;
|
||||
loadConfigBtn.Text = Strings.Load_filters;
|
||||
formatOfResultsBtn.Text = Strings.Format_of_results;
|
||||
printerConfigBtn.Text = Strings.Configure_printer;
|
||||
loadConfigBtn.Text = Strings.Load_filters;
|
||||
saveConfigBtn.Text = Strings.Save_filters;
|
||||
|
||||
executeQueryBtn.Text = Strings.Execute_query;
|
||||
|
||||
executeQueryBtn.Text = Strings.Execute_query;
|
||||
exportQueryResultsBtn.Text = Strings.Export_query_results;
|
||||
printQueryResultsBtn.Text = Strings.Print_query_results;
|
||||
|
||||
statisticsBtn.Text = Strings.Statistics;
|
||||
|
||||
statisticsBtn.Text = Strings.Statistics;
|
||||
}
|
||||
|
||||
private void settingsBtn_Click(object sender, EventArgs e)
|
||||
@@ -176,40 +176,40 @@ namespace ResultsBrowser
|
||||
}
|
||||
}
|
||||
|
||||
private void formatOfResultsBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg();
|
||||
dlg.MetersKind = Config.Entities.MetersKind.Single;
|
||||
dlg.SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
|
||||
private void formatOfResultsBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg();
|
||||
dlg.MetersKind = Config.Entities.MetersKind.Single;
|
||||
dlg.SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
|
||||
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
filtersConfig.ResultItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
|
||||
RedrawResults();
|
||||
}
|
||||
}
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
filtersConfig.ResultItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
|
||||
RedrawResults();
|
||||
}
|
||||
}
|
||||
|
||||
private void printerConfigBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
Forms.PrinterConfigDlg dlg = new Forms.PrinterConfigDlg
|
||||
{
|
||||
PrinterClass = filtersConfig.PrinterClass,
|
||||
PrinterCfg = filtersConfig.PrinterCfg
|
||||
};
|
||||
private void printerConfigBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
Forms.PrinterConfigDlg dlg = new Forms.PrinterConfigDlg
|
||||
{
|
||||
PrinterClass = filtersConfig.PrinterClass,
|
||||
PrinterCfg = filtersConfig.PrinterCfg
|
||||
};
|
||||
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
filtersConfig.PrinterClass = dlg.PrinterClass;
|
||||
filtersConfig.PrinterCfg = dlg.PrinterCfg;
|
||||
}
|
||||
}
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
filtersConfig.PrinterClass = dlg.PrinterClass;
|
||||
filtersConfig.PrinterCfg = dlg.PrinterCfg;
|
||||
}
|
||||
}
|
||||
|
||||
private void loadConfigBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenFileDialog dlg = new OpenFileDialog();
|
||||
dlg.Filter = string.Format("{0} (*.qry)|*.qry|{1} (*.*)|*.*", Strings.Query_files, Strings.All_files);
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
OpenFileDialog dlg = new OpenFileDialog();
|
||||
dlg.Filter = string.Format("{0} (*.qry)|*.qry|{1} (*.*)|*.*", Strings.Query_files, Strings.All_files);
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
LoadConfigFromFile(dlg.FileName);
|
||||
}
|
||||
}
|
||||
@@ -269,8 +269,8 @@ namespace ResultsBrowser
|
||||
|
||||
private void executeQueryBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
timePeriodStart = new DateTime(0);
|
||||
timePeriodEnd = new DateTime(0);
|
||||
timePeriodStart = new DateTime(0);
|
||||
timePeriodEnd = new DateTime(0);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -291,11 +291,11 @@ namespace ResultsBrowser
|
||||
|
||||
foreach (var filter in filters)
|
||||
{
|
||||
if (filter is DateFilter)
|
||||
{
|
||||
timePeriodStart = (filter as DateFilter).From;
|
||||
timePeriodEnd = (filter as DateFilter).To;
|
||||
}
|
||||
if (filter is DateFilter)
|
||||
{
|
||||
timePeriodStart = (filter as DateFilter).From;
|
||||
timePeriodEnd = (filter as DateFilter).To;
|
||||
}
|
||||
waterMeters2 = filter.ExecuteQuery(sessions, waterMeters);
|
||||
waterMeters = waterMeters2;
|
||||
}
|
||||
@@ -364,10 +364,10 @@ namespace ResultsBrowser
|
||||
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (TextWriter writer = new StreamWriter(dlg.FileName, false, System.Text.Encoding.UTF8))
|
||||
{
|
||||
try
|
||||
{
|
||||
using (TextWriter writer = new StreamWriter(dlg.FileName, false, System.Text.Encoding.UTF8))
|
||||
{
|
||||
for (int i = 0; i < items.Count; i++)
|
||||
{
|
||||
writer.Write(items[i].Caption);
|
||||
@@ -397,10 +397,10 @@ namespace ResultsBrowser
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
catch (Exception exc)
|
||||
{
|
||||
MessageBox.Show(exc.Message, Strings.Error_exporting_results, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -409,12 +409,7 @@ namespace ResultsBrowser
|
||||
{
|
||||
if (waterMeters == null || waterMeters.Count == 0) return;
|
||||
|
||||
#if MUNICH
|
||||
foreach (var wm in waterMeters)
|
||||
{
|
||||
new Results.Output.Printers.Munich.MunichPrintDocument(string.Format("4/13 - {0}", BenchName()), wm, Config.Entities.PageOrientation.Portrait).Print();
|
||||
}
|
||||
#elif CEVAK_40
|
||||
#if CEVAK_40
|
||||
IList<Results.Entities.Batch> batches = new List<Results.Entities.Batch>();
|
||||
foreach (var wm in waterMeters)
|
||||
{
|
||||
@@ -448,11 +443,11 @@ namespace ResultsBrowser
|
||||
IComponent component = printerFactory.GetComponent(printerCfg, tbfComponents);
|
||||
IResultsPrinter printer = component as IResultsPrinter;
|
||||
|
||||
if (printer== null)
|
||||
if (printer == null)
|
||||
{
|
||||
MessageBox.Show(Strings.No_printer_defined);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
tbfComponents.Clear();
|
||||
tbfDevices.Clear();
|
||||
@@ -493,7 +488,7 @@ namespace ResultsBrowser
|
||||
{
|
||||
if (waterMeters == null || waterMeters.Count == 0) return;
|
||||
|
||||
IList<Results.WMeterRsltItemSpec> items = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
|
||||
IList<Results.WMeterRsltItemSpec> items = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
|
||||
|
||||
///
|
||||
/// Statistics options
|
||||
@@ -529,24 +524,24 @@ namespace ResultsBrowser
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Updates component factory
|
||||
/// </summary>
|
||||
/// <param name="className">Component class name</param>
|
||||
/// <param name="factory">Reference to a factory</param>
|
||||
/// <returns>true when factory changed</returns>
|
||||
IComponentFactory GetFactory(string className)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(className))
|
||||
{
|
||||
foreach (var fac in TbfComponents.Factories)
|
||||
{
|
||||
if (fac.ClassName == className) return fac;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Updates component factory
|
||||
/// </summary>
|
||||
/// <param name="className">Component class name</param>
|
||||
/// <param name="factory">Reference to a factory</param>
|
||||
/// <returns>true when factory changed</returns>
|
||||
IComponentFactory GetFactory(string className)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(className))
|
||||
{
|
||||
foreach (var fac in TbfComponents.Factories)
|
||||
{
|
||||
if (fac.ClassName == className) return fac;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void customQueryButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -639,7 +634,6 @@ namespace ResultsBrowser
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/// Add this test bench to the list of test benches if it was still missing
|
||||
if (!testBenches.Contains(testBenchId)) testBenches.Add(testBenchId);
|
||||
}
|
||||
@@ -734,20 +728,11 @@ namespace ResultsBrowser
|
||||
/// SUEZ specific
|
||||
switch (testId)
|
||||
{
|
||||
case -2:
|
||||
oraD.AdjErrA4 = error;
|
||||
break;
|
||||
case -1:
|
||||
oraD.AdjErr = error;
|
||||
break;
|
||||
case 5:
|
||||
oraD.Q3LrErr = error;
|
||||
break;
|
||||
case 10:
|
||||
oraD.Q3RlErr = error;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case -2: oraD.AdjErrA4 = error; break;
|
||||
case -1: oraD.AdjErr = error; break;
|
||||
case 5: oraD.Q3LrErr = error; break;
|
||||
case 10: oraD.Q3RlErr = error; break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
dr.Close();
|
||||
@@ -756,6 +741,78 @@ namespace ResultsBrowser
|
||||
|
||||
oracleConnection.Close();
|
||||
}
|
||||
else if (dlg.CQCriteria == CQCriteria.BenchAndBatchNr)
|
||||
{
|
||||
switch (dlg.IntParameter)
|
||||
{
|
||||
case 10: Results.DB.ConnectionString = "SERVER=10.42.130.69; DATABASE=st-wr10-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
case 11: Results.DB.ConnectionString = "SERVER=10.42.129.27; DATABASE=st-wr11-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
case 13: Results.DB.ConnectionString = "SERVER=10.42.130.52; DATABASE=st-wr13-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
case 15: Results.DB.ConnectionString = "SERVER=10.42.130.71; DATABASE=st-wr15-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
case 14: Results.DB.ConnectionString = "SERVER=10.42.130.72; DATABASE=st-wr14-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
case 18: Results.DB.ConnectionString = "SERVER=10.42.130.165; DATABASE=st-wr18-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
case 19: Results.DB.ConnectionString = "SERVER=10.42.128.159; DATABASE=st-wr19-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
case 20: Results.DB.ConnectionString = "SERVER=10.42.130.76; DATABASE=st-wr20-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
case 21: Results.DB.ConnectionString = "SERVER=10.42.128.201; DATABASE=st-wr21-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
default: Results.DB.ConnectionString = string.Empty; break;
|
||||
}
|
||||
Results.DB.DbType = Users.Entities.DBType.MySql;
|
||||
|
||||
string[] fields = dlg.InputList.Split(new char[] { ',' });
|
||||
int[] batchNrs = new int[fields.Length];
|
||||
int batchNr;
|
||||
for (int i = 0; i < batchNrs.Length; i++) if (int.TryParse(fields[i], out batchNr)) batchNrs[i] = batchNr;
|
||||
|
||||
IList<WaterMeter> waterMeters = new List<WaterMeter>();
|
||||
if (!string.IsNullOrEmpty(Results.DB.ConnectionString))
|
||||
{
|
||||
ISession session = Results.DB.CreateSession();
|
||||
|
||||
for (int i = 0; i < batchNrs.Length; i++)
|
||||
{
|
||||
var batches = session.QueryOver<Batch>()
|
||||
.Where(x => (x.BatchNr == batchNrs[i]))
|
||||
.List();
|
||||
if (batches.Count == 1)
|
||||
{
|
||||
var wms = session.QueryOver<WaterMeter>()
|
||||
.Where(x => (x.Batch == batches[0]))
|
||||
.List();
|
||||
foreach (var wm in wms) waterMeters.Add(wm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
consoleTextBox.Text += "Collecting water meters\r\n";
|
||||
foreach (var waterMeter in waterMeters)
|
||||
{
|
||||
oracleConnection = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltachef;Password=deltachef;");
|
||||
oracleConnection.Open();
|
||||
|
||||
OracleCommand cmd = new OracleCommand("select AUFTRAGSNUMMER, MAX_PRUEFINDEX, PREFIX, ZAEHLERNUMMER from VT_ZAEHLER_PD where VT_FERNUM = :1 AND ANBID = 4 order by ZAEHLERNUMMER", oracleConnection);
|
||||
cmd.Parameters.Add(new OracleParameter { ParameterName = "1", OracleDbType = OracleDbType.Varchar2, Value = waterMeter.SerialNr });
|
||||
|
||||
OracleDataReader dr = cmd.ExecuteReader();
|
||||
while (dr.Read())
|
||||
{
|
||||
int i = 0;
|
||||
string queryResult = dr.GetString(i++);
|
||||
int maxPruefIx = dr.GetInt32(i++);
|
||||
int testBenchId = maxPruefIx / 100;
|
||||
maxPruefIx = maxPruefIx % 100;
|
||||
string prefix = dr.GetString(i++);
|
||||
int sn = dr.GetInt32(i++);
|
||||
|
||||
if (sn == -1) continue;
|
||||
|
||||
/// Create 'OraData' object and add it to 'oraDatas' list
|
||||
oraDatas.Add(new OraData() { PO = queryResult, PcbNr = waterMeter.SerialNr, TestBenchId = testBenchId, MaxPruefIx = maxPruefIx, Prefix = prefix, SN = sn });
|
||||
|
||||
/// Add this test bench to the list of test benches if it was still missing
|
||||
if (!testBenches.Contains(testBenchId)) testBenches.Add(testBenchId);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (dlg.CQCriteria == CQCriteria.WZTypeIdAndTimePeriod)
|
||||
{
|
||||
}
|
||||
@@ -795,18 +852,19 @@ namespace ResultsBrowser
|
||||
/// Test bench databases
|
||||
switch (testBenchId)
|
||||
{
|
||||
case 5: Results.DB.ConnectionString = "SERVER=10.42.130.69; DATABASE=st-wr10-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
case 6: Results.DB.ConnectionString = "SERVER=10.42.129.27; DATABASE=st-wr11-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
case 8: Results.DB.ConnectionString = "SERVER=10.42.128.61; DATABASE=st-wr13-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
case 9: Results.DB.ConnectionString = "SERVER=10.42.130.71; DATABASE=st-wr15-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
case 10: Results.DB.ConnectionString = "SERVER=10.42.130.72; DATABASE=st-wr14-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
case 5: Results.DB.ConnectionString = "SERVER=10.42.130.69; DATABASE=st-wr10-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
case 6: Results.DB.ConnectionString = "SERVER=10.42.129.27; DATABASE=st-wr11-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
case 8: Results.DB.ConnectionString = "SERVER=10.42.130.52; DATABASE=st-wr13-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
case 9: Results.DB.ConnectionString = "SERVER=10.42.130.71; DATABASE=st-wr15-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
case 10: Results.DB.ConnectionString = "SERVER=10.42.130.72; DATABASE=st-wr14-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
case 11: Results.DB.ConnectionString = "SERVER=10.42.130.165; DATABASE=st-wr18-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
case 12: Results.DB.ConnectionString = "SERVER=10.42.128.159; DATABASE=st-wr19-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
case 13: Results.DB.ConnectionString = "SERVER=10.42.130.76; DATABASE=st-wr20-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
case 13: Results.DB.ConnectionString = "SERVER=10.42.130.76; DATABASE=st-wr20-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
case 14: Results.DB.ConnectionString = "SERVER=10.42.128.201; DATABASE=st-wr21-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;"; break;
|
||||
default: Results.DB.ConnectionString = string.Empty; break;
|
||||
}
|
||||
#endif
|
||||
Results.DB.DbType = Users.Entities.DBType.MySql;
|
||||
|
||||
if (!string.IsNullOrEmpty(Results.DB.ConnectionString))
|
||||
{
|
||||
@@ -854,7 +912,7 @@ namespace ResultsBrowser
|
||||
consoleTextBox.Text += Environment.NewLine;
|
||||
|
||||
if (session != null) session.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
consoleTextBox.Text += "End reading additional data from MySQL\r\n";
|
||||
|
||||
|
||||
@@ -0,0 +1,579 @@
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SchematicDrawing
|
||||
{
|
||||
public class DrawingShape
|
||||
{
|
||||
public readonly Shape Shape; /// see enum SchematicDrawing.Shape
|
||||
public readonly Sz Sz; /// see enum SchematicDrawing.Sz
|
||||
public readonly int SzX; /// Size X in SchematicDrawing.Const.Step pixels
|
||||
public readonly int SzY; /// Size Y in SchematicDrawing.Const.Step pixels
|
||||
|
||||
public readonly int OffsX; /// Offset of left/top coordinate of the bitmap when rendering
|
||||
public readonly int OffsY; /// Offset of left/top coordinate of the bitmap when rendering
|
||||
public readonly int Wid; /// Width of the bitmap when rendering, original bitmap is resized to this size
|
||||
public readonly int Hgh; /// Height of the bitmap when rendering, original bitmap is resized to this size
|
||||
|
||||
public readonly Node[] Nodes; /// Nodes of this shape
|
||||
public readonly Edge[] Edges; /// Edges (in the open state in case there are two states: open/closed)
|
||||
|
||||
/// open (route bit = 1), wet
|
||||
public readonly bool HasImg; /// True when there is an image of this item to be displayed
|
||||
public readonly Image ImgRight; /// Bitmap to be drawn (in the open state in case there are two states: open/closed)
|
||||
public readonly Image ImgUp;
|
||||
public readonly Image ImgLeft;
|
||||
public readonly Image ImgDown;
|
||||
public readonly Image ImgRightFlipped;
|
||||
public readonly Image ImgUpFlipped;
|
||||
public readonly Image ImgLeftFlipped;
|
||||
public readonly Image ImgDownFlipped;
|
||||
|
||||
/// open (route bit = 1), dry
|
||||
public readonly bool HasOpenDry; /// true = this shape can be displayed as dry in an open state
|
||||
public readonly Image ImgRightOpenDry; /// Optional bitmap in the closed state, size should be the same as the size of Bmp
|
||||
public readonly Image ImgUpOpenDry;
|
||||
public readonly Image ImgLeftOpenDry;
|
||||
public readonly Image ImgDownOpenDry;
|
||||
public readonly Image ImgRightFlippedOpenDry;
|
||||
public readonly Image ImgUpFlippedOpenDry;
|
||||
public readonly Image ImgLeftFlippedOpenDry;
|
||||
public readonly Image ImgDownFlippedOpenDry;
|
||||
|
||||
/// closed (route bit = 0), wet
|
||||
public readonly bool HasClosedWet; /// true = This shape can be displayed as wet in a closed state
|
||||
public readonly Image ImgRightClosedWet; /// Optional bitmap in the closed state, size should be the same as the size of Bmp
|
||||
public readonly Image ImgUpClosedWet;
|
||||
public readonly Image ImgLeftClosedWet;
|
||||
public readonly Image ImgDownClosedWet;
|
||||
public readonly Image ImgRightFlippedClosedWet;
|
||||
public readonly Image ImgUpFlippedClosedWet;
|
||||
public readonly Image ImgLeftFlippedClosedWet;
|
||||
public readonly Image ImgDownFlippedClosedWet;
|
||||
|
||||
/// closed (route bit = 0), dry
|
||||
public readonly bool HasClosedDry; /// true = This shape can be displayed as dry in a closed state
|
||||
public readonly Image ImgRightClosedDry; /// Optional bitmap in the closed state, size should be the same as the size of Bmp
|
||||
public readonly Image ImgUpClosedDry;
|
||||
public readonly Image ImgLeftClosedDry;
|
||||
public readonly Image ImgDownClosedDry;
|
||||
public readonly Image ImgRightFlippedClosedDry;
|
||||
public readonly Image ImgUpFlippedClosedDry;
|
||||
public readonly Image ImgLeftFlippedClosedDry;
|
||||
public readonly Image ImgDownFlippedClosedDry;
|
||||
|
||||
public readonly bool HasVacuum; /// true = This shape can display vacuum
|
||||
public readonly Image ImgRightVacuum; /// Optional bitmap in the closed state, size should be the same as the size of Bmp
|
||||
public readonly Image ImgUpVacuum;
|
||||
public readonly Image ImgLeftVacuum;
|
||||
public readonly Image ImgDownVacuum;
|
||||
public readonly Image ImgRightFlippedVacuum;
|
||||
public readonly Image ImgUpFlippedVacuum;
|
||||
public readonly Image ImgLeftFlippedVacuum;
|
||||
public readonly Image ImgDownFlippedVacuum;
|
||||
|
||||
|
||||
DrawingShape(Shape shape, Sz sz, int szX, int szY, Node[] nodes = null, Edge[] edges = null,
|
||||
int offsX = -10, int offsY = -10, int wid = 20, int hgh = 20,
|
||||
Bitmap bmp = null, /// wet, open (route bit = 1)
|
||||
Bitmap bmpClosedDry = null, /// dry (Dist == int.MaxValue), closed (route bit = 0)
|
||||
Bitmap bmpVacuum = null, /// vacuum (int.MaxValue > Dist && Dist > Const.Vacuum)
|
||||
Bitmap bmpOpenDry = null, /// dry (Dist == int.MaxValue), open (route bit = 1)
|
||||
Bitmap bmpClosedWet = null) /// wet, closed (route bit = 0) ... diverter only
|
||||
{
|
||||
Shape = shape;
|
||||
Sz = sz;
|
||||
SzX = szX;
|
||||
SzY = szY;
|
||||
OffsX = offsX;
|
||||
OffsY = offsY;
|
||||
Wid = wid;
|
||||
Hgh = hgh;
|
||||
Nodes = (nodes != null) ? nodes : new Node[0];
|
||||
Edges = (edges != null) ? edges : new Edge[0];
|
||||
|
||||
HasImg = (bmp != null);
|
||||
if (HasImg)
|
||||
{
|
||||
ImgRight = bmp.Clone() as Image;
|
||||
bmp.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgDown = bmp.Clone() as Image;
|
||||
bmp.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgLeft = bmp.Clone() as Image;
|
||||
bmp.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgUp = bmp.Clone() as Image;
|
||||
bmp.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
bmp.RotateFlip(RotateFlipType.RotateNoneFlipY);
|
||||
ImgRightFlipped = bmp.Clone() as Image;
|
||||
bmp.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgDownFlipped = bmp.Clone() as Image;
|
||||
bmp.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgLeftFlipped = bmp.Clone() as Image;
|
||||
bmp.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgUpFlipped = bmp.Clone() as Image;
|
||||
bmp.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
bmp.RotateFlip(RotateFlipType.RotateNoneFlipY);
|
||||
}
|
||||
HasClosedDry = (bmpClosedDry != null);
|
||||
if (HasClosedDry)
|
||||
{
|
||||
ImgRightClosedDry = bmpClosedDry.Clone() as Image;
|
||||
bmpClosedDry.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgDownClosedDry = bmpClosedDry.Clone() as Image;
|
||||
bmpClosedDry.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgLeftClosedDry = bmpClosedDry.Clone() as Image;
|
||||
bmpClosedDry.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgUpClosedDry = bmpClosedDry.Clone() as Image;
|
||||
bmpClosedDry.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
bmpClosedDry.RotateFlip(RotateFlipType.RotateNoneFlipY);
|
||||
ImgRightFlippedClosedDry = bmpClosedDry.Clone() as Image;
|
||||
bmpClosedDry.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgDownFlippedClosedDry = bmpClosedDry.Clone() as Image;
|
||||
bmpClosedDry.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgLeftFlippedClosedDry = bmpClosedDry.Clone() as Image;
|
||||
bmpClosedDry.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgUpFlippedClosedDry = bmpClosedDry.Clone() as Image;
|
||||
bmpClosedDry.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
bmpClosedDry.RotateFlip(RotateFlipType.RotateNoneFlipY);
|
||||
}
|
||||
HasVacuum = (bmpVacuum != null);
|
||||
if (HasVacuum)
|
||||
{
|
||||
ImgRightVacuum = bmpVacuum.Clone() as Image;
|
||||
bmpVacuum.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgDownVacuum = bmpVacuum.Clone() as Image;
|
||||
bmpVacuum.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgLeftVacuum = bmpVacuum.Clone() as Image;
|
||||
bmpVacuum.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgUpVacuum = bmpVacuum.Clone() as Image;
|
||||
bmpVacuum.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
bmpVacuum.RotateFlip(RotateFlipType.RotateNoneFlipY);
|
||||
ImgRightFlippedVacuum = bmpVacuum.Clone() as Image;
|
||||
bmpVacuum.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgDownFlippedVacuum = bmpVacuum.Clone() as Image;
|
||||
bmpVacuum.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgLeftFlippedVacuum = bmpVacuum.Clone() as Image;
|
||||
bmpVacuum.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgUpFlippedVacuum = bmpVacuum.Clone() as Image;
|
||||
bmpVacuum.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
bmpVacuum.RotateFlip(RotateFlipType.RotateNoneFlipY);
|
||||
}
|
||||
HasOpenDry = (bmpOpenDry != null);
|
||||
if (HasOpenDry)
|
||||
{
|
||||
ImgRightOpenDry = bmpOpenDry.Clone() as Image;
|
||||
bmpOpenDry.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgDownOpenDry = bmpOpenDry.Clone() as Image;
|
||||
bmpOpenDry.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgLeftOpenDry = bmpOpenDry.Clone() as Image;
|
||||
bmpOpenDry.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgUpOpenDry = bmpOpenDry.Clone() as Image;
|
||||
bmpOpenDry.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
bmpOpenDry.RotateFlip(RotateFlipType.RotateNoneFlipY);
|
||||
ImgRightFlippedOpenDry = bmpOpenDry.Clone() as Image;
|
||||
bmpOpenDry.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgDownFlippedOpenDry = bmpOpenDry.Clone() as Image;
|
||||
bmpOpenDry.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgLeftFlippedOpenDry = bmpOpenDry.Clone() as Image;
|
||||
bmpOpenDry.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgUpFlippedOpenDry = bmpOpenDry.Clone() as Image;
|
||||
bmpOpenDry.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
bmpOpenDry.RotateFlip(RotateFlipType.RotateNoneFlipY);
|
||||
}
|
||||
HasClosedWet = (bmpClosedWet != null);
|
||||
if (HasClosedWet)
|
||||
{
|
||||
ImgRightClosedWet = bmpClosedWet.Clone() as Image;
|
||||
bmpClosedWet.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgDownClosedWet = bmpClosedWet.Clone() as Image;
|
||||
bmpClosedWet.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgLeftClosedWet = bmpClosedWet.Clone() as Image;
|
||||
bmpClosedWet.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgUpClosedWet = bmpClosedWet.Clone() as Image;
|
||||
bmpClosedWet.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
bmpClosedWet.RotateFlip(RotateFlipType.RotateNoneFlipY);
|
||||
ImgRightFlippedClosedWet = bmpClosedWet.Clone() as Image;
|
||||
bmpClosedWet.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgDownFlippedClosedWet = bmpClosedWet.Clone() as Image;
|
||||
bmpClosedWet.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgLeftFlippedClosedWet = bmpClosedWet.Clone() as Image;
|
||||
bmpClosedWet.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
ImgUpFlippedClosedWet = bmpClosedWet.Clone() as Image;
|
||||
bmpClosedWet.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
bmpClosedWet.RotateFlip(RotateFlipType.RotateNoneFlipY);
|
||||
}
|
||||
}
|
||||
|
||||
public Rectangle GetRotatedFlippedImageRectangle(IDrawingItem item)
|
||||
{
|
||||
const int G = SchematicDrawing.Const.GridSize;
|
||||
|
||||
if (item.Flip)
|
||||
{
|
||||
/// Flipped (mirror) image
|
||||
switch (item.Orient)
|
||||
{
|
||||
default:
|
||||
case Orient.R: return new Rectangle(item.X + OffsX, item.Y + G * SzY - Hgh - OffsY, Wid, Hgh);
|
||||
case Orient.Up: return new Rectangle(item.X + OffsY, item.Y + OffsX, Hgh, Wid);
|
||||
case Orient.L: return new Rectangle(item.X + G * SzX - Wid - OffsX, item.Y + OffsY, Wid, Hgh);
|
||||
case Orient.Dn: return new Rectangle(item.X + G * SzY - Hgh - OffsY, item.Y + G * SzX - Wid - OffsX, Hgh, Wid);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Normal image
|
||||
switch (item.Orient)
|
||||
{
|
||||
default:
|
||||
case Orient.R: return new Rectangle(item.X + OffsX, item.Y + OffsY, Wid, Hgh);
|
||||
case Orient.Up: return new Rectangle(item.X + OffsY, item.Y + G * SzX - Wid - OffsX, Hgh, Wid);
|
||||
case Orient.L: return new Rectangle(item.X + G * SzX - Wid - OffsX, item.Y + G * SzY - Hgh - OffsY, Wid, Hgh);
|
||||
case Orient.Dn: return new Rectangle(item.X + G * SzY - Hgh - OffsY, item.Y + OffsX, Hgh, Wid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get coordinates and orientation of the rotated/flipped node
|
||||
/// </summary>
|
||||
/// <param name="item">Item</param>
|
||||
/// <param name="nodeId">Node id</param>
|
||||
/// <returns>Rotated/flipped node</returns>
|
||||
public Node GetRotatedFlippedNode(IDrawingItem item, int nodeId)
|
||||
{
|
||||
if (Nodes == null || nodeId < 0 || nodeId >= Nodes.Length) return new Node(0, 0, Orient.R);
|
||||
Node node = Nodes[nodeId];
|
||||
|
||||
if (item.Flip)
|
||||
{
|
||||
/// Flipped
|
||||
int ori = (int)node.Orient;
|
||||
if (ori % 2 == 1) ori += 2;
|
||||
ori += (int)item.Orient;
|
||||
switch (item.Orient)
|
||||
{
|
||||
default:
|
||||
case Orient.R: return new Node(node.X, SzY - node.Y, (Orient)(ori % 4));
|
||||
case Orient.Up: return new Node(SzY - node.Y, SzX - node.X, (Orient)(ori % 4));
|
||||
case Orient.L: return new Node(SzX - node.X, node.Y, (Orient)(ori % 4));
|
||||
case Orient.Dn: return new Node(node.Y, node.X, (Orient)(ori % 4));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Normal
|
||||
int ori = (int)item.Orient + (int)node.Orient;
|
||||
switch (item.Orient)
|
||||
{
|
||||
default:
|
||||
case Orient.R: return new Node(node.X, node.Y, (Orient)(ori % 4));
|
||||
case Orient.Up: return new Node(node.Y, SzX - node.X, (Orient)(ori % 4));
|
||||
case Orient.L: return new Node(SzX - node.X, SzY - node.Y, (Orient)(ori % 4));
|
||||
case Orient.Dn: return new Node(SzY - node.Y, node.X, (Orient)(ori % 4));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static DrawingShape[] Shapes;
|
||||
///
|
||||
public static int DrShIx(Shape shape, Sz sz) { return (int)shape * (int)Sz.Count + (int)sz; }
|
||||
///
|
||||
public static DrawingShape GetDrawingShape(Shape shape, Sz sz) { return Shapes[DrShIx(shape, sz)]; }
|
||||
///
|
||||
public static DrawingShape GetDrawingShape(IDrawingItem item) { return (item != null) ? Shapes[DrShIx(item.Shape, item.Sz)] : null; }
|
||||
|
||||
/// <summary>
|
||||
/// Static constructor that initializes Shapes[] array
|
||||
/// </summary>
|
||||
static DrawingShape()
|
||||
{
|
||||
Shapes = new DrawingShape[(int)Shape.Count * (int)Sz.Count];
|
||||
|
||||
/// Ambient
|
||||
Shapes[DrShIx(Shape.Ambient, Sz.S)] = new DrawingShape(Shape.Ambient, Sz.S, 0, 0);
|
||||
Shapes[DrShIx(Shape.Ambient, Sz.M)] = new DrawingShape(Shape.Ambient, Sz.M, 0, 0);
|
||||
Shapes[DrShIx(Shape.Ambient, Sz.L)] = new DrawingShape(Shape.Ambient, Sz.L, 0, 0);
|
||||
Shapes[DrShIx(Shape.Ambient, Sz.XL)] = new DrawingShape(Shape.Ambient, Sz.XL, 0, 0);
|
||||
|
||||
/// Temperature meter
|
||||
Shapes[DrShIx(Shape.TempM, Sz.S)] = new DrawingShape(Shape.TempM, Sz.S, 0, 0);
|
||||
Shapes[DrShIx(Shape.TempM, Sz.M)] = new DrawingShape(Shape.TempM, Sz.M, 0, 0);
|
||||
Shapes[DrShIx(Shape.TempM, Sz.L)] = new DrawingShape(Shape.TempM, Sz.L, 0, 0);
|
||||
Shapes[DrShIx(Shape.TempM, Sz.XL)] = new DrawingShape(Shape.TempM, Sz.XL, 0, 0);
|
||||
|
||||
/// Pressure meter
|
||||
Shapes[DrShIx(Shape.PressM, Sz.S)] = new DrawingShape(Shape.PressM, Sz.S, 0, 0);
|
||||
Shapes[DrShIx(Shape.PressM, Sz.M)] = new DrawingShape(Shape.PressM, Sz.M, 0, 0);
|
||||
Shapes[DrShIx(Shape.PressM, Sz.L)] = new DrawingShape(Shape.PressM, Sz.L, 0, 0);
|
||||
Shapes[DrShIx(Shape.PressM, Sz.XL)] = new DrawingShape(Shape.PressM, Sz.XL, 0, 0);
|
||||
|
||||
/// Valve
|
||||
Shapes[DrShIx(Shape.Valve, Sz.S)] = new DrawingShape(Shape.Valve, Sz.S, 2, 2,
|
||||
new Node[] { new Node(0, 1, Orient.L), new Node(2, 1, Orient.R) },
|
||||
new Edge[] { new Edge(0, 1, 20, RouteCouple.OpenWhen1), new Edge(1, 0, 20, RouteCouple.OpenWhen1) },
|
||||
0, 0, 20, 20,
|
||||
Properties.Resources.Valve_S_open,
|
||||
Properties.Resources.Valve_S_closed,
|
||||
Properties.Resources.Valve_S_vacuum,
|
||||
Properties.Resources.Valve_S_open_dry);
|
||||
Shapes[DrShIx(Shape.Valve, Sz.M)] = new DrawingShape(Shape.Valve, Sz.M, 3, 4,
|
||||
new Node[] { new Node(0, 2, Orient.L), new Node(3, 2, Orient.R) },
|
||||
new Edge[] { new Edge(0, 1, 30, RouteCouple.OpenWhen1), new Edge(1, 0, 30, RouteCouple.OpenWhen1) },
|
||||
0, 5, 30, 30,
|
||||
Properties.Resources.Valve_M_open,
|
||||
Properties.Resources.Valve_M_closed,
|
||||
Properties.Resources.Valve_M_vacuum,
|
||||
Properties.Resources.Valve_M_open_dry);
|
||||
Shapes[DrShIx(Shape.Valve, Sz.L)] = new DrawingShape(Shape.Valve, Sz.L, 4, 4,
|
||||
new Node[] { new Node(0, 2, Orient.L), new Node(4, 2, Orient.R) },
|
||||
new Edge[] { new Edge(0, 1, 40, RouteCouple.OpenWhen1), new Edge(1, 0, 40, RouteCouple.OpenWhen1) },
|
||||
0, 0, 40, 40,
|
||||
Properties.Resources.Valve_L_open,
|
||||
Properties.Resources.Valve_L_closed,
|
||||
Properties.Resources.Valve_L_vacuum,
|
||||
Properties.Resources.Valve_L_open_dry);
|
||||
Shapes[DrShIx(Shape.Valve, Sz.XL)] = new DrawingShape(Shape.Valve, Sz.XL, 5, 6,
|
||||
new Node[] { new Node(0, 3, Orient.L), new Node(5, 3, Orient.R) },
|
||||
new Edge[] { new Edge(0, 1, 50, RouteCouple.OpenWhen1), new Edge(1, 0, 50, RouteCouple.OpenWhen1) },
|
||||
0, 5, 50, 50,
|
||||
Properties.Resources.Valve_XL_open,
|
||||
Properties.Resources.Valve_XL_closed,
|
||||
Properties.Resources.Valve_XL_vacuum,
|
||||
Properties.Resources.Valve_XL_open_dry);
|
||||
/// Diverter
|
||||
Shapes[DrShIx(Shape.Div, Sz.S)] = new DrawingShape(Shape.Div, Sz.S, 2, 2,
|
||||
new Node[] { new Node(2, 0, Orient.Up), new Node(1, 2, Orient.Dn), new Node(3, 2, Orient.Dn) },
|
||||
new Edge[] { new Edge(0, 1, 20), new Edge(0, 2, 20, RouteCouple.OpenWhen1) },
|
||||
0, 0, 40, 20,
|
||||
Properties.Resources.Div_S_tank_wet,
|
||||
Properties.Resources.Div_S_sink_dry,
|
||||
null,
|
||||
Properties.Resources.Div_S_tank_dry,
|
||||
Properties.Resources.Div_S_sink_wet);
|
||||
Shapes[DrShIx(Shape.Div, Sz.M)] = new DrawingShape(Shape.Div, Sz.M, 3, 4,
|
||||
new Node[] { new Node(2, 0, Orient.Up), new Node(1, 3, Orient.Dn), new Node(3, 3, Orient.Dn) },
|
||||
new Edge[] { new Edge(0, 1, 30), new Edge(0, 2, 30, RouteCouple.OpenWhen1) },
|
||||
0, 0, 40, 30,
|
||||
Properties.Resources.Div_M_tank_wet,
|
||||
Properties.Resources.Div_M_sink_dry,
|
||||
null,
|
||||
Properties.Resources.Div_M_tank_dry,
|
||||
Properties.Resources.Div_M_sink_wet);
|
||||
Shapes[DrShIx(Shape.Div, Sz.L)] = new DrawingShape(Shape.Div, Sz.L, 4, 4,
|
||||
new Node[] { new Node(3, 0, Orient.Up), new Node(1, 4, Orient.Dn), new Node(5, 4, Orient.Dn) },
|
||||
new Edge[] { new Edge(0, 1, 40), new Edge(0, 2, 40, RouteCouple.OpenWhen1) },
|
||||
0, 0, 60, 40,
|
||||
Properties.Resources.Div_L_tank_wet,
|
||||
Properties.Resources.Div_L_sink_dry,
|
||||
null,
|
||||
Properties.Resources.Div_L_tank_dry,
|
||||
Properties.Resources.Div_L_sink_wet);
|
||||
Shapes[DrShIx(Shape.Div, Sz.XL)] = new DrawingShape(Shape.Div, Sz.XL, 5, 6,
|
||||
new Node[] { new Node(3, 0, Orient.Up), new Node(1, 5, Orient.Dn), new Node(5, 5, Orient.Dn) },
|
||||
new Edge[] { new Edge(0, 1, 50), new Edge(0, 2, 50, RouteCouple.OpenWhen1) },
|
||||
0, 0, 60, 50,
|
||||
Properties.Resources.Div_XL_tank_wet,
|
||||
Properties.Resources.Div_XL_sink_dry,
|
||||
null,
|
||||
Properties.Resources.Div_XL_tank_dry,
|
||||
Properties.Resources.Div_XL_sink_wet);
|
||||
/// Regulation valve
|
||||
Shapes[DrShIx(Shape.RegV, Sz.S)] = new DrawingShape(Shape.RegV, Sz.S, 2, 2,
|
||||
new Node[] { new Node(0, 1, Orient.L), new Node(2, 1, Orient.R) },
|
||||
new Edge[] { new Edge(0, 1, 20), new Edge(1, 0, 20) },
|
||||
0, 0, 20, 20,
|
||||
Properties.Resources.RegV_S);
|
||||
Shapes[DrShIx(Shape.RegV, Sz.M)] = new DrawingShape(Shape.RegV, Sz.M, 3, 4,
|
||||
new Node[] { new Node(0, 2, Orient.L), new Node(3, 2, Orient.R) },
|
||||
new Edge[] { new Edge(0, 1, 30), new Edge(1, 0, 30) },
|
||||
0, 5, 30, 30,
|
||||
Properties.Resources.RegV_M);
|
||||
Shapes[DrShIx(Shape.RegV, Sz.L)] = new DrawingShape(Shape.RegV, Sz.L, 4, 4,
|
||||
new Node[] { new Node(0, 2, Orient.L), new Node(4, 2, Orient.R) },
|
||||
new Edge[] { new Edge(0, 1, 40), new Edge(1, 0, 40) },
|
||||
0, 0, 40, 40,
|
||||
Properties.Resources.RegV_L);
|
||||
Shapes[DrShIx(Shape.RegV, Sz.XL)] = new DrawingShape(Shape.RegV, Sz.XL, 5, 6,
|
||||
new Node[] { new Node(0, 3, Orient.L), new Node(5, 3, Orient.R) },
|
||||
new Edge[] { new Edge(0, 1, 50), new Edge(1, 0, 50) },
|
||||
0, 5, 50, 50,
|
||||
Properties.Resources.RegV_XL);
|
||||
/// Pump
|
||||
Shapes[DrShIx(Shape.Pump, Sz.S)] = new DrawingShape(Shape.Pump, Sz.S, 2, 2,
|
||||
new Node[] { new Node(0, 1, Orient.L), new Node(2, 1, Orient.R) },
|
||||
new Edge[] { new Edge(0, 1, 20, RouteCouple.OpenWhen1) },
|
||||
0, 0, 20, 20,
|
||||
Properties.Resources.Pump_S_open,
|
||||
Properties.Resources.Pump_S_closed);
|
||||
Shapes[DrShIx(Shape.Pump, Sz.M)] = new DrawingShape(Shape.Pump, Sz.M, 3, 4,
|
||||
new Node[] { new Node(0, 2, Orient.L), new Node(3, 2, Orient.R) },
|
||||
new Edge[] { new Edge(0, 1, 30, RouteCouple.OpenWhen1) },
|
||||
0, 5, 30, 30,
|
||||
Properties.Resources.Pump_M_open,
|
||||
Properties.Resources.Pump_M_closed);
|
||||
Shapes[DrShIx(Shape.Pump, Sz.L)] = new DrawingShape(Shape.Pump, Sz.L, 4, 4,
|
||||
new Node[] { new Node(0, 2, Orient.L), new Node(4, 2, Orient.R) },
|
||||
new Edge[] { new Edge(0, 1, 40, RouteCouple.OpenWhen1) },
|
||||
0, 0, 40, 40,
|
||||
Properties.Resources.Pump_L_open,
|
||||
Properties.Resources.Pump_L_closed);
|
||||
Shapes[DrShIx(Shape.Pump, Sz.XL)] = new DrawingShape(Shape.Pump, Sz.XL, 5, 6,
|
||||
new Node[] { new Node(0, 3, Orient.L), new Node(5, 3, Orient.R) },
|
||||
new Edge[] { new Edge(0, 1, 50, RouteCouple.OpenWhen1) },
|
||||
0, 5, 50, 50,
|
||||
Properties.Resources.Pump_XL_open,
|
||||
Properties.Resources.Pump_XL_closed);
|
||||
/// Pump with frequency inverter
|
||||
Shapes[DrShIx(Shape.PumpFM, Sz.S)] = new DrawingShape(Shape.PumpFM, Sz.S, 2, 2,
|
||||
new Node[] { new Node(0, 1, Orient.L), new Node(2, 1, Orient.R) },
|
||||
new Edge[] { new Edge(0, 1, 20, RouteCouple.OpenWhen1) },
|
||||
0, 0, 20, 20,
|
||||
Properties.Resources.Pump_S_open,
|
||||
Properties.Resources.Pump_S_closed);
|
||||
Shapes[DrShIx(Shape.PumpFM, Sz.M)] = new DrawingShape(Shape.PumpFM, Sz.M, 3, 4,
|
||||
new Node[] { new Node(0, 2, Orient.L), new Node(3, 2, Orient.R) },
|
||||
new Edge[] { new Edge(0, 1, 30, RouteCouple.OpenWhen1) },
|
||||
0, 5, 30, 30,
|
||||
Properties.Resources.Pump_M_open,
|
||||
Properties.Resources.Pump_M_closed);
|
||||
Shapes[DrShIx(Shape.PumpFM, Sz.L)] = new DrawingShape(Shape.PumpFM, Sz.L, 4, 4,
|
||||
new Node[] { new Node(0, 2, Orient.L), new Node(4, 2, Orient.R) },
|
||||
new Edge[] { new Edge(0, 1, 40, RouteCouple.OpenWhen1) },
|
||||
0, 0, 40, 40,
|
||||
Properties.Resources.Pump_L_open,
|
||||
Properties.Resources.Pump_L_closed);
|
||||
Shapes[DrShIx(Shape.PumpFM, Sz.XL)] = new DrawingShape(Shape.PumpFM, Sz.XL, 5, 6,
|
||||
new Node[] { new Node(0, 3, Orient.L), new Node(5, 3, Orient.R) },
|
||||
new Edge[] { new Edge(0, 1, 50, RouteCouple.OpenWhen1) },
|
||||
0, 5, 50, 50,
|
||||
Properties.Resources.Pump_XL_open,
|
||||
Properties.Resources.Pump_XL_closed);
|
||||
/// Flow meter
|
||||
Shapes[DrShIx(Shape.FlowM, Sz.S)] = new DrawingShape(Shape.FlowM, Sz.S, 2, 2,
|
||||
new Node[] { new Node(0, 1, Orient.L), new Node(2, 1, Orient.R) },
|
||||
new Edge[] { new Edge(0, 1, 20) },
|
||||
0, 0, 20, 20,
|
||||
Properties.Resources.FlowM_S);
|
||||
Shapes[DrShIx(Shape.FlowM, Sz.M)] = new DrawingShape(Shape.FlowM, Sz.M, 3, 4,
|
||||
new Node[] { new Node(0, 2, Orient.L), new Node(3, 2, Orient.R) },
|
||||
new Edge[] { new Edge(0, 1, 30) },
|
||||
0, 5, 30, 30,
|
||||
Properties.Resources.FlowM_M);
|
||||
Shapes[DrShIx(Shape.FlowM, Sz.L)] = new DrawingShape(Shape.FlowM, Sz.L, 4, 4,
|
||||
new Node[] { new Node(0, 2, Orient.L), new Node(4, 2, Orient.R) },
|
||||
new Edge[] { new Edge(0, 1, 40) },
|
||||
0, 0, 40, 40,
|
||||
Properties.Resources.FlowM_L);
|
||||
Shapes[DrShIx(Shape.FlowM, Sz.XL)] = new DrawingShape(Shape.FlowM, Sz.XL, 5, 6,
|
||||
new Node[] { new Node(0, 3, Orient.L), new Node(5, 3, Orient.R) },
|
||||
new Edge[] { new Edge(0, 1, 50) },
|
||||
0, 5, 50, 50,
|
||||
Properties.Resources.FlowM_XL);
|
||||
/// Water meter
|
||||
Shapes[DrShIx(Shape.WaterM, Sz.L)] = new DrawingShape(Shape.WaterM, Sz.L, 4, 4,
|
||||
new Node[] { new Node(0, 2, Orient.L), new Node(4, 2, Orient.R) },
|
||||
new Edge[] { new Edge(0, 1, 40), new Edge(1, 0, 40) },
|
||||
0, 0, 40, 40,
|
||||
Properties.Resources.WaterM_L);
|
||||
Shapes[DrShIx(Shape.WaterM, Sz.S)] = Shapes[DrShIx(Shape.WaterM, Sz.L)];
|
||||
Shapes[DrShIx(Shape.WaterM, Sz.M)] = Shapes[DrShIx(Shape.WaterM, Sz.L)];
|
||||
Shapes[DrShIx(Shape.WaterM, Sz.XL)] = Shapes[DrShIx(Shape.WaterM, Sz.L)];
|
||||
|
||||
/// Scale
|
||||
Shapes[DrShIx(Shape.Scale, Sz.S)] = new DrawingShape(Shape.Scale, Sz.S, 6, 8, new Node[] { new Node(3, 8, Orient.Dn) }, null, 0, 0, 60, 80, Properties.Resources.Scale_S);
|
||||
Shapes[DrShIx(Shape.Scale, Sz.M)] = new DrawingShape(Shape.Scale, Sz.M, 8, 9, new Node[] { new Node(4, 9, Orient.Dn) }, null, 0, 0, 80, 90, Properties.Resources.Scale_M);
|
||||
Shapes[DrShIx(Shape.Scale, Sz.L)] = new DrawingShape(Shape.Scale, Sz.L, 12, 11, new Node[] { new Node(6, 11, Orient.Dn) }, null, 0, 0, 120, 110, Properties.Resources.Scale_L);
|
||||
Shapes[DrShIx(Shape.Scale, Sz.XL)] = new DrawingShape(Shape.Scale, Sz.XL, 16, 13, new Node[] { new Node(8, 13, Orient.Dn) }, null, 0, 0, 160, 130, Properties.Resources.Scale_XL);
|
||||
|
||||
/// Tank
|
||||
Shapes[DrShIx(Shape.Tank, Sz.S)] = new DrawingShape(Shape.Tank, Sz.S, 10, 8, new Node[] { new Node(0, 6, Orient.L) }, null, 0, 0, 100, 80, Properties.Resources.Tank_S);
|
||||
Shapes[DrShIx(Shape.Tank, Sz.M)] = new DrawingShape(Shape.Tank, Sz.M, 12, 9, new Node[] { new Node(0, 7, Orient.L) }, null, 0, 0, 120, 90, Properties.Resources.Tank_M);
|
||||
Shapes[DrShIx(Shape.Tank, Sz.L)] = new DrawingShape(Shape.Tank, Sz.L, 15, 11, new Node[] { new Node(0, 9, Orient.L) }, null, 0, 0, 150, 110, Properties.Resources.Tank_L);
|
||||
Shapes[DrShIx(Shape.Tank, Sz.XL)] = new DrawingShape(Shape.Tank, Sz.XL, 20, 13, new Node[] { new Node(0, 11, Orient.L) }, null, 0, 0, 200, 130, Properties.Resources.Tank_XL);
|
||||
|
||||
/// Junction
|
||||
Shapes[DrShIx(Shape.Junction, Sz.None)] = new DrawingShape(Shape.Junction, Sz.None, 0, 0, new Node[] { new Node(0, 0, Orient.R) });
|
||||
Shapes[DrShIx(Shape.Junction, Sz.S)] = new DrawingShape(Shape.Junction, Sz.S, 2, 2,
|
||||
new Node[] { new Node(1, 1, Orient.R) }, null,
|
||||
0, 0, 20, 20,
|
||||
Properties.Resources.Junction_S_wet,
|
||||
Properties.Resources.Junction_S_dry,
|
||||
Properties.Resources.Junction_S_vacuum);
|
||||
Shapes[DrShIx(Shape.Junction, Sz.M)] = new DrawingShape(Shape.Junction, Sz.M, 2, 2,
|
||||
new Node[] { new Node(1, 1, Orient.R) }, null,
|
||||
0, 0, 20, 20,
|
||||
Properties.Resources.Junction_M_wet,
|
||||
Properties.Resources.Junction_M_dry,
|
||||
Properties.Resources.Junction_M_vacuum);
|
||||
Shapes[DrShIx(Shape.Junction, Sz.L)] = new DrawingShape(Shape.Junction, Sz.L, 2, 2,
|
||||
new Node[] { new Node(1, 1, Orient.R) }, null,
|
||||
0, 0, 20, 20,
|
||||
Properties.Resources.Junction_L_wet,
|
||||
Properties.Resources.Junction_L_dry,
|
||||
Properties.Resources.Junction_L_vacuum);
|
||||
Shapes[DrShIx(Shape.Junction, Sz.XL)] = new DrawingShape(Shape.Junction, Sz.XL, 2, 2,
|
||||
new Node[] { new Node(1, 1, Orient.R) }, null,
|
||||
0, 0, 20, 20,
|
||||
Properties.Resources.Junction_XL_wet,
|
||||
Properties.Resources.Junction_XL_dry,
|
||||
Properties.Resources.Junction_XL_vacuum);
|
||||
/// Knee
|
||||
Shapes[DrShIx(Shape.Knee, Sz.S)] = new DrawingShape(Shape.Knee, Sz.S, 2, 2,
|
||||
new Node[] { new Node(0, 1, Orient.L), new Node(1, 0, Orient.Up) },
|
||||
new Edge[] { new Edge(0, 1, 18), new Edge(1, 0, 18) },
|
||||
0, 0, 20, 20,
|
||||
Properties.Resources.Knee_S_wet,
|
||||
Properties.Resources.Knee_S_dry,
|
||||
Properties.Resources.Knee_S_vacuum);
|
||||
Shapes[DrShIx(Shape.Knee, Sz.M)] = new DrawingShape(Shape.Knee, Sz.M, 2, 2,
|
||||
new Node[] { new Node(0, 1, Orient.L), new Node(1, 0, Orient.Up) },
|
||||
new Edge[] { new Edge(0, 1, 18), new Edge(1, 0, 18) },
|
||||
0, 0, 20, 20,
|
||||
Properties.Resources.Knee_M_wet,
|
||||
Properties.Resources.Knee_M_dry,
|
||||
Properties.Resources.Knee_M_vacuum);
|
||||
Shapes[DrShIx(Shape.Knee, Sz.L)] = new DrawingShape(Shape.Knee, Sz.L, 2, 2,
|
||||
new Node[] { new Node(0, 1, Orient.L), new Node(1, 0, Orient.Up) },
|
||||
new Edge[] { new Edge(0, 1, 17), new Edge(1, 0, 17) },
|
||||
0, 0, 20, 20,
|
||||
Properties.Resources.Knee_L_wet,
|
||||
Properties.Resources.Knee_L_dry,
|
||||
Properties.Resources.Knee_L_vacuum);
|
||||
Shapes[DrShIx(Shape.Knee, Sz.XL)] = new DrawingShape(Shape.Knee, Sz.XL, 4, 4,
|
||||
new Node[] { new Node(0, 2, Orient.L), new Node(2, 0, Orient.Up) },
|
||||
new Edge[] { new Edge(0, 1, 36), new Edge(1, 0, 36) },
|
||||
0, 0, 40, 40,
|
||||
Properties.Resources.Knee_XL_wet,
|
||||
Properties.Resources.Knee_XL_dry,
|
||||
Properties.Resources.Knee_XL_vacuum);
|
||||
/// Vacuum
|
||||
Shapes[DrShIx(Shape.Vacuum, Sz.L)] = new DrawingShape(Shape.Vacuum, Sz.L, 6, 2,
|
||||
new Node[] { new Node(0, 1, Orient.L), new Node(6, 1, Orient.R), new Node(4, 0, Orient.Up) },
|
||||
new Edge[] { new Edge(0, 1, 60), new Edge(1, 0, 60), new Edge(0, 2, Const.Vacuum) },
|
||||
0, 0, 60, 20,
|
||||
Properties.Resources.Vacuum_L_wet,
|
||||
Properties.Resources.Vacuum_L_dry);
|
||||
Shapes[DrShIx(Shape.Vacuum, Sz.S)] = Shapes[DrShIx(Shape.Vacuum, Sz.L)];
|
||||
Shapes[DrShIx(Shape.Vacuum, Sz.M)] = Shapes[DrShIx(Shape.Vacuum, Sz.L)];
|
||||
Shapes[DrShIx(Shape.Vacuum, Sz.XL)] = Shapes[DrShIx(Shape.Vacuum, Sz.L)];
|
||||
|
||||
/// Control board UNI
|
||||
Shapes[DrShIx(Shape.UniCB, Sz.L)] = new DrawingShape(Shape.UniCB, Sz.L, 2, 2, new Node[] { }, null, 0, 0, 20, 20,
|
||||
Properties.Resources.UniCB_M_error,
|
||||
Properties.Resources.UniCB_M_on);
|
||||
Shapes[DrShIx(Shape.UniCB, Sz.S)] = Shapes[DrShIx(Shape.UniCB, Sz.L)];
|
||||
Shapes[DrShIx(Shape.UniCB, Sz.M)] = Shapes[DrShIx(Shape.UniCB, Sz.L)];
|
||||
Shapes[DrShIx(Shape.UniCB, Sz.XL)] = Shapes[DrShIx(Shape.UniCB, Sz.L)];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
|
||||
namespace SchematicDrawing
|
||||
{
|
||||
public class Edge
|
||||
{
|
||||
public readonly int NodeId1;
|
||||
public readonly int NodeId2;
|
||||
public readonly int DefaultDist;
|
||||
public readonly RouteCouple RouteCouple;
|
||||
|
||||
public Edge(int nodeId1, int nodeId2, int defaultDist = 20, RouteCouple routeCouple = RouteCouple.None)
|
||||
{
|
||||
NodeId1 = nodeId1;
|
||||
NodeId2 = nodeId2;
|
||||
DefaultDist = defaultDist;
|
||||
RouteCouple = routeCouple;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
using Dirichlet.Numerics;
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
|
||||
namespace SchematicDrawing
|
||||
{
|
||||
public static class Const
|
||||
{
|
||||
public const int GridSize = 10;
|
||||
public const int SecondaryStart = 10000;
|
||||
public const int Vacuum = 1000000;
|
||||
}
|
||||
|
||||
public enum Element
|
||||
{
|
||||
None = 0,
|
||||
Body = 1, /// Item body (component image)
|
||||
Label = 2, /// Item label
|
||||
MeasuredVal = 4, /// Item measured value
|
||||
Setpoint = 8, /// Item setpoint
|
||||
Node = 16, /// A node of an item
|
||||
Pipe = 32, /// Pipe between two nodes
|
||||
}
|
||||
|
||||
public enum Shape
|
||||
{
|
||||
Ambient,
|
||||
Cross,
|
||||
Div,
|
||||
FlowM,
|
||||
Junction,
|
||||
Knee,
|
||||
PressM,
|
||||
Pump,
|
||||
PumpFM,
|
||||
RegV,
|
||||
Scale,
|
||||
Sink,
|
||||
Tank,
|
||||
Tee,
|
||||
TempM,
|
||||
Vacuum,
|
||||
Valve,
|
||||
WaterM,
|
||||
UniCB,
|
||||
Count
|
||||
}
|
||||
|
||||
public enum Sz
|
||||
{
|
||||
None,
|
||||
S,
|
||||
M,
|
||||
L,
|
||||
XL,
|
||||
Count,
|
||||
}
|
||||
|
||||
public enum Orient
|
||||
{
|
||||
R,
|
||||
Dn,
|
||||
L,
|
||||
Up,
|
||||
Count,
|
||||
}
|
||||
|
||||
public enum RouteCouple
|
||||
{
|
||||
None,
|
||||
OpenWhen1,
|
||||
ClosedWhen1,
|
||||
}
|
||||
|
||||
public static class Utils
|
||||
{
|
||||
/// <summary>
|
||||
/// Return coordinates of the vector in direction Orient
|
||||
/// </summary>
|
||||
/// <param name="orient">Orient</param>
|
||||
/// <returns>Vector</returns>
|
||||
public static Point GetVect(Orient orient)
|
||||
{
|
||||
switch (orient)
|
||||
{
|
||||
default:
|
||||
case Orient.R: return new Point(1, 0);
|
||||
case Orient.Up: return new Point(0, -1);
|
||||
case Orient.L: return new Point(-1, 0);
|
||||
case Orient.Dn: return new Point(0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return coordinates of the vector perpendicular to Orient
|
||||
/// </summary>
|
||||
/// <param name="orient">Orient</param>
|
||||
/// <returns>Perpendicular vector</returns>
|
||||
public static Point GetNormalVect(Orient orient)
|
||||
{
|
||||
switch (orient)
|
||||
{
|
||||
default:
|
||||
case Orient.R: return new Point(0, 1);
|
||||
case Orient.Up: return new Point(1, 0);
|
||||
case Orient.L: return new Point(0, -1);
|
||||
case Orient.Dn: return new Point(-1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true when item is hidden (both X and Y coordinates are 0)
|
||||
/// </summary>
|
||||
/// <param name="item">Drawing item</param>
|
||||
/// <returns>true when hidden</returns>
|
||||
public static bool IsHidden(IDrawingItem item)
|
||||
{
|
||||
return (item.X == 0) && (item.Y == 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates distances of graph edges of IRouteBasedDrewingItem (valve, pump, ...) after route chanage.
|
||||
/// </summary>
|
||||
/// <param name="route">Route</param>
|
||||
/// <param name="item">Item</param>
|
||||
public static void UpdateGraphEdges(UInt128 route, IRouteBasedDrawingItem item)
|
||||
{
|
||||
bool routeBit = (route & (((UInt128)1) << item.BitNr)) != 0;
|
||||
foreach (var gedge in item.EdgesToSet) gedge.UpdateFromRoute(item.Inverted ? (!routeBit) : routeBit);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
|
||||
namespace SchematicDrawing
|
||||
{
|
||||
public class GEdge
|
||||
{
|
||||
public readonly GNode StartNode;
|
||||
public readonly GNode EndNode;
|
||||
public readonly int DefaultDist;
|
||||
public readonly RouteCouple RouteCouple;
|
||||
|
||||
public int Dist;
|
||||
|
||||
public GEdge(GNode startNode, GNode endNode, int defaultDist, RouteCouple routeCouple)
|
||||
{
|
||||
StartNode = startNode;
|
||||
EndNode = endNode;
|
||||
DefaultDist = defaultDist;
|
||||
RouteCouple = routeCouple;
|
||||
|
||||
Dist = (routeCouple == RouteCouple.None || routeCouple == RouteCouple.ClosedWhen1) ? DefaultDist : int.MaxValue;
|
||||
}
|
||||
|
||||
public void UpdateFromRoute(bool routeBit)
|
||||
{
|
||||
switch (RouteCouple)
|
||||
{
|
||||
case RouteCouple.OpenWhen1:
|
||||
Dist = routeBit ? DefaultDist : int.MaxValue; break;
|
||||
case RouteCouple.ClosedWhen1:
|
||||
Dist = routeBit ? int.MaxValue : DefaultDist; break;
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0}/{1}-{2}/{3} dist={4}", StartNode.Item.Name, StartNode.NodeId, EndNode.Item.Name, EndNode.NodeId, Dist);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SchematicDrawing
|
||||
{
|
||||
public class GNode
|
||||
{
|
||||
/// Graph node properties
|
||||
public IDrawingItem Item;
|
||||
public int NodeId;
|
||||
public readonly IList<GEdge> Edges;
|
||||
|
||||
/// Distance from a start node
|
||||
public int Dist;
|
||||
|
||||
/// Minimal heap index
|
||||
public int HeapIx;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="item">Item</param>
|
||||
/// <param name="nodeId"Node ID></param>
|
||||
public GNode(IDrawingItem item, int nodeId)
|
||||
{
|
||||
Item = item;
|
||||
NodeId = nodeId;
|
||||
Edges = new List<GEdge>();
|
||||
Dist = int.MaxValue;
|
||||
}
|
||||
|
||||
public void AddEdge(GEdge edge)
|
||||
{
|
||||
Edges.Add(edge);
|
||||
}
|
||||
|
||||
public GNode Reset(int heapIx, int dist = int.MaxValue)
|
||||
{
|
||||
HeapIx = heapIx;
|
||||
Dist = dist;
|
||||
return this;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0}/{1} dist={2}", Item.Name, NodeId, Dist);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SchematicDrawing
|
||||
{
|
||||
public class Graph
|
||||
{
|
||||
public bool Completed;
|
||||
|
||||
IList<GNode> nodes;
|
||||
GNode startNode;
|
||||
int secondaryStartNodesCount;
|
||||
|
||||
MinHeap minHeap;
|
||||
GNode currentNode;
|
||||
|
||||
public Graph()
|
||||
{
|
||||
nodes = new List<GNode>();
|
||||
startNode = null;
|
||||
secondaryStartNodesCount = 0;
|
||||
minHeap = new MinHeap();
|
||||
Completed = false;
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
nodes.Clear();
|
||||
startNode = null;
|
||||
secondaryStartNodesCount = 0;
|
||||
Completed = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add a node to the list of graph nodes
|
||||
/// </summary>
|
||||
/// <param name="node">Graph node</param>
|
||||
public void AddNode(GNode node, bool isStartNode = false, bool isSecondaryStartNode = false)
|
||||
{
|
||||
if (isStartNode && startNode == null)
|
||||
{
|
||||
startNode = node;
|
||||
nodes.Insert(0, node);
|
||||
}
|
||||
else if (isStartNode || isSecondaryStartNode)
|
||||
{
|
||||
secondaryStartNodesCount++;
|
||||
nodes.Insert(startNode != null ? 1 : 0, node);
|
||||
}
|
||||
else
|
||||
{
|
||||
nodes.Add(node);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add an edge to the list of edges of node1.
|
||||
/// </summary>
|
||||
/// <param name="node1">Node 1 (start)</param>
|
||||
/// <param name="node2">NOde 2 (end)</param>
|
||||
/// <param name="defaultDist">Default distance (when closed)</param>
|
||||
/// <param name="routeCouple">Way the route affects this edge</param>
|
||||
/// <returns>Added graph edge</returns>
|
||||
public GEdge AddEdge(GNode node1, GNode node2, int defaultDist, RouteCouple routeCouple = RouteCouple.None)
|
||||
{
|
||||
GEdge gedge = new GEdge(node1, node2, defaultDist, routeCouple);
|
||||
node1.AddEdge(gedge);
|
||||
return gedge;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Run Dijkstra shortest path algorithm to determine schematic drawing coloring
|
||||
/// </summary>
|
||||
/// <param name="startNode">Start node</param>
|
||||
/// <param name="secondaryStartNodes">List of secondary start nodes</param>
|
||||
public void RunDijkstraAlgo()
|
||||
{
|
||||
if (nodes == null || startNode == null) return;
|
||||
|
||||
/// Reset all nodes
|
||||
minHeap.ResetAndBuild(nodes, secondaryStartNodesCount);
|
||||
|
||||
currentNode = minHeap.ExtractMinNode();
|
||||
do
|
||||
{
|
||||
/// Consider all unvisited neighbors of the current node
|
||||
foreach (var e in currentNode.Edges)
|
||||
{
|
||||
int distViaCurrNode = (e.Dist == int.MaxValue) ? int.MaxValue : currentNode.Dist + e.Dist;
|
||||
if (distViaCurrNode < e.EndNode.Dist)
|
||||
{
|
||||
e.EndNode.Dist = distViaCurrNode;
|
||||
minHeap.SiftUp(e.EndNode.HeapIx);
|
||||
}
|
||||
}
|
||||
|
||||
currentNode = minHeap.ExtractMinNode();
|
||||
}
|
||||
while (currentNode.Dist < int.MaxValue && currentNode != null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
namespace SchematicDrawing
|
||||
{
|
||||
public interface IDrawingItCmpnt
|
||||
{
|
||||
IDrawingItem DrawingItem { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
///
|
||||
/// Copyright (c) 2020-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
namespace SchematicDrawing
|
||||
{
|
||||
public interface IDrawingItCmpntWithMeasuredVal : IDrawingItCmpnt
|
||||
{
|
||||
bool MsrmntAvailable { get; }
|
||||
double MeasuredVal { get; }
|
||||
string AltString { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
namespace SchematicDrawing
|
||||
{
|
||||
public interface IDrawingItCmpntWithSetpoint : IDrawingItCmpnt
|
||||
{
|
||||
double SetpointVal { get; set; }
|
||||
void IncreaseSetpoint();
|
||||
void DecreaseSetpoint();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using Config;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SchematicDrawing
|
||||
{
|
||||
public interface IDrawingItem
|
||||
{
|
||||
///
|
||||
/// Schematic drawing parameters
|
||||
///
|
||||
string Name { get; } /// Unique name
|
||||
string ClassName { get; }
|
||||
|
||||
Shape Shape { get; set; } /// Image
|
||||
int X { get; set; }
|
||||
int Y { get; set; }
|
||||
Sz Sz { get; set; }
|
||||
Orient Orient { get; set; }
|
||||
bool Flip { get; set; }
|
||||
|
||||
int LblX { get; set; } /// Label
|
||||
int LblY { get; set; }
|
||||
Orient LblOrient { get; set; }
|
||||
|
||||
IList<GNode> GNodes { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
///
|
||||
/// Copyright (c) 2020-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
namespace SchematicDrawing
|
||||
{
|
||||
public interface IDrawingItemWithMeasuredVal : IDrawingItem
|
||||
{
|
||||
int MsrdX { get; set; }
|
||||
int MsrdY { get; set; }
|
||||
Orient MsrdOrient { get; set; }
|
||||
|
||||
string MsrdFormat { get; }
|
||||
Config.Unit MsrdUnit { get; }
|
||||
double MsrdValLimLo { get; }
|
||||
double MsrdValLimHi { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
///
|
||||
/// Copyright (c) 2020-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
namespace SchematicDrawing
|
||||
{
|
||||
public interface IDrawingItemWithSetpoint : IDrawingItem
|
||||
{
|
||||
int SetpX { get; set; }
|
||||
int SetpY { get; set; }
|
||||
Orient SetpOrient { get; set; }
|
||||
|
||||
string SetpFormat { get; }
|
||||
Config.Unit SetpUnit { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
namespace SchematicDrawing
|
||||
{
|
||||
public interface IRouteBasedDrawingItem : IDrawingItem
|
||||
{
|
||||
int BitNr { get; }
|
||||
bool Inverted { get; }
|
||||
|
||||
IList<GEdge> EdgesToSet { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Drawing;
|
||||
|
||||
namespace SchematicDrawing
|
||||
{
|
||||
public class ItemElementRect
|
||||
{
|
||||
public IDrawingItem Item;
|
||||
public Element Element;
|
||||
public Rectangle Rect;
|
||||
|
||||
public ItemElementRect(IDrawingItem item, Element element, Rectangle rect)
|
||||
{
|
||||
Item = item;
|
||||
Element = element;
|
||||
Rect = rect;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SchematicDrawing
|
||||
{
|
||||
public class MinHeap
|
||||
{
|
||||
GNode[] heap; /// Minimum heap, a binary tree in form of an array
|
||||
int heapSize; /// Heap size (not necessarily a size of the array heap[])
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
public MinHeap()
|
||||
{
|
||||
heap = null;
|
||||
heapSize = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reset nodes and build the initial minimum heap tree.
|
||||
///
|
||||
/// First node on the list is the start node (mostly the main water tank),
|
||||
/// followed by 'secondaryStartNodesCount' secondary start nodes (typically
|
||||
/// tanks above scales), followed by all remaining nodes of the drawing.
|
||||
/// In this way the heap is heapified from the beginning.
|
||||
/// </summary>
|
||||
/// <param name="nodes">Graph nodes</param>
|
||||
/// <param name="secondaryStartNodesCount">Number of secondary start nodes</param>
|
||||
public void ResetAndBuild(IList<GNode> nodes, int secondaryStartNodesCount)
|
||||
{
|
||||
if (nodes == null || nodes.Count == 0) return;
|
||||
|
||||
if (heapSize != nodes.Count)
|
||||
{
|
||||
heapSize = nodes.Count;
|
||||
heap = new GNode[nodes.Count];
|
||||
}
|
||||
|
||||
heap[0] = nodes[0].Reset(0, 0);
|
||||
for (int i = 1; i <= secondaryStartNodesCount; i++)
|
||||
{
|
||||
heap[i] = nodes[i].Reset(i, Const.SecondaryStart);
|
||||
}
|
||||
for (int i = secondaryStartNodesCount + 1; i < nodes.Count; i++)
|
||||
{
|
||||
heap[i] = nodes[i].Reset(i, int.MaxValue);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the node with minimal distance at the top of the heap binary tree.
|
||||
/// This node is removed from the heap, replaced by the last node and the heap is 'Heapified'.
|
||||
/// </summary>
|
||||
/// <returns>Node with minimal distance</returns>
|
||||
public GNode ExtractMinNode()
|
||||
{
|
||||
GNode minNode = heap[0];
|
||||
if (--heapSize > 0)
|
||||
{
|
||||
heap[0] = heap[heapSize]; /// Swap with the last one
|
||||
heap[0].HeapIx = 0;
|
||||
heap[heapSize] = minNode;
|
||||
SiftDown(0); /// Heapify the heap, sift down the swapped (formerly the last) item
|
||||
}
|
||||
return minNode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sift up the node in the minimum heap binary tree.
|
||||
/// Function is called when distance of a node in the graph is updated.
|
||||
/// As the distance is always decreased, the node sifts up in the tree.
|
||||
/// </summary>
|
||||
/// <param name="heapIx">Index of the node to sift up</param>
|
||||
public void SiftUp(int heapIx)
|
||||
{
|
||||
if (heapIx == 0) return;
|
||||
int parentIx = (heapIx - 1) / 2;
|
||||
if (heap[heapIx].Dist < heap[parentIx].Dist)
|
||||
{
|
||||
SwapNodes(heapIx, parentIx);
|
||||
SiftUp(parentIx);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sift down the node in the minimum heap binary tree.
|
||||
/// Function is called when node at the top of the tree is extracted and replaced
|
||||
/// by the last node. This last node is then sift down according to its distance.
|
||||
/// </summary>
|
||||
/// <param name="heapIx">Index of the node to sift down</param>
|
||||
void SiftDown(int heapIx)
|
||||
{
|
||||
int leftIx = 2 * heapIx + 1;
|
||||
if (leftIx < heapSize)
|
||||
{
|
||||
int minIx = heapIx;
|
||||
if (heap[leftIx].Dist < heap[minIx].Dist)
|
||||
{
|
||||
minIx = leftIx;
|
||||
}
|
||||
|
||||
int rightIx = 2 * heapIx + 2;
|
||||
if (rightIx < heapSize && heap[rightIx].Dist < heap[minIx].Dist)
|
||||
{
|
||||
minIx = rightIx;
|
||||
}
|
||||
|
||||
if (minIx != heapIx)
|
||||
{
|
||||
SwapNodes(heapIx, minIx);
|
||||
SiftDown(minIx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Swap two nodes in the minimum heap binary tree.
|
||||
/// </summary>
|
||||
/// <param name="ix1">Index of the 1st node</param>
|
||||
/// <param name="ix2">Index of the 2nd node</param>
|
||||
void SwapNodes(int ix1, int ix2)
|
||||
{
|
||||
GNode swap = heap[ix1];
|
||||
heap[ix1] = heap[ix2];
|
||||
heap[ix1].HeapIx = ix1;
|
||||
heap[ix2] = swap;
|
||||
heap[ix2].HeapIx = ix2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
///
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
|
||||
namespace SchematicDrawing
|
||||
{
|
||||
public class Node
|
||||
{
|
||||
public int X;
|
||||
public int Y;
|
||||
public Orient Orient;
|
||||
|
||||
public Node(int x, int y, Orient orient)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Orient = orient;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 298 B |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user