Compare commits
56
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f1cdf94f3 | ||
|
|
58a57ba215 | ||
|
|
4d77926a9e | ||
|
|
a7e2947de7 | ||
|
|
4a33339c63 | ||
|
|
7b780d72a0 | ||
|
|
7a60055413 | ||
|
|
c6f3751746 | ||
|
|
300dabc800 | ||
|
|
d51ff414ca | ||
|
|
6f65f0085e | ||
|
|
319cf0b8d4 | ||
|
|
c1daf13411 | ||
|
|
4fd107678d | ||
|
|
e1d3be7e56 | ||
|
|
4f9b07ba20 | ||
|
|
8e25fa6232 | ||
|
|
760ec598ca | ||
|
|
fd77380315 | ||
|
|
bf91dc0aa6 | ||
|
|
14a3d63f1f | ||
|
|
0a60f9c64d | ||
|
|
258fd2579f | ||
|
|
4ec2dee3a2 | ||
|
|
723bf3fdeb | ||
|
|
315cccf74c | ||
|
|
1b68ea8ab9 | ||
|
|
9111bd7346 | ||
|
|
cfdd59abce | ||
|
|
4972347605 | ||
|
|
3459a5eac5 | ||
|
|
0553caac89 | ||
|
|
4464a2025b | ||
|
|
03197dc8f3 | ||
|
|
e74c8692ce | ||
|
|
cda8359623 | ||
|
|
508315a43f | ||
|
|
9a8c9205d3 | ||
|
|
d7728d304a | ||
|
|
fd0d7dcf7b | ||
|
|
997e0d2a6b | ||
|
|
51e1e5721c | ||
|
|
34c3fa26c9 | ||
|
|
5e3e70f43a | ||
|
|
18880dc04d | ||
|
|
2673584113 | ||
|
|
e90967b6ed | ||
|
|
46489224cf | ||
|
|
d8fc4a4c36 | ||
|
|
ae18e15fba | ||
|
|
352ed581c2 | ||
|
|
b5572c20e3 | ||
|
|
1d50b7206d | ||
|
|
331803e51d | ||
|
|
ed25f1a360 | ||
|
|
111fd8d96c |
@@ -20,12 +20,16 @@ EventViewer/bin/
|
||||
EventViewer/obj/
|
||||
Events/bin/
|
||||
Events/obj/
|
||||
FeatureVectorCalculator/bin/
|
||||
FeatureVectorCalculator/obj/
|
||||
GemCard/bin
|
||||
GemCard/obj
|
||||
GenCode128/bin
|
||||
GenCode128/obj
|
||||
GraphLib/bin
|
||||
GraphLib/obj
|
||||
MergeResultsDBs/bin
|
||||
MergeResultsDBs/obj
|
||||
TracingDB/bin
|
||||
TracingDB/obj
|
||||
ResetBatchNr/bin
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BackgroundBeep.cs" />
|
||||
<Compile Include="Iperl\OptoTelegramRaw.cs" />
|
||||
<Compile Include="SerializableDictionary.cs" />
|
||||
<Compile Include="UIControls\CoolButtonCtrl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
|
||||
+81
-134
@@ -1,12 +1,21 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2017 Sensus Metering Systems
|
||||
/// Copyright (c) 2015-2021 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
namespace Common.Iperl
|
||||
{
|
||||
public class OptoTelegramRaw
|
||||
public enum OptoTelegramFlags : byte
|
||||
{
|
||||
OK = 0,
|
||||
OK_TestStart,
|
||||
OK_TestEnd,
|
||||
InvalidTelegram, /// Wrong telegram format of checksum error
|
||||
SyncError,
|
||||
}
|
||||
|
||||
public class OptoTelegramRaw
|
||||
{
|
||||
public static readonly int Length = 42;
|
||||
private static CultureInfo culture;
|
||||
@@ -96,16 +105,16 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
/// </description>
|
||||
/// <param name="data">A complete byte array data</param>
|
||||
/// <returns>true = telegram OK, false = telegram NOK</returns>
|
||||
public bool UpdateFromString(string telegram, int counter, ref Int64 volumeRawExtLast, ref Int64 timestampExtLast)
|
||||
public bool UpdateFromString(string telegram, int counter, float refFlow, ref Int64 volumeRawExtLast, ref Int64 timestampExtLast, bool isLog = false)
|
||||
{
|
||||
DateTime = DateTime.Now;
|
||||
Counter = counter;
|
||||
RefFlow = (float)Sequences.ProcessData.RefFlow.Val;
|
||||
RefFlow = refFlow;
|
||||
|
||||
if ((telegram == null) || (telegram.Length < Length) ||
|
||||
(telegram[6] != '\t') || (telegram[11] != '\t') || (telegram[16] != '\t') ||
|
||||
(telegram[23] != '\t') || (telegram[28] != '\t') || (telegram[37] != '\t') ||
|
||||
(telegram[40] != '\r') || (telegram[41] != '\n'))
|
||||
(!isLog && (telegram[40] != '\r' || telegram[41] != '\n')))
|
||||
{
|
||||
Flags = OptoTelegramFlags.InvalidTelegram;
|
||||
return false;
|
||||
@@ -119,51 +128,61 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
bool f6 = UInt32.TryParse(telegram.Substring(29, 8), NumberStyles.HexNumber, CultureInfo.CurrentCulture, out Timestamp);
|
||||
bool f7 = byte.TryParse(telegram.Substring(38, 2), NumberStyles.HexNumber, CultureInfo.CurrentCulture, out CheckSum);
|
||||
|
||||
bool allOk = f1 && f2 && f3 && f4 && f5 && f6 && f7;
|
||||
byte calculatedCheckSum = 0;
|
||||
for (int i = 0; i < Length - 4; i++)
|
||||
{
|
||||
calculatedCheckSum += (byte)telegram[i];
|
||||
}
|
||||
|
||||
bool allOk = f1 && f2 && f3 && f4 && f5 && f6 && f7 && (calculatedCheckSum == CheckSum);
|
||||
|
||||
if (allOk)
|
||||
{
|
||||
///
|
||||
/// Cope with 'VolumeRaw' overflow
|
||||
///
|
||||
Int64 uncorrected = (Int64)(((UInt64)volumeRawExtLast & 0xFFFFFFFFFF000000UL) | VolumeRaw);
|
||||
if (Math.Abs(uncorrected - volumeRawExtLast) <= 0x800000L)
|
||||
{
|
||||
VolumeRawExt = volumeRawExtLast = uncorrected;
|
||||
}
|
||||
else if (Math.Abs(uncorrected + 0x1000000L - volumeRawExtLast) <= 0x800000L)
|
||||
{
|
||||
VolumeRawExt = volumeRawExtLast = uncorrected + 0x1000000L;
|
||||
}
|
||||
else if (Math.Abs(uncorrected - 0x1000000L - volumeRawExtLast) <= 0x800000L)
|
||||
{
|
||||
VolumeRawExt = volumeRawExtLast = uncorrected - 0x1000000L;
|
||||
}
|
||||
else
|
||||
{
|
||||
VolumeRawExt = volumeRawExtLast = uncorrected;
|
||||
}
|
||||
|
||||
///
|
||||
/// Cope with 'Timestamp' overflow
|
||||
///
|
||||
uncorrected = (Int64)(((UInt64)timestampExtLast & 0xFFFFFFFF00000000UL) | Timestamp);
|
||||
if (Math.Abs(uncorrected - timestampExtLast) <= 0x80000000L)
|
||||
{
|
||||
TimestampExt = timestampExtLast = uncorrected;
|
||||
}
|
||||
else if (Math.Abs(uncorrected + 0x100000000L - timestampExtLast) <= 0x80000000L)
|
||||
{
|
||||
TimestampExt = timestampExtLast = uncorrected + 0x100000000L;
|
||||
}
|
||||
else if (Math.Abs(uncorrected - 0x100000000L - timestampExtLast) <= 0x80000000L)
|
||||
{
|
||||
TimestampExt = timestampExtLast = uncorrected - 0x100000000L;
|
||||
}
|
||||
else
|
||||
{
|
||||
TimestampExt = timestampExtLast = uncorrected;
|
||||
}
|
||||
}
|
||||
|
||||
Flags = allOk ? OptoTelegramFlags.OK : OptoTelegramFlags.InvalidTelegram;
|
||||
|
||||
///
|
||||
/// Cope with 'VolumeRaw' overflow
|
||||
///
|
||||
Int64 uncorrected = (Int64)(((UInt64)volumeRawExtLast & 0xFFFFFFFFFF000000UL) | VolumeRaw);
|
||||
if (Math.Abs(uncorrected - volumeRawExtLast) <= 0x800000L)
|
||||
{
|
||||
VolumeRawExt = volumeRawExtLast = uncorrected;
|
||||
}
|
||||
else if (Math.Abs(uncorrected + 0x1000000L - volumeRawExtLast) <= 0x800000L)
|
||||
{
|
||||
VolumeRawExt = volumeRawExtLast = uncorrected + 0x1000000L;
|
||||
}
|
||||
else if (Math.Abs(uncorrected - 0x1000000L - volumeRawExtLast) <= 0x800000L)
|
||||
{
|
||||
VolumeRawExt = volumeRawExtLast = uncorrected - 0x1000000L;
|
||||
}
|
||||
else
|
||||
{
|
||||
VolumeRawExt = volumeRawExtLast = uncorrected;
|
||||
}
|
||||
|
||||
///
|
||||
/// Cope with 'Timestamp' overflow
|
||||
///
|
||||
uncorrected = (Int64)(((UInt64)timestampExtLast & 0xFFFFFFFF00000000UL) | Timestamp);
|
||||
if (Math.Abs(uncorrected - timestampExtLast) <= 0x80000000L)
|
||||
{
|
||||
TimestampExt = timestampExtLast = uncorrected;
|
||||
}
|
||||
else if (Math.Abs(uncorrected + 0x100000000L - timestampExtLast) <= 0x80000000L)
|
||||
{
|
||||
TimestampExt = timestampExtLast = uncorrected + 0x100000000L;
|
||||
}
|
||||
else if (Math.Abs(uncorrected - 0x100000000L - timestampExtLast) <= 0x80000000L)
|
||||
{
|
||||
TimestampExt = timestampExtLast = uncorrected - 0x100000000L;
|
||||
}
|
||||
else
|
||||
{
|
||||
TimestampExt = timestampExtLast = uncorrected;
|
||||
}
|
||||
|
||||
return allOk;
|
||||
}
|
||||
|
||||
@@ -173,7 +192,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
public bool UpdateFromStringDummy(string telegram)
|
||||
{
|
||||
DateTime = DateTime.Now;
|
||||
RefFlow = (float)Sequences.ProcessData.RefFlow.Val;
|
||||
RefFlow = 0;
|
||||
|
||||
if ((telegram == null) || (telegram.Length < Length) ||
|
||||
(telegram[6] != '\t') || (telegram[11] != '\t') || (telegram[16] != '\t') ||
|
||||
@@ -184,16 +203,19 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
return false;
|
||||
}
|
||||
|
||||
//bool f1 = UInt32.TryParse(telegram.Substring(0, 6), NumberStyles.HexNumber, CultureInfo.CurrentCulture, out EmfRaw);
|
||||
//bool f2 = Int16.TryParse(telegram.Substring(7, 4), NumberStyles.HexNumber, CultureInfo.CurrentCulture, out MagneticFieldRaw);
|
||||
//bool f3 = Int16.TryParse(telegram.Substring(12, 4), NumberStyles.HexNumber, CultureInfo.CurrentCulture, out FlowRaw);
|
||||
//bool f4 = UInt32.TryParse(telegram.Substring(17, 6), NumberStyles.HexNumber, CultureInfo.CurrentCulture, out VolumeRaw);
|
||||
//bool f5 = Int16.TryParse(telegram.Substring(24, 4), NumberStyles.HexNumber, CultureInfo.CurrentCulture, out Impedance);
|
||||
//bool f6 = UInt32.TryParse(telegram.Substring(29, 8), NumberStyles.HexNumber, CultureInfo.CurrentCulture, out Timestamp);
|
||||
//bool f7 = byte.TryParse(telegram.Substring(38, 2), NumberStyles.HexNumber, CultureInfo.CurrentCulture, out CheckSum);
|
||||
//return f1 && f2 && f3 && f4 && f5 && f6 && f7;
|
||||
bool f7 = byte.TryParse(telegram.Substring(38, 2), NumberStyles.HexNumber, CultureInfo.CurrentCulture, out CheckSum);
|
||||
|
||||
return true;
|
||||
byte calculatedCheckSum = 0;
|
||||
for (int i = 0; i < Length - 4; i++)
|
||||
{
|
||||
calculatedCheckSum += (byte)telegram[i];
|
||||
}
|
||||
|
||||
bool allOk = f7 && (calculatedCheckSum == CheckSum);
|
||||
|
||||
Flags = allOk ? OptoTelegramFlags.OK : OptoTelegramFlags.InvalidTelegram;
|
||||
|
||||
return allOk;
|
||||
}
|
||||
|
||||
|
||||
@@ -241,80 +263,5 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
Label());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Filter RefFlow data in an array of OptoTelegramRaw objects by a FIR filter:
|
||||
///
|
||||
/// kSize = 5, kSize2 = 2
|
||||
///
|
||||
/// i k
|
||||
/// ---------------------------------------------------------------------------
|
||||
/// 0 -5 filtered[0] = data[0]
|
||||
/// 1 -4 filtered[1] = data[1]
|
||||
/// 2 -3 filtered[2] = data[0]*k[0] + ... + data[4]*k[4]
|
||||
/// 3 -2 filtered[3] = data[1]*k[0] + ... + data[5]*k[4]
|
||||
/// 4 -1 filtered[4] = data[2]*k[0] + ... + data[6]*k[4]
|
||||
/// 5 0 data[0] = filtered[0], filtered[0] = data[3]*k[0] + ... + data[7]*k[4]
|
||||
/// 6 1 data[1] = filtered[1], filtered[1] = data[4]*k[0] + ... + data[8]*k[4]
|
||||
/// 7 ...
|
||||
/// </summary>
|
||||
/// <param name="optoData">array of OptoTelegramRaw objects</param>
|
||||
/// <param name="from">Index of the first optoData item to process</param>
|
||||
/// <param name="to">Index of the last optoData item to process</param>
|
||||
public static void FIRFilterFlow(OptoTelegramRaw[] optoData, int from, int to)
|
||||
{
|
||||
float[] kernel = new float[] { 0.1f, 0.2f, 0.4f, 0.2f, 0.1f };
|
||||
int kSize = kernel.Length;
|
||||
int kSize2 = kernel.Length / 2;
|
||||
|
||||
float[] filtered = new float[kSize];
|
||||
|
||||
for (int i = from; i <= to; i++)
|
||||
{
|
||||
if ((i < from + kSize2) || (i > to - kSize2))
|
||||
{
|
||||
/// Beginning or end of optoData buffer => Just copy data (=do not filter)
|
||||
filtered[i % kSize] = optoData[BufferIdx(i)].RefFlow;
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Make a convolution of optoData and the kernel
|
||||
float weightedSum = 0;
|
||||
for (int j = -kSize2; j <= kSize2; j++)
|
||||
weightedSum += optoData[BufferIdx(i + j)].RefFlow * kernel[j + kSize2];
|
||||
|
||||
filtered[i % kSize] = weightedSum;
|
||||
}
|
||||
|
||||
if (i >= from + kSize)
|
||||
{
|
||||
/// filtered[] buffer full => copy filtered data to optoData
|
||||
optoData[BufferIdx(i - kSize)].RefFlow = filtered[i % kSize];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = to - kSize + 1; i <= to; i++)
|
||||
{
|
||||
if (i >= 0) optoData[BufferIdx(i)].RefFlow = filtered[i % kSize];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get index to optoData buffer
|
||||
/// </summary>
|
||||
/// <param name="index">Original unwrapped index</param>
|
||||
/// <returns>Index to the buffer</returns>
|
||||
public static int BufferIdx(int index)
|
||||
{
|
||||
if (index < IperlHead.MaxOptoDataCount)
|
||||
{
|
||||
return index;
|
||||
}
|
||||
else
|
||||
{
|
||||
return IperlHead.StartOptoDataCount + (index - IperlHead.MaxOptoDataCount) % IperlHead.EndOptoDataCount;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -17,5 +17,46 @@ namespace Common
|
||||
if (repeats == 1) return name;
|
||||
return string.Format("{0} ({1}/{2})", name, repetitionNr, repeats);
|
||||
}
|
||||
|
||||
public static void CalculateFeatureVector(Iperl.OptoTelegramRaw[] optoData, int optoDataCount, int startIx, int endIx, ref float[] x)
|
||||
{
|
||||
if (startIx < 0 || endIx >= optoDataCount || startIx >= endIx) return;
|
||||
|
||||
int n = 0;
|
||||
Int64 sumFlow = 0;
|
||||
Int64 sumFlow2 = 0;
|
||||
Int64 sumEmf = 0;
|
||||
Int64 sumEmf2 = 0;
|
||||
Int64 sumMagF = 0;
|
||||
Int64 sumMagF2 = 0;
|
||||
Int64 sumImp = 0;
|
||||
Int64 sumImp2 = 0;
|
||||
|
||||
for (int ix = startIx; ix <= endIx; ix++)
|
||||
{
|
||||
if (optoData[ix].Flags == Iperl.OptoTelegramFlags.OK ||
|
||||
optoData[ix].Flags == Iperl.OptoTelegramFlags.OK_TestStart ||
|
||||
optoData[ix].Flags == Iperl.OptoTelegramFlags.OK_TestEnd)
|
||||
{
|
||||
n++;
|
||||
sumFlow += optoData[ix].FlowRaw;
|
||||
sumFlow2 += ((int)optoData[ix].FlowRaw * (int)optoData[ix].FlowRaw);
|
||||
sumEmf += (int)optoData[ix].EmfRaw;
|
||||
sumEmf2 += ((Int64)optoData[ix].EmfRaw * (Int64)optoData[ix].EmfRaw);
|
||||
sumMagF += optoData[ix].MagneticFieldRaw;
|
||||
sumMagF2 += ((int)optoData[ix].MagneticFieldRaw * (int)optoData[ix].MagneticFieldRaw);
|
||||
sumImp += optoData[ix].Impedance;
|
||||
sumImp2 += ((int)optoData[ix].Impedance * (int)optoData[ix].Impedance);
|
||||
}
|
||||
}
|
||||
|
||||
if (n >= 2)
|
||||
{
|
||||
if (x.Length > 0) x[0] = ((float)sumFlow2 - (float)sumFlow * (float)sumFlow / n) / (n - 1);
|
||||
if (x.Length > 1) x[1] = ((float)sumEmf2 - (float)sumEmf * (float)sumEmf / n) / (n - 1);
|
||||
if (x.Length > 2) x[2] = ((float)sumMagF2 - (float)sumMagF * (float)sumMagF / n) / (n - 1);
|
||||
if (x.Length > 3) x[3] = ((float)sumImp2 - (float)sumImp * (float)sumImp / n) / (n - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;TURA_SPECIAL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;TURA_IPERL_NEW;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;TURA_SPECIAL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
|
||||
<DefineConstants>TRACE;TURA_IPERL_NEW;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace Config.Entities
|
||||
public virtual string OriName { get; set; } /// Not mapped to database
|
||||
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
|
||||
public virtual float Qto { get; set; } /// Water flow in [m3/h]
|
||||
public virtual string Selector { get; set; }
|
||||
public virtual string TempMtrUp { get; set; }
|
||||
public virtual string TempMtrDown { get; set; }
|
||||
public virtual string PressMtrUp { get; set; }
|
||||
@@ -46,7 +47,8 @@ namespace Config.Entities
|
||||
|
||||
result.Qfrom = Qfrom;
|
||||
result.Qto = Qto;
|
||||
result.TempMtrUp = TempMtrUp;
|
||||
result.Selector = Selector;
|
||||
result.TempMtrUp = TempMtrUp;
|
||||
result.TempMtrDown = TempMtrDown;
|
||||
result.PressMtrUp = PressMtrUp;
|
||||
result.PressMtrDown = PressMtrDown;
|
||||
|
||||
@@ -551,26 +551,32 @@ namespace Config.Entities
|
||||
[Description("aus")] Off,
|
||||
[Description("info")] Info,
|
||||
[Description("ein")] On,
|
||||
[Description("stopp")] Stop,
|
||||
#elif LANG_FR
|
||||
[Description("éteindre")] Off,
|
||||
[Description("info")] Info,
|
||||
[Description("allumé")] On,
|
||||
[Description("arrêter")] Stop,
|
||||
#elif LANG_CS
|
||||
[Description("vypnuto")] Off,
|
||||
[Description("info")] Info,
|
||||
[Description("zapnuto")] On,
|
||||
[Description("stop")] Stop,
|
||||
#elif LANG_RU
|
||||
[Description("выкл")] Off,
|
||||
[Description("инфо")] Info,
|
||||
[Description("вкл")] On,
|
||||
[Description("останов")] Stop,
|
||||
#elif LANG_PL
|
||||
[Description("nie")] Off,
|
||||
[Description("info")] Info,
|
||||
[Description("tak")] On,
|
||||
[Description("przestać")] Stop,
|
||||
#else // LANG_EN
|
||||
[Description("off")] Off,
|
||||
[Description("info")] Info,
|
||||
[Description("on")] On,
|
||||
[Description("stop")] Stop,
|
||||
#endif
|
||||
Count
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace Config.Entities
|
||||
public virtual string OriName { get; set; } /// Not mapped to database
|
||||
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
|
||||
public virtual float Qto { get; set; } /// Water flow in [m3/h]
|
||||
public virtual string Selector { get; set; }
|
||||
public virtual string Pump { get; set; }
|
||||
public virtual string RegulValvesPct { get; set; } /// Positions of regulation valves in % separated by ';'
|
||||
|
||||
@@ -40,12 +41,14 @@ namespace Config.Entities
|
||||
{
|
||||
FeedingPath result = new FeedingPath(name, itemNr);
|
||||
|
||||
result.Qfrom = Qfrom;
|
||||
result.Qto = Qto;
|
||||
result.Pump = Pump;
|
||||
result.Qfrom = Qfrom;
|
||||
result.Qto = Qto;
|
||||
result.Selector = Selector;
|
||||
result.Pump = Pump;
|
||||
result.RegulValvesPct = RegulValvesPct;
|
||||
result.ValvesOpen = ValvesOpen;
|
||||
result.ValvesClose = ValvesClose;
|
||||
result.ValvesOpen = ValvesOpen;
|
||||
result.ValvesClose = ValvesClose;
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace Config.Entities
|
||||
public virtual string OriName { get; set; } /// Not mapped to database
|
||||
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
|
||||
public virtual float Qto { get; set; } /// Water flow in [m3/h]
|
||||
public virtual string Selector { get; set; }
|
||||
public virtual string RegulValve { get; set; }
|
||||
public virtual string FlowMeter { get; set; }
|
||||
public virtual float PidCoef { get; set; } /// PID coefficient for the regulation path
|
||||
@@ -46,18 +47,19 @@ namespace Config.Entities
|
||||
{
|
||||
OutputPath result = new OutputPath(name, itemNr);
|
||||
|
||||
result.Name = Name;
|
||||
result.Qfrom = Qfrom;
|
||||
result.Qto = Qto;
|
||||
result.RegulValve = RegulValve;
|
||||
result.FlowMeter = FlowMeter;
|
||||
result.PidCoef = PidCoef;
|
||||
result.StartValve = StartValve;
|
||||
result.Diverter = Diverter;
|
||||
result.TempDiv = TempDiv;
|
||||
result.Scale = Scale;
|
||||
result.Name = Name;
|
||||
result.Qfrom = Qfrom;
|
||||
result.Qto = Qto;
|
||||
result.Selector = Selector;
|
||||
result.RegulValve = RegulValve;
|
||||
result.FlowMeter = FlowMeter;
|
||||
result.PidCoef = PidCoef;
|
||||
result.StartValve = StartValve;
|
||||
result.Diverter = Diverter;
|
||||
result.TempDiv = TempDiv;
|
||||
result.Scale = Scale;
|
||||
result.RegulValvesPct = RegulValvesPct;
|
||||
result.ValvesOpen = ValvesOpen;
|
||||
result.ValvesOpen = ValvesOpen;
|
||||
result.ValvesClose = ValvesClose;
|
||||
|
||||
return result;
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace DataStreamMeter
|
||||
|
||||
public int GetMetersCount()
|
||||
{
|
||||
return 1;
|
||||
return 20;
|
||||
}
|
||||
|
||||
public bool OpenConnection(int meterIx, string connectionParameters, out string meterID)
|
||||
|
||||
Generated
+1
@@ -138,6 +138,7 @@
|
||||
// eventsListView
|
||||
//
|
||||
this.eventsListView.AllowColumnReorder = true;
|
||||
this.eventsListView.CheckBoxes = true;
|
||||
this.eventsListView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.eventsListView.DoubleClickActivation = false;
|
||||
this.eventsListView.FullRowSelect = true;
|
||||
|
||||
@@ -59,8 +59,8 @@ namespace EventViewer
|
||||
ConnectionString = "SERVER=localhost; DATABASE=test-e; UID=root; PASSWORD=kraken; CHARSET=utf8";
|
||||
UsersDBConnString = "SERVER=localhost; DATABASE=test; UID=root; PASSWORD=kraken; CHARSET=utf8;";
|
||||
#else
|
||||
ConnectionString = "SERVER=10.42.128.16; DATABASE=st_wr_shared_events; UID=v9305784; PASSWORD=p89344390; CHARSET=utf8";
|
||||
UsersDBConnString = "SERVER=10.42.128.16; DATABASE=st_wr_shared_config; UID=u9305784; PASSWORD=p89344390; CHARSET=utf8;";
|
||||
ConnectionString = "SERVER=10.42.128.24; DATABASE=st_wr_shared_events; UID=v9305784; PASSWORD=p89344390; CHARSET=utf8";
|
||||
UsersDBConnString = "SERVER=10.42.128.24; DATABASE=st_wr_shared_config; UID=u9305784; PASSWORD=p89344390; CHARSET=utf8;";
|
||||
#endif
|
||||
RecentTimeDays = 7;
|
||||
Language = "sk";
|
||||
@@ -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>
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
namespace FeatureVectorCalculator
|
||||
{
|
||||
partial class CalculatorWnd
|
||||
{
|
||||
/// <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.rawFileComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.browseButton = new System.Windows.Forms.Button();
|
||||
this.processButton = new System.Windows.Forms.Button();
|
||||
this.resultsTextBox = new System.Windows.Forms.TextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// rawFileComboBox
|
||||
//
|
||||
this.rawFileComboBox.FormattingEnabled = true;
|
||||
this.rawFileComboBox.Location = new System.Drawing.Point(29, 28);
|
||||
this.rawFileComboBox.Name = "rawFileComboBox";
|
||||
this.rawFileComboBox.Size = new System.Drawing.Size(715, 21);
|
||||
this.rawFileComboBox.TabIndex = 0;
|
||||
//
|
||||
// browseButton
|
||||
//
|
||||
this.browseButton.Location = new System.Drawing.Point(769, 19);
|
||||
this.browseButton.Name = "browseButton";
|
||||
this.browseButton.Size = new System.Drawing.Size(66, 37);
|
||||
this.browseButton.TabIndex = 1;
|
||||
this.browseButton.Text = "Browse";
|
||||
this.browseButton.UseVisualStyleBackColor = true;
|
||||
this.browseButton.Click += new System.EventHandler(this.browseButton_Click);
|
||||
//
|
||||
// processButton
|
||||
//
|
||||
this.processButton.Location = new System.Drawing.Point(29, 66);
|
||||
this.processButton.Name = "processButton";
|
||||
this.processButton.Size = new System.Drawing.Size(91, 46);
|
||||
this.processButton.TabIndex = 2;
|
||||
this.processButton.Text = "Process";
|
||||
this.processButton.UseVisualStyleBackColor = true;
|
||||
this.processButton.Click += new System.EventHandler(this.processButton_Click);
|
||||
//
|
||||
// resultsTextBox
|
||||
//
|
||||
this.resultsTextBox.Location = new System.Drawing.Point(29, 131);
|
||||
this.resultsTextBox.Multiline = true;
|
||||
this.resultsTextBox.Name = "resultsTextBox";
|
||||
this.resultsTextBox.Size = new System.Drawing.Size(715, 181);
|
||||
this.resultsTextBox.TabIndex = 3;
|
||||
//
|
||||
// CalculatorWnd
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(859, 335);
|
||||
this.Controls.Add(this.resultsTextBox);
|
||||
this.Controls.Add(this.processButton);
|
||||
this.Controls.Add(this.browseButton);
|
||||
this.Controls.Add(this.rawFileComboBox);
|
||||
this.Name = "CalculatorWnd";
|
||||
this.Text = "Feature vector calculator";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.ComboBox rawFileComboBox;
|
||||
private System.Windows.Forms.Button browseButton;
|
||||
private System.Windows.Forms.Button processButton;
|
||||
private System.Windows.Forms.TextBox resultsTextBox;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using Common.Iperl;
|
||||
|
||||
namespace FeatureVectorCalculator
|
||||
{
|
||||
public partial class CalculatorWnd : Form
|
||||
{
|
||||
public const int MaxOptoDataCount = 40000;
|
||||
OptoTelegramRaw[] optoData;
|
||||
Int64 volumeRawExtLast;
|
||||
Int64 timestampExtLast;
|
||||
|
||||
|
||||
public CalculatorWnd()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
optoData = new OptoTelegramRaw[MaxOptoDataCount];
|
||||
for (int i = 0; i < MaxOptoDataCount; i++)
|
||||
{
|
||||
optoData[i] = new OptoTelegramRaw();
|
||||
}
|
||||
}
|
||||
|
||||
private void browseButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenFileDialog ofd = new OpenFileDialog();
|
||||
var dr = ofd.ShowDialog();
|
||||
rawFileComboBox.Text = ofd.FileName;
|
||||
}
|
||||
|
||||
private void processButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (optoData == null) return;
|
||||
|
||||
int counter = 0;
|
||||
int startIx = -1;
|
||||
int endIx = -1;
|
||||
|
||||
using (StreamReader reader = new StreamReader(rawFileComboBox.Text))
|
||||
{
|
||||
string line;
|
||||
while ((line = reader.ReadLine()) != null && counter < MaxOptoDataCount)
|
||||
{
|
||||
int ix = line.IndexOf(" :\t");
|
||||
|
||||
if (ix >= 0)
|
||||
{
|
||||
if (optoData[counter].UpdateFromString(line.Substring(ix + 3), counter, 0, ref volumeRawExtLast, ref timestampExtLast, true))
|
||||
{
|
||||
if (line.EndsWith("#### start test ####"))
|
||||
{
|
||||
startIx = counter;
|
||||
optoData[counter].Flags = OptoTelegramFlags.OK_TestStart;
|
||||
}
|
||||
else if (line.EndsWith("#### end of test ####"))
|
||||
{
|
||||
endIx = counter;
|
||||
optoData[counter].Flags = OptoTelegramFlags.OK_TestEnd;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
optoData[counter].Flags = OptoTelegramFlags.InvalidTelegram;
|
||||
}
|
||||
|
||||
counter++;
|
||||
}
|
||||
|
||||
reader.Close();
|
||||
}
|
||||
|
||||
float[] featureVector = new float[9];
|
||||
Common.Utils.CalculateFeatureVector(optoData, counter, startIx, endIx, ref featureVector);
|
||||
|
||||
resultsTextBox.Clear();
|
||||
for (int i = 0; i < 9; i++)
|
||||
{
|
||||
resultsTextBox.Text += string.Format("X{0} = {1}\r\n", i + 1, featureVector[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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,98 @@
|
||||
<?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>{6280F3F9-139A-48E3-8C88-25EB4124E982}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>FeatureVectorCalculator</RootNamespace>
|
||||
<AssemblyName>FeatureVectorCalculator</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>
|
||||
<PropertyGroup>
|
||||
<StartupObject>FeatureVectorCalculator.Program</StartupObject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CalculatorWnd.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="CalculatorWnd.Designer.cs">
|
||||
<DependentUpon>CalculatorWnd.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="CalculatorWnd.resx">
|
||||
<DependentUpon>CalculatorWnd.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<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="..\Common\Common.csproj">
|
||||
<Project>{c8939821-ba5c-4988-a3d0-bf53b74865c7}</Project>
|
||||
<Name>Common</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,25 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace FeatureVectorCalculator
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new CalculatorWnd());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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("FeatureVectorCalculator")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("FeatureVectorCalculator")]
|
||||
[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("4d3a6fe2-3153-4581-8ec7-e5a386b50177")]
|
||||
|
||||
// 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,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 FeatureVectorCalculator.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class 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 (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FeatureVectorCalculator.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,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FeatureVectorCalculator.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,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")]
|
||||
+30
-34
@@ -101,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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+67
-24
@@ -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 double RealDensity { get; set; } /// Density correction in [kg/m3]
|
||||
public virtual double AtTemperature { get; set; }
|
||||
public virtual double Buoyancy { 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()
|
||||
{
|
||||
@@ -122,6 +122,49 @@ namespace Results.Entities
|
||||
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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
@@ -10,36 +10,49 @@ 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 IPERL
|
||||
public virtual string ExtraDataPath { get; set; } /// Relative path to a file with opto-data/raw-data
|
||||
public virtual float X1 { get; set; }
|
||||
public virtual float X2 { get; set; }
|
||||
public virtual float X3 { get; set; }
|
||||
public virtual float X4 { get; set; }
|
||||
public virtual float X5 { get; set; }
|
||||
public virtual float X6 { get; set; }
|
||||
public virtual float X7 { get; set; }
|
||||
public virtual float X8 { get; set; }
|
||||
public virtual float X9 { get; set; }
|
||||
#endif
|
||||
#if ORACLE_DB
|
||||
public virtual double ErrorBC { get; set; } /// [%] error before correction, saved to Oracle to table VT_PRUEFREIHE_IST_PD as KorrErrQ
|
||||
public virtual double LastError { get; set; } /// [%] Previous test error at this Q in case Pruefindex > 1
|
||||
#endif
|
||||
|
||||
public virtual WaterMeter WaterMeter { get; set; } /// reference to the WaterMeter entity
|
||||
public virtual TestRslt TestRslt { get; set; } /// reference to the TestRslt entity
|
||||
|
||||
///
|
||||
/// 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 double FlowSetTime() { return TestRslt.FlowSetTime; } /// [s]
|
||||
@@ -114,28 +127,83 @@ 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;
|
||||
TestDone = oriMTR.TestDone;
|
||||
Passed = oriMTR.Passed;
|
||||
#if IPERL
|
||||
ExtraDataPath = oriMTR.ExtraDataPath;
|
||||
X1 = oriMTR.X1;
|
||||
X2 = oriMTR.X2;
|
||||
X3 = oriMTR.X3;
|
||||
X4 = oriMTR.X4;
|
||||
X5 = oriMTR.X5;
|
||||
X6 = oriMTR.X6;
|
||||
X7 = oriMTR.X7;
|
||||
X8 = oriMTR.X8;
|
||||
X9 = oriMTR.X9;
|
||||
#endif
|
||||
#if ORACLE_DB
|
||||
ErrorBC = oriMTR.ErrorBC;
|
||||
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;
|
||||
TestDone = src.TestDone;
|
||||
Passed = src.Passed;
|
||||
#if IPERL
|
||||
ExtraDataPath = src.ExtraDataPath;
|
||||
X1 = src.X1;
|
||||
X2 = src.X2;
|
||||
X3 = src.X3;
|
||||
X4 = src.X4;
|
||||
X5 = src.X5;
|
||||
X6 = src.X6;
|
||||
X7 = src.X7;
|
||||
X8 = src.X8;
|
||||
X9 = src.X9;
|
||||
#endif
|
||||
#if ORACLE_DB
|
||||
ErrorBC = src.ErrorBC;
|
||||
LastError = src.LastError;
|
||||
#endif
|
||||
}
|
||||
@@ -163,14 +231,26 @@ namespace Results.Entities
|
||||
writer.Write(Error);
|
||||
writer.Write(ErrorIndicators);
|
||||
writer.Write(InfoIndicators);
|
||||
writer.Write(KorrErrQ);
|
||||
writer.Write(TestDone);
|
||||
writer.Write(Passed);
|
||||
#if IPERL
|
||||
writer.Write((ExtraDataPath != null) ? ExtraDataPath : string.Empty);
|
||||
writer.Write(X1);
|
||||
writer.Write(X2);
|
||||
writer.Write(X3);
|
||||
writer.Write(X4);
|
||||
writer.Write(X5);
|
||||
writer.Write(X6);
|
||||
writer.Write(X7);
|
||||
writer.Write(X8);
|
||||
writer.Write(X9);
|
||||
#endif
|
||||
#if ORACLE_DB
|
||||
writer.Write(ErrorBC);
|
||||
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)
|
||||
@@ -191,10 +271,22 @@ namespace Results.Entities
|
||||
Error = reader.ReadDouble();
|
||||
ErrorIndicators = reader.ReadInt64();
|
||||
InfoIndicators = reader.ReadInt64();
|
||||
KorrErrQ = reader.ReadDouble();
|
||||
TestDone = reader.ReadBoolean();
|
||||
Passed = reader.ReadBoolean();
|
||||
#if IPERL
|
||||
ExtraDataPath = reader.ReadString();
|
||||
X1 = reader.ReadSingle();
|
||||
X2 = reader.ReadSingle();
|
||||
X3 = reader.ReadSingle();
|
||||
X4 = reader.ReadSingle();
|
||||
X5 = reader.ReadSingle();
|
||||
X6 = reader.ReadSingle();
|
||||
X7 = reader.ReadSingle();
|
||||
X8 = reader.ReadSingle();
|
||||
X9 = reader.ReadSingle();
|
||||
#endif
|
||||
#if ORACLE_DB
|
||||
ErrorBC = reader.ReadDouble();
|
||||
LastError = reader.ReadDouble();
|
||||
#endif
|
||||
TestRslt = null;
|
||||
|
||||
@@ -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
|
||||
|
||||
+180
-165
@@ -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 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 bool TestDone { get; set; }
|
||||
public virtual string Remark { get; set; }
|
||||
public virtual DateTime StartTime { get; set; } /// Date and time of the test start
|
||||
public virtual DateTime EndTime { get; set; } /// Date and time of the test end
|
||||
public virtual int FlowSetTime { get; set; } /// [s] Flow set time in seconds
|
||||
public virtual int TimeBtwnMassMsrmnts { get; set; } /// [s] Time between two mass measurements in seconds (if applicable)
|
||||
public virtual double TestTime { get; set; } /// [s] Test time in seconds
|
||||
public virtual double TestTimeCorrection { get; set; } /// [s] Correction of the test time due to diverter (0 for methods w/o diverter or when there is no correction table)
|
||||
public virtual double PulsesMaster { get; set; } /// [pls] FlyingStartMassCollectionProlonged: MID pulses of the water to the tank
|
||||
public virtual double TotalPulsesMstr { get; set; } /// [pls] FlyingStartMassCollectionProlonged: MID pulses of the complete test (not mapped to DB)
|
||||
public virtual double ConstMasterRaw { get; set; } /// [l/pls] Liters per pulse of the master flow meter uncorrected.
|
||||
public virtual double ConstMasterCorr { get; set; } /// [l/pls] Liters per pulse of the master flow meter corrected by a correction table.
|
||||
public virtual double ConstMaster { get; set; } /// [l/pls] Liters per pulse of the master flow meter calculated from a mass measurement.
|
||||
/// When mass measurement is not available, corrected by a correction table.
|
||||
public virtual double MassStartRaw { get; set; } /// [kg]
|
||||
public virtual double MassStart { get; set; } /// [kg]
|
||||
public virtual double MassEndRaw { get; set; } /// [kg]
|
||||
public virtual double MassEnd { get; set; } /// [kg]
|
||||
public virtual double DensityIn { get; set; } /// [kg/m3]
|
||||
public virtual double DensityLine { get; set; } /// [kg/m3]
|
||||
public virtual double DensityDiv { get; set; } /// [kg/m3]
|
||||
public virtual double MassOfEvapWater { get; set; } /// [kg]
|
||||
public virtual double FlowMass { get; set; } /// [kg/h] calculated from conventional true value
|
||||
public virtual double FlowVolume { get; set; } /// [m3/h]
|
||||
public virtual double VolumeCTV { get; set; } /// [l] Volume conventional true value
|
||||
public virtual double VolumeMaster { get; set; } /// [l] Volume from the master flow meter
|
||||
public virtual double ErrorMaster { get; set; } /// [%] Error of the master flow meter
|
||||
|
||||
public virtual float DiverterStart { get; set; } /// [s] Diverter switch time when test starts
|
||||
public virtual float DivStart10 { get; set; } /// [s] Diverter switch time when test starts at level 10 (e.g. 10%) (not mapped to DB)
|
||||
public virtual float DivStart50 { get; set; } /// [s] Diverter switch time when test starts at level 50 (e.g. 50%) (not mapped to DB)
|
||||
public virtual float DivStart90 { get; set; } /// [s] Diverter switch time when test starts at level 90 (e.g. 90%) (not mapped to DB)
|
||||
public virtual float DiverterStart { get; set; } /// [s] Diverter switch time when test starts
|
||||
public virtual float DivStart10 { get; set; } /// [s] Diverter switch time when test starts at level 10 (e.g. 10%) (not mapped to DB)
|
||||
public virtual float DivStart50 { get; set; } /// [s] Diverter switch time when test starts at level 50 (e.g. 50%) (not mapped to DB)
|
||||
public virtual float DivStart90 { get; set; } /// [s] Diverter switch time when test starts at level 90 (e.g. 90%) (not mapped to DB)
|
||||
|
||||
public virtual float DiverterEnd { get; set; } /// [s] Diverter switch time when test ends
|
||||
public virtual float DivEnd90 { get; set; } /// [s] Diverter switch time when test starts at level 90 (e.g. 90%) (not mapped to DB)
|
||||
public virtual float DivEnd50 { get; set; } /// [s] Diverter switch time when test starts at level 50 (e.g. 50%) (not mapped to DB)
|
||||
public virtual float DivEnd10 { get; set; } /// [s] Diverter switch time when test starts at level 10 (e.g. 10%) (not mapped to DB)
|
||||
public virtual float DiverterEnd { get; set; } /// [s] Diverter switch time when test ends
|
||||
public virtual float DivEnd90 { get; set; } /// [s] Diverter switch time when test starts at level 90 (e.g. 90%) (not mapped to DB)
|
||||
public virtual float DivEnd50 { get; set; } /// [s] Diverter switch time when test starts at level 50 (e.g. 50%) (not mapped to DB)
|
||||
public virtual float DivEnd10 { get; set; } /// [s] Diverter switch time when test starts at level 10 (e.g. 10%) (not mapped to DB)
|
||||
|
||||
public virtual long ErrorFlags { get; set; } /// bitfield : bit0=E1, bit1=E2, bit2=E3, etc.
|
||||
public virtual long InfoFlags { get; set; } /// bitfield : bit0=E1, bit1=E2, bit2=E3, etc.
|
||||
public virtual long ErrorFlags { get; set; } /// bitfield : bit0=E1, bit1=E2, bit2=E3, etc.
|
||||
public virtual long InfoFlags { get; set; } /// bitfield : bit0=E1, bit1=E2, bit2=E3, etc.
|
||||
|
||||
/// Main results of heat meters
|
||||
public virtual double RefEnergy { get; set; } /// [J] Joul
|
||||
public virtual double RefEnergy { get; set; } /// [J] Joul
|
||||
|
||||
/// Auxiliary results
|
||||
public virtual float AmbTempMean { get; set; } /// [°C] Average ambient air temperature
|
||||
public virtual float AmbTempStart { get; set; } /// [°C] Ambient air temperature on test start
|
||||
public virtual float AmbTempEnd { get; set; } /// [°C] Ambient air temperature on test end
|
||||
public virtual float AmbTempMin { get; set; } /// [°C] Minimum ambient air temperature
|
||||
public virtual float AmbTempMax { get; set; } /// [°C] Maximum ambient air temperature
|
||||
public virtual float AmbPressMean { get; set; } /// [bar] Average ambient air pressure
|
||||
public virtual float AmbPressStart { get; set; } /// [bar] Ambient air pressure on test start
|
||||
public virtual float AmbPressEnd { get; set; } /// [bar] Ambient air pressure on test end
|
||||
public virtual float AmbPressMin { get; set; } /// [bar] Minimum ambient air pressure
|
||||
public virtual float AmbPressMax { get; set; } /// [bar] Maximum ambient air pressure
|
||||
public virtual float AmbHumiMean { get; set; } /// [%] Average ambient air relative humidity
|
||||
public virtual float AmbHumiStart { get; set; } /// [%] Ambient air relative humidity on test start
|
||||
public virtual float AmbHumiEnd { get; set; } /// [%] Ambient air relative humidity on test end
|
||||
public virtual float AmbHumiMin { get; set; } /// [%] Minimum ambient air relative humidity
|
||||
public virtual float AmbHumiMax { get; set; } /// [%] Maximum ambient air relative humidity
|
||||
public virtual float PressUpMean { get; set; } /// [bar] Input water pressure (average)
|
||||
public virtual float PressUpStart { get; set; } /// [bar]
|
||||
public virtual float PressUpEnd { get; set; } /// [bar]
|
||||
public virtual float PressUpMin { get; set; } /// [bar]
|
||||
public virtual float PressUpMax { get; set; } /// [bar]
|
||||
public virtual float PressDownMean { get; set; } /// [bar]
|
||||
public virtual float PressDownStart { get; set; } /// [bar]
|
||||
public virtual float PressDownEnd { get; set; } /// [bar]
|
||||
public virtual float PressDownMin { get; set; } /// [bar]
|
||||
public virtual float PressDownMax { get; set; } /// [bar]
|
||||
public virtual float PressDeltaMean { get; set; } /// [bar]
|
||||
public virtual float PressDeltaStart { get; set; } /// [bar]
|
||||
public virtual float PressDeltaEnd { get; set; } /// [bar]
|
||||
public virtual float PressDeltaMin { get; set; } /// [bar]
|
||||
public virtual float PressDeltaMax { get; set; } /// [bar]
|
||||
public virtual float TempUpMean { get; set; } /// [°C]
|
||||
public virtual float TempUpStart { get; set; } /// [°C]
|
||||
public virtual float TempUpEnd { get; set; } /// [°C]
|
||||
public virtual float TempUpMin { get; set; } /// [°C]
|
||||
public virtual float TempUpMax { get; set; } /// [°C]
|
||||
public virtual float TempDownMean { get; set; } /// [°C]
|
||||
public virtual float TempDownStart { get; set; } /// [°C]
|
||||
public virtual float TempDownEnd { get; set; } /// [°C]
|
||||
public virtual float TempDownMin { get; set; } /// [°C]
|
||||
public virtual float TempDownMax { get; set; } /// [°C]
|
||||
public virtual float TempDivMean { get; set; } /// [°C]
|
||||
public virtual float TempDivStart { get; set; } /// [°C]
|
||||
public virtual float TempDivEnd { get; set; } /// [°C]
|
||||
public virtual float TempDivMin { get; set; } /// [°C]
|
||||
public virtual float TempDivMax { get; set; } /// [°C]
|
||||
public virtual float FlowMean { get; set; } /// [m3/h] mean flow from the reference flowmeter
|
||||
public virtual float FlowStart { get; set; } /// [m3/h] flow at the start of test from the reference flowmeter
|
||||
public virtual float FlowEnd { get; set; } /// [m3/h] flow at the end of test from the reference flowmeter
|
||||
public virtual float FlowMin { get; set; } /// [m3/h]
|
||||
public virtual float FlowMax { get; set; } /// [m3/h]
|
||||
public virtual float ConductMean { get; set; } /// [uS/cm]
|
||||
public virtual float ConductStart { get; set; } /// [uS/cm]
|
||||
public virtual float ConductEnd { get; set; } /// [uS/cm]
|
||||
public virtual float ConductMin { get; set; } /// [uS/cm]
|
||||
public virtual float ConductMax { get; set; } /// [uS/cm]
|
||||
public virtual float AmbTempMean { get; set; } /// [°C] Average ambient air temperature
|
||||
public virtual float AmbTempStart { get; set; } /// [°C] Ambient air temperature on test start
|
||||
public virtual float AmbTempEnd { get; set; } /// [°C] Ambient air temperature on test end
|
||||
public virtual float AmbTempMin { get; set; } /// [°C] Minimum ambient air temperature
|
||||
public virtual float AmbTempMax { get; set; } /// [°C] Maximum ambient air temperature
|
||||
public virtual float AmbPressMean { get; set; } /// [bar] Average ambient air pressure
|
||||
public virtual float AmbPressStart { get; set; } /// [bar] Ambient air pressure on test start
|
||||
public virtual float AmbPressEnd { get; set; } /// [bar] Ambient air pressure on test end
|
||||
public virtual float AmbPressMin { get; set; } /// [bar] Minimum ambient air pressure
|
||||
public virtual float AmbPressMax { get; set; } /// [bar] Maximum ambient air pressure
|
||||
public virtual float AmbHumiMean { get; set; } /// [%] Average ambient air relative humidity
|
||||
public virtual float AmbHumiStart { get; set; } /// [%] Ambient air relative humidity on test start
|
||||
public virtual float AmbHumiEnd { get; set; } /// [%] Ambient air relative humidity on test end
|
||||
public virtual float AmbHumiMin { get; set; } /// [%] Minimum ambient air relative humidity
|
||||
public virtual float AmbHumiMax { get; set; } /// [%] Maximum ambient air relative humidity
|
||||
public virtual float PressUpMean { get; set; } /// [bar] Input water pressure (average)
|
||||
public virtual float PressUpStart { get; set; } /// [bar]
|
||||
public virtual float PressUpEnd { get; set; } /// [bar]
|
||||
public virtual float PressUpMin { get; set; } /// [bar]
|
||||
public virtual float PressUpMax { get; set; } /// [bar]
|
||||
public virtual float PressDownMean { get; set; } /// [bar]
|
||||
public virtual float PressDownStart { get; set; } /// [bar]
|
||||
public virtual float PressDownEnd { get; set; } /// [bar]
|
||||
public virtual float PressDownMin { get; set; } /// [bar]
|
||||
public virtual float PressDownMax { get; set; } /// [bar]
|
||||
public virtual float PressDeltaMean { get; set; } /// [bar]
|
||||
public virtual float PressDeltaStart { get; set; } /// [bar]
|
||||
public virtual float PressDeltaEnd { get; set; } /// [bar]
|
||||
public virtual float PressDeltaMin { get; set; } /// [bar]
|
||||
public virtual float PressDeltaMax { get; set; } /// [bar]
|
||||
public virtual float TempUpMean { get; set; } /// [°C]
|
||||
public virtual float TempUpStart { get; set; } /// [°C]
|
||||
public virtual float TempUpEnd { get; set; } /// [°C]
|
||||
public virtual float TempUpMin { get; set; } /// [°C]
|
||||
public virtual float TempUpMax { get; set; } /// [°C]
|
||||
public virtual float TempDownMean { get; set; } /// [°C]
|
||||
public virtual float TempDownStart { get; set; } /// [°C]
|
||||
public virtual float TempDownEnd { get; set; } /// [°C]
|
||||
public virtual float TempDownMin { get; set; } /// [°C]
|
||||
public virtual float TempDownMax { get; set; } /// [°C]
|
||||
public virtual float TempDivMean { get; set; } /// [°C]
|
||||
public virtual float TempDivStart { get; set; } /// [°C]
|
||||
public virtual float TempDivEnd { get; set; } /// [°C]
|
||||
public virtual float TempDivMin { get; set; } /// [°C]
|
||||
public virtual float TempDivMax { get; set; } /// [°C]
|
||||
public virtual float FlowMean { get; set; } /// [m3/h] mean flow from the reference flowmeter
|
||||
public virtual float FlowStart { get; set; } /// [m3/h] flow at the start of test from the reference flowmeter
|
||||
public virtual float FlowEnd { get; set; } /// [m3/h] flow at the end of test from the reference flowmeter
|
||||
public virtual float FlowMin { get; set; } /// [m3/h]
|
||||
public virtual float FlowMax { get; set; } /// [m3/h]
|
||||
public virtual float ConductMean { get; set; } /// [uS/cm]
|
||||
public virtual float ConductStart { get; set; } /// [uS/cm]
|
||||
public virtual float ConductEnd { get; set; } /// [uS/cm]
|
||||
public virtual float ConductMin { get; set; } /// [uS/cm]
|
||||
public virtual float ConductMax { get; set; } /// [uS/cm]
|
||||
|
||||
public virtual float Uncertnt { get; set; } /// [%] Relative error uncertainty
|
||||
public virtual float UncertntScale { get; set; } /// [%] Contribution to uncertainty from scale
|
||||
public virtual float UncertntDensity { get; set; } /// [%] Contribution to uncertainty from density
|
||||
public virtual float UncertntTemp { get; set; } /// [%] Contribution to uncertainty from temperature
|
||||
public virtual float UncertntPressure { get; set; } /// [%] Contribution to uncertainty from pressure
|
||||
public virtual float Uncertnt { get; set; } /// [%] Relative error uncertainty
|
||||
public virtual float UncertntScale { get; set; } /// [%] Contribution to uncertainty from scale
|
||||
public virtual float UncertntDensity { get; set; } /// [%] Contribution to uncertainty from density
|
||||
public virtual float UncertntTemp { get; set; } /// [%] Contribution to uncertainty from temperature
|
||||
public virtual float UncertntPressure { get; set; } /// [%] Contribution to uncertainty from pressure
|
||||
|
||||
public virtual float Custom1 { get; set; } /// [°C] T ref hi mean
|
||||
public virtual float Custom2 { get; set; } /// [°C] T ref hi start
|
||||
public virtual float Custom3 { get; set; } /// [°C] T ref hi end
|
||||
public virtual float Custom4 { get; set; } /// [°C] T ref hi min
|
||||
public virtual float Custom5 { get; set; } /// [°C] T ref hi max
|
||||
public virtual float Custom6 { get; set; } /// [°C] T ref lo mean
|
||||
public virtual float Custom7 { get; set; } /// [°C] T ref lo start
|
||||
public virtual float Custom8 { get; set; } /// [°C] T ref lo end
|
||||
public virtual float Custom9 { get; set; } /// [°C] T ref lo min
|
||||
public virtual float Custom10 { get; set; } /// [°C] T ref lo max
|
||||
public virtual float Custom1 { get; set; } /// [°C] T ref hi mean
|
||||
public virtual float Custom2 { get; set; } /// [°C] T ref hi start
|
||||
public virtual float Custom3 { get; set; } /// [°C] T ref hi end
|
||||
public virtual float Custom4 { get; set; } /// [°C] T ref hi min
|
||||
public virtual float Custom5 { get; set; } /// [°C] T ref hi max
|
||||
public virtual float Custom6 { get; set; } /// [°C] T ref lo mean
|
||||
public virtual float Custom7 { get; set; } /// [°C] T ref lo start
|
||||
public virtual float Custom8 { get; set; } /// [°C] T ref lo end
|
||||
public virtual float Custom9 { get; set; } /// [°C] T ref lo min
|
||||
public virtual float Custom10 { get; set; } /// [°C] T ref lo max
|
||||
|
||||
public virtual int Counter1 { get; set; }
|
||||
public virtual int Counter2 { get; set; }
|
||||
public virtual int Counter3 { get; set; }
|
||||
public virtual int Counter4 { get; set; }
|
||||
public virtual int Counter5 { get; set; }
|
||||
public virtual int Counter1 { get; set; }
|
||||
public virtual int Counter2 { get; set; }
|
||||
public virtual int Counter3 { get; set; }
|
||||
public virtual int Counter4 { get; set; }
|
||||
public virtual int Counter5 { get; set; }
|
||||
|
||||
/// Wrappers
|
||||
public virtual string Name() { return Utils.GetTestName(TestData.Name, TestData.Repeats, RepetitionNr); }
|
||||
@@ -152,7 +153,10 @@ namespace Results.Entities
|
||||
public virtual double TargetVolume() { return TestData.TargetVolume; }
|
||||
public virtual double TargetTime() { return TestData.TargetTime; }
|
||||
public virtual string Method() { return TestData.Method; }
|
||||
public virtual string RefFlowmeter() { return (Components != null) ? Components.Flowmeter : string.Empty; }
|
||||
public virtual string RefFlowmeter() { return (Components != null && Components.Flowmeter != null) ? Components.Flowmeter : string.Empty; }
|
||||
public virtual string Scale() { return (Components != null && Components.Scale != null) ? Components.Scale : string.Empty; }
|
||||
public virtual string Diverter() { return (Components != null && Components.Diverter != null) ? Components.Diverter : string.Empty; }
|
||||
public virtual string RegValve() { return (Components != null && Components.RegValve != null) ? Components.RegValve : string.Empty; }
|
||||
public virtual bool IsRelErrTest() { return (MethodClass != null) ? (MethodClass.Contains("FixedStart") || MethodClass.Contains("FlyingStart") || MethodClass.Contains("CombinedWithDetection") || MethodClass.Contains("DiverterTest") || MethodClass.Contains("ManualEntry")) : true; }
|
||||
public virtual bool IsPMaxTest() { return (MethodClass != null) ? (MethodClass.Contains("PMaxTest") || MethodClass.Contains("LeakTest") || TestData.Method.ToLower().Contains("pmax")) : true; }
|
||||
public virtual bool IsStartStop() { return (MethodClass != null) ? MethodClass.Contains("FixedStart") : true; }
|
||||
@@ -246,46 +250,51 @@ namespace Results.Entities
|
||||
{
|
||||
if (src == null) return;
|
||||
|
||||
Components = src.Components; /// ???
|
||||
Part = src.Part;
|
||||
RepetitionNr = src.RepetitionNr;
|
||||
MethodClass = src.MethodClass;
|
||||
TestDone = src.TestDone;
|
||||
Remark = src.Remark;
|
||||
StartTime = src.StartTime;
|
||||
EndTime = src.EndTime;
|
||||
FlowSetTime = src.FlowSetTime;
|
||||
Components = src.Components; /// ???
|
||||
|
||||
Part = src.Part;
|
||||
RepetitionNr = src.RepetitionNr;
|
||||
MethodClass = src.MethodClass;
|
||||
TestDone = src.TestDone;
|
||||
Remark = src.Remark;
|
||||
StartTime = src.StartTime;
|
||||
EndTime = src.EndTime;
|
||||
FlowSetTime = src.FlowSetTime;
|
||||
TimeBtwnMassMsrmnts = src.TimeBtwnMassMsrmnts;
|
||||
TestTime = src.TestTime;
|
||||
PulsesMaster = src.PulsesMaster;
|
||||
TotalPulsesMstr = src.TotalPulsesMstr;
|
||||
ConstMasterRaw = src.ConstMasterRaw;
|
||||
ConstMasterCorr = src.ConstMasterCorr;
|
||||
ConstMaster = src.ConstMaster;
|
||||
MassStartRaw = src.MassStartRaw;
|
||||
MassStart = src.MassStart;
|
||||
MassEndRaw = src.MassEndRaw;
|
||||
MassEnd = src.MassEnd;
|
||||
DensityIn = src.DensityIn;
|
||||
DensityLine = src.DensityLine;
|
||||
DensityDiv = src.DensityDiv;
|
||||
MassOfEvapWater = src.MassOfEvapWater;
|
||||
FlowMass = src.FlowMass;
|
||||
FlowVolume = src.FlowVolume;
|
||||
VolumeCTV = src.VolumeCTV;
|
||||
VolumeMaster = src.VolumeMaster;
|
||||
ErrorMaster = src.ErrorMaster;
|
||||
TestTime = src.TestTime;
|
||||
TestTimeCorrection = src.TestTimeCorrection;
|
||||
PulsesMaster = src.PulsesMaster;
|
||||
TotalPulsesMstr = src.TotalPulsesMstr;
|
||||
ConstMasterRaw = src.ConstMasterRaw;
|
||||
ConstMasterCorr = src.ConstMasterCorr;
|
||||
ConstMaster = src.ConstMaster;
|
||||
MassStartRaw = src.MassStartRaw;
|
||||
MassStart = src.MassStart;
|
||||
MassEndRaw = src.MassEndRaw;
|
||||
MassEnd = src.MassEnd;
|
||||
DensityIn = src.DensityIn;
|
||||
DensityLine = src.DensityLine;
|
||||
DensityDiv = src.DensityDiv;
|
||||
MassOfEvapWater = src.MassOfEvapWater;
|
||||
FlowMass = src.FlowMass;
|
||||
FlowVolume = src.FlowVolume;
|
||||
VolumeCTV = src.VolumeCTV;
|
||||
VolumeMaster = src.VolumeMaster;
|
||||
ErrorMaster = src.ErrorMaster;
|
||||
|
||||
DiverterStart = src.DiverterStart;
|
||||
DivStart10 = src.DivStart10;
|
||||
DivStart50 = src.DivStart50;
|
||||
DivStart90 = src.DivStart90;
|
||||
DiverterEnd = src.DiverterEnd;
|
||||
DivEnd10 = src.DivEnd10;
|
||||
DivEnd50 = src.DivEnd50;
|
||||
DivEnd90 = src.DivEnd90;
|
||||
DivStart10 = src.DivStart10;
|
||||
DivStart50 = src.DivStart50;
|
||||
DivStart90 = src.DivStart90;
|
||||
DiverterEnd = src.DiverterEnd;
|
||||
DivEnd10 = src.DivEnd10;
|
||||
DivEnd50 = src.DivEnd50;
|
||||
DivEnd90 = src.DivEnd90;
|
||||
|
||||
ErrorFlags = src.ErrorFlags;
|
||||
InfoFlags = src.InfoFlags;
|
||||
RefEnergy = src.RefEnergy;
|
||||
|
||||
AmbTempMean = src.AmbTempMean;
|
||||
AmbTempStart = src.AmbTempStart;
|
||||
AmbTempEnd = src.AmbTempEnd;
|
||||
@@ -342,15 +351,21 @@ namespace Results.Entities
|
||||
ConductMin = src.ConductMin;
|
||||
ConductMax = src.ConductMax;
|
||||
|
||||
Custom1 = src.Custom1;
|
||||
Custom2 = src.Custom2;
|
||||
Custom3 = src.Custom3;
|
||||
Custom4 = src.Custom4;
|
||||
Custom5 = src.Custom5;
|
||||
Custom6 = src.Custom6;
|
||||
Custom7 = src.Custom7;
|
||||
Custom8 = src.Custom8;
|
||||
Custom9 = src.Custom9;
|
||||
Uncertnt = src.Uncertnt;
|
||||
UncertntScale = src.UncertntScale;
|
||||
UncertntDensity = src.UncertntDensity;
|
||||
UncertntTemp = src.UncertntTemp;
|
||||
UncertntPressure = src.UncertntPressure;
|
||||
|
||||
Custom1 = src.Custom1;
|
||||
Custom2 = src.Custom2;
|
||||
Custom3 = src.Custom3;
|
||||
Custom4 = src.Custom4;
|
||||
Custom5 = src.Custom5;
|
||||
Custom6 = src.Custom6;
|
||||
Custom7 = src.Custom7;
|
||||
Custom8 = src.Custom8;
|
||||
Custom9 = src.Custom9;
|
||||
Custom10 = src.Custom10;
|
||||
|
||||
Counter1 = src.Counter1;
|
||||
|
||||
@@ -459,33 +459,34 @@ 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
|
||||
RadioAddress = src.RadioAddress;
|
||||
@@ -501,19 +502,19 @@ namespace Results.Entities
|
||||
ProdQ2CorrLR = src.ProdQ2CorrLR;
|
||||
#endif
|
||||
#if ORACLE_DB
|
||||
AssignedSerialNr = src.AssignedSerialNr;
|
||||
Prefix = src.Prefix;
|
||||
Suffix = src.Suffix;
|
||||
CompleteSerialNr = src.CompleteSerialNr;
|
||||
WMTypeRevision = src.WMTypeRevision;
|
||||
Pruefindex = src.Pruefindex;
|
||||
HydrPruefung = src.HydrPruefung;
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -284,7 +284,7 @@ namespace Results.Forms
|
||||
|
||||
private void OnTimer(object source, EventArgs e)
|
||||
{
|
||||
if (DateTime.Compare(lastSizeChange, lastRedraw) > 0)
|
||||
if (DateTime.Compare(lastSizeChange, lastRedraw) > 0 && !flowLayoutPanel.IsDisposed)
|
||||
{
|
||||
/// The last size change was more recent then the last redraw
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace Results.Forms
|
||||
|
||||
/// Update background color
|
||||
string message = string.Empty;
|
||||
Update(wMtr.GetColorOfResults(false, out message));
|
||||
UpdateBkColor(wMtr.GetColorOfResults(false, out message));
|
||||
|
||||
/// Update caption
|
||||
#if ORACLE_DB
|
||||
@@ -90,7 +90,7 @@ namespace Results.Forms
|
||||
#endif
|
||||
|
||||
/// Header
|
||||
lView.Columns.Add(wmPosition.ToString(), (columnWidths != null && columnWidths.Length > 0) ? columnWidths[0] : 40);
|
||||
lView.Columns.Add(wMtr.WMPosition.ToString(), (columnWidths != null && columnWidths.Length > 0) ? columnWidths[0] : 40);
|
||||
int col = 1;
|
||||
foreach (var str in wMtr.GetAllDecoratedTestNames())
|
||||
{
|
||||
@@ -139,7 +139,7 @@ namespace Results.Forms
|
||||
/// Private
|
||||
///
|
||||
|
||||
void Update(int wmPosition)
|
||||
void UpdateWMPos(int wmPosition)
|
||||
{
|
||||
this.wmPosition = wmPosition;
|
||||
if (lView.Columns.Count > 0)
|
||||
@@ -148,7 +148,7 @@ namespace Results.Forms
|
||||
}
|
||||
}
|
||||
|
||||
void Update(Color backColor)
|
||||
void UpdateBkColor(Color backColor)
|
||||
{
|
||||
if (this.bkColor != backColor)
|
||||
{
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace Results.Forms
|
||||
|
||||
/// Update background color
|
||||
string message = string.Empty;
|
||||
Update(wMtr.GetColorOfResults(false, out message));
|
||||
UpdateBkColor(wMtr.GetColorOfResults(false, out message));
|
||||
|
||||
/// Update caption
|
||||
#if ORACLE_DB
|
||||
@@ -101,7 +101,7 @@ namespace Results.Forms
|
||||
tBox.Text = caption = string.Format("s/n = {0}", string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr);
|
||||
#endif
|
||||
|
||||
Update(wMtr.WMPosition);
|
||||
UpdateWMPos(wMtr.WMPosition);
|
||||
|
||||
/// Update test results
|
||||
IList<string> testNames = wMtr.GetAllDecoratedTestNames();
|
||||
@@ -149,7 +149,7 @@ namespace Results.Forms
|
||||
/// Private
|
||||
///
|
||||
|
||||
void Update(int wmPosition)
|
||||
void UpdateWMPos(int wmPosition)
|
||||
{
|
||||
this.wmPosition = wmPosition;
|
||||
if (lView.Columns.Count > 0)
|
||||
@@ -158,7 +158,7 @@ namespace Results.Forms
|
||||
}
|
||||
}
|
||||
|
||||
void Update(Color backColor)
|
||||
void UpdateBkColor(Color backColor)
|
||||
{
|
||||
if (this.bkColor != backColor)
|
||||
{
|
||||
|
||||
@@ -328,6 +328,19 @@ namespace Results
|
||||
Conduct_max, /// 278
|
||||
|
||||
InfoFlags, /// 279
|
||||
Scale, /// 280
|
||||
Diverter, /// 281
|
||||
RegValve, /// 282
|
||||
|
||||
X1, /// 283
|
||||
X2,
|
||||
X3,
|
||||
X4,
|
||||
X5,
|
||||
X6,
|
||||
X7,
|
||||
X8,
|
||||
X9, /// 291
|
||||
|
||||
Count,
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2015-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using Results.Entities;
|
||||
@@ -24,10 +24,22 @@ namespace Results.Mappings
|
||||
Map(x => x.TimestampEnd);
|
||||
Map(x => x.TestTime);
|
||||
Map(x => x.Error);
|
||||
Map(x => x.TestDone);
|
||||
Map(x => x.TestDone);
|
||||
Map(x => x.Passed);
|
||||
#if IPERL
|
||||
Map(x => x.ExtraDataPath);
|
||||
Map(x => x.X1);
|
||||
Map(x => x.X2);
|
||||
Map(x => x.X3);
|
||||
Map(x => x.X4);
|
||||
Map(x => x.X5);
|
||||
Map(x => x.X6);
|
||||
Map(x => x.X7);
|
||||
Map(x => x.X8);
|
||||
Map(x => x.X9);
|
||||
#endif
|
||||
#if ORACLE_DB
|
||||
Map(x => x.LastError);
|
||||
Map(x => x.ErrorBC).Column("LastError");
|
||||
#endif
|
||||
References(x => x.WaterMeter);
|
||||
References(x => x.TestRslt);
|
||||
|
||||
@@ -9,23 +9,24 @@ namespace Results.Output
|
||||
{
|
||||
public enum LogType
|
||||
{
|
||||
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)
|
||||
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
|
||||
Just_Q3Q2Q1, /// pNrs = -1,3,2,1
|
||||
Just_Q3Q2Q1_Alt, /// pNrs = -1,5,2,1
|
||||
Just_Q3Q2adjQ1, /// pNrs = -1,3,2,1
|
||||
Just_Q3Q2adjQ1_Alt, /// pNrs = -1,5,2,1
|
||||
JustA0A4_Q3Q2adjQ1, /// pNrs = -2,-1,3,2,1 (Australia 169 MHz, raw data pNrs: -2,-1,4,3,2,1)
|
||||
DEWA, /// Q4, Q3, Q2adj, Q2, Q1
|
||||
DEWA_wo_Q2, /// Q4, Q3, Q2adj, Q1
|
||||
Suez, /// Two directions, with Q2 and Q2ac
|
||||
Suez_smart, /// There is only Q2ac in both directions
|
||||
Suez_Repeatability, /// 3xQ3, 3xQ2, 3xQ1
|
||||
Suez_EMP_DN15, /// EMP: 12 flow rates
|
||||
Suez_EMP_DN20, /// EMP: 12 flow rates
|
||||
Suez_EMP_DN32, /// EMP: 12 flow rates
|
||||
Suez_EMP_DN40, /// EMP: 12 flow rates
|
||||
Greece, /// Q3, Q2adj, Q2, Q1
|
||||
S620, /// Q3, Q100, Q2, Q1
|
||||
S620_Alt, /// Q3, Q100, Q2, Q1
|
||||
S620_Kiwa,
|
||||
Count,
|
||||
None,
|
||||
}
|
||||
@@ -266,18 +267,18 @@ namespace Results.Output
|
||||
new SensusTestInfo("Q1", 1, "Q1", 1, "01", 1, "Q1", Range.R100_110),
|
||||
};
|
||||
|
||||
case LogType.JustA0A4_Q3Q2adjQ1:
|
||||
case LogType.JustA0A4_Q3Q2adjQ1: /// Australia 169 MHz
|
||||
return new SensusTestInfo[]
|
||||
{
|
||||
/// TBF Oracle DB Opto RAW LU logfiles
|
||||
new SensusTestInfo("Q2adj", 0, "", 2, "02", 0, "", Range.R100_110),
|
||||
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", 3, "03", 3, "Q3", Range.R90_100),
|
||||
new SensusTestInfo("Q2", 2, "Q2", 0, "", 2, "Q2", Range.R100_110),
|
||||
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[]
|
||||
{
|
||||
@@ -447,6 +448,15 @@ 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_Kiwa:
|
||||
return new SensusTestInfo[]
|
||||
{
|
||||
/// TBF Oracle DB Opto RAW LU logfiles
|
||||
new SensusTestInfo("Q4", 5, "Q4", 5, "04", 5, "Q4", Range.R90_100),
|
||||
new SensusTestInfo("Q2", 2, "Q2", 2, "02", 2, "Q2", Range.R100_110),
|
||||
new SensusTestInfo("Q1", 1, "Q1", 1, "01", 1, "Q1", Range.R100_110),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -505,7 +515,7 @@ namespace Results.Output
|
||||
///
|
||||
static bool TestShouldBeIncluded(Config.Entities.Test test)
|
||||
{
|
||||
return test.DoEvaluate && !test.Method.ToLower().Contains("iperlcommunication");
|
||||
return test.DoEvaluate && test.IsRegular() && !test.Method.ToLower().Contains("iperlcommunication");
|
||||
}
|
||||
///
|
||||
public static SensusTestInfo CreateFromTest(Config.Entities.Test test, int repetitionNr, int luID, string fullTestNameWoPart)
|
||||
|
||||
@@ -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.1560.0")]
|
||||
[assembly: AssemblyFileVersion("2.26.1560.0")]
|
||||
[assembly: AssemblyVersion("2.26.1622.0")]
|
||||
[assembly: AssemblyFileVersion("2.26.1622.0")]
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;TURA_SPECIAL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;TURA_IPERL_NEW;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;TURA_SPECIAL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
|
||||
<DefineConstants>TRACE;TURA_IPERL_NEW;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
|
||||
@@ -331,8 +331,11 @@ namespace Results
|
||||
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.ThreeState, "Three state result", Quantity.Enumerated, ItemCategory.MeterResult, (w, t, u, f, p) => FormatThreeState(f, w.ThreeStateFromTests())));
|
||||
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.RefFlowmeter, "Ref. flowmeter", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).RefFlowmeter()) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.ResultOrErrorFlags, "Winiki lub E", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.PassedOrErrorFlagsStr()))); /// PL specific result
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.RefFlowmeter, "Ref. flowmeter", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).RefFlowmeter()) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Scale, "Scale", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).Scale()) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Diverter, "Diverter", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).Diverter()) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.RegValve, "Reg. valve", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).RegValve()) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.ResultOrErrorFlags, "Winiki lub E", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.PassedOrErrorFlagsStr()))); /// PL specific result
|
||||
|
||||
///
|
||||
/// Water meter info
|
||||
@@ -437,7 +440,16 @@ namespace Results
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrLFlow, "iPerl Q2Corr LR", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrLR)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrFlowRight, "iPerl Q2CorrFlowRight", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrFlowRight)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.FW_Version, "iPerl FW version", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.FWVersion)));
|
||||
#if ORACLE_DB
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.X1, "X1 ()", Quantity.Number, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", (w.GetMeterTestRslt(t) != null) ? w.GetMeterTestRslt(t).X1 : 0)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.X2, "X2 ()", Quantity.Number, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", (w.GetMeterTestRslt(t) != null) ? w.GetMeterTestRslt(t).X2 : 0)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.X3, "X3 ()", Quantity.Number, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", (w.GetMeterTestRslt(t) != null) ? w.GetMeterTestRslt(t).X3 : 0)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.X4, "X4 ()", Quantity.Number, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", (w.GetMeterTestRslt(t) != null) ? w.GetMeterTestRslt(t).X4 : 0)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.X5, "X5 ()", Quantity.Number, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", (w.GetMeterTestRslt(t) != null) ? w.GetMeterTestRslt(t).X5 : 0)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.X6, "X6 ()", Quantity.Number, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", (w.GetMeterTestRslt(t) != null) ? w.GetMeterTestRslt(t).X6 : 0)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.X7, "X7 ()", Quantity.Number, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", (w.GetMeterTestRslt(t) != null) ? w.GetMeterTestRslt(t).X7 : 0)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.X8, "X8 ()", Quantity.Number, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", (w.GetMeterTestRslt(t) != null) ? w.GetMeterTestRslt(t).X8 : 0)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.X9, "X9 ()", Quantity.Number, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", (w.GetMeterTestRslt(t) != null) ? w.GetMeterTestRslt(t).X9 : 0)));
|
||||
#if ORACLE_DB
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Max_test_index, "iPerl test index", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, (w.Pruefindex % 100))));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.OraWMTypeID, "OraDB WM Type ID", Quantity.Number, ItemCategory.MeterData, (w, t, u, f, p) => FormatInt(f, w.WaterMeterData.WMTypeId)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.OraWMTypeRev, "OraDB WM Type Rev.", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.WMTypeRevision)));
|
||||
|
||||
@@ -126,8 +126,6 @@ namespace ResultsBrowser
|
||||
Bench5 = "WR15";
|
||||
Bench6 = "WR18";
|
||||
Bench7 = "WR19";
|
||||
Bench8 = "WR20";
|
||||
Bench9 = "WR21";
|
||||
ConnectionString1 = "SERVER=10.42.129.253; DATABASE=st-wr10-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;";
|
||||
ConnectionString2 = "SERVER=10.42.129.27; DATABASE=st-wr11-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;";
|
||||
ConnectionString3 = "SERVER=10.42.128.138; DATABASE=st-wr13-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;";
|
||||
@@ -135,8 +133,6 @@ namespace ResultsBrowser
|
||||
ConnectionString5 = "SERVER=10.42.130.97; DATABASE=st-wr15-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;";
|
||||
ConnectionString6 = "SERVER=10.42.130.165; DATABASE=st-wr18-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;";
|
||||
ConnectionString7 = "SERVER=10.42.128.159; DATABASE=st-wr19-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;";
|
||||
ConnectionString8 = "SERVER=10.42.130.76; DATABASE=st-wr20-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;";
|
||||
ConnectionString9 = "SERVER=10.42.128.150; DATABASE=st-wr21-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CharSet=utf8;";
|
||||
Language = "SK";
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace ResultsBrowser
|
||||
|
||||
/// Local program configuration directory including the trailing backslash
|
||||
ExecutableDirectory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
|
||||
#if false
|
||||
#if true
|
||||
/// Config directory is a sibling directory of the executable directory
|
||||
ConfigDirectory = Path.Combine(ExecutableDirectory, "..", string.Format("Cfg{0}", (args.Length >= 1) ? args[0] : string.Empty));
|
||||
LogDirectory = Path.Combine(ExecutableDirectory, "..\\Log\\");
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;TURA_SPECIAL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;TURA_IPERL_NEW;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
@@ -32,7 +32,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;TURA_SPECIAL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
|
||||
<DefineConstants>TRACE;TURA_IPERL_NEW;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
|
||||
@@ -79,6 +79,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataStreamInterfaceTest", "
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataStreamMeter", "DataStreamMeter\DataStreamMeter.csproj", "{E6925701-57A6-4167-B5C4-BF670F1DE310}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MergeResultsDBs", "MergeResultsDBs\MergeResultsDBs.csproj", "{9786D0A8-BA9A-41F6-9E61-C7B2B76D4C08}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FeatureVectorCalculator", "FeatureVectorCalculator\FeatureVectorCalculator.csproj", "{6280F3F9-139A-48E3-8C88-25EB4124E982}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -343,6 +347,26 @@ Global
|
||||
{E6925701-57A6-4167-B5C4-BF670F1DE310}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{E6925701-57A6-4167-B5C4-BF670F1DE310}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{E6925701-57A6-4167-B5C4-BF670F1DE310}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{9786D0A8-BA9A-41F6-9E61-C7B2B76D4C08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9786D0A8-BA9A-41F6-9E61-C7B2B76D4C08}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9786D0A8-BA9A-41F6-9E61-C7B2B76D4C08}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{9786D0A8-BA9A-41F6-9E61-C7B2B76D4C08}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{9786D0A8-BA9A-41F6-9E61-C7B2B76D4C08}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{9786D0A8-BA9A-41F6-9E61-C7B2B76D4C08}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9786D0A8-BA9A-41F6-9E61-C7B2B76D4C08}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9786D0A8-BA9A-41F6-9E61-C7B2B76D4C08}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{9786D0A8-BA9A-41F6-9E61-C7B2B76D4C08}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{9786D0A8-BA9A-41F6-9E61-C7B2B76D4C08}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{6280F3F9-139A-48E3-8C88-25EB4124E982}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6280F3F9-139A-48E3-8C88-25EB4124E982}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6280F3F9-139A-48E3-8C88-25EB4124E982}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{6280F3F9-139A-48E3-8C88-25EB4124E982}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{6280F3F9-139A-48E3-8C88-25EB4124E982}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{6280F3F9-139A-48E3-8C88-25EB4124E982}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6280F3F9-139A-48E3-8C88-25EB4124E982}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6280F3F9-139A-48E3-8C88-25EB4124E982}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{6280F3F9-139A-48E3-8C88-25EB4124E982}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{6280F3F9-139A-48E3-8C88-25EB4124E982}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -18,68 +18,54 @@ namespace TBF.BenchControl.Ambient.Comet
|
||||
public class Ambient : ComponentBase, IDevice, IOperation, GenericDevices.IAmbient
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Ambient));
|
||||
public override string ToString() { return string.Format("Ambient({0})", Cfg.ToString(1)); }
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
private readonly AmbientCfg ambientCfg;
|
||||
|
||||
/// Private fields
|
||||
SerialPort serialPort;
|
||||
|
||||
/// <summary>The state of the measurement</summary>
|
||||
MsrmntState msrmntState;
|
||||
int msrmntTimeStamp;
|
||||
|
||||
/// Measured values when MsrmntState == MsrmntState.Valid
|
||||
float temperature; /// [°C]
|
||||
float pressure; /// [bar]
|
||||
float humidity; /// [R%]
|
||||
|
||||
/// <summary>Last valid measurement time stamp</summary>
|
||||
int msrmntTimeStamp;
|
||||
|
||||
public Ambient()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ambient temperature / humidity / pressure meter 'Greco' connected via serial interface (RS232)
|
||||
/// </summary>
|
||||
public Ambient(AmbientCfg cfg, IList<Generic.IComponent> components)
|
||||
: this(cfg)
|
||||
{
|
||||
}
|
||||
public Ambient() { }
|
||||
|
||||
public Ambient(Generic.IComponentCfg cfg)
|
||||
/// <summary>
|
||||
/// Ambient temperature / humidity / pressure meter 'Comet' connected via serial interface (RS232)
|
||||
/// </summary>
|
||||
public Ambient(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
ambientCfg = cfg as AmbientCfg;
|
||||
log.Warn(this.ToString());
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
public override void Initialize()
|
||||
{
|
||||
if (ambientCfg.DebugLevel == DebugMode.Simulate)
|
||||
{
|
||||
temperature = 20.0f;
|
||||
humidity = 40.0f;
|
||||
pressure = 1.0f;
|
||||
|
||||
msrmntTimeStamp = StateMachine.Time;
|
||||
msrmntState = MsrmntState.Valid;
|
||||
return;
|
||||
}
|
||||
|
||||
string comPortName = "COM" + ambientCfg.ComPortNr.ToString();
|
||||
serialPort = new SerialPort(comPortName, ambientCfg.BaudRate, ambientCfg.Parity, ambientCfg.DataBits, ambientCfg.StopBits);
|
||||
serialPort.Handshake = ambientCfg.Handshake;
|
||||
serialPort.Open();
|
||||
if (ambientCfg.SetDtrToOne)
|
||||
{
|
||||
serialPort.DtrEnable = true;
|
||||
}
|
||||
|
||||
temperature = 20.0f;
|
||||
humidity = 40.0f;
|
||||
pressure = 1.0f;
|
||||
msrmntTimeStamp = 0;
|
||||
msrmntState = MsrmntState.Busy;
|
||||
|
||||
log.FatalFormat("Successfully initialized device {0}", ToString());
|
||||
if (ambientCfg.DebugLevel == DebugMode.Normal)
|
||||
{
|
||||
string comPortName = "COM" + ambientCfg.ComPortNr.ToString();
|
||||
serialPort = new SerialPort(comPortName, ambientCfg.BaudRate, ambientCfg.Parity, ambientCfg.DataBits, ambientCfg.StopBits);
|
||||
serialPort.Handshake = ambientCfg.Handshake;
|
||||
serialPort.Open();
|
||||
if (ambientCfg.SetDtrToOne) serialPort.DtrEnable = true;
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
serialPort = null;
|
||||
log.FatalFormat("{0} simulated: {1}", Name, this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Run this device</summary>
|
||||
@@ -112,7 +98,6 @@ namespace TBF.BenchControl.Ambient.Comet
|
||||
pressure = (float)value / 10000.0f;
|
||||
|
||||
msrmntTimeStamp = StateMachine.Time;
|
||||
msrmntState = MsrmntState.Valid;
|
||||
|
||||
UpdateProcessData(temperature, pressure, humidity);
|
||||
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.Ambient.Comet
|
||||
{
|
||||
public string ClassName { get { return "Comet-Ambient"; } }
|
||||
|
||||
public void ResetStaticProperties() { Ambient.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new Ambient(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Ambient(cfg); }
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace TBF.BenchControl.Ambient.Greco
|
||||
public class Ambient : ComponentBase, IDevice, IOperation, GenericDevices.IAmbient
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Ambient));
|
||||
public override string ToString() { return string.Format("Ambient({0})", Cfg.ToString(1)); }
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
private readonly AmbientCfg ambientCfg;
|
||||
|
||||
@@ -28,9 +28,6 @@ namespace TBF.BenchControl.Ambient.Greco
|
||||
SerialPort serialPort;
|
||||
StringBuilder measurementBuilder;
|
||||
|
||||
/// <summary>The state of the measurement</summary>
|
||||
MsrmntState msrmntState;
|
||||
|
||||
///
|
||||
/// Measured values when MsrmntState == MsrmntState.Valid
|
||||
///
|
||||
@@ -38,49 +35,43 @@ namespace TBF.BenchControl.Ambient.Greco
|
||||
float pressure; /// [bar]
|
||||
float humidity; /// [R%]
|
||||
|
||||
/// <summary>Measurement time stamp when MsrmntState == MsrmntState.Valid</summary>
|
||||
/// <summary>Last valid measurement time stamp</summary>
|
||||
int msrmntTimeStamp;
|
||||
|
||||
public Ambient()
|
||||
{
|
||||
}
|
||||
|
||||
public Ambient() { }
|
||||
|
||||
/// <summary>
|
||||
/// Ambient temperature / humidity / pressure meter 'Greco' connected via serial interface (RS232)
|
||||
/// Connection settings: 19200 Bd 8-bits No-parity 1-stop-bit Flow control: none or hardware.
|
||||
/// </summary>
|
||||
public Ambient(AmbientCfg cfg, IList<Generic.IComponent> components)
|
||||
: this(cfg)
|
||||
{
|
||||
}
|
||||
|
||||
public Ambient(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
ambientCfg = cfg as AmbientCfg;
|
||||
log.Warn(this.ToString());
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
public override void Initialize()
|
||||
{
|
||||
if (ambientCfg.DebugLevel == DebugMode.Simulate)
|
||||
temperature = 20.0f;
|
||||
humidity = 40.0f;
|
||||
pressure = 1.0f;
|
||||
msrmntTimeStamp = 0;
|
||||
|
||||
if (ambientCfg.DebugLevel == DebugMode.Normal)
|
||||
{
|
||||
string comPortName = "COM" + ambientCfg.ComPortNr.ToString();
|
||||
serialPort = new SerialPort(comPortName, ambientCfg.BaudRate, ambientCfg.Parity, ambientCfg.DataBits, ambientCfg.StopBits);
|
||||
serialPort.Handshake = ambientCfg.Handshake;
|
||||
serialPort.Open();
|
||||
measurementBuilder = new StringBuilder(40);
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
temperature = 20.0f;
|
||||
humidity = 40.0f;
|
||||
pressure = 1.0f;
|
||||
msrmntTimeStamp = StateMachine.Time;
|
||||
msrmntState = MsrmntState.Valid;
|
||||
return;
|
||||
}
|
||||
|
||||
string comPortName = "COM" + ambientCfg.ComPortNr.ToString();
|
||||
serialPort = new SerialPort(comPortName, ambientCfg.BaudRate, ambientCfg.Parity, ambientCfg.DataBits, ambientCfg.StopBits);
|
||||
serialPort.Handshake = ambientCfg.Handshake;
|
||||
serialPort.Open();
|
||||
measurementBuilder = new StringBuilder(40);
|
||||
msrmntState = MsrmntState.Busy;
|
||||
|
||||
log.FatalFormat("Successfully initialized device {0}", ToString());
|
||||
serialPort = null;
|
||||
log.FatalFormat("{0} simulated: {1}", Name, this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Run this device</summary>
|
||||
@@ -136,7 +127,6 @@ namespace TBF.BenchControl.Ambient.Greco
|
||||
|
||||
UpdateProcessData(temperature, pressure, humidity);
|
||||
msrmntTimeStamp = StateMachine.Time;
|
||||
msrmntState = MsrmntState.Valid;
|
||||
log.InfoFormat("Ambient: temperature = {0:F1} C, humidity = {1:F1} %, pressure = {2:F0} mbar", temperature, humidity, 1000 * pressure);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.Ambient.Greco
|
||||
{
|
||||
public string ClassName { get { return "Greco Ambient"; } }
|
||||
|
||||
public void ResetStaticProperties() { Ambient.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new Ambient(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Ambient(cfg); }
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace TBF.BenchControl
|
||||
public string Name;
|
||||
public float Qfrom;
|
||||
public float Qto;
|
||||
public string Selector;
|
||||
public ITempMeter TempMtrUp;
|
||||
public ITempMeter TempMtrDown;
|
||||
public IPressureMeter PressMtrUp;
|
||||
@@ -36,6 +37,7 @@ namespace TBF.BenchControl
|
||||
{
|
||||
Qfrom = entity.Qfrom;
|
||||
Qto = entity.Qto;
|
||||
Selector = entity.Selector;
|
||||
TempMtrUp = TbfComponents.FindComponent(entity.TempMtrUp, components) as ITempMeter;
|
||||
TempMtrDown = TbfComponents.FindComponent(entity.TempMtrDown, components) as ITempMeter;
|
||||
PressMtrUp = TbfComponents.FindComponent(entity.PressMtrUp, components) as IPressureMeter;
|
||||
|
||||
@@ -8,18 +8,18 @@ using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl
|
||||
{
|
||||
public class ComponentBase : IComponent
|
||||
public abstract class ComponentBase : IComponent
|
||||
{
|
||||
readonly Generic.IComponentCfg cfg;
|
||||
public Generic.IComponentCfg Cfg { get { return cfg; } }
|
||||
|
||||
public string Name { get { return cfg.Name; } }
|
||||
public string ClassName { get { return cfg.Factory.ClassName; } }
|
||||
public string ParentName { get { return cfg.ParentName; } }
|
||||
public Generic.IComponentFactory Factory { get { return cfg.Factory; } }
|
||||
public int ItemNr { get { return cfg.ItemNr; } }
|
||||
public DebugMode DebugLevel { get { return cfg.DebugLevel; } set { cfg.DebugLevel = value; } }
|
||||
public LogLevel LogLevel { get { return cfg.LogLevel; } }
|
||||
public string Name { get { return cfg.Name; } }
|
||||
public string ClassName { get { return cfg.Factory.ClassName; } }
|
||||
public string ParentName { get { return cfg.ParentName; } }
|
||||
public IComponentFactory Factory { get { return cfg.Factory; } }
|
||||
public int ItemNr { get { return cfg.ItemNr; } }
|
||||
public DebugMode DebugLevel { get { return cfg.DebugLevel; } set { cfg.DebugLevel = value; } }
|
||||
public LogLevel LogLevel { get { return cfg.LogLevel; } }
|
||||
|
||||
public IList<MeasurementCorrection> Corrections
|
||||
{
|
||||
@@ -49,8 +49,7 @@ namespace TBF.BenchControl
|
||||
this.cfg = cfg;
|
||||
}
|
||||
|
||||
/// <summary> Empty implementation, might be overriden in derived classes </summary>
|
||||
public static void ResetStaticProperties() { }
|
||||
public abstract void Initialize();
|
||||
|
||||
/// <summary> Empty implementation, might be overriden in derived classes </summary>
|
||||
public virtual void StartChangeHandler() { }
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace TBF.BenchControl.Danfoss.VLT2800
|
||||
public class Pump : ComponentBase, IDevice, IOperation, GenericDevices.IPumpFM, GenericDevices.IValve
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Pump));
|
||||
public override string ToString() { return string.Format("Pump-Danfoss-VLT2800({0})", Cfg.ToString(1)); }
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
private readonly PumpCfg pumpCfg;
|
||||
|
||||
@@ -86,21 +86,15 @@ namespace TBF.BenchControl.Danfoss.VLT2800
|
||||
/// Pump power in [%] in range 0 .. 100.0f
|
||||
/// </summary>
|
||||
private float power;
|
||||
public float Power
|
||||
{
|
||||
get { return power; }
|
||||
}
|
||||
public float Power { get { return power; } }
|
||||
|
||||
|
||||
readonly Elde.ControlBoardDev controlBoard;
|
||||
readonly int bitPosition; /// 0 .. 63
|
||||
|
||||
public readonly UInt128 Mask; /// derived from bitPosition in the constructor
|
||||
int bitNr; /// 0 .. 127
|
||||
public UInt128 Mask; /// derived from bitPosition in the constructor
|
||||
|
||||
public bool State
|
||||
{
|
||||
get { return (controlBoard.Route & Mask) != 0; }
|
||||
}
|
||||
public bool State { get { return (controlBoard.Route & Mask) != 0; } }
|
||||
|
||||
/// Private fields
|
||||
SerialPort serialPort;
|
||||
@@ -109,9 +103,7 @@ namespace TBF.BenchControl.Danfoss.VLT2800
|
||||
StringBuilder responseBuilder;
|
||||
|
||||
|
||||
public Pump()
|
||||
{
|
||||
}
|
||||
public Pump() { }
|
||||
|
||||
/// <summary>
|
||||
/// Ambient temperature / humidity / pressure meter 'Greco' connected via serial interface (RS232)
|
||||
@@ -124,29 +116,31 @@ namespace TBF.BenchControl.Danfoss.VLT2800
|
||||
|
||||
controlBoard = (Elde.ControlBoardDev)TbfComponents.FindComponent("CB", components); /// TODO: replace "CB"
|
||||
if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent");
|
||||
|
||||
bitPosition = pumpCfg.BitPosition;
|
||||
Mask = (((UInt128)1) << bitPosition);
|
||||
Mask |= (((UInt128)1) << (bitPosition + 1));
|
||||
|
||||
log.Warn(this.ToString());
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
public override void Initialize()
|
||||
{
|
||||
if (pumpCfg.DebugLevel == DebugMode.Simulate)
|
||||
{
|
||||
return;
|
||||
}
|
||||
bitNr = pumpCfg.BitPosition;
|
||||
Mask = (((UInt128)1) << bitNr);
|
||||
#if MUNICH
|
||||
Mask |= (((UInt128)1) << (bitNr + 1));
|
||||
#endif
|
||||
|
||||
string comPortName = "COM" + pumpCfg.ComPortNr.ToString();
|
||||
serialPort = new SerialPort(comPortName, pumpCfg.BaudRate, pumpCfg.Parity, pumpCfg.DataBits, pumpCfg.StopBits);
|
||||
serialPort.Handshake = Handshake.None;
|
||||
serialPort.Open();
|
||||
responseBuilder = new StringBuilder(40);
|
||||
|
||||
log.FatalFormat("Successfully initialized device {0}", ToString());
|
||||
}
|
||||
if (pumpCfg.DebugLevel == DebugMode.Normal)
|
||||
{
|
||||
string comPortName = "COM" + pumpCfg.ComPortNr.ToString();
|
||||
serialPort = new SerialPort(comPortName, pumpCfg.BaudRate, pumpCfg.Parity, pumpCfg.DataBits, pumpCfg.StopBits);
|
||||
serialPort.Handshake = Handshake.None;
|
||||
serialPort.Open();
|
||||
responseBuilder = new StringBuilder(40);
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
serialPort = null;
|
||||
log.FatalFormat("{0} simulated: {1}", Name, this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Run this device</summary>
|
||||
public void RunDeviceBefore()
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.Danfoss.VLT2800
|
||||
{
|
||||
public string ClassName { get { return "Pump-Danfoss-VLT2800"; } }
|
||||
|
||||
public void ResetStaticProperties() { Pump.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new Pump(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Pump(cfg, components); }
|
||||
|
||||
@@ -12,26 +12,26 @@ namespace TBF.BenchControl.DataContainers.BackupAndSecurityOptions
|
||||
public class Component : ComponentBase
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
|
||||
public override string ToString() { return string.Format("{0}({1})", this.GetType().Namespace.Substring(32), Cfg.ToString(1)); }
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
readonly ComponentCfg myCfg;
|
||||
|
||||
public int MinPasswdLength { get { return myCfg.MinPasswdLength; } }
|
||||
public int PasswdExpirationPeriodDays { get { return myCfg.PasswdExpirationPeriodDays; } }
|
||||
|
||||
public Component()
|
||||
{
|
||||
}
|
||||
public Component() { }
|
||||
|
||||
public Component(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
myCfg = cfg as ComponentCfg;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
Users.GlobalData.MinPasswdLength = myCfg.MinPasswdLength;
|
||||
Users.GlobalData.PasswdExpirationPeriodDays = myCfg.PasswdExpirationPeriodDays;
|
||||
|
||||
log.Warn(this.ToString());
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataContainers.BackupAndSecurityOptions
|
||||
{
|
||||
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
|
||||
|
||||
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new Component(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace TBF.BenchControl.DataContainers.BenchInfo.Extended
|
||||
public class Component : ComponentBase, GenericDevices.IBenchInfo
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
|
||||
public override string ToString() { return string.Format("BenchInfoEx({0})", Cfg.ToString(1)); }
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
readonly ComponentCfg myCfg;
|
||||
|
||||
@@ -30,16 +30,19 @@ namespace TBF.BenchControl.DataContainers.BenchInfo.Extended
|
||||
public string Address5 { get { return myCfg.Address5; } }
|
||||
public RemoteDBUse RemoteDBUse { get { return myCfg.RemoteDBUse; } }
|
||||
|
||||
public Component()
|
||||
{
|
||||
}
|
||||
|
||||
public Component() { }
|
||||
|
||||
public Component(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
myCfg = cfg as ComponentCfg;
|
||||
Events.DB.SetBenchName(myCfg.TestBenchName);
|
||||
log.Warn(this.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
Events.DB.SetBenchName(myCfg.TestBenchName);
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataContainers.BenchInfo.Extended
|
||||
{
|
||||
public string ClassName { get { return "BenchInfoEx"; } }
|
||||
|
||||
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new Component(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace TBF.BenchControl.DataContainers.BenchInfo.iPerl
|
||||
public class Component : ComponentBase, GenericDevices.IBenchInfo, GenericDevices.IHasCalendarEvents
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
|
||||
public override string ToString() { return string.Format("BenchInfo.iPerl({0})", Cfg.ToString(1)); }
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
readonly ComponentCfg myCfg;
|
||||
|
||||
@@ -33,16 +33,19 @@ namespace TBF.BenchControl.DataContainers.BenchInfo.iPerl
|
||||
public Side Side { get { return myCfg.Side; } }
|
||||
public int MaxTestIndex { get { return myCfg.MaxTestIndex; } } /// (MaxPruefindex % 100) value when to reject water meters completely if they are NOK
|
||||
|
||||
public Component()
|
||||
{
|
||||
}
|
||||
|
||||
public Component() { }
|
||||
|
||||
public Component(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
myCfg = cfg as ComponentCfg;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
Events.DB.SetBenchName(myCfg.TestBenchName);
|
||||
log.Warn(this.ToString());
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataContainers.BenchInfo.iPerl
|
||||
{
|
||||
public string ClassName { get { return "BenchInfo.iPerl"; } }
|
||||
|
||||
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new Component(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
|
||||
|
||||
@@ -14,27 +14,28 @@ namespace TBF.BenchControl.DataContainers.Buoyancy
|
||||
public class Component : ComponentBase, GenericDevices.IHasCalendarEvents
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
|
||||
public override string ToString() { return string.Format("{0}({1})", this.GetType().Namespace.Substring(32), Cfg.ToString(1)); }
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
readonly ComponentCfg myCfg;
|
||||
|
||||
public double Buoyancy { get { return myCfg.Buoyancy; } }
|
||||
|
||||
public Component()
|
||||
{
|
||||
}
|
||||
|
||||
public Component() { }
|
||||
|
||||
public Component(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
myCfg = cfg as ComponentCfg;
|
||||
|
||||
/// This is to use data in formulas
|
||||
Config.Data.Buoyancy = Buoyancy;
|
||||
|
||||
log.Warn(this.ToString());
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
Config.Data.Buoyancy = Buoyancy; /// This is to use Buoyancy from this component in formulas
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
|
||||
|
||||
public IList<Config.CalendarEvent.ICalendarEvent> GetCalendarEvents()
|
||||
{
|
||||
DateTime calibrationDue = myCfg.CalibValidDate;
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataContainers.Buoyancy
|
||||
{
|
||||
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
|
||||
|
||||
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new Component(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
|
||||
|
||||
@@ -14,29 +14,31 @@ namespace TBF.BenchControl.DataContainers.Density
|
||||
public class Component : ComponentBase, GenericDevices.IHasCalendarEvents
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
|
||||
public override string ToString() { return string.Format("{0}({1})", this.GetType().Namespace.Substring(32), Cfg.ToString(1)); }
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
readonly ComponentCfg myCfg;
|
||||
|
||||
public double RealDensity { get { return myCfg.RealDensity; } }
|
||||
public double AtTemperature { get { return myCfg.AtTemperature; } }
|
||||
|
||||
public Component()
|
||||
{
|
||||
}
|
||||
|
||||
public Component() { }
|
||||
|
||||
public Component(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
myCfg = cfg as ComponentCfg;
|
||||
}
|
||||
|
||||
/// This is to use data in formulas
|
||||
public override void Initialize()
|
||||
{
|
||||
/// This is to use sample density and temp. from this component in formulas
|
||||
Config.Data.RealDensity = RealDensity;
|
||||
Config.Data.AtTemperature = AtTemperature;
|
||||
|
||||
log.Warn(this.ToString());
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
|
||||
|
||||
public IList<Config.CalendarEvent.ICalendarEvent> GetCalendarEvents()
|
||||
{
|
||||
DateTime calibrationDue = myCfg.CalibValidDate;
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataContainers.Density
|
||||
{
|
||||
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
|
||||
|
||||
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new Component(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
|
||||
|
||||
@@ -13,14 +13,10 @@ namespace TBF.BenchControl.DataContainers.Evaporation
|
||||
public class Component : ComponentBase, IEvaporation, GenericDevices.IHasCalendarEvents
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0}({1})", this.GetType().Namespace.Substring(17), Cfg.ToString(1));
|
||||
}
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
readonly EvaporationCfg myCfg;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// For a given temperature in [°C] returns an evaporation rate in [kg/s]
|
||||
/// </summary>
|
||||
@@ -30,17 +26,20 @@ namespace TBF.BenchControl.DataContainers.Evaporation
|
||||
}
|
||||
|
||||
|
||||
public Component()
|
||||
{
|
||||
}
|
||||
public Component() { }
|
||||
|
||||
public Component(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
myCfg = cfg as EvaporationCfg;
|
||||
log.Warn(this.ToString());
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
|
||||
|
||||
public IList<Config.CalendarEvent.ICalendarEvent> GetCalendarEvents()
|
||||
{
|
||||
DateTime calibrationDue = myCfg.CalibValidDate;
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace TBF.BenchControl.DataEntry.Combined
|
||||
public class EntryForm : ComponentBase, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm, IHasWMStatesForm
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(EntryForm));
|
||||
public override string ToString() { return string.Format("DataEntry.Combined({0})", Cfg.ToString(1)); }
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
public bool UsesCameras() { return false; }
|
||||
|
||||
@@ -60,25 +60,26 @@ namespace TBF.BenchControl.DataEntry.Combined
|
||||
CurrentOp currentOp;
|
||||
|
||||
|
||||
public EntryForm()
|
||||
{
|
||||
}
|
||||
public EntryForm() { }
|
||||
|
||||
public EntryForm(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
entryFormCfg = cfg as EntryFormCfg;
|
||||
|
||||
disabled = new bool[Config.Data.CompoundWMsCount];
|
||||
wmStartState = new double[Config.Data.CompoundWMsCount * 2];
|
||||
wmStartStateStr = new string[Config.Data.CompoundWMsCount * 2];
|
||||
wmEndState = new double[Config.Data.CompoundWMsCount * 2];
|
||||
wmCycleEndState = new string[Config.Data.CompoundWMsCount * 2];
|
||||
|
||||
currentOp = CurrentOp.None;
|
||||
log.Warn(this.ToString());
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
disabled = new bool[Config.Data.CompoundWMsCount];
|
||||
wmStartState = new double[Config.Data.CompoundWMsCount * 2];
|
||||
wmStartStateStr = new string[Config.Data.CompoundWMsCount * 2];
|
||||
wmEndState = new double[Config.Data.CompoundWMsCount * 2];
|
||||
wmCycleEndState = new string[Config.Data.CompoundWMsCount * 2];
|
||||
currentOp = CurrentOp.None;
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp()
|
||||
{
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataEntry.Combined
|
||||
{
|
||||
public string ClassName { get { return "DataEntry-Combined"; } }
|
||||
|
||||
public void ResetStaticProperties() { EntryForm.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryForm(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryForm(cfg); }
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace TBF.BenchControl.DataEntry.Fewa
|
||||
public class EntryFormNoStartEnd : ComponentBase, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(EntryFormNoStartEnd));
|
||||
public override string ToString() { return string.Format("DataEntry.Standard24({0})", Cfg.ToString(1)); }
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
public bool UsesCameras() { return false; }
|
||||
|
||||
@@ -60,25 +60,26 @@ namespace TBF.BenchControl.DataEntry.Fewa
|
||||
CurrentOp currentOp;
|
||||
|
||||
|
||||
public EntryFormNoStartEnd()
|
||||
{
|
||||
}
|
||||
public EntryFormNoStartEnd() { }
|
||||
|
||||
public EntryFormNoStartEnd(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
entryFormCfg = cfg as EntryFormCfg;
|
||||
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
wmCycleEndState = new string[Config.Data.WMsCount];
|
||||
|
||||
currentOp = CurrentOp.None;
|
||||
log.Warn(this.ToString());
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
wmCycleEndState = new string[Config.Data.WMsCount];
|
||||
currentOp = CurrentOp.None;
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp()
|
||||
{
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataEntry.Fewa
|
||||
{
|
||||
public string ClassName { get { return "DataEntry.Fewa"; } }
|
||||
|
||||
public void ResetStaticProperties() { EntryFormNoStartEnd.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryFormNoStartEnd(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryForm(cfg); }
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataEntry.Fewa
|
||||
{
|
||||
public string ClassName { get { return "DataEntry.Fewa.NoStartEnd"; } }
|
||||
|
||||
public void ResetStaticProperties() { EntryFormNoStartEnd.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryFormNoStartEnd(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryFormNoStartEnd(cfg); }
|
||||
|
||||
@@ -13,10 +13,7 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
|
||||
public class EntryForm : ComponentBase, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm, IHasHeatMtrStatesForm
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(EntryForm));
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0}({1})", this.GetType().Namespace.Substring(17), Cfg.ToString(1));
|
||||
}
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
public bool UsesCameras() { return false; }
|
||||
|
||||
@@ -75,28 +72,29 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
|
||||
CurrentOp currentOp;
|
||||
|
||||
|
||||
public EntryForm()
|
||||
{
|
||||
}
|
||||
public EntryForm() { }
|
||||
|
||||
public EntryForm(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
entryFormCfg = cfg as EntryFormCfg;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
disabled = new bool[Config.Data.HeatMetersCount];
|
||||
wmStartState = new double[Config.Data.HeatMetersCount];
|
||||
wmStartState = new double[Config.Data.HeatMetersCount];
|
||||
wmStartStateStr = new string[Config.Data.HeatMetersCount];
|
||||
wmEndState = new double[Config.Data.HeatMetersCount];
|
||||
wmEndState = new double[Config.Data.HeatMetersCount];
|
||||
energyStartState = new double[Config.Data.HeatMetersCount];
|
||||
energyStartStateStr = new string[Config.Data.HeatMetersCount];
|
||||
energyEndState = new double[Config.Data.HeatMetersCount];
|
||||
wmCycleEndState = new string[Config.Data.HeatMetersCount];
|
||||
|
||||
currentOp = CurrentOp.None;
|
||||
log.Warn(this.ToString());
|
||||
currentOp = CurrentOp.None;
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp()
|
||||
{
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
|
||||
{
|
||||
public string ClassName { get { return this.GetType().Namespace.Substring("TBF.BenchControl.".Length); } }
|
||||
|
||||
public void ResetStaticProperties() { EntryForm.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryForm(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryForm(cfg); }
|
||||
|
||||
@@ -13,10 +13,7 @@ namespace TBF.BenchControl.DataEntry.HeatMeters6
|
||||
public class EntryForm : ComponentBase, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm, IHasHeatMtrStatesForm
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(EntryForm));
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0}({1})", this.GetType().Namespace.Substring(17), Cfg.ToString(1));
|
||||
}
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
public bool UsesCameras() { return false; }
|
||||
|
||||
@@ -75,26 +72,26 @@ namespace TBF.BenchControl.DataEntry.HeatMeters6
|
||||
CurrentOp currentOp;
|
||||
|
||||
|
||||
public EntryForm()
|
||||
{
|
||||
}
|
||||
public EntryForm() { }
|
||||
|
||||
public EntryForm(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
entryFormCfg = cfg as EntryFormCfg;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
disabled = new bool[Config.Data.HeatMetersCount];
|
||||
wmStartState = new double[Config.Data.HeatMetersCount];
|
||||
wmStartState = new double[Config.Data.HeatMetersCount];
|
||||
wmStartStateStr = new string[Config.Data.HeatMetersCount];
|
||||
wmEndState = new double[Config.Data.HeatMetersCount];
|
||||
wmEndState = new double[Config.Data.HeatMetersCount];
|
||||
energyStartState = new double[Config.Data.HeatMetersCount];
|
||||
energyStartStateStr = new string[Config.Data.HeatMetersCount];
|
||||
energyEndState = new double[Config.Data.HeatMetersCount];
|
||||
wmCycleEndState = new string[Config.Data.HeatMetersCount];
|
||||
|
||||
currentOp = CurrentOp.None;
|
||||
log.Warn(this.ToString());
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
|
||||
@@ -8,18 +8,13 @@ namespace TBF.BenchControl.DataEntry.HeatMeters6
|
||||
{
|
||||
public class Factory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return this.GetType().Namespace.Substring("TBF.BenchControl.".Length); } }
|
||||
public string ClassName { get { return GetType().Namespace.Substring("TBF.BenchControl.".Length); } }
|
||||
|
||||
public void ResetStaticProperties() { EntryForm.ResetStaticProperties(); }
|
||||
public IComponent DummyComponent() { return new EntryForm(); }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryForm(); }
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryForm(cfg); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryForm(cfg); }
|
||||
|
||||
public IComponentCfg DefaultConfig()
|
||||
{
|
||||
return new EntryFormCfg(this.GetType().Namespace.Substring("TBF.BenchControl.DataEntry.".Length), this);
|
||||
}
|
||||
public IComponentCfg DefaultConfig() { return new EntryFormCfg("HeatMeters6", this); }
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace TBF.BenchControl.DataEntry.Munich
|
||||
public class EntryForm : ComponentBase, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(EntryForm));
|
||||
public override string ToString() { return string.Format("DataEntry.Munich({0})", Cfg.ToString(1)); }
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
public bool UsesCameras() { return false; }
|
||||
|
||||
@@ -55,22 +55,23 @@ namespace TBF.BenchControl.DataEntry.Munich
|
||||
CurrentOp currentOp;
|
||||
|
||||
|
||||
public EntryForm()
|
||||
{
|
||||
}
|
||||
public EntryForm() { }
|
||||
|
||||
public EntryForm(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
entryFormCfg = cfg as EntryFormCfg;
|
||||
|
||||
serialNr = new string[Config.Data.CompoundWMsCount];
|
||||
wmEndState = new string[Config.Data.CompoundWMsCount];
|
||||
|
||||
currentOp = CurrentOp.None;
|
||||
log.Warn(this.ToString());
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
serialNr = new string[Config.Data.CompoundWMsCount];
|
||||
wmEndState = new string[Config.Data.CompoundWMsCount];
|
||||
currentOp = CurrentOp.None;
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp()
|
||||
{
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataEntry.Munich
|
||||
{
|
||||
public string ClassName { get { return "DataEntryForm-Munich"; } }
|
||||
|
||||
public void ResetStaticProperties() { EntryForm.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryForm(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryForm(cfg); }
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace TBF.BenchControl.DataEntry.Munich3
|
||||
public class EntryForm : ComponentBase, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm, IHasWMStatesForm
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(EntryForm));
|
||||
public override string ToString() { return string.Format("DataEntry.Munich3({0})", Cfg.ToString(1)); }
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
public bool UsesCameras() { return false; }
|
||||
|
||||
@@ -64,26 +64,27 @@ namespace TBF.BenchControl.DataEntry.Munich3
|
||||
CurrentOp currentOp;
|
||||
|
||||
|
||||
public EntryForm()
|
||||
{
|
||||
}
|
||||
public EntryForm() { }
|
||||
|
||||
public EntryForm(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
entryFormCfg = cfg as EntryFormCfg;
|
||||
|
||||
serialNr = new string[Config.Data.WMsCount];
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
wmCycleEndState = new string[Config.Data.WMsCount];
|
||||
|
||||
currentOp = CurrentOp.None;
|
||||
log.Warn(this.ToString());
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
serialNr = new string[Config.Data.WMsCount];
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
wmCycleEndState = new string[Config.Data.WMsCount];
|
||||
currentOp = CurrentOp.None;
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp()
|
||||
{
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataEntry.Munich3
|
||||
{
|
||||
public string ClassName { get { return "DataEntryForm-3"; } }
|
||||
|
||||
public void ResetStaticProperties() { EntryForm.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryForm(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryForm(cfg); }
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace TBF.BenchControl.DataEntry.S620
|
||||
public class EntryForm : ComponentBase, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm, IHasWMStatesForm
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(EntryForm));
|
||||
public override string ToString() { return string.Format("{0}({1})", this.GetType().Namespace.Substring(17), Cfg.ToString(1)); }
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
public bool UsesCameras() { return false; }
|
||||
|
||||
@@ -62,9 +62,7 @@ namespace TBF.BenchControl.DataEntry.S620
|
||||
CurrentOp currentOp;
|
||||
|
||||
|
||||
public EntryForm()
|
||||
{
|
||||
}
|
||||
public EntryForm() { }
|
||||
|
||||
public EntryForm(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
|
||||
: base(cfg)
|
||||
@@ -73,17 +71,20 @@ namespace TBF.BenchControl.DataEntry.S620
|
||||
|
||||
tracing = (TBF.BenchControl.Output.DB.ProductionTracing.Tracing)TbfComponents.FindComponent(cfg.ParentName, components);
|
||||
if (tracing == null) throw new Exception("Cannot find " + Name + " parent");
|
||||
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
wmCycleEndState = new string[Config.Data.WMsCount];
|
||||
|
||||
currentOp = CurrentOp.None;
|
||||
log.Warn(this.ToString());
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
wmCycleEndState = new string[Config.Data.WMsCount];
|
||||
currentOp = CurrentOp.None;
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp()
|
||||
{
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataEntry.S620
|
||||
{
|
||||
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
|
||||
|
||||
public void ResetStaticProperties() { EntryForm.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryForm(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryForm(cfg, components); }
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace TBF.BenchControl.DataEntry.Single
|
||||
public class EntryFormNoStartEnd : ComponentBase, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(EntryFormNoStartEnd));
|
||||
public override string ToString() { return string.Format("DataEntry.Standard24({0})", Cfg.ToString(1)); }
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
public bool UsesCameras() { return false; }
|
||||
|
||||
@@ -60,25 +60,26 @@ namespace TBF.BenchControl.DataEntry.Single
|
||||
CurrentOp currentOp;
|
||||
|
||||
|
||||
public EntryFormNoStartEnd()
|
||||
{
|
||||
}
|
||||
public EntryFormNoStartEnd() { }
|
||||
|
||||
public EntryFormNoStartEnd(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
entryFormCfg = cfg as EntryFormCfg;
|
||||
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
wmCycleEndState = new string[Config.Data.WMsCount];
|
||||
|
||||
currentOp = CurrentOp.None;
|
||||
log.Warn(this.ToString());
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
wmCycleEndState = new string[Config.Data.WMsCount];
|
||||
currentOp = CurrentOp.None;
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp()
|
||||
{
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataEntry.Single
|
||||
{
|
||||
public string ClassName { get { return "DataEntry.Single"; } }
|
||||
|
||||
public void ResetStaticProperties() { EntryFormNoStartEnd.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryFormNoStartEnd(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryForm(cfg); }
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataEntry.Single
|
||||
{
|
||||
public string ClassName { get { return "DataEntry.NoStartEnd.Single"; } }
|
||||
|
||||
public void ResetStaticProperties() { EntryFormNoStartEnd.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryFormNoStartEnd(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryFormNoStartEnd(cfg); }
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
|
||||
public class EntryFormNoStartEnd : ComponentBase, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(EntryFormNoStartEnd));
|
||||
public override string ToString() { return string.Format("DataEntry.Standard12({0})", Cfg.ToString(1)); }
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
public bool UsesCameras() { return false; }
|
||||
|
||||
@@ -60,25 +60,26 @@ namespace TBF.BenchControl.DataEntry.Standard12
|
||||
CurrentOp currentOp;
|
||||
|
||||
|
||||
public EntryFormNoStartEnd()
|
||||
{
|
||||
}
|
||||
public EntryFormNoStartEnd() { }
|
||||
|
||||
public EntryFormNoStartEnd(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
entryFormCfg = cfg as EntryFormCfg;
|
||||
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
wmCycleEndState = new string[Config.Data.WMsCount];
|
||||
|
||||
currentOp = CurrentOp.None;
|
||||
log.Warn(this.ToString());
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
wmCycleEndState = new string[Config.Data.WMsCount];
|
||||
currentOp = CurrentOp.None;
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp()
|
||||
{
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataEntry.Standard12
|
||||
{
|
||||
public string ClassName { get { return "DataEntry-Standard-12"; } }
|
||||
|
||||
public void ResetStaticProperties() { EntryFormNoStartEnd.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryFormNoStartEnd(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryForm(cfg); }
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataEntry.Standard12
|
||||
{
|
||||
public string ClassName { get { return "DataEntry-Standard-12-NoStartEnd"; } }
|
||||
|
||||
public void ResetStaticProperties() { EntryFormNoStartEnd.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryFormNoStartEnd(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryFormNoStartEnd(cfg); }
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
|
||||
public class EntryFormNoStartEnd : ComponentBase, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(EntryFormNoStartEnd));
|
||||
public override string ToString() { return string.Format("DataEntry.Standard24({0})", Cfg.ToString(1)); }
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
public bool UsesCameras() { return false; }
|
||||
|
||||
@@ -60,25 +60,25 @@ namespace TBF.BenchControl.DataEntry.Standard24
|
||||
CurrentOp currentOp;
|
||||
|
||||
|
||||
public EntryFormNoStartEnd()
|
||||
{
|
||||
}
|
||||
public EntryFormNoStartEnd() { }
|
||||
|
||||
public EntryFormNoStartEnd(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
entryFormCfg = cfg as EntryFormCfg;
|
||||
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
wmCycleEndState = new string[Config.Data.WMsCount];
|
||||
|
||||
currentOp = CurrentOp.None;
|
||||
log.Warn(this.ToString());
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
currentOp = CurrentOp.None;
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp()
|
||||
{
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataEntry.Standard24
|
||||
{
|
||||
public string ClassName { get { return "DataEntry-Standard-24"; } }
|
||||
|
||||
public void ResetStaticProperties() { EntryFormNoStartEnd.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryFormNoStartEnd(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryForm(cfg); }
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataEntry.Standard24
|
||||
{
|
||||
public string ClassName { get { return "DataEntry-Standard-24-NoStartEnd"; } }
|
||||
|
||||
public void ResetStaticProperties() { EntryFormNoStartEnd.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryFormNoStartEnd(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryFormNoStartEnd(cfg); }
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace TBF.BenchControl.DataEntry.Standard48
|
||||
public class EntryFormNoStartEnd : ComponentBase, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(EntryFormNoStartEnd));
|
||||
public override string ToString() { return string.Format("DataEntry.Standard48({0})", Cfg.ToString(1)); }
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
public bool UsesCameras() { return false; }
|
||||
|
||||
@@ -60,25 +60,26 @@ namespace TBF.BenchControl.DataEntry.Standard48
|
||||
CurrentOp currentOp;
|
||||
|
||||
|
||||
public EntryFormNoStartEnd()
|
||||
{
|
||||
}
|
||||
public EntryFormNoStartEnd() { }
|
||||
|
||||
public EntryFormNoStartEnd(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
entryFormCfg = cfg as EntryFormCfg;
|
||||
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
wmCycleEndState = new string[Config.Data.WMsCount];
|
||||
|
||||
currentOp = CurrentOp.None;
|
||||
log.Warn(this.ToString());
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
wmCycleEndState = new string[Config.Data.WMsCount];
|
||||
currentOp = CurrentOp.None;
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp()
|
||||
{
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataEntry.Standard48
|
||||
{
|
||||
public string ClassName { get { return "DataEntry-Standard-48"; } }
|
||||
|
||||
public void ResetStaticProperties() { EntryFormNoStartEnd.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryFormNoStartEnd(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryForm(cfg); }
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataEntry.Standard48
|
||||
{
|
||||
public string ClassName { get { return "DataEntry-Standard-48-NoStartEnd"; } }
|
||||
|
||||
public void ResetStaticProperties() { EntryFormNoStartEnd.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryFormNoStartEnd(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryFormNoStartEnd(cfg); }
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace TBF.BenchControl.DataEntry.Standard6
|
||||
public class EntryFormNoStartEnd : ComponentBase, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(EntryFormNoStartEnd));
|
||||
public override string ToString() { return string.Format("DataEntry.Standard6({0})", Cfg.ToString(1)); }
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
public bool UsesCameras() { return false; }
|
||||
|
||||
@@ -57,24 +57,25 @@ namespace TBF.BenchControl.DataEntry.Standard6
|
||||
CurrentOp currentOp;
|
||||
|
||||
|
||||
public EntryFormNoStartEnd()
|
||||
{
|
||||
}
|
||||
public EntryFormNoStartEnd() { }
|
||||
|
||||
public EntryFormNoStartEnd(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
entryFormCfg = cfg as EntryFormCfg;
|
||||
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
|
||||
currentOp = CurrentOp.None;
|
||||
log.Warn(this.ToString());
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
currentOp = CurrentOp.None;
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp()
|
||||
{
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataEntry.Standard6
|
||||
{
|
||||
public string ClassName { get { return "DataEntry-Standard"; } }
|
||||
|
||||
public void ResetStaticProperties() { EntryFormNoStartEnd.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryFormNoStartEnd(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryForm(cfg); }
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataEntry.Standard6
|
||||
{
|
||||
public string ClassName { get { return "DataEntry-Standard-6-NoStartEnd"; } }
|
||||
|
||||
public void ResetStaticProperties() { EntryFormNoStartEnd.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryFormNoStartEnd(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryFormNoStartEnd(cfg); }
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace TBF.BenchControl.DataEntry.StandardCamera
|
||||
public class EntryForm : ComponentBase, IOperation, IDataEntryForCamera, IHasWMStatesForm, IHasCycleBeginForm, IHasCycleEndForm
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(EntryForm));
|
||||
public override string ToString() { return string.Format("DataEntry.Standard24({0})", Cfg.ToString(1)); }
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
|
||||
readonly EntryFormCfg entryFormCfg;
|
||||
@@ -110,25 +110,26 @@ namespace TBF.BenchControl.DataEntry.StandardCamera
|
||||
CurrentOp currentOp;
|
||||
|
||||
|
||||
public EntryForm()
|
||||
{
|
||||
}
|
||||
public EntryForm() { }
|
||||
|
||||
public EntryForm(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
entryFormCfg = cfg as EntryFormCfg;
|
||||
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
wmCycleEndState = new string[Config.Data.WMsCount];
|
||||
|
||||
currentOp = CurrentOp.None;
|
||||
log.Warn(this.ToString());
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
disabled = new bool[Config.Data.WMsCount];
|
||||
wmStartState = new double[Config.Data.WMsCount];
|
||||
wmStartStateStr = new string[Config.Data.WMsCount];
|
||||
wmEndState = new double[Config.Data.WMsCount];
|
||||
wmCycleEndState = new string[Config.Data.WMsCount];
|
||||
currentOp = CurrentOp.None;
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp()
|
||||
{
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace TBF.BenchControl.DataEntry.StandardCamera
|
||||
{
|
||||
public string ClassName { get { return "DataEntry-Camera"; } }
|
||||
|
||||
public void ResetStaticProperties() { EntryForm.ResetStaticProperties(); }
|
||||
|
||||
public IComponent DummyComponent() { return new EntryForm(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryForm(cfg); }
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user