Compare commits
39
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
28e3ba3b32 | ||
|
|
77c26abc02 | ||
|
|
0c964fdb5b | ||
|
|
84322476d6 | ||
|
|
f1278dd9a5 | ||
|
|
e7164b98ff | ||
|
|
26d49eb4b7 | ||
|
|
b410f473e2 | ||
|
|
3e54204a17 | ||
|
|
70cba76ffd | ||
|
|
d45c3f96d6 | ||
|
|
684fed8fc0 | ||
|
|
99bb0cec57 | ||
|
|
263d990be4 | ||
|
|
5f6c1fe70a | ||
|
|
2e76d595c0 | ||
|
|
75e5b75d4d | ||
|
|
b47f5e32d4 | ||
|
|
771af696ae | ||
|
|
b10ab44fa9 | ||
|
|
13eb7138a3 | ||
|
|
02f6c9264a | ||
|
|
edb26ccf6e | ||
|
|
2574ce1aee | ||
|
|
5586f58c6e | ||
|
|
138e436645 | ||
|
|
ea7e727798 | ||
|
|
7a40cfb1f2 | ||
|
|
b2226ad779 | ||
|
|
ebf96f655c | ||
|
|
4134bf8875 | ||
|
|
fd7149e263 | ||
|
|
a40b4ff606 | ||
|
|
86c063caee | ||
|
|
bea3c04eb7 | ||
|
|
c5644d6999 | ||
|
|
29c4c869f2 | ||
|
|
707c093f0c | ||
|
|
abaf756980 |
@@ -0,0 +1,2 @@
|
||||
# Set the default behavior, in case people don't have core.autocrlf set.
|
||||
* text=auto
|
||||
@@ -18,7 +18,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;SLM_50;HEAT_METERS;LANG_SK</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
@@ -28,7 +28,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;MUNICH</DefineConstants>
|
||||
<DefineConstants>TRACE;SLM_50;HEAT_METERS;LANG_SK</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ namespace Config
|
||||
public const int CompoundWMsCount = 1;
|
||||
public const int HeatMetersCount = 0;
|
||||
public const int MaxPartNr = WMsCount / LineSize;
|
||||
#elif FUZHOU_300 || FUZHOU_150 || IZRAEL_200 || PUCHONG_200 || GENESIS || SLM_150 || PETERSBURG_200
|
||||
#elif FUZHOU_300 || FUZHOU_150 || IZRAEL_200 || PUCHONG_200 || GENESIS || SLM_150 || PETERSBURG_200 || DEWA_300
|
||||
public const int WMsCount = 6;
|
||||
public const int LineSize = 6;
|
||||
public const int CompoundWMsCount = 3;
|
||||
|
||||
@@ -498,4 +498,75 @@ namespace Config.Entities
|
||||
#endif
|
||||
Count
|
||||
}
|
||||
|
||||
|
||||
public enum ErrorFlagShift
|
||||
{
|
||||
E1 = 0,
|
||||
E2,
|
||||
E3,
|
||||
E4,
|
||||
E5,
|
||||
E6,
|
||||
E7,
|
||||
E8,
|
||||
E9,
|
||||
E10,
|
||||
E11,
|
||||
E12,
|
||||
E13,
|
||||
E14,
|
||||
E15,
|
||||
E16,
|
||||
E17,
|
||||
E18,
|
||||
E19,
|
||||
E20,
|
||||
E21,
|
||||
E22,
|
||||
E23,
|
||||
E24,
|
||||
E25,
|
||||
E26,
|
||||
E27,
|
||||
E28,
|
||||
E29,
|
||||
E30,
|
||||
E31,
|
||||
}
|
||||
|
||||
public enum ErrorFlagMask
|
||||
{
|
||||
E1 = (1 << (int)ErrorFlagShift.E1),
|
||||
E2 = (1 << (int)ErrorFlagShift.E2),
|
||||
E3 = (1 << (int)ErrorFlagShift.E3),
|
||||
E4 = (1 << (int)ErrorFlagShift.E4),
|
||||
E5 = (1 << (int)ErrorFlagShift.E5),
|
||||
E6 = (1 << (int)ErrorFlagShift.E6),
|
||||
E7 = (1 << (int)ErrorFlagShift.E7),
|
||||
E8 = (1 << (int)ErrorFlagShift.E8),
|
||||
E9 = (1 << (int)ErrorFlagShift.E9),
|
||||
E10 = (1 << (int)ErrorFlagShift.E10),
|
||||
E11 = (1 << (int)ErrorFlagShift.E11),
|
||||
E12 = (1 << (int)ErrorFlagShift.E12),
|
||||
E13 = (1 << (int)ErrorFlagShift.E13),
|
||||
E14 = (1 << (int)ErrorFlagShift.E14),
|
||||
E15 = (1 << (int)ErrorFlagShift.E15),
|
||||
E16 = (1 << (int)ErrorFlagShift.E16),
|
||||
E17 = (1 << (int)ErrorFlagShift.E17),
|
||||
E18 = (1 << (int)ErrorFlagShift.E18),
|
||||
E19 = (1 << (int)ErrorFlagShift.E19),
|
||||
E20 = (1 << (int)ErrorFlagShift.E20),
|
||||
E21 = (1 << (int)ErrorFlagShift.E21),
|
||||
E22 = (1 << (int)ErrorFlagShift.E22),
|
||||
E23 = (1 << (int)ErrorFlagShift.E23),
|
||||
E24 = (1 << (int)ErrorFlagShift.E24),
|
||||
E25 = (1 << (int)ErrorFlagShift.E25),
|
||||
E26 = (1 << (int)ErrorFlagShift.E26),
|
||||
E27 = (1 << (int)ErrorFlagShift.E27),
|
||||
E28 = (1 << (int)ErrorFlagShift.E28),
|
||||
E29 = (1 << (int)ErrorFlagShift.E29),
|
||||
E30 = (1 << (int)ErrorFlagShift.E30),
|
||||
E31 = (1 << (int)ErrorFlagShift.E31),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.18.1122.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1122.0")]
|
||||
[assembly: AssemblyVersion("2.18.1151.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1151.0")]
|
||||
|
||||
@@ -276,7 +276,14 @@ namespace DeviceTest
|
||||
radioButton3.Text = "SelectTank 3";
|
||||
radioButton4.Text = "SelectTank -";
|
||||
}
|
||||
else radioButton1.Text = "spare";
|
||||
else if (className == "Modbus.QuidoRS")
|
||||
{
|
||||
radioButton1.Text = "Close relay 1";
|
||||
radioButton2.Text = "Close relay 2";
|
||||
radioButton3.Text = "Close relay 3";
|
||||
radioButton4.Text = "Open all relays";
|
||||
}
|
||||
else radioButton1.Text = "spare";
|
||||
}
|
||||
///
|
||||
void UpdateOperations2(string className)
|
||||
@@ -296,7 +303,14 @@ namespace DeviceTest
|
||||
radioButton23.Text = "SelectTank 3";
|
||||
radioButton24.Text = "SelectTank -";
|
||||
}
|
||||
else radioButton21.Text = "spare";
|
||||
else if (className == "Modbus.QuidoRS")
|
||||
{
|
||||
radioButton21.Text = "Close relay 1";
|
||||
radioButton22.Text = "Close relay 2";
|
||||
radioButton23.Text = "Close relay 3";
|
||||
radioButton24.Text = "Open all relays";
|
||||
}
|
||||
else radioButton21.Text = "spare";
|
||||
}
|
||||
///
|
||||
void UpdateOperations3(string className)
|
||||
@@ -316,7 +330,14 @@ namespace DeviceTest
|
||||
radioButton33.Text = "SelectTank 3";
|
||||
radioButton34.Text = "SelectTank -";
|
||||
}
|
||||
else radioButton31.Text = "spare";
|
||||
else if (className == "Modbus.QuidoRS")
|
||||
{
|
||||
radioButton31.Text = "Close relay 1";
|
||||
radioButton32.Text = "Close relay 2";
|
||||
radioButton33.Text = "Close relay 3";
|
||||
radioButton34.Text = "Open all relays";
|
||||
}
|
||||
else radioButton31.Text = "spare";
|
||||
}
|
||||
|
||||
|
||||
@@ -672,6 +693,13 @@ namespace DeviceTest
|
||||
//operation3 = (tbfComponent1forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(3);
|
||||
//operation4 = (tbfComponent1forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(0);
|
||||
}
|
||||
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
|
||||
{
|
||||
operation1 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(1);
|
||||
operation2 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(2);
|
||||
operation3 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(4);
|
||||
operation4 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(0);
|
||||
}
|
||||
|
||||
|
||||
if (tbfComponent2forOp is TBF.BenchControl.Modbus.PressureMeter.Meret.PressureMeter)
|
||||
@@ -704,6 +732,13 @@ namespace DeviceTest
|
||||
//operation23 = (tbfComponent2forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(3);
|
||||
//operation24 = (tbfComponent2forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(0);
|
||||
}
|
||||
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
|
||||
{
|
||||
operation21 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(1);
|
||||
operation22 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(2);
|
||||
operation23 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(4);
|
||||
operation24 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(0);
|
||||
}
|
||||
|
||||
|
||||
if (tbfComponent3forOp is TBF.BenchControl.Modbus.PressureMeter.Meret.PressureMeter)
|
||||
@@ -736,6 +771,13 @@ namespace DeviceTest
|
||||
//operation33 = (tbfComponent3forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(3);
|
||||
//operation34 = (tbfComponent3forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(0);
|
||||
}
|
||||
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
|
||||
{
|
||||
operation31 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(1);
|
||||
operation32 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(2);
|
||||
operation33 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(4);
|
||||
operation34 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(0);
|
||||
}
|
||||
|
||||
|
||||
int time = 0;
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace Results.Entities
|
||||
|
||||
/// Main result
|
||||
public virtual double Error { get; set; } /// [%]
|
||||
public virtual int ErrorIndicators { get; set; } /// Not mapped to DB !!!, bit24=E25, bit25=E26, bit26=E27, bit27=E28
|
||||
public virtual double KorrErrQ { get; set; } /// [%] not mapped to results DB, saved to Oracle DB
|
||||
public virtual bool TestDone { get; set; } /// true = test was completed
|
||||
public virtual bool Passed { get; set; } /// true = test passed, water meter is OK
|
||||
|
||||
@@ -91,12 +91,15 @@ namespace Results.Entities
|
||||
public virtual int ProdQ2CorrLR { get; set; } /// iPerl Q2 correction for the L-flow written to iPerl
|
||||
#endif
|
||||
#if ORACLE_DB
|
||||
public virtual int Pruefindex { get; set; } /// Not mapped to DB !!! 0=unknown (saving to Oracle failed), >=1 ... pruefindex
|
||||
public virtual int HydrPruefung { get; set; } /// Not mapped to DB !!!
|
||||
public virtual int Pruefindex { get; set; } /// >= 1 ... pruefindex
|
||||
public virtual int HydrPruefung { get; set; }
|
||||
public virtual int WMTypeRevision { get; set; } /// Not mapped to DB !!!
|
||||
public virtual object TestInfos { get; set; } /// SensusTestInfo[] array fetched at the beginning of the cycle, not mapped to DB !!!
|
||||
#endif
|
||||
public virtual WaterMeterData WaterMeterData { get; set; }
|
||||
public virtual int ProcessId { get; set; } /// Not mapped to DB !!! Tracing DB Process ID
|
||||
public virtual bool IsLastRecordOk { get; set; } /// Not mapped to DB !!! Previous record verification result
|
||||
|
||||
public virtual WaterMeterData WaterMeterData { get; set; }
|
||||
public virtual Batch Batch { get; set; }
|
||||
public virtual IList<MeterTestRslt> MeterTestRslts { get; set; }
|
||||
|
||||
@@ -281,7 +284,12 @@ namespace Results.Entities
|
||||
{
|
||||
return mtr;
|
||||
}
|
||||
}
|
||||
else if (meterId == Config.Entities.CompoundMeterId.SingleOrCompound &&
|
||||
mtr.CompoundMeterId == (byte)Config.Entities.CompoundMeterId.HeatMeterEnergy)
|
||||
{
|
||||
return mtr;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -349,6 +357,8 @@ namespace Results.Entities
|
||||
WMTypeRevision = 0;
|
||||
TestInfos = null;
|
||||
#endif
|
||||
ProcessId = 0;
|
||||
IsLastRecordOk = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -405,6 +415,9 @@ namespace Results.Entities
|
||||
WMTypeRevision = src.WMTypeRevision;
|
||||
TestInfos = src.TestInfos;
|
||||
#endif
|
||||
ProcessId = src.ProcessId;
|
||||
IsLastRecordOk = src.IsLastRecordOk;
|
||||
|
||||
foreach (var mtr in MeterTestRslts)
|
||||
{
|
||||
MeterTestRslt srcMtr = src.GetMeterTestRslt(mtr.Name(), (Config.Entities.CompoundMeterId)mtr.CompoundMeterId);
|
||||
|
||||
@@ -16,6 +16,16 @@ namespace Results.Forms
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(BatchResultsDlg));
|
||||
|
||||
|
||||
static readonly Color NotCompletedColor = Color.White;
|
||||
static readonly Color OkColor = Color.LightGreen;
|
||||
static readonly Color NokColor = Color.LightPink;
|
||||
static readonly Color RejectColor = Color.Magenta;
|
||||
static readonly Color ProductionTracing = Color.RoyalBlue;
|
||||
static readonly Color WrongDirection = Color.Gold;
|
||||
static readonly Color WrongQ2FactorsColor = Color.Red;
|
||||
|
||||
|
||||
DateTime lastRedraw;
|
||||
DateTime lastSizeChange;
|
||||
bool loaded;
|
||||
@@ -178,14 +188,16 @@ namespace Results.Forms
|
||||
this.ResumeLayout(false);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get an empty ListView control with appropriate parameters.
|
||||
/// </summary>
|
||||
/// <returns>ListView control</returns>
|
||||
OneWMResultsCtrl GetListView()
|
||||
OneWMResultsCtrl GetListView(Color backColor)
|
||||
{
|
||||
return new OneWMResultsCtrl(Color.White, lvWidth, lvHeight);
|
||||
return new OneWMResultsCtrl(backColor, lvWidth, lvHeight);
|
||||
}
|
||||
OneWMResultsCtrl GetListView() { return GetListView(Color.White); }
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -199,8 +211,10 @@ namespace Results.Forms
|
||||
|
||||
foreach (var mtr in wMtr.MeterTestRslts)
|
||||
{
|
||||
if (mtr.IsPilotRslt() && mtr.TestDone && (mtr.Publish() != Config.Entities.Publish.Never)
|
||||
&& (mtr.Publish() != Config.Entities.Publish.Internal))
|
||||
if ((mtr.CompoundMeterId == (byte)CompoundMeterId.Single || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound || mtr.CompoundMeterId == (byte)CompoundMeterId.HeatMeterEnergy)
|
||||
&& mtr.TestDone
|
||||
&& (mtr.Publish() != Config.Entities.Publish.Never)
|
||||
&& (mtr.Publish() != Config.Entities.Publish.Internal))
|
||||
{
|
||||
testNames.Add(mtr.Name());
|
||||
}
|
||||
@@ -209,6 +223,57 @@ namespace Results.Forms
|
||||
return testNames;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get color for highlighting results and an apporpriate text message.
|
||||
/// </summary>
|
||||
/// <param name="wMtr">Water meter results entity</param>
|
||||
/// <param name="message">Appropriate message</param>
|
||||
/// <returns>Color for results</returns>
|
||||
Color GetColorOfResults(Results.Entities.WaterMeter wMtr, out string message)
|
||||
{
|
||||
bool wmtrCompleted = wMtr.CompletedFromTests();
|
||||
bool wmtrPassed = wMtr.PassedFromTests();
|
||||
|
||||
if ((wMtr.ErrorFlags & (int)ErrorFlagMask.E28) != 0)
|
||||
{
|
||||
message = Strings.Previous_step_is_missing_or_NOK;
|
||||
return ProductionTracing;
|
||||
}
|
||||
else if ((wMtr.ErrorFlags & (int)ErrorFlagMask.E27) != 0)
|
||||
{
|
||||
message = Strings.Wrong_iPerl_counting_direction;
|
||||
return WrongDirection;
|
||||
}
|
||||
else if ((wMtr.ErrorFlags & (int)ErrorFlagMask.E26) != 0)
|
||||
{
|
||||
message = Strings.Invalid_Q2_correction_factors;
|
||||
return WrongQ2FactorsColor;
|
||||
}
|
||||
else if ((wMtr.ErrorFlags & (int)ErrorFlagMask.E25) != 0)
|
||||
{
|
||||
message = Strings.Test_repetition_count_exceeded_upper_limit;
|
||||
return RejectColor;
|
||||
}
|
||||
else if (wmtrPassed)
|
||||
{
|
||||
/// Water meter passed (therefore is was also completed)
|
||||
message = Strings.Passed;
|
||||
return OkColor;
|
||||
}
|
||||
else if (wmtrCompleted)
|
||||
{
|
||||
/// Water meter was completed but did not pass => Failed
|
||||
message = Strings.Failed;
|
||||
return NokColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Water meter was not completed yet => did not pass, did not fail
|
||||
message = Strings.Test_in_progress;
|
||||
return NotCompletedColor;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a ListView control filled with results of the meter 'mtr'
|
||||
@@ -219,9 +284,11 @@ namespace Results.Forms
|
||||
{
|
||||
metersKind = wMtr.Compound() ? MetersKind.Combined : (wMtr.HeatMeter() ? MetersKind.HeatMeter : MetersKind.Single);
|
||||
|
||||
OneWMResultsCtrl lview = GetListView();
|
||||
string message = string.Empty;
|
||||
Color commonBackColor = GetColorOfResults(wMtr, out message);
|
||||
OneWMResultsCtrl lview = GetListView(commonBackColor);
|
||||
#if ORACLE_DB
|
||||
lview.Caption = string.Format("PCB {0} {1} {2}", (string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr), Strings.repetition, (wMtr.Pruefindex % 100));
|
||||
lview.Caption = string.Format("{0} ({1}) {2}", (string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr), (wMtr.Pruefindex % 100), message);
|
||||
#else
|
||||
lview.Caption = string.Format("s/n = {0}", string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr);
|
||||
#endif
|
||||
@@ -289,9 +356,11 @@ namespace Results.Forms
|
||||
{
|
||||
metersKind = wMtr.Compound() ? MetersKind.Combined : (wMtr.HeatMeter() ? MetersKind.HeatMeter : MetersKind.Single);
|
||||
|
||||
OneWMResultsCtrl lview = GetListView();
|
||||
string message;
|
||||
Color commonBackColor = GetColorOfResults(wMtr, out message);
|
||||
OneWMResultsCtrl lview = GetListView(commonBackColor);
|
||||
#if ORACLE_DB
|
||||
lview.Caption = string.Format("PCB {0} {1} {2}", (string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr), Strings.repetition, (wMtr.Pruefindex % 100));
|
||||
lview.Caption = string.Format("{0} ({1}) {2}", (string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr), (wMtr.Pruefindex % 100), message);
|
||||
#else
|
||||
lview.Caption = string.Format("s/n = {0}", string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr);
|
||||
#endif
|
||||
|
||||
+75
-71
@@ -91,85 +91,85 @@ namespace Results
|
||||
T_Lo_start, /// 81
|
||||
T_Lo_end, /// 82
|
||||
T_Lo_avg, /// 83
|
||||
P_delta_mean, /// 84
|
||||
P_delta_start, /// 85
|
||||
P_delta_end, /// 86
|
||||
Meter_type, /// 87 Single, Compound or HeatMeter
|
||||
Volume_main, /// 88
|
||||
Volume_aux, /// 89
|
||||
Start_volume, /// 90
|
||||
Start_volume_main, /// 91
|
||||
Start_volume_aux, /// 92
|
||||
End_volume, /// 93
|
||||
End_volume_main, /// 94
|
||||
End_volume_aux, /// 95
|
||||
Error_main, /// 96
|
||||
Error_aux, /// 97
|
||||
Serial_Nr_main, /// 98
|
||||
Serial_Nr_aux, /// 99
|
||||
End_state_main, /// 100
|
||||
End_state_aux, /// 101
|
||||
Q_rise, /// 102
|
||||
Q_fall, /// 103
|
||||
P_delta_mean, /// 84
|
||||
P_delta_start, /// 85
|
||||
P_delta_end, /// 86
|
||||
Meter_type, /// 87 Single, Compound or HeatMeter
|
||||
Volume_main, /// 88
|
||||
Volume_aux, /// 89
|
||||
Start_volume, /// 90
|
||||
Start_volume_main, /// 91
|
||||
Start_volume_aux, /// 92
|
||||
End_volume, /// 93
|
||||
End_volume_main, /// 94
|
||||
End_volume_aux, /// 95
|
||||
Error_main, /// 96
|
||||
Error_aux, /// 97
|
||||
Serial_Nr_main, /// 98
|
||||
Serial_Nr_aux, /// 99
|
||||
End_state_main, /// 100
|
||||
End_state_aux, /// 101
|
||||
Q_rise, /// 102
|
||||
Q_fall, /// 103
|
||||
|
||||
/// iPerl
|
||||
/// iPerl
|
||||
OrigCalibFactor, /// 104
|
||||
CalibFactor, /// 105
|
||||
Q2ErrWOCorrection, /// 106
|
||||
Q2CorrectionDone, /// 107
|
||||
CalibFactor, /// 105
|
||||
Q2ErrWOCorrection, /// 106
|
||||
Q2CorrectionDone, /// 107
|
||||
Q2CorrRFlow, /// 108
|
||||
Q2CorrLFlow, /// 109
|
||||
Q2CorrFlowRight, /// 110
|
||||
|
||||
Q_ref_mean, /// 111
|
||||
T_up_start, /// 112
|
||||
T_up_end, /// 113
|
||||
T_up_avg, /// 114
|
||||
T_down_start, /// 115
|
||||
T_down_end, /// 116
|
||||
T_down_avg, /// 117
|
||||
T_div_start, /// 118
|
||||
T_div_end, /// 119
|
||||
T_div_avg, /// 120
|
||||
P_up_avg, /// 121
|
||||
P_down_avg, /// 122
|
||||
P_delta_avg, /// 123
|
||||
|
||||
TestDone, /// 124
|
||||
TestPassed, /// 125
|
||||
Q_ref_mean, /// 111
|
||||
T_up_start, /// 112
|
||||
T_up_end, /// 113
|
||||
T_up_avg, /// 114
|
||||
T_down_start, /// 115
|
||||
T_down_end, /// 116
|
||||
T_down_avg, /// 117
|
||||
T_div_start, /// 118
|
||||
T_div_end, /// 119
|
||||
T_div_avg, /// 120
|
||||
P_up_avg, /// 121
|
||||
P_down_avg, /// 122
|
||||
P_delta_avg, /// 123
|
||||
|
||||
TestDone, /// 124
|
||||
TestPassed, /// 125
|
||||
|
||||
/// iPerl
|
||||
FW_Version, /// 126
|
||||
|
||||
Mass_start_raw, /// 127
|
||||
Mass_start, /// 128
|
||||
Mass_end_raw, /// 129
|
||||
Mass_end, /// 130
|
||||
Mass, /// 131
|
||||
Buoyancy, /// 132
|
||||
Density_correction, /// 133
|
||||
Mass_start_raw, /// 127
|
||||
Mass_start, /// 128
|
||||
Mass_end_raw, /// 129
|
||||
Mass_end, /// 130
|
||||
Mass, /// 131
|
||||
Buoyancy, /// 132
|
||||
Density_correction, /// 133
|
||||
|
||||
ErrorFlags, /// 134
|
||||
E1, /// 135
|
||||
E2, /// 136
|
||||
E3, /// 137
|
||||
E4, /// 138
|
||||
E5, /// 139
|
||||
E6, /// 140
|
||||
E7, /// 141
|
||||
E8, /// 142
|
||||
E9, /// 143
|
||||
E10, /// 144
|
||||
E11, /// 145
|
||||
E12, /// 146
|
||||
E13, /// 147
|
||||
E14, /// 148
|
||||
E15, /// 149
|
||||
E16, /// 150
|
||||
ErrorFlags, /// 134
|
||||
E1, /// 135
|
||||
E2, /// 136
|
||||
E3, /// 137
|
||||
E4, /// 138
|
||||
E5, /// 139
|
||||
E6, /// 140
|
||||
E7, /// 141
|
||||
E8, /// 142
|
||||
E9, /// 143
|
||||
E10, /// 144
|
||||
E11, /// 145
|
||||
E12, /// 146
|
||||
E13, /// 147
|
||||
E14, /// 148
|
||||
E15, /// 149
|
||||
E16, /// 150
|
||||
|
||||
Table_row_nr, /// 151
|
||||
Table_column_nr, /// 152
|
||||
WMRemark, /// 153
|
||||
Table_row_nr, /// 151
|
||||
Table_column_nr, /// 152
|
||||
WMRemark, /// 153
|
||||
|
||||
User_description, /// 154
|
||||
Legalizator, /// 155
|
||||
@@ -181,7 +181,7 @@ namespace Results
|
||||
Diverter_start_time, /// 159
|
||||
Diverter_end_time, /// 160
|
||||
Q_sensitivity, /// 161
|
||||
|
||||
|
||||
Q_ref_min, /// 162
|
||||
Q_ref_max, /// 163
|
||||
Q_ref_start, /// 164
|
||||
@@ -210,7 +210,7 @@ namespace Results
|
||||
Rho_Wa_calc, /// 183
|
||||
|
||||
Formatted_WM_ID, /// 184, Formated WM ID string:
|
||||
/// {0}=start DateTime {1}-end DateTime, {2}=batch nr., {3}=wm pos.(1..max), {4}=s/n string
|
||||
/// {0}=start DateTime {1}-end DateTime, {2}=batch nr., {3}=wm pos.(1..max), {4}=s/n string
|
||||
E21, /// 185
|
||||
|
||||
T_line_mean, /// 186
|
||||
@@ -262,7 +262,7 @@ namespace Results
|
||||
Bench_address5, /// 227 'Address 5' from IBenchInfo
|
||||
|
||||
Max_test_index, /// 228 MaxPruefindex % 100
|
||||
VolumeCTV, /// 229
|
||||
VolumeCTV, /// 229
|
||||
|
||||
/// iPerl
|
||||
LastError, /// 230 For iPerl previous test result (test with Proefindex-1)
|
||||
@@ -287,7 +287,11 @@ namespace Results
|
||||
Prod_Q2CorrLR, /// 246
|
||||
|
||||
TestPartStr, /// 247
|
||||
|
||||
|
||||
Error_heat_mtr_vol, /// 248
|
||||
Energy_start,
|
||||
Energy_end,
|
||||
|
||||
Count,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Sensus")]
|
||||
[assembly: AssemblyProduct("Results")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2013 - 2018 Sensus Slovensko, a.s.")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2013 - 2019 Sensus Slovensko, a.s.")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.18.1127.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1127.0")]
|
||||
[assembly: AssemblyVersion("2.18.1166.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1166.0")]
|
||||
|
||||
Generated
+63
@@ -384,6 +384,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to NOK.
|
||||
/// </summary>
|
||||
internal static string Failed {
|
||||
get {
|
||||
return ResourceManager.GetString("Failed", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Failed meters count.
|
||||
/// </summary>
|
||||
@@ -447,6 +456,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Invalid Q2 correction factors.
|
||||
/// </summary>
|
||||
internal static string Invalid_Q2_correction_factors {
|
||||
get {
|
||||
return ResourceManager.GetString("Invalid_Q2_correction_factors", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Item.
|
||||
/// </summary>
|
||||
@@ -627,6 +645,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to OK.
|
||||
/// </summary>
|
||||
internal static string Passed {
|
||||
get {
|
||||
return ResourceManager.GetString("Passed", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Passed meters count.
|
||||
/// </summary>
|
||||
@@ -663,6 +690,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Previous step is missing or NOK.
|
||||
/// </summary>
|
||||
internal static string Previous_step_is_missing_or_NOK {
|
||||
get {
|
||||
return ResourceManager.GetString("Previous_step_is_missing_or_NOK", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Procedure.
|
||||
/// </summary>
|
||||
@@ -1032,6 +1068,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Test in progress.
|
||||
/// </summary>
|
||||
internal static string Test_in_progress {
|
||||
get {
|
||||
return ResourceManager.GetString("Test_in_progress", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Test method.
|
||||
/// </summary>
|
||||
@@ -1050,6 +1095,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Test repetition count exceeded upper limit.
|
||||
/// </summary>
|
||||
internal static string Test_repetition_count_exceeded_upper_limit {
|
||||
get {
|
||||
return ResourceManager.GetString("Test_repetition_count_exceeded_upper_limit", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Test vol..
|
||||
/// </summary>
|
||||
@@ -1923,6 +1977,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Wrong iPerl counting direction.
|
||||
/// </summary>
|
||||
internal static string Wrong_iPerl_counting_direction {
|
||||
get {
|
||||
return ResourceManager.GetString("Wrong_iPerl_counting_direction", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Year.
|
||||
/// </summary>
|
||||
|
||||
@@ -258,4 +258,25 @@
|
||||
<data name="repetition" xml:space="preserve">
|
||||
<value>opakování</value>
|
||||
</data>
|
||||
<data name="Invalid_Q2_correction_factors" xml:space="preserve">
|
||||
<value>Nesprávne Q2 korekčné faktory</value>
|
||||
</data>
|
||||
<data name="Previous_step_is_missing_or_NOK" xml:space="preserve">
|
||||
<value>Predchádzajúci krok chýba alebo neprešiel</value>
|
||||
</data>
|
||||
<data name="Test_repetition_count_exceeded_upper_limit" xml:space="preserve">
|
||||
<value>Počet opakovaní testu prekročil dovolené maximum</value>
|
||||
</data>
|
||||
<data name="Wrong_iPerl_counting_direction" xml:space="preserve">
|
||||
<value>Nesprávny smer počítania iPerlu</value>
|
||||
</data>
|
||||
<data name="Failed" xml:space="preserve">
|
||||
<value>NOK</value>
|
||||
</data>
|
||||
<data name="Passed" xml:space="preserve">
|
||||
<value>OK</value>
|
||||
</data>
|
||||
<data name="Test_in_progress" xml:space="preserve">
|
||||
<value>Probíhá test</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -744,4 +744,25 @@
|
||||
<data name="repetition" xml:space="preserve">
|
||||
<value>repetition</value>
|
||||
</data>
|
||||
<data name="Invalid_Q2_correction_factors" xml:space="preserve">
|
||||
<value>Invalid Q2 correction factors</value>
|
||||
</data>
|
||||
<data name="Previous_step_is_missing_or_NOK" xml:space="preserve">
|
||||
<value>Previous step is missing or NOK</value>
|
||||
</data>
|
||||
<data name="Test_repetition_count_exceeded_upper_limit" xml:space="preserve">
|
||||
<value>Test repetition count exceeded upper limit</value>
|
||||
</data>
|
||||
<data name="Wrong_iPerl_counting_direction" xml:space="preserve">
|
||||
<value>Wrong iPerl counting direction</value>
|
||||
</data>
|
||||
<data name="Failed" xml:space="preserve">
|
||||
<value>NOK</value>
|
||||
</data>
|
||||
<data name="Passed" xml:space="preserve">
|
||||
<value>OK</value>
|
||||
</data>
|
||||
<data name="Test_in_progress" xml:space="preserve">
|
||||
<value>Test in progress</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -18,7 +18,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;SLM_50;HEAT_METERS;LANG_SK</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
@@ -27,7 +27,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;MUNICH</DefineConstants>
|
||||
<DefineConstants>TRACE;SLM_50;HEAT_METERS;LANG_SK</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
+2
-2
@@ -48,14 +48,14 @@ namespace Results
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Converts ErrorFlags integer to string. Supports up to 31 flags (E1..E31).
|
||||
/// Converts ErrorFlags integer to string. Supports up to 31 flags (E1..E31, i.e. bit0..bit30).
|
||||
/// </summary>
|
||||
/// <param name="errorFlags">Input</param>
|
||||
/// <returns>Output string</returns>
|
||||
public static string ErrorFlagsStr(int errorFlags)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < 30; i++)
|
||||
for (int i = 0; i < 31; i++)
|
||||
{
|
||||
if ((errorFlags & (1 << i)) != 0)
|
||||
{
|
||||
|
||||
@@ -155,16 +155,16 @@ namespace Results
|
||||
///
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_volume, Strings.Test_vol + "()", Quantity.Volume, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).TargetVolume())));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.VolumeCTV, string.Format("{0} CTV ()", Strings.VName_Vol), Quantity.Volume, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetTestRslt(t).VolumeCTV)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume, string.Format("{0} Mt. ()", Strings.VName_Vol), Strings.Tooltip_Vol_Mt, Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeMeter)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_volume, string.Format("{0} rm ()", Strings.VName_Vol), Strings.Tooltip_Vol_rm, Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeRef)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_main, string.Format("{0} {1} ()", Strings.VName_Vol, Strings.main), Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeMeter)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_aux, string.Format("{0} {1} ()", Strings.VName_Vol, Strings.aux), Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeMeter)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume, Strings.Start_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeStart)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_main, Strings.Start_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeStart)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_aux, Strings.Start_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeStart)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume, Strings.End_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeEnd)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_main, Strings.End_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeEnd)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_aux, Strings.End_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeEnd)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume, string.Format("{0} Mt. ()", Strings.VName_Vol), Strings.Tooltip_Vol_Mt, Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeMeter) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeMeter) : string.Empty)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_volume, string.Format("{0} rm ()", Strings.VName_Vol), Strings.Tooltip_Vol_rm, Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeRef) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeRef) : string.Empty)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_main, string.Format("{0} {1} ()", Strings.VName_Vol, Strings.main), Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).VolumeMeter) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_aux, string.Format("{0} {1} ()", Strings.VName_Vol, Strings.aux), Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).VolumeMeter) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume, Strings.Start_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeStart) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeStart) : string.Empty)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_main, Strings.Start_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).VolumeStart) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_aux, Strings.Start_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).VolumeStart) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume, Strings.End_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeEnd) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeEnd) : string.Empty)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_main, Strings.End_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).VolumeEnd) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_aux, Strings.End_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).VolumeEnd) : string.Empty));
|
||||
|
||||
///
|
||||
/// Mass
|
||||
@@ -314,7 +314,8 @@ namespace Results
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, string.Format("{0} rel. ()", Strings.VName_Error), Strings.Tooltip_E_rel, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "0" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).Error)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.LastError, string.Format("{0} rel. last ()", Strings.VName_Error), Strings.Tooltip_E_rel_last, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "0" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).LastError)));
|
||||
#else
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, string.Format("{0} rel. ()", Strings.VName_Error), Strings.Tooltip_E_rel, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).Error)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, string.Format("{0} rel. ()", Strings.VName_Error), Strings.Tooltip_E_rel, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).Error) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_heat_mtr_vol, string.Format("{0} rel.hm.vol. ()", Strings.VName_Error), Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).Error) : string.Empty));
|
||||
#endif
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed, Strings.Result, Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => string.IsNullOrEmpty(t) ? w.PassedColorStr(f)
|
||||
: ((w.GetMeterTestRslt(t) == null) ? "" : w.GetMeterTestRslt(t).PassedColorStr(f))));
|
||||
@@ -371,8 +372,8 @@ namespace Results
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Degree__liter, "Degree per liter ()", Quantity.PulsePerLtr, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).IsCamera() ? w.GetMeterTestRslt(t).PulsesPerLiter : 0)));
|
||||
|
||||
/// Water meters results (combined)
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_main, Strings.Err_main + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).Error)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_aux, Strings.Err_aux + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).Error)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_main, Strings.Err_main + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).Error) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_aux, Strings.Err_aux + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).Error) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr_main, string.Format("{0} {1}", Strings.sn, Strings.main), Strings.Tooltip_sn_main, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.SerialNr)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr_aux, string.Format("{0} {1}", Strings.sn, Strings.aux), Strings.Tooltip_sn_aux, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.SerialNrAux)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state_main, Strings.EndState_main, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.EndState)));
|
||||
@@ -407,8 +408,10 @@ namespace Results
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Meter_type, Strings.Meter_type, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Compound ? Strings.Compound : (w.WaterMeterData.HeatMeter ? Strings.Heat_meter : Strings.Single))));
|
||||
|
||||
#if HEAT_METERS
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy, Strings.Energy + "()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) == null) ? "" : FormatDbl(u, f, p, "F1", (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeMeter))));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_energy, Strings.Energy_ref + "()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) == null) ? "" : FormatDbl(u, f, p, "F1", (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeRef))));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy, Strings.Energy + " ()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeMeter) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy_start, Strings.Energy + " start ()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeStart) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy_end, Strings.Energy + " end ()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeEnd) : string.Empty));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_energy, Strings.Energy_ref + " ()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeRef) : string.Empty));
|
||||
#endif
|
||||
|
||||
#if IPERL
|
||||
@@ -418,8 +421,8 @@ namespace Results
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.CalibFactorLNA, "iPerl CalibFactorLNA", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.CalibFactorLNA)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2ErrWOCorrection, "iPerl Q2ErrWOCorrection", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.Q2ErrWOCorrection)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrectionDone, "iPerl Q2CorrectionDone", Quantity.Boolean,ItemCategory.MeterResult, (w, t, u, f, p) => (w.Q2CorrectionDone ? Strings.Yes : Strings.No)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrRFlow, "iPerl Q2Corr R-L", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrRL)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrLFlow, "iPerl Q2Corr L-R", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrLR)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrRFlow, "iPerl Q2Corr RL", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrRL)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrLFlow, "iPerl Q2Corr LR", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrLR)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrFlowRight, "iPerl Q2CorrFlowRight", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrFlowRight)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.FW_Version, "iPerl FW version", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.FWVersion)));
|
||||
#if ORACLE_DB
|
||||
@@ -439,8 +442,8 @@ namespace Results
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_PurchaseOrder, "Prod iPerl purchase order", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.ProdPurchaseOrder)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_Passed, "Prod iPerl passed", Quantity.Boolean,ItemCategory.MeterResult, (w, t, u, f, p) => FormatBool(f,w.ProdPassed)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_ResultCode, "Prod iPerl result code", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.ProdResultCode)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_Q2CorrRL, "Prod iPerl Q2Corr R-L", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrRL)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_Q2CorrLR, "Prod iPerl Q2Corr L-R", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrLR)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_Q2CorrRL, "Prod iPerl Q2Corr RL", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.ProdQ2CorrRL)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_Q2CorrLR, "Prod iPerl Q2Corr LR", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.ProdQ2CorrLR)));
|
||||
#endif
|
||||
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestDone, Strings.Test_done + "()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => FormatBool(f, (w.GetMeterTestRslt(t) != null) && w.GetMeterTestRslt(t).TestDone)));
|
||||
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
namespace ResultsBrowser.Forms
|
||||
{
|
||||
partial class HistogramCtrl
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
||||
System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
|
||||
System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
||||
System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title();
|
||||
this.myChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
|
||||
((System.ComponentModel.ISupportInitialize)(this.myChart)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// myChart
|
||||
//
|
||||
chartArea1.Name = "ChartArea1";
|
||||
this.myChart.ChartAreas.Add(chartArea1);
|
||||
this.myChart.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
legend1.Name = "Legend1";
|
||||
this.myChart.Legends.Add(legend1);
|
||||
this.myChart.Location = new System.Drawing.Point(0, 0);
|
||||
this.myChart.Name = "myChart";
|
||||
this.myChart.Palette = System.Windows.Forms.DataVisualization.Charting.ChartColorPalette.Bright;
|
||||
series1.ChartArea = "ChartArea1";
|
||||
series1.Legend = "Legend1";
|
||||
series1.Name = "Series1";
|
||||
this.myChart.Series.Add(series1);
|
||||
this.myChart.Size = new System.Drawing.Size(400, 300);
|
||||
this.myChart.TabIndex = 0;
|
||||
this.myChart.Text = "chart1";
|
||||
title1.Name = "Title1";
|
||||
title1.Text = "Title1";
|
||||
this.myChart.Titles.Add(title1);
|
||||
//
|
||||
// HistogramCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.myChart);
|
||||
this.Name = "HistogramCtrl";
|
||||
this.Size = new System.Drawing.Size(400, 300);
|
||||
((System.ComponentModel.ISupportInitialize)(this.myChart)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.DataVisualization.Charting.Chart myChart;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Forms.DataVisualization.Charting;
|
||||
|
||||
namespace ResultsBrowser.Forms
|
||||
{
|
||||
public partial class HistogramCtrl : UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Create user control that displays a bar chart iwth custom X-axis labels.
|
||||
/// </summary>
|
||||
/// <param name="title">Title of the chart displayed at the top</param>
|
||||
/// <param name="values">Values = bar lengths</param>
|
||||
/// <param name="labels">Labels for the X-axis</param>
|
||||
public HistogramCtrl(string title, double[] values, string[] labels)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
if (myChart.Titles.Count > 0) myChart.Titles[0].Text = title;
|
||||
|
||||
if ((myChart.Series.Count > 0) && (values != null))
|
||||
{
|
||||
int startOffset = -1;
|
||||
int endOffset = 1;
|
||||
for (int i = 0; i < Math.Min(values.Length + 1, labels.Length); i++)
|
||||
{
|
||||
if (i < values.Length) myChart.Series[0].Points.Add(values[i]);
|
||||
if (!string.IsNullOrEmpty(labels[i]))
|
||||
{
|
||||
myChart.ChartAreas[0].AxisX.CustomLabels.Add(new System.Windows.Forms.DataVisualization.Charting.CustomLabel(startOffset, endOffset, labels[i], 0, LabelMarkStyle.None));
|
||||
}
|
||||
startOffset = startOffset + 1;
|
||||
endOffset = endOffset + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
namespace ResultsBrowser.Forms
|
||||
{
|
||||
partial class HistogramDlg
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
|
||||
this.exportButton = new System.Windows.Forms.Button();
|
||||
this.printButton = new System.Windows.Forms.Button();
|
||||
this.closeButton = new System.Windows.Forms.Button();
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
|
||||
this.splitContainer2.Panel2.SuspendLayout();
|
||||
this.splitContainer2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.flowLayoutPanel1);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(572, 409);
|
||||
this.splitContainer1.SplitterDistance = 320;
|
||||
this.splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// splitContainer2
|
||||
//
|
||||
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer2.Name = "splitContainer2";
|
||||
//
|
||||
// splitContainer2.Panel2
|
||||
//
|
||||
this.splitContainer2.Panel2.Controls.Add(this.exportButton);
|
||||
this.splitContainer2.Panel2.Controls.Add(this.printButton);
|
||||
this.splitContainer2.Panel2.Controls.Add(this.closeButton);
|
||||
this.splitContainer2.Size = new System.Drawing.Size(572, 85);
|
||||
this.splitContainer2.SplitterDistance = 249;
|
||||
this.splitContainer2.TabIndex = 0;
|
||||
//
|
||||
// exportButton
|
||||
//
|
||||
this.exportButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.exportButton.Location = new System.Drawing.Point(103, 21);
|
||||
this.exportButton.Name = "exportButton";
|
||||
this.exportButton.Size = new System.Drawing.Size(94, 41);
|
||||
this.exportButton.TabIndex = 1;
|
||||
this.exportButton.Text = "Export";
|
||||
this.exportButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// printButton
|
||||
//
|
||||
this.printButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.printButton.Location = new System.Drawing.Point(4, 21);
|
||||
this.printButton.Name = "printButton";
|
||||
this.printButton.Size = new System.Drawing.Size(94, 41);
|
||||
this.printButton.TabIndex = 0;
|
||||
this.printButton.Text = "Print";
|
||||
this.printButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// closeButton
|
||||
//
|
||||
this.closeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.closeButton.Location = new System.Drawing.Point(203, 21);
|
||||
this.closeButton.Name = "closeButton";
|
||||
this.closeButton.Size = new System.Drawing.Size(94, 41);
|
||||
this.closeButton.TabIndex = 2;
|
||||
this.closeButton.Text = "Close";
|
||||
this.closeButton.UseVisualStyleBackColor = true;
|
||||
this.closeButton.Click += new System.EventHandler(this.closeButton_Click);
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(572, 320);
|
||||
this.flowLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// HistogramDlg
|
||||
//
|
||||
this.AcceptButton = this.closeButton;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(572, 409);
|
||||
this.Controls.Add(this.splitContainer1);
|
||||
this.Name = "HistogramDlg";
|
||||
this.Text = "HistogramDlg";
|
||||
this.Load += new System.EventHandler(this.HistogramDlg_Load);
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.splitContainer2.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
|
||||
this.splitContainer2.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private System.Windows.Forms.SplitContainer splitContainer2;
|
||||
private System.Windows.Forms.Button closeButton;
|
||||
private System.Windows.Forms.Button printButton;
|
||||
private System.Windows.Forms.Button exportButton;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Forms.DataVisualization.Charting;
|
||||
using Results.Entities;
|
||||
using ResultsBrowser.Resources;
|
||||
using ResultsBrowser.Output.Printers.Statistics;
|
||||
|
||||
namespace ResultsBrowser.Forms
|
||||
{
|
||||
public partial class HistogramDlg : Form
|
||||
{
|
||||
const int NrBins = 11;
|
||||
|
||||
IList<WaterMeter> waterMeters;
|
||||
HistogramOptionsDlg options;
|
||||
|
||||
public HistogramDlg(IList<WaterMeter> waterMeters, HistogramOptionsDlg options, string title)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.waterMeters = waterMeters;
|
||||
this.options = options;
|
||||
Text = title;
|
||||
|
||||
closeButton.Text = Strings.OkBtnText;
|
||||
printButton.Text = Strings.Print;
|
||||
}
|
||||
|
||||
private void HistogramDlg_Load(object sender, EventArgs e)
|
||||
{
|
||||
CalculateAndDraw();
|
||||
}
|
||||
|
||||
void CalculateAndDraw()
|
||||
{
|
||||
for (int i = 0; i < options.SelectedItems.Count; i++)
|
||||
{
|
||||
Results.WMeterRsltItemSpec item = options.SelectedItems[i];
|
||||
|
||||
try
|
||||
{
|
||||
/// Find minimum and maximum
|
||||
double min = Double.MaxValue;
|
||||
double max = Double.MinValue;
|
||||
double sum = 0;
|
||||
int count = 0;
|
||||
foreach (var wm in waterMeters)
|
||||
{
|
||||
string strValue = item.Print(wm);
|
||||
double value;
|
||||
if (!double.TryParse(strValue, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.CurrentCulture, out value) &&
|
||||
!double.TryParse(strValue, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture, out value))
|
||||
{
|
||||
throw new Exception(string.Format("{0} is not a number, cannot calculate histogram", item.Caption));
|
||||
}
|
||||
|
||||
sum += value;
|
||||
count++;
|
||||
if (min > value) min = value;
|
||||
if (max < value) max = value;
|
||||
}
|
||||
|
||||
double mean = (count != 0) ? (sum / count) : 0; /// Prevent division by zero
|
||||
|
||||
///
|
||||
/// Determine limits for bins
|
||||
///
|
||||
double[] binHiLim;
|
||||
string[] labels;
|
||||
if ((-0.55 <= min) && (max <= 0.55))
|
||||
{
|
||||
labels = new string[] { "-0.6", "", "-0.4", "", "-0.2", "", "0", "", "0.2", "", "0.4", "", "0.6" };
|
||||
binHiLim = new double[] { -0.45, -0.35, -0.25, -0.15, -0.05, 0.05, 0.15, 0.25, 0.35, 0.45, 0.55 };
|
||||
}
|
||||
else if ((-1.1 <= min) && (max <= 1.1))
|
||||
{
|
||||
labels = new string[] { "-1.2", "", "-0.8", "", "-0.4", "", "0", "", "0.4", "", "0.8", "", "1.2" };
|
||||
binHiLim = new double[] { -0.9, -0.7, -0.5, -0.3, -0.1, 0.1, 0.3, 0.5, 0.7, 0.9, 1.1 };
|
||||
}
|
||||
else if ((-2.2 <= min) && (max <= 2.2))
|
||||
{
|
||||
labels = new string[] { "-2.4", "", "-1.6", "", "-0.8", "", "0", "", "0.8", "", "1.6", "", "2.4" };
|
||||
binHiLim = new double[] { -1.8, -1.4, -1.0, -0.6, -0.2, 0.2, 0.6, 1.0, 1.4, 1.8, 2.2 };
|
||||
}
|
||||
else if ((-4.4 <= min) && (max <= 4.4))
|
||||
{
|
||||
labels = new string[] { "-4.8", "", "-3.2", "", "-1.6", "", "0", "", "1.6", "", "3.2", "", "4.8" };
|
||||
binHiLim = new double[] { -3.6, -2.8, -2.0, -1.2, -0.4, 0.4, 1.2, 2.0, 2.8, 3.6, 4.4 };
|
||||
}
|
||||
else
|
||||
{
|
||||
labels = new string[] { "-9.6", "", "-6.4", "", "-3.2", "", "0", "", "3.2", "", "6.4", "", "9.6" };
|
||||
binHiLim = new double[] { -7.2, -5.6, -4.0, -2.4, -0.8, 0.8, 2.4, 4.0, 5.6, 7.2, 8.8 };
|
||||
}
|
||||
|
||||
int nrBins = Math.Min(labels.Length - 1, binHiLim.Length + 1);
|
||||
|
||||
double[] bins = new double[nrBins];
|
||||
for (int j = 0; j < nrBins; j++) bins[j] = 0;
|
||||
|
||||
/// Calculate bins
|
||||
foreach (var wm in waterMeters)
|
||||
{
|
||||
string strValue = item.Print(wm);
|
||||
double value;
|
||||
if (!double.TryParse(strValue, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.CurrentCulture, out value) &&
|
||||
!double.TryParse(strValue, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture, out value))
|
||||
{
|
||||
throw new Exception(string.Format("{0} is not a number, cannot calculate histogram", item.Caption));
|
||||
}
|
||||
|
||||
for (int j = 0; j < nrBins - 1; j++)
|
||||
{
|
||||
if (value < binHiLim[j])
|
||||
{
|
||||
bins[j] += 1.0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (value >= binHiLim[nrBins - 2])
|
||||
{
|
||||
bins[nrBins - 1] += 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Draw
|
||||
///
|
||||
HistogramCtrl histo = new HistogramCtrl(string.Format("{0} mean = {1}", item.Caption, mean.ToString("F3")), bins, labels);
|
||||
flowLayoutPanel1.Controls.Add(histo);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string msg = exc.Message;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void closeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
namespace ResultsBrowser.Forms
|
||||
{
|
||||
partial class HistogramOptionsDlg
|
||||
{
|
||||
/// <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.cancelButton = new System.Windows.Forms.Button();
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancelButton.Location = new System.Drawing.Point(380, 302);
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.Size = new System.Drawing.Size(95, 38);
|
||||
this.cancelButton.TabIndex = 9;
|
||||
this.cancelButton.Text = "Cancel";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.okButton.Location = new System.Drawing.Point(269, 302);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(95, 38);
|
||||
this.okButton.TabIndex = 8;
|
||||
this.okButton.Text = "OK";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(12, 12);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(479, 271);
|
||||
this.flowLayoutPanel1.TabIndex = 10;
|
||||
//
|
||||
// HistogramOptionsDlg
|
||||
//
|
||||
this.AcceptButton = this.okButton;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.cancelButton;
|
||||
this.ClientSize = new System.Drawing.Size(503, 355);
|
||||
this.Controls.Add(this.flowLayoutPanel1);
|
||||
this.Controls.Add(this.cancelButton);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.Name = "HistogramOptionsDlg";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "HistogramOptionsDlg";
|
||||
this.Load += new System.EventHandler(this.HistogramOptionsDlg_Load);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button cancelButton;
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using ResultsBrowser.Resources;
|
||||
|
||||
namespace ResultsBrowser.Forms
|
||||
{
|
||||
public partial class HistogramOptionsDlg : Form
|
||||
{
|
||||
IList<Results.WMeterRsltItemSpec> items;
|
||||
public IList<Results.WMeterRsltItemSpec> SelectedItems;
|
||||
|
||||
IList<CheckBox> checkBoxes;
|
||||
|
||||
public HistogramOptionsDlg(IList<Results.WMeterRsltItemSpec> items)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.items = items;
|
||||
|
||||
checkBoxes = new List<CheckBox>();
|
||||
}
|
||||
|
||||
private void HistogramOptionsDlg_Load(object sender, EventArgs e)
|
||||
{
|
||||
Localize();
|
||||
|
||||
foreach (var item in items)
|
||||
{
|
||||
CheckBox cb = new CheckBox();
|
||||
cb.Text = item.Caption;
|
||||
cb.Checked = false;
|
||||
flowLayoutPanel1.Controls.Add(cb);
|
||||
checkBoxes.Add(cb);
|
||||
}
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Statistics;
|
||||
okButton.Text = Strings.OkBtnText;
|
||||
cancelButton.Text = Strings.CancelBtnText;
|
||||
}
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
SelectedItems = new List<Results.WMeterRsltItemSpec>();
|
||||
for (int i = 0; i < items.Count; i++)
|
||||
{
|
||||
if (checkBoxes[i].Checked) SelectedItems.Add(items[i]);
|
||||
}
|
||||
|
||||
//Program.LocalSettings.RowItemCaption = RowItem.Caption;
|
||||
// ...
|
||||
//Program.LocalSettings.Save();
|
||||
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void cancelButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
@@ -1,4 +1,7 @@
|
||||
using System;
|
||||
///
|
||||
/// Copyright (c) 2016-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using Results.Entities;
|
||||
@@ -11,22 +14,7 @@ namespace ResultsBrowser.Forms
|
||||
public partial class StatisticsDlg : Form
|
||||
{
|
||||
IList<WaterMeter> waterMeters;
|
||||
|
||||
bool twoDim;
|
||||
|
||||
Results.WMeterRsltItemSpec rowItem;
|
||||
Results.WMeterRsltItemSpec rowItem2;
|
||||
Results.WMeterRsltItemSpec rowItem3;
|
||||
Results.WMeterRsltItemSpec columnItem;
|
||||
Results.WMeterRsltItemSpec columnItem2;
|
||||
Results.WMeterRsltItemSpec columnItem3;
|
||||
|
||||
string rowTestSpec;
|
||||
string rowTestSpec2;
|
||||
string rowTestSpec3;
|
||||
string columnTestSpec;
|
||||
string columnTestSpec2;
|
||||
string columnTestSpec3;
|
||||
StatisticsOptionsDlg options;
|
||||
|
||||
IList<string> rowValues;
|
||||
IList<string> columnValues;
|
||||
@@ -36,23 +24,14 @@ namespace ResultsBrowser.Forms
|
||||
string title;
|
||||
|
||||
|
||||
public StatisticsDlg(IList<WaterMeter> waterMeters, bool twoDim,
|
||||
Results.WMeterRsltItemSpec rowItem,
|
||||
Results.WMeterRsltItemSpec rowItem2,
|
||||
Results.WMeterRsltItemSpec rowItem3,
|
||||
Results.WMeterRsltItemSpec columnItem,
|
||||
Results.WMeterRsltItemSpec columnItem2,
|
||||
Results.WMeterRsltItemSpec columnItem3,
|
||||
string rowTestSpec,
|
||||
string rowTestSpec2,
|
||||
string rowTestSpec3,
|
||||
string columnTestSpec,
|
||||
string columnTestSpec2,
|
||||
string columnTestSpec3,
|
||||
public StatisticsDlg(IList<WaterMeter> waterMeters, StatisticsOptionsDlg options,
|
||||
DateTime startDate, DateTime endDate)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.waterMeters = waterMeters;
|
||||
this.options = options;
|
||||
|
||||
if (!string.IsNullOrEmpty(Program.LocalSettings.TimePeriodFormat) && (startDate != new DateTime(0)) && (endDate != new DateTime(0)))
|
||||
{
|
||||
title = string.Format(Program.LocalSettings.TimePeriodFormat, startDate, endDate);
|
||||
@@ -66,26 +45,6 @@ namespace ResultsBrowser.Forms
|
||||
|
||||
closeButton.Text = Strings.OkBtnText;
|
||||
printButton.Text = Strings.Print;
|
||||
|
||||
this.waterMeters = waterMeters;
|
||||
|
||||
this.twoDim = twoDim;
|
||||
|
||||
this.rowItem = rowItem;
|
||||
this.rowItem2 = rowItem2;
|
||||
this.rowItem3 = rowItem3;
|
||||
|
||||
this.columnItem = columnItem;
|
||||
this.columnItem2 = columnItem2;
|
||||
this.columnItem3 = columnItem3;
|
||||
|
||||
this.rowTestSpec = rowTestSpec;
|
||||
this.rowTestSpec2 = rowTestSpec2;
|
||||
this.rowTestSpec3 = rowTestSpec3;
|
||||
|
||||
this.columnTestSpec = columnTestSpec;
|
||||
this.columnTestSpec2 = columnTestSpec2;
|
||||
this.columnTestSpec3 = columnTestSpec3;
|
||||
}
|
||||
|
||||
private void StatisticsDlg_Load(object sender, EventArgs e)
|
||||
@@ -105,16 +64,16 @@ namespace ResultsBrowser.Forms
|
||||
///
|
||||
foreach (var wm in waterMeters)
|
||||
{
|
||||
string value = rowItem.Print(wm);
|
||||
if (rowItem2 != null) value = value + " | " + rowItem2.Print(wm);
|
||||
if (rowItem3 != null) value = value + " | " + rowItem3.Print(wm);
|
||||
string value = options.RowItem.Print(wm);
|
||||
if (options.RowItem2 != null) value = value + " | " + options.RowItem2.Print(wm);
|
||||
if (options.RowItem3 != null) value = value + " | " + options.RowItem3.Print(wm);
|
||||
if (!rowValues.Contains(value)) rowValues.Add(value);
|
||||
|
||||
if (twoDim)
|
||||
if (options.TwoDim)
|
||||
{
|
||||
value = columnItem.Print(wm);
|
||||
if (columnItem2 != null) value = value + " | " + columnItem2.Print(wm);
|
||||
if (columnItem3 != null) value = value + " | " + columnItem3.Print(wm);
|
||||
value = options.ColumnItem.Print(wm);
|
||||
if (options.ColumnItem2 != null) value = value + " | " + options.ColumnItem2.Print(wm);
|
||||
if (options.ColumnItem3 != null) value = value + " | " + options.ColumnItem3.Print(wm);
|
||||
if (!columnValues.Contains(value)) columnValues.Add(value);
|
||||
}
|
||||
}
|
||||
@@ -129,17 +88,17 @@ namespace ResultsBrowser.Forms
|
||||
{
|
||||
for (int row = 0; row < rowValues.Count; row++)
|
||||
{
|
||||
string rowValue = rowItem.Print(wm);
|
||||
if (rowItem2 != null) rowValue = rowValue + " | " + rowItem2.Print(wm);
|
||||
if (rowItem3 != null) rowValue = rowValue + " | " + rowItem3.Print(wm);
|
||||
string rowValue = options.RowItem.Print(wm);
|
||||
if (options.RowItem2 != null) rowValue = rowValue + " | " + options.RowItem2.Print(wm);
|
||||
if (options.RowItem3 != null) rowValue = rowValue + " | " + options.RowItem3.Print(wm);
|
||||
|
||||
if (twoDim)
|
||||
if (options.TwoDim)
|
||||
{
|
||||
for (int column = 0; column < columnsCount; column++)
|
||||
{
|
||||
string columnValue = columnItem.Print(wm);
|
||||
if (columnItem2 != null) columnValue = columnValue + " | " + columnItem2.Print(wm);
|
||||
if (columnItem3 != null) columnValue = columnValue + " | " + columnItem3.Print(wm);
|
||||
string columnValue = options.ColumnItem.Print(wm);
|
||||
if (options.ColumnItem2 != null) columnValue = columnValue + " | " + options.ColumnItem2.Print(wm);
|
||||
if (options.ColumnItem3 != null) columnValue = columnValue + " | " + options.ColumnItem3.Print(wm);
|
||||
|
||||
if (rowValue == rowValues[row] && columnValue == columnValues[column])
|
||||
{
|
||||
@@ -164,7 +123,7 @@ namespace ResultsBrowser.Forms
|
||||
statisticsListView.Columns.Add(" ", 200);
|
||||
for (int column = 0; column < columnsCount; column++)
|
||||
{
|
||||
statisticsListView.Columns.Add((twoDim ? columnValues[column] : Strings.Count), 70);
|
||||
statisticsListView.Columns.Add((options.TwoDim ? columnValues[column] : Strings.Count), 70);
|
||||
}
|
||||
|
||||
for (int row = 0; row < rowValues.Count; row++)
|
||||
@@ -197,7 +156,7 @@ namespace ResultsBrowser.Forms
|
||||
table[0, 0] = string.Empty;
|
||||
for (int column = 0; column < columnsCount; column++)
|
||||
{
|
||||
table[0, column + 1] = (twoDim ? columnValues[column] : Strings.Count);
|
||||
table[0, column + 1] = (options.TwoDim ? columnValues[column] : Strings.Count);
|
||||
}
|
||||
|
||||
for (int row = 0; row < rowValues.Count; row++)
|
||||
@@ -234,7 +193,7 @@ namespace ResultsBrowser.Forms
|
||||
{
|
||||
using (TextWriter writer = new StreamWriter(dlg.FileName, false, System.Text.Encoding.UTF8))
|
||||
{
|
||||
if (twoDim)
|
||||
if (options.TwoDim)
|
||||
{
|
||||
/// Write column headers
|
||||
for (int i = 0; i < columnValues.Count; i++)
|
||||
@@ -245,7 +204,7 @@ namespace ResultsBrowser.Forms
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteLine(string.Format("\"{0}\";\"{1}\"", rowItem.Caption, Strings.Count));
|
||||
writer.WriteLine(string.Format("\"{0}\";\"{1}\"", options.RowItem.Caption, Strings.Count));
|
||||
}
|
||||
|
||||
int nrColumns = Math.Max(1, columnValues.Count);
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using System;
|
||||
///
|
||||
/// Copyright (c) 2016-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using ResultsBrowser.Resources;
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.18.1140.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1140.0")]
|
||||
[assembly: AssemblyVersion("2.18.1146.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1146.0")]
|
||||
|
||||
@@ -240,4 +240,7 @@
|
||||
<data name="Add_data_from_Oracle" xml:space="preserve">
|
||||
<value>Dohledej údaje z Oracle</value>
|
||||
</data>
|
||||
<data name="Histograms" xml:space="preserve">
|
||||
<value>Histogramy</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -828,4 +828,7 @@
|
||||
<data name="Add_data_from_Oracle" xml:space="preserve">
|
||||
<value>Add data from Oracle</value>
|
||||
</data>
|
||||
<data name="Histograms" xml:space="preserve">
|
||||
<value>Histograms</value>
|
||||
</data>
|
||||
</root>
|
||||
+9
@@ -1257,6 +1257,15 @@ namespace ResultsBrowser.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Histograms.
|
||||
/// </summary>
|
||||
internal static string Histograms {
|
||||
get {
|
||||
return ResourceManager.GetString("Histograms", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Horizontally.
|
||||
/// </summary>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;SLM_50;HEAT_METERS;LANG_SK</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
@@ -31,7 +31,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;MUNICH</DefineConstants>
|
||||
<DefineConstants>TRACE;SLM_50;HEAT_METERS;LANG_SK</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
@@ -60,6 +60,7 @@
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Windows.Forms.DataVisualization" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
@@ -133,6 +134,24 @@
|
||||
<Compile Include="Forms\DatabaseSettingsDlg.Designer.cs">
|
||||
<DependentUpon>DatabaseSettingsDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\HistogramCtrl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\HistogramCtrl.Designer.cs">
|
||||
<DependentUpon>HistogramCtrl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\HistogramDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\HistogramDlg.Designer.cs">
|
||||
<DependentUpon>HistogramDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\HistogramOptionsDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\HistogramOptionsDlg.Designer.cs">
|
||||
<DependentUpon>HistogramOptionsDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\NoBenchOrDatabaseDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -202,6 +221,15 @@
|
||||
<EmbeddedResource Include="Forms\DatabaseSettingsDlg.resx">
|
||||
<DependentUpon>DatabaseSettingsDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\HistogramCtrl.resx">
|
||||
<DependentUpon>HistogramCtrl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\HistogramDlg.resx">
|
||||
<DependentUpon>HistogramDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\HistogramOptionsDlg.resx">
|
||||
<DependentUpon>HistogramOptionsDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\NoBenchOrDatabaseDlg.resx">
|
||||
<DependentUpon>NoBenchOrDatabaseDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
||||
+76
-35
@@ -34,10 +34,13 @@
|
||||
this.filtersFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.resultsGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.resultsListView = new System.Windows.Forms.ListView();
|
||||
this.printerConfigBtn = new System.Windows.Forms.Button();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.histogramBtn = new System.Windows.Forms.Button();
|
||||
this.statisticsBtn = new System.Windows.Forms.Button();
|
||||
this.printQueryResultsBtn = new System.Windows.Forms.Button();
|
||||
this.outputGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.exportQueryResultsBtn = new System.Windows.Forms.Button();
|
||||
this.printQueryResultsBtn = new System.Windows.Forms.Button();
|
||||
this.printerConfigBtn = new System.Windows.Forms.Button();
|
||||
this.formatOfResultsBtn = new System.Windows.Forms.Button();
|
||||
this.clearFiltersBtn = new System.Windows.Forms.Button();
|
||||
this.settingsBtn = new System.Windows.Forms.Button();
|
||||
@@ -62,6 +65,8 @@
|
||||
this.hSplitContainer.SuspendLayout();
|
||||
this.filtersGroupBox.SuspendLayout();
|
||||
this.resultsGroupBox.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.outputGroupBox.SuspendLayout();
|
||||
this.testBenchesGroupBox.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
@@ -79,10 +84,9 @@
|
||||
//
|
||||
// vSplitContainer.Panel2
|
||||
//
|
||||
this.vSplitContainer.Panel2.Controls.Add(this.groupBox1);
|
||||
this.vSplitContainer.Panel2.Controls.Add(this.outputGroupBox);
|
||||
this.vSplitContainer.Panel2.Controls.Add(this.printerConfigBtn);
|
||||
this.vSplitContainer.Panel2.Controls.Add(this.statisticsBtn);
|
||||
this.vSplitContainer.Panel2.Controls.Add(this.printQueryResultsBtn);
|
||||
this.vSplitContainer.Panel2.Controls.Add(this.exportQueryResultsBtn);
|
||||
this.vSplitContainer.Panel2.Controls.Add(this.formatOfResultsBtn);
|
||||
this.vSplitContainer.Panel2.Controls.Add(this.clearFiltersBtn);
|
||||
this.vSplitContainer.Panel2.Controls.Add(this.settingsBtn);
|
||||
@@ -154,6 +158,68 @@
|
||||
this.resultsListView.UseCompatibleStateImageBehavior = false;
|
||||
this.resultsListView.View = System.Windows.Forms.View.Details;
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.histogramBtn);
|
||||
this.groupBox1.Controls.Add(this.statisticsBtn);
|
||||
this.groupBox1.Location = new System.Drawing.Point(8, 608);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(125, 93);
|
||||
this.groupBox1.TabIndex = 13;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Analysis";
|
||||
//
|
||||
// histogramBtn
|
||||
//
|
||||
this.histogramBtn.Location = new System.Drawing.Point(5, 55);
|
||||
this.histogramBtn.Name = "histogramBtn";
|
||||
this.histogramBtn.Size = new System.Drawing.Size(114, 32);
|
||||
this.histogramBtn.TabIndex = 11;
|
||||
this.histogramBtn.Text = "Histograms";
|
||||
this.histogramBtn.UseVisualStyleBackColor = true;
|
||||
this.histogramBtn.Click += new System.EventHandler(this.histogramBtn_Click);
|
||||
//
|
||||
// statisticsBtn
|
||||
//
|
||||
this.statisticsBtn.Location = new System.Drawing.Point(5, 18);
|
||||
this.statisticsBtn.Name = "statisticsBtn";
|
||||
this.statisticsBtn.Size = new System.Drawing.Size(114, 32);
|
||||
this.statisticsBtn.TabIndex = 10;
|
||||
this.statisticsBtn.Text = "Statistics";
|
||||
this.statisticsBtn.UseVisualStyleBackColor = true;
|
||||
this.statisticsBtn.Click += new System.EventHandler(this.statisticsBtn_Click);
|
||||
//
|
||||
// outputGroupBox
|
||||
//
|
||||
this.outputGroupBox.Controls.Add(this.exportQueryResultsBtn);
|
||||
this.outputGroupBox.Controls.Add(this.printQueryResultsBtn);
|
||||
this.outputGroupBox.Location = new System.Drawing.Point(8, 509);
|
||||
this.outputGroupBox.Name = "outputGroupBox";
|
||||
this.outputGroupBox.Size = new System.Drawing.Size(125, 93);
|
||||
this.outputGroupBox.TabIndex = 12;
|
||||
this.outputGroupBox.TabStop = false;
|
||||
this.outputGroupBox.Text = "Output";
|
||||
//
|
||||
// exportQueryResultsBtn
|
||||
//
|
||||
this.exportQueryResultsBtn.Location = new System.Drawing.Point(5, 18);
|
||||
this.exportQueryResultsBtn.Name = "exportQueryResultsBtn";
|
||||
this.exportQueryResultsBtn.Size = new System.Drawing.Size(114, 32);
|
||||
this.exportQueryResultsBtn.TabIndex = 8;
|
||||
this.exportQueryResultsBtn.Text = "Export query results";
|
||||
this.exportQueryResultsBtn.UseVisualStyleBackColor = true;
|
||||
this.exportQueryResultsBtn.Click += new System.EventHandler(this.exportQueryResultsBtn_Click);
|
||||
//
|
||||
// printQueryResultsBtn
|
||||
//
|
||||
this.printQueryResultsBtn.Location = new System.Drawing.Point(5, 55);
|
||||
this.printQueryResultsBtn.Name = "printQueryResultsBtn";
|
||||
this.printQueryResultsBtn.Size = new System.Drawing.Size(113, 32);
|
||||
this.printQueryResultsBtn.TabIndex = 9;
|
||||
this.printQueryResultsBtn.Text = "Print query results";
|
||||
this.printQueryResultsBtn.UseVisualStyleBackColor = true;
|
||||
this.printQueryResultsBtn.Click += new System.EventHandler(this.printQueryResultsBtn_Click);
|
||||
//
|
||||
// printerConfigBtn
|
||||
//
|
||||
this.printerConfigBtn.Location = new System.Drawing.Point(8, 316);
|
||||
@@ -164,36 +230,6 @@
|
||||
this.printerConfigBtn.UseVisualStyleBackColor = true;
|
||||
this.printerConfigBtn.Click += new System.EventHandler(this.printerConfigBtn_Click);
|
||||
//
|
||||
// statisticsBtn
|
||||
//
|
||||
this.statisticsBtn.Location = new System.Drawing.Point(8, 621);
|
||||
this.statisticsBtn.Name = "statisticsBtn";
|
||||
this.statisticsBtn.Size = new System.Drawing.Size(125, 35);
|
||||
this.statisticsBtn.TabIndex = 10;
|
||||
this.statisticsBtn.Text = "Statistics";
|
||||
this.statisticsBtn.UseVisualStyleBackColor = true;
|
||||
this.statisticsBtn.Click += new System.EventHandler(this.statisticsBtn_Click);
|
||||
//
|
||||
// printQueryResultsBtn
|
||||
//
|
||||
this.printQueryResultsBtn.Location = new System.Drawing.Point(8, 548);
|
||||
this.printQueryResultsBtn.Name = "printQueryResultsBtn";
|
||||
this.printQueryResultsBtn.Size = new System.Drawing.Size(125, 35);
|
||||
this.printQueryResultsBtn.TabIndex = 9;
|
||||
this.printQueryResultsBtn.Text = "Print query results";
|
||||
this.printQueryResultsBtn.UseVisualStyleBackColor = true;
|
||||
this.printQueryResultsBtn.Click += new System.EventHandler(this.printQueryResultsBtn_Click);
|
||||
//
|
||||
// exportQueryResultsBtn
|
||||
//
|
||||
this.exportQueryResultsBtn.Location = new System.Drawing.Point(8, 508);
|
||||
this.exportQueryResultsBtn.Name = "exportQueryResultsBtn";
|
||||
this.exportQueryResultsBtn.Size = new System.Drawing.Size(125, 35);
|
||||
this.exportQueryResultsBtn.TabIndex = 8;
|
||||
this.exportQueryResultsBtn.Text = "Export query results";
|
||||
this.exportQueryResultsBtn.UseVisualStyleBackColor = true;
|
||||
this.exportQueryResultsBtn.Click += new System.EventHandler(this.exportQueryResultsBtn_Click);
|
||||
//
|
||||
// formatOfResultsBtn
|
||||
//
|
||||
this.formatOfResultsBtn.Location = new System.Drawing.Point(8, 276);
|
||||
@@ -370,6 +406,8 @@
|
||||
this.hSplitContainer.ResumeLayout(false);
|
||||
this.filtersGroupBox.ResumeLayout(false);
|
||||
this.resultsGroupBox.ResumeLayout(false);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.outputGroupBox.ResumeLayout(false);
|
||||
this.testBenchesGroupBox.ResumeLayout(false);
|
||||
this.testBenchesGroupBox.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
@@ -402,5 +440,8 @@
|
||||
private System.Windows.Forms.RadioButton checkBox4;
|
||||
private System.Windows.Forms.Button printerConfigBtn;
|
||||
private System.Windows.Forms.RadioButton checkBox6;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.GroupBox outputGroupBox;
|
||||
private System.Windows.Forms.Button histogramBtn;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,7 @@
|
||||
using System;
|
||||
///
|
||||
/// Copyright (c) 2016-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
@@ -489,7 +492,7 @@ namespace ResultsBrowser
|
||||
IList<Results.WMeterRsltItemSpec> items = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
|
||||
|
||||
///
|
||||
/// Enter options
|
||||
/// Statistics options
|
||||
///
|
||||
Forms.StatisticsOptionsDlg optionsDlg = new Forms.StatisticsOptionsDlg(items);
|
||||
if (optionsDlg.ShowDialog() != DialogResult.OK) return;
|
||||
@@ -497,16 +500,31 @@ namespace ResultsBrowser
|
||||
///
|
||||
/// Calculate statistics
|
||||
///
|
||||
Forms.StatisticsDlg statisticsDlg = new Forms.StatisticsDlg(waterMeters, optionsDlg.TwoDim,
|
||||
optionsDlg.RowItem, optionsDlg.RowItem2, optionsDlg.RowItem3,
|
||||
optionsDlg.ColumnItem, optionsDlg.ColumnItem2, optionsDlg.ColumnItem3,
|
||||
optionsDlg.RowTestSpecifier, optionsDlg.RowTestSpecifier2, optionsDlg.RowTestSpecifier3,
|
||||
optionsDlg.ColumnTestSpecifier, optionsDlg.ColumnTestSpecifier2, optionsDlg.ColumnTestSpecifier3,
|
||||
timePeriodStart, timePeriodEnd);
|
||||
Forms.StatisticsDlg statisticsDlg = new Forms.StatisticsDlg(waterMeters, optionsDlg, timePeriodStart, timePeriodEnd);
|
||||
statisticsDlg.ShowDialog();
|
||||
}
|
||||
|
||||
|
||||
private void histogramBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (waterMeters == null || waterMeters.Count == 0) return;
|
||||
|
||||
IList<Results.WMeterRsltItemSpec> items = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
|
||||
|
||||
///
|
||||
/// Histogram options
|
||||
///
|
||||
Forms.HistogramOptionsDlg optionsDlg = new Forms.HistogramOptionsDlg(items);
|
||||
if (optionsDlg.ShowDialog() != DialogResult.OK) return;
|
||||
|
||||
///
|
||||
/// Calculate and display histograms
|
||||
///
|
||||
Forms.HistogramDlg histogramDlg = new Forms.HistogramDlg(waterMeters, optionsDlg, "Histogramy");
|
||||
histogramDlg.ShowDialog();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Updates component factory
|
||||
/// </summary>
|
||||
|
||||
+128
-58
@@ -18,7 +18,6 @@ namespace Statistics
|
||||
[XmlRootAttribute("Statistics")]
|
||||
public class LocalSettings
|
||||
{
|
||||
public const int BenchesCount = 6;
|
||||
public const int FlowsCount = 5;
|
||||
|
||||
|
||||
@@ -47,115 +46,166 @@ namespace Statistics
|
||||
return ((ConnectionStrings != null) && (i >= 0) && (i < ConnectionStrings.Length)) ? ConnectionStrings[i] : string.Empty;
|
||||
}
|
||||
|
||||
///
|
||||
/// MID-s
|
||||
///
|
||||
public string[] MidNames;
|
||||
|
||||
///
|
||||
/// Flow settings
|
||||
///
|
||||
public bool[] FlowEnabledWMs;
|
||||
public bool[] FlowEnabledI1;
|
||||
public bool[] FlowEnabledI2;
|
||||
public bool[] FlowEnabledI3;
|
||||
public bool[] FlowEnabledI4;
|
||||
///
|
||||
public bool GetFlowEnabled(UserControls.MidId midId, int i)
|
||||
public bool[] FlowEnabledI5;
|
||||
public bool[] FlowEnabledI6;
|
||||
public bool[] FlowEnabledI7;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get flow enabled info
|
||||
/// </summary>
|
||||
/// <param name="midId">1-based MID id</param>
|
||||
/// <param name="i">0-based flow id</param>
|
||||
/// <returns>true = enabled</returns>
|
||||
public bool GetFlowEnabled(int midId, int i)
|
||||
{
|
||||
switch (midId)
|
||||
{
|
||||
case UserControls.MidId.WaterMeters:
|
||||
return ((FlowEnabledWMs != null) && (i >= 0) && (i < FlowEnabledWMs.Length)) ? FlowEnabledWMs[i] : false;
|
||||
case UserControls.MidId.I1: return ((FlowEnabledI1 != null) && (i >= 0) && (i < FlowEnabledI1.Length)) ? FlowEnabledI1[i] : false;
|
||||
case UserControls.MidId.I2: return ((FlowEnabledI2 != null) && (i >= 0) && (i < FlowEnabledI2.Length)) ? FlowEnabledI2[i] : false;
|
||||
case UserControls.MidId.I3: return ((FlowEnabledI3 != null) && (i >= 0) && (i < FlowEnabledI3.Length)) ? FlowEnabledI3[i] : false;
|
||||
case UserControls.MidId.I4: return ((FlowEnabledI4 != null) && (i >= 0) && (i < FlowEnabledI4.Length)) ? FlowEnabledI4[i] : false;
|
||||
case 1: return ((FlowEnabledI1 != null) && (i >= 0) && (i < FlowEnabledI1.Length)) ? FlowEnabledI1[i] : false;
|
||||
case 2: return ((FlowEnabledI2 != null) && (i >= 0) && (i < FlowEnabledI2.Length)) ? FlowEnabledI2[i] : false;
|
||||
case 3: return ((FlowEnabledI3 != null) && (i >= 0) && (i < FlowEnabledI3.Length)) ? FlowEnabledI3[i] : false;
|
||||
case 4: return ((FlowEnabledI4 != null) && (i >= 0) && (i < FlowEnabledI4.Length)) ? FlowEnabledI4[i] : false;
|
||||
case 5: return ((FlowEnabledI5 != null) && (i >= 0) && (i < FlowEnabledI5.Length)) ? FlowEnabledI5[i] : false;
|
||||
case 6: return ((FlowEnabledI6 != null) && (i >= 0) && (i < FlowEnabledI6.Length)) ? FlowEnabledI6[i] : false;
|
||||
case 7: return ((FlowEnabledI7 != null) && (i >= 0) && (i < FlowEnabledI7.Length)) ? FlowEnabledI7[i] : false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
///
|
||||
public void SetFlowEnabled(UserControls.MidId midId, int i, bool value)
|
||||
|
||||
/// <summary>
|
||||
/// Set flow enabled info
|
||||
/// </summary>
|
||||
/// <param name="midId">1-based MID id</param>
|
||||
/// <param name="i">0-based flow id</param>
|
||||
/// <param name="value">true = enabled</param>
|
||||
public void SetFlowEnabled(int midId, int i, bool value)
|
||||
{
|
||||
switch (midId)
|
||||
{
|
||||
case UserControls.MidId.WaterMeters:
|
||||
if ((FlowEnabledWMs != null) && (i >= 0) && (i < FlowEnabledWMs.Length)) { FlowEnabledWMs[i] = value; };
|
||||
break;
|
||||
case UserControls.MidId.I1: if ((FlowEnabledI1 != null) && (i >= 0) && (i < FlowEnabledI1.Length)) { FlowEnabledI1[i] = value; }; break;
|
||||
case UserControls.MidId.I2: if ((FlowEnabledI2 != null) && (i >= 0) && (i < FlowEnabledI2.Length)) { FlowEnabledI2[i] = value; }; break;
|
||||
case UserControls.MidId.I3: if ((FlowEnabledI3 != null) && (i >= 0) && (i < FlowEnabledI3.Length)) { FlowEnabledI3[i] = value; }; break;
|
||||
case UserControls.MidId.I4: if ((FlowEnabledI4 != null) && (i >= 0) && (i < FlowEnabledI4.Length)) { FlowEnabledI4[i] = value; }; break;
|
||||
case 1: if ((FlowEnabledI1 != null) && (i >= 0) && (i < FlowEnabledI1.Length)) { FlowEnabledI1[i] = value; }; break;
|
||||
case 2: if ((FlowEnabledI2 != null) && (i >= 0) && (i < FlowEnabledI2.Length)) { FlowEnabledI2[i] = value; }; break;
|
||||
case 3: if ((FlowEnabledI3 != null) && (i >= 0) && (i < FlowEnabledI3.Length)) { FlowEnabledI3[i] = value; }; break;
|
||||
case 4: if ((FlowEnabledI4 != null) && (i >= 0) && (i < FlowEnabledI4.Length)) { FlowEnabledI4[i] = value; }; break;
|
||||
case 5: if ((FlowEnabledI5 != null) && (i >= 0) && (i < FlowEnabledI5.Length)) { FlowEnabledI5[i] = value; }; break;
|
||||
case 6: if ((FlowEnabledI6 != null) && (i >= 0) && (i < FlowEnabledI6.Length)) { FlowEnabledI6[i] = value; }; break;
|
||||
case 7: if ((FlowEnabledI7 != null) && (i >= 0) && (i < FlowEnabledI7.Length)) { FlowEnabledI7[i] = value; }; break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public double[] FlowFromWMs;
|
||||
public double[] FlowFromI1;
|
||||
public double[] FlowFromI2;
|
||||
public double[] FlowFromI3;
|
||||
public double[] FlowFromI4;
|
||||
///
|
||||
public double GetFlowFrom(UserControls.MidId midId, int i)
|
||||
public double[] FlowFromI5;
|
||||
public double[] FlowFromI6;
|
||||
public double[] FlowFromI7;
|
||||
|
||||
/// <summary>
|
||||
/// Get lower limit of the flow
|
||||
/// </summary>
|
||||
/// <param name="midId">1-based MID id</param>
|
||||
/// <param name="i">0-based flow id</param>
|
||||
/// <returns>Flow in m3/h</returns>
|
||||
public double GetFlowFrom(int midId, int i)
|
||||
{
|
||||
switch (midId)
|
||||
{
|
||||
case UserControls.MidId.WaterMeters:
|
||||
return ((FlowFromWMs != null) && (i >= 0) && (i < FlowFromWMs.Length)) ? FlowFromWMs[i] : 0;
|
||||
case UserControls.MidId.I1: return ((FlowFromI1 != null) && (i >= 0) && (i < FlowFromI1.Length)) ? FlowFromI1[i] : 0;
|
||||
case UserControls.MidId.I2: return ((FlowFromI2 != null) && (i >= 0) && (i < FlowFromI2.Length)) ? FlowFromI2[i] : 0;
|
||||
case UserControls.MidId.I3: return ((FlowFromI3 != null) && (i >= 0) && (i < FlowFromI3.Length)) ? FlowFromI3[i] : 0;
|
||||
case UserControls.MidId.I4: return ((FlowFromI4 != null) && (i >= 0) && (i < FlowFromI4.Length)) ? FlowFromI4[i] : 0;
|
||||
case 1: return ((FlowFromI1 != null) && (i >= 0) && (i < FlowFromI1.Length)) ? FlowFromI1[i] : 0;
|
||||
case 2: return ((FlowFromI2 != null) && (i >= 0) && (i < FlowFromI2.Length)) ? FlowFromI2[i] : 0;
|
||||
case 3: return ((FlowFromI3 != null) && (i >= 0) && (i < FlowFromI3.Length)) ? FlowFromI3[i] : 0;
|
||||
case 4: return ((FlowFromI4 != null) && (i >= 0) && (i < FlowFromI4.Length)) ? FlowFromI4[i] : 0;
|
||||
case 5: return ((FlowFromI5 != null) && (i >= 0) && (i < FlowFromI5.Length)) ? FlowFromI5[i] : 0;
|
||||
case 6: return ((FlowFromI6 != null) && (i >= 0) && (i < FlowFromI6.Length)) ? FlowFromI6[i] : 0;
|
||||
case 7: return ((FlowFromI7 != null) && (i >= 0) && (i < FlowFromI7.Length)) ? FlowFromI7[i] : 0;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
///
|
||||
public void SetFlowFrom(UserControls.MidId midId, int i, double value)
|
||||
|
||||
/// <summary>
|
||||
/// Set lower limit of the flow
|
||||
/// </summary>
|
||||
/// <param name="midId">1-based MID id</param>
|
||||
/// <param name="i">0-based flow id</param>
|
||||
/// <param name="value">Flow in m3/h</param>
|
||||
public void SetFlowFrom(int midId, int i, double value)
|
||||
{
|
||||
switch (midId)
|
||||
{
|
||||
case UserControls.MidId.WaterMeters:
|
||||
if ((FlowFromWMs != null) && (i >= 0) && (i < FlowFromWMs.Length)) { FlowFromWMs[i] = value; };
|
||||
break;
|
||||
case UserControls.MidId.I1: if ((FlowFromI1 != null) && (i >= 0) && (i < FlowFromI1.Length)) { FlowFromI1[i] = value; }; break;
|
||||
case UserControls.MidId.I2: if ((FlowFromI2 != null) && (i >= 0) && (i < FlowFromI2.Length)) { FlowFromI2[i] = value; }; break;
|
||||
case UserControls.MidId.I3: if ((FlowFromI3 != null) && (i >= 0) && (i < FlowFromI3.Length)) { FlowFromI3[i] = value; }; break;
|
||||
case UserControls.MidId.I4: if ((FlowFromI4 != null) && (i >= 0) && (i < FlowFromI4.Length)) { FlowFromI4[i] = value; }; break;
|
||||
case 1: if ((FlowFromI1 != null) && (i >= 0) && (i < FlowFromI1.Length)) { FlowFromI1[i] = value; }; break;
|
||||
case 2: if ((FlowFromI2 != null) && (i >= 0) && (i < FlowFromI2.Length)) { FlowFromI2[i] = value; }; break;
|
||||
case 3: if ((FlowFromI3 != null) && (i >= 0) && (i < FlowFromI3.Length)) { FlowFromI3[i] = value; }; break;
|
||||
case 4: if ((FlowFromI4 != null) && (i >= 0) && (i < FlowFromI4.Length)) { FlowFromI4[i] = value; }; break;
|
||||
case 5: if ((FlowFromI5 != null) && (i >= 0) && (i < FlowFromI5.Length)) { FlowFromI5[i] = value; }; break;
|
||||
case 6: if ((FlowFromI6 != null) && (i >= 0) && (i < FlowFromI6.Length)) { FlowFromI6[i] = value; }; break;
|
||||
case 7: if ((FlowFromI7 != null) && (i >= 0) && (i < FlowFromI7.Length)) { FlowFromI7[i] = value; }; break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public double[] FlowToWMs;
|
||||
public double[] FlowToI1;
|
||||
public double[] FlowToI2;
|
||||
public double[] FlowToI3;
|
||||
public double[] FlowToI4;
|
||||
///
|
||||
public double GetFlowTo(UserControls.MidId midId, int i)
|
||||
public double[] FlowToI5;
|
||||
public double[] FlowToI6;
|
||||
public double[] FlowToI7;
|
||||
|
||||
/// <summary>
|
||||
/// Get upper limit of the flow
|
||||
/// </summary>
|
||||
/// <param name="midId">1-based MID id</param>
|
||||
/// <param name="i">0-based flow id</param>
|
||||
/// <returns>Flow in m3/h</returns>
|
||||
public double GetFlowTo(int midId, int i)
|
||||
{
|
||||
switch (midId)
|
||||
{
|
||||
case UserControls.MidId.WaterMeters:
|
||||
return ((FlowToWMs != null) && (i >= 0) && (i < FlowToWMs.Length)) ? FlowToWMs[i] : 0;
|
||||
case UserControls.MidId.I1: return ((FlowToI1 != null) && (i >= 0) && (i < FlowToI1.Length)) ? FlowToI1[i] : 0;
|
||||
case UserControls.MidId.I2: return ((FlowToI2 != null) && (i >= 0) && (i < FlowToI2.Length)) ? FlowToI2[i] : 0;
|
||||
case UserControls.MidId.I3: return ((FlowToI3 != null) && (i >= 0) && (i < FlowToI3.Length)) ? FlowToI3[i] : 0;
|
||||
case UserControls.MidId.I4: return ((FlowToI4 != null) && (i >= 0) && (i < FlowToI4.Length)) ? FlowToI4[i] : 0;
|
||||
case 1: return ((FlowToI1 != null) && (i >= 0) && (i < FlowToI1.Length)) ? FlowToI1[i] : 0;
|
||||
case 2: return ((FlowToI2 != null) && (i >= 0) && (i < FlowToI2.Length)) ? FlowToI2[i] : 0;
|
||||
case 3: return ((FlowToI3 != null) && (i >= 0) && (i < FlowToI3.Length)) ? FlowToI3[i] : 0;
|
||||
case 4: return ((FlowToI4 != null) && (i >= 0) && (i < FlowToI4.Length)) ? FlowToI4[i] : 0;
|
||||
case 5: return ((FlowToI5 != null) && (i >= 0) && (i < FlowToI5.Length)) ? FlowToI5[i] : 0;
|
||||
case 6: return ((FlowToI6 != null) && (i >= 0) && (i < FlowToI6.Length)) ? FlowToI6[i] : 0;
|
||||
case 7: return ((FlowToI7 != null) && (i >= 0) && (i < FlowToI7.Length)) ? FlowToI7[i] : 0;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
///
|
||||
public void SetFlowTo(UserControls.MidId midId, int i, double value)
|
||||
|
||||
/// <summary>
|
||||
/// Set upper limit of the flow
|
||||
/// </summary>
|
||||
/// <param name="midId">1-based MID id</param>
|
||||
/// <param name="i">0-based flow id</param>
|
||||
/// <param name="value">Flow in m3/h</param>
|
||||
public void SetFlowTo(int midId, int i, double value)
|
||||
{
|
||||
switch (midId)
|
||||
{
|
||||
case UserControls.MidId.WaterMeters:
|
||||
if ((FlowToWMs != null) && (i >= 0) && (i < FlowToWMs.Length)) { FlowToWMs[i] = value; };
|
||||
break;
|
||||
case UserControls.MidId.I1: if ((FlowToI1 != null) && (i >= 0) && (i < FlowToI1.Length)) { FlowToI1[i] = value; }; break;
|
||||
case UserControls.MidId.I2: if ((FlowToI2 != null) && (i >= 0) && (i < FlowToI2.Length)) { FlowToI2[i] = value; }; break;
|
||||
case UserControls.MidId.I3: if ((FlowToI3 != null) && (i >= 0) && (i < FlowToI3.Length)) { FlowToI3[i] = value; }; break;
|
||||
case UserControls.MidId.I4: if ((FlowToI4 != null) && (i >= 0) && (i < FlowToI4.Length)) { FlowToI4[i] = value; }; break;
|
||||
case 1: if ((FlowToI1 != null) && (i >= 0) && (i < FlowToI1.Length)) { FlowToI1[i] = value; }; break;
|
||||
case 2: if ((FlowToI2 != null) && (i >= 0) && (i < FlowToI2.Length)) { FlowToI2[i] = value; }; break;
|
||||
case 3: if ((FlowToI3 != null) && (i >= 0) && (i < FlowToI3.Length)) { FlowToI3[i] = value; }; break;
|
||||
case 4: if ((FlowToI4 != null) && (i >= 0) && (i < FlowToI4.Length)) { FlowToI4[i] = value; }; break;
|
||||
case 5: if ((FlowToI5 != null) && (i >= 0) && (i < FlowToI5.Length)) { FlowToI5[i] = value; }; break;
|
||||
case 6: if ((FlowToI6 != null) && (i >= 0) && (i < FlowToI6.Length)) { FlowToI6[i] = value; }; break;
|
||||
case 7: if ((FlowToI7 != null) && (i >= 0) && (i < FlowToI7.Length)) { FlowToI7[i] = value; }; break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -180,6 +230,18 @@ namespace Statistics
|
||||
/// </summary>
|
||||
public LocalSettings()
|
||||
{
|
||||
#if GENESIS
|
||||
Language = "DE";
|
||||
|
||||
BenchNames = new string[] { "Genesis" };
|
||||
|
||||
ConnectionStrings = new string[]
|
||||
{
|
||||
"SERVER=localhost; DATABASE=genesis-r; UID=root; PASSWORD=; CHARSET=utf8;",
|
||||
};
|
||||
|
||||
MidNames = new string[] { string.Empty, "I11", "I12", "I2", "I3", "I4", "I5" }; /// Index is MID-id
|
||||
#else
|
||||
Language = "SK";
|
||||
|
||||
BenchNames = new string[] { "WR10", "WR11", "WR13", "WR14", "WR15", "PT7" };
|
||||
@@ -194,23 +256,31 @@ namespace Statistics
|
||||
"SERVER=10.42.129.26; DATABASE=iperlspecial-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;",
|
||||
};
|
||||
|
||||
FlowEnabledWMs = new bool[FlowsCount];
|
||||
MidNames = new string[] { string.Empty, "I1", "I2", "I3", "I4" }; /// Index is MID-id
|
||||
#endif
|
||||
FlowEnabledI1 = new bool[FlowsCount];
|
||||
FlowEnabledI2 = new bool[FlowsCount];
|
||||
FlowEnabledI3 = new bool[FlowsCount];
|
||||
FlowEnabledI4 = new bool[FlowsCount];
|
||||
FlowEnabledI5 = new bool[FlowsCount];
|
||||
FlowEnabledI6 = new bool[FlowsCount];
|
||||
FlowEnabledI7 = new bool[FlowsCount];
|
||||
|
||||
FlowFromWMs = new double[FlowsCount];
|
||||
FlowFromI1 = new double[FlowsCount];
|
||||
FlowFromI2 = new double[FlowsCount];
|
||||
FlowFromI3 = new double[FlowsCount];
|
||||
FlowFromI4 = new double[FlowsCount];
|
||||
FlowFromI5 = new double[FlowsCount];
|
||||
FlowFromI6 = new double[FlowsCount];
|
||||
FlowFromI7 = new double[FlowsCount];
|
||||
|
||||
FlowToWMs = new double[FlowsCount];
|
||||
FlowToI1 = new double[FlowsCount];
|
||||
FlowToI2 = new double[FlowsCount];
|
||||
FlowToI3 = new double[FlowsCount];
|
||||
FlowToI4 = new double[FlowsCount];
|
||||
FlowToI5 = new double[FlowsCount];
|
||||
FlowToI6 = new double[FlowsCount];
|
||||
FlowToI7 = new double[FlowsCount];
|
||||
|
||||
SelectedRadioButtonNumber = 1;
|
||||
}
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.18.1108.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1108.0")]
|
||||
[assembly: AssemblyVersion("2.18.1154.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1154.0")]
|
||||
|
||||
@@ -80,7 +80,6 @@
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="UserControls\Enums.cs" />
|
||||
<Compile Include="UserControls\MidOrWaterMetersCtrl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
|
||||
Generated
+2
-134
@@ -39,27 +39,11 @@
|
||||
this.dateTimeFromPicker = new System.Windows.Forms.DateTimePicker();
|
||||
this.dateTimeToPicker = new System.Windows.Forms.DateTimePicker();
|
||||
this.midsTabControl = new System.Windows.Forms.TabControl();
|
||||
this.wr10TabPage = new System.Windows.Forms.TabPage();
|
||||
this.wmsBenchesControl = new Statistics.UserControls.MidOrWaterMetersCtrl();
|
||||
this.wr11TabPage = new System.Windows.Forms.TabPage();
|
||||
this.i1BenchesControl = new Statistics.UserControls.MidOrWaterMetersCtrl();
|
||||
this.wr13TabPage = new System.Windows.Forms.TabPage();
|
||||
this.i2BbenchesControl = new Statistics.UserControls.MidOrWaterMetersCtrl();
|
||||
this.wr14TabPage = new System.Windows.Forms.TabPage();
|
||||
this.i3BenchesControl = new Statistics.UserControls.MidOrWaterMetersCtrl();
|
||||
this.wr15TabPage = new System.Windows.Forms.TabPage();
|
||||
this.i4BenchesControl = new Statistics.UserControls.MidOrWaterMetersCtrl();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.timePeriodGroupBox.SuspendLayout();
|
||||
this.midsTabControl.SuspendLayout();
|
||||
this.wr10TabPage.SuspendLayout();
|
||||
this.wr11TabPage.SuspendLayout();
|
||||
this.wr13TabPage.SuspendLayout();
|
||||
this.wr14TabPage.SuspendLayout();
|
||||
this.wr15TabPage.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
@@ -177,11 +161,6 @@
|
||||
//
|
||||
// midsTabControl
|
||||
//
|
||||
this.midsTabControl.Controls.Add(this.wr10TabPage);
|
||||
this.midsTabControl.Controls.Add(this.wr11TabPage);
|
||||
this.midsTabControl.Controls.Add(this.wr13TabPage);
|
||||
this.midsTabControl.Controls.Add(this.wr14TabPage);
|
||||
this.midsTabControl.Controls.Add(this.wr15TabPage);
|
||||
this.midsTabControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.midsTabControl.Location = new System.Drawing.Point(0, 0);
|
||||
this.midsTabControl.Name = "midsTabControl";
|
||||
@@ -189,101 +168,6 @@
|
||||
this.midsTabControl.Size = new System.Drawing.Size(1368, 732);
|
||||
this.midsTabControl.TabIndex = 0;
|
||||
//
|
||||
// wr10TabPage
|
||||
//
|
||||
this.wr10TabPage.Controls.Add(this.wmsBenchesControl);
|
||||
this.wr10TabPage.Location = new System.Drawing.Point(4, 22);
|
||||
this.wr10TabPage.Name = "wr10TabPage";
|
||||
this.wr10TabPage.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.wr10TabPage.Size = new System.Drawing.Size(1360, 706);
|
||||
this.wr10TabPage.TabIndex = 0;
|
||||
this.wr10TabPage.Text = "Water meters";
|
||||
this.wr10TabPage.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// wmsBenchesControl
|
||||
//
|
||||
this.wmsBenchesControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.wmsBenchesControl.Location = new System.Drawing.Point(3, 3);
|
||||
this.wmsBenchesControl.Name = "wmsBenchesControl";
|
||||
this.wmsBenchesControl.Size = new System.Drawing.Size(1354, 700);
|
||||
this.wmsBenchesControl.TabIndex = 0;
|
||||
//
|
||||
// wr11TabPage
|
||||
//
|
||||
this.wr11TabPage.Controls.Add(this.i1BenchesControl);
|
||||
this.wr11TabPage.Location = new System.Drawing.Point(4, 22);
|
||||
this.wr11TabPage.Name = "wr11TabPage";
|
||||
this.wr11TabPage.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.wr11TabPage.Size = new System.Drawing.Size(1360, 706);
|
||||
this.wr11TabPage.TabIndex = 1;
|
||||
this.wr11TabPage.Text = "I1";
|
||||
this.wr11TabPage.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// i1BenchesControl
|
||||
//
|
||||
this.i1BenchesControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.i1BenchesControl.Location = new System.Drawing.Point(3, 3);
|
||||
this.i1BenchesControl.Name = "i1BenchesControl";
|
||||
this.i1BenchesControl.Size = new System.Drawing.Size(1354, 700);
|
||||
this.i1BenchesControl.TabIndex = 0;
|
||||
//
|
||||
// wr13TabPage
|
||||
//
|
||||
this.wr13TabPage.Controls.Add(this.i2BbenchesControl);
|
||||
this.wr13TabPage.Location = new System.Drawing.Point(4, 22);
|
||||
this.wr13TabPage.Name = "wr13TabPage";
|
||||
this.wr13TabPage.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.wr13TabPage.Size = new System.Drawing.Size(1360, 706);
|
||||
this.wr13TabPage.TabIndex = 2;
|
||||
this.wr13TabPage.Text = "I2";
|
||||
this.wr13TabPage.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// i2BbenchesControl
|
||||
//
|
||||
this.i2BbenchesControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.i2BbenchesControl.Location = new System.Drawing.Point(3, 3);
|
||||
this.i2BbenchesControl.Name = "i2BbenchesControl";
|
||||
this.i2BbenchesControl.Size = new System.Drawing.Size(1354, 700);
|
||||
this.i2BbenchesControl.TabIndex = 0;
|
||||
//
|
||||
// wr14TabPage
|
||||
//
|
||||
this.wr14TabPage.Controls.Add(this.i3BenchesControl);
|
||||
this.wr14TabPage.Location = new System.Drawing.Point(4, 22);
|
||||
this.wr14TabPage.Name = "wr14TabPage";
|
||||
this.wr14TabPage.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.wr14TabPage.Size = new System.Drawing.Size(1360, 706);
|
||||
this.wr14TabPage.TabIndex = 3;
|
||||
this.wr14TabPage.Text = "I3";
|
||||
this.wr14TabPage.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// i3BenchesControl
|
||||
//
|
||||
this.i3BenchesControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.i3BenchesControl.Location = new System.Drawing.Point(3, 3);
|
||||
this.i3BenchesControl.Name = "i3BenchesControl";
|
||||
this.i3BenchesControl.Size = new System.Drawing.Size(1354, 700);
|
||||
this.i3BenchesControl.TabIndex = 0;
|
||||
//
|
||||
// wr15TabPage
|
||||
//
|
||||
this.wr15TabPage.Controls.Add(this.i4BenchesControl);
|
||||
this.wr15TabPage.Location = new System.Drawing.Point(4, 22);
|
||||
this.wr15TabPage.Name = "wr15TabPage";
|
||||
this.wr15TabPage.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.wr15TabPage.Size = new System.Drawing.Size(1360, 706);
|
||||
this.wr15TabPage.TabIndex = 4;
|
||||
this.wr15TabPage.Text = "I4";
|
||||
this.wr15TabPage.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// i4BenchesControl
|
||||
//
|
||||
this.i4BenchesControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.i4BenchesControl.Location = new System.Drawing.Point(3, 3);
|
||||
this.i4BenchesControl.Name = "i4BenchesControl";
|
||||
this.i4BenchesControl.Size = new System.Drawing.Size(1354, 700);
|
||||
this.i4BenchesControl.TabIndex = 0;
|
||||
//
|
||||
// StatisticsDlg
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
@@ -291,7 +175,7 @@
|
||||
this.ClientSize = new System.Drawing.Size(1368, 826);
|
||||
this.Controls.Add(this.splitContainer1);
|
||||
this.Name = "StatisticsDlg";
|
||||
this.Text = "Statistics";
|
||||
this.Text = "MID Statistics";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.StatisticsDlg_FormClosing);
|
||||
this.Load += new System.EventHandler(this.StatisticsDlg_Load);
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
@@ -301,12 +185,6 @@
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.timePeriodGroupBox.ResumeLayout(false);
|
||||
this.timePeriodGroupBox.PerformLayout();
|
||||
this.midsTabControl.ResumeLayout(false);
|
||||
this.wr10TabPage.ResumeLayout(false);
|
||||
this.wr11TabPage.ResumeLayout(false);
|
||||
this.wr13TabPage.ResumeLayout(false);
|
||||
this.wr14TabPage.ResumeLayout(false);
|
||||
this.wr15TabPage.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
@@ -314,26 +192,16 @@
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private System.Windows.Forms.TabControl midsTabControl;
|
||||
private System.Windows.Forms.TabPage wr10TabPage;
|
||||
private System.Windows.Forms.TabPage wr11TabPage;
|
||||
private System.Windows.Forms.TabPage wr13TabPage;
|
||||
private System.Windows.Forms.TabPage wr14TabPage;
|
||||
private System.Windows.Forms.TabPage wr15TabPage;
|
||||
private System.Windows.Forms.GroupBox timePeriodGroupBox;
|
||||
private System.Windows.Forms.DateTimePicker dateTimeFromPicker;
|
||||
private System.Windows.Forms.DateTimePicker dateTimeToPicker;
|
||||
private System.Windows.Forms.Label toLabel1;
|
||||
private System.Windows.Forms.Label fromLabel1;
|
||||
private UserControls.MidOrWaterMetersCtrl wmsBenchesControl;
|
||||
private UserControls.MidOrWaterMetersCtrl i1BenchesControl;
|
||||
private UserControls.MidOrWaterMetersCtrl i2BbenchesControl;
|
||||
private UserControls.MidOrWaterMetersCtrl i3BenchesControl;
|
||||
private UserControls.MidOrWaterMetersCtrl i4BenchesControl;
|
||||
private System.Windows.Forms.RadioButton radioButton3;
|
||||
private System.Windows.Forms.RadioButton radioButton2;
|
||||
private System.Windows.Forms.RadioButton radioButton1;
|
||||
private System.Windows.Forms.RadioButton radioButton4;
|
||||
private System.Windows.Forms.TabControl midsTabControl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+32
-24
@@ -24,7 +24,7 @@ namespace Statistics
|
||||
{
|
||||
public partial class StatisticsDlg : Form
|
||||
{
|
||||
static ISessionFactory[] sessionFactories = new ISessionFactory[LocalSettings.BenchesCount];
|
||||
static ISessionFactory[] sessionFactories = new ISessionFactory[Program.LocalSettings.ConnectionStrings.Length];
|
||||
|
||||
|
||||
public StatisticsDlg()
|
||||
@@ -33,14 +33,19 @@ namespace Statistics
|
||||
|
||||
///ManageCheckGroupBox(timePeriodCheckBox, timePeriodGroupBox);
|
||||
|
||||
for (MidId midId = 0; midId < MidId.Count; midId++)
|
||||
for (int midId = 1; midId < Program.LocalSettings.MidNames.Length; midId++)
|
||||
{
|
||||
int i = (int)midId;
|
||||
midsTabControl.TabPages[i].Text = midId.ToString();
|
||||
(midsTabControl.TabPages[i].Controls[0] as MidOrWaterMetersCtrl).MidId = midId;
|
||||
(midsTabControl.TabPages[i].Controls[0] as MidOrWaterMetersCtrl).Parent = this;
|
||||
TabPage tp = new TabPage();
|
||||
tp.Text = Program.LocalSettings.MidNames[midId];
|
||||
|
||||
MidOrWaterMetersCtrl ctrl = new MidOrWaterMetersCtrl();
|
||||
ctrl.MidId = midId;
|
||||
ctrl.Parent = this;
|
||||
ctrl.Dock = DockStyle.Fill;
|
||||
|
||||
tp.Controls.Add(ctrl);
|
||||
midsTabControl.TabPages.Add(tp);
|
||||
}
|
||||
midsTabControl.TabPages[0].Text = Strings.Water_meters;
|
||||
|
||||
radioButton1.Checked = true;
|
||||
timePeriodGroupBox.Enabled = false;
|
||||
@@ -50,7 +55,7 @@ namespace Statistics
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Statistics;
|
||||
Text = string.Format("MID {0}", Strings.Statistics);
|
||||
//timePeriodCheckBox.Text = Strings.Time_period;
|
||||
fromLabel1.Text = Strings.From;
|
||||
toLabel1.Text = Strings.To;
|
||||
@@ -76,12 +81,12 @@ namespace Statistics
|
||||
case 4: radioButton4.Checked = true; break;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)MidId.Count; i++)
|
||||
for (int i = 1; i < Program.LocalSettings.MidNames.Length; i++)
|
||||
{
|
||||
(midsTabControl.TabPages[i].Controls[0] as MidOrWaterMetersCtrl).Data2UI();
|
||||
(midsTabControl.TabPages[i - 1].Controls[0] as MidOrWaterMetersCtrl).Data2UI();
|
||||
}
|
||||
|
||||
for (int i = 0; i < LocalSettings.BenchesCount; i++)
|
||||
for (int i = 0; i < Program.LocalSettings.ConnectionStrings.Length; i++)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Program.LocalSettings.GetConnectionString(i)))
|
||||
{
|
||||
@@ -128,18 +133,18 @@ namespace Statistics
|
||||
//}
|
||||
|
||||
|
||||
public IList<TestRslt> UpdateRequest(int benchId, MidId midId)
|
||||
/// <summary>
|
||||
/// Called by a child form.
|
||||
/// Reads and returns results from DB required by the child form to update it's content.
|
||||
/// </summary>
|
||||
/// <param name="benchId">0-based bench Id.</param>
|
||||
/// <param name="midId">1-based MID Id.</param>
|
||||
/// <returns>Required test results</returns>
|
||||
public IList<TestRslt> UpdateRequest(int benchId, int midId)
|
||||
{
|
||||
if ((benchId < 0) || (benchId >= LocalSettings.BenchesCount) || (sessionFactories[benchId] == null) || (midId == MidId.WaterMeters))
|
||||
if ((benchId < 0) || (benchId >= Program.LocalSettings.BenchNames.Length) || (sessionFactories[benchId] == null))
|
||||
{
|
||||
if (midId == MidId.WaterMeters)
|
||||
{
|
||||
MessageBox.Show("Loading statistics of water meters is not implemented yet");
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show(string.Format("Cannot load statistics of {0}", Program.LocalSettings.GetBenchName(benchId)));
|
||||
}
|
||||
MessageBox.Show(string.Format("Cannot load statistics of {0}", Program.LocalSettings.GetBenchName(benchId)));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -164,7 +169,7 @@ namespace Statistics
|
||||
{
|
||||
ISession session = sessionFactories[benchId].OpenSession();
|
||||
var listOfComponentsWithFlowmeter = session.QueryOver<Components>()
|
||||
.Where(x => (x.Flowmeter == midId.ToString()))
|
||||
.Where(x => (x.Flowmeter == Program.LocalSettings.MidNames[midId]))
|
||||
.List();
|
||||
IList<TestRslt> testRslts = new List<TestRslt>();
|
||||
foreach (var cmpnts in listOfComponentsWithFlowmeter)
|
||||
@@ -248,9 +253,12 @@ namespace Statistics
|
||||
else if (radioButton4.Checked) ls.SelectedRadioButtonNumber = 4;
|
||||
else ls.SelectedRadioButtonNumber = 0;
|
||||
|
||||
for (int i = 0; i < (int)MidId.Count; i++)
|
||||
for (int i = 1; i < Math.Min(Program.LocalSettings.MidNames.Length, midsTabControl.TabPages.Count + 1); i++)
|
||||
{
|
||||
(midsTabControl.TabPages[i].Controls[0] as MidOrWaterMetersCtrl).UI2Data();
|
||||
if (midsTabControl.TabPages[i - 1].Controls.Count > 0 && midsTabControl.TabPages[i - 1].Controls[0] is MidOrWaterMetersCtrl)
|
||||
{
|
||||
(midsTabControl.TabPages[i - 1].Controls[0] as MidOrWaterMetersCtrl).UI2Data();
|
||||
}
|
||||
}
|
||||
|
||||
ls.Save();
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Statistics.UserControls
|
||||
{
|
||||
public enum MidId
|
||||
{
|
||||
/// When converted to 'int' it's the MID number, 0 = water meters
|
||||
WaterMeters,
|
||||
I1,
|
||||
I2,
|
||||
I3,
|
||||
I4,
|
||||
Count
|
||||
}
|
||||
}
|
||||
+230
-384
@@ -29,6 +29,26 @@
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.flow5GroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.flow5ToExclamation = new System.Windows.Forms.Label();
|
||||
this.flow5FromExclamation = new System.Windows.Forms.Label();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
this.toLabel6 = new System.Windows.Forms.Label();
|
||||
this.fromLabel6 = new System.Windows.Forms.Label();
|
||||
this.flow5ToTextBox = new System.Windows.Forms.TextBox();
|
||||
this.flow5FromTextBox = new System.Windows.Forms.TextBox();
|
||||
this.flow5CheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.flow4GroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.flow4ToExclamation = new System.Windows.Forms.Label();
|
||||
this.flow4FromExclamation = new System.Windows.Forms.Label();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.toLabel5 = new System.Windows.Forms.Label();
|
||||
this.fromLabel5 = new System.Windows.Forms.Label();
|
||||
this.flow4ToTextBox = new System.Windows.Forms.TextBox();
|
||||
this.flow4FromTextBox = new System.Windows.Forms.TextBox();
|
||||
this.flow4CheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.flow3GroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.flow3ToExclamation = new System.Windows.Forms.Label();
|
||||
this.flow3FromExclamation = new System.Windows.Forms.Label();
|
||||
@@ -60,54 +80,15 @@
|
||||
this.flow1FromTextBox = new System.Windows.Forms.TextBox();
|
||||
this.flow1CheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.benchesTabControl = new System.Windows.Forms.TabControl();
|
||||
this.tabPage1 = new System.Windows.Forms.TabPage();
|
||||
this.tabPage2 = new System.Windows.Forms.TabPage();
|
||||
this.tabPage3 = new System.Windows.Forms.TabPage();
|
||||
this.tabPage4 = new System.Windows.Forms.TabPage();
|
||||
this.tabPage5 = new System.Windows.Forms.TabPage();
|
||||
this.tabPage6 = new System.Windows.Forms.TabPage();
|
||||
this.flow4GroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.flow4ToExclamation = new System.Windows.Forms.Label();
|
||||
this.flow4FromExclamation = new System.Windows.Forms.Label();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.toLabel5 = new System.Windows.Forms.Label();
|
||||
this.fromLabel5 = new System.Windows.Forms.Label();
|
||||
this.flow4ToTextBox = new System.Windows.Forms.TextBox();
|
||||
this.flow4FromTextBox = new System.Windows.Forms.TextBox();
|
||||
this.flow4CheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.flow5GroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.flow5ToExclamation = new System.Windows.Forms.Label();
|
||||
this.flow5FromExclamation = new System.Windows.Forms.Label();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
this.toLabel6 = new System.Windows.Forms.Label();
|
||||
this.fromLabel6 = new System.Windows.Forms.Label();
|
||||
this.flow5ToTextBox = new System.Windows.Forms.TextBox();
|
||||
this.flow5FromTextBox = new System.Windows.Forms.TextBox();
|
||||
this.flow5CheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.wr10StatisticsCtrl1 = new Statistics.UserControls.StatisticsCtrl();
|
||||
this.wr11StatisticsCtrl = new Statistics.UserControls.StatisticsCtrl();
|
||||
this.wr13StatisticsCtrl = new Statistics.UserControls.StatisticsCtrl();
|
||||
this.wr14StatisticsCtrl = new Statistics.UserControls.StatisticsCtrl();
|
||||
this.wr15StatisticsCtrl = new Statistics.UserControls.StatisticsCtrl();
|
||||
this.pt7StatisticsCtrl = new Statistics.UserControls.StatisticsCtrl();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.flow5GroupBox.SuspendLayout();
|
||||
this.flow4GroupBox.SuspendLayout();
|
||||
this.flow3GroupBox.SuspendLayout();
|
||||
this.flow2GroupBox.SuspendLayout();
|
||||
this.flow1GroupBox.SuspendLayout();
|
||||
this.benchesTabControl.SuspendLayout();
|
||||
this.tabPage1.SuspendLayout();
|
||||
this.tabPage2.SuspendLayout();
|
||||
this.tabPage3.SuspendLayout();
|
||||
this.tabPage4.SuspendLayout();
|
||||
this.tabPage5.SuspendLayout();
|
||||
this.tabPage6.SuspendLayout();
|
||||
this.flow4GroupBox.SuspendLayout();
|
||||
this.flow5GroupBox.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
@@ -134,6 +115,210 @@
|
||||
this.splitContainer1.SplitterDistance = 90;
|
||||
this.splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// flow5GroupBox
|
||||
//
|
||||
this.flow5GroupBox.Controls.Add(this.flow5ToExclamation);
|
||||
this.flow5GroupBox.Controls.Add(this.flow5FromExclamation);
|
||||
this.flow5GroupBox.Controls.Add(this.label9);
|
||||
this.flow5GroupBox.Controls.Add(this.label10);
|
||||
this.flow5GroupBox.Controls.Add(this.toLabel6);
|
||||
this.flow5GroupBox.Controls.Add(this.fromLabel6);
|
||||
this.flow5GroupBox.Controls.Add(this.flow5ToTextBox);
|
||||
this.flow5GroupBox.Controls.Add(this.flow5FromTextBox);
|
||||
this.flow5GroupBox.Controls.Add(this.flow5CheckBox);
|
||||
this.flow5GroupBox.Location = new System.Drawing.Point(939, 7);
|
||||
this.flow5GroupBox.Name = "flow5GroupBox";
|
||||
this.flow5GroupBox.Size = new System.Drawing.Size(221, 77);
|
||||
this.flow5GroupBox.TabIndex = 8;
|
||||
this.flow5GroupBox.TabStop = false;
|
||||
//
|
||||
// flow5ToExclamation
|
||||
//
|
||||
this.flow5ToExclamation.AutoSize = true;
|
||||
this.flow5ToExclamation.ForeColor = System.Drawing.Color.Red;
|
||||
this.flow5ToExclamation.Location = new System.Drawing.Point(167, 48);
|
||||
this.flow5ToExclamation.Name = "flow5ToExclamation";
|
||||
this.flow5ToExclamation.Size = new System.Drawing.Size(10, 13);
|
||||
this.flow5ToExclamation.TabIndex = 9;
|
||||
this.flow5ToExclamation.Text = "!";
|
||||
this.flow5ToExclamation.Visible = false;
|
||||
//
|
||||
// flow5FromExclamation
|
||||
//
|
||||
this.flow5FromExclamation.AutoSize = true;
|
||||
this.flow5FromExclamation.ForeColor = System.Drawing.Color.Red;
|
||||
this.flow5FromExclamation.Location = new System.Drawing.Point(167, 24);
|
||||
this.flow5FromExclamation.Name = "flow5FromExclamation";
|
||||
this.flow5FromExclamation.Size = new System.Drawing.Size(10, 13);
|
||||
this.flow5FromExclamation.TabIndex = 8;
|
||||
this.flow5FromExclamation.Text = "!";
|
||||
this.flow5FromExclamation.Visible = false;
|
||||
//
|
||||
// label9
|
||||
//
|
||||
this.label9.AutoSize = true;
|
||||
this.label9.Location = new System.Drawing.Point(178, 48);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(32, 13);
|
||||
this.label9.TabIndex = 6;
|
||||
this.label9.Text = "m3/h";
|
||||
//
|
||||
// label10
|
||||
//
|
||||
this.label10.AutoSize = true;
|
||||
this.label10.Location = new System.Drawing.Point(177, 23);
|
||||
this.label10.Name = "label10";
|
||||
this.label10.Size = new System.Drawing.Size(32, 13);
|
||||
this.label10.TabIndex = 5;
|
||||
this.label10.Text = "m3/h";
|
||||
//
|
||||
// toLabel6
|
||||
//
|
||||
this.toLabel6.AutoSize = true;
|
||||
this.toLabel6.Location = new System.Drawing.Point(14, 48);
|
||||
this.toLabel6.Name = "toLabel6";
|
||||
this.toLabel6.Size = new System.Drawing.Size(20, 13);
|
||||
this.toLabel6.TabIndex = 4;
|
||||
this.toLabel6.Text = "To";
|
||||
//
|
||||
// fromLabel6
|
||||
//
|
||||
this.fromLabel6.AutoSize = true;
|
||||
this.fromLabel6.Location = new System.Drawing.Point(14, 23);
|
||||
this.fromLabel6.Name = "fromLabel6";
|
||||
this.fromLabel6.Size = new System.Drawing.Size(30, 13);
|
||||
this.fromLabel6.TabIndex = 3;
|
||||
this.fromLabel6.Text = "From";
|
||||
//
|
||||
// flow5ToTextBox
|
||||
//
|
||||
this.flow5ToTextBox.Location = new System.Drawing.Point(65, 45);
|
||||
this.flow5ToTextBox.Name = "flow5ToTextBox";
|
||||
this.flow5ToTextBox.Size = new System.Drawing.Size(100, 20);
|
||||
this.flow5ToTextBox.TabIndex = 2;
|
||||
this.flow5ToTextBox.TextChanged += new System.EventHandler(this.flow5ToTextBox_TextChanged);
|
||||
//
|
||||
// flow5FromTextBox
|
||||
//
|
||||
this.flow5FromTextBox.Location = new System.Drawing.Point(65, 20);
|
||||
this.flow5FromTextBox.Name = "flow5FromTextBox";
|
||||
this.flow5FromTextBox.Size = new System.Drawing.Size(100, 20);
|
||||
this.flow5FromTextBox.TabIndex = 1;
|
||||
this.flow5FromTextBox.TextChanged += new System.EventHandler(this.flow5FromTextBox_TextChanged);
|
||||
//
|
||||
// flow5CheckBox
|
||||
//
|
||||
this.flow5CheckBox.AutoSize = true;
|
||||
this.flow5CheckBox.Location = new System.Drawing.Point(10, 0);
|
||||
this.flow5CheckBox.Name = "flow5CheckBox";
|
||||
this.flow5CheckBox.Size = new System.Drawing.Size(57, 17);
|
||||
this.flow5CheckBox.TabIndex = 0;
|
||||
this.flow5CheckBox.Text = "Flow 5";
|
||||
this.flow5CheckBox.UseVisualStyleBackColor = true;
|
||||
this.flow5CheckBox.CheckedChanged += new System.EventHandler(this.flow5CheckBox_CheckedChanged);
|
||||
//
|
||||
// flow4GroupBox
|
||||
//
|
||||
this.flow4GroupBox.Controls.Add(this.flow4ToExclamation);
|
||||
this.flow4GroupBox.Controls.Add(this.flow4FromExclamation);
|
||||
this.flow4GroupBox.Controls.Add(this.label7);
|
||||
this.flow4GroupBox.Controls.Add(this.label8);
|
||||
this.flow4GroupBox.Controls.Add(this.toLabel5);
|
||||
this.flow4GroupBox.Controls.Add(this.fromLabel5);
|
||||
this.flow4GroupBox.Controls.Add(this.flow4ToTextBox);
|
||||
this.flow4GroupBox.Controls.Add(this.flow4FromTextBox);
|
||||
this.flow4GroupBox.Controls.Add(this.flow4CheckBox);
|
||||
this.flow4GroupBox.Location = new System.Drawing.Point(706, 7);
|
||||
this.flow4GroupBox.Name = "flow4GroupBox";
|
||||
this.flow4GroupBox.Size = new System.Drawing.Size(221, 77);
|
||||
this.flow4GroupBox.TabIndex = 7;
|
||||
this.flow4GroupBox.TabStop = false;
|
||||
//
|
||||
// flow4ToExclamation
|
||||
//
|
||||
this.flow4ToExclamation.AutoSize = true;
|
||||
this.flow4ToExclamation.ForeColor = System.Drawing.Color.Red;
|
||||
this.flow4ToExclamation.Location = new System.Drawing.Point(167, 48);
|
||||
this.flow4ToExclamation.Name = "flow4ToExclamation";
|
||||
this.flow4ToExclamation.Size = new System.Drawing.Size(10, 13);
|
||||
this.flow4ToExclamation.TabIndex = 9;
|
||||
this.flow4ToExclamation.Text = "!";
|
||||
this.flow4ToExclamation.Visible = false;
|
||||
//
|
||||
// flow4FromExclamation
|
||||
//
|
||||
this.flow4FromExclamation.AutoSize = true;
|
||||
this.flow4FromExclamation.ForeColor = System.Drawing.Color.Red;
|
||||
this.flow4FromExclamation.Location = new System.Drawing.Point(167, 24);
|
||||
this.flow4FromExclamation.Name = "flow4FromExclamation";
|
||||
this.flow4FromExclamation.Size = new System.Drawing.Size(10, 13);
|
||||
this.flow4FromExclamation.TabIndex = 8;
|
||||
this.flow4FromExclamation.Text = "!";
|
||||
this.flow4FromExclamation.Visible = false;
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(178, 48);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(32, 13);
|
||||
this.label7.TabIndex = 6;
|
||||
this.label7.Text = "m3/h";
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Location = new System.Drawing.Point(177, 23);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(32, 13);
|
||||
this.label8.TabIndex = 5;
|
||||
this.label8.Text = "m3/h";
|
||||
//
|
||||
// toLabel5
|
||||
//
|
||||
this.toLabel5.AutoSize = true;
|
||||
this.toLabel5.Location = new System.Drawing.Point(14, 48);
|
||||
this.toLabel5.Name = "toLabel5";
|
||||
this.toLabel5.Size = new System.Drawing.Size(20, 13);
|
||||
this.toLabel5.TabIndex = 4;
|
||||
this.toLabel5.Text = "To";
|
||||
//
|
||||
// fromLabel5
|
||||
//
|
||||
this.fromLabel5.AutoSize = true;
|
||||
this.fromLabel5.Location = new System.Drawing.Point(14, 23);
|
||||
this.fromLabel5.Name = "fromLabel5";
|
||||
this.fromLabel5.Size = new System.Drawing.Size(30, 13);
|
||||
this.fromLabel5.TabIndex = 3;
|
||||
this.fromLabel5.Text = "From";
|
||||
//
|
||||
// flow4ToTextBox
|
||||
//
|
||||
this.flow4ToTextBox.Location = new System.Drawing.Point(65, 45);
|
||||
this.flow4ToTextBox.Name = "flow4ToTextBox";
|
||||
this.flow4ToTextBox.Size = new System.Drawing.Size(100, 20);
|
||||
this.flow4ToTextBox.TabIndex = 2;
|
||||
this.flow4ToTextBox.TextChanged += new System.EventHandler(this.flow4ToTextBox_TextChanged);
|
||||
//
|
||||
// flow4FromTextBox
|
||||
//
|
||||
this.flow4FromTextBox.Location = new System.Drawing.Point(65, 20);
|
||||
this.flow4FromTextBox.Name = "flow4FromTextBox";
|
||||
this.flow4FromTextBox.Size = new System.Drawing.Size(100, 20);
|
||||
this.flow4FromTextBox.TabIndex = 1;
|
||||
this.flow4FromTextBox.TextChanged += new System.EventHandler(this.flow4FromTextBox_TextChanged);
|
||||
//
|
||||
// flow4CheckBox
|
||||
//
|
||||
this.flow4CheckBox.AutoSize = true;
|
||||
this.flow4CheckBox.Location = new System.Drawing.Point(10, 0);
|
||||
this.flow4CheckBox.Name = "flow4CheckBox";
|
||||
this.flow4CheckBox.Size = new System.Drawing.Size(57, 17);
|
||||
this.flow4CheckBox.TabIndex = 0;
|
||||
this.flow4CheckBox.Text = "Flow 4";
|
||||
this.flow4CheckBox.UseVisualStyleBackColor = true;
|
||||
this.flow4CheckBox.CheckedChanged += new System.EventHandler(this.flow4CheckBox_CheckedChanged);
|
||||
//
|
||||
// flow3GroupBox
|
||||
//
|
||||
this.flow3GroupBox.Controls.Add(this.flow3ToExclamation);
|
||||
@@ -442,12 +627,6 @@
|
||||
//
|
||||
// benchesTabControl
|
||||
//
|
||||
this.benchesTabControl.Controls.Add(this.tabPage1);
|
||||
this.benchesTabControl.Controls.Add(this.tabPage2);
|
||||
this.benchesTabControl.Controls.Add(this.tabPage3);
|
||||
this.benchesTabControl.Controls.Add(this.tabPage4);
|
||||
this.benchesTabControl.Controls.Add(this.tabPage5);
|
||||
this.benchesTabControl.Controls.Add(this.tabPage6);
|
||||
this.benchesTabControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.benchesTabControl.Location = new System.Drawing.Point(0, 0);
|
||||
this.benchesTabControl.Name = "benchesTabControl";
|
||||
@@ -455,320 +634,6 @@
|
||||
this.benchesTabControl.Size = new System.Drawing.Size(1202, 356);
|
||||
this.benchesTabControl.TabIndex = 0;
|
||||
//
|
||||
// tabPage1
|
||||
//
|
||||
this.tabPage1.Controls.Add(this.wr10StatisticsCtrl1);
|
||||
this.tabPage1.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage1.Name = "tabPage1";
|
||||
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPage1.Size = new System.Drawing.Size(1194, 330);
|
||||
this.tabPage1.TabIndex = 0;
|
||||
this.tabPage1.Text = "WR10";
|
||||
this.tabPage1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// tabPage2
|
||||
//
|
||||
this.tabPage2.Controls.Add(this.wr11StatisticsCtrl);
|
||||
this.tabPage2.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage2.Name = "tabPage2";
|
||||
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPage2.Size = new System.Drawing.Size(1194, 330);
|
||||
this.tabPage2.TabIndex = 1;
|
||||
this.tabPage2.Text = "WR11";
|
||||
this.tabPage2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// tabPage3
|
||||
//
|
||||
this.tabPage3.Controls.Add(this.wr13StatisticsCtrl);
|
||||
this.tabPage3.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage3.Name = "tabPage3";
|
||||
this.tabPage3.Size = new System.Drawing.Size(1194, 330);
|
||||
this.tabPage3.TabIndex = 2;
|
||||
this.tabPage3.Text = "WR13";
|
||||
this.tabPage3.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// tabPage4
|
||||
//
|
||||
this.tabPage4.Controls.Add(this.wr14StatisticsCtrl);
|
||||
this.tabPage4.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage4.Name = "tabPage4";
|
||||
this.tabPage4.Size = new System.Drawing.Size(1194, 330);
|
||||
this.tabPage4.TabIndex = 3;
|
||||
this.tabPage4.Text = "WR14";
|
||||
this.tabPage4.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// tabPage5
|
||||
//
|
||||
this.tabPage5.Controls.Add(this.wr15StatisticsCtrl);
|
||||
this.tabPage5.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage5.Name = "tabPage5";
|
||||
this.tabPage5.Size = new System.Drawing.Size(1194, 330);
|
||||
this.tabPage5.TabIndex = 4;
|
||||
this.tabPage5.Text = "WR15";
|
||||
this.tabPage5.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// tabPage6
|
||||
//
|
||||
this.tabPage6.Controls.Add(this.pt7StatisticsCtrl);
|
||||
this.tabPage6.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage6.Name = "tabPage6";
|
||||
this.tabPage6.Size = new System.Drawing.Size(1194, 330);
|
||||
this.tabPage6.TabIndex = 5;
|
||||
this.tabPage6.Text = "PT7";
|
||||
this.tabPage6.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// flow4GroupBox
|
||||
//
|
||||
this.flow4GroupBox.Controls.Add(this.flow4ToExclamation);
|
||||
this.flow4GroupBox.Controls.Add(this.flow4FromExclamation);
|
||||
this.flow4GroupBox.Controls.Add(this.label7);
|
||||
this.flow4GroupBox.Controls.Add(this.label8);
|
||||
this.flow4GroupBox.Controls.Add(this.toLabel5);
|
||||
this.flow4GroupBox.Controls.Add(this.fromLabel5);
|
||||
this.flow4GroupBox.Controls.Add(this.flow4ToTextBox);
|
||||
this.flow4GroupBox.Controls.Add(this.flow4FromTextBox);
|
||||
this.flow4GroupBox.Controls.Add(this.flow4CheckBox);
|
||||
this.flow4GroupBox.Location = new System.Drawing.Point(706, 7);
|
||||
this.flow4GroupBox.Name = "flow4GroupBox";
|
||||
this.flow4GroupBox.Size = new System.Drawing.Size(221, 77);
|
||||
this.flow4GroupBox.TabIndex = 7;
|
||||
this.flow4GroupBox.TabStop = false;
|
||||
//
|
||||
// flow4ToExclamation
|
||||
//
|
||||
this.flow4ToExclamation.AutoSize = true;
|
||||
this.flow4ToExclamation.ForeColor = System.Drawing.Color.Red;
|
||||
this.flow4ToExclamation.Location = new System.Drawing.Point(167, 48);
|
||||
this.flow4ToExclamation.Name = "flow4ToExclamation";
|
||||
this.flow4ToExclamation.Size = new System.Drawing.Size(10, 13);
|
||||
this.flow4ToExclamation.TabIndex = 9;
|
||||
this.flow4ToExclamation.Text = "!";
|
||||
this.flow4ToExclamation.Visible = false;
|
||||
//
|
||||
// flow4FromExclamation
|
||||
//
|
||||
this.flow4FromExclamation.AutoSize = true;
|
||||
this.flow4FromExclamation.ForeColor = System.Drawing.Color.Red;
|
||||
this.flow4FromExclamation.Location = new System.Drawing.Point(167, 24);
|
||||
this.flow4FromExclamation.Name = "flow4FromExclamation";
|
||||
this.flow4FromExclamation.Size = new System.Drawing.Size(10, 13);
|
||||
this.flow4FromExclamation.TabIndex = 8;
|
||||
this.flow4FromExclamation.Text = "!";
|
||||
this.flow4FromExclamation.Visible = false;
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(178, 48);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(32, 13);
|
||||
this.label7.TabIndex = 6;
|
||||
this.label7.Text = "m3/h";
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Location = new System.Drawing.Point(177, 23);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(32, 13);
|
||||
this.label8.TabIndex = 5;
|
||||
this.label8.Text = "m3/h";
|
||||
//
|
||||
// toLabel5
|
||||
//
|
||||
this.toLabel5.AutoSize = true;
|
||||
this.toLabel5.Location = new System.Drawing.Point(14, 48);
|
||||
this.toLabel5.Name = "toLabel5";
|
||||
this.toLabel5.Size = new System.Drawing.Size(20, 13);
|
||||
this.toLabel5.TabIndex = 4;
|
||||
this.toLabel5.Text = "To";
|
||||
//
|
||||
// fromLabel5
|
||||
//
|
||||
this.fromLabel5.AutoSize = true;
|
||||
this.fromLabel5.Location = new System.Drawing.Point(14, 23);
|
||||
this.fromLabel5.Name = "fromLabel5";
|
||||
this.fromLabel5.Size = new System.Drawing.Size(30, 13);
|
||||
this.fromLabel5.TabIndex = 3;
|
||||
this.fromLabel5.Text = "From";
|
||||
//
|
||||
// flow4ToTextBox
|
||||
//
|
||||
this.flow4ToTextBox.Location = new System.Drawing.Point(65, 45);
|
||||
this.flow4ToTextBox.Name = "flow4ToTextBox";
|
||||
this.flow4ToTextBox.Size = new System.Drawing.Size(100, 20);
|
||||
this.flow4ToTextBox.TabIndex = 2;
|
||||
this.flow4ToTextBox.TextChanged += new System.EventHandler(this.flow4ToTextBox_TextChanged);
|
||||
//
|
||||
// flow4FromTextBox
|
||||
//
|
||||
this.flow4FromTextBox.Location = new System.Drawing.Point(65, 20);
|
||||
this.flow4FromTextBox.Name = "flow4FromTextBox";
|
||||
this.flow4FromTextBox.Size = new System.Drawing.Size(100, 20);
|
||||
this.flow4FromTextBox.TabIndex = 1;
|
||||
this.flow4FromTextBox.TextChanged += new System.EventHandler(this.flow4FromTextBox_TextChanged);
|
||||
//
|
||||
// flow4CheckBox
|
||||
//
|
||||
this.flow4CheckBox.AutoSize = true;
|
||||
this.flow4CheckBox.Location = new System.Drawing.Point(10, 0);
|
||||
this.flow4CheckBox.Name = "flow4CheckBox";
|
||||
this.flow4CheckBox.Size = new System.Drawing.Size(57, 17);
|
||||
this.flow4CheckBox.TabIndex = 0;
|
||||
this.flow4CheckBox.Text = "Flow 4";
|
||||
this.flow4CheckBox.UseVisualStyleBackColor = true;
|
||||
this.flow4CheckBox.CheckedChanged += new System.EventHandler(this.flow4CheckBox_CheckedChanged);
|
||||
//
|
||||
// flow5GroupBox
|
||||
//
|
||||
this.flow5GroupBox.Controls.Add(this.flow5ToExclamation);
|
||||
this.flow5GroupBox.Controls.Add(this.flow5FromExclamation);
|
||||
this.flow5GroupBox.Controls.Add(this.label9);
|
||||
this.flow5GroupBox.Controls.Add(this.label10);
|
||||
this.flow5GroupBox.Controls.Add(this.toLabel6);
|
||||
this.flow5GroupBox.Controls.Add(this.fromLabel6);
|
||||
this.flow5GroupBox.Controls.Add(this.flow5ToTextBox);
|
||||
this.flow5GroupBox.Controls.Add(this.flow5FromTextBox);
|
||||
this.flow5GroupBox.Controls.Add(this.flow5CheckBox);
|
||||
this.flow5GroupBox.Location = new System.Drawing.Point(939, 7);
|
||||
this.flow5GroupBox.Name = "flow5GroupBox";
|
||||
this.flow5GroupBox.Size = new System.Drawing.Size(221, 77);
|
||||
this.flow5GroupBox.TabIndex = 8;
|
||||
this.flow5GroupBox.TabStop = false;
|
||||
//
|
||||
// flow5ToExclamation
|
||||
//
|
||||
this.flow5ToExclamation.AutoSize = true;
|
||||
this.flow5ToExclamation.ForeColor = System.Drawing.Color.Red;
|
||||
this.flow5ToExclamation.Location = new System.Drawing.Point(167, 48);
|
||||
this.flow5ToExclamation.Name = "flow5ToExclamation";
|
||||
this.flow5ToExclamation.Size = new System.Drawing.Size(10, 13);
|
||||
this.flow5ToExclamation.TabIndex = 9;
|
||||
this.flow5ToExclamation.Text = "!";
|
||||
this.flow5ToExclamation.Visible = false;
|
||||
//
|
||||
// flow5FromExclamation
|
||||
//
|
||||
this.flow5FromExclamation.AutoSize = true;
|
||||
this.flow5FromExclamation.ForeColor = System.Drawing.Color.Red;
|
||||
this.flow5FromExclamation.Location = new System.Drawing.Point(167, 24);
|
||||
this.flow5FromExclamation.Name = "flow5FromExclamation";
|
||||
this.flow5FromExclamation.Size = new System.Drawing.Size(10, 13);
|
||||
this.flow5FromExclamation.TabIndex = 8;
|
||||
this.flow5FromExclamation.Text = "!";
|
||||
this.flow5FromExclamation.Visible = false;
|
||||
//
|
||||
// label9
|
||||
//
|
||||
this.label9.AutoSize = true;
|
||||
this.label9.Location = new System.Drawing.Point(178, 48);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(32, 13);
|
||||
this.label9.TabIndex = 6;
|
||||
this.label9.Text = "m3/h";
|
||||
//
|
||||
// label10
|
||||
//
|
||||
this.label10.AutoSize = true;
|
||||
this.label10.Location = new System.Drawing.Point(177, 23);
|
||||
this.label10.Name = "label10";
|
||||
this.label10.Size = new System.Drawing.Size(32, 13);
|
||||
this.label10.TabIndex = 5;
|
||||
this.label10.Text = "m3/h";
|
||||
//
|
||||
// toLabel6
|
||||
//
|
||||
this.toLabel6.AutoSize = true;
|
||||
this.toLabel6.Location = new System.Drawing.Point(14, 48);
|
||||
this.toLabel6.Name = "toLabel6";
|
||||
this.toLabel6.Size = new System.Drawing.Size(20, 13);
|
||||
this.toLabel6.TabIndex = 4;
|
||||
this.toLabel6.Text = "To";
|
||||
//
|
||||
// fromLabel6
|
||||
//
|
||||
this.fromLabel6.AutoSize = true;
|
||||
this.fromLabel6.Location = new System.Drawing.Point(14, 23);
|
||||
this.fromLabel6.Name = "fromLabel6";
|
||||
this.fromLabel6.Size = new System.Drawing.Size(30, 13);
|
||||
this.fromLabel6.TabIndex = 3;
|
||||
this.fromLabel6.Text = "From";
|
||||
//
|
||||
// flow5ToTextBox
|
||||
//
|
||||
this.flow5ToTextBox.Location = new System.Drawing.Point(65, 45);
|
||||
this.flow5ToTextBox.Name = "flow5ToTextBox";
|
||||
this.flow5ToTextBox.Size = new System.Drawing.Size(100, 20);
|
||||
this.flow5ToTextBox.TabIndex = 2;
|
||||
this.flow5ToTextBox.TextChanged += new System.EventHandler(this.flow5ToTextBox_TextChanged);
|
||||
//
|
||||
// flow5FromTextBox
|
||||
//
|
||||
this.flow5FromTextBox.Location = new System.Drawing.Point(65, 20);
|
||||
this.flow5FromTextBox.Name = "flow5FromTextBox";
|
||||
this.flow5FromTextBox.Size = new System.Drawing.Size(100, 20);
|
||||
this.flow5FromTextBox.TabIndex = 1;
|
||||
this.flow5FromTextBox.TextChanged += new System.EventHandler(this.flow5FromTextBox_TextChanged);
|
||||
//
|
||||
// flow5CheckBox
|
||||
//
|
||||
this.flow5CheckBox.AutoSize = true;
|
||||
this.flow5CheckBox.Location = new System.Drawing.Point(10, 0);
|
||||
this.flow5CheckBox.Name = "flow5CheckBox";
|
||||
this.flow5CheckBox.Size = new System.Drawing.Size(57, 17);
|
||||
this.flow5CheckBox.TabIndex = 0;
|
||||
this.flow5CheckBox.Text = "Flow 5";
|
||||
this.flow5CheckBox.UseVisualStyleBackColor = true;
|
||||
this.flow5CheckBox.CheckedChanged += new System.EventHandler(this.flow5CheckBox_CheckedChanged);
|
||||
//
|
||||
// wr10StatisticsCtrl1
|
||||
//
|
||||
this.wr10StatisticsCtrl1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.wr10StatisticsCtrl1.Location = new System.Drawing.Point(3, 3);
|
||||
this.wr10StatisticsCtrl1.Name = "wr10StatisticsCtrl1";
|
||||
this.wr10StatisticsCtrl1.Size = new System.Drawing.Size(1188, 324);
|
||||
this.wr10StatisticsCtrl1.TabIndex = 0;
|
||||
//
|
||||
// wr11StatisticsCtrl
|
||||
//
|
||||
this.wr11StatisticsCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.wr11StatisticsCtrl.Location = new System.Drawing.Point(3, 3);
|
||||
this.wr11StatisticsCtrl.Name = "wr11StatisticsCtrl";
|
||||
this.wr11StatisticsCtrl.Size = new System.Drawing.Size(1188, 324);
|
||||
this.wr11StatisticsCtrl.TabIndex = 0;
|
||||
//
|
||||
// wr13StatisticsCtrl
|
||||
//
|
||||
this.wr13StatisticsCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.wr13StatisticsCtrl.Location = new System.Drawing.Point(0, 0);
|
||||
this.wr13StatisticsCtrl.Name = "wr13StatisticsCtrl";
|
||||
this.wr13StatisticsCtrl.Size = new System.Drawing.Size(1194, 330);
|
||||
this.wr13StatisticsCtrl.TabIndex = 0;
|
||||
//
|
||||
// wr14StatisticsCtrl
|
||||
//
|
||||
this.wr14StatisticsCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.wr14StatisticsCtrl.Location = new System.Drawing.Point(0, 0);
|
||||
this.wr14StatisticsCtrl.Name = "wr14StatisticsCtrl";
|
||||
this.wr14StatisticsCtrl.Size = new System.Drawing.Size(1194, 330);
|
||||
this.wr14StatisticsCtrl.TabIndex = 0;
|
||||
//
|
||||
// wr15StatisticsCtrl
|
||||
//
|
||||
this.wr15StatisticsCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.wr15StatisticsCtrl.Location = new System.Drawing.Point(0, 0);
|
||||
this.wr15StatisticsCtrl.Name = "wr15StatisticsCtrl";
|
||||
this.wr15StatisticsCtrl.Size = new System.Drawing.Size(1194, 330);
|
||||
this.wr15StatisticsCtrl.TabIndex = 0;
|
||||
//
|
||||
// pt7StatisticsCtrl
|
||||
//
|
||||
this.pt7StatisticsCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pt7StatisticsCtrl.Location = new System.Drawing.Point(0, 0);
|
||||
this.pt7StatisticsCtrl.Name = "pt7StatisticsCtrl";
|
||||
this.pt7StatisticsCtrl.Size = new System.Drawing.Size(1194, 330);
|
||||
this.pt7StatisticsCtrl.TabIndex = 0;
|
||||
//
|
||||
// MidOrWaterMetersCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
@@ -780,23 +645,16 @@
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.flow5GroupBox.ResumeLayout(false);
|
||||
this.flow5GroupBox.PerformLayout();
|
||||
this.flow4GroupBox.ResumeLayout(false);
|
||||
this.flow4GroupBox.PerformLayout();
|
||||
this.flow3GroupBox.ResumeLayout(false);
|
||||
this.flow3GroupBox.PerformLayout();
|
||||
this.flow2GroupBox.ResumeLayout(false);
|
||||
this.flow2GroupBox.PerformLayout();
|
||||
this.flow1GroupBox.ResumeLayout(false);
|
||||
this.flow1GroupBox.PerformLayout();
|
||||
this.benchesTabControl.ResumeLayout(false);
|
||||
this.tabPage1.ResumeLayout(false);
|
||||
this.tabPage2.ResumeLayout(false);
|
||||
this.tabPage3.ResumeLayout(false);
|
||||
this.tabPage4.ResumeLayout(false);
|
||||
this.tabPage5.ResumeLayout(false);
|
||||
this.tabPage6.ResumeLayout(false);
|
||||
this.flow4GroupBox.ResumeLayout(false);
|
||||
this.flow4GroupBox.PerformLayout();
|
||||
this.flow5GroupBox.ResumeLayout(false);
|
||||
this.flow5GroupBox.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
@@ -805,18 +663,6 @@
|
||||
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private System.Windows.Forms.TabControl benchesTabControl;
|
||||
private System.Windows.Forms.TabPage tabPage1;
|
||||
private System.Windows.Forms.TabPage tabPage2;
|
||||
private System.Windows.Forms.TabPage tabPage3;
|
||||
private System.Windows.Forms.TabPage tabPage4;
|
||||
private System.Windows.Forms.TabPage tabPage5;
|
||||
private System.Windows.Forms.TabPage tabPage6;
|
||||
private StatisticsCtrl wr10StatisticsCtrl1;
|
||||
private StatisticsCtrl wr11StatisticsCtrl;
|
||||
private StatisticsCtrl wr13StatisticsCtrl;
|
||||
private StatisticsCtrl wr14StatisticsCtrl;
|
||||
private StatisticsCtrl wr15StatisticsCtrl;
|
||||
private StatisticsCtrl pt7StatisticsCtrl;
|
||||
private System.Windows.Forms.GroupBox flow3GroupBox;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Statistics.UserControls
|
||||
{
|
||||
public partial class MidOrWaterMetersCtrl : UserControl
|
||||
{
|
||||
public MidId MidId;
|
||||
public int MidId; /// 1-based MID Id.
|
||||
public StatisticsDlg Parent;
|
||||
|
||||
|
||||
@@ -96,14 +96,16 @@ namespace Statistics.UserControls
|
||||
ManageCheckGroupBox(flow4CheckBox, flow4GroupBox);
|
||||
ManageCheckGroupBox(flow5CheckBox, flow5GroupBox);
|
||||
|
||||
for (int i = 0; i < benchesTabControl.TabPages.Count; i++ )
|
||||
for (int i = 0; i < Program.LocalSettings.BenchNames.Length; i++)
|
||||
{
|
||||
TabPage tp = benchesTabControl.TabPages[i];
|
||||
if ((tp.Controls.Count > 0) && (tp.Controls[0] is StatisticsCtrl))
|
||||
{
|
||||
(tp.Controls[0] as StatisticsCtrl).Id = i;
|
||||
(tp.Controls[0] as StatisticsCtrl).MidCtrl = this;
|
||||
}
|
||||
TabPage tp = new TabPage();
|
||||
tp.Text = Program.LocalSettings.BenchNames[i];
|
||||
StatisticsCtrl statistics = new StatisticsCtrl();
|
||||
statistics.Id = i;
|
||||
statistics.MidCtrl = this;
|
||||
statistics.Dock = DockStyle.Fill;
|
||||
tp.Controls.Add(statistics);
|
||||
benchesTabControl.TabPages.Add(tp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace TBF.BenchControl.DataEntry.Combined
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
public bool Completed { get { return (modelessDlg is IHasCompleted) ? (modelessDlg as IHasCompleted).Completed : true; } }
|
||||
|
||||
double refVolume;
|
||||
double errLimLo;
|
||||
|
||||
@@ -52,6 +52,7 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
public bool Completed { get { return (modelessDlg is IHasCompleted) ? (modelessDlg as IHasCompleted).Completed : true; } }
|
||||
|
||||
double refVolume;
|
||||
double errLimLo;
|
||||
|
||||
@@ -52,6 +52,7 @@ namespace TBF.BenchControl.DataEntry.HeatMeters6
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
public bool Completed { get { return (modelessDlg is IHasCompleted) ? (modelessDlg as IHasCompleted).Completed : true; } }
|
||||
|
||||
double refVolume;
|
||||
double errLimLo;
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace TBF.BenchControl.DataEntry.Munich
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
public bool Completed { get { return (modelessDlg is IHasCompleted) ? (modelessDlg as IHasCompleted).Completed : true; } }
|
||||
|
||||
bool resultSaved; /// Set in Run() when results are saved
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace TBF.BenchControl.DataEntry.Munich3
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
public bool Completed { get { return (modelessDlg is IHasCompleted) ? (modelessDlg as IHasCompleted).Completed : true; } }
|
||||
|
||||
double refVolume;
|
||||
double errLimLo;
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace TBF.BenchControl.DataEntry.Single
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
public bool Completed { get { return (modelessDlg is IHasCompleted) ? (modelessDlg as IHasCompleted).Completed : true; } }
|
||||
|
||||
double refVolume;
|
||||
double errLimLo;
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
public bool Completed { get { return (modelessDlg is IHasCompleted) ? (modelessDlg as IHasCompleted).Completed : true; } }
|
||||
|
||||
double refVolume;
|
||||
double errLimLo;
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
public bool Completed { get { return (modelessDlg is IHasCompleted) ? (modelessDlg as IHasCompleted).Completed : true; } }
|
||||
|
||||
double refVolume;
|
||||
double errLimLo;
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace TBF.BenchControl.DataEntry.Standard48
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
public bool Completed { get { return (modelessDlg is IHasCompleted) ? (modelessDlg as IHasCompleted).Completed : true; } }
|
||||
|
||||
double refVolume;
|
||||
double errLimLo;
|
||||
|
||||
@@ -40,6 +40,7 @@ namespace TBF.BenchControl.DataEntry.Standard6
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
public bool Completed { get { return (modelessDlg is IHasCompleted) ? (modelessDlg as IHasCompleted).Completed : true; } }
|
||||
|
||||
double refVolume;
|
||||
double errLimLo;
|
||||
|
||||
@@ -90,6 +90,7 @@ namespace TBF.BenchControl.DataEntry.StandardCamera
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
public bool Completed { get { return (modelessDlg is IHasCompleted) ? (modelessDlg as IHasCompleted).Completed : true; } }
|
||||
|
||||
double refVolume;
|
||||
double errLimLo;
|
||||
|
||||
@@ -47,6 +47,7 @@ namespace TBF.BenchControl.DataEntry.WMStates
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
public bool Completed { get { return (modelessDlg is IHasCompleted) ? (modelessDlg as IHasCompleted).Completed : true; } }
|
||||
|
||||
bool resultSaved;
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace TBF.BenchControl.DataEntry.iPerl
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
public bool Completed { get { return (modelessDlg is IHasCompleted) ? (modelessDlg as IHasCompleted).Completed : true; } }
|
||||
|
||||
double refVolume;
|
||||
double errLimLo;
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace TBF.BenchControl.Elde
|
||||
EnduranceCycleStop = 13,
|
||||
}
|
||||
|
||||
#if FUZHOU_300 || IZRAEL_200 || TORINO_50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TURA_IPERL || TURA_SPECIAL || BADGER_VELKA_TRAT || PUCHONG_200 || SLM_50 || GENESIS || MALTA_WSD25 || SLM_END || WARSAW_END || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || SENTEC || FUZHOU_100 || CEVAK_200 || IZRAEL_50
|
||||
#if FUZHOU_300 || IZRAEL_200 || TORINO_50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TURA_IPERL || TURA_SPECIAL || BADGER_VELKA_TRAT || PUCHONG_200 || SLM_50 || GENESIS || MALTA_WSD25 || SLM_END || WARSAW_END || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || DEWA_300 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || SENTEC || FUZHOU_100 || CEVAK_200 || IZRAEL_50
|
||||
public enum StatusP : ulong
|
||||
{
|
||||
RefFlowMeterMask = 0x7, /// bits 0,1,2
|
||||
|
||||
@@ -122,8 +122,12 @@ namespace TBF.BenchControl.Elde
|
||||
/// Initialization data updated by constructors of children components
|
||||
/// and sent to 'controlCom2panel' by SendCalibData() method.
|
||||
///
|
||||
#if DEWA_300
|
||||
public float[,] TempCalibData = new float[16, 5];
|
||||
#else
|
||||
public float[,] TempCalibData = new float[8, 5];
|
||||
public uint[] DiverterEdge; /// Created and initialized in this.Initialize()
|
||||
#endif
|
||||
public uint[] DiverterEdge; /// Created and initialized in this.Initialize()
|
||||
public byte MeretProtocol = 0;
|
||||
|
||||
// Array length is the reference flowmeters count plus one
|
||||
@@ -138,6 +142,13 @@ namespace TBF.BenchControl.Elde
|
||||
{100,500}, {100,500}, {100,500}, {100,500} };
|
||||
public byte[] MeretRS485Address = new byte[4];
|
||||
public float[] EtCalib = new float[7] { 1, 1, 1, 1, 1, 1, 1 };
|
||||
#elif DEWA_300
|
||||
public uint[,] RegValveCalib = new uint[16, 2] { {100,500}, {100,500}, {100,500}, {100,500},
|
||||
{100,500}, {100,500}, {100,500}, {100,500},
|
||||
{100,500}, {100,500}, {100,500}, {100,500},
|
||||
{100,500}, {100,500}, {100,500}, {100,500} };
|
||||
public byte[] MeretRS485Address = new byte[4];
|
||||
public float[] EtCalib = new float[8] { 1, 1, 1, 1, 1, 1, 1, 1 };
|
||||
#elif MUNICH || TORINO_50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TORUN_50 || CEVAK_40 || TURA_IPERL || TURA_SPECIAL || MURES_40 || FUZHOU_50 || SLM_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FUZHOU_100
|
||||
public uint[,] RegValveCalib = new uint[8,2] {{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500}};
|
||||
public byte[] MeretRS485Address = new byte[4];
|
||||
|
||||
@@ -56,13 +56,13 @@ namespace TBF.BenchControl.Elde
|
||||
public float Pressure(int prsNr0) { return ctrlBrdComponent.pressure[prsNr0]; }
|
||||
public float Temperature(int tmpNr0) { return ctrlBrdComponent.temperature[tmpNr0]; }
|
||||
public RegulValveState RegulValveState(int rvNr1) { return (RegulValveState)ctrlBrdComponent.rValveStatus[rvNr1 - 1]; }
|
||||
#if GENESIS || BERLIN || PETERSBURG_200
|
||||
#if GENESIS || BERLIN || PETERSBURG_200 || DEWA_300
|
||||
public UInt128 RRoute { get { return ((UInt128)ctrlBrdComponent.rRouteH << 64) | (UInt128)ctrlBrdComponent.rRoute; } }
|
||||
#else
|
||||
public UInt128 RRoute { get { return ctrlBrdComponent.rRoute; } }
|
||||
#endif
|
||||
|
||||
#if GENESIS || KEMPNO_50 || KRAKOW_50 || BAHRAIN_50 || BADGER_STREDNA_TRAT || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || SENTEC || FUZHOU_100 || CEVAK_200 || IZRAEL_50
|
||||
#if GENESIS || KEMPNO_50 || KRAKOW_50 || BAHRAIN_50 || BADGER_STREDNA_TRAT || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || SENTEC || FUZHOU_100 || CEVAK_200 || IZRAEL_50 || DEWA_300
|
||||
public uint DivTime(int id) { return ctrlBrdComponent.divTime[id]; }
|
||||
public void SetDivLimit(int divNo, uint limLoPct, uint limHiPct)
|
||||
{
|
||||
@@ -94,9 +94,9 @@ namespace TBF.BenchControl.Elde
|
||||
return ctrlBrdComponent.Analogy[rvNr1 - 1]; /// Fixes bug: RValvePosition returns 0 all the time
|
||||
}
|
||||
public float DivSamples(int time, int divIx0)
|
||||
{
|
||||
#if MUNICH
|
||||
return ctrlBrdComponent.DIVSamples[time, 0];
|
||||
{
|
||||
#if MUNICH || IZRAEL_200
|
||||
return ctrlBrdComponent.DIVSamples[time, 0];
|
||||
#else
|
||||
return ctrlBrdComponent.DIVSamples[time, divIx0];
|
||||
#endif
|
||||
@@ -353,7 +353,7 @@ namespace TBF.BenchControl.Elde
|
||||
bool bit39 = (route & 0x00FC000000000000) != 0; /// true if any of bits 50 through 55 is set
|
||||
route = route & 0xFF03FFFFFFFFFFFF;
|
||||
if (bit39) route = route | 0x0000008000000000;
|
||||
#elif PETERSBURG_200
|
||||
#elif PETERSBURG_200 || DEWA_300
|
||||
///
|
||||
/// The following code deals with the situation that all pumps share bit #80.
|
||||
/// In settings the bits of pumps should be sent as follows: P1=64, P2=65, P3=66, P4=67 and P5=68
|
||||
@@ -388,7 +388,7 @@ namespace TBF.BenchControl.Elde
|
||||
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
|
||||
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)(route & (UInt128)0xFFFFFFFFFFFFFFFF), (ulong)(route >> 64), pulsesArr, (uint)testMethods,
|
||||
Convert.ToSingle(filterConstants[0]), fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
|
||||
#elif GENESIS
|
||||
#elif GENESIS || DEWA_300
|
||||
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
|
||||
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)(route & (UInt128)0xFFFFFFFFFFFFFFFF), (ulong)(route >> 64), pulsesArr, (uint)testMethods,
|
||||
filterConstants, fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
|
||||
|
||||
@@ -74,6 +74,7 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
if (divertersSoFar != null)
|
||||
{
|
||||
for (int i = 0; i < divertersSoFar.Length; i++) Diverters[i] = divertersSoFar[i];
|
||||
|
||||
}
|
||||
|
||||
Diverters[nextIdx - 1] = this;
|
||||
@@ -107,6 +108,8 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
flowMtrNr4Cmd = divNrFromName;
|
||||
#elif CEVAK_200
|
||||
flowMtrNr4Cmd = (divNrFromName == 4) ? 5 : divNrFromName;
|
||||
#elif DEWA_300
|
||||
flowMtrNr4Cmd = divNrFromName + 2; /// Div1: 1,2,3, Div2: 4, Div3: 5, Div4: 6, Div5: 7
|
||||
#else
|
||||
flowMtrNr4Cmd = (divNrFromName == 1) ? 1 : 3;
|
||||
#endif
|
||||
|
||||
@@ -16,13 +16,13 @@ namespace TBF.BenchControl.Elde.FlowMeter
|
||||
readonly FlowMeterCfg flowMeterCfg;
|
||||
readonly ControlBoardDev controlBoard;
|
||||
|
||||
public int Idx1 { get { return flowMeterCfg.Idx1; } }
|
||||
public int Idx1 { get { return flowMeterCfg.Idx1; } }
|
||||
public float NominalFlow { get { return flowMeterCfg.NominalFlow; } }
|
||||
public float LtrPerPulse { get { return flowMeterCfg.NominalFlow / 7200.0f; } } /// Nominal frequency is 2000 Hz
|
||||
|
||||
public float LtrPerPulseCorrected(double flow, int rangeIx)
|
||||
{
|
||||
if (flow < 0.1 * NominalFlow) return LtrPerPulse; /// No correction for small flow
|
||||
if (flow < 0.1 * NominalFlow) return LtrPerPulse; /// No correction for small flow
|
||||
|
||||
/// Apply correction
|
||||
var rangeCorrections = new List<Config.Entities.MeasurementCorrection>();
|
||||
|
||||
@@ -58,7 +58,9 @@ namespace TBF.BenchControl.Elde.PressureMeter
|
||||
/// <returns>Pressure in mBar</returns>
|
||||
public float ReadPressure()
|
||||
{
|
||||
return (float)Config.Units.ConvertFrom(Config.Unit.kPa, ControlBoard.Pressure(Idx0));
|
||||
double rawPressure = Config.Units.ConvertFrom(Config.Unit.kPa, ControlBoard.Pressure(Idx0));
|
||||
double correctedPressure = Config.Formulas.CorrectedValue(rawPressure, Corrections);
|
||||
return (float)correctedPressure;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
float targetPositionLo;
|
||||
float targetPositionHi;
|
||||
|
||||
int startTime;
|
||||
int expireTime;
|
||||
DoubleBox flowBox;
|
||||
int flowWithinBoundsTime;
|
||||
@@ -165,6 +166,10 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
startTime = StateMachine.Time;
|
||||
expireTime = StateMachine.Time + timeout;
|
||||
if (expireTime < 0) expireTime = int.MaxValue;
|
||||
|
||||
double flowMtrFreq = flowMeter.ReadFrequency();
|
||||
double flow = flowMeter.ReadFlow();
|
||||
|
||||
@@ -194,9 +199,6 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
opState = OpState.ValveMoveToFlow1;
|
||||
}
|
||||
|
||||
expireTime = StateMachine.Time + timeout;
|
||||
if (expireTime < 0) expireTime = int.MaxValue;
|
||||
|
||||
TestMethods tm = 0;
|
||||
StopDevs sd = 0;
|
||||
// '_regulValve.RegulValveCfg.PidCoef' replaced by a casted operation parameter 'pidCoef'
|
||||
@@ -221,7 +223,7 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
}
|
||||
|
||||
log.InfoFormat("SetFlowOp:Run(T={0}) rv#={1} pos={2}% freq={3} flow={4} opState={5}",
|
||||
StateMachine.Time - expireTime + timeout, regulValveNr, rvPosition.ToString("F1"), flowMtrFreq, flow, opState);
|
||||
StateMachine.Time - startTime, regulValveNr, rvPosition.ToString("F1"), flowMtrFreq, flow, opState);
|
||||
|
||||
if (StateMachine.Time > expireTime)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace TBF.BenchControl.Elde.TempMeter
|
||||
|
||||
public readonly ControlBoardDev ControlBoard;
|
||||
|
||||
public int Idx0 { get { return tempMtrCfg.Idx0; } } /// 0..7
|
||||
public int Idx0 { get { return tempMtrCfg.Idx0; } } /// 0..15
|
||||
public double A1 { get { return tempMtrCfg.A1; } }
|
||||
public double A2 { get { return tempMtrCfg.A2; } }
|
||||
public double A3 { get { return tempMtrCfg.A3; } }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2016 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -19,7 +19,7 @@ namespace TBF.BenchControl.Elde.TempMeter
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public int Idx0; /// 0..7
|
||||
public int Idx0; /// 0 .. 15
|
||||
public double A1;
|
||||
public double A2;
|
||||
public double A3;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2016 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.IO;
|
||||
@@ -96,10 +96,10 @@ namespace TBF.BenchControl.Elde.TempMeter
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Invalid 'Parent Name'";
|
||||
}
|
||||
if (!int.TryParse(positionTextBox.Text, out dummy) || dummy < 0 || dummy > 7)
|
||||
if (!int.TryParse(positionTextBox.Text, out dummy) || dummy < 0 || dummy > 15)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Position' should be between 0 and 7";
|
||||
message += Environment.NewLine + "'Position' should be between 0 and 15";
|
||||
}
|
||||
|
||||
double fdummy;
|
||||
@@ -167,36 +167,46 @@ namespace TBF.BenchControl.Elde.TempMeter
|
||||
if (!string.IsNullOrEmpty(lastImportFileName)) dlg.FileName = lastImportFileName;
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
try
|
||||
using (TextReader reader = new StreamReader(dlg.FileName))
|
||||
{
|
||||
using (TextReader reader = new StreamReader(dlg.FileName))
|
||||
{
|
||||
double tmp;
|
||||
string lineID = string.Format("Calch{0} =", positionTextBox.Text);
|
||||
|
||||
do
|
||||
try
|
||||
{
|
||||
string startOfLine = string.Format("Calch{0} =", positionTextBox.Text);
|
||||
bool channelFound = false;
|
||||
string line;
|
||||
|
||||
do
|
||||
{
|
||||
string line = reader.ReadLine();
|
||||
if (line != null && line.IndexOf(lineID) == 0)
|
||||
line = reader.ReadLine();
|
||||
if (!string.IsNullOrEmpty(line) && (line.IndexOf(startOfLine) == 0))
|
||||
{
|
||||
string[] factors = line.Substring(lineID.Length).Split(new char[] { ',' });
|
||||
string[] factors = line.Substring(startOfLine.Length).Split(new char[] { ',' });
|
||||
int count = factors.Length;
|
||||
if (count >= 1 && Utils.TryParseEDouble(factors[0].Trim(), out tmp)) a1TextBox.Text = factors[0].Trim();
|
||||
double tmp;
|
||||
if (count >= 1 && Utils.TryParseEDouble(factors[0].Trim(), out tmp)) a1TextBox.Text = factors[0].Trim();
|
||||
if (count >= 2 && Utils.TryParseEDouble(factors[1].Trim(), out tmp)) a2TextBox.Text = factors[1].Trim();
|
||||
if (count >= 3 && Utils.TryParseEDouble(factors[2].Trim(), out tmp)) a3TextBox.Text = factors[2].Trim();
|
||||
if (count >= 4 && Utils.TryParseEDouble(factors[3].Trim(), out tmp)) a4TextBox.Text = factors[3].Trim();
|
||||
if (count >= 5 && Utils.TryParseEDouble(factors[4].Trim(), out tmp)) a5TextBox.Text = factors[4].Trim();
|
||||
channelFound = true;
|
||||
lastImportFileName = dlg.FileName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (lineID != null);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
MessageBox.Show("Import failed", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
}
|
||||
while (line != null);
|
||||
|
||||
if (!channelFound)
|
||||
{
|
||||
MessageBox.Show(string.Format("Calibration factors for channel {0} not found.", positionTextBox.Text),
|
||||
"Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
MessageBox.Show("Wrong file format, import failed.",
|
||||
"Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,6 +169,7 @@ namespace TBF.BenchControl
|
||||
Next, /// To move to the next state when debugging
|
||||
OK,
|
||||
Retry,
|
||||
Continue,
|
||||
Abort,
|
||||
TimerBusy,
|
||||
SetOutputsDone,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using Config.Entities;
|
||||
@@ -9,6 +9,11 @@ namespace TBF.BenchControl.GenericDevices
|
||||
{
|
||||
public interface IDataEntry : IComponent
|
||||
{
|
||||
/// <summary>
|
||||
/// true when DataEntry dialog was completed or when it does not support IHasCompleted (to avoid TBF freeze).
|
||||
/// </summary>
|
||||
bool Completed { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Updates test results with the information collected in watermeters.
|
||||
/// </summary>
|
||||
|
||||
@@ -5,8 +5,11 @@ using System;
|
||||
|
||||
namespace TBF.BenchControl.GenericDevices
|
||||
{
|
||||
interface IHasCompleted
|
||||
public interface IHasCompleted
|
||||
{
|
||||
/// <summary>
|
||||
/// true when a dialog was completed
|
||||
/// </summary>
|
||||
bool Completed { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.GenericDevices
|
||||
{
|
||||
public interface IParallelOutput : IComponent
|
||||
{
|
||||
IOperation SetOutputsOp(ushort outValue);
|
||||
IOperation ShowBenchWaitingOp();
|
||||
IOperation ShowBenchErrorOp();
|
||||
}
|
||||
}
|
||||
@@ -63,8 +63,8 @@ namespace TBF.BenchControl.Keithley.Multimeter_2010_RS232
|
||||
}
|
||||
|
||||
/// <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.
|
||||
/// Keithley mulltimeter connected via serial interface (RS232)
|
||||
/// Connection settings: 9600Bd 8-bits no-parity 1-stop-bit flow control: none
|
||||
/// </summary>
|
||||
public Multimeter(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace TBF.BenchControl.Modbus.Common
|
||||
/// Private fields
|
||||
SerialPort serialPort;
|
||||
DateTime lastSerialPortWrite;
|
||||
bool initialRunDeviceCommComplete;
|
||||
|
||||
public Queue<byte[]>[] ReceivedTelegrams
|
||||
{
|
||||
@@ -82,6 +83,8 @@ namespace TBF.BenchControl.Modbus.Common
|
||||
//workerThread = new Thread(Worker);
|
||||
//workerThread.Start();
|
||||
|
||||
initialRunDeviceCommComplete = false; /// Causes search for Quido RS modules in the first RunDeviceAfter() call
|
||||
|
||||
log.FatalFormat("{0} - Device successfully initialized", Name);
|
||||
}
|
||||
|
||||
@@ -99,7 +102,7 @@ namespace TBF.BenchControl.Modbus.Common
|
||||
|
||||
Telegram.UpdateTelegramCRC(message);
|
||||
|
||||
if ((DateTime.Now - lastSerialPortWrite) > new TimeSpan(0, 0, 0, 0, 100))
|
||||
if ((DateTime.Now - lastSerialPortWrite) > new TimeSpan(0, 0, 0, 0, 100) && initialRunDeviceCommComplete)
|
||||
{
|
||||
/// More then 100 ms since last 'send' --> do not enqueue the message
|
||||
SendMessageNow(message);
|
||||
@@ -174,12 +177,12 @@ namespace TBF.BenchControl.Modbus.Common
|
||||
Debug.WriteLine(s);
|
||||
log.Debug(s);
|
||||
}
|
||||
else
|
||||
{
|
||||
string s = Telegram.LogTelegram(string.Format("{0} - Invalid data received ", Name), buffer);
|
||||
Debug.WriteLine(s);
|
||||
log.Debug(s);
|
||||
}
|
||||
else
|
||||
{
|
||||
string s = Telegram.LogTelegram(string.Format("{0} - Invalid data received ", Name), buffer);
|
||||
Debug.WriteLine(s);
|
||||
log.Debug(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,6 +191,16 @@ namespace TBF.BenchControl.Modbus.Common
|
||||
{
|
||||
if (serialPort == null) return;
|
||||
|
||||
if (!initialRunDeviceCommComplete)
|
||||
{
|
||||
initialRunDeviceCommComplete = true; /// Prevent 2nd invocation of the subsequent code
|
||||
|
||||
/// Search Quido RS modules
|
||||
byte[] searchTelegram = new byte[] { 0xF8, 0x11, 0, 0 };
|
||||
Telegram.UpdateTelegramCRC(searchTelegram);
|
||||
SendMessageNow(searchTelegram);
|
||||
}
|
||||
|
||||
if (telegramsToSend.Count > 0 && (DateTime.Now - lastSerialPortWrite) > new TimeSpan(0, 0, 0, 0, 500))
|
||||
{
|
||||
SendMessageNow(telegramsToSend.Dequeue());
|
||||
@@ -197,15 +210,27 @@ namespace TBF.BenchControl.Modbus.Common
|
||||
/// <summary>Stop this device</summary>
|
||||
public void StopDevice()
|
||||
{
|
||||
if (serialPort != null)
|
||||
{
|
||||
//stopWorkerThread = true;
|
||||
//workerThread.Join(2000);
|
||||
serialPort.Close();
|
||||
serialPort = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void StopDevice2() { }
|
||||
public void StopDevice2()
|
||||
{
|
||||
if (serialPort != null)
|
||||
{
|
||||
/// Send telegrams currently in the queue
|
||||
while (telegramsToSend.Count > 0)
|
||||
{
|
||||
while ((DateTime.Now - lastSerialPortWrite) <= new TimeSpan(0, 0, 0, 0, 200))
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
SendMessageNow(telegramsToSend.Dequeue());
|
||||
}
|
||||
|
||||
//stopWorkerThread = true;
|
||||
//workerThread.Join(2000);
|
||||
serialPort.Close();
|
||||
serialPort = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,9 +33,6 @@ namespace TBF.BenchControl.Modbus.PressureMeter.Meret
|
||||
modbus = (GenericDevices.IModbus)TbfComponents.FindComponent(cfg.ParentName, components);
|
||||
if (modbus == null) throw new Exception("Cannot find " + Name + " parent");
|
||||
|
||||
/// Connect to handler
|
||||
//ModbusAddress.MeretRS485Address[Idx0] = ModbusAddress;
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
@@ -51,7 +48,9 @@ namespace TBF.BenchControl.Modbus.PressureMeter.Meret
|
||||
/// <returns>Pressure in mBar</returns>
|
||||
public float ReadPressure()
|
||||
{
|
||||
return (float)Config.Units.ConvertFrom(Config.Unit.kPa, receivedPressure);
|
||||
double rawPressure = Config.Units.ConvertFrom(Config.Unit.kPa, receivedPressure);
|
||||
double correctedPressure = Config.Formulas.CorrectedValue(rawPressure, Corrections);
|
||||
return (float)correctedPressure;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
{
|
||||
public partial class ConfirmationForm : Form
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(ConfirmationForm));
|
||||
|
||||
/// Set to 'true' when the form closes
|
||||
public bool Completed { get { return completed; } }
|
||||
bool completed;
|
||||
|
||||
|
||||
public ConfirmationForm(string message, Color backgroundColor)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Localize();
|
||||
messageLabel.Text = message;
|
||||
BackColor = backgroundColor;
|
||||
|
||||
float textWidth = Graphics.FromImage(new Bitmap(1, 1)).MeasureString(messageLabel.Text, messageLabel.Font).Width;
|
||||
int rqrdFormWidth = (int)textWidth + 80; /// Form width calculated from the text width
|
||||
|
||||
if (rqrdFormWidth > Width)
|
||||
{
|
||||
int shift = (rqrdFormWidth - Width) / 2;
|
||||
Width = rqrdFormWidth;
|
||||
okButton.Left += shift;
|
||||
}
|
||||
|
||||
completed = false;
|
||||
StartForceCloseHandler();
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
okButton.Text = Strings.OkBtnText;
|
||||
}
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
completed = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void MessageBoxForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
completed = true;
|
||||
}
|
||||
|
||||
#region Forced close handling
|
||||
|
||||
/// <summary>
|
||||
/// Used by CoverTest, AskYesNoOp and MessageBoxOp.
|
||||
/// </summary>
|
||||
public void OnCloseThisForm(object sender, EventArgs args)
|
||||
{
|
||||
if (CloseThisFormHandler == null) return;
|
||||
try
|
||||
{
|
||||
CloseThisFormHandler(sender, null);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.Error("CloseThisFormHandler(...) failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
public event EventHandler<EventArgs> CloseThisFormHandler;
|
||||
|
||||
public void StartForceCloseHandler()
|
||||
{
|
||||
CloseThisFormHandler += delegate(object sender, EventArgs args)
|
||||
{
|
||||
if (InvokeRequired)
|
||||
Invoke(new EventHandler<EventArgs>(OnForceClose), sender, args);
|
||||
else
|
||||
OnForceClose(sender, args);
|
||||
};
|
||||
}
|
||||
|
||||
private void OnForceClose(object sender, EventArgs args)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
{
|
||||
partial class ConfirmationForm
|
||||
{
|
||||
/// <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.okButton = new System.Windows.Forms.Button();
|
||||
this.messageLabel = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.okButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.okButton.Location = new System.Drawing.Point(177, 99);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(98, 63);
|
||||
this.okButton.TabIndex = 1;
|
||||
this.okButton.Text = "OK";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
//
|
||||
// messageLabel
|
||||
//
|
||||
this.messageLabel.AutoSize = true;
|
||||
this.messageLabel.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.messageLabel.Location = new System.Drawing.Point(34, 39);
|
||||
this.messageLabel.Name = "messageLabel";
|
||||
this.messageLabel.Size = new System.Drawing.Size(91, 23);
|
||||
this.messageLabel.TabIndex = 4;
|
||||
this.messageLabel.Text = "Message";
|
||||
//
|
||||
// ConfirmationForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.Goldenrod;
|
||||
this.ClientSize = new System.Drawing.Size(454, 201);
|
||||
this.Controls.Add(this.messageLabel);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "ConfirmationForm";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.TopMost = true;
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MessageBoxForm_FormClosing);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.Label messageLabel;
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2016 Sensus Metering Systems
|
||||
/// Copyright (c) 2015-2016 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2015-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Boxes;
|
||||
using System.Text;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
{
|
||||
public class QuidoRS : ComponentBase, IDevice
|
||||
public class QuidoRS : ComponentBase, IDevice, GenericDevices.IParallelOutput
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(QuidoRS));
|
||||
public override string ToString() { return string.Format("QuidoRS({0})", Cfg.ToString(1)); }
|
||||
@@ -17,6 +19,8 @@ namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
readonly QuidoRSCfg quidoRSCfg;
|
||||
readonly GenericDevices.IModbus modbus;
|
||||
|
||||
public QuidoVariant Variant { get { return quidoRSCfg.Variant; } }
|
||||
|
||||
private ushort currentOutputs;
|
||||
private DateTime lastOutputsChange;
|
||||
|
||||
@@ -60,12 +64,22 @@ namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
|
||||
if (modbus.ReceivedTelegrams[quidoRSCfg.ModbusAddress].Count > 0)
|
||||
{
|
||||
modbus.ReceivedTelegrams[quidoRSCfg.ModbusAddress].Dequeue();
|
||||
byte[] telegram = modbus.ReceivedTelegrams[quidoRSCfg.ModbusAddress].Dequeue();
|
||||
|
||||
if ((telegram.Length >= 8) && (telegram[1] == 0x11) && (telegram[2] == telegram.Length - 5))
|
||||
{
|
||||
int msgLen = telegram.Length - 7;
|
||||
byte modbusAddress = telegram[3];
|
||||
string msg = Encoding.ASCII.GetString(telegram, 5, msgLen);
|
||||
string s = string.Format("QuidoRS detected: Address={0}, Message={1}", modbusAddress, msg);
|
||||
Debug.WriteLine(s);
|
||||
log.Warn(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RunDeviceAfter() { }
|
||||
public void StopDevice() { }
|
||||
public void StopDevice() { SendOutputs(0); }
|
||||
public void StopDevice2() { }
|
||||
|
||||
|
||||
@@ -124,19 +138,23 @@ namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
|
||||
private void SendOutputs(ushort outputs)
|
||||
{
|
||||
byte[] msg = new byte[11];
|
||||
byte addr = quidoRSCfg.ModbusAddress;
|
||||
byte cmd = (byte)Function.ForceMultipleCoils;
|
||||
byte dataLo = (byte)(outputs & 0xFF);
|
||||
byte dataHi = (byte)(outputs >> 8);
|
||||
|
||||
msg[0] = quidoRSCfg.ModbusAddress;
|
||||
msg[1] = (byte)Function.ForceMultipleCoils;
|
||||
msg[2] = 0; /// Data Hi
|
||||
msg[3] = 0; /// Data Lo
|
||||
msg[4] = 0; /// Nr. of coils Hi
|
||||
msg[5] = 16; /// Nr. of coils Lo
|
||||
msg[6] = 2; /// Byte count
|
||||
msg[7] = (byte)(outputs & 0xFF); /// Output data Lo
|
||||
msg[8] = (byte)(outputs >> 8); /// Output data Hi
|
||||
|
||||
modbus.SendMessage(msg);
|
||||
if (quidoRSCfg.Variant == QuidoVariant.QuidoRS_2_16)
|
||||
{
|
||||
modbus.SendMessage(new byte[] { addr, cmd, 0, 0, 0, 16, 2, dataLo, dataHi, 0, 0 });
|
||||
}
|
||||
else if (quidoRSCfg.Variant == QuidoVariant.QuidoRS_4_4)
|
||||
{
|
||||
modbus.SendMessage(new byte[] { addr, cmd, 0, 0, 0, 4, 1, dataLo, 0, 0 });
|
||||
}
|
||||
else if (quidoRSCfg.Variant == QuidoVariant.QuidoRS_8_8)
|
||||
{
|
||||
modbus.SendMessage(new byte[] { addr, cmd, 0, 0, 0, 8, 1, dataLo, 0, 0 });
|
||||
}
|
||||
|
||||
lastOutputsChange = DateTime.Now;
|
||||
}
|
||||
@@ -145,22 +163,29 @@ namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
/// <summary>
|
||||
/// Events: SetOpututsDone, Error
|
||||
/// </summary>
|
||||
/// <param name="outValue">Reference to a variable for the pressure in Bar</param>
|
||||
/// <returns>SetOutputsOp instance reference casted to IOperaton</returns>
|
||||
/// <param name="outValue">Parallel output data</param>
|
||||
/// <returns>SetOutputsOp operation casted to IOperaton</returns>
|
||||
public IOperation SetOutputsOp(ushort outValue)
|
||||
{
|
||||
return new SetOutputsOp(this, outValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Events: pressureDone, Error
|
||||
/// Events: Event.None
|
||||
/// </summary>
|
||||
/// <param name="outValue">Reference to a variable for the pressure in Bar</param>
|
||||
/// <param name="setOutputsDone">Event returned when SetOutput is done</param>
|
||||
/// <returns>SetOutputsOp instance reference casted to IOperaton</returns>
|
||||
public IOperation ReadPressureOp(ushort outValue, Event setOutputsDone)
|
||||
/// <returns>ShowBenchWaitingOp operation casted to generic IOperaton</returns>
|
||||
public IOperation ShowBenchWaitingOp()
|
||||
{
|
||||
return new SetOutputsOp(this, outValue, setOutputsDone);
|
||||
return new ShowBenchWaitingOp(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Events: Event.None
|
||||
/// </summary>
|
||||
/// <returns>ShowBenchErrorOp operation casted to generic IOperaton</returns>
|
||||
public IOperation ShowBenchErrorOp()
|
||||
{
|
||||
return new ShowBenchErrorOp(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2016 Sensus Metering Systems
|
||||
/// Copyright (c) 2015-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -9,6 +9,14 @@ using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
{
|
||||
public enum QuidoVariant
|
||||
{
|
||||
QuidoRS_2_16,
|
||||
QuidoRS_4_4,
|
||||
QuidoRS_8_8,
|
||||
Count
|
||||
}
|
||||
|
||||
public class QuidoRSCfg : ComponentCfgBase, Generic.IChildComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(QuidoRSCfg) })[0];
|
||||
@@ -19,7 +27,8 @@ namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public byte ModbusAddress; /// 1..255
|
||||
public byte ModbusAddress; /// 1..247
|
||||
public QuidoVariant Variant; /// 'QuidoRS_2_16' or 'QuidoRS_8_8'
|
||||
public bool WatchdogEnabled;
|
||||
public int WatchdogBitNr; /// 0..15
|
||||
|
||||
@@ -29,7 +38,8 @@ namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
Name = "QuidoRS";
|
||||
ParentName = "Modbus";
|
||||
ModbusAddress = 49;
|
||||
WatchdogEnabled = true;
|
||||
Variant = QuidoVariant.QuidoRS_2_16;
|
||||
WatchdogEnabled = false;
|
||||
WatchdogBitNr = 4;
|
||||
}
|
||||
|
||||
@@ -41,9 +51,10 @@ namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}, ModbusAddr={1}, Parent={2}",
|
||||
return string.Format("Name={0}, ModbusAddress={1}, Variant={2}, Parent={2}",
|
||||
Name,
|
||||
ModbusAddress,
|
||||
Variant,
|
||||
(string.IsNullOrEmpty(ParentName) ? "-" : ParentName));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2015-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
@@ -46,6 +46,8 @@ namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
}
|
||||
}
|
||||
|
||||
for (QuidoVariant v = 0; v < QuidoVariant.Count; v++) variantComboBox.Items.Add(v.ToString());
|
||||
|
||||
Redraw();
|
||||
}
|
||||
|
||||
@@ -61,6 +63,7 @@ namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
nameTextBox.Text = config.Name;
|
||||
parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName;
|
||||
modbusAddressTextBox.Text = config.ModbusAddress.ToString();
|
||||
variantComboBox.Text = config.Variant.ToString();
|
||||
watchdogCheckBox.Checked = config.WatchdogEnabled;
|
||||
watchdogBitNrTextBox.Text = config.WatchdogBitNr.ToString();
|
||||
}
|
||||
@@ -70,6 +73,7 @@ namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
nameTextBox.Enabled = true;
|
||||
parentNameComboBox.Enabled = true;
|
||||
modbusAddressTextBox.Enabled = true;
|
||||
variantComboBox.Enabled = true;
|
||||
watchdogCheckBox.Enabled = true;
|
||||
watchdogBitNrTextBox.Enabled = true;
|
||||
}
|
||||
@@ -84,11 +88,16 @@ namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Invalid 'Parent Name'";
|
||||
}
|
||||
if (!int.TryParse(modbusAddressTextBox.Text, out dummy) || dummy < 0 || dummy > 255)
|
||||
if (!int.TryParse(modbusAddressTextBox.Text, out dummy) || dummy < 1 || dummy > 247)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Modbus Address' should be between 0 and 255";
|
||||
}
|
||||
if (!variantComboBox.Items.Contains(variantComboBox.Text))
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "Invalid 'Variant'";
|
||||
}
|
||||
if (!int.TryParse(watchdogBitNrTextBox.Text, out dummy) || dummy < 0 || dummy > 15)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
@@ -106,6 +115,10 @@ namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
config.Name = nameTextBox.Text;
|
||||
config.ParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text;
|
||||
config.ModbusAddress = (byte)int.Parse(modbusAddressTextBox.Text);
|
||||
for (QuidoVariant v = 0; v < QuidoVariant.Count; v++)
|
||||
{
|
||||
if (variantComboBox.Text == v.ToString()) { config.Variant = v; break; }
|
||||
}
|
||||
config.WatchdogEnabled = watchdogCheckBox.Checked;
|
||||
config.WatchdogBitNr = int.Parse(watchdogBitNrTextBox.Text);
|
||||
|
||||
|
||||
+30
-6
@@ -41,6 +41,8 @@ namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
this.watchdogCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.watchdogBitNrTextBox = new System.Windows.Forms.TextBox();
|
||||
this.watchdogBitNrLabel = new System.Windows.Forms.Label();
|
||||
this.variantComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.variantLabel = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// parentNameLabel
|
||||
@@ -84,7 +86,7 @@ namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
this.modbusAddressLabel.Location = new System.Drawing.Point(28, 108);
|
||||
this.modbusAddressLabel.Name = "modbusAddressLabel";
|
||||
this.modbusAddressLabel.Size = new System.Drawing.Size(86, 13);
|
||||
this.modbusAddressLabel.TabIndex = 7;
|
||||
this.modbusAddressLabel.TabIndex = 5;
|
||||
this.modbusAddressLabel.Text = "Modbus Address";
|
||||
//
|
||||
// modbusAddressTextBox
|
||||
@@ -93,7 +95,7 @@ namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
this.modbusAddressTextBox.Location = new System.Drawing.Point(138, 105);
|
||||
this.modbusAddressTextBox.Name = "modbusAddressTextBox";
|
||||
this.modbusAddressTextBox.Size = new System.Drawing.Size(46, 20);
|
||||
this.modbusAddressTextBox.TabIndex = 8;
|
||||
this.modbusAddressTextBox.TabIndex = 6;
|
||||
//
|
||||
// parentNameComboBox
|
||||
//
|
||||
@@ -108,7 +110,7 @@ namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
//
|
||||
this.watchdogCheckBox.AutoSize = true;
|
||||
this.watchdogCheckBox.Enabled = false;
|
||||
this.watchdogCheckBox.Location = new System.Drawing.Point(31, 131);
|
||||
this.watchdogCheckBox.Location = new System.Drawing.Point(31, 164);
|
||||
this.watchdogCheckBox.Name = "watchdogCheckBox";
|
||||
this.watchdogCheckBox.Size = new System.Drawing.Size(99, 17);
|
||||
this.watchdogCheckBox.TabIndex = 9;
|
||||
@@ -118,7 +120,7 @@ namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
// watchdogBitNrTextBox
|
||||
//
|
||||
this.watchdogBitNrTextBox.Enabled = false;
|
||||
this.watchdogBitNrTextBox.Location = new System.Drawing.Point(138, 153);
|
||||
this.watchdogBitNrTextBox.Location = new System.Drawing.Point(138, 186);
|
||||
this.watchdogBitNrTextBox.Name = "watchdogBitNrTextBox";
|
||||
this.watchdogBitNrTextBox.Size = new System.Drawing.Size(46, 20);
|
||||
this.watchdogBitNrTextBox.TabIndex = 11;
|
||||
@@ -126,16 +128,36 @@ namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
// watchdogBitNrLabel
|
||||
//
|
||||
this.watchdogBitNrLabel.AutoSize = true;
|
||||
this.watchdogBitNrLabel.Location = new System.Drawing.Point(28, 156);
|
||||
this.watchdogBitNrLabel.Location = new System.Drawing.Point(28, 189);
|
||||
this.watchdogBitNrLabel.Name = "watchdogBitNrLabel";
|
||||
this.watchdogBitNrLabel.Size = new System.Drawing.Size(81, 13);
|
||||
this.watchdogBitNrLabel.TabIndex = 10;
|
||||
this.watchdogBitNrLabel.Text = "Watchdog bit #";
|
||||
//
|
||||
// variantComboBox
|
||||
//
|
||||
this.variantComboBox.Enabled = false;
|
||||
this.variantComboBox.FormattingEnabled = true;
|
||||
this.variantComboBox.Location = new System.Drawing.Point(138, 131);
|
||||
this.variantComboBox.Name = "variantComboBox";
|
||||
this.variantComboBox.Size = new System.Drawing.Size(130, 21);
|
||||
this.variantComboBox.TabIndex = 8;
|
||||
//
|
||||
// variantLabel
|
||||
//
|
||||
this.variantLabel.AutoSize = true;
|
||||
this.variantLabel.Location = new System.Drawing.Point(28, 134);
|
||||
this.variantLabel.Name = "variantLabel";
|
||||
this.variantLabel.Size = new System.Drawing.Size(40, 13);
|
||||
this.variantLabel.TabIndex = 7;
|
||||
this.variantLabel.Text = "Variant";
|
||||
//
|
||||
// QuidoRSCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.variantComboBox);
|
||||
this.Controls.Add(this.variantLabel);
|
||||
this.Controls.Add(this.watchdogBitNrTextBox);
|
||||
this.Controls.Add(this.watchdogBitNrLabel);
|
||||
this.Controls.Add(this.watchdogCheckBox);
|
||||
@@ -147,7 +169,7 @@ namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
this.Controls.Add(this.nameLabel);
|
||||
this.Controls.Add(this.componentNameLabel);
|
||||
this.Name = "QuidoRSCfgCtrl";
|
||||
this.Size = new System.Drawing.Size(300, 200);
|
||||
this.Size = new System.Drawing.Size(374, 268);
|
||||
this.Load += new System.EventHandler(this.QuidoRSCfgCtrl_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
@@ -166,5 +188,7 @@ namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
private System.Windows.Forms.CheckBox watchdogCheckBox;
|
||||
private System.Windows.Forms.TextBox watchdogBitNrTextBox;
|
||||
private System.Windows.Forms.Label watchdogBitNrLabel;
|
||||
private System.Windows.Forms.ComboBox variantComboBox;
|
||||
private System.Windows.Forms.Label variantLabel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2015 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using log4net;
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using log4net;
|
||||
using TBF.Boxes;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
{
|
||||
public class ShowBenchErrorOp : IOperation
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(ShowBenchErrorOp));
|
||||
public override string ToString() { return string.Format("ShowBenchErrorOp(.)"); }
|
||||
|
||||
const ushort BenchReadyValue = 0x01;
|
||||
const ushort BenchErrorValue = 0x06;
|
||||
const ushort BenchConfirmedValue = 0x02;
|
||||
|
||||
/// Set by the constructor
|
||||
readonly QuidoRS quidoRS;
|
||||
|
||||
|
||||
|
||||
bool confirmed = false;
|
||||
///
|
||||
ConfirmationForm confirmationForm;
|
||||
///
|
||||
delegate void MessageBoxFormDlgt(ShowBenchErrorOp myRef);
|
||||
///
|
||||
void OpenFormDlg(ShowBenchErrorOp myRef)
|
||||
{
|
||||
myRef.confirmationForm = new ConfirmationForm(Strings.Mute_alarm, Color.Yellow);
|
||||
confirmationForm.Show();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Events: Event.None
|
||||
/// </summary>
|
||||
/// <param name="quidoRS">Pressure meter reference</param>
|
||||
public ShowBenchErrorOp(QuidoRS quidoRS)
|
||||
{
|
||||
if (quidoRS == null) throw new ArgumentNullException("quidoRS");
|
||||
this.quidoRS = quidoRS;
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
log.WarnFormat("ShowBenchErrorOp.Start()");
|
||||
quidoRS.SetOutputs(BenchErrorValue);
|
||||
confirmed = false;
|
||||
Program.MainWnd.Invoke(new MessageBoxFormDlgt(OpenFormDlg), this);
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
public Event Run()
|
||||
{
|
||||
if (confirmed || confirmationForm.Completed)
|
||||
{
|
||||
log.WarnFormat("ShowBenchWaitingOp.Run() --> Confirmed");
|
||||
quidoRS.SetOutputs(BenchConfirmedValue);
|
||||
|
||||
confirmed = true;
|
||||
confirmationForm = null;
|
||||
}
|
||||
|
||||
return Event.None;
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
{
|
||||
log.WarnFormat("ShowBenchErrorOp.Stop()");
|
||||
quidoRS.SetOutputs(BenchReadyValue);
|
||||
|
||||
if (confirmationForm != null)
|
||||
{
|
||||
confirmationForm.OnCloseThisForm(this, null);
|
||||
confirmationForm = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using log4net;
|
||||
using TBF.Boxes;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.Modbus.QuidoRS
|
||||
{
|
||||
public class ShowBenchWaitingOp : IOperation
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(ShowBenchWaitingOp));
|
||||
public override string ToString() { return string.Format("ShowBenchWaitingOp(.)"); }
|
||||
|
||||
const ushort BenchReadyValue = 0x01;
|
||||
const ushort BenchWaitingValue = 0x06;
|
||||
const ushort BenchConfirmedValue = 0x02;
|
||||
|
||||
/// Set by the constructor
|
||||
readonly QuidoRS quidoRS;
|
||||
|
||||
|
||||
|
||||
bool confirmed = false;
|
||||
///
|
||||
ConfirmationForm confirmationForm;
|
||||
///
|
||||
delegate void MessageBoxFormDlgt(ShowBenchWaitingOp myRef);
|
||||
///
|
||||
void OpenFormDlg(ShowBenchWaitingOp myRef)
|
||||
{
|
||||
myRef.confirmationForm = new ConfirmationForm(Strings.Mute_alarm, Color.Yellow);
|
||||
confirmationForm.Show();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Events: Event.None
|
||||
/// </summary>
|
||||
/// <param name="quidoRS">Pressure meter reference</param>
|
||||
public ShowBenchWaitingOp(QuidoRS quidoRS)
|
||||
{
|
||||
if (quidoRS == null) throw new ArgumentNullException("quidoRS");
|
||||
this.quidoRS = quidoRS;
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
log.WarnFormat("ShowBenchWaitingOp.Start()");
|
||||
quidoRS.SetOutputs(BenchWaitingValue);
|
||||
confirmed = false;
|
||||
Program.MainWnd.Invoke(new MessageBoxFormDlgt(OpenFormDlg), this);
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
public Event Run()
|
||||
{
|
||||
if (confirmed || confirmationForm.Completed)
|
||||
{
|
||||
log.WarnFormat("ShowBenchWaitingOp.Run() --> Confirmed");
|
||||
quidoRS.SetOutputs(BenchConfirmedValue);
|
||||
|
||||
confirmed = true;
|
||||
confirmationForm = null;
|
||||
}
|
||||
|
||||
return Event.None;
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
{
|
||||
log.WarnFormat("ShowBenchWaitingOp.Stop()");
|
||||
quidoRS.SetOutputs(BenchReadyValue);
|
||||
|
||||
if (confirmationForm != null)
|
||||
{
|
||||
confirmationForm.OnCloseThisForm(this, null);
|
||||
confirmationForm = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+63
-17
@@ -31,40 +31,80 @@ namespace TBF.BenchControl.Operations
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.continueButton = new System.Windows.Forms.Button();
|
||||
this.messageLabel = new System.Windows.Forms.Label();
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.abortButton = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// okButton
|
||||
// continueButton
|
||||
//
|
||||
this.okButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.okButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.okButton.Location = new System.Drawing.Point(452, 523);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(98, 63);
|
||||
this.okButton.TabIndex = 1;
|
||||
this.okButton.Text = "OK";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.Click += new System.EventHandler(this.okButton_Click);
|
||||
this.continueButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.continueButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.continueButton.Location = new System.Drawing.Point(224, 23);
|
||||
this.continueButton.Name = "continueButton";
|
||||
this.continueButton.Size = new System.Drawing.Size(254, 63);
|
||||
this.continueButton.TabIndex = 1;
|
||||
this.continueButton.Text = "Continue";
|
||||
this.continueButton.UseVisualStyleBackColor = true;
|
||||
this.continueButton.Click += new System.EventHandler(this.continueButton_Click);
|
||||
//
|
||||
// messageLabel
|
||||
//
|
||||
this.messageLabel.AutoSize = true;
|
||||
this.messageLabel.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.messageLabel.Location = new System.Drawing.Point(34, 29);
|
||||
this.messageLabel.Location = new System.Drawing.Point(44, 37);
|
||||
this.messageLabel.Name = "messageLabel";
|
||||
this.messageLabel.Size = new System.Drawing.Size(91, 23);
|
||||
this.messageLabel.TabIndex = 4;
|
||||
this.messageLabel.Text = "Message";
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.AutoScroll = true;
|
||||
this.splitContainer1.Panel1.BackColor = System.Drawing.Color.OrangeRed;
|
||||
this.splitContainer1.Panel1.Controls.Add(this.messageLabel);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.BackColor = System.Drawing.Color.OrangeRed;
|
||||
this.splitContainer1.Panel2.Controls.Add(this.abortButton);
|
||||
this.splitContainer1.Panel2.Controls.Add(this.continueButton);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(1002, 617);
|
||||
this.splitContainer1.SplitterDistance = 508;
|
||||
this.splitContainer1.SplitterWidth = 1;
|
||||
this.splitContainer1.TabIndex = 5;
|
||||
//
|
||||
// abortButton
|
||||
//
|
||||
this.abortButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.abortButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.abortButton.Location = new System.Drawing.Point(510, 23);
|
||||
this.abortButton.Name = "abortButton";
|
||||
this.abortButton.Size = new System.Drawing.Size(254, 63);
|
||||
this.abortButton.TabIndex = 2;
|
||||
this.abortButton.Text = "Abort cycle";
|
||||
this.abortButton.UseVisualStyleBackColor = true;
|
||||
this.abortButton.Click += new System.EventHandler(this.abortButton_Click);
|
||||
//
|
||||
// LargeMessageBoxForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.Goldenrod;
|
||||
this.BackColor = System.Drawing.Color.OrangeRed;
|
||||
this.ClientSize = new System.Drawing.Size(1002, 617);
|
||||
this.Controls.Add(this.messageLabel);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.Controls.Add(this.splitContainer1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
@@ -73,14 +113,20 @@ namespace TBF.BenchControl.Operations
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.TopMost = true;
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MessageBoxForm_FormClosing);
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel1.PerformLayout();
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.Button continueButton;
|
||||
private System.Windows.Forms.Label messageLabel;
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private System.Windows.Forms.Button abortButton;
|
||||
}
|
||||
}
|
||||
@@ -13,9 +13,9 @@ namespace TBF.BenchControl.Operations
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(LargeMessageBoxForm));
|
||||
|
||||
/// Set to 'true' when the form closes
|
||||
public bool Completed { get { return completed; } }
|
||||
bool completed;
|
||||
/// One of the following two variables is 'true' when the form closes
|
||||
public bool CompletedContinue;
|
||||
public bool CompletedAbort;
|
||||
|
||||
|
||||
public LargeMessageBoxForm(string message, Color backgroundColor)
|
||||
@@ -34,27 +34,38 @@ namespace TBF.BenchControl.Operations
|
||||
{
|
||||
int shift = (rqrdFormWidth - Width) / 2;
|
||||
Width = rqrdFormWidth;
|
||||
okButton.Left += shift;
|
||||
continueButton.Left += shift;
|
||||
}
|
||||
|
||||
completed = false;
|
||||
CompletedContinue = false;
|
||||
CompletedAbort = false;
|
||||
StartForceCloseHandler();
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
okButton.Text = Strings.OkBtnText;
|
||||
continueButton.Text = Strings.Continue;
|
||||
abortButton.Text = Strings.Abort_cycle;
|
||||
}
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
private void continueButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
completed = true;
|
||||
CompletedContinue = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void abortButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
CompletedAbort = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void MessageBoxForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
completed = true;
|
||||
if (!CompletedContinue && !CompletedAbort)
|
||||
{
|
||||
CompletedContinue = true; /// Default action is 'Continue'
|
||||
}
|
||||
}
|
||||
|
||||
#region Forced close handling
|
||||
|
||||
@@ -53,14 +53,9 @@ namespace TBF.BenchControl.Operations
|
||||
/// <returns>Event.ResultsPrinted</returns>
|
||||
public Event Run()
|
||||
{
|
||||
if (completed || form.Completed)
|
||||
{
|
||||
completed = true;
|
||||
form = null;
|
||||
return Event.OK;
|
||||
}
|
||||
|
||||
return Event.None;
|
||||
if (form.CompletedContinue) return Event.Continue;
|
||||
if (form.CompletedAbort) return Event.Abort;
|
||||
return Event.None;
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
|
||||
@@ -19,6 +19,8 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
||||
|
||||
public string Workplace;
|
||||
public string ConnStr;
|
||||
public bool CheckPreviousRecords;
|
||||
public bool SaveTracingRecords;
|
||||
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
@@ -27,7 +29,9 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
||||
ParentName = string.Empty;
|
||||
Workplace = "WR10";
|
||||
ConnStr = "SERVER=10.42.128.16; DATABASE=st_wr_shared_config; UID=u9305784; PASSWORD=p89344390; CHARSET=utf8;";
|
||||
}
|
||||
CheckPreviousRecords = true;
|
||||
SaveTracingRecords = true;
|
||||
}
|
||||
|
||||
public MonitoringCfg(string name, IComponentFactory factory)
|
||||
: this()
|
||||
@@ -38,7 +42,12 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}, Workplace={1}", Name, Workplace);
|
||||
return string.Format("Name={0}, Workplace={1}, CheckPreviousRecords={2}, SaveTracingRecords={3}, ConnStr={4}",
|
||||
Name,
|
||||
Workplace,
|
||||
CheckPreviousRecords,
|
||||
SaveTracingRecords,
|
||||
ConnStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
///
|
||||
/// Copyright (c) 2018 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2018-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using log4net;
|
||||
using NHibernate;
|
||||
using NHibernate.Criterion;
|
||||
using Config.Entities;
|
||||
using TracingDB.Entities;
|
||||
|
||||
@@ -16,37 +18,61 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
||||
Error,
|
||||
}
|
||||
|
||||
public class Tracing : ComponentBase, IOperation, GenericDevices.IResultsWriter, Generic.IDevice
|
||||
class DateTimeComparer : IComparer<DateTime>
|
||||
{
|
||||
public int Compare(DateTime x, DateTime y)
|
||||
{
|
||||
return DateTime.Compare(x, y);
|
||||
}
|
||||
}
|
||||
|
||||
public class Tracing : ComponentBase, IOperation, GenericDevices.IResultsWriter, GenericDevices.IStartInfoReader, Generic.IDevice
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Tracing));
|
||||
public override string ToString() { return string.Format("Tracing({0})", Cfg.ToString(1)); }
|
||||
|
||||
|
||||
public const string WorkstepName = "Test_bench";
|
||||
|
||||
|
||||
MonitoringCfg tracingCfg;
|
||||
string workplace { get { return tracingCfg.Workplace; } }
|
||||
|
||||
|
||||
enum CurrentOp
|
||||
{
|
||||
None,
|
||||
SaveRecords,
|
||||
CheckPreviousRecords,
|
||||
SaveTracingRecords,
|
||||
}
|
||||
|
||||
///
|
||||
CurrentOp currentOp;
|
||||
bool opCompleted;
|
||||
bool anyError;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Watermeters to check at the beginning of the cycle
|
||||
/// </summary>
|
||||
Results.Entities.WaterMeter[] waterMeters;
|
||||
|
||||
/// <summary>
|
||||
/// Results to print
|
||||
/// Data (tracing records) to write at the end of cycle
|
||||
/// </summary>
|
||||
Results.Entities.Batch batch;
|
||||
|
||||
ISessionFactory sessionFactory; /// Factory to create database sessions initialized in the constructor
|
||||
|
||||
ISessionFactory sessionFactory; /// Factory to create database sessions that is initialized in the constructor
|
||||
IList<Process> processes;
|
||||
Dictionary<int, Process> processDictionary;
|
||||
Dictionary<int, IList<Workstep>> workstepsDictionary;
|
||||
|
||||
///
|
||||
/// Previous workstep verification info
|
||||
///
|
||||
Process currentProcess; /// Currently used process
|
||||
Workstep currentWorkstep; /// Currently used workstep of this test bench
|
||||
Workstep verifiedWorkstep;
|
||||
Part verifiedPart; /// Applicable when verifyReferencePart == false
|
||||
bool verifyReferencePart;
|
||||
|
||||
|
||||
public Tracing() {}
|
||||
@@ -67,36 +93,33 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
||||
///
|
||||
/// Session factory is used to create database sessions
|
||||
///
|
||||
sessionFactory = FluentNHibernate.Cfg.Fluently
|
||||
.Configure()
|
||||
.Database(FluentNHibernate.Cfg.Db.MySQLConfiguration.Standard.ConnectionString(tracingCfg.ConnStr))
|
||||
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<TracingDB.Entities.Process>())
|
||||
.ExposeConfiguration(TracingDB.DB.BuildSchema)
|
||||
.BuildSessionFactory();
|
||||
sessionFactory = FluentNHibernate.Cfg.Fluently.Configure()
|
||||
.Database(FluentNHibernate.Cfg.Db.MySQLConfiguration.Standard.ConnectionString(tracingCfg.ConnStr))
|
||||
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<TracingDB.Entities.Process>())
|
||||
.ExposeConfiguration(TracingDB.DB.BuildSchema)
|
||||
.BuildSessionFactory();
|
||||
///
|
||||
/// Register this test bench in the tracing DB for approx. 2 weeks
|
||||
///
|
||||
ISession session = sessionFactory.OpenSession();
|
||||
|
||||
using (ISession session = sessionFactory.OpenSession())
|
||||
{
|
||||
///
|
||||
/// Read processes and worksteps from the database (this verifies DB connection as well)
|
||||
///
|
||||
log.WarnFormat("Reading processes/worksteps from production tracing DB started");
|
||||
ReadProcessesFromDB(session);
|
||||
log.WarnFormat("Reading processes/worksteps from production tracing DB completed");
|
||||
TracingDB.DB.RegisterWorkplace(session,
|
||||
workplace,
|
||||
Users.GlobalData.GetCurrentUserName(),
|
||||
"1.2.3.4",
|
||||
"<multiple>",
|
||||
WorkstepName,
|
||||
DateTime.Now + new TimeSpan(15, 0, 0, 0));
|
||||
session.Flush();
|
||||
session.Close();
|
||||
if (session != null) session.Dispose();
|
||||
|
||||
///
|
||||
/// Register the test bench workplace
|
||||
///
|
||||
TracingDB.DB.RegisterWorkplace(session,
|
||||
workplace,
|
||||
Users.GlobalData.GetCurrentUserName(),
|
||||
"1.2.3.4",
|
||||
"<multiple>",
|
||||
WorkstepName,
|
||||
DateTime.Now + new TimeSpan(8, 0, 0));
|
||||
session.Flush();
|
||||
}
|
||||
currentProcess = null;
|
||||
}
|
||||
|
||||
///
|
||||
public void RunDeviceBefore() { }
|
||||
public void RunDeviceAfter() { }
|
||||
///
|
||||
public void StopDevice()
|
||||
{
|
||||
if (tracingCfg.DebugLevel == DebugMode.Simulate) return;
|
||||
@@ -107,13 +130,31 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
||||
session.Flush();
|
||||
}
|
||||
}
|
||||
|
||||
public void StopDevice2() {}
|
||||
|
||||
|
||||
public void RunDeviceBefore() {}
|
||||
public void RunDeviceAfter() {}
|
||||
|
||||
/// <summary>
|
||||
/// Reads information on start of a cycle, Events: Event.InfoRead
|
||||
/// </summary>
|
||||
/// <param name="waterMeters">Results of water meters</param>
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ReadStartInfoOp(Results.Entities.WaterMeter[] waterMeters)
|
||||
{
|
||||
if (!tracingCfg.CheckPreviousRecords)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else if (currentOp != CurrentOp.None)
|
||||
{
|
||||
throw new Exception("Sequence error");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.waterMeters = waterMeters;
|
||||
currentOp = CurrentOp.CheckPreviousRecords;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes the test cycle results into a file, Events: Event.ResultsWritten
|
||||
@@ -123,16 +164,23 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation WriteResultsOp(Results.Entities.Batch batch)
|
||||
{
|
||||
if (currentOp != CurrentOp.None)
|
||||
if (!tracingCfg.SaveTracingRecords)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else if (currentOp != CurrentOp.None)
|
||||
{
|
||||
throw new Exception("Sequence error");
|
||||
}
|
||||
else
|
||||
currentOp = CurrentOp.SaveRecords;
|
||||
|
||||
this.batch = batch;
|
||||
|
||||
return this;
|
||||
{
|
||||
this.batch = batch;
|
||||
currentOp = CurrentOp.SaveTracingRecords;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
@@ -144,50 +192,47 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
||||
/// <returns>Event.ResultsWritten or Event.Error</returns>
|
||||
public Event Run()
|
||||
{
|
||||
if (tracingCfg.DebugLevel == DebugMode.Simulate || batch.WaterMeters.Count == 0)
|
||||
if (currentOp == CurrentOp.CheckPreviousRecords)
|
||||
{
|
||||
opCompleted = true;
|
||||
return Event.ResultsWritten;
|
||||
}
|
||||
|
||||
if (currentOp == CurrentOp.SaveRecords)
|
||||
{
|
||||
if (!opCompleted)
|
||||
if (tracingCfg.DebugLevel == DebugMode.Simulate)
|
||||
{
|
||||
ITransaction transaction = null;
|
||||
try
|
||||
{
|
||||
ISession session = sessionFactory.OpenSession();
|
||||
transaction = session.BeginTransaction();
|
||||
|
||||
int wrCount = WriteResultsToDatabase(session, batch);
|
||||
transaction.Commit();
|
||||
session.Flush();
|
||||
opCompleted = true;
|
||||
|
||||
log.ErrorFormat("Batch {0}: {1} of {2} watermeters written to production tracing DB",
|
||||
batch.BatchNr, wrCount, batch.WaterMeters.Count);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
if (transaction != null && !transaction.WasCommitted) transaction.Rollback();
|
||||
anyError = true;
|
||||
|
||||
log.WarnFormat("Failed to write results of batch {0} to production tracing DB: {1}",
|
||||
batch.BatchNr, exc.Message);
|
||||
}
|
||||
return Event.InfoRead;
|
||||
}
|
||||
else if (!opCompleted)
|
||||
{
|
||||
log.WarnFormat("{0} : Run() : currentOp = {1}", Name, currentOp);
|
||||
opCompleted = true;
|
||||
if (CheckPreviousRecords(waterMeters) != Retv.OK) anyError = true;
|
||||
return anyError ? Event.InfoNotRead : Event.InfoRead;
|
||||
}
|
||||
|
||||
if (anyError)
|
||||
return Event.ResultsNotWritten;
|
||||
else
|
||||
{
|
||||
return anyError ? Event.InfoNotRead : Event.InfoRead;
|
||||
}
|
||||
}
|
||||
else if (currentOp == CurrentOp.SaveTracingRecords)
|
||||
{
|
||||
if (tracingCfg.DebugLevel == DebugMode.Simulate || batch.WaterMeters.Count == 0)
|
||||
{
|
||||
return Event.ResultsWritten;
|
||||
}
|
||||
else if (!opCompleted)
|
||||
{
|
||||
log.WarnFormat("{0} : Run() : currentOp = {1}", Name, currentOp);
|
||||
opCompleted = true;
|
||||
if (SaveTracingRecords(batch) != Retv.OK) anyError = true;
|
||||
return anyError ? Event.ResultsNotWritten : Event.ResultsWritten;
|
||||
}
|
||||
else
|
||||
{
|
||||
return anyError ? Event.ResultsNotWritten : Event.ResultsWritten;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Event.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
@@ -196,19 +241,170 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
||||
}
|
||||
|
||||
|
||||
Retv CheckPreviousRecords(Results.Entities.WaterMeter[] waterMeters)
|
||||
{
|
||||
Retv retVal = Retv.Error;
|
||||
|
||||
using (ISession session = sessionFactory.OpenSession())
|
||||
{
|
||||
for (int i = 0; i < waterMeters.Length; i++)
|
||||
{
|
||||
Results.Entities.WaterMeter wm = waterMeters[i];
|
||||
|
||||
if ((wm != null) && !string.IsNullOrEmpty(wm.SerialNr))
|
||||
{
|
||||
CheckPreviousRecordOfSingleWM(session, wm);
|
||||
}
|
||||
}
|
||||
|
||||
retVal = Retv.OK;
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
Retv CheckPreviousRecordOfSingleWM(ISession session, Results.Entities.WaterMeter wm)
|
||||
{
|
||||
///
|
||||
/// Get all already existing reference records with Code == wm.SerialNr, refRecords[0] will be the most recent one
|
||||
///
|
||||
ReferenceRecord refRecord = null;
|
||||
Workstep workstep = null;
|
||||
|
||||
ProjectionList projections = Projections.ProjectionList();
|
||||
projections.Add(Projections.Property(() => refRecord.Id)); /// rslt[0] = reference record ID
|
||||
projections.Add(Projections.Property(() => workstep.Id)); /// rslt[1] = workstep ID
|
||||
projections.Add(Projections.Property(() => refRecord.Process.Id)); /// rslt[2] = process ID
|
||||
projections.Add(Projections.Property(() => refRecord.TimeStamp)); /// rslt[3] = reference record time stamp
|
||||
|
||||
///
|
||||
/// Get all reference records with Code == SerialNr from all worksteps different from 'Test_bench'
|
||||
///
|
||||
IList<object[]> results = session.QueryOver<ReferenceRecord>(() => refRecord)
|
||||
.Where(rr => (rr.Code == wm.SerialNr))
|
||||
.JoinQueryOver<Workstep>(rr => rr.Workstep, () => workstep)
|
||||
.And(ws => (ws.Name != WorkstepName))
|
||||
.Select(projections)
|
||||
.List<object[]>();
|
||||
|
||||
if (results.Count == 0)
|
||||
{
|
||||
/// No records found => IsLastRecordOk = false
|
||||
wm.ProcessId = 0;
|
||||
wm.IsLastRecordOk = false;
|
||||
return Retv.OK;
|
||||
}
|
||||
|
||||
///
|
||||
/// Get processId of the last record
|
||||
///
|
||||
int processId = 0;
|
||||
DateTime lastTimeStamp = DateTime.MinValue;
|
||||
foreach (var rslt in results)
|
||||
{
|
||||
if (DateTime.Compare((DateTime)rslt[3], lastTimeStamp) > 0)
|
||||
{
|
||||
lastTimeStamp = (DateTime)rslt[3];
|
||||
processId = (int)rslt[2];
|
||||
}
|
||||
}
|
||||
|
||||
if (processId == 0) return Retv.Error; /// This should never happen
|
||||
|
||||
|
||||
if ((currentProcess == null) || (currentProcess.Id != processId))
|
||||
{
|
||||
///
|
||||
/// Process changed ==> update currentProcess / currentWorkstep / verifiedWorkstep / verifiedPart / verifyReferencePart
|
||||
///
|
||||
var processes = session.QueryOver<Process>()
|
||||
.Where(p => (p.Id == processId))
|
||||
.List();
|
||||
|
||||
if (processes.Count != 1) return Retv.Error;
|
||||
|
||||
IList<Workstep> worksteps = session.QueryOver<Workstep>()
|
||||
.Where(ws => (ws.Process == processes[0]))
|
||||
.And( ws => (ws.Name == WorkstepName))
|
||||
.List();
|
||||
|
||||
if (worksteps.Count != 1) return Retv.Error;
|
||||
|
||||
Workstep vWS;
|
||||
Part vP;
|
||||
bool vRP;
|
||||
///
|
||||
if (!TracingDB.DB.AnalyzeProcess(session, processes[0], worksteps[0], out vWS, out vRP, out vP))
|
||||
{
|
||||
return Retv.Error; /// Unable to
|
||||
}
|
||||
|
||||
currentProcess = processes[0];
|
||||
currentWorkstep = worksteps[0];
|
||||
verifiedWorkstep = vWS;
|
||||
verifiedPart = vP;
|
||||
verifyReferencePart = vRP;
|
||||
}
|
||||
|
||||
wm.ProcessId = currentProcess.Id;
|
||||
wm.IsLastRecordOk = false;
|
||||
foreach (var rslt in results)
|
||||
{
|
||||
if ((verifiedWorkstep.Id == (int)rslt[1]) && (processId == (int)rslt[2]))
|
||||
{
|
||||
wm.IsLastRecordOk = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return Retv.OK;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Write results of a batch of water meters to the DB
|
||||
/// </summary>
|
||||
/// <param name="session">DB session</param>
|
||||
/// <param name="batch">Batch entity</param>
|
||||
int WriteResultsToDatabase(ISession session, Results.Entities.Batch batch)
|
||||
Retv SaveTracingRecords(Results.Entities.Batch batch)
|
||||
{
|
||||
int wrCount = 0;
|
||||
foreach (var wMtr in batch.WaterMeters)
|
||||
{
|
||||
wrCount += SaveSingleWM2DB(session, wMtr);
|
||||
}
|
||||
return wrCount;
|
||||
ITransaction transaction = null;
|
||||
ISession session = null;
|
||||
try
|
||||
{
|
||||
session = sessionFactory.OpenSession();
|
||||
transaction = session.BeginTransaction();
|
||||
|
||||
int writtenRecordsCount = 0;
|
||||
foreach (var wMtr in batch.WaterMeters)
|
||||
{
|
||||
writtenRecordsCount += SaveSingleWM2DB(session, wMtr);
|
||||
}
|
||||
transaction.Commit();
|
||||
session.Flush();
|
||||
|
||||
log.ErrorFormat("Batch {0}: {1} of {2} watermeters written to production tracing DB",
|
||||
batch.BatchNr, writtenRecordsCount, batch.WaterMeters.Count);
|
||||
|
||||
return Retv.OK;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
if (transaction != null && !transaction.WasCommitted) transaction.Rollback();
|
||||
|
||||
log.WarnFormat("Failed to write results of batch {0} to production tracing DB: {1}",
|
||||
batch.BatchNr, exc.Message);
|
||||
|
||||
return Retv.Error;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (session != null)
|
||||
{
|
||||
session.Close();
|
||||
session.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -220,36 +416,67 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
||||
/// <returns>Number of written reference record</returns>
|
||||
int SaveSingleWM2DB(ISession session, Results.Entities.WaterMeter wm)
|
||||
{
|
||||
if (string.IsNullOrEmpty(wm.SerialNr)) return 0; /// Without PCB number there is no DB activity
|
||||
|
||||
///
|
||||
/// Get all already existing reference records with Code == wm.SerialNr, refRecords[0] will be the most recent one
|
||||
///
|
||||
IList<ReferenceRecord> refRecords;
|
||||
int trialsCount = 0;
|
||||
do
|
||||
if (string.IsNullOrEmpty(wm.SerialNr))
|
||||
{
|
||||
if (trialsCount > 0) ReadProcessesFromDB(session);
|
||||
|
||||
refRecords = session.QueryOver<ReferenceRecord>()
|
||||
.Where(rr => (rr.Code == wm.SerialNr))
|
||||
.OrderBy(rr => rr.TimeStamp).Desc
|
||||
.List();
|
||||
trialsCount++;
|
||||
/// Without PCB number there is no DB activity
|
||||
return 0;
|
||||
}
|
||||
while (refRecords.Count == 0 && trialsCount <= 2);
|
||||
|
||||
///
|
||||
/// Save a new reference record from this test bench if workstep "Test_bench" is defined in the obtained WM process
|
||||
///
|
||||
IList<Workstep> worksteps;
|
||||
if ((refRecords.Count > 0) && workstepsDictionary.TryGetValue(refRecords[0].Process.Id, out worksteps) && (worksteps.Count == 1))
|
||||
else if ((currentProcess != null) && (wm.ProcessId == currentProcess.Id))
|
||||
{
|
||||
session.SaveOrUpdate(new ReferenceRecord(refRecords[0].Process, worksteps[0], wm.SerialNr, Users.GlobalData.CurrentUser.UserName, workplace, wm.Passed ? 0 : 1));
|
||||
/// Process is already loaded => save a reference record for this WM
|
||||
session.SaveOrUpdate(new ReferenceRecord(currentProcess, currentWorkstep, wm.SerialNr, Users.GlobalData.CurrentUser.UserName, workplace, wm.Passed ? 0 : 1));
|
||||
return 1;
|
||||
}
|
||||
else if (wm.ProcessId != 0)
|
||||
{
|
||||
/// Process ID is already known, however process and workstep have to be loaded
|
||||
IList<Process> processes = session.QueryOver<Process>()
|
||||
.Where(x => (x.Id == wm.ProcessId))
|
||||
.List();
|
||||
if (processes.Count != 1) return 0;
|
||||
|
||||
return 0;
|
||||
foreach (var ws in processes[0].Worksteps)
|
||||
{
|
||||
if (ws.Name == WorkstepName)
|
||||
{
|
||||
session.SaveOrUpdate(new ReferenceRecord(processes[0], ws, wm.SerialNr, Users.GlobalData.CurrentUser.UserName, workplace, wm.Passed ? 0 : 1));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0; /// No workste with 'WorkstepName' found
|
||||
}
|
||||
else
|
||||
{
|
||||
///
|
||||
/// Process ID is unknown => do everything from scratch
|
||||
///
|
||||
|
||||
/// Get all already existing reference records with Code == wm.SerialNr, refRecords[0] will be the most recent one
|
||||
IList<ReferenceRecord> refRecords;
|
||||
int trialsCount = 0;
|
||||
do
|
||||
{
|
||||
if (trialsCount > 0) ReadProcessesFromDB(session);
|
||||
|
||||
refRecords = session.QueryOver<ReferenceRecord>()
|
||||
.Where(rr => (rr.Code == wm.SerialNr))
|
||||
.OrderBy(rr => rr.TimeStamp).Desc
|
||||
.List();
|
||||
trialsCount++;
|
||||
}
|
||||
while (refRecords.Count == 0 && trialsCount <= 2);
|
||||
|
||||
/// Save a new reference record from this test bench if workstep "Test_bench" is defined in the obtained WM process
|
||||
IList<Workstep> worksteps;
|
||||
if ((refRecords.Count > 0) && workstepsDictionary.TryGetValue(refRecords[0].Process.Id, out worksteps) && (worksteps.Count == 1))
|
||||
{
|
||||
session.SaveOrUpdate(new ReferenceRecord(refRecords[0].Process, worksteps[0], wm.SerialNr, Users.GlobalData.CurrentUser.UserName, workplace, wm.Passed ? 0 : 1));
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -259,12 +486,17 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
||||
/// <param name="session">DB session</param>
|
||||
void ReadProcessesFromDB(ISession session)
|
||||
{
|
||||
processes = session.QueryOver<Process>().List();
|
||||
processes = session.QueryOver<Process>()
|
||||
.List();
|
||||
|
||||
processDictionary = new Dictionary<int, Process>();
|
||||
workstepsDictionary = new Dictionary<int, IList<Workstep>>();
|
||||
///
|
||||
foreach (var pr in processes)
|
||||
{
|
||||
IList<Workstep> worksteps = session.QueryOver<Workstep>().Where(ws => ((ws.Process == pr) && (ws.Name == WorkstepName))).List();
|
||||
IList<Workstep> worksteps = session.QueryOver<Workstep>()
|
||||
.Where(ws => ((ws.Process == pr) && (ws.Name == WorkstepName)))
|
||||
.List();
|
||||
processDictionary.Add(pr.Id, pr);
|
||||
workstepsDictionary.Add(pr.Id, worksteps);
|
||||
}
|
||||
|
||||
@@ -45,14 +45,18 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
||||
nameTextBox.Text = config.Name;
|
||||
workplaceTextBox.Text = config.Workplace;
|
||||
connStrTextBox.Text = config.ConnStr;
|
||||
}
|
||||
checkPreviousRecordsCheckBox.Checked = config.CheckPreviousRecords;
|
||||
saveTracingRecordsCheckBox.Checked = config.SaveTracingRecords;
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
{
|
||||
nameTextBox.Enabled = true;
|
||||
workplaceTextBox.Enabled = true;
|
||||
connStrTextBox.Enabled = true;
|
||||
}
|
||||
checkPreviousRecordsCheckBox.Enabled = true;
|
||||
saveTracingRecordsCheckBox.Enabled = true;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
||||
{
|
||||
@@ -68,11 +72,13 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
||||
if (config.Name != nameTextBox.Text)
|
||||
{
|
||||
config.Name = nameTextBox.Text;
|
||||
flags |= CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd;
|
||||
flags |= (CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
|
||||
}
|
||||
|
||||
flags |= UpdateDifferent(ref config.Workplace, workplaceTextBox.Text, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
|
||||
flags |= UpdateDifferent(ref config.ConnStr, connStrTextBox.Text, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
|
||||
flags |= UpdateDifferent(ref config.CheckPreviousRecords, checkPreviousRecordsCheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
|
||||
flags |= UpdateDifferent(ref config.SaveTracingRecords, saveTracingRecordsCheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,8 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
||||
this.workplaceLabel = new System.Windows.Forms.Label();
|
||||
this.connStrTextBox = new System.Windows.Forms.TextBox();
|
||||
this.connStrLabel = new System.Windows.Forms.Label();
|
||||
this.saveTracingRecordsCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.checkPreviousRecordsCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// nameTextBox
|
||||
@@ -100,10 +102,34 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
||||
this.connStrLabel.TabIndex = 21;
|
||||
this.connStrLabel.Text = "Connection string";
|
||||
//
|
||||
// saveTracingRecordsCheckBox
|
||||
//
|
||||
this.saveTracingRecordsCheckBox.AutoSize = true;
|
||||
this.saveTracingRecordsCheckBox.Enabled = false;
|
||||
this.saveTracingRecordsCheckBox.Location = new System.Drawing.Point(110, 154);
|
||||
this.saveTracingRecordsCheckBox.Name = "saveTracingRecordsCheckBox";
|
||||
this.saveTracingRecordsCheckBox.Size = new System.Drawing.Size(177, 17);
|
||||
this.saveTracingRecordsCheckBox.TabIndex = 24;
|
||||
this.saveTracingRecordsCheckBox.Text = "Save production tracing records";
|
||||
this.saveTracingRecordsCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// checkPreviousRecordsCheckBox
|
||||
//
|
||||
this.checkPreviousRecordsCheckBox.AutoSize = true;
|
||||
this.checkPreviousRecordsCheckBox.Enabled = false;
|
||||
this.checkPreviousRecordsCheckBox.Location = new System.Drawing.Point(110, 131);
|
||||
this.checkPreviousRecordsCheckBox.Name = "checkPreviousRecordsCheckBox";
|
||||
this.checkPreviousRecordsCheckBox.Size = new System.Drawing.Size(138, 17);
|
||||
this.checkPreviousRecordsCheckBox.TabIndex = 23;
|
||||
this.checkPreviousRecordsCheckBox.Text = "Check previous records";
|
||||
this.checkPreviousRecordsCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// TracingCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.saveTracingRecordsCheckBox);
|
||||
this.Controls.Add(this.checkPreviousRecordsCheckBox);
|
||||
this.Controls.Add(this.connStrTextBox);
|
||||
this.Controls.Add(this.connStrLabel);
|
||||
this.Controls.Add(this.workplaceTextBox);
|
||||
@@ -128,5 +154,7 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
||||
private System.Windows.Forms.Label workplaceLabel;
|
||||
private System.Windows.Forms.TextBox connStrTextBox;
|
||||
private System.Windows.Forms.Label connStrLabel;
|
||||
private System.Windows.Forms.CheckBox saveTracingRecordsCheckBox;
|
||||
private System.Windows.Forms.CheckBox checkPreviousRecordsCheckBox;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace TBF.BenchControl.Output.DB.SaveFlowmeterCorrections
|
||||
|
||||
if (tr.Repeats() == 1)
|
||||
{
|
||||
flow = tr.FlowMean;
|
||||
flow = tr.FlowVolume;
|
||||
errorMaster = tr.ErrorMaster;
|
||||
}
|
||||
else
|
||||
@@ -100,7 +100,7 @@ namespace TBF.BenchControl.Output.DB.SaveFlowmeterCorrections
|
||||
{
|
||||
if (tr2.TestDone && (tr2.TestData.Name == tr.TestData.Name))
|
||||
{
|
||||
flow += tr2.FlowMean;
|
||||
flow += tr2.FlowVolume;
|
||||
errorMaster += tr2.ErrorMaster;
|
||||
count++;
|
||||
}
|
||||
|
||||
@@ -31,9 +31,8 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
||||
enum CurrentOp
|
||||
{
|
||||
None,
|
||||
CheckBarcodeScanning,
|
||||
WriteResults,
|
||||
ReadStartInfo,
|
||||
WriteResults,
|
||||
}
|
||||
CurrentOp currentOp;
|
||||
bool opCompleted;
|
||||
@@ -258,18 +257,6 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
||||
}
|
||||
}
|
||||
|
||||
public IOperation CheckBarcodeScanningOp(GenericDevices.IRegisterReader[] iperlHeads)
|
||||
{
|
||||
if (currentOp != CurrentOp.None)
|
||||
{
|
||||
throw new Exception("Sequence error");
|
||||
}
|
||||
|
||||
currentOp = CurrentOp.CheckBarcodeScanning;
|
||||
this.iperlHeads = iperlHeads;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
@@ -286,13 +273,15 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
||||
{
|
||||
if (!opCompleted)
|
||||
{
|
||||
if ( waterMeters.Length == 0) return Event.ResultsWritten;
|
||||
#if ORACLE_DB
|
||||
if (waterMeters.Length == 0) return Event.ResultsWritten;
|
||||
|
||||
if ((dbCfg.DebugLevel == DebugMode.Normal) && (connection != null))
|
||||
{
|
||||
log.WarnFormat("{0} : Run() : currentOp = {1}", Name, currentOp);
|
||||
#if ORACLE_DB
|
||||
if (ReadStartInfoFromDB(connection) == Retv.Error) anyError = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
opCompleted = true;
|
||||
}
|
||||
|
||||
@@ -303,32 +292,19 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
||||
if (!opCompleted)
|
||||
{
|
||||
if (batch.WaterMeters.Count == 0) return Event.ResultsWritten;
|
||||
#if ORACLE_DB
|
||||
|
||||
if ((dbCfg.DebugLevel == DebugMode.Normal) && (connection != null))
|
||||
{
|
||||
log.WarnFormat("{0} : Run() : currentOp = {1}", Name, currentOp);
|
||||
#if ORACLE_DB
|
||||
if (WriteResultsToDB(connection, batch, false) == Retv.Error) anyError = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
opCompleted = true;
|
||||
}
|
||||
|
||||
return anyError ? Event.ResultsNotWritten : Event.ResultsWritten;
|
||||
}
|
||||
else if (currentOp == CurrentOp.CheckBarcodeScanning)
|
||||
{
|
||||
if (!opCompleted)
|
||||
{
|
||||
#if ORACLE_DB
|
||||
if ((dbCfg.DebugLevel == DebugMode.Normal) && (connection != null))
|
||||
{
|
||||
if (CheckBarcodeScanning(connection, iperlHeads) == Retv.Error) anyError = true; ;
|
||||
}
|
||||
#endif
|
||||
opCompleted = true;
|
||||
}
|
||||
|
||||
return anyError ? Event.CheckNotDone : Event.CheckDone;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Event.None;
|
||||
@@ -341,49 +317,8 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
||||
currentOp = CurrentOp.None;
|
||||
}
|
||||
|
||||
|
||||
#if ORACLE_DB
|
||||
public Retv CheckBarcodeScanning(OracleConnection conn, GenericDevices.IRegisterReader[] iPerlHeads)
|
||||
{
|
||||
try
|
||||
{
|
||||
conn.Open(); /// Open the Oracle database
|
||||
|
||||
foreach (var rr in iPerlHeads)
|
||||
{
|
||||
//WaterMeters.iPerl.WaterMeter iPerlHead = rr as WaterMeters.iPerl.WaterMeter;
|
||||
|
||||
//if (iPerlHead != null)
|
||||
//{
|
||||
// OracleCommand cmd = new OracleCommand("select * from IP_ENDTEST_PD where PCBNUMBER = :1 and TESTSTATIONNAME = :2", conn);
|
||||
// OracleParameter param;
|
||||
// param = new OracleParameter("PCBNUMBER", OracleDbType.Varchar2); param.Value = iPerlHead.SerialNr; cmd.Parameters.Add(param);
|
||||
// param = new OracleParameter("TESTSTATIONNAME", OracleDbType.Varchar2); param.Value = "STAWL001"; cmd.Parameters.Add(param);
|
||||
|
||||
// bool exists = false; /// true = RF_Power record exists
|
||||
// OracleDataReader dr1 = cmd.ExecuteReader();
|
||||
// if (dr1.Read()) { exists = true; }
|
||||
// dr1.Close();
|
||||
|
||||
// if (!exists)
|
||||
// {
|
||||
// iPerlHead.CommFailed = true;
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
log.ErrorFormat("Barcode scanning records were not checked: {1}", exc.Message);
|
||||
|
||||
conn.Close();
|
||||
return Retv.Error;
|
||||
}
|
||||
|
||||
conn.Close();
|
||||
return Retv.OK;
|
||||
}
|
||||
|
||||
|
||||
public Retv ReadStartInfoFromDB(OracleConnection conn)
|
||||
{
|
||||
bool anyError = false;
|
||||
@@ -626,35 +561,45 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
||||
|
||||
public Retv WriteResultsToDB(OracleConnection conn, Results.Entities.Batch batch, bool safeMode)
|
||||
{
|
||||
OracleTransaction transaction = null;
|
||||
OracleTransaction transaction;
|
||||
|
||||
try
|
||||
{
|
||||
conn.Open(); /// Open the Oracle database
|
||||
|
||||
transaction = conn.BeginTransaction();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
log.ErrorFormat("Results of batch {0} not written to ORACLE DB (phase 1): {1}",
|
||||
batch.BatchNr, exc.Message);
|
||||
conn.Close();
|
||||
return Retv.Error;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
SaveBatchData(conn, batch);
|
||||
foreach (var wMtr in batch.WaterMeters)
|
||||
{
|
||||
SaveSingleWM2DB(conn, wMtr, safeMode);
|
||||
if ((wMtr.ErrorFlags & ((int)ErrorFlagMask.E25 | (int)ErrorFlagMask.E26 | (int)ErrorFlagMask.E27 | (int)ErrorFlagMask.E28)) == 0)
|
||||
{
|
||||
/// No error production process error => write the result of testing to Oracle DB
|
||||
SaveSingleWM2DB(conn, wMtr, safeMode);
|
||||
}
|
||||
}
|
||||
|
||||
transaction.Commit();
|
||||
conn.Close();
|
||||
log.ErrorFormat("Results of batch {0} correctly written to ORACLE DB", batch.BatchNr);
|
||||
return Retv.OK;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
if (transaction != null) transaction.Rollback();
|
||||
|
||||
log.ErrorFormat("Results of batch {0} not written to ORACLE database: {1}",
|
||||
batch.BatchNr, exc.Message);
|
||||
|
||||
transaction.Rollback();
|
||||
conn.Close();
|
||||
log.ErrorFormat("Results of batch {0} not written to ORACLE DB: {1}", batch.BatchNr, exc.Message);
|
||||
return Retv.Error;
|
||||
}
|
||||
|
||||
conn.Close();
|
||||
return Retv.OK;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -8,7 +8,7 @@ using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Output.DB.SensusOracle
|
||||
{
|
||||
public partial class DatabaseCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
public partial class DatabaseCfgCtrl : Configs.ConfigCtrlUtils, IComponentCfgCtrl
|
||||
{
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
@@ -100,21 +100,21 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
||||
if (config.Name != nameTextBox.Text)
|
||||
{
|
||||
config.Name = nameTextBox.Text;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
flags |= CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
|
||||
int benchId = int.Parse(benchIdTextBox.Text);
|
||||
if (config.TestBenchId != benchId)
|
||||
{
|
||||
config.TestBenchId = benchId;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
flags |= CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
|
||||
int baujahr = int.Parse(baujahrTextBox.Text);
|
||||
if (config.Baujahr != baujahr)
|
||||
{
|
||||
config.Baujahr = baujahr;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
flags |= CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)DBUsed.Count; i++)
|
||||
@@ -122,26 +122,14 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
||||
if (((DBUsed)i).ToString().Equals(dbUsedComboBox.Text) && (config.DBUsed != (DBUsed)i))
|
||||
{
|
||||
config.DBUsed = (DBUsed)i;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
flags |= CfgUpdateFlags.RestartRqrd;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (readStartInfoCheckBox.Checked != config.ReadStartInfo)
|
||||
{
|
||||
config.ReadStartInfo = readStartInfoCheckBox.Checked;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
if (saveResultsCheckBox.Checked != config.SaveResults)
|
||||
{
|
||||
config.SaveResults = saveResultsCheckBox.Checked;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
if (startInfoIsRequiredCheckBox.Checked != config.StartInfoIsRequired)
|
||||
{
|
||||
config.StartInfoIsRequired = startInfoIsRequiredCheckBox.Checked;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
flags |= UpdateDifferent(ref config.ReadStartInfo, readStartInfoCheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
|
||||
flags |= UpdateDifferent(ref config.SaveResults, saveResultsCheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
|
||||
flags |= UpdateDifferent(ref config.StartInfoIsRequired, startInfoIsRequiredCheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using log4net;
|
||||
using Config;
|
||||
using Config.Entities;
|
||||
|
||||
namespace TBF.BenchControl.Output.FileWriters.IperlLogger
|
||||
{
|
||||
@@ -37,8 +38,7 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
|
||||
/// Results to print
|
||||
/// </summary>
|
||||
Results.Entities.Batch batch;
|
||||
|
||||
StreamWriter logger; /// Logs specified by LU
|
||||
string fileName;
|
||||
|
||||
|
||||
public Writer() {}
|
||||
@@ -95,22 +95,21 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
|
||||
public IOperation WriteResultsOp(Results.Entities.Batch batch)
|
||||
{
|
||||
if (currentOp != CurrentOp.None)
|
||||
{
|
||||
throw new Exception("Sequence error");
|
||||
else
|
||||
currentOp = CurrentOp.WriteResults;
|
||||
}
|
||||
|
||||
this.batch = batch;
|
||||
|
||||
string fname = GetLogFileName(batch.StartTime);
|
||||
currentOp = CurrentOp.WriteResults;
|
||||
|
||||
try
|
||||
{
|
||||
logger = new StreamWriter(System.IO.File.Create(fname));
|
||||
fileName = GetLogFileName(batch.StartTime);
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger = null;
|
||||
log.ErrorFormat("Was not able to open LU log file {0}", fname);
|
||||
fileName = string.Empty;
|
||||
log.Error("Unable to create IperlLogger file name");
|
||||
}
|
||||
|
||||
return this;
|
||||
@@ -129,17 +128,24 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
|
||||
{
|
||||
if (currentOp == CurrentOp.WriteResults)
|
||||
{
|
||||
if (!opCompleted)
|
||||
if (batch.WaterMeters.Count == 0) return Event.ResultsWritten;
|
||||
|
||||
if (!opCompleted && !string.IsNullOrEmpty(fileName))
|
||||
{
|
||||
if (batch.WaterMeters.Count == 0) return Event.ResultsWritten;
|
||||
try
|
||||
log.WarnFormat("{0} : Going to write Iperl Log to file {1}", Name, fileName);
|
||||
|
||||
using (TextWriter logger = new StreamWriter(System.IO.File.Create(fileName)))
|
||||
{
|
||||
WriteLogsToDisk(logger, batch);
|
||||
log.WarnFormat("Batch {0} written by {1}", batch.BatchNr, Name);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
log.ErrorFormat("Error writing batch {0} by {1}", batch.BatchNr, Name);
|
||||
try
|
||||
{
|
||||
WriteLogsToDisk(logger, batch);
|
||||
log.WarnFormat("{0} : Batch {1} written OK", Name, batch.BatchNr);
|
||||
}
|
||||
catch
|
||||
{
|
||||
anyError = true;
|
||||
log.WarnFormat("{0} : Failed to write batch {1}", Name, batch.BatchNr);
|
||||
}
|
||||
}
|
||||
|
||||
opCompleted = true;
|
||||
@@ -163,18 +169,20 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
|
||||
}
|
||||
|
||||
|
||||
public Retv WriteLogsToDisk(StreamWriter logger, Results.Entities.Batch batch)
|
||||
public Retv WriteLogsToDisk(TextWriter logger, Results.Entities.Batch batch)
|
||||
{
|
||||
#if TURA_IPERL || TURA_SPECIAL
|
||||
|
||||
if (logger == null)
|
||||
{
|
||||
return Retv.Error; /// No logger
|
||||
}
|
||||
|
||||
|
||||
/// Obtain one representative water meter data
|
||||
Results.Entities.WaterMeter wm0 = null;
|
||||
foreach (var m in batch.WaterMeters) if (m != null) { wm0 = m; break; }
|
||||
foreach (var m in batch.WaterMeters)
|
||||
{
|
||||
if (m != null)
|
||||
{
|
||||
wm0 = m;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (wm0 == null)
|
||||
{
|
||||
return Retv.Error; /// Not a single watermeter in the batch
|
||||
@@ -186,7 +194,15 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
|
||||
{
|
||||
return Retv.Error; /// No test infos
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
log.Info("test infos:");
|
||||
foreach (var ti in testInfos)
|
||||
{
|
||||
log.InfoFormat("ID_WZTyp={0} Rev_WZTyp={1} PruefungsNr={2} Str={3} QBezeichnung={4} Range={5} TbfTestName={6}",
|
||||
wm0.WaterMeterData.WMTypeId, wm0.WMTypeRevision, ti.PruefungsNr, ti.PruefungsNrStr, ti.QBezeichnung, ti.Range, ti.TestName);
|
||||
}
|
||||
}
|
||||
|
||||
Results.Entities.WaterMeterData wmData = wm0.WaterMeterData;
|
||||
|
||||
@@ -202,12 +218,13 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
|
||||
{
|
||||
totalTestTime += wm0trs[j].TargetTime();
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(testInfos[j].TestName))
|
||||
{
|
||||
return Retv.Error; /// Missing test result for one of specified tests
|
||||
}
|
||||
//else if (!string.IsNullOrEmpty(testInfos[j].TestName))
|
||||
//{
|
||||
// return Retv.Error; /// Missing test result for one of specified tests
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
logger.WriteLine("[Wasserzähler-Daten]");
|
||||
@@ -283,88 +300,91 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
|
||||
{
|
||||
Results.Entities.WaterMeter wMtr = batch.WaterMeters[i];
|
||||
|
||||
bool testRsltIsMissing = false;
|
||||
Results.Entities.MeterTestRslt[] wmtrs = new Results.Entities.MeterTestRslt[testInfos.Length];
|
||||
for (int j = 0; j < testInfos.Length; j++)
|
||||
if ((wMtr != null) && (wMtr.ErrorFlags & ((int)ErrorFlagMask.E25 | (int)ErrorFlagMask.E26 | (int)ErrorFlagMask.E27 | (int)ErrorFlagMask.E28)) == 0)
|
||||
{
|
||||
wmtrs[j] = wMtr.GetMeterTestRslt(testInfos[j].TestName);
|
||||
|
||||
if (wmtrs[j] == null && !string.IsNullOrEmpty(testInfos[j].TestName))
|
||||
{
|
||||
testRsltIsMissing = true; /// Missing test result for one of specified tests
|
||||
}
|
||||
}
|
||||
|
||||
logger.WriteLine();
|
||||
logger.WriteLine(string.Format("[Zählerdaten_{0}]", wMtr.WMPosition));
|
||||
|
||||
if (testRsltIsMissing)
|
||||
{
|
||||
logger.WriteLine("geprüft=0");
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.WriteLine("geprüft=1");
|
||||
logger.WriteLine(string.Format("Zählernummer="));
|
||||
logger.WriteLine(string.Format("FertigsNr={0}", wMtr.SerialNr));
|
||||
logger.WriteLine(string.Format("bestanden={0}", wMtr.Passed ? 1 : 0)); /// 1
|
||||
logger.WriteLine(string.Format("Prüfflag={0}", wMtr.HydrPruefung)); /// 96
|
||||
logger.WriteLine(string.Format("FestWertWZ=0")); /// 0
|
||||
logger.WriteLine(string.Format("Dicht={0}", 1)); /// 1
|
||||
logger.WriteLine(string.Format("PrüfIndex={0}", wMtr.Pruefindex)); /// 7301
|
||||
logger.WriteLine(string.Format("GeprüftIndex=1")); /// 1
|
||||
|
||||
bool testRsltIsMissing = false;
|
||||
Results.Entities.MeterTestRslt[] wmtrs = new Results.Entities.MeterTestRslt[testInfos.Length];
|
||||
for (int j = 0; j < testInfos.Length; j++)
|
||||
{
|
||||
Results.Entities.MeterTestRslt mtr = wmtrs[j];
|
||||
string flID = testInfos[j].PruefungsNrStr;
|
||||
wmtrs[j] = wMtr.GetMeterTestRslt(testInfos[j].TestName);
|
||||
|
||||
if (mtr != null)
|
||||
if (wmtrs[j] == null && !string.IsNullOrEmpty(testInfos[j].TestName))
|
||||
{
|
||||
logger.WriteLine(string.Format("Q{0}bestanden={1}", flID, 1));
|
||||
logger.WriteLine(string.Format("Durchfluss{0}={1}", flID, Utils.DoubleToStr(Units.ConvertTo(Unit.lph, mtr.FlowVolume()), 5, true)));
|
||||
logger.WriteLine(string.Format("Fehler{0}={1}", flID, mtr.Error.ToString(Program.AltCulture)));
|
||||
logger.WriteLine(string.Format("ZeitImpulse{0}={1}", flID, mtr.TestTime.ToString(Program.AltCulture)));
|
||||
logger.WriteLine(string.Format("Impulse{0}={1}", flID, 0));
|
||||
logger.WriteLine(string.Format("Volumen{0}={1}", flID, mtr.VolumeMeter.ToString(Program.AltCulture)));
|
||||
logger.WriteLine(string.Format("KorrFehler{0}={1}", flID, ((testInfos[j].TestName == "Q2") && mtr.WaterMeter.Q2CorrectionDone) ? mtr.WaterMeter.Q2ErrWOCorrection.ToString(Program.AltCulture)
|
||||
: mtr.Error.ToString(Program.AltCulture)));
|
||||
logger.WriteLine(string.Format("KorrDurchfluss{0}={1}", flID, 0));
|
||||
logger.WriteLine(string.Format("Q{0}KorrBestanden={1}", flID, 0));
|
||||
logger.WriteLine(string.Format("Anfangsstand{0}={1}", flID, 0)); /// TODO
|
||||
logger.WriteLine(string.Format("Endstand{0}={1}", flID, 0)); /// TODO
|
||||
logger.WriteLine(string.Format("QMittelwert{0}={1}", flID, Utils.DoubleToStr(Units.ConvertTo(Unit.lph, mtr.FlowVolume()), 5, true)));
|
||||
logger.WriteLine(string.Format("QStandardAbweichung{0}={1}", flID, 0));
|
||||
logger.WriteLine(string.Format("ImpedanzMittelwert{0}={1}", flID, "0,00000"));
|
||||
logger.WriteLine(string.Format("AusfallGrund{0}={1}", flID, 0));
|
||||
testRsltIsMissing = true; /// Missing test result for one of specified tests
|
||||
}
|
||||
}
|
||||
|
||||
logger.WriteLine(string.Format("AusfallGrundGesamt={0}", 0));
|
||||
logger.WriteLine(string.Format("AuftragNum={0}", wMtr.PurchaseOrder));
|
||||
logger.WriteLine(string.Format("MaterialNum={0}", 38140500));
|
||||
logger.WriteLine(string.Format("Prefix={0}", "8SEN01"));
|
||||
logger.WriteLine(string.Format("Suffix="));
|
||||
logger.WriteLine(string.Format("Palette={0}", 0));
|
||||
logger.WriteLine(string.Format("Umkarton={0}", 0));
|
||||
logger.WriteLine(string.Format("ZNr_komplett="));
|
||||
logger.WriteLine(string.Format("OptikBewertung=0,00000"));
|
||||
logger.WriteLine(string.Format("IdProduziert={0}", 0));
|
||||
logger.WriteLine(string.Format("Calibration_alt={0}", wMtr.OrigCalibFactor));
|
||||
logger.WriteLine(string.Format("Calibration={0}", wMtr.CalibFactor));
|
||||
logger.WriteLine(string.Format("Firmware={0}", wMtr.FWVersion)); /// 5.066
|
||||
logger.WriteLine(string.Format("FlexFlowFehler={0}", 0)); /// 0
|
||||
logger.WriteLine(string.Format("FlexFlowAuftrag={0}", 0)); /// 4248189
|
||||
logger.WriteLine(string.Format("JustierWert=0,2")); /// 0,2
|
||||
logger.WriteLine(string.Format("Corrected2Hz={0}", wMtr.Hz2CorrectionDone ? 1 : 0));
|
||||
logger.WriteLine(string.Format("Q2Corrected={0}", wMtr.Q2CorrectionDone ? 1 : 0));
|
||||
logger.WriteLine(string.Format("Q2CorrectionRight={0}", wMtr.Q2CorrLR));
|
||||
logger.WriteLine(string.Format("Q2CorrectionLeft={0}", wMtr.Q2CorrRL));
|
||||
logger.WriteLine(string.Format("Q2CorrectionFlowRight={0}", wMtr.Q2CorrFlowRight));
|
||||
logger.WriteLine(string.Format("FlowDirectionRight={0}", wMtr.Q2CorrFlowRight));
|
||||
logger.WriteLine(string.Format("Position={0}", wMtr.WMPosition));
|
||||
}
|
||||
}
|
||||
logger.WriteLine();
|
||||
logger.WriteLine(string.Format("[Zählerdaten_{0}]", wMtr.WMPosition));
|
||||
|
||||
if (testRsltIsMissing)
|
||||
{
|
||||
logger.WriteLine("geprüft=0");
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.WriteLine("geprüft=1");
|
||||
logger.WriteLine(string.Format("Zählernummer="));
|
||||
logger.WriteLine(string.Format("FertigsNr={0}", wMtr.SerialNr));
|
||||
logger.WriteLine(string.Format("bestanden={0}", wMtr.Passed ? 1 : 0)); /// 1
|
||||
logger.WriteLine(string.Format("Prüfflag={0}", wMtr.HydrPruefung)); /// 96
|
||||
logger.WriteLine(string.Format("FestWertWZ=0")); /// 0
|
||||
logger.WriteLine(string.Format("Dicht={0}", 1)); /// 1
|
||||
logger.WriteLine(string.Format("PrüfIndex={0}", wMtr.Pruefindex)); /// 7301
|
||||
logger.WriteLine(string.Format("GeprüftIndex=1")); /// 1
|
||||
|
||||
for (int j = 0; j < testInfos.Length; j++)
|
||||
{
|
||||
Results.Entities.MeterTestRslt mtr = wmtrs[j];
|
||||
string flID = testInfos[j].PruefungsNrStr;
|
||||
|
||||
if (mtr != null)
|
||||
{
|
||||
logger.WriteLine(string.Format("Q{0}bestanden={1}", flID, 1));
|
||||
logger.WriteLine(string.Format("Durchfluss{0}={1}", flID, Utils.DoubleToStr(Units.ConvertTo(Unit.lph, mtr.FlowVolume()), 5, true)));
|
||||
logger.WriteLine(string.Format("Fehler{0}={1}", flID, mtr.Error.ToString(Program.AltCulture)));
|
||||
logger.WriteLine(string.Format("ZeitImpulse{0}={1}", flID, mtr.TestTime.ToString(Program.AltCulture)));
|
||||
logger.WriteLine(string.Format("Impulse{0}={1}", flID, 0));
|
||||
logger.WriteLine(string.Format("Volumen{0}={1}", flID, mtr.VolumeMeter.ToString(Program.AltCulture)));
|
||||
logger.WriteLine(string.Format("KorrFehler{0}={1}", flID, ((testInfos[j].TestName == "Q2") && mtr.WaterMeter.Q2CorrectionDone) ? mtr.WaterMeter.Q2ErrWOCorrection.ToString(Program.AltCulture)
|
||||
: mtr.Error.ToString(Program.AltCulture)));
|
||||
logger.WriteLine(string.Format("KorrDurchfluss{0}={1}", flID, 0));
|
||||
logger.WriteLine(string.Format("Q{0}KorrBestanden={1}", flID, 0));
|
||||
logger.WriteLine(string.Format("Anfangsstand{0}={1}", flID, 0)); /// TODO
|
||||
logger.WriteLine(string.Format("Endstand{0}={1}", flID, 0)); /// TODO
|
||||
logger.WriteLine(string.Format("QMittelwert{0}={1}", flID, Utils.DoubleToStr(Units.ConvertTo(Unit.lph, mtr.FlowVolume()), 5, true)));
|
||||
logger.WriteLine(string.Format("QStandardAbweichung{0}={1}", flID, 0));
|
||||
logger.WriteLine(string.Format("ImpedanzMittelwert{0}={1}", flID, "0,00000"));
|
||||
logger.WriteLine(string.Format("AusfallGrund{0}={1}", flID, 0));
|
||||
}
|
||||
}
|
||||
|
||||
logger.WriteLine(string.Format("AusfallGrundGesamt={0}", 0));
|
||||
logger.WriteLine(string.Format("AuftragNum={0}", wMtr.PurchaseOrder));
|
||||
logger.WriteLine(string.Format("MaterialNum={0}", 38140500));
|
||||
logger.WriteLine(string.Format("Prefix={0}", "8SEN01"));
|
||||
logger.WriteLine(string.Format("Suffix="));
|
||||
logger.WriteLine(string.Format("Palette={0}", 0));
|
||||
logger.WriteLine(string.Format("Umkarton={0}", 0));
|
||||
logger.WriteLine(string.Format("ZNr_komplett="));
|
||||
logger.WriteLine(string.Format("OptikBewertung=0,00000"));
|
||||
logger.WriteLine(string.Format("IdProduziert={0}", 0));
|
||||
logger.WriteLine(string.Format("Calibration_alt={0}", wMtr.OrigCalibFactor));
|
||||
logger.WriteLine(string.Format("Calibration={0}", wMtr.CalibFactor));
|
||||
logger.WriteLine(string.Format("Firmware={0}", wMtr.FWVersion)); /// 5.066
|
||||
logger.WriteLine(string.Format("FlexFlowFehler={0}", 0)); /// 0
|
||||
logger.WriteLine(string.Format("FlexFlowAuftrag={0}", 0)); /// 4248189
|
||||
logger.WriteLine(string.Format("JustierWert=0,2")); /// 0,2
|
||||
logger.WriteLine(string.Format("Corrected2Hz={0}", wMtr.Hz2CorrectionDone ? 1 : 0));
|
||||
logger.WriteLine(string.Format("Q2Corrected={0}", wMtr.Q2CorrectionDone ? 1 : 0));
|
||||
logger.WriteLine(string.Format("Q2CorrectionRight={0}", wMtr.Q2CorrLR));
|
||||
logger.WriteLine(string.Format("Q2CorrectionLeft={0}", wMtr.Q2CorrRL));
|
||||
logger.WriteLine(string.Format("Q2CorrectionFlowRight={0}", wMtr.Q2CorrFlowRight));
|
||||
logger.WriteLine(string.Format("FlowDirectionRight={0}", wMtr.Q2CorrFlowRight));
|
||||
logger.WriteLine(string.Format("Position={0}", wMtr.WMPosition));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
logger.WriteLine();
|
||||
logger.WriteLine("[Prüfdaten]");
|
||||
@@ -441,7 +461,7 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
|
||||
}
|
||||
|
||||
|
||||
void WriteOneToDisk(StreamWriter logger, string id, Results.Entities.TestRslt tr)
|
||||
void WriteOneToDisk(TextWriter logger, string id, Results.Entities.TestRslt tr)
|
||||
{
|
||||
logger.WriteLine(string.Format("Prüfvolumen{0}={1}", id, Config.Units.ConvertTo(Unit.l, tr.TestData.TargetVolume).ToString(Program.AltCulture)));
|
||||
logger.WriteLine(string.Format("Prüfmasse{0}={1}", id, 0)); /// 3,72610
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace TBF.BenchControl.RegisterReaders.KPackE.DataEntryForRadio
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
public bool Completed { get { return (modelessDlg is IHasCompleted) ? (modelessDlg as IHasCompleted).Completed : true; } }
|
||||
|
||||
double refVolume;
|
||||
double errLimLo;
|
||||
|
||||
@@ -14,6 +14,7 @@ using TBF.BenchControl.Operations;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
using TBF.Boxes;
|
||||
using TBF.Resources;
|
||||
using System.Threading;
|
||||
|
||||
namespace TBF.BenchControl.Sequences
|
||||
{
|
||||
@@ -228,7 +229,7 @@ namespace TBF.BenchControl.Sequences
|
||||
/// </summary>
|
||||
/// <param name="dummyArg"></param>
|
||||
/// <returns></returns>
|
||||
public IList<Event> Execute(Test dummyArg)
|
||||
public void Execute()
|
||||
{
|
||||
IList<Event> e;
|
||||
Selection selection;
|
||||
@@ -347,7 +348,7 @@ namespace TBF.BenchControl.Sequences
|
||||
//--------------------------------------------------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Resetting_scales);
|
||||
//--------------------------------------------------------------------------------------------
|
||||
Bridge.Bench2UI(ButtonsEtc.StopBtnEn);
|
||||
Bridge.Bench2UI(ButtonsEtc.StopBtnEn); /// Resetting scales : Enable STOP button
|
||||
|
||||
DoubleBox tara1 = new DoubleBox(0);
|
||||
DoubleBox tara2 = new DoubleBox(0);
|
||||
@@ -387,7 +388,17 @@ namespace TBF.BenchControl.Sequences
|
||||
|
||||
do
|
||||
{
|
||||
selection = MakeSelection(MKSelContext.ProcedureNotSelected);
|
||||
do
|
||||
{
|
||||
selection = MakeSelection(MKSelContext.ProcedureNotSelected);
|
||||
if (selection == Selection.Shutdown)
|
||||
{
|
||||
Shutdown();
|
||||
return;
|
||||
}
|
||||
}
|
||||
while (selection == Selection.Shutdown);
|
||||
|
||||
switch (selection)
|
||||
{
|
||||
case Selection.Q1: selectedTestName = "Q1"; break;
|
||||
@@ -446,7 +457,7 @@ namespace TBF.BenchControl.Sequences
|
||||
///
|
||||
StateMachine.ControlBoard.ManualUIAllowed = !StateMachine.Procedure.ManualCtrlDisabled;
|
||||
|
||||
Bridge.Bench2UI(ButtonsEtc.StopBtnEn); /// Enable STOP button
|
||||
Bridge.Bench2UI(ButtonsEtc.StopBtnEn); /// A new cycle started : Enable STOP button
|
||||
|
||||
int newBatchNr = Program.LocalSettings.BatchNr;
|
||||
log.FatalFormat("New measurement session started: batch = {0}, procedure = {1}", newBatchNr, StateMachine.Procedure.Name);
|
||||
@@ -579,8 +590,10 @@ namespace TBF.BenchControl.Sequences
|
||||
///
|
||||
if ((simultWithPurgingCount > 0) || (readingStartInfo.Operations.Count > 0))
|
||||
{
|
||||
bool completed = !(modelessDlg is GenericDevices.IHasCompleted)
|
||||
|| (modelessDlg as GenericDevices.IHasCompleted).Completed;
|
||||
/// Get 'bool completed'
|
||||
bool completed = !(modelessDlg is GenericDevices.IHasCompleted) || (modelessDlg as GenericDevices.IHasCompleted).Completed;
|
||||
if (lastDataEntryCmpnt != null) completed = completed && lastDataEntryCmpnt.Completed;
|
||||
|
||||
if (!completed)
|
||||
{
|
||||
State.Create("MainSeq : Wait until the entry form is closed")
|
||||
@@ -595,7 +608,9 @@ namespace TBF.BenchControl.Sequences
|
||||
goto stop;
|
||||
}
|
||||
|
||||
completed = (modelessDlg as GenericDevices.IHasCompleted).Completed;
|
||||
/// Update 'bool completed'
|
||||
completed = !(modelessDlg is GenericDevices.IHasCompleted) || (modelessDlg as GenericDevices.IHasCompleted).Completed;
|
||||
if (lastDataEntryCmpnt != null) completed = completed && lastDataEntryCmpnt.Completed;
|
||||
}
|
||||
while (!completed);
|
||||
}
|
||||
@@ -606,6 +621,7 @@ namespace TBF.BenchControl.Sequences
|
||||
///
|
||||
/// Read start info from the DB @ cycle start
|
||||
///
|
||||
|
||||
if (readingStartInfo.Operations.Count > 0)
|
||||
{
|
||||
readingStartInfo.AddOperation(checkUiOp).EnterState();
|
||||
@@ -642,7 +658,12 @@ namespace TBF.BenchControl.Sequences
|
||||
|
||||
//----------------------------------------------------------
|
||||
selection = MakeSelection(MKSelContext.InsideProcedure);
|
||||
switch (selection)
|
||||
if (selection == Selection.Shutdown)
|
||||
{
|
||||
Shutdown();
|
||||
return;
|
||||
}
|
||||
switch (selection)
|
||||
{
|
||||
case Selection.Q1: selectedTestName = "Q1"; break;
|
||||
case Selection.Q2: selectedTestName = "Q2"; break;
|
||||
@@ -1245,6 +1266,7 @@ namespace TBF.BenchControl.Sequences
|
||||
//--------------------------------
|
||||
State.Create("MainSeq : Procedure configuration error")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.BenchErrorOp)
|
||||
.AddOperation(new Operations.MessageBoxOp("Test configration error"))
|
||||
.EnterState();
|
||||
do
|
||||
@@ -1259,6 +1281,7 @@ namespace TBF.BenchControl.Sequences
|
||||
//--------------------------------
|
||||
State.Create("MainSeq : ERROR -> Closing the valves")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.BenchErrorOp)
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.DefaultValvesOpen,
|
||||
StateMachine.DefaultValvesClose))
|
||||
.EnterState();
|
||||
@@ -1270,8 +1293,17 @@ namespace TBF.BenchControl.Sequences
|
||||
|
||||
//--------------------------------
|
||||
State.Create("MainSeq : ERROR state")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.BenchErrorOp)
|
||||
.EnterState();
|
||||
while (true) StateMachine.WaitRunDevsRunOps();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
}
|
||||
while (!e.Contains(Event.UiCmdShutdown));
|
||||
|
||||
Shutdown(true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1312,7 +1344,7 @@ namespace TBF.BenchControl.Sequences
|
||||
/// <returns>
|
||||
/// Selection.PurgeBegin, PurgeEnd, Break, Cycle, Test, Q1, Q2, Q3 or SaveResults
|
||||
/// </returns>
|
||||
private Selection MakeSelection(MKSelContext context)
|
||||
Selection MakeSelection(MKSelContext context)
|
||||
{
|
||||
log.WarnFormat("MakeSelection({0})", context);
|
||||
|
||||
@@ -1359,6 +1391,7 @@ namespace TBF.BenchControl.Sequences
|
||||
|
||||
State.Create("MainSeq : Select an activity")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.BenchWaitingOp)
|
||||
.AddOperation((StateMachine.Tank1 is IScale) ? (StateMachine.Tank1 as IScale).ReadMassOp(ref mass1) : null)
|
||||
.AddOperation((StateMachine.Tank2 is IScale) ? (StateMachine.Tank2 as IScale).ReadMassOp(ref mass2) : null)
|
||||
.AddOperation((StateMachine.Tank3 is IScale) ? (StateMachine.Tank3 as IScale).ReadMassOp(ref mass3) : null)
|
||||
@@ -1380,7 +1413,8 @@ namespace TBF.BenchControl.Sequences
|
||||
if (draining3 && StateMachine.Tank3.IsEmpty()) break;
|
||||
|
||||
/// Quit the selection loop and leave MakeSelection()
|
||||
if (e.Contains(Event.UiCmdBreak) && context == MKSelContext.InsideProcedure) return Selection.Break;
|
||||
if (e.Contains(Event.UiCmdShutdown)) return Selection.Shutdown;
|
||||
if (e.Contains(Event.UiCmdBreak) && (context == MKSelContext.InsideProcedure)) return Selection.Break;
|
||||
if (e.Contains(Event.UiCmdPurgeBegin)) return Selection.PurgeBegin;
|
||||
if (e.Contains(Event.UiCmdPurgeEnd)) return Selection.PurgeEnd;
|
||||
if (e.Contains(Event.UiCmdStartCycle)) return Selection.Cycle;
|
||||
@@ -1400,8 +1434,16 @@ namespace TBF.BenchControl.Sequences
|
||||
Bridge.OnActivity(this, Strings.Error);
|
||||
///------------------------------------
|
||||
State.Create("MainSeq : ERROR state")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(StateMachine.BenchErrorOp)
|
||||
.EnterState();
|
||||
while (true) StateMachine.WaitRunDevsRunOps(); /// Endless loop
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
}
|
||||
while (!e.Contains(Event.UiCmdShutdown));
|
||||
|
||||
return Selection.Shutdown;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1466,6 +1508,90 @@ namespace TBF.BenchControl.Sequences
|
||||
}
|
||||
}
|
||||
|
||||
void Shutdown(bool skipTankDraining = false)
|
||||
{
|
||||
log.WarnFormat(string.Format("Shutdown(skipTankDraining={0})", skipTankDraining));
|
||||
|
||||
StateMachine.MachineState = MachineState.ShuttingDown; /// TBF shut down cannot be aborted from now on
|
||||
Bridge.Bench2UI(0); /// All buttons off
|
||||
|
||||
if (!skipTankDraining)
|
||||
{
|
||||
/// Drain time
|
||||
int maxDrainTime = 0;
|
||||
if ((StateMachine.Tank1 != null) && (StateMachine.Tank1.EmptyTimeSec > maxDrainTime)) maxDrainTime = StateMachine.Tank1.EmptyTimeSec;
|
||||
if ((StateMachine.Tank2 != null) && (StateMachine.Tank2.EmptyTimeSec > maxDrainTime)) maxDrainTime = StateMachine.Tank2.EmptyTimeSec;
|
||||
if ((StateMachine.Tank3 != null) && (StateMachine.Tank3.EmptyTimeSec > maxDrainTime)) maxDrainTime = StateMachine.Tank3.EmptyTimeSec;
|
||||
|
||||
/// Drain valves
|
||||
IList<IValve> drainValves = new List<IValve>();
|
||||
if (StateMachine.DrainValve1 != null) drainValves.Add(StateMachine.DrainValve1);
|
||||
if (StateMachine.DrainValve2 != null) drainValves.Add(StateMachine.DrainValve2);
|
||||
if (StateMachine.DrainValve3 != null) drainValves.Add(StateMachine.DrainValve3);
|
||||
|
||||
/// Open all drain valves
|
||||
if (drainValves.Count > 0)
|
||||
{
|
||||
Bridge.OnActivity(this, Strings.Emptying_tank); /// Activity message
|
||||
|
||||
State.Create("Open all drain valves")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(drainValves, null))
|
||||
.EnterState();
|
||||
while (StateMachine.WaitRunDevsRunOps().Contains(Event.ValvesBusy)) { }
|
||||
}
|
||||
|
||||
/// Tank emptying valves states
|
||||
bool draining1 = (StateMachine.DrainValve1 != null);
|
||||
bool draining2 = (StateMachine.DrainValve2 != null);
|
||||
bool draining3 = (StateMachine.DrainValve3 != null);
|
||||
|
||||
int drainingStartTime = StateMachine.Time;
|
||||
|
||||
/// Quit the following loop when time expires or all tanks are empty
|
||||
while ((StateMachine.Time < drainingStartTime + maxDrainTime) && (draining1 || draining2 || draining3))
|
||||
{
|
||||
int remTime = drainingStartTime + maxDrainTime - StateMachine.Time;
|
||||
Bridge.OnActivity(this, string.Format("{0} ... {1} {2} {3} {4}", Strings.Emptying_tank, remTime / 60, "min", remTime % 60, Strings.sec));
|
||||
|
||||
DoubleBox mass1 = new DoubleBox();
|
||||
DoubleBox mass2 = new DoubleBox();
|
||||
DoubleBox mass3 = new DoubleBox();
|
||||
///
|
||||
State.Create("MainSeq : Reading mass")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((StateMachine.Tank1 is IScale) ? (StateMachine.Tank1 as IScale).ReadMassOp(ref mass1) : null)
|
||||
.AddOperation((StateMachine.Tank2 is IScale) ? (StateMachine.Tank2 as IScale).ReadMassOp(ref mass2) : null)
|
||||
.AddOperation((StateMachine.Tank3 is IScale) ? (StateMachine.Tank3 as IScale).ReadMassOp(ref mass3) : null)
|
||||
.EnterState();
|
||||
while (StateMachine.WaitRunDevsRunOps().Contains(Event.Busy)) { }
|
||||
|
||||
if (draining1 && StateMachine.Tank1.IsEmpty()) draining1 = false;
|
||||
if (draining2 && StateMachine.Tank2.IsEmpty()) draining2 = false;
|
||||
if (draining3 && StateMachine.Tank3.IsEmpty()) draining3 = false;
|
||||
}
|
||||
|
||||
/// Close all drain valves
|
||||
if (drainValves.Count > 0)
|
||||
{
|
||||
State.Create("Close all drain valves")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, drainValves))
|
||||
.EnterState();
|
||||
while (StateMachine.WaitRunDevsRunOps().Contains(Event.ValvesBusy)) { }
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Shut down the state machine
|
||||
///
|
||||
Bridge.OnActivity(this, Strings.Shutting_down_devices); /// Activity message
|
||||
|
||||
State.Create("No operations").EnterState(); /// Stop all operations
|
||||
StateMachine.WaitRunDevsRunOps(true);
|
||||
|
||||
BenchControl.StateMachine.StopDevices(); /// Stop all devices - phase 1
|
||||
Thread.Sleep(100);
|
||||
BenchControl.StateMachine.StopDevices2(); /// Stop all devices - phase 2
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a new empty batch results from the procedure
|
||||
|
||||
@@ -27,6 +27,11 @@ namespace TBF.BenchControl.Sequences
|
||||
protected static readonly ILog allResults = LogManager.GetLogger("AllResults");
|
||||
protected static readonly ILog summaryResults = LogManager.GetLogger("SummaryResults");
|
||||
|
||||
|
||||
public const int FlowSettingTimeoutSec = 300; /// Flow setting timeout = 5 min.
|
||||
public const int StableMassMsrmntTimeoutSec = 300; /// Stable mass measurement timeout = 5 min.
|
||||
|
||||
|
||||
///------------------------------------------------------------
|
||||
/// Global static variables set only once.
|
||||
///------------------------------------------------------------
|
||||
@@ -71,6 +76,9 @@ namespace TBF.BenchControl.Sequences
|
||||
protected IOperation enduranceDataLoggingOp;
|
||||
|
||||
|
||||
protected GenericDevices.IDataEntry lastDataEntryCmpnt;
|
||||
|
||||
|
||||
///
|
||||
/// Process data logging
|
||||
///
|
||||
@@ -756,13 +764,12 @@ namespace TBF.BenchControl.Sequences
|
||||
protected bool OpenCycleBeginForm()
|
||||
{
|
||||
IList<Event> e;
|
||||
GenericDevices.IDataEntry dataEntryCmpnt =
|
||||
TbfComponents.FindComponent(StateMachine.Procedure.DataEntry) as GenericDevices.IDataEntry;
|
||||
if (dataEntryCmpnt is IHasCycleBeginForm)
|
||||
lastDataEntryCmpnt = TbfComponents.FindComponent(StateMachine.Procedure.DataEntry) as GenericDevices.IDataEntry;
|
||||
if (lastDataEntryCmpnt is IHasCycleBeginForm)
|
||||
{
|
||||
Bridge.OnActivity(this, Strings.Enter_water_meter_data);
|
||||
State.Create("MainSeq : Enter begin data")
|
||||
.AddPermanentOperation((dataEntryCmpnt as IHasCycleBeginForm).ShowCycleBeginFormOp())
|
||||
.AddPermanentOperation((lastDataEntryCmpnt as IHasCycleBeginForm).ShowCycleBeginFormOp())
|
||||
.AddOperation(checkUiOp)
|
||||
.EnterState();
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
|
||||
@@ -171,8 +171,6 @@ namespace TBF.BenchControl
|
||||
/// </summary>
|
||||
public State EnterState()
|
||||
{
|
||||
log.Debug(this.ToString());
|
||||
|
||||
StopAndStartOperations(State.currentState, this);
|
||||
State.currentState = this;
|
||||
UiBridge.Bridge.OnStateChanged(this, State.currentState.ToString());
|
||||
@@ -236,7 +234,7 @@ namespace TBF.BenchControl
|
||||
}
|
||||
}
|
||||
|
||||
log.WarnFormat("---------------( {0} )---------------", newState.ToString());
|
||||
log.WarnFormat("---------------( {0} )---------------", newState);
|
||||
|
||||
/// Start() the operations that are in the current (new) state, but aren't in the previous state.
|
||||
foreach (IOperation operation in newState.Operations)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Text;
|
||||
@@ -16,9 +16,17 @@ using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl
|
||||
{
|
||||
public class QuitStateMachineException : Exception
|
||||
{
|
||||
}
|
||||
public enum MachineState
|
||||
{
|
||||
Undefined = 0,
|
||||
Disabled,
|
||||
StartingUp, /// Start-up: Initialize() of all devices + start of the worker thread
|
||||
FailedToStart, /// Most likely Initialize() of any device thrown an exception
|
||||
Running, /// RunDeviceBefore() and RunDeviceAfter() of all devices, Start()/Run()/Stop() of operations
|
||||
ShuttingDown, /// Shutdown: StopDevice() and StopDevice2() of all devices
|
||||
Off, /// Off after the shutdown
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// This class controls real test bench behavior.
|
||||
@@ -45,7 +53,9 @@ namespace TBF.BenchControl
|
||||
/// Public components
|
||||
public static Elde.ControlBoardDev ControlBoard;
|
||||
public static GenericDevices.IAmbient Ambient;
|
||||
public static GenericDevices.IScaleOrTank Tank1;
|
||||
public static IOperation BenchWaitingOp;
|
||||
public static IOperation BenchErrorOp;
|
||||
public static GenericDevices.IScaleOrTank Tank1;
|
||||
public static GenericDevices.IScaleOrTank Tank2;
|
||||
public static GenericDevices.IScaleOrTank Tank3;
|
||||
public static GenericDevices.IValve DrainValve1;
|
||||
@@ -65,11 +75,8 @@ namespace TBF.BenchControl
|
||||
|
||||
static DateTime startDateTime; /// DateTime of time instance when the state machine worker thread starts
|
||||
static int currentTimeSec; /// Time from the start of the state machine in seconds
|
||||
static bool quitStateMachine; /// flag to stop the worker thread
|
||||
|
||||
/// true when the state machine is running
|
||||
static bool stateMachineRunning;
|
||||
public static bool Running { get { return stateMachineRunning; } }
|
||||
public static MachineState MachineState; /// see enum MachineState for explanation
|
||||
|
||||
/// Worker thread and database session
|
||||
static Thread workerThread;
|
||||
@@ -134,9 +141,7 @@ namespace TBF.BenchControl
|
||||
{
|
||||
devices = new List<IDevice>();
|
||||
states = new List<State>();
|
||||
|
||||
currentTimeSec = 0;
|
||||
quitStateMachine = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -241,6 +246,13 @@ namespace TBF.BenchControl
|
||||
if (cmpnt is IWaterMeter) SequenceBase.WaterMeters.Add(cmpnt as IWaterMeter);
|
||||
if (cmpnt is ICamera) SequenceBase.Cameras.Add(cmpnt as ICamera);
|
||||
if (cmpnt is GenericDevices.IAmbient) Ambient = cmpnt as GenericDevices.IAmbient;
|
||||
|
||||
if (cmpnt is GenericDevices.IParallelOutput && cmpnt.Name.ToLower().Contains("tower"))
|
||||
{
|
||||
BenchWaitingOp = (cmpnt as GenericDevices.IParallelOutput).ShowBenchWaitingOp();
|
||||
BenchErrorOp = (cmpnt as GenericDevices.IParallelOutput).ShowBenchErrorOp();
|
||||
}
|
||||
|
||||
if (cmpnt is IScaleOrTank)
|
||||
{
|
||||
IScaleOrTank tank = cmpnt as IScaleOrTank;
|
||||
@@ -495,13 +507,18 @@ namespace TBF.BenchControl
|
||||
/// </summary>
|
||||
public static void Start()
|
||||
{
|
||||
if (stateMachineRunning) return;
|
||||
if (MachineState != MachineState.StartingUp)
|
||||
{
|
||||
/// Unexpected MachineState (not MachineState.StartingUp) --> prevent worker thread from starting
|
||||
///
|
||||
MachineState = MachineState.FailedToStart;
|
||||
return;
|
||||
}
|
||||
|
||||
workerThread = new Thread(Worker);
|
||||
workerThread.CurrentCulture = Thread.CurrentThread.CurrentCulture;
|
||||
workerThread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
|
||||
workerThread.Start();
|
||||
stateMachineRunning = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -703,15 +720,6 @@ namespace TBF.BenchControl
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Stops the state machine (and the worker thread)
|
||||
/// </summary>
|
||||
public static void Stop()
|
||||
{
|
||||
if (stateMachineRunning) quitStateMachine = true;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This is and example sequence of RunDeviceBefore() / RunOperations() / RunDeviceAfter() calls
|
||||
* as they are executed during normal run from the progran start to the end.
|
||||
@@ -748,32 +756,32 @@ namespace TBF.BenchControl
|
||||
/// </summary>
|
||||
static void Worker()
|
||||
{
|
||||
MachineState = MachineState.Running;
|
||||
startDateTime = DateTime.Now;
|
||||
CycleStartTimeStamp = startDateTime; /// To prevent it is undefined
|
||||
|
||||
CycleStartTimeStamp = startDateTime; /// Do not leave CycleStartTimeStamp uninitialized
|
||||
wlog.InfoFormat(" currentTime = {0}s startDateTime = {1}", currentTimeSec.ToString(), startDateTime.ToString());
|
||||
|
||||
/// Run all devices for the first time
|
||||
foreach (var device in devices) device.RunDeviceBefore();
|
||||
|
||||
try
|
||||
{
|
||||
SequenceBase.ReferenceFlowmetersCount = SequenceBase.FlowMeters.Count;
|
||||
SequenceBase.CalibratedLtrPerRefPulse = new float[SequenceBase.ReferenceFlowmetersCount];
|
||||
foreach (var flowmtr in SequenceBase.FlowMeters)
|
||||
SequenceBase.ReferenceFlowmetersCount = SequenceBase.FlowMeters.Count;
|
||||
SequenceBase.CalibratedLtrPerRefPulse = new float[SequenceBase.ReferenceFlowmetersCount];
|
||||
foreach (var flowmtr in SequenceBase.FlowMeters)
|
||||
{
|
||||
int ix = flowmtr.Idx1;
|
||||
if (ix > 0 && ix <= SequenceBase.ReferenceFlowmetersCount)
|
||||
{
|
||||
int ix = flowmtr.Idx1;
|
||||
if (ix > 0 && ix <= SequenceBase.ReferenceFlowmetersCount)
|
||||
{
|
||||
SequenceBase.CalibratedLtrPerRefPulse[ix - 1] = flowmtr.NominalFlow / 7200.0f;
|
||||
}
|
||||
SequenceBase.CalibratedLtrPerRefPulse[ix - 1] = flowmtr.NominalFlow / 7200.0f;
|
||||
}
|
||||
|
||||
(new Sequences.MainSeq()).Execute(null);
|
||||
}
|
||||
catch (QuitStateMachineException)
|
||||
{
|
||||
}
|
||||
|
||||
///
|
||||
/// Run the main sequence
|
||||
///
|
||||
(new Sequences.MainSeq()).Execute();
|
||||
|
||||
StateMachine.MachineState = MachineState.Off; /// Update StateMachine.MachineState
|
||||
TBF.UiBridge.Bridge.Bench2UI(TBF.UiBridge.ButtonsEtc.Shutdown); /// Let UI know the state machine is shut down now
|
||||
}
|
||||
|
||||
|
||||
@@ -781,34 +789,35 @@ namespace TBF.BenchControl
|
||||
/// Do stuff that is repeated in the state execution loops most often
|
||||
/// </summary>
|
||||
/// <returns>List of Event-s returned from the state operations, null == quit</returns>
|
||||
public static IList<Event> WaitRunDevsRunOps()
|
||||
public static IList<Event> WaitRunDevsRunOps(bool lastTime = false)
|
||||
{
|
||||
Thread.Sleep(100); /// Insert 1/10 sec.delay between RunOperations() and RunDeviceAfter()
|
||||
|
||||
foreach (var device in devices) device.RunDeviceAfter();
|
||||
foreach (var device in devices)
|
||||
{
|
||||
device.RunDeviceAfter();
|
||||
}
|
||||
|
||||
if (WaitNextTick())
|
||||
WaitNextTick();
|
||||
|
||||
if (lastTime)
|
||||
{
|
||||
///
|
||||
/// Executed when the state machine is stopped
|
||||
/// Executed when the state machine is being stopped
|
||||
///
|
||||
wlog.Fatal("quitStateMachine == true ... The last StopOperaions() start now");
|
||||
State.StopOperations();
|
||||
stateMachineRunning = false;
|
||||
wlog.Fatal("StopOperaions() completed ... stateMachineRunning = false)");
|
||||
|
||||
throw new QuitStateMachineException();
|
||||
return null;
|
||||
}
|
||||
|
||||
foreach (var device in devices) device.RunDeviceBefore();
|
||||
|
||||
Thread.Sleep(100); /// Insert 1/10 sec.delay between RunDeviceBefore() and RunOperations()
|
||||
foreach (var device in devices)
|
||||
{
|
||||
device.RunDeviceBefore();
|
||||
}
|
||||
|
||||
IList<Event> events = State.RunOperations();
|
||||
return events;
|
||||
///
|
||||
/// This is followed by a state change in the sequence
|
||||
///
|
||||
Thread.Sleep(100); /// Insert 1/10 sec.delay between RunDeviceBefore() and RunOperations()
|
||||
|
||||
return State.RunOperations(); /// Returns events from all running operations
|
||||
/// This is followed by a state change in the sequence
|
||||
}
|
||||
|
||||
|
||||
@@ -816,20 +825,15 @@ namespace TBF.BenchControl
|
||||
/// Wait time period - synchronize
|
||||
/// </summary>
|
||||
/// <returns>true when interrupted by 'quitStateMachine', otherwise false</returns>
|
||||
public static bool WaitNextTick()
|
||||
public static void WaitNextTick()
|
||||
{
|
||||
currentTimeSec += Period;
|
||||
DateTime nextTickDateTime = startDateTime + TimeSpan.FromSeconds(currentTimeSec);
|
||||
|
||||
TimeSpan timeFromStart = TimeSpan.FromSeconds(currentTimeSec);
|
||||
DateTime nextLoopDateTime = startDateTime + timeFromStart;
|
||||
|
||||
while (DateTime.Now < nextLoopDateTime)
|
||||
while (DateTime.Now < nextTickDateTime)
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
if (quitStateMachine) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user