Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ac85a3468 | ||
|
|
202b5dee96 | ||
|
|
fd0d7dcf7b | ||
|
|
997e0d2a6b | ||
|
|
51e1e5721c | ||
|
|
34c3fa26c9 | ||
|
|
5e3e70f43a | ||
|
|
18880dc04d | ||
|
|
2673584113 | ||
|
|
e90967b6ed | ||
|
|
46489224cf | ||
|
|
d8fc4a4c36 | ||
|
|
ae18e15fba | ||
|
|
352ed581c2 | ||
|
|
b5572c20e3 | ||
|
|
1d50b7206d | ||
|
|
331803e51d | ||
|
|
ed25f1a360 | ||
|
|
111fd8d96c | ||
|
|
c86bafd779 | ||
|
|
c472bfc99d | ||
|
|
b8eaaeb64c | ||
|
|
b09a057b02 | ||
|
|
9f19df7f3f | ||
|
|
db9506290a | ||
|
|
4505759115 | ||
|
|
d15497f2b0 | ||
|
|
ec9edbf04c | ||
|
|
31b167cd62 | ||
|
|
1d33b9651b | ||
|
|
3bf8b4fe54 | ||
|
|
2e75d91adc | ||
|
|
55d9d58978 | ||
|
|
241bb3aff1 | ||
|
|
0fa8057324 | ||
|
|
4609abe6ea | ||
|
|
cb6d9538c8 | ||
|
|
8ec062b165 | ||
|
|
b2df02dd1b | ||
|
|
c403f9345f | ||
|
|
b97b795c93 | ||
|
|
4a1c6ef031 | ||
|
|
40f3aacd32 | ||
|
|
8e9344cc47 | ||
|
|
b3160799c8 | ||
|
|
66852682bf | ||
|
|
3399b07fc0 | ||
|
|
844f5573dc | ||
|
|
e9cc77a2d5 | ||
|
|
2981ab2a5f | ||
|
|
a3227f356f | ||
|
|
0d8210614d | ||
|
|
97df1250dc | ||
|
|
11eff5c962 | ||
|
|
f95f961a5d | ||
|
|
4db2f475cd | ||
|
|
9dbbf03acd | ||
|
|
d8ed144dee | ||
|
|
99cd84fb2a | ||
|
|
de0b84076f | ||
|
|
18506390fa | ||
|
|
fd9a08406f | ||
|
|
6226fbedfc | ||
|
|
86fb107e73 | ||
|
|
b32329cdf7 | ||
|
|
38c7d43a8a | ||
|
|
c72fb29f36 | ||
|
|
0dd5c469f5 | ||
|
|
df1b4527ba | ||
|
|
6da5bd92ec | ||
|
|
d4ac2453b8 | ||
|
|
59c1cb76f0 | ||
|
|
89b47860a5 | ||
|
|
646cebe877 | ||
|
|
f8b8c3bfec | ||
|
|
723c077c64 | ||
|
|
7e64c9299c | ||
|
|
ea9c0615ee | ||
|
|
428d100f6c | ||
|
|
8846f16546 | ||
|
|
37ec839807 | ||
|
|
5f44fd4bdb | ||
|
|
5f5063663c | ||
|
|
75f0cb2930 | ||
|
|
1f581a72c1 | ||
|
|
705f4de0b0 | ||
|
|
6ec3b7b287 | ||
|
|
9758411519 | ||
|
|
e1a185efdf | ||
|
|
a2556bec35 | ||
|
|
483e2b4eb7 | ||
|
|
f1d46782d3 | ||
|
|
d1adde9b63 | ||
|
|
95c7257d6f | ||
|
|
91392f9452 | ||
|
|
b145c71ee3 | ||
|
|
1cf2eb8e06 | ||
|
|
037a5be3b3 | ||
|
|
0fc7d831b0 | ||
|
|
abf54f765f | ||
|
|
0e7ba933d8 | ||
|
|
fa03c09f09 | ||
|
|
3ac90ee622 | ||
|
|
774f561fcf | ||
|
|
3a626740c7 | ||
|
|
97ce601d31 | ||
|
|
49d4cf1ac0 | ||
|
|
dcb0ee680c | ||
|
|
e94eb83c1d | ||
|
|
ff3de55593 | ||
|
|
1e50cc6fb7 | ||
|
|
7b31c6b2b6 | ||
|
|
38ee1cc067 | ||
|
|
e27dfe570d | ||
|
|
b2f2f595e5 | ||
|
|
67f4683026 | ||
|
|
42f8d02a68 | ||
|
|
14717d5d46 | ||
|
|
450530a707 | ||
|
|
adf30d615b | ||
|
|
610387e071 | ||
|
|
114e628305 | ||
|
|
68d01aab14 | ||
|
|
eaf0e2cf22 | ||
|
|
02ec8d8124 | ||
|
|
1dc328746d | ||
|
|
5bb94666a4 | ||
|
|
c1f23b8481 | ||
|
|
70c11ad6d9 | ||
|
|
3a8c6b4d3e | ||
|
|
b8f1b9293a | ||
|
|
6558951857 | ||
|
|
54e964ffde | ||
|
|
a5b270eec8 | ||
|
|
6f9c6596d5 | ||
|
|
d99c53bc8e | ||
|
|
3496fcbbba | ||
|
|
77a29dadfc |
@@ -4,6 +4,10 @@ Config/bin/
|
||||
Config/obj/
|
||||
DataStreamInterface/bin/
|
||||
DataStreamInterface/obj/
|
||||
DataStreamInterfaceTest/bin/
|
||||
DataStreamInterfaceTest/obj/
|
||||
DataStreamMeter/bin/
|
||||
DataStreamMeter/obj/
|
||||
Decrypt/bin/
|
||||
Decrypt/obj/
|
||||
DeviceTest/bin/
|
||||
@@ -22,8 +26,12 @@ 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/
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
||||
namespace Common
|
||||
{
|
||||
public class BackgroundBeep
|
||||
{
|
||||
static Thread beepThread;
|
||||
static AutoResetEvent signalBeep;
|
||||
|
||||
static BackgroundBeep()
|
||||
{
|
||||
signalBeep = new AutoResetEvent(false);
|
||||
beepThread = new Thread(() =>
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
signalBeep.WaitOne(); /// waits for an event
|
||||
Console.Beep(500, 400); /// frequency (Hz), duration (ms)
|
||||
}
|
||||
}, 1);
|
||||
beepThread.IsBackground = true;
|
||||
beepThread.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes one beep in a separate thread (non-blocking function)
|
||||
/// </summary>
|
||||
public static void Beep()
|
||||
{
|
||||
signalBeep.Set();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,7 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BackgroundBeep.cs" />
|
||||
<Compile Include="SerializableDictionary.cs" />
|
||||
<Compile Include="UIControls\CoolButtonCtrl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using System;
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
|
||||
+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;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK</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;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK</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>
|
||||
|
||||
+36
-54
@@ -8,31 +8,43 @@ namespace Config
|
||||
public const string AdminPassword = "staratura";
|
||||
public const string SQLiteDbFName = "SQLite.db";
|
||||
|
||||
#if MUNICH
|
||||
#if 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 = 1;
|
||||
#elif 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
|
||||
#elif MALTA_WSD25
|
||||
public const int WMsCount = 6;
|
||||
public const int LineSize = 6;
|
||||
public const int CompoundWMsCount = 1;
|
||||
public const int CompoundWMsCount = 0;
|
||||
public const int HeatMetersCount = 0;
|
||||
public const int MaxPartNr = 3;
|
||||
public const int MaxPartNr = 1;
|
||||
#elif BADGER_MALA_TRAT || BERLIN || FUZHOU_150 || FUZHOU_300 || GELSENWASSER || GENESIS || IZRAEL_200 || PETERSBURG_200 || SENTEC || SLM_150 || TORINO_50 || TURA_SPECIAL
|
||||
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 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
|
||||
#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 DEWA_300 || FUZHOU_100 || ROMA_200 || LUXEMBURG_40
|
||||
public const int WMsCount = 10;
|
||||
public const int LineSize = 10;
|
||||
public const int CompoundWMsCount = 1;
|
||||
@@ -44,63 +56,33 @@ namespace Config
|
||||
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;
|
||||
#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 = WMsCount / LineSize;
|
||||
#elif TORINO_50 || BADGER_MALA_TRAT || BERLIN || GELSENWASSER
|
||||
public const int WMsCount = 6;
|
||||
public const int LineSize = 6;
|
||||
public const int MaxPartNr = 4;
|
||||
#elif SLM_50
|
||||
public const int WMsCount = 12;
|
||||
public const int LineSize = 12;
|
||||
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 HeatMetersCount = 6;
|
||||
public const int MaxPartNr = WMsCount / LineSize;
|
||||
#elif ALZIR_25 || BAHRAIN_50 || CEVAK_40 || FEWA_50 || FILIPINY_50 || FUZHOU_50 || HONGKONG_50 || IZRAEL_25 || JUZNA_AFRIKA_50 || KEMPNO_50 || KRAKOW_50 || MILWAUKEE || MURES_40 || PETERSBURG_50 || TORUN_50 || WARSAW_50 || ZAMBIA || ZODINO
|
||||
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 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;
|
||||
#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;
|
||||
|
||||
@@ -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}",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -21,7 +21,7 @@ namespace Config.Entities
|
||||
public virtual string Diverter { get; set; }
|
||||
public virtual string TempDiv { get; set; }
|
||||
public virtual string Scale { get; set; }
|
||||
public virtual string EmptyTankValve { get; set; } /// Not used anywhere
|
||||
public virtual string RegulValvesPct { get; set; } /// Positions of regulation valves in % separated by ';'
|
||||
|
||||
/// Valves
|
||||
public virtual string ValvesOpen { get; set; }
|
||||
@@ -56,7 +56,7 @@ namespace Config.Entities
|
||||
result.Diverter = Diverter;
|
||||
result.TempDiv = TempDiv;
|
||||
result.Scale = Scale;
|
||||
result.EmptyTankValve = EmptyTankValve;
|
||||
result.RegulValvesPct = RegulValvesPct;
|
||||
result.ValvesOpen = ValvesOpen;
|
||||
result.ValvesClose = ValvesClose;
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
+17
-1
@@ -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;
|
||||
@@ -108,6 +108,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()
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using Config.Entities;
|
||||
@@ -23,7 +23,8 @@ namespace Config.Mappings
|
||||
Map(x => x.TempDiv);
|
||||
Map(x => x.Scale)
|
||||
.Column("Balance");
|
||||
Map(x => x.EmptyTankValve);
|
||||
Map(x => x.RegulValvesPct)
|
||||
.Column("EmptyTankValve");
|
||||
Map(x => x.ValvesOpen)
|
||||
.CustomType("StringClob")
|
||||
.CustomSqlType("varchar(8000)");
|
||||
|
||||
@@ -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("2.26.1519.0")]
|
||||
[assembly: AssemblyFileVersion("2.26.1519.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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,12 +7,12 @@ namespace DataStreamInterface
|
||||
{
|
||||
public class DataFrame
|
||||
{
|
||||
public readonly UInt64 ID; /// Frame ID
|
||||
public readonly Int64 ID; /// Frame ID
|
||||
public readonly double Time; /// Time stamp in units of time
|
||||
public readonly double Volume; /// Volume in units of volume
|
||||
public readonly double[] Quantity; /// An array of optional quantities in their respective units
|
||||
|
||||
public DataFrame(UInt64 id, double time, double volume, double[] quantity)
|
||||
public DataFrame(Int64 id, double time, double volume, double[] quantity)
|
||||
{
|
||||
ID = id;
|
||||
Time = time;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>DataStreamInterface</RootNamespace>
|
||||
<AssemblyName>DataStreamInterface</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
@@ -21,6 +21,7 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -29,9 +30,11 @@
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.Composition" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
|
||||
Binary file not shown.
+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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,58 +2,82 @@
|
||||
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataStreamInterface
|
||||
{
|
||||
public interface IDataStreamMeter
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns count of water meters supported by the data stream component
|
||||
/// </summary>
|
||||
/// <returns>Water meters count</returns>
|
||||
int GetMetersCount();
|
||||
|
||||
/// <summary>
|
||||
/// Get state of the connected data stream meter
|
||||
/// </summary>
|
||||
/// <param name="meterIx">Index of the meter in range 0 .. (GetMetersCount() - 1)</param>
|
||||
/// <param name="state">Current state of the meter</param>
|
||||
/// <param name="parameter">Current extra parameter of the meter</param>
|
||||
/// <returns>true when successful</returns>
|
||||
bool GetState(out int state, out string parameter);
|
||||
bool GetState(int meterIx, out int state, out string parameter);
|
||||
|
||||
/// <summary>
|
||||
/// Set state of the connected data stream meter
|
||||
/// </summary>
|
||||
/// <param name="meterIx">Index of the meter in range 0 .. (GetMetersCount() - 1)</param>
|
||||
/// <param name="state">Required state of the meter</param>
|
||||
/// <param name="parameter">Required extra parameter of the meter</param>
|
||||
/// <returns>true when successful</returns>
|
||||
bool SetState(int state, string parameter);
|
||||
bool SetState(int meterIx, int state, string parameter);
|
||||
|
||||
bool SetStateAll(int state, string parameter);
|
||||
|
||||
/// <summary>
|
||||
/// Establish connection with a data stream meter
|
||||
/// </summary>
|
||||
/// <param name="meterIx">Index of the meter in range 0 .. (GetMetersCount() - 1)</param>
|
||||
/// <param name="connectionParameters">Connection parameters</param>
|
||||
/// <param name="meterId">Meter ID (e.g. serial number)</param>
|
||||
/// <returns>true when successful</returns>
|
||||
bool OpenConnection(string connectionParameters, out string meterId);
|
||||
|
||||
/// <summary>
|
||||
/// Closes connection with the data stream meter
|
||||
/// </summary>
|
||||
/// <returns>true when successful</returns>
|
||||
bool CloseConnection();
|
||||
bool OpenConnection(int meterIx, string connectionParameters, out string meterId);
|
||||
|
||||
/// <summary>
|
||||
/// Stars saving measurement results into internal data structures of the component.
|
||||
/// Each data frame obtains a unique ID.
|
||||
/// The very first data fraim obrains ID = 0.
|
||||
/// </summary>
|
||||
/// <param name="meterIx">Index of the meter in range 0 .. (GetMetersCount() - 1)</param>
|
||||
/// <returns>true when successful</returns>
|
||||
bool StartMeasurement();
|
||||
bool StartMeasurement(int meterIx);
|
||||
|
||||
bool StartMeasurementAll();
|
||||
|
||||
/// <summary>
|
||||
/// Stops saving measurement results into internal data structures of the component.
|
||||
/// Updates ID of the last date frame received from the meter.
|
||||
/// </summary>
|
||||
/// <param name="lastFrameID">ID of the last date frame</param>
|
||||
/// <param name="meterIx">Index of the meter in range 0 .. (GetMetersCount() - 1)</param>
|
||||
/// <param name="storedFramesCount">Number of stored date frames</param>
|
||||
/// <returns>true when successful</returns>
|
||||
bool StopMeasurement(out UInt64 lastFrameID);
|
||||
bool StopMeasurement(int meterIx, out Int64 storedFramesCount);
|
||||
|
||||
bool StopMeasurementAll(out Int64[] storedFramesCounts);
|
||||
|
||||
/// <summary>
|
||||
/// Closes connection with the data stream meter
|
||||
/// </summary>
|
||||
/// <param name="meterIx">Index of the meter in range 0 .. (GetMetersCount() - 1)</param>
|
||||
/// <returns>true when successful</returns>
|
||||
bool CloseConnection(int meterIx);
|
||||
|
||||
bool CloseConnectionAll();
|
||||
|
||||
/// <summary>
|
||||
/// This function is called when TBF program is shutting down.
|
||||
/// </summary>
|
||||
/// <returns>true when successful</returns>
|
||||
bool Shutdown();
|
||||
|
||||
///------------------------------------------------
|
||||
/// Units of time, volume and optional quantities
|
||||
@@ -70,7 +94,7 @@ namespace DataStreamInterface
|
||||
Unit GetVolumeUnits();
|
||||
|
||||
///-----------------------------------------------
|
||||
/// Ooptional quantities: count, units, captions
|
||||
/// Optional quantities: count, units, captions
|
||||
///-----------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
@@ -83,13 +107,13 @@ namespace DataStreamInterface
|
||||
/// Returns units of the specified quantity
|
||||
/// </summary>
|
||||
/// <param name="quanityNr">Zero based quantity number 0 .. quantites count-1</param>
|
||||
Unit GetQuantityUnits(int quanityNr);
|
||||
Unit GetQuantityUnits(int quantityNr);
|
||||
|
||||
/// <summary>
|
||||
/// Returns caption of the specified quantity
|
||||
/// </summary>
|
||||
/// <param name="quanityNr">Zero based quantity number 0 .. quantites count-1</param>
|
||||
string GetQuantityCaption(int quanityNr);
|
||||
string GetQuantityCaption(int quantityNr);
|
||||
|
||||
///---------------------------
|
||||
/// Datastream data exchange
|
||||
@@ -98,17 +122,19 @@ namespace DataStreamInterface
|
||||
/// <summary>
|
||||
/// Retuns 'count' data frames starting with data frame with ID = 'id'
|
||||
/// </summary>
|
||||
/// <param name="meterIx">Index of the meter in range 0 .. (GetMetersCount() - 1)</param>
|
||||
/// <param name="id">First frame ID</param>
|
||||
/// <param name="count">Frames count</param>
|
||||
/// <returns>Selected data frames</returns>
|
||||
DataFrame[] GetFrames(UInt64 id, int count);
|
||||
DataFrame[] GetFrames(int meterIx, Int64 id, int count);
|
||||
|
||||
/// <summary>
|
||||
/// Returns ID of the data frame where time equals or exceeds the specified time.
|
||||
/// When time of the first frame (ID=0) is larger then specified time, function returns 0.
|
||||
/// </summary>
|
||||
/// <param name="meterIx">Index of the meter in range 0 .. (GetMetersCount() - 1)</param>
|
||||
/// <param name="time">Time</param>
|
||||
/// <returns>ID of the data frame at or after the pecified time</returns>
|
||||
UInt64 GetID(double time);
|
||||
Int64 GetID(int meterIx, double time);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DataStreamInterfaceTest
|
||||
{
|
||||
public class ActivityLog
|
||||
{
|
||||
const int LinesCount = 50;
|
||||
|
||||
TextBox textBox;
|
||||
string[] lines;
|
||||
string activity;
|
||||
|
||||
public ActivityLog(TextBox textBox)
|
||||
{
|
||||
this.textBox = textBox;
|
||||
lines = new string[LinesCount];
|
||||
for (int i = 0; i < LinesCount; i++) lines[i] = string.Empty;
|
||||
}
|
||||
|
||||
public void Print(string log)
|
||||
{
|
||||
for (int i = LinesCount - 1; i > 0; i--) lines[i] = lines[i - 1];
|
||||
lines[0] = log;
|
||||
DisplayLines();
|
||||
}
|
||||
|
||||
private void DisplayLines()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (var line in lines) sb.AppendLine(line);
|
||||
textBox.Text = sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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,134 @@
|
||||
<?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>{1D1EEF9C-7F41-43D3-BD09-5054D00F7A23}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>DataStreamInterfaceTest</RootNamespace>
|
||||
<AssemblyName>DataStreamInterfaceTest</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="System" />
|
||||
<Reference Include="System.ComponentModel.Composition" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ActivityLog.cs" />
|
||||
<Compile Include="DemoMainWnd.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DemoMainWnd.Designer.cs">
|
||||
<DependentUpon>DemoMainWnd.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GetDblValueDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="GetDblValueDlg.designer.cs">
|
||||
<DependentUpon>GetDblValueDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GetFrameBoundariesDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="GetFrameBoundariesDlg.designer.cs">
|
||||
<DependentUpon>GetFrameBoundariesDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GetIntegerNumberDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="GetIntegerNumberDlg.Designer.cs">
|
||||
<DependentUpon>GetIntegerNumberDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GetStateDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="GetStateDlg.designer.cs">
|
||||
<DependentUpon>GetStateDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LviIDComparer.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="DemoMainWnd.resx">
|
||||
<DependentUpon>DemoMainWnd.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="GetDblValueDlg.resx">
|
||||
<DependentUpon>GetDblValueDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="GetFrameBoundariesDlg.resx">
|
||||
<DependentUpon>GetFrameBoundariesDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="GetIntegerNumberDlg.resx">
|
||||
<DependentUpon>GetIntegerNumberDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="GetStateDlg.resx">
|
||||
<DependentUpon>GetStateDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DataStreamInterface\DataStreamInterface.csproj">
|
||||
<Project>{7ebeea14-91c4-48d7-af0a-7a4bc3ff9a28}</Project>
|
||||
<Name>DataStreamInterface</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>
|
||||
+380
@@ -0,0 +1,380 @@
|
||||
namespace DataStreamInterfaceTest
|
||||
{
|
||||
partial class DemoMainWnd
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.getIDButton = new System.Windows.Forms.Button();
|
||||
this.getFramesButton = new System.Windows.Forms.Button();
|
||||
this.measurementLabel = new System.Windows.Forms.Label();
|
||||
this.stateLabel = new System.Windows.Forms.Label();
|
||||
this.capabilitiesLabel = new System.Windows.Forms.Label();
|
||||
this.getQuantityUnitsButton = new System.Windows.Forms.Button();
|
||||
this.getQuantityCaptionButton = new System.Windows.Forms.Button();
|
||||
this.getQuantitiesCountButton = new System.Windows.Forms.Button();
|
||||
this.getVolumeUnitsButton = new System.Windows.Forms.Button();
|
||||
this.getTimeUnitsButton = new System.Windows.Forms.Button();
|
||||
this.setStateButton = new System.Windows.Forms.Button();
|
||||
this.getStateButton = new System.Windows.Forms.Button();
|
||||
this.stopMeasurementButton = new System.Windows.Forms.Button();
|
||||
this.startMeasurementButton = new System.Windows.Forms.Button();
|
||||
this.closeConnectionButton = new System.Windows.Forms.Button();
|
||||
this.openConnectionButton = new System.Windows.Forms.Button();
|
||||
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
|
||||
this.logsTextBox = new System.Windows.Forms.TextBox();
|
||||
this.dataTabControl = new System.Windows.Forms.TabControl();
|
||||
this.tabPage1 = new System.Windows.Forms.TabPage();
|
||||
this.framesListView = new System.Windows.Forms.ListView();
|
||||
this.tabPage2 = new System.Windows.Forms.TabPage();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
|
||||
this.splitContainer2.Panel1.SuspendLayout();
|
||||
this.splitContainer2.Panel2.SuspendLayout();
|
||||
this.splitContainer2.SuspendLayout();
|
||||
this.dataTabControl.SuspendLayout();
|
||||
this.tabPage1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
|
||||
this.splitContainer1.IsSplitterFixed = true;
|
||||
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.getIDButton);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.getFramesButton);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.measurementLabel);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.stateLabel);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.capabilitiesLabel);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.getQuantityUnitsButton);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.getQuantityCaptionButton);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.getQuantitiesCountButton);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.getVolumeUnitsButton);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.getTimeUnitsButton);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.setStateButton);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.getStateButton);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.stopMeasurementButton);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.startMeasurementButton);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.closeConnectionButton);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.openConnectionButton);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(826, 583);
|
||||
this.splitContainer1.SplitterDistance = 150;
|
||||
this.splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// getIDButton
|
||||
//
|
||||
this.getIDButton.Location = new System.Drawing.Point(12, 480);
|
||||
this.getIDButton.Name = "getIDButton";
|
||||
this.getIDButton.Size = new System.Drawing.Size(128, 24);
|
||||
this.getIDButton.TabIndex = 12;
|
||||
this.getIDButton.Text = "Get ID";
|
||||
this.getIDButton.UseVisualStyleBackColor = true;
|
||||
this.getIDButton.Click += new System.EventHandler(this.getIDButton_Click);
|
||||
//
|
||||
// getFramesButton
|
||||
//
|
||||
this.getFramesButton.Location = new System.Drawing.Point(12, 450);
|
||||
this.getFramesButton.Name = "getFramesButton";
|
||||
this.getFramesButton.Size = new System.Drawing.Size(128, 24);
|
||||
this.getFramesButton.TabIndex = 11;
|
||||
this.getFramesButton.Text = "Get frames";
|
||||
this.getFramesButton.UseVisualStyleBackColor = true;
|
||||
this.getFramesButton.Click += new System.EventHandler(this.getFramesButton_Click);
|
||||
//
|
||||
// measurementLabel
|
||||
//
|
||||
this.measurementLabel.AutoSize = true;
|
||||
this.measurementLabel.Location = new System.Drawing.Point(12, 374);
|
||||
this.measurementLabel.Name = "measurementLabel";
|
||||
this.measurementLabel.Size = new System.Drawing.Size(74, 13);
|
||||
this.measurementLabel.TabIndex = 15;
|
||||
this.measurementLabel.Text = "Measurement:";
|
||||
//
|
||||
// stateLabel
|
||||
//
|
||||
this.stateLabel.AutoSize = true;
|
||||
this.stateLabel.Location = new System.Drawing.Point(12, 194);
|
||||
this.stateLabel.Name = "stateLabel";
|
||||
this.stateLabel.Size = new System.Drawing.Size(112, 13);
|
||||
this.stateLabel.TabIndex = 14;
|
||||
this.stateLabel.Text = "State and connection:";
|
||||
//
|
||||
// capabilitiesLabel
|
||||
//
|
||||
this.capabilitiesLabel.AutoSize = true;
|
||||
this.capabilitiesLabel.Location = new System.Drawing.Point(12, 9);
|
||||
this.capabilitiesLabel.Name = "capabilitiesLabel";
|
||||
this.capabilitiesLabel.Size = new System.Drawing.Size(63, 13);
|
||||
this.capabilitiesLabel.TabIndex = 13;
|
||||
this.capabilitiesLabel.Text = "Capabilities:";
|
||||
//
|
||||
// getQuantityUnitsButton
|
||||
//
|
||||
this.getQuantityUnitsButton.Location = new System.Drawing.Point(12, 145);
|
||||
this.getQuantityUnitsButton.Name = "getQuantityUnitsButton";
|
||||
this.getQuantityUnitsButton.Size = new System.Drawing.Size(128, 24);
|
||||
this.getQuantityUnitsButton.TabIndex = 4;
|
||||
this.getQuantityUnitsButton.Text = "Get quantity units";
|
||||
this.getQuantityUnitsButton.UseVisualStyleBackColor = true;
|
||||
this.getQuantityUnitsButton.Click += new System.EventHandler(this.getQuantityUnitsButton_Click);
|
||||
//
|
||||
// getQuantityCaptionButton
|
||||
//
|
||||
this.getQuantityCaptionButton.Location = new System.Drawing.Point(12, 115);
|
||||
this.getQuantityCaptionButton.Name = "getQuantityCaptionButton";
|
||||
this.getQuantityCaptionButton.Size = new System.Drawing.Size(128, 24);
|
||||
this.getQuantityCaptionButton.TabIndex = 3;
|
||||
this.getQuantityCaptionButton.Text = "Get quantity caption";
|
||||
this.getQuantityCaptionButton.UseVisualStyleBackColor = true;
|
||||
this.getQuantityCaptionButton.Click += new System.EventHandler(this.getQuantityCaptionButton_Click);
|
||||
//
|
||||
// getQuantitiesCountButton
|
||||
//
|
||||
this.getQuantitiesCountButton.Location = new System.Drawing.Point(12, 85);
|
||||
this.getQuantitiesCountButton.Name = "getQuantitiesCountButton";
|
||||
this.getQuantitiesCountButton.Size = new System.Drawing.Size(128, 24);
|
||||
this.getQuantitiesCountButton.TabIndex = 2;
|
||||
this.getQuantitiesCountButton.Text = "Get quantities count";
|
||||
this.getQuantitiesCountButton.UseVisualStyleBackColor = true;
|
||||
this.getQuantitiesCountButton.Click += new System.EventHandler(this.getQuantitiesCountButton_Click);
|
||||
//
|
||||
// getVolumeUnitsButton
|
||||
//
|
||||
this.getVolumeUnitsButton.Location = new System.Drawing.Point(12, 55);
|
||||
this.getVolumeUnitsButton.Name = "getVolumeUnitsButton";
|
||||
this.getVolumeUnitsButton.Size = new System.Drawing.Size(128, 24);
|
||||
this.getVolumeUnitsButton.TabIndex = 1;
|
||||
this.getVolumeUnitsButton.Text = "Get volume units";
|
||||
this.getVolumeUnitsButton.UseVisualStyleBackColor = true;
|
||||
this.getVolumeUnitsButton.Click += new System.EventHandler(this.getVolumeUnitsButton_Click);
|
||||
//
|
||||
// getTimeUnitsButton
|
||||
//
|
||||
this.getTimeUnitsButton.Location = new System.Drawing.Point(12, 25);
|
||||
this.getTimeUnitsButton.Name = "getTimeUnitsButton";
|
||||
this.getTimeUnitsButton.Size = new System.Drawing.Size(128, 24);
|
||||
this.getTimeUnitsButton.TabIndex = 0;
|
||||
this.getTimeUnitsButton.Text = "Get time units";
|
||||
this.getTimeUnitsButton.UseVisualStyleBackColor = true;
|
||||
this.getTimeUnitsButton.Click += new System.EventHandler(this.getTimeUnitsButton_Click);
|
||||
//
|
||||
// setStateButton
|
||||
//
|
||||
this.setStateButton.Location = new System.Drawing.Point(12, 315);
|
||||
this.setStateButton.Name = "setStateButton";
|
||||
this.setStateButton.Size = new System.Drawing.Size(128, 24);
|
||||
this.setStateButton.TabIndex = 8;
|
||||
this.setStateButton.Text = "Set state";
|
||||
this.setStateButton.UseVisualStyleBackColor = true;
|
||||
this.setStateButton.Click += new System.EventHandler(this.setStateButton_Click);
|
||||
//
|
||||
// getStateButton
|
||||
//
|
||||
this.getStateButton.Location = new System.Drawing.Point(12, 285);
|
||||
this.getStateButton.Name = "getStateButton";
|
||||
this.getStateButton.Size = new System.Drawing.Size(128, 24);
|
||||
this.getStateButton.TabIndex = 7;
|
||||
this.getStateButton.Text = "Get state";
|
||||
this.getStateButton.UseVisualStyleBackColor = true;
|
||||
this.getStateButton.Click += new System.EventHandler(this.getStateButton_Click);
|
||||
//
|
||||
// stopMeasurementButton
|
||||
//
|
||||
this.stopMeasurementButton.Location = new System.Drawing.Point(12, 420);
|
||||
this.stopMeasurementButton.Name = "stopMeasurementButton";
|
||||
this.stopMeasurementButton.Size = new System.Drawing.Size(128, 24);
|
||||
this.stopMeasurementButton.TabIndex = 10;
|
||||
this.stopMeasurementButton.Text = "Stop measurement";
|
||||
this.stopMeasurementButton.UseVisualStyleBackColor = true;
|
||||
this.stopMeasurementButton.Click += new System.EventHandler(this.stopMeasurementButton_Click);
|
||||
//
|
||||
// startMeasurementButton
|
||||
//
|
||||
this.startMeasurementButton.Location = new System.Drawing.Point(12, 390);
|
||||
this.startMeasurementButton.Name = "startMeasurementButton";
|
||||
this.startMeasurementButton.Size = new System.Drawing.Size(128, 24);
|
||||
this.startMeasurementButton.TabIndex = 9;
|
||||
this.startMeasurementButton.Text = "Start measurement";
|
||||
this.startMeasurementButton.UseVisualStyleBackColor = true;
|
||||
this.startMeasurementButton.Click += new System.EventHandler(this.startMeasurementButton_Click);
|
||||
//
|
||||
// closeConnectionButton
|
||||
//
|
||||
this.closeConnectionButton.Location = new System.Drawing.Point(12, 240);
|
||||
this.closeConnectionButton.Name = "closeConnectionButton";
|
||||
this.closeConnectionButton.Size = new System.Drawing.Size(128, 24);
|
||||
this.closeConnectionButton.TabIndex = 6;
|
||||
this.closeConnectionButton.Text = "Close connection";
|
||||
this.closeConnectionButton.UseVisualStyleBackColor = true;
|
||||
this.closeConnectionButton.Click += new System.EventHandler(this.closeConnectionButton_Click);
|
||||
//
|
||||
// openConnectionButton
|
||||
//
|
||||
this.openConnectionButton.Location = new System.Drawing.Point(12, 210);
|
||||
this.openConnectionButton.Name = "openConnectionButton";
|
||||
this.openConnectionButton.Size = new System.Drawing.Size(128, 24);
|
||||
this.openConnectionButton.TabIndex = 5;
|
||||
this.openConnectionButton.Text = "Open connection";
|
||||
this.openConnectionButton.UseVisualStyleBackColor = true;
|
||||
this.openConnectionButton.Click += new System.EventHandler(this.openConnectionButton_Click);
|
||||
//
|
||||
// splitContainer2
|
||||
//
|
||||
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer2.Name = "splitContainer2";
|
||||
this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer2.Panel1
|
||||
//
|
||||
this.splitContainer2.Panel1.Controls.Add(this.logsTextBox);
|
||||
//
|
||||
// splitContainer2.Panel2
|
||||
//
|
||||
this.splitContainer2.Panel2.Controls.Add(this.dataTabControl);
|
||||
this.splitContainer2.Size = new System.Drawing.Size(672, 583);
|
||||
this.splitContainer2.SplitterDistance = 222;
|
||||
this.splitContainer2.TabIndex = 0;
|
||||
//
|
||||
// logsTextBox
|
||||
//
|
||||
this.logsTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.logsTextBox.Location = new System.Drawing.Point(0, 0);
|
||||
this.logsTextBox.Multiline = true;
|
||||
this.logsTextBox.Name = "logsTextBox";
|
||||
this.logsTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
|
||||
this.logsTextBox.Size = new System.Drawing.Size(672, 222);
|
||||
this.logsTextBox.TabIndex = 0;
|
||||
//
|
||||
// dataTabControl
|
||||
//
|
||||
this.dataTabControl.Controls.Add(this.tabPage1);
|
||||
this.dataTabControl.Controls.Add(this.tabPage2);
|
||||
this.dataTabControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.dataTabControl.Location = new System.Drawing.Point(0, 0);
|
||||
this.dataTabControl.Name = "dataTabControl";
|
||||
this.dataTabControl.SelectedIndex = 0;
|
||||
this.dataTabControl.Size = new System.Drawing.Size(672, 357);
|
||||
this.dataTabControl.TabIndex = 0;
|
||||
//
|
||||
// tabPage1
|
||||
//
|
||||
this.tabPage1.Controls.Add(this.framesListView);
|
||||
this.tabPage1.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage1.Name = "tabPage1";
|
||||
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPage1.Size = new System.Drawing.Size(664, 331);
|
||||
this.tabPage1.TabIndex = 0;
|
||||
this.tabPage1.Text = "Transferred frames";
|
||||
this.tabPage1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// framesListView
|
||||
//
|
||||
this.framesListView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.framesListView.GridLines = true;
|
||||
this.framesListView.Location = new System.Drawing.Point(3, 3);
|
||||
this.framesListView.Name = "framesListView";
|
||||
this.framesListView.Size = new System.Drawing.Size(658, 325);
|
||||
this.framesListView.TabIndex = 0;
|
||||
this.framesListView.UseCompatibleStateImageBehavior = false;
|
||||
this.framesListView.View = System.Windows.Forms.View.Details;
|
||||
//
|
||||
// tabPage2
|
||||
//
|
||||
this.tabPage2.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage2.Name = "tabPage2";
|
||||
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPage2.Size = new System.Drawing.Size(664, 331);
|
||||
this.tabPage2.TabIndex = 1;
|
||||
this.tabPage2.Text = "Graph";
|
||||
this.tabPage2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// DemoMainWnd
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(826, 583);
|
||||
this.Controls.Add(this.splitContainer1);
|
||||
this.Name = "DemoMainWnd";
|
||||
this.Text = "Datastream interface test";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.DemoMainWnd_FormClosing);
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel1.PerformLayout();
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.splitContainer2.Panel1.ResumeLayout(false);
|
||||
this.splitContainer2.Panel1.PerformLayout();
|
||||
this.splitContainer2.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
|
||||
this.splitContainer2.ResumeLayout(false);
|
||||
this.dataTabControl.ResumeLayout(false);
|
||||
this.tabPage1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private System.Windows.Forms.Button openConnectionButton;
|
||||
private System.Windows.Forms.Button closeConnectionButton;
|
||||
private System.Windows.Forms.Button stopMeasurementButton;
|
||||
private System.Windows.Forms.Button startMeasurementButton;
|
||||
private System.Windows.Forms.Button setStateButton;
|
||||
private System.Windows.Forms.Button getStateButton;
|
||||
private System.Windows.Forms.Button getQuantityUnitsButton;
|
||||
private System.Windows.Forms.Button getQuantityCaptionButton;
|
||||
private System.Windows.Forms.Button getQuantitiesCountButton;
|
||||
private System.Windows.Forms.Button getVolumeUnitsButton;
|
||||
private System.Windows.Forms.Button getTimeUnitsButton;
|
||||
private System.Windows.Forms.Label measurementLabel;
|
||||
private System.Windows.Forms.Label stateLabel;
|
||||
private System.Windows.Forms.Label capabilitiesLabel;
|
||||
private System.Windows.Forms.Button getIDButton;
|
||||
private System.Windows.Forms.Button getFramesButton;
|
||||
private System.Windows.Forms.SplitContainer splitContainer2;
|
||||
private System.Windows.Forms.TextBox logsTextBox;
|
||||
private System.Windows.Forms.TabControl dataTabControl;
|
||||
private System.Windows.Forms.TabPage tabPage1;
|
||||
private System.Windows.Forms.ListView framesListView;
|
||||
private System.Windows.Forms.TabPage tabPage2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,292 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using DataStreamInterface;
|
||||
|
||||
namespace DataStreamInterfaceTest
|
||||
{
|
||||
public partial class DemoMainWnd : Form
|
||||
{
|
||||
IDataStreamMeter dataStreamMeter;
|
||||
|
||||
ActivityLog activityLog;
|
||||
|
||||
Unit timeUnits;
|
||||
Unit volumeUnits;
|
||||
int quantitiesCount;
|
||||
string[] quantityCaption;
|
||||
Unit[] quantityUnit;
|
||||
|
||||
Int64 storedFramesCount;
|
||||
DataFrame[] transferredFrames;
|
||||
|
||||
public DemoMainWnd() : this(null) { }
|
||||
|
||||
public DemoMainWnd(IDataStreamMeter dataStreamMeter)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.dataStreamMeter = dataStreamMeter;
|
||||
activityLog = new ActivityLog(logsTextBox);
|
||||
|
||||
framesListView.Columns.Add("ID", 100);
|
||||
framesListView.Columns.Add("Time", 100);
|
||||
framesListView.Columns.Add("Volume", 100);
|
||||
framesListView.Columns.Add("Additional quantities", 300);
|
||||
framesListView.ListViewItemSorter = new LviIDComparer();
|
||||
}
|
||||
|
||||
void ShowNoMeterInterfaceMessage()
|
||||
{
|
||||
MessageBox.Show("No datastream meter interface");
|
||||
}
|
||||
|
||||
private void getTimeUnitsButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dataStreamMeter == null)
|
||||
ShowNoMeterInterfaceMessage();
|
||||
else
|
||||
{
|
||||
timeUnits = dataStreamMeter.GetTimeUnits();
|
||||
activityLog.Print(string.Format("Time units are {0}", timeUnits));
|
||||
}
|
||||
}
|
||||
|
||||
private void getVolumeUnitsButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dataStreamMeter == null)
|
||||
ShowNoMeterInterfaceMessage();
|
||||
else
|
||||
{
|
||||
volumeUnits = dataStreamMeter.GetVolumeUnits();
|
||||
activityLog.Print(string.Format("Volume units are {0}", volumeUnits));
|
||||
}
|
||||
}
|
||||
|
||||
private void getQuantitiesCountButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dataStreamMeter == null)
|
||||
ShowNoMeterInterfaceMessage();
|
||||
else
|
||||
{
|
||||
int quantitesCountOri = quantitiesCount;
|
||||
quantitiesCount = dataStreamMeter.GetQuantitiesCount();
|
||||
activityLog.Print(string.Format("There are {0} additional quantites", quantitiesCount));
|
||||
|
||||
if (quantitesCountOri == 0)
|
||||
{
|
||||
quantityUnit = new Unit[quantitiesCount];
|
||||
quantityCaption = new string[quantitiesCount];
|
||||
for (int i = 0; i < quantitiesCount; i++) quantityCaption[i] = string.Empty;
|
||||
}
|
||||
else if (quantitiesCount != quantitesCountOri)
|
||||
{
|
||||
quantityUnit = new Unit[quantitiesCount];
|
||||
quantityCaption = new string[quantitiesCount];
|
||||
for (int i = 0; i < quantitiesCount; i++) quantityCaption[i] = string.Empty;
|
||||
|
||||
activityLog.Print(string.Format("Quantities count changed during operation"));
|
||||
MessageBox.Show("Quantities count changed during operation", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void getQuantityCaptionButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dataStreamMeter == null)
|
||||
ShowNoMeterInterfaceMessage();
|
||||
else
|
||||
{
|
||||
GetIntegerNumberDlg dlg = new GetIntegerNumberDlg(string.Format("Enter index {0} .. {1}", 0, quantitiesCount - 1), 0, quantitiesCount - 1);
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
quantityCaption[dlg.Number] = dataStreamMeter.GetQuantityCaption(dlg.Number);
|
||||
activityLog.Print(string.Format("Caption of quantity #{0} is {1}", dlg.Number, quantityCaption[dlg.Number]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void getQuantityUnitsButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dataStreamMeter == null)
|
||||
ShowNoMeterInterfaceMessage();
|
||||
else
|
||||
{
|
||||
GetIntegerNumberDlg dlg = new GetIntegerNumberDlg(string.Format("Enter index {0} .. {1}", 0, quantitiesCount - 1), 0, quantitiesCount - 1);
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
quantityUnit[dlg.Number] = dataStreamMeter.GetQuantityUnits(dlg.Number);
|
||||
activityLog.Print(string.Format("Units of quantity #{0} are {1}", dlg.Number, quantityUnit[dlg.Number]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void openConnectionButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dataStreamMeter == null)
|
||||
ShowNoMeterInterfaceMessage();
|
||||
else
|
||||
{
|
||||
string meterId;
|
||||
if (dataStreamMeter.OpenConnection(0, "no connection parameters", out meterId))
|
||||
{
|
||||
activityLog.Print(string.Format("Connection established, meter ID is {0}", meterId));
|
||||
}
|
||||
else
|
||||
{
|
||||
activityLog.Print("Failed to establish a connection");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void closeConnectionButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dataStreamMeter == null)
|
||||
ShowNoMeterInterfaceMessage();
|
||||
else
|
||||
{
|
||||
if (dataStreamMeter.CloseConnection(0))
|
||||
{
|
||||
framesListView.Items.Clear();
|
||||
activityLog.Print("Connection closed");
|
||||
}
|
||||
else
|
||||
{
|
||||
activityLog.Print("Failed to close the connection");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DemoMainWnd_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
if (dataStreamMeter == null)
|
||||
{
|
||||
dataStreamMeter.Shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
private void getStateButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dataStreamMeter == null)
|
||||
ShowNoMeterInterfaceMessage();
|
||||
else
|
||||
{
|
||||
int state;
|
||||
string parameter;
|
||||
if (dataStreamMeter.GetState(0, out state, out parameter))
|
||||
{
|
||||
activityLog.Print(string.Format("Water meter state is {0} / {1}", state, parameter));
|
||||
}
|
||||
else
|
||||
{
|
||||
activityLog.Print("Failed to obtain the water meter state");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setStateButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dataStreamMeter == null)
|
||||
ShowNoMeterInterfaceMessage();
|
||||
else
|
||||
{
|
||||
GetStateDlg dlg = new GetStateDlg();
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
if (dataStreamMeter.SetState(0, dlg.State, dlg.Parameter))
|
||||
{
|
||||
activityLog.Print(string.Format("Water meter state set to {0} / {1}", dlg.State, dlg.Parameter));
|
||||
}
|
||||
else
|
||||
{
|
||||
activityLog.Print(string.Format("Failed to set the water meter state to {0} / {1}", dlg.State, dlg.Parameter));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void startMeasurementButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dataStreamMeter == null)
|
||||
ShowNoMeterInterfaceMessage();
|
||||
else
|
||||
{
|
||||
if (dataStreamMeter.StartMeasurement(0))
|
||||
{
|
||||
framesListView.Items.Clear();
|
||||
activityLog.Print(string.Format("Measurement started"));
|
||||
}
|
||||
else
|
||||
{
|
||||
activityLog.Print("Failed to start a measurement");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void stopMeasurementButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dataStreamMeter == null)
|
||||
ShowNoMeterInterfaceMessage();
|
||||
else
|
||||
{
|
||||
if (dataStreamMeter.StopMeasurement(0, out storedFramesCount))
|
||||
{
|
||||
framesListView.Items.Clear();
|
||||
activityLog.Print(string.Format("Measurement sopped, {0} frames acquired", storedFramesCount));
|
||||
}
|
||||
else
|
||||
{
|
||||
activityLog.Print("Failed to stop the measurement");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void getFramesButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dataStreamMeter == null)
|
||||
ShowNoMeterInterfaceMessage();
|
||||
else
|
||||
{
|
||||
GetFrameBoundariesDlg dlg = new GetFrameBoundariesDlg("Enter frames range boundaries", 0, storedFramesCount - 1);
|
||||
if (dlg.ShowDialog() != DialogResult.OK) return;
|
||||
DataFrame[] frames = dataStreamMeter.GetFrames(0, dlg.From, Convert.ToInt32(dlg.To - dlg.From + 1));
|
||||
{
|
||||
foreach (var frame in frames)
|
||||
{
|
||||
if (frame != null) framesListView.Items.Add(GetListViewItem(frame));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void getIDButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dataStreamMeter == null)
|
||||
ShowNoMeterInterfaceMessage();
|
||||
else
|
||||
{
|
||||
GetDblValueDlg dlg = new GetDblValueDlg("Enter time in seconds");
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
Int64 id = dataStreamMeter.GetID(0, dlg.DblValue);
|
||||
activityLog.Print(string.Format("GetID({0}) returned {1}", dlg.DblValue, id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ListViewItem GetListViewItem(DataFrame frame)
|
||||
{
|
||||
ListViewItem lvi = new ListViewItem(frame.ID.ToString());
|
||||
lvi.SubItems.Add(frame.Time.ToString());
|
||||
lvi.SubItems.Add(frame.Volume.ToString());
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (var quantity in frame.Quantity)
|
||||
{
|
||||
sb.Append(quantity.ToString());
|
||||
sb.Append(" ");
|
||||
}
|
||||
lvi.SubItems.Add(sb.ToString());
|
||||
lvi.Tag = frame;
|
||||
return lvi;
|
||||
}
|
||||
}
|
||||
}
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
namespace DataStreamInterfaceTest
|
||||
{
|
||||
partial class GetDblValueDlg
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.valueTextBox = new System.Windows.Forms.TextBox();
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// valueTextBox
|
||||
//
|
||||
this.valueTextBox.Location = new System.Drawing.Point(35, 20);
|
||||
this.valueTextBox.Name = "valueTextBox";
|
||||
this.valueTextBox.Size = new System.Drawing.Size(94, 20);
|
||||
this.valueTextBox.TabIndex = 0;
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.okButton.Location = new System.Drawing.Point(216, 16);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(75, 29);
|
||||
this.okButton.TabIndex = 1;
|
||||
this.okButton.Text = "OK";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancelButton.Location = new System.Drawing.Point(306, 16);
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.Size = new System.Drawing.Size(75, 29);
|
||||
this.cancelButton.TabIndex = 2;
|
||||
this.cancelButton.Text = "Cancel";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// GetFlowDlg
|
||||
//
|
||||
this.AcceptButton = this.okButton;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.cancelButton;
|
||||
this.ClientSize = new System.Drawing.Size(396, 58);
|
||||
this.Controls.Add(this.cancelButton);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.Controls.Add(this.valueTextBox);
|
||||
this.Name = "GetFlowDlg";
|
||||
this.Text = "Enter flow";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox valueTextBox;
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.Button cancelButton;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DataStreamInterfaceTest
|
||||
{
|
||||
public partial class GetDblValueDlg : Form
|
||||
{
|
||||
public double DblValue;
|
||||
|
||||
double lowerLimit;
|
||||
double upperLimit;
|
||||
|
||||
|
||||
public GetDblValueDlg()
|
||||
: this("Enter flow in [m3/h] please")
|
||||
{
|
||||
}
|
||||
|
||||
public GetDblValueDlg(string title)
|
||||
: this(title, 0, 100.0)
|
||||
{
|
||||
}
|
||||
|
||||
public GetDblValueDlg(string title, double lowerLimit, double upperLimit)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Text = title;
|
||||
this.lowerLimit = lowerLimit;
|
||||
this.upperLimit = upperLimit;
|
||||
}
|
||||
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
double val;
|
||||
if (TryParseUDouble(valueTextBox.Text, out val))
|
||||
{
|
||||
DblValue = val;
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Invalid value");
|
||||
DialogResult = DialogResult.None;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parse an unsigned double number
|
||||
/// </summary>
|
||||
bool TryParseUDouble(string text, out double result)
|
||||
{
|
||||
return double.TryParse(text, NumberStyles.AllowDecimalPoint, CultureInfo.CurrentCulture, out result) ||
|
||||
double.TryParse(text, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out result);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
namespace DataStreamInterfaceTest
|
||||
{
|
||||
partial class GetFrameBoundariesDlg
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.fromTextBox = new System.Windows.Forms.TextBox();
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.toTextBox = new System.Windows.Forms.TextBox();
|
||||
this.fromLabel = new System.Windows.Forms.Label();
|
||||
this.toLabel = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// fromTextBox
|
||||
//
|
||||
this.fromTextBox.Location = new System.Drawing.Point(89, 16);
|
||||
this.fromTextBox.Name = "fromTextBox";
|
||||
this.fromTextBox.Size = new System.Drawing.Size(100, 20);
|
||||
this.fromTextBox.TabIndex = 0;
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.okButton.Location = new System.Drawing.Point(225, 24);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(75, 36);
|
||||
this.okButton.TabIndex = 1;
|
||||
this.okButton.Text = "OK";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancelButton.Location = new System.Drawing.Point(316, 24);
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.Size = new System.Drawing.Size(75, 36);
|
||||
this.cancelButton.TabIndex = 2;
|
||||
this.cancelButton.Text = "Cancel";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// toTextBox
|
||||
//
|
||||
this.toTextBox.Location = new System.Drawing.Point(89, 46);
|
||||
this.toTextBox.Name = "toTextBox";
|
||||
this.toTextBox.Size = new System.Drawing.Size(100, 20);
|
||||
this.toTextBox.TabIndex = 3;
|
||||
//
|
||||
// fromLabel
|
||||
//
|
||||
this.fromLabel.AutoSize = true;
|
||||
this.fromLabel.Location = new System.Drawing.Point(12, 19);
|
||||
this.fromLabel.Name = "fromLabel";
|
||||
this.fromLabel.Size = new System.Drawing.Size(30, 13);
|
||||
this.fromLabel.TabIndex = 4;
|
||||
this.fromLabel.Text = "From";
|
||||
//
|
||||
// toLabel
|
||||
//
|
||||
this.toLabel.AutoSize = true;
|
||||
this.toLabel.Location = new System.Drawing.Point(12, 49);
|
||||
this.toLabel.Name = "toLabel";
|
||||
this.toLabel.Size = new System.Drawing.Size(20, 13);
|
||||
this.toLabel.TabIndex = 5;
|
||||
this.toLabel.Text = "To";
|
||||
//
|
||||
// GetFrameBoundariesDlg
|
||||
//
|
||||
this.AcceptButton = this.okButton;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.AutoSize = true;
|
||||
this.CancelButton = this.cancelButton;
|
||||
this.ClientSize = new System.Drawing.Size(419, 79);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.toLabel);
|
||||
this.Controls.Add(this.fromLabel);
|
||||
this.Controls.Add(this.toTextBox);
|
||||
this.Controls.Add(this.cancelButton);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.Controls.Add(this.fromTextBox);
|
||||
this.Name = "GetFrameBoundariesDlg";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Enter frames range boundaries";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox fromTextBox;
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.Button cancelButton;
|
||||
private System.Windows.Forms.TextBox toTextBox;
|
||||
private System.Windows.Forms.Label fromLabel;
|
||||
private System.Windows.Forms.Label toLabel;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DataStreamInterfaceTest
|
||||
{
|
||||
public partial class GetFrameBoundariesDlg : Form
|
||||
{
|
||||
/// <summary>
|
||||
/// Integer number entered in this form
|
||||
/// </summary>
|
||||
public Int64 From;
|
||||
public Int64 To;
|
||||
|
||||
Int64 lowerLimit;
|
||||
Int64 upperLimit;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor
|
||||
/// </summary>
|
||||
public GetFrameBoundariesDlg()
|
||||
: this("Enter state please")
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor with a custom window title.
|
||||
/// </summary>
|
||||
/// <param name="title">Window title</param>
|
||||
public GetFrameBoundariesDlg(string title)
|
||||
: this(title, Int64.MinValue, Int64.MaxValue)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor with a custom window title, limits and non-empty initial value.
|
||||
/// </summary>
|
||||
/// <param name="title">Window title</param>
|
||||
/// <param name="lowerLimit">Lower limit</param>
|
||||
/// <param name="upperLimit">Upper limit</param>
|
||||
/// <param name="initialValue">Initial value</param>
|
||||
public GetFrameBoundariesDlg(string title, Int64 lowerLimit, Int64 upperLimit, int initialValue)
|
||||
: this(title, lowerLimit, upperLimit)
|
||||
{
|
||||
fromTextBox.Text = initialValue.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor with a custom window title and lower/upper limits.
|
||||
/// </summary>
|
||||
/// <param name="title">Window title</param>
|
||||
/// <param name="lowerLimit">Lower limit</param>
|
||||
/// <param name="upperLimit">Upper limit</param>
|
||||
public GetFrameBoundariesDlg(string title, Int64 lowerLimit, Int64 upperLimit)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Text = title;
|
||||
this.lowerLimit = lowerLimit;
|
||||
this.upperLimit = upperLimit;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// OK button handler that verifies validity of the entered value.
|
||||
/// </summary>
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Int64 from;
|
||||
Int64 to;
|
||||
if (Int64.TryParse(fromTextBox.Text, out from) && from >= lowerLimit && from <= upperLimit &&
|
||||
Int64.TryParse(toTextBox.Text, out to) && to >= lowerLimit && to <= upperLimit &&
|
||||
to >= from && to < from + Int32.MaxValue)
|
||||
{
|
||||
From = from;
|
||||
To = to;
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
string message = (lowerLimit != 0 || upperLimit != Int32.MaxValue)
|
||||
? string.Format("Invalid boundaries ({0}..{1})", lowerLimit, upperLimit)
|
||||
: "Invalid boundaries";
|
||||
MessageBox.Show(message);
|
||||
DialogResult = DialogResult.None; /// Prevent closing this window
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,90 @@
|
||||
namespace DataStreamInterfaceTest
|
||||
{
|
||||
partial class GetIntegerNumberDlg
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.numberTextBox = new System.Windows.Forms.TextBox();
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// numberTextBox
|
||||
//
|
||||
this.numberTextBox.Location = new System.Drawing.Point(36, 16);
|
||||
this.numberTextBox.Name = "numberTextBox";
|
||||
this.numberTextBox.Size = new System.Drawing.Size(100, 20);
|
||||
this.numberTextBox.TabIndex = 0;
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.Location = new System.Drawing.Point(174, 7);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(75, 36);
|
||||
this.okButton.TabIndex = 1;
|
||||
this.okButton.Text = "OK";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancelButton.Location = new System.Drawing.Point(265, 7);
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.Size = new System.Drawing.Size(75, 36);
|
||||
this.cancelButton.TabIndex = 2;
|
||||
this.cancelButton.Text = "Cancel";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// GetIntegerNumberDlg
|
||||
//
|
||||
this.AcceptButton = this.okButton;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.AutoSize = true;
|
||||
this.CancelButton = this.cancelButton;
|
||||
this.ClientSize = new System.Drawing.Size(363, 50);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.cancelButton);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.Controls.Add(this.numberTextBox);
|
||||
this.Name = "GetIntegerNumberDlg";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Enter integer number please";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox numberTextBox;
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.Button cancelButton;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DataStreamInterfaceTest
|
||||
{
|
||||
public partial class GetIntegerNumberDlg : Form
|
||||
{
|
||||
/// <summary>
|
||||
/// Integer number entered in this form
|
||||
/// </summary>
|
||||
public int Number;
|
||||
|
||||
int lowerLimit;
|
||||
int upperLimit;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor
|
||||
/// </summary>
|
||||
public GetIntegerNumberDlg()
|
||||
: this("Enter integer number please")
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor with a custom window title.
|
||||
/// </summary>
|
||||
/// <param name="title">Window title</param>
|
||||
public GetIntegerNumberDlg(string title)
|
||||
: this(title, Int32.MinValue, Int32.MaxValue)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor with a custom window title, limits and non-empty initial value.
|
||||
/// </summary>
|
||||
/// <param name="title">Window title</param>
|
||||
/// <param name="lowerLimit">Lower limit</param>
|
||||
/// <param name="upperLimit">Upper limit</param>
|
||||
/// <param name="initialValue">Initial value</param>
|
||||
public GetIntegerNumberDlg(string title, int lowerLimit, int upperLimit, int initialValue)
|
||||
: this(title, lowerLimit, upperLimit)
|
||||
{
|
||||
numberTextBox.Text = initialValue.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor with a custom window title and lower/upper limits.
|
||||
/// </summary>
|
||||
/// <param name="title">Window title</param>
|
||||
/// <param name="lowerLimit">Lower limit</param>
|
||||
/// <param name="upperLimit">Upper limit</param>
|
||||
public GetIntegerNumberDlg(string title, int lowerLimit, int upperLimit)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Text = title;
|
||||
this.lowerLimit = lowerLimit;
|
||||
this.upperLimit = upperLimit;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// OK button handler that verifies validity of the entered value.
|
||||
/// </summary>
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
int number;
|
||||
if (int.TryParse(numberTextBox.Text, out number) && number >= lowerLimit && number <= upperLimit)
|
||||
{
|
||||
Number = number;
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
string message = (lowerLimit != Int32.MinValue || upperLimit != Int32.MaxValue)
|
||||
? string.Format("Invalid integer number ({0}..{1})", lowerLimit, upperLimit)
|
||||
: "Invalid integer number";
|
||||
MessageBox.Show(message);
|
||||
DialogResult = DialogResult.None; /// Prevent closing this window
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
namespace DataStreamInterfaceTest
|
||||
{
|
||||
partial class GetStateDlg
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.stateTextBox = new System.Windows.Forms.TextBox();
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.parameterTextBox = new System.Windows.Forms.TextBox();
|
||||
this.stateLabel = new System.Windows.Forms.Label();
|
||||
this.parameterLabel = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// stateTextBox
|
||||
//
|
||||
this.stateTextBox.Location = new System.Drawing.Point(89, 16);
|
||||
this.stateTextBox.Name = "stateTextBox";
|
||||
this.stateTextBox.Size = new System.Drawing.Size(100, 20);
|
||||
this.stateTextBox.TabIndex = 0;
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.okButton.Location = new System.Drawing.Point(225, 24);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(75, 36);
|
||||
this.okButton.TabIndex = 1;
|
||||
this.okButton.Text = "OK";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancelButton.Location = new System.Drawing.Point(316, 24);
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.Size = new System.Drawing.Size(75, 36);
|
||||
this.cancelButton.TabIndex = 2;
|
||||
this.cancelButton.Text = "Cancel";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// parameterTextBox
|
||||
//
|
||||
this.parameterTextBox.Location = new System.Drawing.Point(89, 46);
|
||||
this.parameterTextBox.Name = "parameterTextBox";
|
||||
this.parameterTextBox.Size = new System.Drawing.Size(100, 20);
|
||||
this.parameterTextBox.TabIndex = 3;
|
||||
//
|
||||
// stateLabel
|
||||
//
|
||||
this.stateLabel.AutoSize = true;
|
||||
this.stateLabel.Location = new System.Drawing.Point(12, 19);
|
||||
this.stateLabel.Name = "stateLabel";
|
||||
this.stateLabel.Size = new System.Drawing.Size(32, 13);
|
||||
this.stateLabel.TabIndex = 4;
|
||||
this.stateLabel.Text = "State";
|
||||
//
|
||||
// parameterLabel
|
||||
//
|
||||
this.parameterLabel.AutoSize = true;
|
||||
this.parameterLabel.Location = new System.Drawing.Point(12, 49);
|
||||
this.parameterLabel.Name = "parameterLabel";
|
||||
this.parameterLabel.Size = new System.Drawing.Size(55, 13);
|
||||
this.parameterLabel.TabIndex = 5;
|
||||
this.parameterLabel.Text = "Parameter";
|
||||
//
|
||||
// GetStateDlg
|
||||
//
|
||||
this.AcceptButton = this.okButton;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.AutoSize = true;
|
||||
this.CancelButton = this.cancelButton;
|
||||
this.ClientSize = new System.Drawing.Size(419, 79);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.parameterLabel);
|
||||
this.Controls.Add(this.stateLabel);
|
||||
this.Controls.Add(this.parameterTextBox);
|
||||
this.Controls.Add(this.cancelButton);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.Controls.Add(this.stateTextBox);
|
||||
this.Name = "GetStateDlg";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Enter state please";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox stateTextBox;
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.Button cancelButton;
|
||||
private System.Windows.Forms.TextBox parameterTextBox;
|
||||
private System.Windows.Forms.Label stateLabel;
|
||||
private System.Windows.Forms.Label parameterLabel;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DataStreamInterfaceTest
|
||||
{
|
||||
public partial class GetStateDlg : Form
|
||||
{
|
||||
/// <summary>
|
||||
/// Integer number entered in this form
|
||||
/// </summary>
|
||||
public int State;
|
||||
public string Parameter;
|
||||
|
||||
int lowerLimit;
|
||||
int upperLimit;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor
|
||||
/// </summary>
|
||||
public GetStateDlg()
|
||||
: this("Enter state please")
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor with a custom window title.
|
||||
/// </summary>
|
||||
/// <param name="title">Window title</param>
|
||||
public GetStateDlg(string title)
|
||||
: this(title, Int32.MinValue, Int32.MaxValue)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor with a custom window title, limits and non-empty initial value.
|
||||
/// </summary>
|
||||
/// <param name="title">Window title</param>
|
||||
/// <param name="lowerLimit">Lower limit</param>
|
||||
/// <param name="upperLimit">Upper limit</param>
|
||||
/// <param name="initialValue">Initial value</param>
|
||||
public GetStateDlg(string title, int lowerLimit, int upperLimit, int initialValue)
|
||||
: this(title, lowerLimit, upperLimit)
|
||||
{
|
||||
stateTextBox.Text = initialValue.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor with a custom window title and lower/upper limits.
|
||||
/// </summary>
|
||||
/// <param name="title">Window title</param>
|
||||
/// <param name="lowerLimit">Lower limit</param>
|
||||
/// <param name="upperLimit">Upper limit</param>
|
||||
public GetStateDlg(string title, int lowerLimit, int upperLimit)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Text = title;
|
||||
this.lowerLimit = lowerLimit;
|
||||
this.upperLimit = upperLimit;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// OK button handler that verifies validity of the entered value.
|
||||
/// </summary>
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
int number;
|
||||
if (int.TryParse(stateTextBox.Text, out number) && number >= lowerLimit && number <= upperLimit)
|
||||
{
|
||||
State = number;
|
||||
Parameter = parameterTextBox.Text;
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
string message = (lowerLimit != Int32.MinValue || upperLimit != Int32.MaxValue)
|
||||
? string.Format("Invalid state ({0}..{1})", lowerLimit, upperLimit)
|
||||
: "Invalid state";
|
||||
MessageBox.Show(message);
|
||||
DialogResult = DialogResult.None; /// Prevent closing this window
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DataStreamInterfaceTest
|
||||
{
|
||||
public class LviIDComparer : IComparer
|
||||
{
|
||||
int column;
|
||||
SortOrder order;
|
||||
|
||||
public LviIDComparer()
|
||||
{
|
||||
column = 0;
|
||||
order = SortOrder.Ascending;
|
||||
}
|
||||
|
||||
public LviIDComparer(int column, SortOrder order)
|
||||
{
|
||||
this.column = column;
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
public int Compare(object x, object y)
|
||||
{
|
||||
Int64 valX = Int64.Parse(((ListViewItem)x).SubItems[column].Text);
|
||||
Int64 valY = Int64.Parse(((ListViewItem)y).SubItems[column].Text);
|
||||
|
||||
if (order == SortOrder.Ascending)
|
||||
{
|
||||
return valX > valY ? 1 : valX == valY ? 0 : -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return valX < valY ? 1 : valX == valY ? 0 : -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.ComponentModel.Composition;
|
||||
using System.ComponentModel.Composition.Hosting;
|
||||
using System.Windows.Forms;
|
||||
using DataStreamInterface;
|
||||
|
||||
namespace DataStreamInterfaceTest
|
||||
{
|
||||
class Program
|
||||
{
|
||||
#if DEBUG
|
||||
const string CatalogDir = "..\\..\\..\\DataStreamMeter\\bin\\Debug";
|
||||
#else
|
||||
const string CatalogDir = "..\\..\\..\\DataStreamMeter\\bin\\Release";
|
||||
#endif
|
||||
|
||||
[Import(typeof(IDataStreamMeter))]
|
||||
IDataStreamMeter dataStreamMeter;
|
||||
|
||||
private Program()
|
||||
{
|
||||
Console.WriteLine("Components found:");
|
||||
foreach (var file in Directory.EnumerateFiles(CatalogDir))
|
||||
{
|
||||
Console.WriteLine(file);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var catalog = new AggregateCatalog();
|
||||
catalog.Catalogs.Add(new AssemblyCatalog(typeof(DataStreamInterface.IDataStreamMeter).Assembly));
|
||||
catalog.Catalogs.Add(new DirectoryCatalog(CatalogDir));
|
||||
(new CompositionContainer(catalog)).ComposeParts(this);
|
||||
}
|
||||
catch (CompositionException compositionException)
|
||||
{
|
||||
Console.WriteLine(compositionException.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Program p = new Program();
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new DemoMainWnd(p.dataStreamMeter));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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("DataStreamInterfaceTest")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("DataStreamInterfaceTest")]
|
||||
[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("429fdea9-ec3a-47d8-88b3-5df11de8b4c8")]
|
||||
|
||||
// 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,71 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace DataStreamInterfaceTest.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DataStreamMainDemo.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,30 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace DataStreamInterfaceTest.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -0,0 +1,85 @@
|
||||
<?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>{E6925701-57A6-4167-B5C4-BF670F1DE310}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>DataStreamMeter</RootNamespace>
|
||||
<AssemblyName>DataStreamMeter</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.Composition" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<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="GetDblValueDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="GetDblValueDlg.Designer.cs">
|
||||
<DependentUpon>GetDblValueDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MeterDataEventArgs.cs" />
|
||||
<Compile Include="MeterSimulationDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MeterSimulationDlg.Designer.cs">
|
||||
<DependentUpon>MeterSimulationDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MeterSimulation.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Sample.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DataStreamInterface\DataStreamInterface.csproj">
|
||||
<Project>{7ebeea14-91c4-48d7-af0a-7a4bc3ff9a28}</Project>
|
||||
<Name>DataStreamInterface</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="GetDblValueDlg.resx">
|
||||
<DependentUpon>GetDblValueDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MeterSimulationDlg.resx">
|
||||
<DependentUpon>MeterSimulationDlg.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</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>
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
namespace DataStreamMeter
|
||||
{
|
||||
partial class GetDblValueDlg
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.valueTextBox = new System.Windows.Forms.TextBox();
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// valueTextBox
|
||||
//
|
||||
this.valueTextBox.Location = new System.Drawing.Point(35, 20);
|
||||
this.valueTextBox.Name = "valueTextBox";
|
||||
this.valueTextBox.Size = new System.Drawing.Size(94, 20);
|
||||
this.valueTextBox.TabIndex = 0;
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.okButton.Location = new System.Drawing.Point(216, 16);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(75, 29);
|
||||
this.okButton.TabIndex = 1;
|
||||
this.okButton.Text = "OK";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancelButton.Location = new System.Drawing.Point(306, 16);
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.Size = new System.Drawing.Size(75, 29);
|
||||
this.cancelButton.TabIndex = 2;
|
||||
this.cancelButton.Text = "Cancel";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// GetFlowDlg
|
||||
//
|
||||
this.AcceptButton = this.okButton;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.cancelButton;
|
||||
this.ClientSize = new System.Drawing.Size(396, 58);
|
||||
this.Controls.Add(this.cancelButton);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.Controls.Add(this.valueTextBox);
|
||||
this.Name = "GetFlowDlg";
|
||||
this.Text = "Enter flow";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox valueTextBox;
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.Button cancelButton;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DataStreamMeter
|
||||
{
|
||||
public partial class GetDblValueDlg : Form
|
||||
{
|
||||
public double DblValue;
|
||||
|
||||
double lowerLimit;
|
||||
double upperLimit;
|
||||
|
||||
|
||||
public GetDblValueDlg()
|
||||
: this("Enter flow in [m3/h] please")
|
||||
{
|
||||
}
|
||||
|
||||
public GetDblValueDlg(string title)
|
||||
: this(title, 0, 100.0)
|
||||
{
|
||||
}
|
||||
|
||||
public GetDblValueDlg(string title, double lowerLimit, double upperLimit)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Text = title;
|
||||
this.lowerLimit = lowerLimit;
|
||||
this.upperLimit = upperLimit;
|
||||
}
|
||||
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
double val;
|
||||
if (TryParseUDouble(valueTextBox.Text, out val))
|
||||
{
|
||||
DblValue = val;
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Invalid value");
|
||||
DialogResult = DialogResult.None;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parse an unsigned double number
|
||||
/// </summary>
|
||||
bool TryParseUDouble(string text, out double result)
|
||||
{
|
||||
return double.TryParse(text, NumberStyles.AllowDecimalPoint, CultureInfo.CurrentCulture, out result) ||
|
||||
double.TryParse(text, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out result);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
|
||||
namespace DataStreamMeter
|
||||
{
|
||||
public class MeterDataEventArgs : EventArgs
|
||||
{
|
||||
public State State;
|
||||
public double Time;
|
||||
public double Volume;
|
||||
public double Flow;
|
||||
|
||||
public MeterDataEventArgs(State state, double time, double volume, double flow)
|
||||
{
|
||||
State = state;
|
||||
Time = time;
|
||||
Volume = volume;
|
||||
Flow = flow;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,351 @@
|
||||
using System;
|
||||
using System.ComponentModel.Composition;
|
||||
using DataStreamInterface;
|
||||
|
||||
namespace DataStreamMeter
|
||||
{
|
||||
[Export(typeof(IDataStreamMeter))]
|
||||
public class MeterSimulation : IDataStreamMeter
|
||||
{
|
||||
MeterSimulationDlg modelessDlg;
|
||||
|
||||
/// Water meter specification
|
||||
public readonly string MeterID = "3141592653";
|
||||
public const Unit TimeUnits = Unit.s; /// Unit.s, Unit.ms, ...
|
||||
public const Unit VolumeUnits = Unit.l; /// Unit.l, Unit.USgal, ...
|
||||
public const Unit FlowUnits = Unit.m3ph; /// Unit.m3ph, Unit.USgalps, Unit.cfs, ...
|
||||
public const double SamplingPeriodSec = 0.125; /// Sampling period in seconds (here 125 ms, 8 Hz)
|
||||
public readonly double SamplingPeriod;
|
||||
|
||||
|
||||
public const Int64 MaxSamplesCount = 40000; /// Maximal test time is SamplingPeriod * MaxSamplesCount
|
||||
Sample[] samples = new Sample[MaxSamplesCount];
|
||||
Int64 storedSamplesCount;
|
||||
|
||||
|
||||
readonly object stateChangeAndTimerTickLock = new object();
|
||||
public State State;
|
||||
string connectionParameters;
|
||||
|
||||
/// initialTime is time when simulation started
|
||||
/// (lastSampleTime - initialTime).TotalSeconds is multiple of Sampling Period
|
||||
DateTime initialTime;
|
||||
|
||||
/// Last user interface tick info
|
||||
bool lastTickValid;
|
||||
State lastTickState;
|
||||
|
||||
/// Values incrementally updated on each timer tick
|
||||
double currentTime;
|
||||
double currentVolume;
|
||||
double currentFlow;
|
||||
double currentFlow_m3ph;
|
||||
|
||||
DateTime startTimeStamp; /// Measurement start DateTime
|
||||
double startTime; /// Measurement start time in seconds
|
||||
DateTime stopTimeStamp; /// Measurement end DateTime
|
||||
double stopTime; /// Measurement end time in seconds
|
||||
|
||||
|
||||
public MeterSimulation()
|
||||
{
|
||||
modelessDlg = null;
|
||||
State = State.Disconnected;
|
||||
SamplingPeriod = DataStreamInterface.Units.ConvertTo(TimeUnits, SamplingPeriodSec);
|
||||
lastTickValid = false;
|
||||
initialTime = DateTime.Now.Date; /// An arbitrary initial time (in this case the last midnight)
|
||||
}
|
||||
|
||||
public Unit GetTimeUnits()
|
||||
{
|
||||
return TimeUnits;
|
||||
}
|
||||
|
||||
public Unit GetVolumeUnits()
|
||||
{
|
||||
return VolumeUnits;
|
||||
}
|
||||
|
||||
public int GetQuantitiesCount()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public string GetQuantityCaption(int quantityNr)
|
||||
{
|
||||
if (quantityNr == 0) return "Flow";
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public Unit GetQuantityUnits(int quantityNr)
|
||||
{
|
||||
if (quantityNr == 0) return FlowUnits;
|
||||
return Unit.None;
|
||||
}
|
||||
|
||||
|
||||
public int GetMetersCount()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public bool OpenConnection(int meterIx, string connectionParameters, out string meterID)
|
||||
{
|
||||
lock (stateChangeAndTimerTickLock)
|
||||
{
|
||||
if (State != State.Disconnected)
|
||||
{
|
||||
/// Meter is already connected
|
||||
meterID = MeterID;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Connect the meter
|
||||
meterID = MeterID;
|
||||
this.connectionParameters = connectionParameters;
|
||||
lastTickValid = false;
|
||||
State = State.Connected;
|
||||
}
|
||||
|
||||
/// Open modeless form
|
||||
modelessDlg = new MeterSimulationDlg(this, MeterID);
|
||||
modelessDlg.Show();
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool CloseConnection(int meterIx)
|
||||
{
|
||||
bool closeModelessDlg = false;
|
||||
|
||||
lock (stateChangeAndTimerTickLock)
|
||||
{
|
||||
if (State != State.Disconnected)
|
||||
{
|
||||
State = State.Disconnected;
|
||||
storedSamplesCount = 0;
|
||||
closeModelessDlg = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (closeModelessDlg)
|
||||
{
|
||||
if (modelessDlg != null) modelessDlg.Close();
|
||||
modelessDlg = null;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool CloseConnectionAll()
|
||||
{
|
||||
return CloseConnection(0);
|
||||
}
|
||||
|
||||
public bool Shutdown()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool GetState(int meterIx, out int state, out string parameter)
|
||||
{
|
||||
state = (int)this.State;
|
||||
parameter = this.connectionParameters;
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool SetState(int meterIx, int state, string parameter)
|
||||
{
|
||||
/// It's not allowed to change the satate in this demo
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool SetStateAll(int state, string parameter)
|
||||
{
|
||||
return SetState(0, state, parameter);
|
||||
}
|
||||
|
||||
public bool StartMeasurement(int meterIx = 0)
|
||||
{
|
||||
lock (stateChangeAndTimerTickLock)
|
||||
{
|
||||
if (State == State.Connected)
|
||||
{
|
||||
startTimeStamp = DateTime.Now;
|
||||
startTime = TimeInSecondsFromDateTime(startTimeStamp, initialTime, SamplingPeriodSec);
|
||||
storedSamplesCount = 0;
|
||||
State = State.MeasurementInProgress;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool StartMeasurementAll()
|
||||
{
|
||||
return StartMeasurement(0);
|
||||
}
|
||||
|
||||
public bool StopMeasurement(int meterIx, out Int64 storedFramesCount)
|
||||
{
|
||||
lock (stateChangeAndTimerTickLock)
|
||||
{
|
||||
if (State == State.MeasurementInProgress)
|
||||
{
|
||||
stopTimeStamp = DateTime.Now;
|
||||
stopTime = TimeInSecondsFromDateTime(stopTimeStamp, initialTime, SamplingPeriodSec);
|
||||
|
||||
int newSamplesCount = Convert.ToInt32(Math.Round((stopTime - currentTime) / SamplingPeriodSec));
|
||||
double time = Units.ConvertTo(TimeUnits, currentTime);
|
||||
double volume = currentVolume;
|
||||
double volumeIncrement = Units.ConvertTo(VolumeUnits, currentFlow_m3ph * (SamplingPeriodSec / 3.6));
|
||||
for (int i = 0; i < newSamplesCount; i++)
|
||||
{
|
||||
time += SamplingPeriod;
|
||||
volume += volumeIncrement;
|
||||
if (storedSamplesCount < MaxSamplesCount)
|
||||
{
|
||||
samples[storedSamplesCount++] = new Sample(time, volume, currentFlow);
|
||||
}
|
||||
}
|
||||
|
||||
State = State.Connected;
|
||||
storedFramesCount = storedSamplesCount;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
storedFramesCount = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool StopMeasurementAll(out Int64[] storedFramesCount)
|
||||
{
|
||||
storedFramesCount = new Int64[1];
|
||||
return StopMeasurement(0, out storedFramesCount[0]);
|
||||
}
|
||||
|
||||
public void TimerTick(double flow_m3ph)
|
||||
{
|
||||
lock (stateChangeAndTimerTickLock)
|
||||
{
|
||||
double lastSampleTime = TimeInSecondsFromDateTime(DateTime.Now, initialTime, SamplingPeriodSec);
|
||||
currentFlow_m3ph = flow_m3ph;
|
||||
currentFlow = Units.ConvertTo(FlowUnits, flow_m3ph);
|
||||
|
||||
if (!lastTickValid)
|
||||
{
|
||||
currentTime = lastSampleTime;
|
||||
currentVolume = 0;
|
||||
lastTickValid = true;
|
||||
lastTickState = State;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
int newSamplesCount = Convert.ToInt32(Math.Round((lastSampleTime - currentTime) / SamplingPeriodSec));
|
||||
double volumeIncrement = Units.ConvertTo(VolumeUnits, currentFlow_m3ph * (SamplingPeriodSec / 3.6));
|
||||
for (int i = 0; i < newSamplesCount; i++)
|
||||
{
|
||||
currentTime += SamplingPeriodSec;
|
||||
currentVolume += volumeIncrement;
|
||||
|
||||
if (State == State.MeasurementInProgress && currentTime > startTime && storedSamplesCount < MaxSamplesCount)
|
||||
{
|
||||
samples[storedSamplesCount++] = new Sample(Units.ConvertTo(TimeUnits, currentTime), currentVolume, currentFlow);
|
||||
}
|
||||
}
|
||||
currentTime = lastSampleTime; /// Rectify, prevent error propagation
|
||||
lastTickState = State;
|
||||
}
|
||||
}
|
||||
|
||||
modelessDlg.OnMeterdata(new MeterDataEventArgs(State, currentTime, currentVolume, currentFlow));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Obtain the last time instance before 'DateTime time' which is multiple of samplingPeriod-s after 'DateTime initialTime'.
|
||||
/// </summary>
|
||||
/// <param name="time">Time to be converted to seconds and rounded to samplingPeriod-s</param>
|
||||
/// <param name="startTime">Initial time</param>
|
||||
/// <param name="samplePeriod">Sampling period in seconds</param>
|
||||
/// <returns></returns>
|
||||
double TimeInSecondsFromDateTime(DateTime time, DateTime initialTime, double samplingPeriod)
|
||||
{
|
||||
TimeSpan span = time - initialTime;
|
||||
return samplingPeriod * Math.Floor(span.TotalSeconds / samplingPeriod);
|
||||
}
|
||||
|
||||
|
||||
///---------------------------
|
||||
/// Datastream data exchange
|
||||
///---------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Retuns 'count' data frames starting with data frame with ID = 'id'
|
||||
/// </summary>
|
||||
/// <param name="id">First frame ID</param>
|
||||
/// <param name="count">Frames count</param>
|
||||
/// <returns>Selected data frames</returns>
|
||||
public DataFrame[] GetFrames(int meterIx, Int64 startID, int count)
|
||||
{
|
||||
DataFrame[] frames = new DataFrame[count];
|
||||
|
||||
if (State != State.MeasurementInProgress)
|
||||
{
|
||||
for (int j = 0; j < count; j++)
|
||||
{
|
||||
Int64 id = startID + j;
|
||||
if (id < storedSamplesCount)
|
||||
{
|
||||
frames[j] = new DataFrame(id, samples[id].Time, samples[id].Volume, new double[1] { samples[id].Flow });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return frames;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns ID of the data frame where time equals or exceeds the specified time.
|
||||
/// When time of the first frame (ID=0) is larger then specified time, function returns 0.
|
||||
/// </summary>
|
||||
/// <param name="time">Time</param>
|
||||
/// <returns>ID of the data frame at or after the pecified time</returns>
|
||||
public Int64 GetID(int meterIx, double time)
|
||||
{
|
||||
if (storedSamplesCount == 0) return -1;
|
||||
|
||||
Int64 lo = 0;
|
||||
Int64 hi = storedSamplesCount - 1;
|
||||
|
||||
if (samples[hi].Time < time) return -1;
|
||||
|
||||
while (lo < hi)
|
||||
{
|
||||
Int64 mid = (lo + hi) / 2;
|
||||
if (samples[mid].Time < time)
|
||||
{
|
||||
lo = mid + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
hi = mid;
|
||||
}
|
||||
}
|
||||
|
||||
return lo;
|
||||
}
|
||||
}
|
||||
|
||||
public enum State
|
||||
{
|
||||
Disconnected = 0,
|
||||
Connected = 1,
|
||||
MeasurementInProgress = 2,
|
||||
}
|
||||
}
|
||||
+323
@@ -0,0 +1,323 @@
|
||||
namespace DataStreamMeter
|
||||
{
|
||||
partial class MeterSimulationDlg
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.meterIDGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.volumeUnitsTextBox = new System.Windows.Forms.TextBox();
|
||||
this.timeUnitsTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.meterIDTextBox = new System.Windows.Forms.TextBox();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.setFlowButton = new System.Windows.Forms.Button();
|
||||
this.flowm3phTextBox = new System.Windows.Forms.TextBox();
|
||||
this.flowTrackBar = new System.Windows.Forms.TrackBar();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.flowTextBox = new System.Windows.Forms.TextBox();
|
||||
this.volumeTextBox = new System.Windows.Forms.TextBox();
|
||||
this.timeTextBox = new System.Windows.Forms.TextBox();
|
||||
this.stateTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.lastUITickTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
||||
this.meterIDGroupBox.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.flowTrackBar)).BeginInit();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// meterIDGroupBox
|
||||
//
|
||||
this.meterIDGroupBox.Controls.Add(this.label3);
|
||||
this.meterIDGroupBox.Controls.Add(this.label2);
|
||||
this.meterIDGroupBox.Controls.Add(this.volumeUnitsTextBox);
|
||||
this.meterIDGroupBox.Controls.Add(this.timeUnitsTextBox);
|
||||
this.meterIDGroupBox.Controls.Add(this.label1);
|
||||
this.meterIDGroupBox.Controls.Add(this.meterIDTextBox);
|
||||
this.meterIDGroupBox.Location = new System.Drawing.Point(12, 12);
|
||||
this.meterIDGroupBox.Name = "meterIDGroupBox";
|
||||
this.meterIDGroupBox.Size = new System.Drawing.Size(453, 105);
|
||||
this.meterIDGroupBox.TabIndex = 0;
|
||||
this.meterIDGroupBox.TabStop = false;
|
||||
this.meterIDGroupBox.Text = "Water meter info";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(18, 76);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(67, 13);
|
||||
this.label3.TabIndex = 5;
|
||||
this.label3.Text = "Volume units";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(18, 50);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(55, 13);
|
||||
this.label2.TabIndex = 4;
|
||||
this.label2.Text = "Time units";
|
||||
//
|
||||
// volumeUnitsTextBox
|
||||
//
|
||||
this.volumeUnitsTextBox.Enabled = false;
|
||||
this.volumeUnitsTextBox.Location = new System.Drawing.Point(122, 73);
|
||||
this.volumeUnitsTextBox.Name = "volumeUnitsTextBox";
|
||||
this.volumeUnitsTextBox.Size = new System.Drawing.Size(52, 20);
|
||||
this.volumeUnitsTextBox.TabIndex = 3;
|
||||
//
|
||||
// timeUnitsTextBox
|
||||
//
|
||||
this.timeUnitsTextBox.Enabled = false;
|
||||
this.timeUnitsTextBox.Location = new System.Drawing.Point(122, 47);
|
||||
this.timeUnitsTextBox.Name = "timeUnitsTextBox";
|
||||
this.timeUnitsTextBox.Size = new System.Drawing.Size(52, 20);
|
||||
this.timeUnitsTextBox.TabIndex = 2;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(18, 24);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(73, 13);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "Meter ID (s/n)";
|
||||
//
|
||||
// meterIDTextBox
|
||||
//
|
||||
this.meterIDTextBox.Enabled = false;
|
||||
this.meterIDTextBox.Location = new System.Drawing.Point(122, 21);
|
||||
this.meterIDTextBox.Name = "meterIDTextBox";
|
||||
this.meterIDTextBox.Size = new System.Drawing.Size(145, 20);
|
||||
this.meterIDTextBox.TabIndex = 0;
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.setFlowButton);
|
||||
this.groupBox1.Controls.Add(this.flowm3phTextBox);
|
||||
this.groupBox1.Controls.Add(this.flowTrackBar);
|
||||
this.groupBox1.Location = new System.Drawing.Point(12, 123);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(453, 96);
|
||||
this.groupBox1.TabIndex = 1;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Flow";
|
||||
//
|
||||
// setFlowButton
|
||||
//
|
||||
this.setFlowButton.Location = new System.Drawing.Point(289, 17);
|
||||
this.setFlowButton.Name = "setFlowButton";
|
||||
this.setFlowButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.setFlowButton.TabIndex = 4;
|
||||
this.setFlowButton.Text = "Set value";
|
||||
this.setFlowButton.UseVisualStyleBackColor = true;
|
||||
this.setFlowButton.Click += new System.EventHandler(this.setFlowButton_Click);
|
||||
//
|
||||
// flowm3phTextBox
|
||||
//
|
||||
this.flowm3phTextBox.Enabled = false;
|
||||
this.flowm3phTextBox.Location = new System.Drawing.Point(122, 19);
|
||||
this.flowm3phTextBox.Name = "flowm3phTextBox";
|
||||
this.flowm3phTextBox.Size = new System.Drawing.Size(145, 20);
|
||||
this.flowm3phTextBox.TabIndex = 3;
|
||||
//
|
||||
// flowTrackBar
|
||||
//
|
||||
this.flowTrackBar.LargeChange = 1;
|
||||
this.flowTrackBar.Location = new System.Drawing.Point(0, 43);
|
||||
this.flowTrackBar.Maximum = 25;
|
||||
this.flowTrackBar.Name = "flowTrackBar";
|
||||
this.flowTrackBar.Size = new System.Drawing.Size(447, 45);
|
||||
this.flowTrackBar.TabIndex = 2;
|
||||
this.flowTrackBar.Scroll += new System.EventHandler(this.flowTrackBar_Scroll);
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.flowTextBox);
|
||||
this.groupBox2.Controls.Add(this.volumeTextBox);
|
||||
this.groupBox2.Controls.Add(this.timeTextBox);
|
||||
this.groupBox2.Controls.Add(this.stateTextBox);
|
||||
this.groupBox2.Controls.Add(this.label8);
|
||||
this.groupBox2.Controls.Add(this.label7);
|
||||
this.groupBox2.Controls.Add(this.label6);
|
||||
this.groupBox2.Controls.Add(this.label5);
|
||||
this.groupBox2.Controls.Add(this.lastUITickTextBox);
|
||||
this.groupBox2.Controls.Add(this.label4);
|
||||
this.groupBox2.Location = new System.Drawing.Point(12, 225);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(453, 150);
|
||||
this.groupBox2.TabIndex = 2;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "State";
|
||||
//
|
||||
// flowTextBox
|
||||
//
|
||||
this.flowTextBox.Enabled = false;
|
||||
this.flowTextBox.Location = new System.Drawing.Point(122, 121);
|
||||
this.flowTextBox.Name = "flowTextBox";
|
||||
this.flowTextBox.Size = new System.Drawing.Size(99, 20);
|
||||
this.flowTextBox.TabIndex = 9;
|
||||
//
|
||||
// volumeTextBox
|
||||
//
|
||||
this.volumeTextBox.Enabled = false;
|
||||
this.volumeTextBox.Location = new System.Drawing.Point(122, 95);
|
||||
this.volumeTextBox.Name = "volumeTextBox";
|
||||
this.volumeTextBox.Size = new System.Drawing.Size(99, 20);
|
||||
this.volumeTextBox.TabIndex = 8;
|
||||
//
|
||||
// timeTextBox
|
||||
//
|
||||
this.timeTextBox.Enabled = false;
|
||||
this.timeTextBox.Location = new System.Drawing.Point(122, 68);
|
||||
this.timeTextBox.Name = "timeTextBox";
|
||||
this.timeTextBox.Size = new System.Drawing.Size(99, 20);
|
||||
this.timeTextBox.TabIndex = 7;
|
||||
//
|
||||
// stateTextBox
|
||||
//
|
||||
this.stateTextBox.Enabled = false;
|
||||
this.stateTextBox.Location = new System.Drawing.Point(122, 42);
|
||||
this.stateTextBox.Name = "stateTextBox";
|
||||
this.stateTextBox.Size = new System.Drawing.Size(99, 20);
|
||||
this.stateTextBox.TabIndex = 6;
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Location = new System.Drawing.Point(18, 124);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(29, 13);
|
||||
this.label8.TabIndex = 5;
|
||||
this.label8.Text = "Flow";
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(18, 98);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(42, 13);
|
||||
this.label7.TabIndex = 4;
|
||||
this.label7.Text = "Volume";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(18, 71);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(30, 13);
|
||||
this.label6.TabIndex = 3;
|
||||
this.label6.Text = "Time";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(18, 45);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(32, 13);
|
||||
this.label5.TabIndex = 2;
|
||||
this.label5.Text = "State";
|
||||
//
|
||||
// lastUITickTextBox
|
||||
//
|
||||
this.lastUITickTextBox.Enabled = false;
|
||||
this.lastUITickTextBox.Location = new System.Drawing.Point(122, 13);
|
||||
this.lastUITickTextBox.Name = "lastUITickTextBox";
|
||||
this.lastUITickTextBox.Size = new System.Drawing.Size(145, 20);
|
||||
this.lastUITickTextBox.TabIndex = 1;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(18, 16);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(61, 13);
|
||||
this.label4.TabIndex = 0;
|
||||
this.label4.Text = "Last UI tick";
|
||||
//
|
||||
// timer1
|
||||
//
|
||||
this.timer1.Interval = 1000;
|
||||
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
|
||||
//
|
||||
// MeterSimulationDlg
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(477, 387);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.meterIDGroupBox);
|
||||
this.Name = "MeterSimulationDlg";
|
||||
this.Text = "MeterDialog";
|
||||
this.meterIDGroupBox.ResumeLayout(false);
|
||||
this.meterIDGroupBox.PerformLayout();
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.flowTrackBar)).EndInit();
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.GroupBox meterIDGroupBox;
|
||||
private System.Windows.Forms.TextBox meterIDTextBox;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.TextBox volumeUnitsTextBox;
|
||||
private System.Windows.Forms.TextBox timeUnitsTextBox;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.TextBox flowm3phTextBox;
|
||||
private System.Windows.Forms.TrackBar flowTrackBar;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.Button setFlowButton;
|
||||
private System.Windows.Forms.Timer timer1;
|
||||
private System.Windows.Forms.TextBox lastUITickTextBox;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.TextBox flowTextBox;
|
||||
private System.Windows.Forms.TextBox volumeTextBox;
|
||||
private System.Windows.Forms.TextBox timeTextBox;
|
||||
private System.Windows.Forms.TextBox stateTextBox;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.Label label5;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DataStreamMeter
|
||||
{
|
||||
public partial class MeterSimulationDlg : Form
|
||||
{
|
||||
MeterSimulation meterSimulation;
|
||||
double currentFlow;
|
||||
|
||||
|
||||
public string MeterID;
|
||||
|
||||
|
||||
public void OnMeterdata(MeterDataEventArgs args)
|
||||
{
|
||||
if (MeterDataHandler == null) return;
|
||||
MeterDataHandler(null, args);
|
||||
}
|
||||
public event EventHandler<MeterDataEventArgs> MeterDataHandler;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor with no meter
|
||||
/// </summary>
|
||||
public MeterSimulationDlg()
|
||||
: this(null, string.Empty)
|
||||
{
|
||||
}
|
||||
|
||||
public MeterSimulationDlg(MeterSimulation meterSimulation, string meterID)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.meterSimulation = meterSimulation;
|
||||
meterIDTextBox.Text = meterID;
|
||||
|
||||
currentFlow = 0;
|
||||
flowm3phTextBox.Text = currentFlow.ToString();
|
||||
flowTrackBar.Value = Convert.ToInt32(currentFlow);
|
||||
|
||||
MeterDataHandler += delegate(object sender, MeterDataEventArgs args)
|
||||
{
|
||||
if (InvokeRequired)
|
||||
{
|
||||
Invoke(new EventHandler<MeterDataEventArgs>(DisplayMeterData), sender, args);
|
||||
}
|
||||
else
|
||||
{
|
||||
DisplayMeterData(sender, args);
|
||||
}
|
||||
};
|
||||
|
||||
if (meterSimulation != null)
|
||||
{
|
||||
timer1.Enabled = true;
|
||||
timer1.Start();
|
||||
}
|
||||
}
|
||||
|
||||
private void flowTrackBar_Scroll(object sender, EventArgs e)
|
||||
{
|
||||
currentFlow = flowTrackBar.Value;
|
||||
flowm3phTextBox.Text = currentFlow.ToString("F2");
|
||||
}
|
||||
|
||||
private void setFlowButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
GetDblValueDlg dlg = new GetDblValueDlg("Enter flow in [m3/h] please", 0, 25.0);
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
currentFlow = dlg.DblValue;
|
||||
flowm3phTextBox.Text = currentFlow.ToString();
|
||||
flowTrackBar.Value = Convert.ToInt32(currentFlow);
|
||||
}
|
||||
}
|
||||
|
||||
private void timer1_Tick(object sender, EventArgs e)
|
||||
{
|
||||
lastUITickTextBox.Text = DateTime.Now.ToString("HH:mm:ss fff");
|
||||
meterSimulation.TimerTick(currentFlow);
|
||||
}
|
||||
|
||||
void DisplayMeterData(object sender, MeterDataEventArgs args)
|
||||
{
|
||||
stateTextBox.Text = args.State.ToString();
|
||||
timeTextBox.Text = args.Time.ToString();
|
||||
volumeTextBox.Text = args.Volume.ToString();
|
||||
flowTextBox.Text = args.Flow.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -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("DataStreamMeter")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("DataStreamMeter")]
|
||||
[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("8acd46eb-c84d-4199-9f40-7420b7ebabc2")]
|
||||
|
||||
// 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,23 @@
|
||||
using System;
|
||||
|
||||
namespace DataStreamMeter
|
||||
{
|
||||
public class Sample
|
||||
{
|
||||
public readonly double Time; /// In water meter time units
|
||||
public readonly double Volume; /// In water meter colume units
|
||||
public readonly double Flow; /// In water meter flow units
|
||||
|
||||
public Sample(double time, double volume, double flow)
|
||||
{
|
||||
Time = time;
|
||||
Volume = volume;
|
||||
Flow = flow;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("time={0} volume={1} flow={2}", Time, Volume, Flow);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -645,7 +645,8 @@ namespace DeviceTest
|
||||
MessageBoxIcon.Exclamation);
|
||||
|
||||
foreach (var dev in tbfDevices) dev.StopDevice();
|
||||
tbfDevices.Clear();
|
||||
foreach (var dev in tbfDevices) dev.StopDevice2();
|
||||
tbfDevices.Clear();
|
||||
|
||||
startButton.Enabled = true;
|
||||
stopButton.Enabled = false;
|
||||
@@ -856,7 +857,8 @@ namespace DeviceTest
|
||||
}
|
||||
|
||||
foreach (var d in tbfDevices) d.StopDevice();
|
||||
}
|
||||
foreach (var d in tbfDevices) d.StopDevice2();
|
||||
}
|
||||
|
||||
private void stopButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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,72 @@
|
||||
<?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>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="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>
|
||||
+43
-42
@@ -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;
|
||||
@@ -65,8 +68,10 @@ namespace Results
|
||||
ProcedureRevision = procedure.Revision,
|
||||
ProtocolTitle = string.Empty,
|
||||
StartTime = DateTime.Now,
|
||||
DensityCorr = (float)densityCorr,
|
||||
Compound = (procedure.MetersKind == Config.Entities.MetersKind.Combined),
|
||||
RealDensity = realDensity,
|
||||
AtTemperature = atTemperature,
|
||||
Buoyancy = buoyancy,
|
||||
Compound = (procedure.MetersKind == Config.Entities.MetersKind.Combined),
|
||||
#if HEAT_METERS
|
||||
HeatMeter = (procedure.MetersKind == Config.Entities.MetersKind.HeatMeter),
|
||||
#endif
|
||||
@@ -96,45 +101,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 +157,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();
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+79
-51
@@ -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;
|
||||
@@ -10,42 +10,42 @@ namespace Results.Entities
|
||||
public class Batch
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual int BatchNr { get; set; }
|
||||
public virtual int BatchNr { get; set; }
|
||||
public virtual string ProgramVersion { get; set; }
|
||||
public virtual int TestBenchId { get; set; }
|
||||
public virtual string TestBenchName { get; set; } /// CEVAK, not mapped to DB
|
||||
public virtual string Address1 { get; set; } /// CEVAK, not mapped to DB
|
||||
public virtual string Address2 { get; set; } /// CEVAK, not mapped to DB
|
||||
public virtual string Address3 { get; set; } /// CEVAK, not mapped to DB
|
||||
public virtual string Address4 { get; set; } /// CEVAK, not mapped to DB
|
||||
public virtual string Address5 { get; set; } /// CEVAK, not mapped to DB
|
||||
public virtual string UserName { get; set; }
|
||||
public virtual int UserNumber { get; set; }
|
||||
public virtual string ProcedureName { get; set; }
|
||||
public virtual string TestBenchName { get; set; } /// CEVAK, not mapped to DB
|
||||
public virtual string Address1 { get; set; } /// CEVAK, not mapped to DB
|
||||
public virtual string Address2 { get; set; } /// CEVAK, not mapped to DB
|
||||
public virtual string Address3 { get; set; } /// CEVAK, not mapped to DB
|
||||
public virtual string Address4 { get; set; } /// CEVAK, not mapped to DB
|
||||
public virtual string Address5 { get; set; } /// CEVAK, not mapped to DB
|
||||
public virtual string UserName { get; set; }
|
||||
public virtual int UserNumber { get; set; }
|
||||
public virtual string ProcedureName { get; set; }
|
||||
public virtual bool IsRemoteProcedure { get; set; } /// Stara Tura, not mapped to DB
|
||||
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 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 RealDensity { get; set; } /// Density correction in [kg/m3]
|
||||
public virtual double AtTemperature { get; set; }
|
||||
public virtual double Buoyancy { get; set; }
|
||||
public virtual int Counter6 { get; set; }
|
||||
public virtual int Counter7 { get; set; }
|
||||
public virtual int Counter8 { get; set; }
|
||||
public virtual int Counter9 { get; set; }
|
||||
public virtual int Counter10 { get; set; }
|
||||
public virtual DateTime StartTime { get; set; }
|
||||
public virtual DateTime EndTime { get; set; }
|
||||
public virtual DateTime EndTime { get; set; }
|
||||
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 IList<WaterMeter> WaterMeters { get; set; }
|
||||
public virtual IList<TestRslt> TestRslts { get; set; }
|
||||
public virtual bool Compound { get; set; } /// Not mapped to DB now
|
||||
public virtual bool HeatMeter { get; set; } /// Not mapped to DB now
|
||||
public virtual bool RsltsPrinted { get; set; }
|
||||
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()
|
||||
{
|
||||
@@ -117,8 +117,54 @@ namespace Results.Entities
|
||||
ProtocolTitle = string.Empty;
|
||||
ProtocolTitle = string.Empty;
|
||||
Remark = string.Empty;
|
||||
RealDensity = Config.Data.RealDensity;
|
||||
AtTemperature = Config.Data.AtTemperature;
|
||||
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;
|
||||
ProtocolTitle = oriBatch.ProtocolTitle;
|
||||
Remark = oriBatch.Remark;
|
||||
RealDensity = oriBatch.RealDensity;
|
||||
AtTemperature = oriBatch.AtTemperature;
|
||||
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;
|
||||
|
||||
Tests = new List<TestData>();
|
||||
WaterMeters = new List<WaterMeter>();
|
||||
TestRslts = new List<TestRslt>();
|
||||
}
|
||||
|
||||
public virtual int PassedMetersCount()
|
||||
{
|
||||
int count = 0;
|
||||
@@ -263,24 +309,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,10 +325,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} ProtocolTitle={8} Remark={9} RealDensity={10} AtTemperature={11} Buoyancy={12} StartTime={13} EndTime={14} Dirty={15} RsltsSent={16} RsltsPrinted={17}",
|
||||
BatchNr, ProgramVersion, TestBenchId, UserName, UserNumber,
|
||||
ProcedureName, (IsRemoteProcedure ? "(R)" : ""), ProcedureRevision,
|
||||
ProtocolTitle, Remark, DensityCorr, Custom2, Custom3,
|
||||
ProtocolTitle, Remark, RealDensity, AtTemperature, Buoyancy,
|
||||
StartTime, EndTime, Dirty, RsltsSent, RsltsPrinted);
|
||||
}
|
||||
|
||||
@@ -325,9 +353,9 @@ namespace Results.Entities
|
||||
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(RealDensity);
|
||||
writer.Write(AtTemperature);
|
||||
writer.Write(Buoyancy);
|
||||
writer.Write(Counter6);
|
||||
writer.Write(Counter7);
|
||||
writer.Write(Counter8);
|
||||
@@ -392,9 +420,9 @@ namespace Results.Entities
|
||||
WatermetersStr = reader.ReadString();
|
||||
ProtocolTitle = reader.ReadString();
|
||||
Remark = reader.ReadString();
|
||||
DensityCorr = reader.ReadInt32();
|
||||
Custom2 = reader.ReadInt32();
|
||||
Custom3 = reader.ReadInt32();
|
||||
RealDensity = reader.ReadDouble();
|
||||
AtTemperature = reader.ReadDouble();
|
||||
Buoyancy = reader.ReadDouble();
|
||||
Counter6 = reader.ReadInt32();
|
||||
Counter7 = reader.ReadInt32();
|
||||
Counter8 = reader.ReadInt32();
|
||||
|
||||
@@ -22,22 +22,25 @@ 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;
|
||||
TestBenchName = benchName;
|
||||
@@ -51,6 +54,23 @@ namespace Results.Entities
|
||||
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
|
||||
|
||||
@@ -10,27 +10,26 @@ namespace Results.Entities
|
||||
public class MeterTestRslt
|
||||
{
|
||||
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 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]
|
||||
public virtual double VolumeStart { get; set; } /// Volume or energy (CompoundMeterId==5) on test start in [l] or [J]
|
||||
public virtual double VolumeEnd { get; set; } /// Volume or energy (CompoundMeterId==5) on test end in [l] or [J]
|
||||
public virtual double VolumeMeter { get; set; } /// Measured volume or energy (CompoundMeterId==5) in [l] or [J]
|
||||
public virtual double VolumeRef { get; set; } /// Reference volume or energy (CompoundMeterId==5) in [l] or [J]
|
||||
public virtual double TimestampStart { get; set; } /// [s]
|
||||
public virtual double TimestampEnd { get; set; } /// [s]
|
||||
public virtual double TestTime { get; set; } /// [s]
|
||||
public virtual double TimestampStart { get; set; } /// [s]
|
||||
public virtual double TimestampEnd { get; set; } /// [s]
|
||||
public virtual double TestTime { get; set; } /// [s]
|
||||
|
||||
/// Main result
|
||||
public virtual double Error { get; set; } /// [%]
|
||||
/// Main result
|
||||
public virtual double Error { get; set; } /// [%]
|
||||
public virtual long ErrorIndicators { get; set; } /// Not mapped to DB !!!, bit24=E25, bit25=E26, bit26=E27, bit27=E28 (error flags)
|
||||
public virtual long InfoIndicators { get; set; } /// Not mapped to DB !!!, bit24=E25, bit25=E26, bit26=E27, bit27=E28 (info flags)
|
||||
public virtual double KorrErrQ { get; set; } /// [%] not mapped to results DB, saved to Oracle DB
|
||||
public virtual bool TestDone { get; set; } /// true = test was completed
|
||||
public virtual bool Passed { get; set; } /// true = test passed, water meter is OK
|
||||
public virtual bool TestDone { get; set; } /// true = test was completed
|
||||
public virtual bool Passed { get; set; } /// true = test passed, water meter is OK
|
||||
#if ORACLE_DB
|
||||
public virtual double LastError { get; set; } /// [%] Previous test error at this Q in case Pruefindex > 1
|
||||
#endif
|
||||
@@ -38,10 +37,12 @@ namespace Results.Entities
|
||||
public virtual WaterMeter WaterMeter { get; set; } /// reference to the WaterMeter entity
|
||||
public virtual TestRslt TestRslt { get; set; } /// reference to the TestRslt entity
|
||||
|
||||
///
|
||||
/// Wrappers
|
||||
public virtual string Name() { return TestRslt.Name(); }
|
||||
///
|
||||
public virtual string Name() { return TestRslt.Name(); }
|
||||
public virtual DateTime StartTime() { return TestRslt.StartTime; }
|
||||
public virtual DateTime EndTime() { return TestRslt.EndTime; }
|
||||
public virtual DateTime EndTime() { return TestRslt.EndTime; }
|
||||
public virtual double FlowSetTime() { return TestRslt.FlowSetTime; } /// [s]
|
||||
public virtual double FlowMass() { return TestRslt.FlowMass; } /// [kg/h]
|
||||
public virtual double FlowVolume() { return TestRslt.FlowVolume; } /// [m3/h]
|
||||
@@ -114,29 +115,60 @@ 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)
|
||||
{
|
||||
CompoundMeterId = oriMTR.CompoundMeterId;
|
||||
RegReaderType = oriMTR.RegReaderType;
|
||||
PulsesMeter = oriMTR.PulsesMeter;
|
||||
PulsesMaster = oriMTR.PulsesMaster;
|
||||
PulsesPerLiter = oriMTR.PulsesPerLiter;
|
||||
VolumeStart = oriMTR.VolumeStart;
|
||||
VolumeEnd = oriMTR.VolumeEnd;
|
||||
VolumeMeter = oriMTR.VolumeMeter;
|
||||
VolumeRef = oriMTR.VolumeRef;
|
||||
TimestampStart = oriMTR.TimestampStart;
|
||||
TimestampEnd = oriMTR.TimestampEnd;
|
||||
TestTime = oriMTR.TestTime;
|
||||
Error = oriMTR.Error;
|
||||
ErrorIndicators = oriMTR.ErrorIndicators;
|
||||
InfoIndicators = oriMTR.InfoIndicators;
|
||||
KorrErrQ = oriMTR.KorrErrQ;
|
||||
TestDone = oriMTR.TestDone;
|
||||
Passed = oriMTR.Passed;
|
||||
#if ORACLE_DB
|
||||
LastError = oriMTR.LastError;
|
||||
#endif
|
||||
}
|
||||
|
||||
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 +202,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)
|
||||
|
||||
@@ -5,6 +5,7 @@ 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.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;
|
||||
}
|
||||
|
||||
/// <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
|
||||
|
||||
+186
-168
@@ -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); }
|
||||
@@ -246,46 +247,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 +348,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 +383,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 +408,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 +479,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 +620,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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -5,61 +5,97 @@ 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
|
||||
|
||||
@@ -327,6 +327,8 @@ namespace Results
|
||||
Conduct_min, /// 277
|
||||
Conduct_max, /// 278
|
||||
|
||||
InfoFlags, /// 279
|
||||
|
||||
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;
|
||||
@@ -22,10 +22,10 @@ namespace Results.Mappings
|
||||
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.RealDensity).Column("Custom1");
|
||||
Map(x => x.AtTemperature).Column("Custom2");
|
||||
Map(x => x.Buoyancy).Column("Custom3");
|
||||
|
||||
Map(x => x.Counter6);
|
||||
Map(x => x.Counter7);
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Results.Mappings
|
||||
Map(x => x.DensityIn);
|
||||
Map(x => x.DensityLine).Column("DensityOut");
|
||||
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);
|
||||
|
||||
@@ -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,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,23 @@ 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
|
||||
Count,
|
||||
None,
|
||||
}
|
||||
@@ -263,6 +266,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 +429,24 @@ 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),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,7 +505,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)
|
||||
|
||||
@@ -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("2.26.1560.0")]
|
||||
[assembly: AssemblyFileVersion("2.26.1560.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;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK</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;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
@@ -195,6 +195,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.RealDensity, w.Batch.AtTemperature))));
|
||||
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.RealDensity)));
|
||||
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
|
||||
@@ -210,22 +203,22 @@ namespace Results
|
||||
///
|
||||
/// Flow
|
||||
///
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_from, string.Format("{0} {1}", Strings.VName_Flow, Strings.from), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qfrom())));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_to, string.Format("{0} {1}", Strings.VName_Flow, Strings.to), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qto())));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow, string.Format("{0} v r", Strings.VName_Flow), Strings.Tooltip_Q_v_r, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowVolume)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_mean, string.Format("{0} rim ()", Strings.VName_Flow), Strings.Tooltip_Q_rim, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMean)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_min, string.Format("{0} ref min ()", Strings.VName_Flow), Strings.Tooltip_Q_min, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMin)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_max, string.Format("{0} ref max ()", Strings.VName_Flow), Strings.Tooltip_Q_max, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMax)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_start, string.Format("{0} ref start ()",Strings.VName_Flow),Strings.Tooltip_Q_start, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowStart)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_end, string.Format("{0} ref end ()", Strings.VName_Flow), Strings.Tooltip_Q_end, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowEnd)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Qc, string.Format("Qc"), "Calculated water meter flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V5", (w.GetMeterTestRslt(t).TestTime == 0 || w.GetTestRslt(t).PulsesMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV / w.GetMeterTestRslt(t).TestTime * 3.6 * w.GetMeterTestRslt(t).PulsesMaster / w.GetTestRslt(t).PulsesMaster)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv, string.Format("{0} ctv ()", Strings.VName_Flow), "CTV of the flow (mean val.)", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V5", (w.GetMeterTestRslt(t).TestTime == 0 || w.GetTestRslt(t).PulsesMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV / w.GetMeterTestRslt(t).TestTime * 3.6 * w.GetMeterTestRslt(t).PulsesMaster / w.GetTestRslt(t).PulsesMaster)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_min, string.Format("{0} ctv min ()", Strings.VName_Flow), "Min. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowMin / w.GetTestRslt(t).VolumeMaster)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_max, string.Format("{0} ctv max ()", Strings.VName_Flow), "Max. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowMax / w.GetTestRslt(t).VolumeMaster)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_start, string.Format("{0} ctv start ()", Strings.VName_Flow), "Start flow CTV", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowStart / w.GetTestRslt(t).VolumeMaster)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_end, string.Format("{0} ctv end ()", Strings.VName_Flow), "End flow CTV", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowEnd / w.GetTestRslt(t).VolumeMaster)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_rise, string.Format("{0} {1}", Strings.VName_Flow, Strings.rise), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QRise == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QRise)) : ""));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_fall, string.Format("{0} {1}", Strings.VName_Flow, Strings.fall), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QFall == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QFall)) : ""));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_from, string.Format("{0} {1}", Strings.VName_Flow, Strings.from), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qfrom())));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_to, string.Format("{0} {1}", Strings.VName_Flow, Strings.to), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qto())));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow, string.Format("{0} v r", Strings.VName_Flow), Strings.Tooltip_Q_v_r, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowVolume)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_mean, string.Format("{0} rim ()", Strings.VName_Flow), Strings.Tooltip_Q_rim, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMean)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_min, string.Format("{0} ref min ()", Strings.VName_Flow), Strings.Tooltip_Q_min, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMin)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_max, string.Format("{0} ref max ()", Strings.VName_Flow), Strings.Tooltip_Q_max, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMax)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_start, string.Format("{0} ref start ()",Strings.VName_Flow),Strings.Tooltip_Q_start, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowStart)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_end, string.Format("{0} ref end ()", Strings.VName_Flow), Strings.Tooltip_Q_end, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowEnd)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Qc, string.Format("Qc"), "Calculated water meter flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V5", w.GetTestRslt(t).FlowVolume)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv, string.Format("{0} ctv ()", Strings.VName_Flow), "CTV of the flow (mean val.)", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V5", w.GetTestRslt(t).FlowVolume)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_min, string.Format("{0} ctv min ()", Strings.VName_Flow), "Min. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).FlowMean == 0) ? w.GetTestRslt(t).FlowMin : w.GetTestRslt(t).FlowVolume * w.GetTestRslt(t).FlowMin / w.GetTestRslt(t).FlowMean)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_max, string.Format("{0} ctv max ()", Strings.VName_Flow), "Max. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).FlowMean == 0) ? w.GetTestRslt(t).FlowMax : w.GetTestRslt(t).FlowVolume * w.GetTestRslt(t).FlowMax / w.GetTestRslt(t).FlowMean)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_start, string.Format("{0} ctv start ()", Strings.VName_Flow), "Start flow CTV", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).FlowMean == 0) ? w.GetTestRslt(t).FlowStart : w.GetTestRslt(t).FlowVolume * w.GetTestRslt(t).FlowStart / w.GetTestRslt(t).FlowMean)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_end, string.Format("{0} ctv end ()", Strings.VName_Flow), "End flow CTV", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).FlowMean == 0) ? w.GetTestRslt(t).FlowEnd : w.GetTestRslt(t).FlowVolume * w.GetTestRslt(t).FlowEnd / w.GetTestRslt(t).FlowMean)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_rise, string.Format("{0} {1}", Strings.VName_Flow, Strings.rise), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QRise == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QRise)) : ""));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_fall, string.Format("{0} {1}", Strings.VName_Flow, Strings.fall), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QFall == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QFall)) : ""));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_sensitivity, string.Format("{0} {1}", Strings.VName_Flow, Strings.sensitivity), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QRise == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QRise)) : ""));
|
||||
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.ConstMaster, string.Format("k MID ()"), "Const. of the reference flow meter", Quantity.PulsePerLtr, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", ((w.GetTestRslt(t).ConstMaster < float.Epsilon) ? 0 : (1 / w.GetTestRslt(t).ConstMaster)))));
|
||||
@@ -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.AtTemperature)));
|
||||
#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,7 +329,7 @@ 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
|
||||
@@ -451,9 +444,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 +467,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,8 @@ namespace ResultsBrowser
|
||||
ListOfSerialNumbers,
|
||||
WZTypeIdAndTimePeriod,
|
||||
ProducedWithinTimePeriod,
|
||||
BenchAndBatchNr,
|
||||
GetListOfUsedProcedures,
|
||||
Count,
|
||||
}
|
||||
|
||||
|
||||
@@ -181,7 +181,7 @@
|
||||
//
|
||||
// parameterValueTextBox
|
||||
//
|
||||
this.parameterValueTextBox.Location = new System.Drawing.Point(325, 14);
|
||||
this.parameterValueTextBox.Location = new System.Drawing.Point(612, 13);
|
||||
this.parameterValueTextBox.Name = "parameterValueTextBox";
|
||||
this.parameterValueTextBox.Size = new System.Drawing.Size(68, 20);
|
||||
this.parameterValueTextBox.TabIndex = 1;
|
||||
@@ -189,7 +189,7 @@
|
||||
// parameterNameLabel
|
||||
//
|
||||
this.parameterNameLabel.AutoSize = true;
|
||||
this.parameterNameLabel.Location = new System.Drawing.Point(128, 17);
|
||||
this.parameterNameLabel.Location = new System.Drawing.Point(121, 17);
|
||||
this.parameterNameLabel.Name = "parameterNameLabel";
|
||||
this.parameterNameLabel.Size = new System.Drawing.Size(0, 13);
|
||||
this.parameterNameLabel.TabIndex = 0;
|
||||
|
||||
@@ -39,6 +39,8 @@ 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.Items.Add(new CQSelectionItem(CQCriteria.GetListOfUsedProcedures, "Zoznam použitých procedúr"));
|
||||
queryTypeComboBox.Text = "Všetky vodomery vyrobené v zadanom časovom období";
|
||||
|
||||
destinationFileTextBox.Text = string.Format("vysledky_hladania_{0:ddMMyyyy_HHmm}.csv", DateTime.Now);
|
||||
@@ -68,16 +70,23 @@ 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);
|
||||
(CQCriteria == CQCriteria.ProducedWithinTimePeriod) ||
|
||||
(CQCriteria == CQCriteria.GetListOfUsedProcedures);
|
||||
|
||||
if (CQCriteria == CQCriteria.WZTypeIdAndTimePeriod)
|
||||
{
|
||||
parameterGroupBox.Enabled = true;
|
||||
parameterNameLabel.Text = "WZ Type ID";
|
||||
}
|
||||
else if (CQCriteria == CQCriteria.BenchAndBatchNr)
|
||||
{
|
||||
parameterGroupBox.Enabled = true;
|
||||
parameterNameLabel.Text = "wr10=5, wr11=6, wr13=8, wr14=10, wr15=9, wr18=11, wr19=12, wr20=13, wr21=14";
|
||||
}
|
||||
else
|
||||
{
|
||||
parameterGroupBox.Enabled = false;
|
||||
|
||||
+74
-14
@@ -48,13 +48,19 @@
|
||||
this.connectionStringTextBox4 = new System.Windows.Forms.TextBox();
|
||||
this.benchNameTextBox6 = new System.Windows.Forms.TextBox();
|
||||
this.connectionStringTextBox6 = new System.Windows.Forms.TextBox();
|
||||
this.benchNameTextBox9 = new System.Windows.Forms.TextBox();
|
||||
this.connectionStringTextBox9 = new System.Windows.Forms.TextBox();
|
||||
this.benchNameTextBox8 = new System.Windows.Forms.TextBox();
|
||||
this.benchNameTextBox7 = new System.Windows.Forms.TextBox();
|
||||
this.connectionStringTextBox8 = new System.Windows.Forms.TextBox();
|
||||
this.connectionStringTextBox7 = new System.Windows.Forms.TextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// connectionStringTextBox1
|
||||
//
|
||||
this.connectionStringTextBox1.Location = new System.Drawing.Point(157, 45);
|
||||
this.connectionStringTextBox1.Name = "connectionStringTextBox1";
|
||||
this.connectionStringTextBox1.Size = new System.Drawing.Size(555, 20);
|
||||
this.connectionStringTextBox1.Size = new System.Drawing.Size(713, 20);
|
||||
this.connectionStringTextBox1.TabIndex = 3;
|
||||
//
|
||||
// benchNameLabel
|
||||
@@ -79,20 +85,20 @@
|
||||
//
|
||||
this.connectionStringTextBox2.Location = new System.Drawing.Point(157, 69);
|
||||
this.connectionStringTextBox2.Name = "connectionStringTextBox2";
|
||||
this.connectionStringTextBox2.Size = new System.Drawing.Size(555, 20);
|
||||
this.connectionStringTextBox2.Size = new System.Drawing.Size(713, 20);
|
||||
this.connectionStringTextBox2.TabIndex = 5;
|
||||
//
|
||||
// connectionStringTextBox3
|
||||
//
|
||||
this.connectionStringTextBox3.Location = new System.Drawing.Point(157, 93);
|
||||
this.connectionStringTextBox3.Name = "connectionStringTextBox3";
|
||||
this.connectionStringTextBox3.Size = new System.Drawing.Size(555, 20);
|
||||
this.connectionStringTextBox3.Size = new System.Drawing.Size(713, 20);
|
||||
this.connectionStringTextBox3.TabIndex = 7;
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.okButton.Location = new System.Drawing.Point(506, 250);
|
||||
this.okButton.Location = new System.Drawing.Point(664, 326);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(95, 38);
|
||||
this.okButton.TabIndex = 18;
|
||||
@@ -104,7 +110,7 @@
|
||||
//
|
||||
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancelButton.Location = new System.Drawing.Point(617, 250);
|
||||
this.cancelButton.Location = new System.Drawing.Point(775, 326);
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.Size = new System.Drawing.Size(95, 38);
|
||||
this.cancelButton.TabIndex = 19;
|
||||
@@ -137,7 +143,7 @@
|
||||
//
|
||||
this.languageLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.languageLabel.AutoSize = true;
|
||||
this.languageLabel.Location = new System.Drawing.Point(26, 245);
|
||||
this.languageLabel.Location = new System.Drawing.Point(26, 317);
|
||||
this.languageLabel.Name = "languageLabel";
|
||||
this.languageLabel.Size = new System.Drawing.Size(55, 13);
|
||||
this.languageLabel.TabIndex = 14;
|
||||
@@ -146,7 +152,7 @@
|
||||
// languageTextBox
|
||||
//
|
||||
this.languageTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.languageTextBox.Location = new System.Drawing.Point(29, 263);
|
||||
this.languageTextBox.Location = new System.Drawing.Point(29, 335);
|
||||
this.languageTextBox.Name = "languageTextBox";
|
||||
this.languageTextBox.Size = new System.Drawing.Size(100, 20);
|
||||
this.languageTextBox.TabIndex = 15;
|
||||
@@ -155,7 +161,7 @@
|
||||
//
|
||||
this.formatLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.formatLabel.AutoSize = true;
|
||||
this.formatLabel.Location = new System.Drawing.Point(26, 196);
|
||||
this.formatLabel.Location = new System.Drawing.Point(26, 268);
|
||||
this.formatLabel.Name = "formatLabel";
|
||||
this.formatLabel.Size = new System.Drawing.Size(94, 13);
|
||||
this.formatLabel.TabIndex = 12;
|
||||
@@ -164,9 +170,9 @@
|
||||
// timePeriodFormatTextBox
|
||||
//
|
||||
this.timePeriodFormatTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.timePeriodFormatTextBox.Location = new System.Drawing.Point(29, 215);
|
||||
this.timePeriodFormatTextBox.Location = new System.Drawing.Point(29, 287);
|
||||
this.timePeriodFormatTextBox.Name = "timePeriodFormatTextBox";
|
||||
this.timePeriodFormatTextBox.Size = new System.Drawing.Size(683, 20);
|
||||
this.timePeriodFormatTextBox.Size = new System.Drawing.Size(841, 20);
|
||||
this.timePeriodFormatTextBox.TabIndex = 13;
|
||||
//
|
||||
// benchNameTextBox5
|
||||
@@ -187,14 +193,14 @@
|
||||
//
|
||||
this.connectionStringTextBox5.Location = new System.Drawing.Point(157, 141);
|
||||
this.connectionStringTextBox5.Name = "connectionStringTextBox5";
|
||||
this.connectionStringTextBox5.Size = new System.Drawing.Size(555, 20);
|
||||
this.connectionStringTextBox5.Size = new System.Drawing.Size(713, 20);
|
||||
this.connectionStringTextBox5.TabIndex = 11;
|
||||
//
|
||||
// connectionStringTextBox4
|
||||
//
|
||||
this.connectionStringTextBox4.Location = new System.Drawing.Point(157, 117);
|
||||
this.connectionStringTextBox4.Name = "connectionStringTextBox4";
|
||||
this.connectionStringTextBox4.Size = new System.Drawing.Size(555, 20);
|
||||
this.connectionStringTextBox4.Size = new System.Drawing.Size(713, 20);
|
||||
this.connectionStringTextBox4.TabIndex = 9;
|
||||
//
|
||||
// benchNameTextBox6
|
||||
@@ -208,16 +214,64 @@
|
||||
//
|
||||
this.connectionStringTextBox6.Location = new System.Drawing.Point(157, 165);
|
||||
this.connectionStringTextBox6.Name = "connectionStringTextBox6";
|
||||
this.connectionStringTextBox6.Size = new System.Drawing.Size(555, 20);
|
||||
this.connectionStringTextBox6.Size = new System.Drawing.Size(713, 20);
|
||||
this.connectionStringTextBox6.TabIndex = 21;
|
||||
//
|
||||
// benchNameTextBox9
|
||||
//
|
||||
this.benchNameTextBox9.Location = new System.Drawing.Point(29, 237);
|
||||
this.benchNameTextBox9.Name = "benchNameTextBox9";
|
||||
this.benchNameTextBox9.Size = new System.Drawing.Size(100, 20);
|
||||
this.benchNameTextBox9.TabIndex = 26;
|
||||
//
|
||||
// connectionStringTextBox9
|
||||
//
|
||||
this.connectionStringTextBox9.Location = new System.Drawing.Point(157, 237);
|
||||
this.connectionStringTextBox9.Name = "connectionStringTextBox9";
|
||||
this.connectionStringTextBox9.Size = new System.Drawing.Size(713, 20);
|
||||
this.connectionStringTextBox9.TabIndex = 27;
|
||||
//
|
||||
// benchNameTextBox8
|
||||
//
|
||||
this.benchNameTextBox8.Location = new System.Drawing.Point(29, 213);
|
||||
this.benchNameTextBox8.Name = "benchNameTextBox8";
|
||||
this.benchNameTextBox8.Size = new System.Drawing.Size(100, 20);
|
||||
this.benchNameTextBox8.TabIndex = 24;
|
||||
//
|
||||
// benchNameTextBox7
|
||||
//
|
||||
this.benchNameTextBox7.Location = new System.Drawing.Point(29, 189);
|
||||
this.benchNameTextBox7.Name = "benchNameTextBox7";
|
||||
this.benchNameTextBox7.Size = new System.Drawing.Size(100, 20);
|
||||
this.benchNameTextBox7.TabIndex = 22;
|
||||
//
|
||||
// connectionStringTextBox8
|
||||
//
|
||||
this.connectionStringTextBox8.Location = new System.Drawing.Point(157, 213);
|
||||
this.connectionStringTextBox8.Name = "connectionStringTextBox8";
|
||||
this.connectionStringTextBox8.Size = new System.Drawing.Size(713, 20);
|
||||
this.connectionStringTextBox8.TabIndex = 25;
|
||||
//
|
||||
// connectionStringTextBox7
|
||||
//
|
||||
this.connectionStringTextBox7.Location = new System.Drawing.Point(157, 189);
|
||||
this.connectionStringTextBox7.Name = "connectionStringTextBox7";
|
||||
this.connectionStringTextBox7.Size = new System.Drawing.Size(713, 20);
|
||||
this.connectionStringTextBox7.TabIndex = 23;
|
||||
//
|
||||
// DatabaseSettingsDlg
|
||||
//
|
||||
this.AcceptButton = this.okButton;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.cancelButton;
|
||||
this.ClientSize = new System.Drawing.Size(743, 310);
|
||||
this.ClientSize = new System.Drawing.Size(901, 382);
|
||||
this.Controls.Add(this.benchNameTextBox9);
|
||||
this.Controls.Add(this.connectionStringTextBox9);
|
||||
this.Controls.Add(this.benchNameTextBox8);
|
||||
this.Controls.Add(this.benchNameTextBox7);
|
||||
this.Controls.Add(this.connectionStringTextBox8);
|
||||
this.Controls.Add(this.connectionStringTextBox7);
|
||||
this.Controls.Add(this.benchNameTextBox6);
|
||||
this.Controls.Add(this.connectionStringTextBox6);
|
||||
this.Controls.Add(this.benchNameTextBox5);
|
||||
@@ -269,5 +323,11 @@
|
||||
private System.Windows.Forms.TextBox connectionStringTextBox4;
|
||||
private System.Windows.Forms.TextBox benchNameTextBox6;
|
||||
private System.Windows.Forms.TextBox connectionStringTextBox6;
|
||||
private System.Windows.Forms.TextBox benchNameTextBox9;
|
||||
private System.Windows.Forms.TextBox connectionStringTextBox9;
|
||||
private System.Windows.Forms.TextBox benchNameTextBox8;
|
||||
private System.Windows.Forms.TextBox benchNameTextBox7;
|
||||
private System.Windows.Forms.TextBox connectionStringTextBox8;
|
||||
private System.Windows.Forms.TextBox connectionStringTextBox7;
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,9 @@ namespace ResultsBrowser.Forms
|
||||
benchNameTextBox4.Text = Program.LocalSettings.Bench4;
|
||||
benchNameTextBox5.Text = Program.LocalSettings.Bench5;
|
||||
benchNameTextBox6.Text = Program.LocalSettings.Bench6;
|
||||
benchNameTextBox7.Text = Program.LocalSettings.Bench7;
|
||||
benchNameTextBox8.Text = Program.LocalSettings.Bench8;
|
||||
benchNameTextBox9.Text = Program.LocalSettings.Bench9;
|
||||
|
||||
connectionStringTextBox1.Text = Program.LocalSettings.ConnectionString1;
|
||||
connectionStringTextBox2.Text = Program.LocalSettings.ConnectionString2;
|
||||
@@ -28,6 +31,9 @@ namespace ResultsBrowser.Forms
|
||||
connectionStringTextBox4.Text = Program.LocalSettings.ConnectionString4;
|
||||
connectionStringTextBox5.Text = Program.LocalSettings.ConnectionString5;
|
||||
connectionStringTextBox6.Text = Program.LocalSettings.ConnectionString6;
|
||||
connectionStringTextBox7.Text = Program.LocalSettings.ConnectionString7;
|
||||
connectionStringTextBox8.Text = Program.LocalSettings.ConnectionString8;
|
||||
connectionStringTextBox9.Text = Program.LocalSettings.ConnectionString9;
|
||||
|
||||
timePeriodFormatTextBox.Text = Program.LocalSettings.TimePeriodFormat;
|
||||
|
||||
@@ -53,6 +59,9 @@ namespace ResultsBrowser.Forms
|
||||
Program.LocalSettings.Bench4 = benchNameTextBox4.Text;
|
||||
Program.LocalSettings.Bench5 = benchNameTextBox5.Text;
|
||||
Program.LocalSettings.Bench6 = benchNameTextBox6.Text;
|
||||
Program.LocalSettings.Bench7 = benchNameTextBox7.Text;
|
||||
Program.LocalSettings.Bench8 = benchNameTextBox8.Text;
|
||||
Program.LocalSettings.Bench9 = benchNameTextBox9.Text;
|
||||
|
||||
Program.LocalSettings.ConnectionString1 = connectionStringTextBox1.Text;
|
||||
Program.LocalSettings.ConnectionString2 = connectionStringTextBox2.Text;
|
||||
@@ -60,6 +69,9 @@ namespace ResultsBrowser.Forms
|
||||
Program.LocalSettings.ConnectionString4 = connectionStringTextBox4.Text;
|
||||
Program.LocalSettings.ConnectionString5 = connectionStringTextBox5.Text;
|
||||
Program.LocalSettings.ConnectionString6 = connectionStringTextBox6.Text;
|
||||
Program.LocalSettings.ConnectionString7 = connectionStringTextBox7.Text;
|
||||
Program.LocalSettings.ConnectionString8 = connectionStringTextBox8.Text;
|
||||
Program.LocalSettings.ConnectionString9 = connectionStringTextBox9.Text;
|
||||
|
||||
Program.LocalSettings.TimePeriodFormat = timePeriodFormatTextBox.Text;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user