Compare commits

...
Author SHA1 Message Date
Milan Hanajik 0bde5ffc74 Reconfigured for SLM-50 2017-05-29 15:26:16 +02:00
Milan Hanajik c669d723b5 Automated renaming of paths and transitions, parts 3,4. 2017-05-29 15:24:42 +02:00
Milan Hanajik 8286c6adc6 ver. 2.12.567 2017-05-25 17:15:03 +02:00
Milan Hanajik 0f0f9421e7 Previous results display fixed, ver. 2.12.566 2017-05-25 17:06:14 +02:00
Milan Hanajik daf793d0b1 Automated renaming of paths and transitions, part 2. 2017-05-25 16:33:44 +02:00
Milan Hanajik db555a7a71 tstRslt.FlowMin evaluated, saved to Oracle DB only. 2017-05-25 13:00:43 +02:00
Milan Hanajik b30c965cb4 Config ver. 2.12.565 2017-05-25 12:50:13 +02:00
Milan Hanajik 7c702b8155 Automated renaming of paths and transition sequences, part 1. 2017-05-25 12:40:18 +02:00
Milan Hanajik d139f355e6 Czech BenchControlPanel changes. 2017-05-25 10:38:03 +02:00
Milan Hanajik e448cafd8d ver. 2.12.565 2017-05-24 15:00:28 +02:00
Milan Hanajik 1a883425d5 Results items : Tooltips added. 2017-05-24 15:00:12 +02:00
Milan Hanajik 09d60648da On screen results use new style of configuration, part 2: ResultsConfigCtrl added. 2017-05-24 11:33:08 +02:00
Milan Hanajik e758407479 On screen results use new style of configuration, ver. 2.12.564 2017-05-19 14:42:56 +02:00
Milan Hanajik 13d65a0be4 Old style ResultsPrinters.Basic removed. 2017-05-19 11:29:39 +02:00
Milan Hanajik 784ebcb1d6 Q_ref_mean and many other result items added, ver. 2.12.563 2017-05-19 11:29:04 +02:00
Milan Hanajik 2387ab28fa Results, ResultsBrowser: iPerl specific results added, Passed item fixed for a water meter (it was correct only for a test), ver. 2.12.561 2017-05-16 19:41:31 +02:00
Milan Hanajik 84a7f21dfa ResultsBrowser supports 5 test benches (connection strings and UI). 2017-05-16 09:58:22 +02:00
Milan Hanajik 72b7af914e Bug fix: Missing 'using' for ORACLE_DB 2017-05-16 09:57:49 +02:00
Milan Hanajik e522ea0a85 DataEntry changes specific to SLM50 undone. 2017-05-12 15:03:29 +02:00
Milan Hanajik daf8b6ddee FixedStartMassCollection : Test time fixed, cBrd.TTime not used. 2017-05-12 15:02:36 +02:00
Milan Hanajik b1c54c9182 Bug fix 2017-05-12 09:01:19 +02:00
Milan Hanajik 36b3f31352 ver. 2.12.556 2017-05-11 13:43:01 +02:00
Milan Hanajik 261d3a7406 SequenceBase.LogProcessDataHeader() added. 2017-05-11 13:34:17 +02:00
Milan Hanajik 8c7d418b89 UpdateTempPressDensAmb(tstRslt) function added to SequenceBase, used by all sequences. 2017-05-11 13:34:14 +02:00
Milan Hanajik 954e9db303 German language, etc. 2017-05-11 13:34:11 +02:00
100 changed files with 3733 additions and 3665 deletions
+2 -2
View File
@@ -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>
+4 -3
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -11,8 +11,9 @@ namespace Config.Entities
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
public virtual float Qto { get; set; } /// Water flow in [m3/h]
public virtual string OriName { get; set; } /// Not mapped to database
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
public virtual float Qto { get; set; } /// Water flow in [m3/h]
public virtual string TempMtrUp { get; set; }
public virtual string TempMtrDown { get; set; }
public virtual string PressMtrUp { get; set; }
+13 -4
View File
@@ -48,9 +48,19 @@ namespace Config.Entities
/// <summary> Kind of meters for the procedure / test </summary>
public enum MetersKind
{
Single,
Combined,
HeatMeter,
#if LANG_DE
[Description("Wasserzähler")] Single,
[Description("Verbundwasserzähler")] Combined,
[Description("Wärmezähler")] HeatMeter,
#elif LANG_CS
[Description("Vodoměry")] Single,
[Description("Kombinované vodoměry")] Combined,
[Description("Měřiče tepla")] HeatMeter,
#else
[Description("Water meters")] Single,
[Description("Compound water meters")] Combined,
[Description("Heat meters")] HeatMeter,
#endif
}
public enum CompoundMeterId : byte
@@ -354,4 +364,3 @@ namespace Config.Entities
Count
}
}
+2 -1
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -11,6 +11,7 @@ namespace Config.Entities
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string OriName { get; set; } /// Not mapped to database
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
public virtual float Qto { get; set; } /// Water flow in [m3/h]
public virtual string Pump { get; set; }
+2 -1
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2016 Sensus Metering Systems
/// Copyright (c) 2016-2017 Sensus Metering Systems
///
using System;
@@ -10,6 +10,7 @@ namespace Config.Entities
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string OriName { get; set; } /// Not mapped to database
public virtual float TempWarmFrom { get; set; } /// Warm temperature range from [°C]
public virtual float TempWarmTo { get; set; } /// Warm temperature range to [°C]
+2 -1
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -11,6 +11,7 @@ namespace Config.Entities
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string OriName { get; set; } /// Not mapped to database
/// Sensors
public virtual string Sensor1 { get; set; }
+2 -1
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -11,6 +11,7 @@ namespace Config.Entities
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string OriName { get; set; } /// Not mapped to database
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
public virtual float Qto { get; set; } /// Water flow in [m3/h]
public virtual string RegulValve { get; set; }
+2 -1
View File
@@ -13,7 +13,8 @@ namespace Config.Entities
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string Description { get; set; } /// Short description
public virtual string OriName { get; set; } /// Not mapped to database
public virtual string Description { get; set; } /// Short description
public virtual IList<TransitionStep> TransitionSteps { get; set; }
public TransitionSequence()
+2 -1
View File
@@ -11,7 +11,8 @@ namespace Config.Entities
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string Description { get; set; } /// Short description
public virtual string OriName { get; set; } /// Not mapped to database
public virtual string Description { get; set; } /// Short description
public virtual IList<VirtualBenchStep> VirtualBenchSteps { get; set; }
public VirtualBenchSequence()
+2 -2
View File
@@ -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.12.537.0")]
[assembly: AssemblyFileVersion("2.12.537.0")]
[assembly: AssemblyVersion("2.12.566.0")]
[assembly: AssemblyFileVersion("2.12.566.0")]
+3 -3
View File
@@ -40,7 +40,7 @@ namespace Results.Entities
TestRslts = new List<TestRslt>();
}
public virtual float AmbientTempAve()
public virtual float AmbTempMean()
{
if (TestRslts.Count == 0) return 0;
float sum = 0;
@@ -48,7 +48,7 @@ namespace Results.Entities
return sum / TestRslts.Count;
}
public virtual float AmbientPressAve()
public virtual float AmbPressMean()
{
if (TestRslts.Count == 0) return 0;
float sum = 0;
@@ -56,7 +56,7 @@ namespace Results.Entities
return sum / TestRslts.Count;
}
public virtual float AmbientHumiAve()
public virtual float AmbHumiMean()
{
if (TestRslts.Count == 0) return 0;
float sum = 0;
+6 -5
View File
@@ -86,10 +86,11 @@ namespace Results.Entities
public virtual float TempDivEnd { get; set; } /// [°C]
public virtual float TempDivMin { get; set; } /// [°C]
public virtual float TempDivMax { get; set; } /// [°C]
public virtual float FlowStart { get; set; } /// [m3/h] minimum flow
public virtual float FlowEnd { get; set; } /// [m3/h] maximum flow
public virtual float FlowMin { get; set; } /// [m3/h] minimum flow
public virtual float FlowMax { get; set; } /// [m3/h] maximum flow
public virtual float FlowStart { get; set; } /// [m3/h] flow at the start of test from the reference flowmeter
public virtual float FlowEnd { get; set; } /// [m3/h] flow at the end of test from the reference flowmeter
public virtual float FlowMean { get; set; } /// [m3/h] mean flow from the reference flowmeter
public virtual float FlowMin { get; set; } /// [m3/h] not mapped to DB
public virtual float FlowMax { get; set; } /// [m3/h]
public virtual float Custom1 { get; set; } /// [°C] T ref hi mean
public virtual float Custom2 { get; set; } /// [°C] T ref hi start
@@ -204,7 +205,7 @@ namespace Results.Entities
TempDivMax = src.TempDivMax;
FlowStart = src.FlowStart;
FlowEnd = src.FlowEnd;
FlowMin = src.FlowMin;
FlowMean = src.FlowMean;
FlowMax = src.FlowMax;
Custom1 = src.Custom1;
Custom2 = src.Custom2;
+11
View File
@@ -87,6 +87,17 @@ namespace Results.Entities
return passed;
}
public virtual string PassedColorStr()
{
#if PUCHONG_PT200
return Passed ? "OK|Green" : "NG|Red";
#else
return Passed ? "OK|Green" : "NOK|Red";
#endif
}
///
/// Not mapped to the database
///
+67 -85
View File
@@ -27,8 +27,9 @@ namespace Results.Forms
public TestsArrangement TestsArrangement;
public int NrMetersInOneGroup;
public IList<Results.ItemSpec> RsltItems_Screen_SingleWM;
public IList<Results.ItemSpec> RsltItems_Screen_CombinedWM;
public IList<Results.WMeterRsltItemSpec> RsltItems_Screen_SingleWM;
public IList<Results.WMeterRsltItemSpec> RsltItems_Screen_CombinedWM;
public IList<Results.WMeterRsltItemSpec> RsltItems_Screen_HeatM;
public int[] RsltsClmnWidths { set { rsltsClmnWidths = value; } }
public int PopupResultsLeft;
@@ -42,7 +43,7 @@ namespace Results.Forms
/// Private members
///
Results.BatchResults results;
bool compound;
MetersKind metersKind;
ListView firstListView;
public int[] rsltsClmnWidths;
@@ -87,6 +88,23 @@ namespace Results.Forms
}
IList<Results.WMeterRsltItemSpec> GetRsltItems(MetersKind metersKind)
{
IList<Results.WMeterRsltItemSpec> srcItems;
switch (metersKind)
{
default:
case MetersKind.Single: srcItems = RsltItems_Screen_SingleWM; break;
case MetersKind.Combined: srcItems = RsltItems_Screen_CombinedWM; break;
case MetersKind.HeatMeter: srcItems = RsltItems_Screen_HeatM; break;
}
IList<Results.WMeterRsltItemSpec> copiedItems = new List<Results.WMeterRsltItemSpec>();
foreach (var it in srcItems) copiedItems.Add(it.Clone());
return copiedItems;
}
/// <summary>
/// Re-draw the results. Apply new settings if they changed.
/// </summary>
@@ -109,7 +127,7 @@ namespace Results.Forms
}
int metersInOneGroup = Math.Max(1, Math.Min(enabledWMsCount, NrMetersInOneGroup));
int nrGroups = Math.Max(1, (enabledWMsCount + NrMetersInOneGroup - 1) / metersInOneGroup);
int nrGroups = Math.Max(1, (enabledWMsCount + metersInOneGroup - 1) / metersInOneGroup);
if (MetersArrangement == MetersArrangement.Horizontally)
{
@@ -211,20 +229,21 @@ namespace Results.Forms
/// <returns>ListView object</returns>
ListView GetResultsTestsAreRows(Results.Entities.WaterMeter wMtr, int printedWMNr)
{
compound = wMtr.Compound();
metersKind = wMtr.Compound() ? MetersKind.Combined : (wMtr.HeatMeter() ? MetersKind.HeatMeter : MetersKind.Single);
ListView lview = GetListView();
IList<Results.ItemSpec> items = (compound ? RsltItems_Screen_CombinedWM : RsltItems_Screen_SingleWM);
IList<Results.WMeterRsltItemSpec> items = GetRsltItems(metersKind);
if (items == null || items.Count == 0) return lview;
// Header
lview.Columns.Add(printedWMNr.ToString(), (rsltsClmnCount > 0) ? rsltsClmnWidths[0] : 40);
int i = 1;
int col = 1;
foreach (var item in items)
{
lview.Columns.Add(item.ClmnHeaderText, (rsltsClmnCount > i) ? rsltsClmnWidths[i] : 70);
i++;
lview.Columns.Add(item.Caption, (rsltsClmnCount > col) ? rsltsClmnWidths[col] : 70);
col++;
}
@@ -232,29 +251,21 @@ namespace Results.Forms
int ix = 0;
foreach (var mtr in wMtr.MeterTestRslts)
{
if ((mtr.CompoundMeterId == (byte)CompoundMeterId.Single || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
&& mtr.TestDone
&& (mtr.Publish() != Config.Entities.Publish.Never)
&& (mtr.Publish() != Config.Entities.Publish.Internal))
if (mtr != null &&
(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)
{
ListViewItem lvi = new ListViewItem(testNames[ix++]);
foreach (var item in items)
for (int i = 0; i < items.Count; i++)
{
string str;
if (compound)
{
var main = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
var aux = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
str = (item.CanPrintCompoundMeter && main != null && aux != null)
? item.PrintCombined(main, aux, mtr)
: string.Empty;
}
else
{
str = item.CanPrintSingle ? item.Print(mtr) : string.Empty;
}
string str = items[i].Print(wMtr, mtr.Name());
/// Extract and use color information
string[] texts = str.Split(new char[] { '|' });
if (texts.Length == 1)
{
@@ -288,11 +299,12 @@ namespace Results.Forms
/// <returns>ListView object</returns>
ListView GetResultsTestsAreColumns(Results.Entities.WaterMeter wMtr, int printedWMNr)
{
compound = wMtr.Compound();
metersKind = wMtr.Compound() ? MetersKind.Combined : (wMtr.HeatMeter() ? MetersKind.HeatMeter : MetersKind.Single);
ListView lview = GetListView();
IList<Results.ItemSpec> items = (compound ? RsltItems_Screen_CombinedWM : RsltItems_Screen_SingleWM);
IList<Results.WMeterRsltItemSpec> items = GetRsltItems(metersKind);
if (items == null || items.Count == 0) return lview;
// Header
@@ -306,69 +318,39 @@ namespace Results.Forms
foreach (var item in items)
{
ListViewItem lvi = new ListViewItem(item.ClmnHeaderText);
if (compound)
ListViewItem lvi = new ListViewItem(item.Caption);
foreach (var mtr in wMtr.MeterTestRslts)
{
foreach (var mtr in wMtr.MeterTestRslts)
if (mtr != null &&
(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)
{
if (mtr.CompoundMeterId == (byte)CompoundMeterId.Compound && mtr.TestDone
&& (mtr.Publish() != Config.Entities.Publish.Never)
&& (mtr.Publish() != Config.Entities.Publish.Internal))
string str = items[i].Print(wMtr, mtr.Name());
string[] texts = str.Split(new char[] { '|' });
if (texts.Length == 1)
{
var main = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
var aux = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
string str = (item.CanPrintCompoundMeter && main != null && aux != null)
? item.PrintCombined(main, aux, mtr)
: string.Empty;
string[] texts = str.Split(new char[] { '|' });
if (texts.Length == 1)
{
lvi.SubItems.Add(str);
}
else if (texts.Length == 2)
{
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
lvi.UseItemStyleForSubItems = false;
lvi.SubItems.Add(texts[0]);
lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
}
else
{
lvi.SubItems.Add(string.Empty);
}
lvi.SubItems.Add(str);
}
else if (texts.Length == 2)
{
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
lvi.UseItemStyleForSubItems = false;
lvi.SubItems.Add(texts[0]);
lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
}
else
{
lvi.SubItems.Add(string.Empty);
}
}
}
else
{
foreach (var mtr in wMtr.MeterTestRslts)
{
if (mtr.TestDone && (mtr.Publish() != Config.Entities.Publish.Never)
&& (mtr.Publish() != Config.Entities.Publish.Internal))
{
string str = !item.CanPrintSingle ? string.Empty : item.Print(mtr);
string[] texts = str.Split(new char[] { '|' });
if (texts.Length == 1)
{
lvi.SubItems.Add(str);
}
else if (texts.Length == 2)
{
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
lvi.UseItemStyleForSubItems = false;
lvi.SubItems.Add(texts[0]);
lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
}
else
{
lvi.SubItems.Add(string.Empty);
}
}
}
}
lview.Items.Add(lvi);
}
+257
View File
@@ -0,0 +1,257 @@
namespace Results.Forms
{
partial class ResultsConfigCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.availableTabControl = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.availableAlphabeticTreeView = new System.Windows.Forms.TreeView();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.availableByQuantityTreeView = new System.Windows.Forms.TreeView();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.availableByCategoryTreeView = new System.Windows.Forms.TreeView();
this.downButton = new System.Windows.Forms.Button();
this.upButton = new System.Windows.Forms.Button();
this.selectedResultsListViewEx = new Results.Forms.ListViewEx();
this.removeAllButton = new System.Windows.Forms.Button();
this.removeButton = new System.Windows.Forms.Button();
this.addButton = new System.Windows.Forms.Button();
this.selectedResultsLabel = new System.Windows.Forms.Label();
this.availableResultsLabel = new System.Windows.Forms.Label();
this.availableTabControl.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.SuspendLayout();
//
// availableTabControl
//
this.availableTabControl.Controls.Add(this.tabPage1);
this.availableTabControl.Controls.Add(this.tabPage2);
this.availableTabControl.Controls.Add(this.tabPage3);
this.availableTabControl.Enabled = false;
this.availableTabControl.Location = new System.Drawing.Point(9, 33);
this.availableTabControl.Name = "availableTabControl";
this.availableTabControl.SelectedIndex = 0;
this.availableTabControl.Size = new System.Drawing.Size(206, 453);
this.availableTabControl.TabIndex = 59;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.availableAlphabeticTreeView);
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(198, 427);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "A...Z";
this.tabPage1.UseVisualStyleBackColor = true;
//
// availableAlphabeticTreeView
//
this.availableAlphabeticTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableAlphabeticTreeView.Location = new System.Drawing.Point(3, 3);
this.availableAlphabeticTreeView.Name = "availableAlphabeticTreeView";
this.availableAlphabeticTreeView.Size = new System.Drawing.Size(192, 421);
this.availableAlphabeticTreeView.TabIndex = 0;
this.availableAlphabeticTreeView.DoubleClick += new System.EventHandler(this.availableAlphabeticTreeView_DoubleClick);
//
// tabPage2
//
this.tabPage2.Controls.Add(this.availableByQuantityTreeView);
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(198, 427);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "by quantity";
this.tabPage2.UseVisualStyleBackColor = true;
//
// availableByQuantityTreeView
//
this.availableByQuantityTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableByQuantityTreeView.Location = new System.Drawing.Point(3, 3);
this.availableByQuantityTreeView.Name = "availableByQuantityTreeView";
this.availableByQuantityTreeView.Size = new System.Drawing.Size(192, 421);
this.availableByQuantityTreeView.TabIndex = 0;
this.availableByQuantityTreeView.DoubleClick += new System.EventHandler(this.availableByQuantityTreeView_DoubleClick);
//
// tabPage3
//
this.tabPage3.Controls.Add(this.availableByCategoryTreeView);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(198, 427);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "by category";
this.tabPage3.UseVisualStyleBackColor = true;
//
// availableByCategoryTreeView
//
this.availableByCategoryTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableByCategoryTreeView.Location = new System.Drawing.Point(0, 0);
this.availableByCategoryTreeView.Name = "availableByCategoryTreeView";
this.availableByCategoryTreeView.Size = new System.Drawing.Size(198, 427);
this.availableByCategoryTreeView.TabIndex = 0;
this.availableByCategoryTreeView.DoubleClick += new System.EventHandler(this.availableByCategoryTreeView_DoubleClick);
//
// downButton
//
this.downButton.Enabled = false;
this.downButton.Location = new System.Drawing.Point(221, 351);
this.downButton.Name = "downButton";
this.downButton.Size = new System.Drawing.Size(93, 30);
this.downButton.TabIndex = 58;
this.downButton.Text = "Down";
this.downButton.UseVisualStyleBackColor = true;
this.downButton.Click += new System.EventHandler(this.downButton_Click);
//
// upButton
//
this.upButton.Enabled = false;
this.upButton.Location = new System.Drawing.Point(221, 315);
this.upButton.Name = "upButton";
this.upButton.Size = new System.Drawing.Size(93, 30);
this.upButton.TabIndex = 57;
this.upButton.Text = "Up";
this.upButton.UseVisualStyleBackColor = true;
this.upButton.Click += new System.EventHandler(this.upButton_Click);
//
// selectedResultsListViewEx
//
this.selectedResultsListViewEx.AllowColumnReorder = true;
this.selectedResultsListViewEx.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.selectedResultsListViewEx.DoubleClickActivation = false;
this.selectedResultsListViewEx.Enabled = false;
this.selectedResultsListViewEx.FullRowSelect = true;
this.selectedResultsListViewEx.GridLines = true;
this.selectedResultsListViewEx.Location = new System.Drawing.Point(322, 33);
this.selectedResultsListViewEx.Name = "selectedResultsListViewEx";
this.selectedResultsListViewEx.Size = new System.Drawing.Size(594, 453);
this.selectedResultsListViewEx.TabIndex = 56;
this.selectedResultsListViewEx.UseCompatibleStateImageBehavior = false;
this.selectedResultsListViewEx.View = System.Windows.Forms.View.Details;
this.selectedResultsListViewEx.DoubleClick += new System.EventHandler(this.selectedResultsListViewEx_DoubleClick);
//
// removeAllButton
//
this.removeAllButton.Enabled = false;
this.removeAllButton.Location = new System.Drawing.Point(221, 223);
this.removeAllButton.Name = "removeAllButton";
this.removeAllButton.Size = new System.Drawing.Size(94, 30);
this.removeAllButton.TabIndex = 55;
this.removeAllButton.Text = "<< R&emove all";
this.removeAllButton.UseVisualStyleBackColor = true;
this.removeAllButton.Click += new System.EventHandler(this.removeAllButton_Click);
//
// removeButton
//
this.removeButton.Enabled = false;
this.removeButton.Location = new System.Drawing.Point(221, 188);
this.removeButton.Name = "removeButton";
this.removeButton.Size = new System.Drawing.Size(93, 30);
this.removeButton.TabIndex = 54;
this.removeButton.Text = "< &Remove";
this.removeButton.UseVisualStyleBackColor = true;
this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
//
// addButton
//
this.addButton.Enabled = false;
this.addButton.Location = new System.Drawing.Point(221, 153);
this.addButton.Name = "addButton";
this.addButton.Size = new System.Drawing.Size(93, 30);
this.addButton.TabIndex = 53;
this.addButton.Text = "&Add >";
this.addButton.UseVisualStyleBackColor = true;
this.addButton.Click += new System.EventHandler(this.addButton_Click);
//
// selectedResultsLabel
//
this.selectedResultsLabel.AutoSize = true;
this.selectedResultsLabel.Location = new System.Drawing.Point(321, 11);
this.selectedResultsLabel.Name = "selectedResultsLabel";
this.selectedResultsLabel.Size = new System.Drawing.Size(85, 13);
this.selectedResultsLabel.TabIndex = 52;
this.selectedResultsLabel.Text = "Selected results:";
//
// availableResultsLabel
//
this.availableResultsLabel.AutoSize = true;
this.availableResultsLabel.Location = new System.Drawing.Point(11, 11);
this.availableResultsLabel.Name = "availableResultsLabel";
this.availableResultsLabel.Size = new System.Drawing.Size(86, 13);
this.availableResultsLabel.TabIndex = 51;
this.availableResultsLabel.Text = "Available results:";
//
// ResultsConfigCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.availableTabControl);
this.Controls.Add(this.downButton);
this.Controls.Add(this.upButton);
this.Controls.Add(this.selectedResultsListViewEx);
this.Controls.Add(this.removeAllButton);
this.Controls.Add(this.removeButton);
this.Controls.Add(this.addButton);
this.Controls.Add(this.selectedResultsLabel);
this.Controls.Add(this.availableResultsLabel);
this.Name = "ResultsConfigCtrl";
this.Size = new System.Drawing.Size(925, 496);
this.Load += new System.EventHandler(this.ResultsConfigCtrl_Load);
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.ResultsConfigCtrl_KeyPress);
this.availableTabControl.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TabControl availableTabControl;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TreeView availableAlphabeticTreeView;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TreeView availableByQuantityTreeView;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.TreeView availableByCategoryTreeView;
private System.Windows.Forms.Button downButton;
private System.Windows.Forms.Button upButton;
private ListViewEx selectedResultsListViewEx;
private System.Windows.Forms.Button removeAllButton;
private System.Windows.Forms.Button removeButton;
private System.Windows.Forms.Button addButton;
private System.Windows.Forms.Label selectedResultsLabel;
private System.Windows.Forms.Label availableResultsLabel;
}
}
+517
View File
@@ -0,0 +1,517 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using log4net;
using Config.Entities;
using Results;
using Results.Resources;
namespace Results.Forms
{
public partial class ResultsConfigCtrl : UserControl
{
/// <summary>
/// ListViewEx columns
/// </summary>
enum Column
{
Item,
Caption,
Units,
Format,
Precision,
Width,
Alignment,
TestID,
Count,
}
Control[] editors; /// all editors except of units
ComboBox unitsCB; /// units combo box
public MetersKind MetersKind;
public IList<WMeterRsltItemSpec> SelectedItems;
public bool SupressTestIDColumn;
public bool Unlocked
{
set
{
availableTabControl.Enabled = value;
selectedResultsListViewEx.Enabled = value;
addButton.Enabled = value;
removeButton.Enabled = value;
removeAllButton.Enabled = value;
upButton.Enabled = value;
downButton.Enabled = value;
unlocked = value;
}
get { return unlocked; }
}
bool unlocked;
public ResultsConfigCtrl(bool supressTestIDColumn)
: this()
{
this.SupressTestIDColumn = supressTestIDColumn;
}
public ResultsConfigCtrl()
{
InitializeComponent();
}
void Localize()
{
Text = Strings.Configuration;
availableResultsLabel.Text = Strings.Available_results;
availableTabControl.TabPages[0].Text = "A...Z";
availableTabControl.TabPages[1].Text = Strings.Quantity;
availableTabControl.TabPages[2].Text = Strings.Category;
selectedResultsLabel.Text = Strings.Selected_results;
addButton.Text = Strings.Add;
removeButton.Text = Strings.Remove;
removeAllButton.Text = Strings.Remove_all;
upButton.Text = Strings.UpBtnText;
downButton.Text = Strings.DownBtnText;
}
private void ResultsConfigCtrl_Load(object sender, EventArgs e)
{
Localize();
/// Add columns to ListViewEx
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Item, Width = 120 });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Caption });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Units });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Format });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Precision });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Width });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Alignment });
if (!SupressTestIDColumn)
{
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Test_ID });
}
/// Create controls used by ListViewEx to edit items
unitsCB = new ComboBox();
ComboBox alignmentCB = new ComboBox();
for (Config.Entities.Alignment a = 0; a < Config.Entities.Alignment.Count; a++)
{
alignmentCB.Items.Add(a.ToDescription());
}
editors = new Control[]
{
null,
new TextBox(), /// caption
unitsCB,
new TextBox(), /// format
new TextBox(), /// precision
new TextBox(), /// width
alignmentCB,
new TextBox(), /// testID
};
foreach (var edi in editors)
{
if (edi != null)
{
edi.Visible = false;
Controls.Add(edi);
}
}
selectedResultsListViewEx.SubItemClicked += new SubItemEventHandler(selectedResultsListViewEx_SubItemClicked);
selectedResultsListViewEx.SubItemEndEditing += new SubItemEndEditingEventHandler(selectedResultsListViewEx_SubItemEndEditing);
availableAlphabeticTreeView.ShowNodeToolTips = true;
availableByQuantityTreeView.ShowNodeToolTips = true;
availableByCategoryTreeView.ShowNodeToolTips = true;
RedrawAvailable();
RedrawSelected();
}
void selectedResultsListViewEx_SubItemClicked(object sender, SubItemEventArgs e)
{
if (e.SubItem == (int)Column.Units)
{
Config.Quantity quantity = (e.Item.Tag as WMeterRsltItemSpec).Quantity;
unitsCB.Items.Clear();
unitsCB.Items.Add(Config.Unit.None.ToDescription()); /// "---"
for (Config.Unit u = (Config.Unit)1; u < Config.Unit.Count; u++)
{
if (Config.Units.IsQuantity(u, quantity)) unitsCB.Items.Add(u.ToDescription());
}
selectedResultsListViewEx.StartEditing(unitsCB, e.Item, e.SubItem);
}
else if ((e.SubItem > 0) && (e.SubItem < (int)(SupressTestIDColumn ? Column.TestID : Column.Count)))
{
selectedResultsListViewEx.StartEditing(editors[e.SubItem], e.Item, e.SubItem);
}
}
void selectedResultsListViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e)
{
ListViewItem lvi = e.Item;
WMeterRsltItemSpec item = lvi.Tag as WMeterRsltItemSpec;
switch ((Column)e.SubItem)
{
case Column.Caption: item.Caption = e.DisplayText; return;
case Column.Units:
for (Config.Unit u = 0; u < Config.Unit.Count; u++)
{
if (u.ToDescription().Equals(unitsCB.Text))
{
item.Units = u;
return; /// OK
}
}
break; /// Error
case Column.Format: item.Format = e.DisplayText; return;
case Column.Precision: item.Precision = e.DisplayText; return;
case Column.Width:
{
int width;
if (Int32.TryParse(editors[e.SubItem].Text, out width) && width >= 0)
{
item.Width = width;
return; /// OK
}
break; /// Error
}
case Column.Alignment:
for (Config.Entities.Alignment a = 0; a < Config.Entities.Alignment.Count; a++)
{
if (a.ToDescription().Equals(editors[e.SubItem].Text))
{
item.Alignment = a;
return;
}
}
break; /// Error
case Column.TestID: item.TestID = e.DisplayText; return;
default:
return; /// OK
}
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
e.Cancel = true;
return;
}
/// <summary>
/// Redraw available items (right hand side)
/// </summary>
void RedrawAvailable()
{
RedrawInAlphabeticOrder(availableAlphabeticTreeView);
RedrawByQuantity(availableByQuantityTreeView);
RedrawByCategory(availableByCategoryTreeView);
}
void RedrawInAlphabeticOrder(TreeView treeView)
{
treeView.Nodes.Clear();
IList<WMeterRsltItemSpec> alphabeticlList = WMeterRsltItemSpec.AllItems.OrderBy(x => x.Name).ToList();
///
foreach (var item in alphabeticlList)
{
TreeNode node = new TreeNode(item.Name);
node.Tag = item;
node.ToolTipText = item.ToolTipText;
availableAlphabeticTreeView.Nodes.Add(node);
}
}
void RedrawByQuantity(TreeView treeView)
{
treeView.Nodes.Clear();
IList<Config.Quantity> quantities = new List<Config.Quantity>();
for (Config.Quantity q = 0; q < Config.Quantity.Count; q++) quantities.Add(q);
IList<Config.Quantity> sortedQuantities = quantities.OrderBy(x => x.ToDescription()).ToList();
foreach (var q in sortedQuantities)
{
int n = 0;
foreach (var ri in WMeterRsltItemSpec.AllItems)
{
if (ri.Quantity == q) n++;
}
if (n > 0)
{
TreeNode[] array = new TreeNode[n];
int i = 0;
foreach (var ri in WMeterRsltItemSpec.AllItems)
{
if (ri.Quantity == q)
{
TreeNode node = new TreeNode(ri.Name);
node.Tag = ri;
node.ToolTipText = ri.ToolTipText;
array[i++] = node;
}
}
treeView.Nodes.Add(new TreeNode(q.ToDescription(), array));
}
}
}
void RedrawByCategory(TreeView treeView)
{
treeView.Nodes.Clear();
IList<ItemCategory> categories = new List<ItemCategory>();
for (ItemCategory c = 0; c < ItemCategory.Count; c++) categories.Add(c);
IList<ItemCategory> sortedCategories = categories.OrderBy(x => x.ToDescription()).ToList();
foreach (var c in sortedCategories)
{
int n = 0;
foreach (var ri in WMeterRsltItemSpec.AllItems)
{
if (ri.Category == c) n++;
}
if (n > 0)
{
TreeNode[] array = new TreeNode[n];
int i = 0;
foreach (var ri in WMeterRsltItemSpec.AllItems)
{
if (ri.Category == c)
{
TreeNode node = new TreeNode(ri.Name);
node.Tag = ri;
node.ToolTipText = ri.ToolTipText;
array[i++] = node;
}
}
treeView.Nodes.Add(new TreeNode(c.ToDescription(), array));
}
}
}
/// <summary>
/// Redraw selected items (right hand side)
/// </summary>
void RedrawSelected()
{
selectedResultsListViewEx.Items.Clear();
if (SelectedItems == null) return;
foreach (var item in SelectedItems)
{
ListViewItem lvi = new ListViewItem(item.Name); /// Item
lvi.Tag = item;
lvi.SubItems.Add(item.Caption); /// Header
lvi.SubItems.Add(item.Units.ToDescription()); /// Units
lvi.SubItems.Add(item.Format); /// Format
lvi.SubItems.Add(item.Precision); /// Precision
lvi.SubItems.Add(item.Width.ToString()); /// Width
lvi.SubItems.Add(item.Alignment.ToDescription()); /// Alignment
if (!SupressTestIDColumn)
{
lvi.SubItems.Add(item.TestID); /// TestID
}
selectedResultsListViewEx.Items.Add(lvi);
}
}
void UpdateSelectedFromView()
{
}
void addButton_Click(object sender, EventArgs e)
{
switch (availableTabControl.SelectedIndex)
{
case 0:
availableAlphabeticTreeView_DoubleClick(this, null);
break;
case 1:
availableByQuantityTreeView_DoubleClick(this, null);
break;
case 2:
availableByCategoryTreeView_DoubleClick(this, null);
break;
default:
break;
}
}
private void availableAlphabeticTreeView_DoubleClick(object sender, EventArgs e)
{
if (availableAlphabeticTreeView.SelectedNode != null &&
availableAlphabeticTreeView.SelectedNode.Tag is WMeterRsltItemSpec)
{
AddItem(availableAlphabeticTreeView.SelectedNode.Tag as WMeterRsltItemSpec);
}
}
private void availableByQuantityTreeView_DoubleClick(object sender, EventArgs e)
{
if (availableByQuantityTreeView.SelectedNode != null &&
availableByQuantityTreeView.SelectedNode.Tag is WMeterRsltItemSpec)
{
AddItem(availableByQuantityTreeView.SelectedNode.Tag as WMeterRsltItemSpec);
}
}
private void availableByCategoryTreeView_DoubleClick(object sender, EventArgs e)
{
if (availableByCategoryTreeView.SelectedNode != null &&
availableByCategoryTreeView.SelectedNode.Tag is WMeterRsltItemSpec)
{
AddItem(availableByCategoryTreeView.SelectedNode.Tag as WMeterRsltItemSpec);
}
}
void AddItem(WMeterRsltItemSpec item)
{
WMeterRsltItemSpec newItem = item.Clone();
newItem.Caption = newItem.Name;
SelectedItems.Add(newItem);
RedrawSelected();
/// Select the last item
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[SelectedItems.Count - 1].Selected = true;
selectedResultsListViewEx.Items[SelectedItems.Count - 1].EnsureVisible();
}
private void selectedResultsListViewEx_DoubleClick(object sender, EventArgs e)
{
/// Double click works when just one item is selected
if (selectedResultsListViewEx.SelectedIndices.Count == 1)
{
SelectedItems.RemoveAt(selectedResultsListViewEx.SelectedIndices[0]);
RedrawAvailable();
RedrawSelected();
}
}
void removeButton_Click(object sender, EventArgs e)
{
/// Remove from the list (the last selected item first so that the indexes are not affected)
for (int i = selectedResultsListViewEx.SelectedIndices.Count - 1; i >= 0; i--)
{
SelectedItems.RemoveAt(selectedResultsListViewEx.SelectedIndices[i]);
}
RedrawAvailable();
RedrawSelected();
}
void removeAllButton_Click(object sender, EventArgs e)
{
/// Remove all items from 'Selected' list
SelectedItems.Clear();
RedrawAvailable();
RedrawSelected();
}
//void okButton_Click(object sender, EventArgs e)
//{
// DialogResult = DialogResult.OK;
// Close();
//}
private void ResultsConfigCtrl_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
}
private void upButton_Click(object sender, EventArgs e)
{
if (selectedResultsListViewEx.SelectedIndices.Count != 1) return;
int selIdx = selectedResultsListViewEx.SelectedIndices[0];
if (selIdx == 0)
{
/// Cannot move up
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[0].Selected = true;
return;
}
WMeterRsltItemSpec tmp = SelectedItems[selIdx - 1];
SelectedItems[selIdx - 1] = SelectedItems[selIdx];
SelectedItems[selIdx] = tmp;
RedrawSelected();
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[selIdx - 1].Selected = true;
selectedResultsListViewEx.Items[selIdx - 1].EnsureVisible();
}
private void downButton_Click(object sender, EventArgs e)
{
if (selectedResultsListViewEx.SelectedIndices.Count != 1) return;
int selIdx = selectedResultsListViewEx.SelectedIndices[0];
if (selIdx == SelectedItems.Count - 1)
{
/// Cannot move down
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[SelectedItems.Count - 1].Selected = true;
return;
}
WMeterRsltItemSpec tmp = SelectedItems[selIdx + 1];
SelectedItems[selIdx + 1] = SelectedItems[selIdx];
SelectedItems[selIdx] = tmp;
RedrawSelected();
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[selIdx + 1].Selected = true;
selectedResultsListViewEx.Items[selIdx + 1].EnsureVisible();
}
//private void cancelButton_Click(object sender, EventArgs e)
//{
// DialogResult = DialogResult.Cancel;
// Close();
//}
private void availableByCategoryTreeView_NodeMouseHover2(object sender, TreeNodeMouseHoverEventArgs e)
{
ToolTip toolTip = new ToolTip();
toolTip.SetToolTip(this, e.Node.ToolTipText);
}
}
}
+15 -454
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2016 Sensus Metering Systems
/// Copyright (c) 2016-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -14,497 +14,58 @@ namespace Results.Forms
{
public partial class ResultsConfigDlg : Form
{
/// <summary>
/// ListViewEx columns
/// </summary>
enum Column
public IList<WMeterRsltItemSpec> SelectedItems
{
Item,
Caption,
Units,
Format,
Precision,
Width,
Alignment,
TestID,
Count,
set { resultsConfigCtrl.SelectedItems = value; }
get { return resultsConfigCtrl.SelectedItems; }
}
Control[] editors; /// all editors except of units
ComboBox unitsCB; /// units combo box
public IList<WMeterRsltItemSpec> AvailableItems;
public IList<WMeterRsltItemSpec> SelectedItems;
public MetersKind MetersKind;
bool supressTestIDColumn;
public MetersKind MetersKind
{
set { resultsConfigCtrl.MetersKind = value; }
}
public ResultsConfigDlg(bool supressTestIDColumn)
: this()
{
this.supressTestIDColumn = supressTestIDColumn;
resultsConfigCtrl.SupressTestIDColumn = supressTestIDColumn;
}
public ResultsConfigDlg()
{
InitializeComponent();
resultsConfigCtrl.Unlocked = true;
}
void Localize()
{
Text = Strings.Configuration;
availableResultsLabel.Text = Strings.Available_results;
availableTabControl.TabPages[0].Text = "A...Z";
availableTabControl.TabPages[1].Text = Strings.Quantity;
availableTabControl.TabPages[2].Text = Strings.Category;
selectedResultsLabel.Text = Strings.Selected_results;
addButton.Text = Strings.Add;
removeButton.Text = Strings.Remove;
removeAllButton.Text = Strings.Remove_all;
okButton.Text = Strings.OkBtnText;
cancelButton.Text = Strings.CancelBtnText;
upButton.Text = Strings.UpBtnText;
downButton.Text = Strings.DownBtnText;
}
void ResultsConfig_Load(object sender, EventArgs e)
{
Localize();
/// Add columns to ListViewEx
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Item, Width = 120 });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Caption });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Units });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Format });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Precision });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Width });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Alignment });
if (!supressTestIDColumn)
{
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Test_ID });
}
/// Create controls used by ListViewEx to edit items
unitsCB = new ComboBox();
ComboBox alignmentCB = new ComboBox();
for (Config.Entities.Alignment a = 0; a < Config.Entities.Alignment.Count; a++)
{
alignmentCB.Items.Add(a.ToDescription());
}
editors = new Control[]
{
null,
new TextBox(), /// caption
unitsCB,
new TextBox(), /// format
new TextBox(), /// precision
new TextBox(), /// width
alignmentCB,
new TextBox(), /// testID
};
foreach (var edi in editors)
{
if (edi != null)
{
edi.Visible = false;
Controls.Add(edi);
}
}
selectedResultsListViewEx.SubItemClicked += new SubItemEventHandler(selectedResultsListViewEx_SubItemClicked);
selectedResultsListViewEx.SubItemEndEditing += new SubItemEndEditingEventHandler(selectedResultsListViewEx_SubItemEndEditing);
//availableAlphabeticTreeView.ShowNodeToolTips = true;
//availableByQuantityTreeView.ShowNodeToolTips = true;
//availableByCategoryTreeView.ShowNodeToolTips = true;
RedrawAvailable();
RedrawSelected();
}
void selectedResultsListViewEx_SubItemClicked(object sender, SubItemEventArgs e)
{
if (e.SubItem == (int)Column.Units)
{
Config.Quantity quantity = (e.Item.Tag as WMeterRsltItemSpec).Quantity;
unitsCB.Items.Clear();
unitsCB.Items.Add(Config.Unit.None.ToDescription()); /// "---"
for (Config.Unit u = (Config.Unit)1; u < Config.Unit.Count; u++)
{
if (Config.Units.IsQuantity(u, quantity)) unitsCB.Items.Add(u.ToDescription());
}
selectedResultsListViewEx.StartEditing(unitsCB, e.Item, e.SubItem);
}
else if ((e.SubItem > 0) && (e.SubItem < (int)(supressTestIDColumn ? Column.TestID : Column.Count)))
{
selectedResultsListViewEx.StartEditing(editors[e.SubItem], e.Item, e.SubItem);
}
}
void selectedResultsListViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e)
{
ListViewItem lvi = e.Item;
WMeterRsltItemSpec item = lvi.Tag as WMeterRsltItemSpec;
switch ((Column)e.SubItem)
{
case Column.Caption: item.Caption = e.DisplayText; return;
case Column.Units:
for (Config.Unit u = 0; u < Config.Unit.Count; u++)
{
if (u.ToDescription().Equals(unitsCB.Text))
{
item.Units = u;
return; /// OK
}
}
break; /// Error
case Column.Format: item.Format = e.DisplayText; return;
case Column.Precision: item.Precision = e.DisplayText; return;
case Column.Width:
{
int width;
if (Int32.TryParse(editors[e.SubItem].Text, out width) && width >= 0)
{
item.Width = width;
return; /// OK
}
break; /// Error
}
case Column.Alignment:
for (Config.Entities.Alignment a = 0; a < Config.Entities.Alignment.Count; a++)
{
if (a.ToDescription().Equals(editors[e.SubItem].Text))
{
item.Alignment = a;
return;
}
}
break; /// Error
case Column.TestID: item.TestID = e.DisplayText; return;
default:
return; /// OK
}
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
e.Cancel = true;
return;
}
/// <summary>
/// Redraw available items (right hand side)
/// </summary>
void RedrawAvailable()
{
RedrawInAlphabeticOrder(availableAlphabeticTreeView);
RedrawByQuantity(availableByQuantityTreeView);
RedrawByCategory(availableByCategoryTreeView);
}
void RedrawInAlphabeticOrder(TreeView treeView)
{
treeView.Nodes.Clear();
IList<WMeterRsltItemSpec> alphabeticlList = WMeterRsltItemSpec.AllItems.OrderBy(x => x.Name).ToList();
///
foreach (var item in alphabeticlList)
{
TreeNode node = new TreeNode(item.Name);
node.Tag = item;
node.ToolTipText = item.ToolTipText;
availableAlphabeticTreeView.Nodes.Add(node);
}
}
void RedrawByQuantity(TreeView treeView)
{
treeView.Nodes.Clear();
IList<Config.Quantity> quantities = new List<Config.Quantity>();
for (Config.Quantity q = 0; q < Config.Quantity.Count; q++) quantities.Add(q);
IList<Config.Quantity> sortedQuantities = quantities.OrderBy(x => x.ToDescription()).ToList();
foreach (var q in sortedQuantities)
{
int n = 0;
foreach (var ri in WMeterRsltItemSpec.AllItems)
{
if (ri.Quantity == q) n++;
}
if (n > 0)
{
TreeNode[] array = new TreeNode[n];
int i = 0;
foreach (var ri in WMeterRsltItemSpec.AllItems)
{
if (ri.Quantity == q)
{
TreeNode node = new TreeNode(ri.Name);
node.Tag = ri;
node.ToolTipText = ri.ToolTipText;
array[i++] = node;
}
}
treeView.Nodes.Add(new TreeNode(q.ToDescription(), array));
}
}
}
void RedrawByCategory(TreeView treeView)
{
treeView.Nodes.Clear();
IList<ItemCategory> categories = new List<ItemCategory>();
for (ItemCategory c = 0; c < ItemCategory.Count; c++) categories.Add(c);
IList<ItemCategory> sortedCategories = categories.OrderBy(x => x.ToDescription()).ToList();
foreach (var c in sortedCategories)
{
int n = 0;
foreach (var ri in WMeterRsltItemSpec.AllItems)
{
if (ri.Category == c) n++;
}
if (n > 0)
{
TreeNode[] array = new TreeNode[n];
int i = 0;
foreach (var ri in WMeterRsltItemSpec.AllItems)
{
if (ri.Category == c)
{
TreeNode node = new TreeNode(ri.Name);
node.Tag = ri;
node.ToolTipText = ri.ToolTipText;
array[i++] = node;
}
}
treeView.Nodes.Add(new TreeNode(c.ToDescription(), array));
}
}
}
/// <summary>
/// Redraw selected items (right hand side)
/// </summary>
void RedrawSelected()
{
selectedResultsListViewEx.Items.Clear();
foreach (var item in SelectedItems)
{
ListViewItem lvi = new ListViewItem(item.Name); /// Item
lvi.Tag = item;
lvi.SubItems.Add(item.Caption); /// Header
lvi.SubItems.Add(item.Units.ToDescription()); /// Units
lvi.SubItems.Add(item.Format); /// Format
lvi.SubItems.Add(item.Precision); /// Precision
lvi.SubItems.Add(item.Width.ToString()); /// Width
lvi.SubItems.Add(item.Alignment.ToDescription()); /// Alignment
if (!supressTestIDColumn)
{
lvi.SubItems.Add(item.TestID); /// TestID
}
selectedResultsListViewEx.Items.Add(lvi);
}
}
void UpdateSelectedFromView()
{
}
void addButton_Click(object sender, EventArgs e)
{
switch (availableTabControl.SelectedIndex)
{
case 0:
availableAlphabeticTreeView_DoubleClick(this, null);
break;
case 1:
availableByQuantityTreeView_DoubleClick(this, null);
break;
case 2:
availableByCategoryTreeView_DoubleClick(this, null);
break;
default:
break;
}
}
private void availableAlphabeticTreeView_DoubleClick(object sender, EventArgs e)
{
if (availableAlphabeticTreeView.SelectedNode != null &&
availableAlphabeticTreeView.SelectedNode.Tag is WMeterRsltItemSpec)
{
AddItem(availableAlphabeticTreeView.SelectedNode.Tag as WMeterRsltItemSpec);
}
}
private void availableByQuantityTreeView_DoubleClick(object sender, EventArgs e)
{
if (availableByQuantityTreeView.SelectedNode != null &&
availableByQuantityTreeView.SelectedNode.Tag is WMeterRsltItemSpec)
{
AddItem(availableByQuantityTreeView.SelectedNode.Tag as WMeterRsltItemSpec);
}
}
private void availableByCategoryTreeView_DoubleClick(object sender, EventArgs e)
{
if (availableByCategoryTreeView.SelectedNode != null &&
availableByCategoryTreeView.SelectedNode.Tag is WMeterRsltItemSpec)
{
AddItem(availableByCategoryTreeView.SelectedNode.Tag as WMeterRsltItemSpec);
}
}
void AddItem(WMeterRsltItemSpec item)
{
WMeterRsltItemSpec newItem = item.Clone();
newItem.Caption = newItem.Name;
SelectedItems.Add(newItem);
RedrawSelected();
/// Select the last item
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[SelectedItems.Count - 1].Selected = true;
selectedResultsListViewEx.Items[SelectedItems.Count - 1].EnsureVisible();
}
private void selectedResultsListBox_DoubleClick(object sender, EventArgs e)
{
/// Double click works when just one item is selected
if (selectedResultsListViewEx.SelectedIndices.Count == 1)
{
SelectedItems.RemoveAt(selectedResultsListViewEx.SelectedIndices[0]);
RedrawAvailable();
RedrawSelected();
}
}
void removeButton_Click(object sender, EventArgs e)
{
/// Remove from the list (the last selected item first so that the indexes are not affected)
for (int i = selectedResultsListViewEx.SelectedIndices.Count - 1; i >= 0; i--)
{
SelectedItems.RemoveAt(selectedResultsListViewEx.SelectedIndices[i]);
}
RedrawAvailable();
RedrawSelected();
}
void removeAllButton_Click(object sender, EventArgs e)
{
/// Remove all items from 'Selected' list
SelectedItems.Clear();
RedrawAvailable();
RedrawSelected();
}
void okButton_Click(object sender, EventArgs e)
void okButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
Close();
}
private void ResultsConfigDlg_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
}
private void upButton_Click(object sender, EventArgs e)
{
if (selectedResultsListViewEx.SelectedIndices.Count != 1) return;
int selIdx = selectedResultsListViewEx.SelectedIndices[0];
if (selIdx == 0)
{
/// Cannot move up
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[0].Selected = true;
return;
}
WMeterRsltItemSpec tmp = SelectedItems[selIdx - 1];
SelectedItems[selIdx - 1] = SelectedItems[selIdx];
SelectedItems[selIdx] = tmp;
RedrawSelected();
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[selIdx - 1].Selected = true;
selectedResultsListViewEx.Items[selIdx - 1].EnsureVisible();
}
private void downButton_Click(object sender, EventArgs e)
{
if (selectedResultsListViewEx.SelectedIndices.Count != 1) return;
int selIdx = selectedResultsListViewEx.SelectedIndices[0];
if (selIdx == SelectedItems.Count - 1)
{
/// Cannot move down
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[SelectedItems.Count - 1].Selected = true;
return;
}
WMeterRsltItemSpec tmp = SelectedItems[selIdx + 1];
SelectedItems[selIdx + 1] = SelectedItems[selIdx];
SelectedItems[selIdx] = tmp;
RedrawSelected();
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[selIdx + 1].Selected = true;
selectedResultsListViewEx.Items[selIdx + 1].EnsureVisible();
}
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
private void tabPage1_Click(object sender, EventArgs e)
{
}
private void availableByCategoryTreeView_NodeMouseHover(object sender, TreeNodeMouseHoverEventArgs e)
{
ToolTip toolTip = new ToolTip();
toolTip.SetToolTip(this, e.Node.ToolTipText);
}
private void ResultsConfigDlg_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
}
}
}
+16 -211
View File
@@ -31,36 +31,17 @@ namespace Results.Forms
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.availableResultsLabel = new System.Windows.Forms.Label();
this.selectedResultsLabel = new System.Windows.Forms.Label();
this.removeAllButton = new System.Windows.Forms.Button();
this.removeButton = new System.Windows.Forms.Button();
this.addButton = new System.Windows.Forms.Button();
this.upButton = new System.Windows.Forms.Button();
this.downButton = new System.Windows.Forms.Button();
this.availableTabControl = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.availableAlphabeticTreeView = new System.Windows.Forms.TreeView();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.availableByQuantityTreeView = new System.Windows.Forms.TreeView();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.availableByCategoryTreeView = new System.Windows.Forms.TreeView();
this.selectedResultsListViewEx = new Results.Forms.ListViewEx();
this.availableTabControl.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.resultsConfigCtrl = new Results.Forms.ResultsConfigCtrl();
this.SuspendLayout();
//
// 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(373, 499);
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.Location = new System.Drawing.Point(939, 29);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(105, 30);
this.okButton.Size = new System.Drawing.Size(105, 42);
this.okButton.TabIndex = 4;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
@@ -68,186 +49,29 @@ namespace Results.Forms
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(494, 499);
this.cancelButton.Location = new System.Drawing.Point(939, 82);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(105, 30);
this.cancelButton.Size = new System.Drawing.Size(105, 42);
this.cancelButton.TabIndex = 5;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// availableResultsLabel
// resultsConfigCtrl
//
this.availableResultsLabel.AutoSize = true;
this.availableResultsLabel.Location = new System.Drawing.Point(12, 9);
this.availableResultsLabel.Name = "availableResultsLabel";
this.availableResultsLabel.Size = new System.Drawing.Size(86, 13);
this.availableResultsLabel.TabIndex = 8;
this.availableResultsLabel.Text = "Available results:";
//
// selectedResultsLabel
//
this.selectedResultsLabel.AutoSize = true;
this.selectedResultsLabel.Location = new System.Drawing.Point(284, 9);
this.selectedResultsLabel.Name = "selectedResultsLabel";
this.selectedResultsLabel.Size = new System.Drawing.Size(85, 13);
this.selectedResultsLabel.TabIndex = 9;
this.selectedResultsLabel.Text = "Selected results:";
//
// removeAllButton
//
this.removeAllButton.Location = new System.Drawing.Point(218, 221);
this.removeAllButton.Name = "removeAllButton";
this.removeAllButton.Size = new System.Drawing.Size(94, 30);
this.removeAllButton.TabIndex = 46;
this.removeAllButton.Text = "<< R&emove all";
this.removeAllButton.UseVisualStyleBackColor = true;
this.removeAllButton.Click += new System.EventHandler(this.removeAllButton_Click);
//
// removeButton
//
this.removeButton.Location = new System.Drawing.Point(218, 186);
this.removeButton.Name = "removeButton";
this.removeButton.Size = new System.Drawing.Size(93, 30);
this.removeButton.TabIndex = 45;
this.removeButton.Text = "< &Remove";
this.removeButton.UseVisualStyleBackColor = true;
this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
//
// addButton
//
this.addButton.Location = new System.Drawing.Point(218, 151);
this.addButton.Name = "addButton";
this.addButton.Size = new System.Drawing.Size(93, 30);
this.addButton.TabIndex = 44;
this.addButton.Text = "&Add >";
this.addButton.UseVisualStyleBackColor = true;
this.addButton.Click += new System.EventHandler(this.addButton_Click);
//
// upButton
//
this.upButton.Location = new System.Drawing.Point(218, 313);
this.upButton.Name = "upButton";
this.upButton.Size = new System.Drawing.Size(93, 30);
this.upButton.TabIndex = 48;
this.upButton.Text = "Up";
this.upButton.UseVisualStyleBackColor = true;
this.upButton.Click += new System.EventHandler(this.upButton_Click);
//
// downButton
//
this.downButton.Location = new System.Drawing.Point(218, 349);
this.downButton.Name = "downButton";
this.downButton.Size = new System.Drawing.Size(93, 30);
this.downButton.TabIndex = 49;
this.downButton.Text = "Down";
this.downButton.UseVisualStyleBackColor = true;
this.downButton.Click += new System.EventHandler(this.downButton_Click);
//
// availableTabControl
//
this.availableTabControl.Controls.Add(this.tabPage1);
this.availableTabControl.Controls.Add(this.tabPage2);
this.availableTabControl.Controls.Add(this.tabPage3);
this.availableTabControl.Location = new System.Drawing.Point(6, 31);
this.availableTabControl.Name = "availableTabControl";
this.availableTabControl.SelectedIndex = 0;
this.availableTabControl.Size = new System.Drawing.Size(206, 453);
this.availableTabControl.TabIndex = 50;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.availableAlphabeticTreeView);
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(198, 427);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "A...Z";
this.tabPage1.UseVisualStyleBackColor = true;
this.tabPage1.Click += new System.EventHandler(this.tabPage1_Click);
//
// availableAlphabeticTreeView
//
this.availableAlphabeticTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableAlphabeticTreeView.Location = new System.Drawing.Point(3, 3);
this.availableAlphabeticTreeView.Name = "availableAlphabeticTreeView";
this.availableAlphabeticTreeView.Size = new System.Drawing.Size(192, 421);
this.availableAlphabeticTreeView.TabIndex = 0;
this.availableAlphabeticTreeView.DoubleClick += new System.EventHandler(this.availableAlphabeticTreeView_DoubleClick);
//
// tabPage2
//
this.tabPage2.Controls.Add(this.availableByQuantityTreeView);
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(198, 427);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "by quantity";
this.tabPage2.UseVisualStyleBackColor = true;
//
// availableByQuantityTreeView
//
this.availableByQuantityTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableByQuantityTreeView.Location = new System.Drawing.Point(3, 3);
this.availableByQuantityTreeView.Name = "availableByQuantityTreeView";
this.availableByQuantityTreeView.Size = new System.Drawing.Size(192, 421);
this.availableByQuantityTreeView.TabIndex = 0;
this.availableByQuantityTreeView.DoubleClick += new System.EventHandler(this.availableByQuantityTreeView_DoubleClick);
//
// tabPage3
//
this.tabPage3.Controls.Add(this.availableByCategoryTreeView);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(198, 427);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "by category";
this.tabPage3.UseVisualStyleBackColor = true;
//
// availableByCategoryTreeView
//
this.availableByCategoryTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableByCategoryTreeView.Location = new System.Drawing.Point(0, 0);
this.availableByCategoryTreeView.Name = "availableByCategoryTreeView";
this.availableByCategoryTreeView.Size = new System.Drawing.Size(198, 427);
this.availableByCategoryTreeView.TabIndex = 0;
this.availableByCategoryTreeView.NodeMouseHover += new System.Windows.Forms.TreeNodeMouseHoverEventHandler(this.availableByCategoryTreeView_NodeMouseHover);
this.availableByCategoryTreeView.DoubleClick += new System.EventHandler(this.availableByCategoryTreeView_DoubleClick);
//
// selectedResultsListViewEx
//
this.selectedResultsListViewEx.AllowColumnReorder = true;
this.selectedResultsListViewEx.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.selectedResultsListViewEx.DoubleClickActivation = false;
this.selectedResultsListViewEx.FullRowSelect = true;
this.selectedResultsListViewEx.Location = new System.Drawing.Point(317, 31);
this.selectedResultsListViewEx.Name = "selectedResultsListViewEx";
this.selectedResultsListViewEx.Size = new System.Drawing.Size(594, 453);
this.selectedResultsListViewEx.TabIndex = 47;
this.selectedResultsListViewEx.UseCompatibleStateImageBehavior = false;
this.selectedResultsListViewEx.View = System.Windows.Forms.View.Details;
this.selectedResultsListViewEx.SubItemClicked += new Results.Forms.SubItemEventHandler(this.selectedResultsListViewEx_SubItemClicked);
this.selectedResultsListViewEx.SubItemEndEditing += new Results.Forms.SubItemEndEditingEventHandler(this.selectedResultsListViewEx_SubItemEndEditing);
this.resultsConfigCtrl.Location = new System.Drawing.Point(-1, 1);
this.resultsConfigCtrl.Name = "resultsConfigCtrl";
this.resultsConfigCtrl.Size = new System.Drawing.Size(925, 496);
this.resultsConfigCtrl.TabIndex = 6;
//
// ResultsConfigDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(923, 543);
this.Controls.Add(this.availableTabControl);
this.Controls.Add(this.downButton);
this.Controls.Add(this.upButton);
this.Controls.Add(this.selectedResultsListViewEx);
this.Controls.Add(this.removeAllButton);
this.Controls.Add(this.removeButton);
this.Controls.Add(this.addButton);
this.Controls.Add(this.selectedResultsLabel);
this.Controls.Add(this.availableResultsLabel);
this.ClientSize = new System.Drawing.Size(1066, 498);
this.Controls.Add(this.resultsConfigCtrl);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
@@ -257,33 +81,14 @@ namespace Results.Forms
this.Text = "ResultsConfig";
this.Load += new System.EventHandler(this.ResultsConfig_Load);
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.ResultsConfigDlg_KeyPress);
this.availableTabControl.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Label availableResultsLabel;
private System.Windows.Forms.Label selectedResultsLabel;
private System.Windows.Forms.Button removeAllButton;
private System.Windows.Forms.Button removeButton;
private System.Windows.Forms.Button addButton;
private ListViewEx selectedResultsListViewEx;
private System.Windows.Forms.Button upButton;
private System.Windows.Forms.Button downButton;
private System.Windows.Forms.TabControl availableTabControl;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TreeView availableAlphabeticTreeView;
private System.Windows.Forms.TreeView availableByQuantityTreeView;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.TreeView availableByCategoryTreeView;
private System.Windows.Forms.Button cancelButton;
private ResultsConfigCtrl resultsConfigCtrl;
}
}
-3
View File
@@ -117,7 +117,4 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
+32 -9
View File
@@ -83,14 +83,14 @@ namespace Results
Lite_per_pulse_Read, /// 73
Result_code, /// 74
Remark, /// 75
TempHiMean, /// 76
TempHiStart, /// 77
TempHiEnd, /// 78
TempHiAve, /// 79
TempLoMean, /// 80
TempLoStart, /// 81
TempLoEnd, /// 82
TempLoAve, /// 83
T_Hi_mean, /// 76
T_Hi_start, /// 77
T_Hi_end, /// 78
T_Hi_avg, /// 79
T_Lo_mean, /// 80
T_Lo_start, /// 81
T_Lo_end, /// 82
T_Lo_avg, /// 83
P_delta_mean, /// 84
P_delta_start, /// 85
P_delta_end, /// 86
@@ -111,7 +111,30 @@ namespace Results
End_state_aux, /// 101
Q_rise, /// 102
Q_fall, /// 103
/// iPerl
OrigCalibFactor, /// 104
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
Count,
}
}
+1 -1
View File
@@ -86,7 +86,7 @@ namespace Results.Mappings
Map(x => x.TempDivMax);
Map(x => x.FlowStart);
Map(x => x.FlowEnd);
Map(x => x.FlowMin);
Map(x => x.FlowMean).Column("FlowMin");
Map(x => x.FlowMax);
Map(x => x.Custom1);
@@ -235,13 +235,13 @@ namespace Results.Output.Printers.Munich
lineNr += (secondTableOffset * 2) / SpacingOne;
PrintAt(e, Tab1, lineNr * SpacingOne, "Temperatur");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientTempAve().ToString("F1") + " \x00b0C");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbTempMean().ToString("F1") + " \x00b0C");
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Feuchtigkeit");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientHumiAve().ToString("F0") + " %");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbHumiMean().ToString("F0") + " %");
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Luftdruck");
PrintAt(e, Tab2, lineNr * SpacingOne, Config.Units.ConvertTo(Config.Unit.mbar, wm.Batch.AmbientPressAve()).ToString("F0") + " mbar");
PrintAt(e, Tab2, lineNr * SpacingOne, Config.Units.ConvertTo(Config.Unit.mbar, wm.Batch.AmbPressMean()).ToString("F0") + " mbar");
lineNr++;
PrintAt(e, Tab3, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
+3 -3
View File
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Sensus")]
[assembly: AssemblyProduct("Results")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyCopyright("Copyright © 2013 - 2017 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.12.544.0")]
[assembly: AssemblyFileVersion("2.12.544.0")]
[assembly: AssemblyVersion("2.12.566.0")]
[assembly: AssemblyFileVersion("2.12.566.0")]
+532 -1
View File
@@ -87,6 +87,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to aux..
/// </summary>
internal static string aux {
get {
return ResourceManager.GetString("aux", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Available results.
/// </summary>
@@ -313,7 +322,7 @@ namespace Results.Resources {
}
/// <summary>
/// Looks up a localized string similar to Err.ref..
/// Looks up a localized string similar to E rel. ref..
/// </summary>
internal static string ErrRef {
get {
@@ -321,6 +330,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to fall.
/// </summary>
internal static string fall {
get {
return ResourceManager.GetString("fall", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Flow.
/// </summary>
@@ -339,6 +357,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to from.
/// </summary>
internal static string from {
get {
return ResourceManager.GetString("from", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to H amb.
/// </summary>
@@ -366,6 +393,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to main.
/// </summary>
internal static string main {
get {
return ResourceManager.GetString("main", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to M.Class.
/// </summary>
@@ -690,6 +726,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to rise.
/// </summary>
internal static string rise {
get {
return ResourceManager.GetString("rise", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Selected results.
/// </summary>
@@ -879,6 +924,411 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to to.
/// </summary>
internal static string to {
get {
return ResourceManager.GetString("to", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Relative error of a meter.
/// </summary>
internal static string Tooltip_E_rel {
get {
return ResourceManager.GetString("Tooltip_E_rel", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Relative error of the master meter.
/// </summary>
internal static string Tooltip_E_rel_ref {
get {
return ResourceManager.GetString("Tooltip_E_rel_ref", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Ambient humidity during test.
/// </summary>
internal static string Tooltip_Hu_Amb_M {
get {
return ResourceManager.GetString("Tooltip_Hu_Amb_M", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Ambient pressure during test.
/// </summary>
internal static string Tooltip_P_Amb_M {
get {
return ResourceManager.GetString("Tooltip_P_Amb_M", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pressure difference measured by delta P meter - actual.
/// </summary>
internal static string Tooltip_P_de_ac {
get {
return ResourceManager.GetString("Tooltip_P_de_ac", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pressure difference measured by delta P meter - average.
/// </summary>
internal static string Tooltip_P_de_avg {
get {
return ResourceManager.GetString("Tooltip_P_de_avg", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pressure difference measured by delta P meter - at the end of the test.
/// </summary>
internal static string Tooltip_P_de_en {
get {
return ResourceManager.GetString("Tooltip_P_de_en", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pressure difference measured by delta P meter - mean.
/// </summary>
internal static string Tooltip_P_de_me {
get {
return ResourceManager.GetString("Tooltip_P_de_me", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pressure difference measured by delta P meter - at the start of the test.
/// </summary>
internal static string Tooltip_P_de_st {
get {
return ResourceManager.GetString("Tooltip_P_de_st", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pressure at the outlet actual.
/// </summary>
internal static string Tooltip_P_dw_ac {
get {
return ResourceManager.GetString("Tooltip_P_dw_ac", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Average pressure at the outlet.
/// </summary>
internal static string Tooltip_P_dw_avg {
get {
return ResourceManager.GetString("Tooltip_P_dw_avg", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pressure at the outlet at end of the test.
/// </summary>
internal static string Tooltip_P_dw_en {
get {
return ResourceManager.GetString("Tooltip_P_dw_en", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Mean pressure at the outlet.
/// </summary>
internal static string Tooltip_P_dw_me {
get {
return ResourceManager.GetString("Tooltip_P_dw_me", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pressure at the outlet at start of the test.
/// </summary>
internal static string Tooltip_P_dw_st {
get {
return ResourceManager.GetString("Tooltip_P_dw_st", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pressure at the inlet actual.
/// </summary>
internal static string Tooltip_P_up_ac {
get {
return ResourceManager.GetString("Tooltip_P_up_ac", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Average pressure at the inlet.
/// </summary>
internal static string Tooltip_P_up_avg {
get {
return ResourceManager.GetString("Tooltip_P_up_avg", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pressure at the inlet at end of the test.
/// </summary>
internal static string Tooltip_P_up_en {
get {
return ResourceManager.GetString("Tooltip_P_up_en", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Mean pressure at the inlet.
/// </summary>
internal static string Tooltip_P_up_me {
get {
return ResourceManager.GetString("Tooltip_P_up_me", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pressure at the inlet at start of the test.
/// </summary>
internal static string Tooltip_P_up_st {
get {
return ResourceManager.GetString("Tooltip_P_up_st", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Flow calculated from conventional true mass and time.
/// </summary>
internal static string Tooltip_Q_m_r {
get {
return ResourceManager.GetString("Tooltip_Q_m_r", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Flow obtained from the master meter - actual.
/// </summary>
internal static string Tooltip_Q_riac {
get {
return ResourceManager.GetString("Tooltip_Q_riac", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Flow obtained from the master meter - mean.
/// </summary>
internal static string Tooltip_Q_rim {
get {
return ResourceManager.GetString("Tooltip_Q_rim", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Flow calculated from conventional true volume and the time.
/// </summary>
internal static string Tooltip_Q_v_r {
get {
return ResourceManager.GetString("Tooltip_Q_v_r", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Serial number of the meter.
/// </summary>
internal static string Tooltip_sn {
get {
return ResourceManager.GetString("Tooltip_sn", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Serial number of the auxiliary meter of a compound water meter.
/// </summary>
internal static string Tooltip_sn_aux {
get {
return ResourceManager.GetString("Tooltip_sn_aux", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Serial number of the main meter of a compound water meter.
/// </summary>
internal static string Tooltip_sn_main {
get {
return ResourceManager.GetString("Tooltip_sn_main", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Ambient temperature during test.
/// </summary>
internal static string Tooltip_T_Amb_M {
get {
return ResourceManager.GetString("Tooltip_T_Amb_M", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Actual temperature at the diverter.
/// </summary>
internal static string Tooltip_T_di_ac {
get {
return ResourceManager.GetString("Tooltip_T_di_ac", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Average temperature at the diverter.
/// </summary>
internal static string Tooltip_T_di_avg {
get {
return ResourceManager.GetString("Tooltip_T_di_avg", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Temperature at the diverter at end of the test last 4 measurement before the end.
/// </summary>
internal static string Tooltip_T_di_en {
get {
return ResourceManager.GetString("Tooltip_T_di_en", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Mean temperature at diverter.
/// </summary>
internal static string Tooltip_T_di_me {
get {
return ResourceManager.GetString("Tooltip_T_di_me", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Temperature at the diverter at start of the test first 4 measurements from the start.
/// </summary>
internal static string Tooltip_T_di_st {
get {
return ResourceManager.GetString("Tooltip_T_di_st", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Actual temperature at the outlet.
/// </summary>
internal static string Tooltip_T_dw_ac {
get {
return ResourceManager.GetString("Tooltip_T_dw_ac", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Average temperature at the outlet.
/// </summary>
internal static string Tooltip_T_dw_avg {
get {
return ResourceManager.GetString("Tooltip_T_dw_avg", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Temperature at the outlet at end of the test last 4 measurement before the end.
/// </summary>
internal static string Tooltip_T_dw_en {
get {
return ResourceManager.GetString("Tooltip_T_dw_en", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Mean temperature at outlet.
/// </summary>
internal static string Tooltip_T_dw_me {
get {
return ResourceManager.GetString("Tooltip_T_dw_me", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Temperature at the outlet at start of the test first 4 measurements from the start.
/// </summary>
internal static string Tooltip_T_dw_st {
get {
return ResourceManager.GetString("Tooltip_T_dw_st", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Actual temperature at the inlet.
/// </summary>
internal static string Tooltip_T_up_ac {
get {
return ResourceManager.GetString("Tooltip_T_up_ac", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Average temperature at the inlet.
/// </summary>
internal static string Tooltip_T_up_avg {
get {
return ResourceManager.GetString("Tooltip_T_up_avg", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Temperature at the inlet at end of the test last 4 measurement before the end.
/// </summary>
internal static string Tooltip_T_up_en {
get {
return ResourceManager.GetString("Tooltip_T_up_en", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Mean temperature at inlet.
/// </summary>
internal static string Tooltip_T_up_me {
get {
return ResourceManager.GetString("Tooltip_T_up_me", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Temperature at the inlet at start of the test first 4 measurements from the start.
/// </summary>
internal static string Tooltip_T_up_st {
get {
return ResourceManager.GetString("Tooltip_T_up_st", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Volume measured by the tested meter.
/// </summary>
internal static string Tooltip_Vol_Mt {
get {
return ResourceManager.GetString("Tooltip_Vol_Mt", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Reference volume for tested meter.
/// </summary>
internal static string Tooltip_Vol_rm {
get {
return ResourceManager.GetString("Tooltip_Vol_rm", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Uncertainty.
/// </summary>
@@ -933,6 +1383,87 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Ro.
/// </summary>
internal static string VName_Dens {
get {
return ResourceManager.GetString("VName_Dens", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to E.
/// </summary>
internal static string VName_Error {
get {
return ResourceManager.GetString("VName_Error", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Q.
/// </summary>
internal static string VName_Flow {
get {
return ResourceManager.GetString("VName_Flow", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Hu..
/// </summary>
internal static string VName_Humi {
get {
return ResourceManager.GetString("VName_Humi", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Mass.
/// </summary>
internal static string VName_Mass {
get {
return ResourceManager.GetString("VName_Mass", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Press..
/// </summary>
internal static string VName_Press {
get {
return ResourceManager.GetString("VName_Press", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Temp..
/// </summary>
internal static string VName_Temp {
get {
return ResourceManager.GetString("VName_Temp", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Tau.
/// </summary>
internal static string VName_TstTime {
get {
return ResourceManager.GetString("VName_TstTime", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Vol..
/// </summary>
internal static string VName_Vol {
get {
return ResourceManager.GetString("VName_Vol", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Vol.ref..
/// </summary>
+9
View File
@@ -201,4 +201,13 @@
<data name="Water_Meter" xml:space="preserve">
<value>Vodoměr</value>
</data>
<data name="Batch_nr" xml:space="preserve">
<value>Číslo dávky</value>
</data>
<data name="from" xml:space="preserve">
<value>od</value>
</data>
<data name="to" xml:space="preserve">
<value>do</value>
</data>
</root>
+18
View File
@@ -387,4 +387,22 @@
<data name="Water_Meter" xml:space="preserve">
<value>Wasserzähler</value>
</data>
<data name="aux" xml:space="preserve">
<value>Nebenz.</value>
</data>
<data name="main" xml:space="preserve">
<value>Hauptz.</value>
</data>
<data name="fall" xml:space="preserve">
<value>fall</value>
</data>
<data name="from" xml:space="preserve">
<value>von</value>
</data>
<data name="rise" xml:space="preserve">
<value>steig</value>
</data>
<data name="to" xml:space="preserve">
<value>bis</value>
</data>
</root>
+18
View File
@@ -420,4 +420,22 @@
<data name="Volume_main" xml:space="preserve">
<value>Objętość główna</value>
</data>
<data name="aux" xml:space="preserve">
<value>dodatkowy</value>
</data>
<data name="main" xml:space="preserve">
<value>główny</value>
</data>
<data name="fall" xml:space="preserve">
<value>obniżanie</value>
</data>
<data name="from" xml:space="preserve">
<value>od</value>
</data>
<data name="rise" xml:space="preserve">
<value>zwiększanie</value>
</data>
<data name="to" xml:space="preserve">
<value>do</value>
</data>
</root>
+178 -1
View File
@@ -172,7 +172,7 @@
<value>Error</value>
</data>
<data name="ErrRef" xml:space="preserve">
<value>Err.ref.</value>
<value>E rel. ref.</value>
</data>
<data name="Err_aux" xml:space="preserve">
<value>Err. aux.</value>
@@ -435,4 +435,181 @@
<data name="Water_Meter" xml:space="preserve">
<value>Water Meter</value>
</data>
<data name="VName_Flow" xml:space="preserve">
<value>Q</value>
</data>
<data name="VName_Press" xml:space="preserve">
<value>Press.</value>
</data>
<data name="VName_Temp" xml:space="preserve">
<value>Temp.</value>
</data>
<data name="VName_Dens" xml:space="preserve">
<value>Ro</value>
</data>
<data name="VName_Humi" xml:space="preserve">
<value>Hu.</value>
</data>
<data name="VName_Mass" xml:space="preserve">
<value>Mass</value>
</data>
<data name="VName_TstTime" xml:space="preserve">
<value>Tau</value>
</data>
<data name="VName_Vol" xml:space="preserve">
<value>Vol.</value>
</data>
<data name="Tooltip_P_de_ac" xml:space="preserve">
<value>Pressure difference measured by delta P meter - actual</value>
</data>
<data name="Tooltip_P_de_avg" xml:space="preserve">
<value>Pressure difference measured by delta P meter - average</value>
</data>
<data name="Tooltip_P_de_en" xml:space="preserve">
<value>Pressure difference measured by delta P meter - at the end of the test</value>
</data>
<data name="Tooltip_P_de_me" xml:space="preserve">
<value>Pressure difference measured by delta P meter - mean</value>
</data>
<data name="Tooltip_P_de_st" xml:space="preserve">
<value>Pressure difference measured by delta P meter - at the start of the test</value>
</data>
<data name="Tooltip_P_dw_ac" xml:space="preserve">
<value>Pressure at the outlet actual</value>
</data>
<data name="Tooltip_P_dw_avg" xml:space="preserve">
<value>Average pressure at the outlet</value>
</data>
<data name="Tooltip_P_dw_en" xml:space="preserve">
<value>Pressure at the outlet at end of the test</value>
</data>
<data name="Tooltip_P_dw_me" xml:space="preserve">
<value>Mean pressure at the outlet</value>
</data>
<data name="Tooltip_P_dw_st" xml:space="preserve">
<value>Pressure at the outlet at start of the test</value>
</data>
<data name="Tooltip_P_up_ac" xml:space="preserve">
<value>Pressure at the inlet actual</value>
</data>
<data name="Tooltip_P_up_avg" xml:space="preserve">
<value>Average pressure at the inlet</value>
</data>
<data name="Tooltip_P_up_en" xml:space="preserve">
<value>Pressure at the inlet at end of the test</value>
</data>
<data name="Tooltip_P_up_me" xml:space="preserve">
<value>Mean pressure at the inlet</value>
</data>
<data name="Tooltip_P_up_st" xml:space="preserve">
<value>Pressure at the inlet at start of the test</value>
</data>
<data name="Tooltip_Q_m_r" xml:space="preserve">
<value>Flow calculated from conventional true mass and time</value>
</data>
<data name="Tooltip_Q_riac" xml:space="preserve">
<value>Flow obtained from the master meter - actual</value>
</data>
<data name="Tooltip_Q_rim" xml:space="preserve">
<value>Flow obtained from the master meter - mean</value>
</data>
<data name="Tooltip_Q_v_r" xml:space="preserve">
<value>Flow calculated from conventional true volume and the time</value>
</data>
<data name="Tooltip_T_di_ac" xml:space="preserve">
<value>Actual temperature at the diverter</value>
</data>
<data name="Tooltip_T_di_avg" xml:space="preserve">
<value>Average temperature at the diverter</value>
</data>
<data name="Tooltip_T_di_en" xml:space="preserve">
<value>Temperature at the diverter at end of the test last 4 measurement before the end</value>
</data>
<data name="Tooltip_T_di_me" xml:space="preserve">
<value>Mean temperature at diverter</value>
</data>
<data name="Tooltip_T_di_st" xml:space="preserve">
<value>Temperature at the diverter at start of the test first 4 measurements from the start</value>
</data>
<data name="Tooltip_T_dw_ac" xml:space="preserve">
<value>Actual temperature at the outlet</value>
</data>
<data name="Tooltip_T_dw_avg" xml:space="preserve">
<value>Average temperature at the outlet</value>
</data>
<data name="Tooltip_T_dw_en" xml:space="preserve">
<value>Temperature at the outlet at end of the test last 4 measurement before the end</value>
</data>
<data name="Tooltip_T_dw_me" xml:space="preserve">
<value>Mean temperature at outlet</value>
</data>
<data name="Tooltip_T_dw_st" xml:space="preserve">
<value>Temperature at the outlet at start of the test first 4 measurements from the start</value>
</data>
<data name="Tooltip_T_up_ac" xml:space="preserve">
<value>Actual temperature at the inlet</value>
</data>
<data name="Tooltip_T_up_avg" xml:space="preserve">
<value>Average temperature at the inlet</value>
</data>
<data name="Tooltip_T_up_en" xml:space="preserve">
<value>Temperature at the inlet at end of the test last 4 measurement before the end</value>
</data>
<data name="Tooltip_T_up_me" xml:space="preserve">
<value>Mean temperature at inlet</value>
</data>
<data name="Tooltip_T_up_st" xml:space="preserve">
<value>Temperature at the inlet at start of the test first 4 measurements from the start</value>
</data>
<data name="aux" xml:space="preserve">
<value>aux.</value>
</data>
<data name="main" xml:space="preserve">
<value>main</value>
</data>
<data name="Tooltip_E_rel" xml:space="preserve">
<value>Relative error of a meter</value>
</data>
<data name="Tooltip_E_rel_ref" xml:space="preserve">
<value>Relative error of the master meter</value>
</data>
<data name="Tooltip_sn" xml:space="preserve">
<value>Serial number of the meter</value>
</data>
<data name="Tooltip_sn_aux" xml:space="preserve">
<value>Serial number of the auxiliary meter of a compound water meter</value>
</data>
<data name="Tooltip_sn_main" xml:space="preserve">
<value>Serial number of the main meter of a compound water meter</value>
</data>
<data name="Tooltip_Vol_Mt" xml:space="preserve">
<value>Volume measured by the tested meter</value>
</data>
<data name="Tooltip_Vol_rm" xml:space="preserve">
<value>Reference volume for tested meter</value>
</data>
<data name="VName_Error" xml:space="preserve">
<value>E</value>
</data>
<data name="fall" xml:space="preserve">
<value>fall</value>
</data>
<data name="from" xml:space="preserve">
<value>from</value>
</data>
<data name="rise" xml:space="preserve">
<value>rise</value>
</data>
<data name="to" xml:space="preserve">
<value>to</value>
</data>
<data name="Tooltip_Hu_Amb_M" xml:space="preserve">
<value>Ambient humidity during test</value>
</data>
<data name="Tooltip_P_Amb_M" xml:space="preserve">
<value>Ambient pressure during test</value>
</data>
<data name="Tooltip_T_Amb_M" xml:space="preserve">
<value>Ambient temperature during test</value>
</data>
</root>
+9
View File
@@ -420,4 +420,13 @@
<data name="Volume_main" xml:space="preserve">
<value>Объем главн.</value>
</data>
<data name="aux" xml:space="preserve">
<value>доп.</value>
</data>
<data name="main" xml:space="preserve">
<value>главн.</value>
</data>
<data name="VName_Vol" xml:space="preserve">
<value>Объем</value>
</data>
</root>
+11 -2
View File
@@ -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>
@@ -77,6 +77,12 @@
<Compile Include="Forms\ListViewEx.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Forms\ResultsConfigCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\ResultsConfigCtrl.Designer.cs">
<DependentUpon>ResultsConfigCtrl.cs</DependentUpon>
</Compile>
<Compile Include="Forms\ResultsConfigDlg.cs">
<SubType>Form</SubType>
</Compile>
@@ -137,6 +143,9 @@
<EmbeddedResource Include="Forms\ListViewEx.resx">
<DependentUpon>ListViewEx.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\ResultsConfigCtrl.resx">
<DependentUpon>ResultsConfigCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\ResultsConfigDlg.resx">
<DependentUpon>ResultsConfigDlg.cs</DependentUpon>
</EmbeddedResource>
+110 -63
View File
@@ -99,14 +99,14 @@ namespace Results
}
///
/// Constructorwithot ToolTip text
/// Constructor without ToolTip text
///
public WMeterRsltItemSpec(ItemID itemId, string name, Quantity quantity, ItemCategory category, PrintDlgt printDlgt)
{
Uid = (int)itemId;
OldUid = itemId.ToString().Replace("__", "/").Replace('_', ' ');
Name = name;
ToolTipText = string.Format("{0} bla, bla, bla", Name);
ToolTipText = null;
Quantity = quantity;
Category = category;
this.printDlgt = printDlgt;
@@ -130,48 +130,105 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_method, Strings.Test_method + " *", Quantity.String, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Method()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Density, Strings.Density + " *", Quantity.Density, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).DensityOut.ToString(string.IsNullOrEmpty(p) ? "F1" : p))); /// [kg/m3]
/// Target values
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_from, Strings.Q_from + "()", Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Qfrom().ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_to, Strings.Q_to + "()", Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Qto().ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_volume, Strings.Test_vol + "()", Quantity.Volume, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TargetVolume()).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Lo, Strings.ErrLimLo + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrLimLo()).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Hi, Strings.ErrLimHi + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrLimHi()).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty, Strings.Uncertainty + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Uncertainty().ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
///
/// Volume
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_volume, Strings.Test_vol + "()", Quantity.Volume, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TargetVolume()).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
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) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
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) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeRef).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
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) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
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) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume, Strings.Start_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
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) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
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) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume, Strings.End_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
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) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
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) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
/// Test results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_start_time, Strings.T_start + "()", Quantity.DateTime, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(f) ? w.GetTestRslt(t).StartTime.ToString() : string.Format(f, w.GetTestRslt(t).StartTime))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_end_time, Strings.T_end + "()", Quantity.DateTime, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(f) ? w.GetTestRslt(t).EndTime.ToString() : string.Format(f, w.GetTestRslt(t).EndTime))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_time, Strings.T_s + "()", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).TestTime.ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow, Strings.Flow + "()", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Utils.DoubleToStr(Config.Units.ConvertTo(u, w.GetTestRslt(t).FlowVolume), 4)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_mean, Strings.T_in + "()", Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempUpMean).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_mean, Strings.T_out + "()", Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDownMean).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div, Strings.T_div + "()", Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDivMean).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up, Strings.P_up + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpMean).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_start, Strings.P_up_start + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_end, Strings.P_up_end + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down, Strings.P_dn + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownMean).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_start, Strings.P_dn_start + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_end, Strings.P_dn_end + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_mean, Strings.P_delta + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDeltaMean).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_start, Strings.P_delta_start + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDeltaStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_end, Strings.P_delta_end + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDeltaEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_error, Strings.ErrRef + "()", Quantity.Error, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrorMaster).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_temperature, Strings.T_amb + "()", Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbientTempAve()).ToString(string.IsNullOrEmpty(p) ? "F1" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbTempMean).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_pressure, Strings.P_amb + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbientPressAve()).ToString(string.IsNullOrEmpty(p) ? "F0" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbPressMean).ToString(string.IsNullOrEmpty(p) ? "F0" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_humidity, Strings.H_amb + "()", Quantity.Humidity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbientHumiAve()).ToString(string.IsNullOrEmpty(p) ? "F1" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbHumiMean).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
///
/// Time (duration), date and time
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_start_time, Strings.T_start + "()", Quantity.DateTime, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(f) ? w.GetTestRslt(t).StartTime.ToString() : string.Format(f, w.GetTestRslt(t).StartTime))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_end_time, Strings.T_end + "()", Quantity.DateTime, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(f) ? w.GetTestRslt(t).EndTime.ToString() : string.Format(f, w.GetTestRslt(t).EndTime))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_time, Strings.T_s + "()", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).TestTime.ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
/// Single and combined meter results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume, Strings.Volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_volume, Strings.VolRef + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeRef).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
#if TURA_IPERL || TURA_SPECIAL
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, Strings.Error + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "0" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).Error).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
#else
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, Strings.Error + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).Error).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
///
/// Flow
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_from, string.Format("{0} {1}", Strings.VName_Flow, Strings.from), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Qfrom().ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_to, string.Format("{0} {1}", Strings.VName_Flow, Strings.to), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Qto().ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow, string.Format("{0} v r", Strings.VName_Flow), Strings.Tooltip_Q_v_r, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Utils.DoubleToStr(Config.Units.ConvertTo(u, w.GetTestRslt(t).FlowVolume), 4)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_rise, string.Format("{0} {1}", Strings.VName_Flow, Strings.rise), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (w.QRise == 0) ? "-" : Utils.DoubleToStr(w.QRise, 4)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_fall, string.Format("{0} {1}", Strings.VName_Flow, Strings.fall), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (w.QFall == 0) ? "-" : Utils.DoubleToStr(w.QFall, 4)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_mean, string.Format("{0} rim ()", Strings.VName_Flow), Strings.Tooltip_Q_rim, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Utils.DoubleToStr(Config.Units.ConvertTo(u, w.GetTestRslt(t).FlowMean), 4)));
///
/// Temperature
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_mean, string.Format("{0} UP ME ()", Strings.VName_Temp), Strings.Tooltip_T_up_me, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempUpMean).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_start, string.Format("{0} UP ST ()", Strings.VName_Temp), Strings.Tooltip_T_up_st, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempUpStart).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_end, string.Format("{0} UP EN ()", Strings.VName_Temp), Strings.Tooltip_T_up_en, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempUpEnd).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_avg, string.Format("{0} UP avg ()", Strings.VName_Temp), Strings.Tooltip_T_up_avg, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).TempUpStart + w.GetTestRslt(t).TempUpEnd) / 2).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_mean, string.Format("{0} DW ME ()", Strings.VName_Temp), Strings.Tooltip_T_dw_me, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDownMean).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_start, string.Format("{0} DW ST ()", Strings.VName_Temp), Strings.Tooltip_T_dw_st, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDownStart).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_end, string.Format("{0} DW EN ()", Strings.VName_Temp), Strings.Tooltip_T_dw_en, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDownEnd).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_avg, string.Format("{0} DW avg ()", Strings.VName_Temp), Strings.Tooltip_T_dw_avg, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).TempDownStart + w.GetTestRslt(t).TempDownEnd) / 2).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div, string.Format("{0} DI ME ()", Strings.VName_Temp), Strings.Tooltip_T_di_me, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDivMean).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_start, string.Format("{0} DI ST ()", Strings.VName_Temp), Strings.Tooltip_T_di_st, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDivStart).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_end, string.Format("{0} DI EN ()", Strings.VName_Temp), Strings.Tooltip_T_di_en, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDivEnd).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_avg, string.Format("{0} DI avg ()", Strings.VName_Temp), Strings.Tooltip_T_di_avg, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).TempDivStart + w.GetTestRslt(t).TempDivEnd) / 2).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
#if HEAT_METERS
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_mean, string.Format("{0} hi me", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom1).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_start, string.Format("{0} hi st", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom2).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_end, string.Format("{0} hi en", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom3).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_avg, string.Format("{0} hi av", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).Custom2 + w.GetTestRslt(t).Custom3) / 2).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_mean, string.Format("{0} lo me", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom6).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_start, string.Format("{0} lo st", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom7).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_end, string.Format("{0} lo en", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom8).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_avg, string.Format("{0} lo av", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).Custom7 + w.GetTestRslt(t).Custom8) / 2).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
#endif
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed, Strings.Result + "()", Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : w.GetMeterTestRslt(t).PassedColorStr()));
///
/// Pressure
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up, string.Format("{0} UP ME ()", Strings.VName_Press), Strings.Tooltip_P_up_me, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpMean).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_start, string.Format("{0} UP ST ()", Strings.VName_Press), Strings.Tooltip_P_up_st, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_end, string.Format("{0} UP EN ()", Strings.VName_Press), Strings.Tooltip_P_up_en, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_avg, string.Format("{0} UP avg ()", Strings.VName_Press), Strings.Tooltip_P_up_avg, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).PressUpStart + w.GetTestRslt(t).PressUpEnd) / 2).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down, string.Format("{0} DW ME ()", Strings.VName_Press), Strings.Tooltip_P_dw_me, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownMean).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_start, string.Format("{0} DW ST ()", Strings.VName_Press), Strings.Tooltip_P_dw_st, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_end, string.Format("{0} DW EN ()", Strings.VName_Press), Strings.Tooltip_P_dw_en, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_avg, string.Format("{0} DW avg ()", Strings.VName_Press), Strings.Tooltip_P_dw_avg, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).PressDownStart + w.GetTestRslt(t).PressDownEnd) / 2).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_mean, string.Format("{0} DE ME ()", Strings.VName_Press), Strings.Tooltip_P_de_me, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDeltaMean).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_start, string.Format("{0} DE ST ()", Strings.VName_Press), Strings.Tooltip_P_de_st, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDeltaStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_end, string.Format("{0} DE EN ()", Strings.VName_Press), Strings.Tooltip_P_de_en, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDeltaEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_avg, string.Format("{0} DE avg ()", Strings.VName_Press), Strings.Tooltip_P_de_avg, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).PressDeltaStart + w.GetTestRslt(t).PressDeltaEnd) / 2).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
///
/// Ambient temperature/pressure/humidity
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_temperature, string.Format("{0} Amb M", Strings.VName_Temp), Strings.Tooltip_T_Amb_M, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbTempMean()).ToString(string.IsNullOrEmpty(p) ? "F1" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbTempMean).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_pressure, string.Format("{0} Amb M", Strings.VName_Press), Strings.Tooltip_P_Amb_M, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbPressMean()).ToString(string.IsNullOrEmpty(p) ? "F0" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbPressMean).ToString(string.IsNullOrEmpty(p) ? "F0" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_humidity, string.Format("{0} Amb M", Strings.VName_Humi), Strings.Tooltip_Hu_Amb_M, Quantity.Humidity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbHumiMean()).ToString(string.IsNullOrEmpty(p) ? "F1" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbHumiMean).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
///
/// Error
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Lo, Strings.ErrLimLo + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrLimLo()).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Hi, Strings.ErrLimHi + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrLimHi()).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty, Strings.Uncertainty + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Uncertainty().ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_error, string.Format("{0} rel.ref. ()", Strings.VName_Error), Strings.Tooltip_E_rel_ref, Quantity.Error, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrorMaster).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
#if TURA_IPERL || TURA_SPECIAL
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" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).Error).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
#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) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).Error).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
#endif
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed, Strings.Result + "()", Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => string.IsNullOrEmpty(t) ? w.PassedColorStr() : ((w.GetMeterTestRslt(t) == null) ? "" : w.GetMeterTestRslt(t).PassedColorStr())));
///
/// Water meter info
AllItems.Add(new WMeterRsltItemSpec(ItemID.Watermeter_type, Strings.WM_Type, Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => w.WaterMeterData.ProductName));
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Watermeter_type, Strings.WM_Type, Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => w.WaterMeterData.ProductName));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Producer, Strings.Producer, Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => w.WaterMeterData.Producer));
AllItems.Add(new WMeterRsltItemSpec(ItemID.DN, "DN", Quantity.Length, ItemCategory.MeterData, (w, t, u, f, p) => string.IsNullOrEmpty(p) ? Config.Units.ConvertTo(u, w.WaterMeterData.DN).ToString()
@@ -208,7 +265,7 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text5, "Text5", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.WaterMeterData.Text5));
/// Water meters results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr, Strings.sn, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => w.SerialNr));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr, Strings.sn, Strings.Tooltip_sn, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => w.SerialNr));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Purchase_order, Strings.PO, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.PurchaseOrder));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Year_of_production, Strings.Year, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => w.YearOfProduction.ToString()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.WM_Position, Strings.Pos, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => w.WMPosition.ToString()));
@@ -221,14 +278,11 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_pulses, Strings.RefPulses + "()", Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : w.GetMeterTestRslt(t).PulsesMaster.ToString()));
/// Water meters results (combined)
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_rise, Strings.Q_rise, Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (w.QRise == 0) ? "-" : Utils.DoubleToStr(w.QRise, 4)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_fall, Strings.Q_fall, Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (w.QFall == 0) ? "-" : Utils.DoubleToStr(w.QFall, 4)));
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) ? "" : (string.IsNullOrEmpty(p) ? w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).Error.ToString()
: w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).Error.ToString(p))));
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) ? "" : (string.IsNullOrEmpty(p) ? w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).Error.ToString() : w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).Error.ToString(p))));
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) ? "" : (string.IsNullOrEmpty(p) ? w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).Error.ToString()
: w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).Error.ToString(p))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr_main, Strings.sn_main, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => w.SerialNr));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr_aux, Strings.sn_aux, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => w.SerialNrAux));
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) => 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) => w.SerialNrAux));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state_main, Strings.EndState_main, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => w.EndState));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state_aux, Strings.EndState_aux, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => w.EndStateAux));
@@ -248,26 +302,19 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Remark, Strings.Remark, Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => w.Batch.Remark));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Meter_type, Strings.Meter_type, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.WaterMeterData.Compound ? Strings.Compound : (w.WaterMeterData.HeatMeter ? Strings.Heat_meter : Strings.Single)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_main, Strings.Volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_aux, Strings.Volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume, Strings.Start_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
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) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
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) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume, Strings.End_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
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) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
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) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
#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) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
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) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeRef).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempHiMean, "T hi me", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom1).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempHiStart, "T hi st", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom2).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempHiEnd, "T hi en", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom3).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempHiAve, "T hi av", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).Custom2 + w.GetTestRslt(t).Custom3) / 2).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempLoMean, "T lo me", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom6).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempLoStart, "T lo st", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom7).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempLoEnd, "T lo en", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom8).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempLoAve, "T lo av", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).Custom7 + w.GetTestRslt(t).Custom8) / 2).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
#endif
#if IPERL
AllItems.Add(new WMeterRsltItemSpec(ItemID.OrigCalibFactor, "iPerl OrigCalibFactor", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => (w.OrigCalibFactor.ToString())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.CalibFactor, "iPerl CalibFactor", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => (w.CalibFactor.ToString())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2ErrWOCorrection, "iPerl Q2ErrWOCorrection", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.Q2ErrWOCorrection.ToString(string.IsNullOrEmpty(p) ? "F2" : p))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrectionDone, "iPerl Q2CorrectionDone", Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => (w.Q2CorrectionDone ? "yes" : "no")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrRFlow, "iPerl Q2CorrRFlow", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => (w.Q2CorrRFlow.ToString())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrLFlow, "iPerl Q2CorrLFlow", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => (w.Q2CorrLFlow.ToString())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrFlowRight, "iPerl Q2CorrFlowRight", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.Q2CorrFlowRight.ToString())));
#endif
}
+202 -156
View File
@@ -28,162 +28,204 @@
/// </summary>
private void InitializeComponent()
{
this.connectionStringTextBox1 = new System.Windows.Forms.TextBox();
this.benchNameLabel = new System.Windows.Forms.Label();
this.connectionStringLabel = new System.Windows.Forms.Label();
this.connectionStringTextBox2 = new System.Windows.Forms.TextBox();
this.connectionStringTextBox3 = new System.Windows.Forms.TextBox();
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.benchNameTextBox1 = new System.Windows.Forms.TextBox();
this.benchNameTextBox2 = new System.Windows.Forms.TextBox();
this.benchNameTextBox3 = new System.Windows.Forms.TextBox();
this.languageLabel = new System.Windows.Forms.Label();
this.languageTextBox = new System.Windows.Forms.TextBox();
this.formatLabel = new System.Windows.Forms.Label();
this.timePeriodFormatTextBox = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// connectionStringTextBox1
//
this.connectionStringTextBox1.Location = new System.Drawing.Point(157, 45);
this.connectionStringTextBox1.Name = "connectionStringTextBox1";
this.connectionStringTextBox1.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox1.TabIndex = 0;
//
// benchNameLabel
//
this.benchNameLabel.AutoSize = true;
this.benchNameLabel.Location = new System.Drawing.Point(26, 20);
this.benchNameLabel.Name = "benchNameLabel";
this.benchNameLabel.Size = new System.Drawing.Size(67, 13);
this.benchNameLabel.TabIndex = 1;
this.benchNameLabel.Text = "Bench name";
//
// connectionStringLabel
//
this.connectionStringLabel.AutoSize = true;
this.connectionStringLabel.Location = new System.Drawing.Point(154, 20);
this.connectionStringLabel.Name = "connectionStringLabel";
this.connectionStringLabel.Size = new System.Drawing.Size(89, 13);
this.connectionStringLabel.TabIndex = 3;
this.connectionStringLabel.Text = "Connection string";
//
// connectionStringTextBox2
//
this.connectionStringTextBox2.Location = new System.Drawing.Point(157, 71);
this.connectionStringTextBox2.Name = "connectionStringTextBox2";
this.connectionStringTextBox2.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox2.TabIndex = 2;
//
// connectionStringTextBox3
//
this.connectionStringTextBox3.Location = new System.Drawing.Point(157, 97);
this.connectionStringTextBox3.Name = "connectionStringTextBox3";
this.connectionStringTextBox3.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox3.TabIndex = 4;
//
// okButton
//
this.okButton.Location = new System.Drawing.Point(506, 194);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(95, 38);
this.okButton.TabIndex = 6;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(617, 194);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(95, 38);
this.cancelButton.TabIndex = 7;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// benchNameTextBox1
//
this.benchNameTextBox1.Location = new System.Drawing.Point(29, 45);
this.benchNameTextBox1.Name = "benchNameTextBox1";
this.benchNameTextBox1.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox1.TabIndex = 8;
//
// benchNameTextBox2
//
this.benchNameTextBox2.Location = new System.Drawing.Point(29, 71);
this.benchNameTextBox2.Name = "benchNameTextBox2";
this.benchNameTextBox2.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox2.TabIndex = 9;
//
// benchNameTextBox3
//
this.benchNameTextBox3.Location = new System.Drawing.Point(29, 97);
this.benchNameTextBox3.Name = "benchNameTextBox3";
this.benchNameTextBox3.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox3.TabIndex = 10;
//
// languageLabel
//
this.languageLabel.AutoSize = true;
this.languageLabel.Location = new System.Drawing.Point(26, 183);
this.languageLabel.Name = "languageLabel";
this.languageLabel.Size = new System.Drawing.Size(55, 13);
this.languageLabel.TabIndex = 11;
this.languageLabel.Text = "Language";
//
// languageTextBox
//
this.languageTextBox.Location = new System.Drawing.Point(29, 207);
this.languageTextBox.Name = "languageTextBox";
this.languageTextBox.Size = new System.Drawing.Size(100, 20);
this.languageTextBox.TabIndex = 12;
//
// formatLabel
//
this.formatLabel.AutoSize = true;
this.formatLabel.Location = new System.Drawing.Point(26, 129);
this.formatLabel.Name = "formatLabel";
this.formatLabel.Size = new System.Drawing.Size(39, 13);
this.formatLabel.TabIndex = 13;
this.formatLabel.Text = "Format";
//
// timePeriodFormatTextBox
//
this.timePeriodFormatTextBox.Location = new System.Drawing.Point(29, 151);
this.timePeriodFormatTextBox.Name = "timePeriodFormatTextBox";
this.timePeriodFormatTextBox.Size = new System.Drawing.Size(683, 20);
this.timePeriodFormatTextBox.TabIndex = 14;
//
// DatabaseSettingsDlg
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(743, 254);
this.Controls.Add(this.timePeriodFormatTextBox);
this.Controls.Add(this.formatLabel);
this.Controls.Add(this.languageTextBox);
this.Controls.Add(this.languageLabel);
this.Controls.Add(this.benchNameTextBox3);
this.Controls.Add(this.benchNameTextBox2);
this.Controls.Add(this.benchNameTextBox1);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Controls.Add(this.connectionStringTextBox3);
this.Controls.Add(this.connectionStringLabel);
this.Controls.Add(this.connectionStringTextBox2);
this.Controls.Add(this.benchNameLabel);
this.Controls.Add(this.connectionStringTextBox1);
this.Name = "DatabaseSettingsDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Database Settings";
this.Load += new System.EventHandler(this.DatabaseSettings_Load);
this.ResumeLayout(false);
this.PerformLayout();
this.connectionStringTextBox1 = new System.Windows.Forms.TextBox();
this.benchNameLabel = new System.Windows.Forms.Label();
this.connectionStringLabel = new System.Windows.Forms.Label();
this.connectionStringTextBox2 = new System.Windows.Forms.TextBox();
this.connectionStringTextBox3 = new System.Windows.Forms.TextBox();
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.benchNameTextBox1 = new System.Windows.Forms.TextBox();
this.benchNameTextBox2 = new System.Windows.Forms.TextBox();
this.benchNameTextBox3 = new System.Windows.Forms.TextBox();
this.languageLabel = new System.Windows.Forms.Label();
this.languageTextBox = new System.Windows.Forms.TextBox();
this.formatLabel = new System.Windows.Forms.Label();
this.timePeriodFormatTextBox = new System.Windows.Forms.TextBox();
this.benchNameTextBox5 = new System.Windows.Forms.TextBox();
this.benchNameTextBox4 = new System.Windows.Forms.TextBox();
this.connectionStringTextBox5 = new System.Windows.Forms.TextBox();
this.connectionStringTextBox4 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// connectionStringTextBox1
//
this.connectionStringTextBox1.Location = new System.Drawing.Point(157, 45);
this.connectionStringTextBox1.Name = "connectionStringTextBox1";
this.connectionStringTextBox1.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox1.TabIndex = 3;
//
// benchNameLabel
//
this.benchNameLabel.AutoSize = true;
this.benchNameLabel.Location = new System.Drawing.Point(26, 20);
this.benchNameLabel.Name = "benchNameLabel";
this.benchNameLabel.Size = new System.Drawing.Size(67, 13);
this.benchNameLabel.TabIndex = 0;
this.benchNameLabel.Text = "Bench name";
//
// connectionStringLabel
//
this.connectionStringLabel.AutoSize = true;
this.connectionStringLabel.Location = new System.Drawing.Point(154, 20);
this.connectionStringLabel.Name = "connectionStringLabel";
this.connectionStringLabel.Size = new System.Drawing.Size(89, 13);
this.connectionStringLabel.TabIndex = 1;
this.connectionStringLabel.Text = "Connection string";
//
// connectionStringTextBox2
//
this.connectionStringTextBox2.Location = new System.Drawing.Point(157, 71);
this.connectionStringTextBox2.Name = "connectionStringTextBox2";
this.connectionStringTextBox2.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox2.TabIndex = 5;
//
// connectionStringTextBox3
//
this.connectionStringTextBox3.Location = new System.Drawing.Point(157, 97);
this.connectionStringTextBox3.Name = "connectionStringTextBox3";
this.connectionStringTextBox3.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox3.TabIndex = 7;
//
// okButton
//
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.Location = new System.Drawing.Point(506, 250);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(95, 38);
this.okButton.TabIndex = 16;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(617, 250);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(95, 38);
this.cancelButton.TabIndex = 17;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// benchNameTextBox1
//
this.benchNameTextBox1.Location = new System.Drawing.Point(29, 45);
this.benchNameTextBox1.Name = "benchNameTextBox1";
this.benchNameTextBox1.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox1.TabIndex = 2;
//
// benchNameTextBox2
//
this.benchNameTextBox2.Location = new System.Drawing.Point(29, 71);
this.benchNameTextBox2.Name = "benchNameTextBox2";
this.benchNameTextBox2.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox2.TabIndex = 4;
//
// benchNameTextBox3
//
this.benchNameTextBox3.Location = new System.Drawing.Point(29, 97);
this.benchNameTextBox3.Name = "benchNameTextBox3";
this.benchNameTextBox3.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox3.TabIndex = 6;
//
// languageLabel
//
this.languageLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.languageLabel.AutoSize = true;
this.languageLabel.Location = new System.Drawing.Point(26, 239);
this.languageLabel.Name = "languageLabel";
this.languageLabel.Size = new System.Drawing.Size(55, 13);
this.languageLabel.TabIndex = 14;
this.languageLabel.Text = "Language";
//
// languageTextBox
//
this.languageTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.languageTextBox.Location = new System.Drawing.Point(29, 263);
this.languageTextBox.Name = "languageTextBox";
this.languageTextBox.Size = new System.Drawing.Size(100, 20);
this.languageTextBox.TabIndex = 15;
//
// formatLabel
//
this.formatLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.formatLabel.AutoSize = true;
this.formatLabel.Location = new System.Drawing.Point(26, 185);
this.formatLabel.Name = "formatLabel";
this.formatLabel.Size = new System.Drawing.Size(39, 13);
this.formatLabel.TabIndex = 12;
this.formatLabel.Text = "Format";
//
// timePeriodFormatTextBox
//
this.timePeriodFormatTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.timePeriodFormatTextBox.Location = new System.Drawing.Point(29, 207);
this.timePeriodFormatTextBox.Name = "timePeriodFormatTextBox";
this.timePeriodFormatTextBox.Size = new System.Drawing.Size(683, 20);
this.timePeriodFormatTextBox.TabIndex = 13;
//
// benchNameTextBox5
//
this.benchNameTextBox5.Location = new System.Drawing.Point(29, 149);
this.benchNameTextBox5.Name = "benchNameTextBox5";
this.benchNameTextBox5.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox5.TabIndex = 10;
//
// benchNameTextBox4
//
this.benchNameTextBox4.Location = new System.Drawing.Point(29, 123);
this.benchNameTextBox4.Name = "benchNameTextBox4";
this.benchNameTextBox4.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox4.TabIndex = 8;
//
// connectionStringTextBox5
//
this.connectionStringTextBox5.Location = new System.Drawing.Point(157, 149);
this.connectionStringTextBox5.Name = "connectionStringTextBox5";
this.connectionStringTextBox5.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox5.TabIndex = 11;
//
// connectionStringTextBox4
//
this.connectionStringTextBox4.Location = new System.Drawing.Point(157, 123);
this.connectionStringTextBox4.Name = "connectionStringTextBox4";
this.connectionStringTextBox4.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox4.TabIndex = 9;
//
// DatabaseSettingsDlg
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(743, 310);
this.Controls.Add(this.benchNameTextBox5);
this.Controls.Add(this.benchNameTextBox4);
this.Controls.Add(this.connectionStringTextBox5);
this.Controls.Add(this.connectionStringTextBox4);
this.Controls.Add(this.timePeriodFormatTextBox);
this.Controls.Add(this.formatLabel);
this.Controls.Add(this.languageTextBox);
this.Controls.Add(this.languageLabel);
this.Controls.Add(this.benchNameTextBox3);
this.Controls.Add(this.benchNameTextBox2);
this.Controls.Add(this.benchNameTextBox1);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Controls.Add(this.connectionStringTextBox3);
this.Controls.Add(this.connectionStringLabel);
this.Controls.Add(this.connectionStringTextBox2);
this.Controls.Add(this.benchNameLabel);
this.Controls.Add(this.connectionStringTextBox1);
this.Name = "DatabaseSettingsDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Database Settings";
this.Load += new System.EventHandler(this.DatabaseSettings_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
@@ -203,5 +245,9 @@
private System.Windows.Forms.TextBox languageTextBox;
private System.Windows.Forms.Label formatLabel;
private System.Windows.Forms.TextBox timePeriodFormatTextBox;
private System.Windows.Forms.TextBox benchNameTextBox5;
private System.Windows.Forms.TextBox benchNameTextBox4;
private System.Windows.Forms.TextBox connectionStringTextBox5;
private System.Windows.Forms.TextBox connectionStringTextBox4;
}
}
+8 -6
View File
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ResultsBrowser.Resources;
@@ -24,10 +18,14 @@ namespace ResultsBrowser.Forms
benchNameTextBox1.Text = Program.LocalSettings.Bench1;
benchNameTextBox2.Text = Program.LocalSettings.Bench2;
benchNameTextBox3.Text = Program.LocalSettings.Bench3;
benchNameTextBox4.Text = Program.LocalSettings.Bench4;
benchNameTextBox5.Text = Program.LocalSettings.Bench5;
connectionStringTextBox1.Text = Program.LocalSettings.ConnectionString1;
connectionStringTextBox2.Text = Program.LocalSettings.ConnectionString2;
connectionStringTextBox3.Text = Program.LocalSettings.ConnectionString3;
connectionStringTextBox4.Text = Program.LocalSettings.ConnectionString4;
connectionStringTextBox5.Text = Program.LocalSettings.ConnectionString5;
timePeriodFormatTextBox.Text = Program.LocalSettings.TimePeriodFormat;
@@ -50,10 +48,14 @@ namespace ResultsBrowser.Forms
Program.LocalSettings.Bench1 = benchNameTextBox1.Text;
Program.LocalSettings.Bench2 = benchNameTextBox2.Text;
Program.LocalSettings.Bench3 = benchNameTextBox3.Text;
Program.LocalSettings.Bench4 = benchNameTextBox4.Text;
Program.LocalSettings.Bench5 = benchNameTextBox5.Text;
Program.LocalSettings.ConnectionString1 = connectionStringTextBox1.Text;
Program.LocalSettings.ConnectionString2 = connectionStringTextBox2.Text;
Program.LocalSettings.ConnectionString3 = connectionStringTextBox3.Text;
Program.LocalSettings.ConnectionString4 = connectionStringTextBox4.Text;
Program.LocalSettings.ConnectionString5 = connectionStringTextBox5.Text;
Program.LocalSettings.TimePeriodFormat = timePeriodFormatTextBox.Text;
+6
View File
@@ -27,15 +27,21 @@ namespace ResultsBrowser
public string Bench1;
public string Bench2;
public string Bench3;
public string Bench4;
public string Bench5;
/// Database settings of servers.
public string ConnectionString1;
public string ConnectionString2;
public string ConnectionString3;
public string ConnectionString4;
public string ConnectionString5;
public bool Bench1Selected;
public bool Bench2Selected;
public bool Bench3Selected;
public bool Bench4Selected;
public bool Bench5Selected;
public string TimePeriodFormat;
@@ -232,13 +232,13 @@ namespace ResultsBrowser.Output.Printers.QueryResults
lineNr += (secondTableOffset * 2) / SpacingOne;
PrintAt(e, Tab1, lineNr * SpacingOne, "Temperatur");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientTempAve().ToString("F1") + " \x00b0C");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbTempMean().ToString("F1") + " \x00b0C");
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Feuchtigkeit");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientHumiAve().ToString("F0") + " %");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbHumiMean().ToString("F0") + " %");
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Luftdruck");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientPressAve().ToString("F0") + " mbar");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbPressMean().ToString("F0") + " mbar");
lineNr++;
PrintAt(e, Tab3, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
+2 -2
View File
@@ -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.12.542.0")]
[assembly: AssemblyFileVersion("2.12.542.0")]
[assembly: AssemblyVersion("2.12.561.0")]
[assembly: AssemblyFileVersion("2.12.561.0")]
+2 -2
View File
@@ -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>
+42 -12
View File
@@ -45,6 +45,8 @@
this.executeQueryBtn = new System.Windows.Forms.Button();
this.addFilterBtn = new System.Windows.Forms.Button();
this.testBenchesGroupBox = new System.Windows.Forms.GroupBox();
this.checkBox5 = new System.Windows.Forms.RadioButton();
this.checkBox4 = new System.Windows.Forms.RadioButton();
this.checkBox3 = new System.Windows.Forms.RadioButton();
this.checkBox2 = new System.Windows.Forms.RadioButton();
this.checkBox1 = new System.Windows.Forms.RadioButton();
@@ -151,7 +153,7 @@
//
// statisticsBtn
//
this.statisticsBtn.Location = new System.Drawing.Point(8, 562);
this.statisticsBtn.Location = new System.Drawing.Point(8, 581);
this.statisticsBtn.Name = "statisticsBtn";
this.statisticsBtn.Size = new System.Drawing.Size(125, 33);
this.statisticsBtn.TabIndex = 10;
@@ -161,7 +163,7 @@
//
// printQueryResultsBtn
//
this.printQueryResultsBtn.Location = new System.Drawing.Point(8, 487);
this.printQueryResultsBtn.Location = new System.Drawing.Point(8, 506);
this.printQueryResultsBtn.Name = "printQueryResultsBtn";
this.printQueryResultsBtn.Size = new System.Drawing.Size(125, 33);
this.printQueryResultsBtn.TabIndex = 9;
@@ -171,7 +173,7 @@
//
// exportQueryResultsBtn
//
this.exportQueryResultsBtn.Location = new System.Drawing.Point(8, 448);
this.exportQueryResultsBtn.Location = new System.Drawing.Point(8, 467);
this.exportQueryResultsBtn.Name = "exportQueryResultsBtn";
this.exportQueryResultsBtn.Size = new System.Drawing.Size(125, 33);
this.exportQueryResultsBtn.TabIndex = 8;
@@ -181,7 +183,7 @@
//
// formatOfResultsBtn
//
this.formatOfResultsBtn.Location = new System.Drawing.Point(8, 255);
this.formatOfResultsBtn.Location = new System.Drawing.Point(8, 274);
this.formatOfResultsBtn.Name = "formatOfResultsBtn";
this.formatOfResultsBtn.Size = new System.Drawing.Size(125, 33);
this.formatOfResultsBtn.TabIndex = 7;
@@ -191,7 +193,7 @@
//
// clearFiltersBtn
//
this.clearFiltersBtn.Location = new System.Drawing.Point(8, 177);
this.clearFiltersBtn.Location = new System.Drawing.Point(8, 196);
this.clearFiltersBtn.Name = "clearFiltersBtn";
this.clearFiltersBtn.Size = new System.Drawing.Size(125, 33);
this.clearFiltersBtn.TabIndex = 2;
@@ -211,7 +213,7 @@
//
// saveConfigBtn
//
this.saveConfigBtn.Location = new System.Drawing.Point(8, 294);
this.saveConfigBtn.Location = new System.Drawing.Point(8, 313);
this.saveConfigBtn.Name = "saveConfigBtn";
this.saveConfigBtn.Size = new System.Drawing.Size(125, 33);
this.saveConfigBtn.TabIndex = 5;
@@ -221,7 +223,7 @@
//
// loadConfigBtn
//
this.loadConfigBtn.Location = new System.Drawing.Point(8, 333);
this.loadConfigBtn.Location = new System.Drawing.Point(8, 352);
this.loadConfigBtn.Name = "loadConfigBtn";
this.loadConfigBtn.Size = new System.Drawing.Size(125, 33);
this.loadConfigBtn.TabIndex = 4;
@@ -231,7 +233,7 @@
//
// executeQueryBtn
//
this.executeQueryBtn.Location = new System.Drawing.Point(8, 409);
this.executeQueryBtn.Location = new System.Drawing.Point(8, 428);
this.executeQueryBtn.Name = "executeQueryBtn";
this.executeQueryBtn.Size = new System.Drawing.Size(125, 33);
this.executeQueryBtn.TabIndex = 6;
@@ -241,7 +243,7 @@
//
// addFilterBtn
//
this.addFilterBtn.Location = new System.Drawing.Point(8, 216);
this.addFilterBtn.Location = new System.Drawing.Point(8, 235);
this.addFilterBtn.Name = "addFilterBtn";
this.addFilterBtn.Size = new System.Drawing.Size(125, 33);
this.addFilterBtn.TabIndex = 3;
@@ -251,20 +253,46 @@
//
// testBenchesGroupBox
//
this.testBenchesGroupBox.Controls.Add(this.checkBox5);
this.testBenchesGroupBox.Controls.Add(this.checkBox4);
this.testBenchesGroupBox.Controls.Add(this.checkBox3);
this.testBenchesGroupBox.Controls.Add(this.checkBox2);
this.testBenchesGroupBox.Controls.Add(this.checkBox1);
this.testBenchesGroupBox.Location = new System.Drawing.Point(8, 54);
this.testBenchesGroupBox.Name = "testBenchesGroupBox";
this.testBenchesGroupBox.Size = new System.Drawing.Size(125, 99);
this.testBenchesGroupBox.Size = new System.Drawing.Size(125, 135);
this.testBenchesGroupBox.TabIndex = 1;
this.testBenchesGroupBox.TabStop = false;
this.testBenchesGroupBox.Text = "Test benches";
//
// checkBox5
//
this.checkBox5.AutoSize = true;
this.checkBox5.Location = new System.Drawing.Point(23, 106);
this.checkBox5.Name = "checkBox5";
this.checkBox5.Size = new System.Drawing.Size(85, 17);
this.checkBox5.TabIndex = 4;
this.checkBox5.TabStop = true;
this.checkBox5.Text = "radioButton5";
this.checkBox5.UseVisualStyleBackColor = true;
this.checkBox5.CheckedChanged += new System.EventHandler(this.checkBox5_CheckedChanged);
//
// checkBox4
//
this.checkBox4.AutoSize = true;
this.checkBox4.Location = new System.Drawing.Point(23, 86);
this.checkBox4.Name = "checkBox4";
this.checkBox4.Size = new System.Drawing.Size(85, 17);
this.checkBox4.TabIndex = 3;
this.checkBox4.TabStop = true;
this.checkBox4.Text = "radioButton4";
this.checkBox4.UseVisualStyleBackColor = true;
this.checkBox4.CheckedChanged += new System.EventHandler(this.checkBox4_CheckedChanged);
//
// checkBox3
//
this.checkBox3.AutoSize = true;
this.checkBox3.Location = new System.Drawing.Point(23, 69);
this.checkBox3.Location = new System.Drawing.Point(23, 65);
this.checkBox3.Name = "checkBox3";
this.checkBox3.Size = new System.Drawing.Size(85, 17);
this.checkBox3.TabIndex = 2;
@@ -276,7 +304,7 @@
// checkBox2
//
this.checkBox2.AutoSize = true;
this.checkBox2.Location = new System.Drawing.Point(23, 46);
this.checkBox2.Location = new System.Drawing.Point(23, 44);
this.checkBox2.Name = "checkBox2";
this.checkBox2.Size = new System.Drawing.Size(85, 17);
this.checkBox2.TabIndex = 1;
@@ -344,5 +372,7 @@
private System.Windows.Forms.Button printQueryResultsBtn;
private System.Windows.Forms.Button statisticsBtn;
private System.Windows.Forms.ListView resultsListView;
private System.Windows.Forms.RadioButton checkBox5;
private System.Windows.Forms.RadioButton checkBox4;
}
}
+68 -4
View File
@@ -5,6 +5,7 @@ using NHibernate;
using Results.Entities;
using ResultsBrowser.Filters;
using ResultsBrowser.Resources;
using System.IO;
namespace ResultsBrowser
{
@@ -49,6 +50,8 @@ namespace ResultsBrowser
checkBox1.Checked = Program.LocalSettings.Bench1Selected;
checkBox2.Checked = Program.LocalSettings.Bench2Selected;
checkBox3.Checked = Program.LocalSettings.Bench3Selected;
checkBox4.Checked = Program.LocalSettings.Bench4Selected;
checkBox5.Checked = Program.LocalSettings.Bench5Selected;
if (args.Length == 1 && args[0].IndexOf(".qry") == args[0].Length - 4)
{
@@ -69,10 +72,14 @@ namespace ResultsBrowser
checkBox1.Text = Program.LocalSettings.Bench1;
checkBox2.Text = Program.LocalSettings.Bench2;
checkBox3.Text = Program.LocalSettings.Bench3;
checkBox4.Text = Program.LocalSettings.Bench4;
checkBox5.Text = Program.LocalSettings.Bench5;
checkBox1.Visible = !string.IsNullOrEmpty(checkBox1.Text);
checkBox2.Visible = !string.IsNullOrEmpty(checkBox2.Text);
checkBox3.Visible = !string.IsNullOrEmpty(checkBox3.Text);
checkBox4.Visible = !string.IsNullOrEmpty(checkBox4.Text);
checkBox5.Visible = !string.IsNullOrEmpty(checkBox5.Text);
}
string BenchName()
@@ -110,12 +117,16 @@ namespace ResultsBrowser
private void checkBox1_CheckedChanged(object sender, EventArgs e) { SaveCheckBoxes(); }
private void checkBox2_CheckedChanged(object sender, EventArgs e) { SaveCheckBoxes(); }
private void checkBox3_CheckedChanged(object sender, EventArgs e) { SaveCheckBoxes(); }
private void checkBox4_CheckedChanged(object sender, EventArgs e) { SaveCheckBoxes(); }
private void checkBox5_CheckedChanged(object sender, EventArgs e) { SaveCheckBoxes(); }
void SaveCheckBoxes()
{
Program.LocalSettings.Bench1Selected = checkBox1.Checked;
Program.LocalSettings.Bench2Selected = checkBox2.Checked;
Program.LocalSettings.Bench3Selected = checkBox3.Checked;
Program.LocalSettings.Bench4Selected = checkBox4.Checked;
Program.LocalSettings.Bench5Selected = checkBox5.Checked;
Program.LocalSettings.Save();
}
@@ -214,7 +225,9 @@ namespace ResultsBrowser
Results.DB.ConnectionString = checkBox1.Checked ? Program.LocalSettings.ConnectionString1 :
(checkBox2.Checked ? Program.LocalSettings.ConnectionString2 :
(checkBox3.Checked ? Program.LocalSettings.ConnectionString3 :
Program.LocalSettings.ConnectionString1));
(checkBox4.Checked ? Program.LocalSettings.ConnectionString4 :
(checkBox5.Checked ? Program.LocalSettings.ConnectionString5 :
Program.LocalSettings.ConnectionString1))));
ISession[] sessions = new ISession[] { Results.DB.CreateSession() };
@@ -259,8 +272,15 @@ namespace ResultsBrowser
ListViewItem lvi = null;
foreach (var item in items)
{
if (lvi == null) lvi = new ListViewItem(item.Print(wm));
else lvi.SubItems.Add(item.Print(wm));
/// Get text and strip color information
string itemText = item.Print(wm);
string[] texts = itemText.Split(new char[] { '|' });
if (texts.Length == 2) { itemText = texts[0]; }
if (lvi == null)
lvi = new ListViewItem(itemText);
else
lvi.SubItems.Add(itemText);
}
if (lvi != null) resultsListView.Items.Add(lvi);
}
@@ -288,8 +308,52 @@ namespace ResultsBrowser
private void exportQueryResultsBtn_Click(object sender, EventArgs e)
{
if (waterMeters == null || waterMeters.Count == 0) return;
IList<Results.WMeterRsltItemSpec> items = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
if (waterMeters == null || waterMeters.Count == 0 || items.Count == 0) return;
SaveFileDialog dlg = new SaveFileDialog();
if (dlg.ShowDialog() == DialogResult.OK)
{
using (TextWriter writer = new StreamWriter(dlg.FileName))
{
try
{
for (int i = 0; i < items.Count; i++)
{
writer.Write(items[i].Caption);
if (i == items.Count - 1)
writer.WriteLine(); /// New line after the last item
else
writer.Write(";"); /// Semicolon between two items
}
foreach (var wm in waterMeters)
{
for (int i = 0; i < items.Count; i++)
{
/// Get text and strip color information
string itemText = items[i].Print(wm);
string[] texts = itemText.Split(new char[] { '|' });
if (texts.Length == 2) { itemText = texts[0]; }
writer.Write(itemText);
if (i == items.Count - 1)
writer.WriteLine(); /// New line after the last item
else
writer.Write(";"); /// Semicolon between two items
}
}
}
catch (Exception exc)
{
MessageBox.Show(exc.Message, Strings.Error_displaying_results, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
}
}
private void printQueryResultsBtn_Click(object sender, EventArgs e)
@@ -226,11 +226,8 @@ namespace TBF.BenchControl.Output.FileWriters.Basic
{
MetersKind = config.MetersKind,
SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(selectedItems),
AvailableItems = new List<Results.WMeterRsltItemSpec>()
};
foreach (var v in Results.WMeterRsltItemSpec.AllItems) dlg.AvailableItems.Add(v);
if (dlg.ShowDialog() == DialogResult.OK)
{
selectedItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
@@ -271,12 +271,12 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
}
}
WriteRslts2(batch, writer);
WriteRsltsEx(batch, writer);
writer.Close();
}
void WriteRslts2(Results.Entities.Batch batch, StreamWriter wrtr)
void WriteRsltsEx(Results.Entities.Batch batch, StreamWriter wrtr)
{
///----------
/// Header
@@ -289,11 +289,8 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
{
MetersKind = config.MetersKind,
SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(commonItems),
AvailableItems = new List<Results.WMeterRsltItemSpec>()
};
foreach (var v in Results.WMeterRsltItemSpec.AllItems) dlg.AvailableItems.Add(v);
if (dlg.ShowDialog() == DialogResult.OK)
{
commonItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
@@ -306,11 +303,8 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
{
MetersKind = config.MetersKind,
SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(testItems),
AvailableItems = new List<Results.WMeterRsltItemSpec>()
};
foreach (var v in Results.WMeterRsltItemSpec.AllItems) dlg.AvailableItems.Add(v);
if (dlg.ShowDialog() == DialogResult.OK)
{
testItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
@@ -347,12 +341,7 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
};
commonItemsButton_Click(this, null);
///
/// Use legacy test inems from local settings
///
testItems = config.Factory.ClassName.Contains("Compound") ? Program.LocalSettings.RsltItems_Disk_CombinedWM
: Program.LocalSettings.RsltItems_Disk_SingleWM;
testItemsButton_Click(this, null);
testItemsButton_Click(this, null);
}
}
@@ -284,11 +284,8 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
{
MetersKind = config.MetersKind,
SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(commonItems),
AvailableItems = new List<Results.WMeterRsltItemSpec>()
};
foreach (var v in Results.WMeterRsltItemSpec.AllItems) dlg.AvailableItems.Add(v);
if (dlg.ShowDialog() == DialogResult.OK)
{
commonItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
@@ -301,11 +298,8 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
{
MetersKind = config.MetersKind,
SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(testItems),
AvailableItems = new List<Results.WMeterRsltItemSpec>()
};
foreach (var v in Results.WMeterRsltItemSpec.AllItems) dlg.AvailableItems.Add(v);
if (dlg.ShowDialog() == DialogResult.OK)
{
testItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
@@ -233,11 +233,8 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
{
MetersKind = config.MetersKind,
SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(commonItems),
AvailableItems = new List<Results.WMeterRsltItemSpec>()
};
foreach (var v in Results.WMeterRsltItemSpec.AllItems) dlg.AvailableItems.Add(v);
if (dlg.ShowDialog() == DialogResult.OK)
{
commonItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
@@ -250,11 +247,8 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
{
MetersKind = config.MetersKind,
SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(testItems),
AvailableItems = new List<Results.WMeterRsltItemSpec>()
};
foreach (var v in Results.WMeterRsltItemSpec.AllItems) dlg.AvailableItems.Add(v);
if (dlg.ShowDialog() == DialogResult.OK)
{
testItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
@@ -1,372 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Printing;
using System.IO;
using Config.Entities;
using TBF.Resources;
namespace TBF.BenchControl.ResultsPrinters.Basic
{
public class BasicPrintDocument : PrintDocument
{
const string FontFamilyName = "Arial"; //"Times New Roman";
const int SpacingOne = 18;
const int SpacingOneAndHalf = (3 * SpacingOne) / 2;
readonly int topMargin;
readonly int bottomMargin;
readonly int leftMargin;
readonly int TitleX;
readonly int TitleY; /// Depends on the size of the header
readonly int HdrTop; /// = TitleY + 60
readonly int BodyTop; /// = HdrTop + 160
/// Size of the printed area without margins, after taking into account 'pageOrientation'
int printHeight;
int printWidth;
/// <summary>
/// Property variable for the Font the user wishes to use
/// </summary>
Font font;
Font boldFont;
Font titleFont;
///
/// Data to print
///
Results.Entities.Batch batch;
///
/// Items to print
///
readonly IList<Results.ItemSpec> rsltItems;
///
/// Layout and status
///
int nrWMsOnFirstPage;
int nrWMsOnNextPage;
int nextWMNr; /// nr. of watermeter to be printed as the first one on the next page
int nrPages;
int pageNr; /// Page number to be printed at the bottom of the page
/// <summary>
/// Constructor
/// </summary>
/// <param name="textToPrint">Text to be printed</param>
public BasicPrintDocument(Results.Entities.Batch batch,
PageOrientation pageOrientation,
int topMargin, int bottomMargin, int leftMargin)
{
this.batch = batch;
DefaultPageSettings.Landscape = (pageOrientation == PageOrientation.Landscape);
this.topMargin = topMargin;
this.bottomMargin = bottomMargin;
this.leftMargin = leftMargin;
TitleX = leftMargin;
TitleY = topMargin; /// Depends on the size of the header
HdrTop = TitleY + 60;
BodyTop = HdrTop + 160;
if (batch.WaterMeters.Count > 0 && batch.WaterMeters[0].Compound())
{
rsltItems = Results.ItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Printer_CombinedWM);
}
else
{
rsltItems = Results.ItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Printer_SingleWM);
}
/// Set print area size and margins (in dots using 100 dpi)
if (DefaultPageSettings.Landscape)
{
printHeight = base.DefaultPageSettings.PaperSize.Width - topMargin - bottomMargin;
printWidth = base.DefaultPageSettings.PaperSize.Height - leftMargin - leftMargin;
}
else
{
printHeight = base.DefaultPageSettings.PaperSize.Height - topMargin - bottomMargin;
printWidth = base.DefaultPageSettings.PaperSize.Width - leftMargin - leftMargin;
}
int testsCount = 0;
if (batch.WaterMeters.Count > 0)
{
foreach (var mtr in batch.WaterMeters[0].MeterTestRslts)
{
if (mtr.Publish() == Config.Entities.Publish.Always) testsCount++;
}
}
if (batch.WaterMeters.Count > 0 && batch.WaterMeters[0].Compound()) testsCount /= 3;
int wmSectionHeight = (testsCount + 4) * SpacingOne;
nrWMsOnFirstPage = (printHeight - BodyTop + TitleY - 2 * SpacingOne) / wmSectionHeight;
nrWMsOnNextPage = (printHeight - 2 * SpacingOne) / wmSectionHeight;
nrWMsOnNextPage = Math.Max(nrWMsOnNextPage, 1); /// Prevent division by zero if there are too many WM tests
nrPages = 1 + (batch.WaterMeters.Count - nrWMsOnFirstPage + nrWMsOnNextPage - 1) / nrWMsOnNextPage;
pageNr = 1;
nextWMNr = 0;
}
/// <summary>
/// Override the default onbeginPrint method of the PrintDocument Object
/// </summary>
/// <param name=e></param>
/// <remarks></remarks>
protected override void OnBeginPrint(System.Drawing.Printing.PrintEventArgs e)
{
base.OnBeginPrint(e);
if (font == null) { font = new Font(FontFamilyName, 10, FontStyle.Regular); }
if (boldFont == null) { boldFont = new Font(FontFamilyName, 10, FontStyle.Bold); }
if (titleFont == null) { titleFont = new Font(FontFamilyName, 18, FontStyle.Bold); }
}
/// <summary>
/// Override the default OnPrintPage method of the PrintDocument.
/// </summary>
/// <param name=e></param>
/// <remarks>This provides the print logic for our document</remarks>
protected override void OnPrintPage(System.Drawing.Printing.PrintPageEventArgs e)
{
/// Run base code
base.OnPrintPage(e);
if (File.Exists("C:\\TBF\\header.png"))
{
Image img = Image.FromFile("C:\\TBF\\header.png");
e.Graphics.DrawImage(new Bitmap(img), new Rectangle(0, 0, 827, 1169));
}
/// Use the StringFormat class for the text layout of our document
StringFormat format = new StringFormat(StringFormatFlags.LineLimit);
if (pageNr == 1)
{
///----------
/// Header
///----------
RectangleF printArea = new RectangleF(TitleX, TitleY, printWidth, 40);
e.Graphics.DrawString(batch.ProtocolTitle, titleFont, Brushes.Black, printArea);
string[] leftColumn = new string[]
{
"Batch number: ",
"Date and time: ",
"Procedure: ",
Strings.User + ": ",
"Ambient temperature: ",
"Ambient pressure: ",
"Ambient humidity: ",
};
string[] rightColumn = new string[]
{
batch.BatchNr.ToString(),
//batch.EndTime.ToShortDateString() + " " + batch.EndTime.ToShortTimeString(),
string.Format("{0:yyyy.MM.dd HH:mm}", batch.EndTime),
batch.ProcedureName,
Users.GlobalData.CurrentUser.UserName,
batch.AmbientTempAve().ToString("F1") + " °C",
Config.Units.ConvertTo(Config.Unit.mbar, batch.AmbientPressAve()).ToString("F0") + " mbar",
batch.AmbientHumiAve().ToString("F0") + " %",
};
/// Determine max. left column width in characters
int maxLen = 0;
foreach (var s in leftColumn) if (s.Length > maxLen) maxLen = s.Length;
/// Write aligned columns
for (int i = 0; i < Math.Min(leftColumn.Length, rightColumn.Length); i++)
{
PrintAt(e, leftMargin, HdrTop + SpacingOne * i, leftColumn[i]);
PrintAt(e, 300, HdrTop + SpacingOne * i, rightColumn[i]);
}
}
///--------
/// Body
///--------
/// This variable represents the top coordinate of the area where WM results are printed
/// and it is updated (increased by) the value returned by PrintXyzWM() - the section size.
int nextWmTop = (pageNr == 1) ? BodyTop : TitleY;
int nrWMsOnPage = (pageNr == 1) ? nrWMsOnFirstPage : nrWMsOnNextPage;
for (int wmNr = nextWMNr; wmNr < Math.Min(nextWMNr + nrWMsOnPage, batch.WaterMeters.Count); wmNr++) /// wmNr is 0-based
{
int wmPosition = true ? batch.WaterMeters[wmNr].WMPosition : (wmNr + 1);
nextWmTop += PrintWM(e, batch.WaterMeters[wmNr], wmPosition, nextWmTop);
}
nextWMNr += nrWMsOnPage;
e.HasMorePages = (nextWMNr < batch.WaterMeters.Count);
///----------
/// Footer
///----------
string footerText = string.Format("str. {1}/{2}", Strings.Page, pageNr++, nrPages);
int footerWidth = (int)e.Graphics.MeasureString(footerText, font).Width;
PrintAt(e, leftMargin + (printWidth - footerWidth) / 2, topMargin + printHeight - SpacingOne, footerText);
}
/// <summary>
/// Print one water meter results
/// </summary>
/// <param name="wm">Water meter</param>
/// <param name="printedWMNr">Number of the water meter printed</param>
/// <param name="top">Top coordinate of watermeter data</param>
/// <returns>The height of the printed section</returns>
int PrintWM(System.Drawing.Printing.PrintPageEventArgs e,
Results.Entities.WaterMeter wm, int printedWMNr, int top)
{
/// Determin column widths
float[] columnPos = new float[rsltItems.Count + 1];
columnPos[0] = (float)leftMargin;
for (int i = 0; i < rsltItems.Count; i++)
{
float columnWidth = e.Graphics.MeasureString(rsltItems[i].ClmnHeaderText, font).Width;
foreach (var mtr in wm.MeterTestRslts)
{
string itemText;
if (!wm.Compound())
{
itemText = rsltItems[i].Print(mtr);
}
else if (mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
{
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
itemText = rsltItems[i].PrintCombined(mainMtr, auxMtr, mtr);
}
else
{
continue;
}
/// Strip color information
string[] texts = itemText.Split(new char[] { '|' });
if (texts.Length == 2) { itemText = texts[0]; }
float width = e.Graphics.MeasureString(itemText, font).Width;
if (width > columnWidth) columnWidth = width;
}
columnPos[i + 1] = columnPos[i] + columnWidth + 20.0f;
}
int tableLeftX = (int)columnPos[0];
int tableRightX = (int)columnPos[rsltItems.Count] - 20;
string wmText = string.Format("Water meter {0}", printedWMNr);
PrintAt(e, leftMargin, top, wmText);
if (!string.IsNullOrEmpty(wm.SerialNr))
{
PrintAt(e, leftMargin + (int)e.Graphics.MeasureString(wmText, font).Width, top,
string.Format(" s/n = {0}", wm.SerialNr));
}
/// Horizontal line
int horY = top + 25;
e.Graphics.DrawLine(new Pen(Color.Black, 2), new Point(tableLeftX, horY), new Point(tableRightX, horY));
for (int i = 0; i < rsltItems.Count; i++)
{
PrintAt(e, (int)columnPos[i], top + 27, rsltItems[i].ClmnHeaderText);
}
/// Horizontal line
horY = top + 27 + SpacingOne;
e.Graphics.DrawLine(new Pen(Color.Black, 2), new Point(tableLeftX, horY), new Point(tableRightX, horY));
int testsCount = 0;
foreach (var mtr in wm.MeterTestRslts)
{
if (mtr.Publish() == Config.Entities.Publish.Always)
{
testsCount++;
for (int i = 0; i < rsltItems.Count; i++)
{
string itemText;
if (!wm.Compound())
{
/// Single water meter
itemText = rsltItems[i].Print(mtr);
}
else if (mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
{
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
itemText = rsltItems[i].PrintCombined(mainMtr, auxMtr, mtr);
}
else
{
continue;
}
/// Strip color information
string[] texts = itemText.Split(new char[] { '|' });
if (texts.Length == 2)
{
itemText = texts[0];
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
/// TODO: How to print colors?
}
PrintAt(e, (int)columnPos[i], top + 30 + SpacingOne * testsCount, itemText);
}
}
}
/// Horizontal line
horY = top + 30 + SpacingOne * (testsCount + 1);
e.Graphics.DrawLine(new Pen(Color.Black, 2), new Point(tableLeftX, horY), new Point(tableRightX, horY));
return (testsCount + 4) * SpacingOne;
}
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text)
{
PrintAt(e, p.X, p.Y, text);
}
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
{
RectangleF printArea = new RectangleF(x, y, 667, SpacingOne);
e.Graphics.DrawString(text, this.font, Brushes.Black, printArea);
}
void PrintBoldAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text)
{
PrintBoldAt(e, p.X, p.Y, text);
}
void PrintBoldAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
{
RectangleF printArea = new RectangleF(x, y, 667, SpacingOne);
e.Graphics.DrawString(text, this.boldFont, Brushes.Black, printArea);
}
}
}
@@ -1,64 +0,0 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using log4net;
namespace TBF.BenchControl.ResultsPrinters.Basic
{
public class Printer : ComponentBase, IOperation, GenericDevices.IResultsPrinter
{
private static readonly ILog log = LogManager.GetLogger(typeof(Printer));
public override string ToString() { return string.Format("ResultsPrinters.Basic({0})", Cfg.ToString(1)); }
readonly PrinterCfg printerCfg;
public bool SupressPrinting { get { return printerCfg.SupressPrinting; } }
/// <summary> Data to print </summary>
Results.Entities.Batch batch;
public Printer() { }
public Printer(Generic.IComponentCfg cfg)
: base(cfg)
{
printerCfg = cfg as PrinterCfg;
log.Debug(this.ToString());
}
/// <summary>
/// Prints the test cycle results, Events: Event.ResultsPrinted
/// </summary>
/// <param name="batch">Batch results to print</param>
/// <returns>Reference to the operation</returns>
public IOperation PrintResultsOp(Results.Entities.Batch batch)
{
this.batch = batch;
return this;
}
/// <summary>Start this operation</summary>
public void Start()
{
if (batch.WaterMeters.Count > 0)
{
new BasicPrintDocument(batch, printerCfg.PageOrientation, printerCfg.TopMargin, printerCfg.BottomMargin, printerCfg.LeftMargin).Print();
}
}
/// <summary>Run this operation</summary>
/// <returns>Event.ResultsPrinted</returns>
public Event Run()
{
return Event.ResultsPrinted;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
}
}
}
@@ -1,56 +0,0 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.ResultsPrinters.Basic
{
public class PrinterCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponentCfgCtrl GetControl() { return new PrinterCfgCtrl(); }
///
/// Serialized parameters
///
public PageOrientation PageOrientation;
public int TopMargin;
public int BottomMargin;
public int LeftMargin;
public bool SupressPrinting; /// Bypass printing when true
/// Private parameterless constructor invoked by all other (public) constructors
PrinterCfg()
{
Name = "BasicResultsPrinter";
ParentName = string.Empty;
PageOrientation = PageOrientation.Portrait;
TopMargin = 100;
BottomMargin = 100;
LeftMargin = 100;
SupressPrinting = false;
}
public PrinterCfg(IComponentFactory factory)
: this()
{
this.Factory = factory;
}
public string ToString(int i)
{
return string.Format("Name={0}, Orientation={1}, Margins T={2} B={3} L={4}, SupressPrinting={5}",
Name,
PageOrientation,
TopMargin,
BottomMargin,
LeftMargin,
SupressPrinting ? "yes" : "no"
);
}
}
}
@@ -1,193 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
namespace TBF.BenchControl.ResultsPrinters.Basic
{
partial class PrinterCfgCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.supressPrintingCheckBox = new System.Windows.Forms.CheckBox();
this.orientationLabel = new System.Windows.Forms.Label();
this.orientationComboBox = new System.Windows.Forms.ComboBox();
this.topMarginTextBox = new System.Windows.Forms.TextBox();
this.topMarginLabel = new System.Windows.Forms.Label();
this.leftMarginTextBox = new System.Windows.Forms.TextBox();
this.leftMarginLabel = new System.Windows.Forms.Label();
this.bottomMarginTextBox = new System.Windows.Forms.TextBox();
this.bottomMarginLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(142, 40);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(16, 43);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 1;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(139, 16);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// supressPrintingCheckBox
//
this.supressPrintingCheckBox.AutoSize = true;
this.supressPrintingCheckBox.Enabled = false;
this.supressPrintingCheckBox.Location = new System.Drawing.Point(142, 167);
this.supressPrintingCheckBox.Name = "supressPrintingCheckBox";
this.supressPrintingCheckBox.Size = new System.Drawing.Size(101, 17);
this.supressPrintingCheckBox.TabIndex = 11;
this.supressPrintingCheckBox.Text = "Supress printing";
this.supressPrintingCheckBox.UseVisualStyleBackColor = true;
//
// orientationLabel
//
this.orientationLabel.AutoSize = true;
this.orientationLabel.Location = new System.Drawing.Point(16, 67);
this.orientationLabel.Name = "orientationLabel";
this.orientationLabel.Size = new System.Drawing.Size(84, 13);
this.orientationLabel.TabIndex = 3;
this.orientationLabel.Text = "Page orientation";
//
// orientationComboBox
//
this.orientationComboBox.Enabled = false;
this.orientationComboBox.FormattingEnabled = true;
this.orientationComboBox.Location = new System.Drawing.Point(142, 64);
this.orientationComboBox.Name = "orientationComboBox";
this.orientationComboBox.Size = new System.Drawing.Size(130, 21);
this.orientationComboBox.TabIndex = 4;
//
// topMarginTextBox
//
this.topMarginTextBox.Enabled = false;
this.topMarginTextBox.Location = new System.Drawing.Point(142, 89);
this.topMarginTextBox.Name = "topMarginTextBox";
this.topMarginTextBox.Size = new System.Drawing.Size(80, 20);
this.topMarginTextBox.TabIndex = 6;
//
// topMarginLabel
//
this.topMarginLabel.AutoSize = true;
this.topMarginLabel.Location = new System.Drawing.Point(16, 92);
this.topMarginLabel.Name = "topMarginLabel";
this.topMarginLabel.Size = new System.Drawing.Size(109, 13);
this.topMarginLabel.TabIndex = 5;
this.topMarginLabel.Text = "Top margin [0.25 mm]";
//
// leftMarginTextBox
//
this.leftMarginTextBox.Enabled = false;
this.leftMarginTextBox.Location = new System.Drawing.Point(142, 137);
this.leftMarginTextBox.Name = "leftMarginTextBox";
this.leftMarginTextBox.Size = new System.Drawing.Size(80, 20);
this.leftMarginTextBox.TabIndex = 10;
//
// leftMarginLabel
//
this.leftMarginLabel.AutoSize = true;
this.leftMarginLabel.Location = new System.Drawing.Point(16, 140);
this.leftMarginLabel.Name = "leftMarginLabel";
this.leftMarginLabel.Size = new System.Drawing.Size(108, 13);
this.leftMarginLabel.TabIndex = 9;
this.leftMarginLabel.Text = "Left margin [0.25 mm]";
//
// bottomMarginTextBox
//
this.bottomMarginTextBox.Enabled = false;
this.bottomMarginTextBox.Location = new System.Drawing.Point(142, 113);
this.bottomMarginTextBox.Name = "bottomMarginTextBox";
this.bottomMarginTextBox.Size = new System.Drawing.Size(80, 20);
this.bottomMarginTextBox.TabIndex = 8;
//
// bottomMarginLabel
//
this.bottomMarginLabel.AutoSize = true;
this.bottomMarginLabel.Location = new System.Drawing.Point(16, 116);
this.bottomMarginLabel.Name = "bottomMarginLabel";
this.bottomMarginLabel.Size = new System.Drawing.Size(123, 13);
this.bottomMarginLabel.TabIndex = 7;
this.bottomMarginLabel.Text = "Bottom margin [0.25 mm]";
//
// PrinterCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.bottomMarginTextBox);
this.Controls.Add(this.bottomMarginLabel);
this.Controls.Add(this.leftMarginTextBox);
this.Controls.Add(this.leftMarginLabel);
this.Controls.Add(this.topMarginTextBox);
this.Controls.Add(this.topMarginLabel);
this.Controls.Add(this.orientationComboBox);
this.Controls.Add(this.orientationLabel);
this.Controls.Add(this.supressPrintingCheckBox);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "PrinterCfgCtrl";
this.Size = new System.Drawing.Size(300, 200);
this.Load += new System.EventHandler(this.PrinterCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.CheckBox supressPrintingCheckBox;
private System.Windows.Forms.Label orientationLabel;
private System.Windows.Forms.ComboBox orientationComboBox;
private System.Windows.Forms.TextBox topMarginTextBox;
private System.Windows.Forms.Label topMarginLabel;
private System.Windows.Forms.TextBox leftMarginTextBox;
private System.Windows.Forms.Label leftMarginLabel;
private System.Windows.Forms.TextBox bottomMarginTextBox;
private System.Windows.Forms.Label bottomMarginLabel;
}
}
@@ -1,123 +0,0 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using System;
using System.Windows.Forms;
using log4net;
using Config.Entities;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.ResultsPrinters.Basic
{
public partial class PrinterCfgCtrl : UserControl, IComponentCfgCtrl
{
static readonly ILog log = LogManager.GetLogger(typeof(PrinterCfgCtrl));
public bool ShowMore { get { return false; } }
PrinterCfg config;
public IComponentCfg Config
{
get { return config as IComponentCfg; }
set
{
config = value as PrinterCfg;
Redraw();
}
}
public PrinterCfgCtrl()
{
InitializeComponent();
orientationComboBox.Items.Add(PageOrientation.Portrait.ToString());
orientationComboBox.Items.Add(PageOrientation.Landscape.ToString());
}
private void PrinterCfgCtrl_Load(object sender, EventArgs e)
{
Redraw();
}
public void Closing()
{
}
PageOrientation GetOrientation(string str)
{
if (str.Equals(PageOrientation.Landscape.ToString())) return PageOrientation.Landscape;
if (str.Equals(PageOrientation.Portrait.ToString())) return PageOrientation.Portrait;
return (PageOrientation)(-1);
}
void Redraw()
{
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
orientationComboBox.Text = config.PageOrientation.ToString();
topMarginTextBox.Text = config.TopMargin.ToString();
bottomMarginTextBox.Text = config.BottomMargin.ToString();
leftMarginTextBox.Text = config.LeftMargin.ToString();
supressPrintingCheckBox.Checked = config.SupressPrinting;
}
public void Unlock()
{
nameTextBox.Enabled = true;
orientationComboBox.Enabled = true;
topMarginTextBox.Enabled = true;
bottomMarginTextBox.Enabled = true;
leftMarginTextBox.Enabled = true;
supressPrintingCheckBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
if ((int)GetOrientation(orientationComboBox.Text) < 0)
{
message += Environment.NewLine + "Invalid 'Page orientation'";
flags |= CfgUpdateFlags.Error;
}
int dummy;
if (!int.TryParse(topMarginTextBox.Text, out dummy) || dummy < 0 || dummy > 500)
{
message += Environment.NewLine + "'Top margin' should be between 0 and 500";
flags |= CfgUpdateFlags.Error;
}
if (!int.TryParse(bottomMarginTextBox.Text, out dummy) || dummy < 0 || dummy > 200)
{
message += Environment.NewLine + "'Bottom margin' should be between 0 and 200";
flags |= CfgUpdateFlags.Error;
}
if (!int.TryParse(leftMarginTextBox.Text, out dummy) || dummy < 0 || dummy > 200)
{
message += Environment.NewLine + "Left margin' should be between 0 and 200";
flags |= CfgUpdateFlags.Error;
}
return flags;
}
public CfgUpdateFlags UpdateCfg()
{
CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd;
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
config.Name = nameTextBox.Text;
config.PageOrientation = GetOrientation(orientationComboBox.Text);
config.TopMargin = int.Parse(topMarginTextBox.Text);
config.BottomMargin = int.Parse(bottomMarginTextBox.Text);
config.LeftMargin = int.Parse(leftMarginTextBox.Text);
config.SupressPrinting = supressPrintingCheckBox.Checked;
return flags;
}
}
}
@@ -1,26 +0,0 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.ResultsPrinters.Basic
{
public class PrinterFactory : IComponentFactory
{
public string ClassName { get { return "BasicResultsPrinter"; } }
public void ResetStaticProperties() { Printer.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Printer(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Printer(cfg); }
public IComponentCfg DefaultConfig() { return new PrinterCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(PrinterCfg), component, this);
}
}
}
@@ -1096,9 +1096,7 @@ namespace TBF.BenchControl.Sequences
Bridge.OnActivity(this, Strings.Please_select_a_cycle_a_test_or_empty);
}
bool saveResultsActive = (context == MKSelContext.InsideProcedure)
&& (StateMachine.Procedure != null)
&& (!StateMachine.Procedure.MustBeComplete || BatchRslts.AllTestsDone());
bool saveResultsActive = (context == MKSelContext.InsideProcedure) && (StateMachine.Procedure != null);
/// Enable appropriate UI controls and buttons
Bridge.Bench2UI(((context == MKSelContext.ProcedureNotSelected) ? ButtonsEtc.ProcedureCmbBoxEn : 0) |
@@ -31,6 +31,9 @@ namespace TBF.BenchControl.Sequences
public static DateTime TestStartTime;
public static DateTime TestEndTime;
public static double StartTime;
public static double EndTime;
/// Heat meters only
public static DoubleBox TempRefHi1 = new DoubleBox() { Name = "T hi ac 1", Format = "F3" }; /// [°C]
public static DoubleBox TempRefHi2 = new DoubleBox() { Name = "T hi ac 2", Format = "F3" }; /// [°C]
@@ -90,8 +93,13 @@ namespace TBF.BenchControl.Sequences
public static Statistics VolumeForEnergy = new Statistics();
public static int lastEnergyUpdateTime;
protected static void ClearAllStatistics()
public static int machineTimeStart;
public static int lastMachineTime;
protected static void ClearAllStatistics(int machineTime)
{
lastMachineTime = machineTimeStart = machineTime;
AmbTempStat.Clear();
AmbPressStat.Clear();
AmbHumiStat.Clear();
@@ -110,8 +118,10 @@ namespace TBF.BenchControl.Sequences
lastEnergyUpdateTime = 0;
}
protected static void UpdateAllStatistics()
protected static void UpdateAllStatistics(int machineTime)
{
int timeDelta = machineTime - lastMachineTime;
AmbTempStat.Update(AmbTemp);
AmbPressStat.Update(AmbPress);
AmbHumiStat.Update(AmbHumi);
@@ -121,13 +131,19 @@ namespace TBF.BenchControl.Sequences
PressUpStat.Update(PressUp);
PressDownStat.Update(PressDown);
PressDeltaStat.Update(PressDelta);
RefFlowStat.Update(RefFlow);
if (machineTime - machineTimeStart <= 5) /// Wait until flow is steady
{
RefFlowStat.Update(RefFlow);
}
if (BatchRslts.Batch.HeatMeter)
{
TempRefHiStat.Update((TempRefHi1.Val + TempRefHi2.Val) / 2);
TempRefLoStat.Update((TempRefLo1.Val + TempRefLo2.Val) / 2);
}
lastMachineTime = machineTime;
}
}
}
@@ -73,12 +73,22 @@ namespace TBF.BenchControl.Sequences
///
/// Process data logging
///
public void LogProcessHeader(ILog logger)
public void LogProcessDataTestInfo(ILog logger, string procedureName, string testName)
{
LogProcessHeader(logger, null);
logger.Info(Environment.NewLine);
logger.InfoFormat("{0}={1:dd.MM.yyyy HH:mm:ss} {2}={3} {4}={5} {6}={7}",
Strings.Date_and_time, TestStartTime,
Strings.Batch_nr, BatchRslts.Batch.BatchNr,
Strings.Procedure, procedureName,
Strings.Test, testName);
}
public void LogProcessHeader(ILog logger, string sectionName)
public void LogProcessDataHeader(ILog logger)
{
LogProcessDataHeader(logger, null);
}
public void LogProcessDataHeader(ILog logger, string sectionName)
{
logger.Info(Environment.NewLine);
if (sectionName != null) logger.Info(sectionName);
@@ -108,7 +118,7 @@ namespace TBF.BenchControl.Sequences
outPath.RegulValve.Position.ToString("F1"));
}
public void LogProcessHeaderHeatMeters(ILog logger, string sectionName)
public void LogProcessDataHeaderHeatMeters(ILog logger, string sectionName)
{
logger.Info(Environment.NewLine);
if (sectionName != null) logger.Info(sectionName);
@@ -742,6 +752,64 @@ namespace TBF.BenchControl.Sequences
return Event.Done;
}
/// <summary>
/// Update temperature, pressure, water density and ambient values
/// including their statistics in the test results structure.
/// </summary>
/// <param name="tstRslt">Test results</param>
protected void UpdateTempPressDensAmb(Results.Entities.TestRslt tstRslt)
{
tstRslt.AmbTempMean = (float)AmbTempStat.Average;
tstRslt.AmbTempStart = (float)AmbTempStat.First;
tstRslt.AmbTempEnd = (float)AmbTempStat.Last;
tstRslt.AmbTempMin = (float)AmbTempStat.Min;
tstRslt.AmbTempMax = (float)AmbTempStat.Max;
tstRslt.AmbPressMean = (float)AmbPressStat.Average;
tstRslt.AmbPressStart = (float)AmbPressStat.First;
tstRslt.AmbPressEnd = (float)AmbPressStat.Last;
tstRslt.AmbPressMin = (float)AmbPressStat.Min;
tstRslt.AmbPressMax = (float)AmbPressStat.Max;
tstRslt.AmbHumiMean = (float)AmbHumiStat.Average;
tstRslt.AmbHumiStart = (float)AmbHumiStat.First;
tstRslt.AmbHumiEnd = (float)AmbHumiStat.Last;
tstRslt.AmbHumiMin = (float)AmbHumiStat.Min;
tstRslt.AmbHumiMax = (float)AmbHumiStat.Max;
tstRslt.PressUpMean = (float)PressUpStat.Average;
tstRslt.PressUpStart = (float)PressUpStat.First;
tstRslt.PressUpEnd = (float)PressUpStat.Last;
tstRslt.PressUpMin = (float)PressUpStat.Min;
tstRslt.PressUpMax = (float)PressUpStat.Max;
tstRslt.PressDownMean = (float)PressDownStat.Average;
tstRslt.PressDownStart = (float)PressDownStat.First;
tstRslt.PressDownEnd = (float)PressDownStat.Last;
tstRslt.PressDownMin = (float)PressDownStat.Min;
tstRslt.PressDownMax = (float)PressDownStat.Max;
tstRslt.PressDeltaMean = (float)PressDeltaStat.Average;
tstRslt.PressDeltaStart = (float)PressDeltaStat.First;
tstRslt.PressDeltaEnd = (float)PressDeltaStat.Last;
tstRslt.PressDeltaMin = (float)PressDeltaStat.Min;
tstRslt.PressDeltaMax = (float)PressDeltaStat.Max;
tstRslt.TempUpMean = (float)TempUpStat.Average;
tstRslt.TempUpStart = (float)TempUpStat.First;
tstRslt.TempUpEnd = (float)TempUpStat.Last;
tstRslt.TempUpMin = (float)TempUpStat.Min;
tstRslt.TempUpMax = (float)TempUpStat.Max;
tstRslt.TempDownMean = (float)TempDownStat.Average;
tstRslt.TempDownStart = (float)TempDownStat.First;
tstRslt.TempDownEnd = (float)TempDownStat.Last;
tstRslt.TempDownMin = (float)TempDownStat.Min;
tstRslt.TempDownMax = (float)TempDownStat.Max;
tstRslt.TempDivMean = (float)TempDivStat.Average;
tstRslt.TempDivStart = (float)TempDivStat.First;
tstRslt.TempDivEnd = (float)TempDivStat.Last;
tstRslt.TempDivMin = (float)TempDivStat.Min;
tstRslt.TempDivMax = (float)TempDivStat.Max;
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempUpMean); /// [kg/m3]
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempDownMean); /// [kg/m3]
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivMean); /// [kg/m3]
}
protected string TestResult2CsvLine(string testName, int part)
{
@@ -1048,7 +1116,7 @@ namespace TBF.BenchControl.Sequences
tstRslt.TempDownMax = 20.0f;
tstRslt.TempDivMax = 20.0f;
tstRslt.FlowMin = 0; /// TODO
tstRslt.FlowMean = 0; /// TODO
tstRslt.FlowMax = 0; /// TODO
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
@@ -1152,7 +1220,7 @@ namespace TBF.BenchControl.Sequences
tstRslt.TempDownMax = 20.0f;
tstRslt.TempDivMax = 20.0f;
tstRslt.FlowMin = 0; /// TODO
tstRslt.FlowMean = 0; /// TODO
tstRslt.FlowMax = 0; /// TODO
@@ -1276,7 +1344,7 @@ namespace TBF.BenchControl.Sequences
tstRslt.TempDownMax = 20.0f;
tstRslt.TempDivMax = 20.0f;
tstRslt.FlowMin = 0; /// TODO
tstRslt.FlowMean = 0; /// TODO
tstRslt.FlowMax = 0; /// TODO
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
@@ -15,7 +15,6 @@ namespace TBF.BenchControl
{
Factories = new List<IComponentFactory>();
Factories.Add(new ResultsPrinters.Basic.PrinterFactory());
Factories.Add(new BenchInfo.Munich.ComponentFactory());
Factories.Add(new BenchInfo.Polska.ComponentFactory());
Factories.Add(new Elde.ControlBoardFactory());
@@ -249,7 +249,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
queryEnd1 = cBrd.QueryMeasurementEndOp();
queryEnd2 = cBrd.QueryMeasurementEndOp();
ClearAllStatistics();
ClearAllStatistics(StateMachine.Time);
/// Measurement loop - begin
while (true)
@@ -264,7 +264,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
UpdateAllStatistics();
UpdateAllStatistics(StateMachine.Time);
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
@@ -289,55 +289,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
if (tstRslt != null)
{
/// Auxiliary results
tstRslt.AmbTempMean = (float)AmbTempStat.Average;
tstRslt.AmbTempStart = (float)AmbTempStat.First;
tstRslt.AmbTempEnd = (float)AmbTempStat.Last;
tstRslt.AmbTempMin = (float)AmbTempStat.Min;
tstRslt.AmbTempMax = (float)AmbTempStat.Max;
tstRslt.AmbPressMean = (float)AmbPressStat.Average;
tstRslt.AmbPressStart = (float)AmbPressStat.First;
tstRslt.AmbPressEnd = (float)AmbPressStat.Last;
tstRslt.AmbPressMin = (float)AmbPressStat.Min;
tstRslt.AmbPressMax = (float)AmbPressStat.Max;
tstRslt.AmbHumiMean = (float)AmbHumiStat.Average;
tstRslt.AmbHumiStart = (float)AmbHumiStat.First;
tstRslt.AmbHumiEnd = (float)AmbHumiStat.Last;
tstRslt.AmbHumiMin = (float)AmbHumiStat.Min;
tstRslt.AmbHumiMax = (float)AmbHumiStat.Max;
tstRslt.PressUpMean = (float)PressUpStat.Average;
tstRslt.PressUpStart = (float)PressUpStat.First;
tstRslt.PressUpEnd = (float)PressUpStat.Last;
tstRslt.PressUpMin = (float)PressUpStat.Min;
tstRslt.PressUpMax = (float)PressUpStat.Max;
tstRslt.PressDownMean = (float)PressDownStat.Average;
tstRslt.PressDownStart = (float)PressDownStat.First;
tstRslt.PressDownEnd = (float)PressDownStat.Last;
tstRslt.PressDownMin = (float)PressDownStat.Min;
tstRslt.PressDownMax = (float)PressDownStat.Max;
tstRslt.PressDeltaMean = (float)PressDeltaStat.Average;
tstRslt.PressDeltaStart = (float)PressDeltaStat.First;
tstRslt.PressDeltaEnd = (float)PressDeltaStat.Last;
tstRslt.PressDeltaMin = (float)PressDeltaStat.Min;
tstRslt.PressDeltaMax = (float)PressDeltaStat.Max;
tstRslt.TempUpMean = (float)TempUpStat.Average;
tstRslt.TempUpStart = (float)TempUpStat.First;
tstRslt.TempUpEnd = (float)TempUpStat.Last;
tstRslt.TempUpMin = (float)TempUpStat.Min;
tstRslt.TempUpMax = (float)TempUpStat.Max;
tstRslt.TempDownMean = (float)TempDownStat.Average;
tstRslt.TempDownStart = (float)TempDownStat.First;
tstRslt.TempDownEnd = (float)TempDownStat.Last;
tstRslt.TempDownMin = (float)TempDownStat.Min;
tstRslt.TempDownMax = (float)TempDownStat.Max;
tstRslt.TempDivMean = (float)TempDivStat.Average;
tstRslt.TempDivStart = (float)TempDivStat.First;
tstRslt.TempDivEnd = (float)TempDivStat.Last;
tstRslt.TempDivMin = (float)TempDivStat.Min;
tstRslt.TempDivMax = (float)TempDivStat.Max;
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempUpMean); /// [kg/m3]
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempDownMean); /// [kg/m3]
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivMean); /// [kg/m3]
UpdateTempPressDensAmb(tstRslt);
/// Main results
tstRslt.StartTime = TestStartTime;
@@ -354,8 +306,9 @@ namespace TBF.BenchControl.TestMethods.Adjustment
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0.0f; /// Cannot be determined without the collected water mass measurement
tstRslt.FlowMin = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Min * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Min);
tstRslt.FlowMax = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Max * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Max);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
@@ -502,7 +502,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
queryEnd1 = cBrd.QueryMeasurementEndOp();
queryEnd2 = cBrd.QueryMeasurementEndOp();
ClearAllStatistics();
ClearAllStatistics(StateMachine.Time);
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
/// Measurement loop - begin
@@ -526,7 +526,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime));
}
UpdateAllStatistics();
UpdateAllStatistics(StateMachine.Time);
/// TODO: Reimplement
//for (int i = 0; i < Config.Data.CompoundWMsCount; i++)
@@ -603,55 +603,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
if (tstRslt != null)
{
/// Auxiliary results
tstRslt.AmbTempMean = (float)AmbTempStat.Average;
tstRslt.AmbTempStart = (float)AmbTempStat.First;
tstRslt.AmbTempEnd = (float)AmbTempStat.Last;
tstRslt.AmbTempMin = (float)AmbTempStat.Min;
tstRslt.AmbTempMax = (float)AmbTempStat.Max;
tstRslt.AmbPressMean = (float)AmbPressStat.Average;
tstRslt.AmbPressStart = (float)AmbPressStat.First;
tstRslt.AmbPressEnd = (float)AmbPressStat.Last;
tstRslt.AmbPressMin = (float)AmbPressStat.Min;
tstRslt.AmbPressMax = (float)AmbPressStat.Max;
tstRslt.AmbHumiMean = (float)AmbHumiStat.Average;
tstRslt.AmbHumiStart = (float)AmbHumiStat.First;
tstRslt.AmbHumiEnd = (float)AmbHumiStat.Last;
tstRslt.AmbHumiMin = (float)AmbHumiStat.Min;
tstRslt.AmbHumiMax = (float)AmbHumiStat.Max;
tstRslt.PressUpMean = (float)PressUpStat.Average;
tstRslt.PressUpStart = (float)PressUpStat.First;
tstRslt.PressUpEnd = (float)PressUpStat.Last;
tstRslt.PressUpMin = (float)PressUpStat.Min;
tstRslt.PressUpMax = (float)PressUpStat.Max;
tstRslt.PressDownMean = (float)PressDownStat.Average;
tstRslt.PressDownStart = (float)PressDownStat.First;
tstRslt.PressDownEnd = (float)PressDownStat.Last;
tstRslt.PressDownMin = (float)PressDownStat.Min;
tstRslt.PressDownMax = (float)PressDownStat.Max;
tstRslt.PressDeltaMean = (float)PressDeltaStat.Average;
tstRslt.PressDeltaStart = (float)PressDeltaStat.First;
tstRslt.PressDeltaEnd = (float)PressDeltaStat.Last;
tstRslt.PressDeltaMin = (float)PressDeltaStat.Min;
tstRslt.PressDeltaMax = (float)PressDeltaStat.Max;
tstRslt.TempUpMean = (float)TempUpStat.Average;
tstRslt.TempUpStart = (float)TempUpStat.First;
tstRslt.TempUpEnd = (float)TempUpStat.Last;
tstRslt.TempUpMin = (float)TempUpStat.Min;
tstRslt.TempUpMax = (float)TempUpStat.Max;
tstRslt.TempDownMean = (float)TempDownStat.Average;
tstRslt.TempDownStart = (float)TempDownStat.First;
tstRslt.TempDownEnd = (float)TempDownStat.Last;
tstRslt.TempDownMin = (float)TempDownStat.Min;
tstRslt.TempDownMax = (float)TempDownStat.Max;
tstRslt.TempDivMean = (float)TempDivStat.Average;
tstRslt.TempDivStart = (float)TempDivStat.First;
tstRslt.TempDivEnd = (float)TempDivStat.Last;
tstRslt.TempDivMin = (float)TempDivStat.Min;
tstRslt.TempDivMax = (float)TempDivStat.Max;
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempUpMean); /// [kg/m3]
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempDownMean); /// [kg/m3]
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivMean); /// [kg/m3]
UpdateTempPressDensAmb(tstRslt);
/// Main results
tstRslt.StartTime = TestStartTime;
@@ -670,8 +622,9 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMin = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Min * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Min);
tstRslt.FlowMax = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Max * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Max);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
@@ -259,5 +259,14 @@ namespace TBF.BenchControl.TestMethods.Endurance
parent.UpdateButtonStates(TBF.UiControls.SharedButtons.SelectedItemPos.None);
}
}
}
public string GetWarningsBeforeSaving(ref Dictionary<string, string> renmInfo)
{
return string.Empty;
}
public void UpdateRelatedItems(Dictionary<string, string> renameInfo)
{
}
}
}
@@ -228,7 +228,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
queryEnd1 = cBrd.QueryMeasurementEndOp();
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
ClearAllStatistics();
ClearAllStatistics(StateMachine.Time);
/// Measurement loop - begin
State.Create(string.Format("{0}({1}) : Reading watermeters", test.Method, test.Name))
@@ -274,7 +274,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
UpdateAllStatistics();
UpdateAllStatistics(StateMachine.Time);
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
@@ -304,55 +304,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
if (tstRslt != null)
{
/// Auxiliary results
tstRslt.AmbTempMean = (float)AmbTempStat.Average;
tstRslt.AmbTempStart = (float)AmbTempStat.First;
tstRslt.AmbTempEnd = (float)AmbTempStat.Last;
tstRslt.AmbTempMin = (float)AmbTempStat.Min;
tstRslt.AmbTempMax = (float)AmbTempStat.Max;
tstRslt.AmbPressMean = (float)AmbPressStat.Average;
tstRslt.AmbPressStart = (float)AmbPressStat.First;
tstRslt.AmbPressEnd = (float)AmbPressStat.Last;
tstRslt.AmbPressMin = (float)AmbPressStat.Min;
tstRslt.AmbPressMax = (float)AmbPressStat.Max;
tstRslt.AmbHumiMean = (float)AmbHumiStat.Average;
tstRslt.AmbHumiStart = (float)AmbHumiStat.First;
tstRslt.AmbHumiEnd = (float)AmbHumiStat.Last;
tstRslt.AmbHumiMin = (float)AmbHumiStat.Min;
tstRslt.AmbHumiMax = (float)AmbHumiStat.Max;
tstRslt.PressUpMean = (float)PressUpStat.Average;
tstRslt.PressUpStart = (float)PressUpStat.First;
tstRslt.PressUpEnd = (float)PressUpStat.Last;
tstRslt.PressUpMin = (float)PressUpStat.Min;
tstRslt.PressUpMax = (float)PressUpStat.Max;
tstRslt.PressDownMean = (float)PressDownStat.Average;
tstRslt.PressDownStart = (float)PressDownStat.First;
tstRslt.PressDownEnd = (float)PressDownStat.Last;
tstRslt.PressDownMin = (float)PressDownStat.Min;
tstRslt.PressDownMax = (float)PressDownStat.Max;
tstRslt.PressDeltaMean = (float)PressDeltaStat.Average;
tstRslt.PressDeltaStart = (float)PressDeltaStat.First;
tstRslt.PressDeltaEnd = (float)PressDeltaStat.Last;
tstRslt.PressDeltaMin = (float)PressDeltaStat.Min;
tstRslt.PressDeltaMax = (float)PressDeltaStat.Max;
tstRslt.TempUpMean = (float)TempUpStat.Average;
tstRslt.TempUpStart = (float)TempUpStat.First;
tstRslt.TempUpEnd = (float)TempUpStat.Last;
tstRslt.TempUpMin = (float)TempUpStat.Min;
tstRslt.TempUpMax = (float)TempUpStat.Max;
tstRslt.TempDownMean = (float)TempDownStat.Average;
tstRslt.TempDownStart = (float)TempDownStat.First;
tstRslt.TempDownEnd = (float)TempDownStat.Last;
tstRslt.TempDownMin = (float)TempDownStat.Min;
tstRslt.TempDownMax = (float)TempDownStat.Max;
tstRslt.TempDivMean = (float)TempDivStat.Average;
tstRslt.TempDivStart = (float)TempDivStat.First;
tstRslt.TempDivEnd = (float)TempDivStat.Last;
tstRslt.TempDivMin = (float)TempDivStat.Min;
tstRslt.TempDivMax = (float)TempDivStat.Max;
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempUpMean); /// [kg/m3]
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempDownMean); /// [kg/m3]
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivMean); /// [kg/m3]
UpdateTempPressDensAmb(tstRslt);
/// Main results
tstRslt.StartTime = TestStartTime;
@@ -371,8 +323,9 @@ namespace TBF.BenchControl.TestMethods.Endurance
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0.0; /// Cannot be determined without a mass measurement
tstRslt.FlowMin = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Min * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Min);
tstRslt.FlowMax = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Max * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Max);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
///
/// Single meters
@@ -464,7 +417,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
while (!e.Contains(Event.PreviousStopped));
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
ClearAllStatistics();
ClearAllStatistics(StateMachine.Time);
///
@@ -514,7 +467,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
UpdateAllStatistics();
UpdateAllStatistics(StateMachine.Time);
}
while (!e.Contains(Event.CommandCompleted));
@@ -560,7 +513,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
UpdateAllStatistics();
UpdateAllStatistics(StateMachine.Time);
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
@@ -596,7 +549,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
UpdateAllStatistics();
UpdateAllStatistics(StateMachine.Time);
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
@@ -335,7 +335,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
queryEnd1 = cBrd.QueryMeasurementEndOp();
queryEnd2 = cBrd.QueryMeasurementEndOp();
ClearAllStatistics();
ClearAllStatistics(StateMachine.Time);
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
/// Measurement loop - begin
@@ -368,7 +368,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
UpdateAllStatistics();
UpdateAllStatistics(StateMachine.Time);
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
@@ -503,55 +503,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
if (tstRslt != null)
{
/// Auxiliary results
tstRslt.AmbTempMean = (float)AmbTempStat.Average;
tstRslt.AmbTempStart = (float)AmbTempStat.First;
tstRslt.AmbTempEnd = (float)AmbTempStat.Last;
tstRslt.AmbTempMin = (float)AmbTempStat.Min;
tstRslt.AmbTempMax = (float)AmbTempStat.Max;
tstRslt.AmbPressMean = (float)AmbPressStat.Average;
tstRslt.AmbPressStart = (float)AmbPressStat.First;
tstRslt.AmbPressEnd = (float)AmbPressStat.Last;
tstRslt.AmbPressMin = (float)AmbPressStat.Min;
tstRslt.AmbPressMax = (float)AmbPressStat.Max;
tstRslt.AmbHumiMean = (float)AmbHumiStat.Average;
tstRslt.AmbHumiStart = (float)AmbHumiStat.First;
tstRslt.AmbHumiEnd = (float)AmbHumiStat.Last;
tstRslt.AmbHumiMin = (float)AmbHumiStat.Min;
tstRslt.AmbHumiMax = (float)AmbHumiStat.Max;
tstRslt.PressUpMean = (float)PressUpStat.Average;
tstRslt.PressUpStart = (float)PressUpStat.First;
tstRslt.PressUpEnd = (float)PressUpStat.Last;
tstRslt.PressUpMin = (float)PressUpStat.Min;
tstRslt.PressUpMax = (float)PressUpStat.Max;
tstRslt.PressDownMean = (float)PressDownStat.Average;
tstRslt.PressDownStart = (float)PressDownStat.First;
tstRslt.PressDownEnd = (float)PressDownStat.Last;
tstRslt.PressDownMin = (float)PressDownStat.Min;
tstRslt.PressDownMax = (float)PressDownStat.Max;
tstRslt.PressDeltaMean = (float)PressDeltaStat.Average;
tstRslt.PressDeltaStart = (float)PressDeltaStat.First;
tstRslt.PressDeltaEnd = (float)PressDeltaStat.Last;
tstRslt.PressDeltaMin = (float)PressDeltaStat.Min;
tstRslt.PressDeltaMax = (float)PressDeltaStat.Max;
tstRslt.TempUpMean = (float)TempUpStat.Average;
tstRslt.TempUpStart = (float)TempUpStat.First;
tstRslt.TempUpEnd = (float)TempUpStat.Last;
tstRslt.TempUpMin = (float)TempUpStat.Min;
tstRslt.TempUpMax = (float)TempUpStat.Max;
tstRslt.TempDownMean = (float)TempDownStat.Average;
tstRslt.TempDownStart = (float)TempDownStat.First;
tstRslt.TempDownEnd = (float)TempDownStat.Last;
tstRslt.TempDownMin = (float)TempDownStat.Min;
tstRslt.TempDownMax = (float)TempDownStat.Max;
tstRslt.TempDivMean = (float)TempDivStat.Average;
tstRslt.TempDivStart = (float)TempDivStat.First;
tstRslt.TempDivEnd = (float)TempDivStat.Last;
tstRslt.TempDivMin = (float)TempDivStat.Min;
tstRslt.TempDivMax = (float)TempDivStat.Max;
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempUpMean); /// [kg/m3]
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempDownMean); /// [kg/m3]
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivMean); /// [kg/m3]
UpdateTempPressDensAmb(tstRslt);
/// Main results
tstRslt.StartTime = TestStartTime;
@@ -570,8 +522,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMin = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Min * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Min);
tstRslt.FlowMax = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Max * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Max);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
@@ -72,7 +72,6 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
/// Start the test, initialize test results
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
TestStartTime = DateTime.Now;
TestProgressEventArgs.SetEstimatedTimes(new int[] { 1, 1, 1, 30, 0, Convert.ToInt32(test.TstTime) + 15, 0, 0 });
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.JustStarted));
@@ -401,6 +400,13 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
//------------------------------------------------
Bridge.OnActivity(this, Strings.Measuring_the_weight);
//------------------------------------------------
TestStartTime = DateTime.Now;
LogProcessDataTestInfo(processDataLogger, test.Procedure.Name, test.Name);
if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "Start mass");
else LogProcessDataHeaderHeatMeters(processDataLogger, "Start mass");
State.Create(string.Format("{0}({1}) : Measuring the start mass", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(measureOperations)
@@ -430,6 +436,10 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
Mass.Val = StartMass.Val;
if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "Measurement");
else LogProcessDataHeaderHeatMeters(processDataLogger, "Measurement");
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress);
//------------------------------------------------
@@ -457,6 +467,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
}
while (!e.Contains(Event.MeasurementStarted));
StartTime = (double)StateMachine.Time;
State.Create(string.Format("{0}({1}) : Opening the start/stop valve at the beginning of the fixed start test", test.Method, test.Name))
.AddOperation(checkUiOp)
@@ -486,7 +497,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
queryEnd1 = cBrd.QueryMeasurementEndOp();
queryEnd2 = cBrd.QueryMeasurementEndOp();
ClearAllStatistics();
ClearAllStatistics(StateMachine.Time);
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
/// Measurement loop - begin
@@ -520,7 +531,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
UpdateAllStatistics();
UpdateAllStatistics(StateMachine.Time);
if (heatMetersTestParams != null)
{
@@ -564,6 +575,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
test_completed:
EndTime = (double)StateMachine.Time;
State.Create(string.Format("{0}({1}) : Closing the start/stop valve at the end of the fixed start test", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(benchPath.TempMtrUp == null ? null : benchPath.TempMtrUp.ReadTempOp(ref TempUp))
@@ -615,6 +628,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
while (!e.Contains(Event.TimerExpired));
if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "End mass");
else LogProcessDataHeaderHeatMeters(processDataLogger, "End mass");
//------------------------------------------------
Bridge.OnActivity(this, Strings.Measuring_the_weight);
//------------------------------------------------
@@ -737,75 +753,30 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
if (tstRslt != null)
{
/// Auxiliary results
tstRslt.AmbTempMean = (float)AmbTempStat.Average;
tstRslt.AmbTempStart = (float)AmbTempStat.First;
tstRslt.AmbTempEnd = (float)AmbTempStat.Last;
tstRslt.AmbTempMin = (float)AmbTempStat.Min;
tstRslt.AmbTempMax = (float)AmbTempStat.Max;
tstRslt.AmbPressMean = (float)AmbPressStat.Average;
tstRslt.AmbPressStart = (float)AmbPressStat.First;
tstRslt.AmbPressEnd = (float)AmbPressStat.Last;
tstRslt.AmbPressMin = (float)AmbPressStat.Min;
tstRslt.AmbPressMax = (float)AmbPressStat.Max;
tstRslt.AmbHumiMean = (float)AmbHumiStat.Average;
tstRslt.AmbHumiStart = (float)AmbHumiStat.First;
tstRslt.AmbHumiEnd = (float)AmbHumiStat.Last;
tstRslt.AmbHumiMin = (float)AmbHumiStat.Min;
tstRslt.AmbHumiMax = (float)AmbHumiStat.Max;
tstRslt.PressUpMean = (float)PressUpStat.Average;
tstRslt.PressUpStart = (float)PressUpStat.First;
tstRslt.PressUpEnd = (float)PressUpStat.Last;
tstRslt.PressUpMin = (float)PressUpStat.Min;
tstRslt.PressUpMax = (float)PressUpStat.Max;
tstRslt.PressDownMean = (float)PressDownStat.Average;
tstRslt.PressDownStart = (float)PressDownStat.First;
tstRslt.PressDownEnd = (float)PressDownStat.Last;
tstRslt.PressDownMin = (float)PressDownStat.Min;
tstRslt.PressDownMax = (float)PressDownStat.Max;
tstRslt.PressDeltaMean = (float)PressDeltaStat.Average;
tstRslt.PressDeltaStart = (float)PressDeltaStat.First;
tstRslt.PressDeltaEnd = (float)PressDeltaStat.Last;
tstRslt.PressDeltaMin = (float)PressDeltaStat.Min;
tstRslt.PressDeltaMax = (float)PressDeltaStat.Max;
tstRslt.TempUpMean = (float)TempUpStat.Average;
tstRslt.TempUpStart = (float)TempUpStat.First;
tstRslt.TempUpEnd = (float)TempUpStat.Last;
tstRslt.TempUpMin = (float)TempUpStat.Min;
tstRslt.TempUpMax = (float)TempUpStat.Max;
tstRslt.TempDownMean = (float)TempDownStat.Average;
tstRslt.TempDownStart = (float)TempDownStat.First;
tstRslt.TempDownEnd = (float)TempDownStat.Last;
tstRslt.TempDownMin = (float)TempDownStat.Min;
tstRslt.TempDownMax = (float)TempDownStat.Max;
tstRslt.TempDivMean = (float)TempDivStat.Average;
tstRslt.TempDivStart = (float)TempDivStat.First;
tstRslt.TempDivEnd = (float)TempDivStat.Last;
tstRslt.TempDivMin = (float)TempDivStat.Min;
tstRslt.TempDivMax = (float)TempDivStat.Max;
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempUpMean); /// [kg/m3]
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempDownMean); /// [kg/m3]
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivMean); /// [kg/m3]
UpdateTempPressDensAmb(tstRslt);
/// Main results
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
tstRslt.TestTime = Math.Max(1.0, EndTime - StartTime); /// [s] measurement time, at least 1 to prevent division by zero
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassStart = massStart;
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = massEnd;
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMin = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Min * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Min);
tstRslt.FlowMax = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Max * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Max);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
if (compound)
{
@@ -321,7 +321,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
queryEnd1 = cBrd.QueryMeasurementEndOp();
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
ClearAllStatistics();
ClearAllStatistics(StateMachine.Time);
/// Measurement loop - begin
State.Create("Read water meters")
@@ -366,7 +366,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
UpdateAllStatistics();
UpdateAllStatistics(StateMachine.Time);
if (heatMetersTestParams != null)
{
@@ -414,55 +414,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
if (tstRslt != null)
{
/// Auxiliary results
tstRslt.AmbTempMean = (float)AmbTempStat.Average;
tstRslt.AmbTempStart = (float)AmbTempStat.First;
tstRslt.AmbTempEnd = (float)AmbTempStat.Last;
tstRslt.AmbTempMin = (float)AmbTempStat.Min;
tstRslt.AmbTempMax = (float)AmbTempStat.Max;
tstRslt.AmbPressMean = (float)AmbPressStat.Average;
tstRslt.AmbPressStart = (float)AmbPressStat.First;
tstRslt.AmbPressEnd = (float)AmbPressStat.Last;
tstRslt.AmbPressMin = (float)AmbPressStat.Min;
tstRslt.AmbPressMax = (float)AmbPressStat.Max;
tstRslt.AmbHumiMean = (float)AmbHumiStat.Average;
tstRslt.AmbHumiStart = (float)AmbHumiStat.First;
tstRslt.AmbHumiEnd = (float)AmbHumiStat.Last;
tstRslt.AmbHumiMin = (float)AmbHumiStat.Min;
tstRslt.AmbHumiMax = (float)AmbHumiStat.Max;
tstRslt.PressUpMean = (float)PressUpStat.Average;
tstRslt.PressUpStart = (float)PressUpStat.First;
tstRslt.PressUpEnd = (float)PressUpStat.Last;
tstRslt.PressUpMin = (float)PressUpStat.Min;
tstRslt.PressUpMax = (float)PressUpStat.Max;
tstRslt.PressDownMean = (float)PressDownStat.Average;
tstRslt.PressDownStart = (float)PressDownStat.First;
tstRslt.PressDownEnd = (float)PressDownStat.Last;
tstRslt.PressDownMin = (float)PressDownStat.Min;
tstRslt.PressDownMax = (float)PressDownStat.Max;
tstRslt.PressDeltaMean = (float)PressDeltaStat.Average;
tstRslt.PressDeltaStart = (float)PressDeltaStat.First;
tstRslt.PressDeltaEnd = (float)PressDeltaStat.Last;
tstRslt.PressDeltaMin = (float)PressDeltaStat.Min;
tstRslt.PressDeltaMax = (float)PressDeltaStat.Max;
tstRslt.TempUpMean = (float)TempUpStat.Average;
tstRslt.TempUpStart = (float)TempUpStat.First;
tstRslt.TempUpEnd = (float)TempUpStat.Last;
tstRslt.TempUpMin = (float)TempUpStat.Min;
tstRslt.TempUpMax = (float)TempUpStat.Max;
tstRslt.TempDownMean = (float)TempDownStat.Average;
tstRslt.TempDownStart = (float)TempDownStat.First;
tstRslt.TempDownEnd = (float)TempDownStat.Last;
tstRslt.TempDownMin = (float)TempDownStat.Min;
tstRslt.TempDownMax = (float)TempDownStat.Max;
tstRslt.TempDivMean = (float)TempDivStat.Average;
tstRslt.TempDivStart = (float)TempDivStat.First;
tstRslt.TempDivEnd = (float)TempDivStat.Last;
tstRslt.TempDivMin = (float)TempDivStat.Min;
tstRslt.TempDivMax = (float)TempDivStat.Max;
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempUpMean); /// [kg/m3]
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempDownMean); /// [kg/m3]
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivMean); /// [kg/m3]
UpdateTempPressDensAmb(tstRslt);
/// Main results
tstRslt.StartTime = TestStartTime;
@@ -481,8 +433,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0.0; /// Cannot be determined without a mass measurement
tstRslt.FlowMin = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Min * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Min);
tstRslt.FlowMax = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Max * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Max);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
if (compoundTestParams != null)
{
@@ -458,10 +458,10 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
Bridge.OnActivity(this, Strings.Measuring_the_weight);
//------------------------------------------------
if (heatMetersPath == null)
LogProcessHeader(processDataLogger, "Start mass");
else
LogProcessHeaderHeatMeters(processDataLogger, "Start mass");
LogProcessDataTestInfo(processDataLogger, test.Procedure.Name, test.Name);
if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "Start mass");
else LogProcessDataHeaderHeatMeters(processDataLogger, "Start mass");
State.Create(string.Format("{0}({1}) : Measuring the start mass", test.Method, test.Name))
.AddOperation(checkUiOp)
@@ -490,14 +490,13 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
}
while (!e.Contains(Event.BalanceDone));
if (heatMetersPath == null)
LogProcessHeader(processDataLogger, "Measurement");
else
LogProcessHeaderHeatMeters(processDataLogger, "Measurement");
log.WarnFormat("Start mass = {0}kg", StartMass);
Mass.Val = StartMass.Val;
if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "Measurement");
else LogProcessDataHeaderHeatMeters(processDataLogger, "Measurement");
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress);
//------------------------------------------------
@@ -540,7 +539,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
readRegistersOp = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders);
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
ClearAllStatistics();
ClearAllStatistics(StateMachine.Time);
/// Measurement loop - begin
State.Create(string.Format("{0}({1}) : Reading watermeters", test.Method, test.Name))
@@ -587,7 +586,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
UpdateAllStatistics();
UpdateAllStatistics(StateMachine.Time);
if (heatMetersTestParams != null)
{
@@ -661,10 +660,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
}
while (!e.Contains(Event.TimerExpired) || !e.Contains(Event.BalanceDone));
if (heatMetersPath == null)
LogProcessHeader(processDataLogger, "End mass");
else
LogProcessHeaderHeatMeters(processDataLogger, "End mass");
if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "End mass");
else LogProcessDataHeaderHeatMeters(processDataLogger, "End mass");
State.Create(string.Format("{0}({1}) : Measuring the end mass", test.Method, test.Name))
.AddOperation(checkUiOp)
@@ -712,55 +710,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
if (tstRslt != null)
{
/// Auxiliary results
tstRslt.AmbTempMean = (float)AmbTempStat.Average;
tstRslt.AmbTempStart = (float)AmbTempStat.First;
tstRslt.AmbTempEnd = (float)AmbTempStat.Last;
tstRslt.AmbTempMin = (float)AmbTempStat.Min;
tstRslt.AmbTempMax = (float)AmbTempStat.Max;
tstRslt.AmbPressMean = (float)AmbPressStat.Average;
tstRslt.AmbPressStart = (float)AmbPressStat.First;
tstRslt.AmbPressEnd = (float)AmbPressStat.Last;
tstRslt.AmbPressMin = (float)AmbPressStat.Min;
tstRslt.AmbPressMax = (float)AmbPressStat.Max;
tstRslt.AmbHumiMean = (float)AmbHumiStat.Average;
tstRslt.AmbHumiStart = (float)AmbHumiStat.First;
tstRslt.AmbHumiEnd = (float)AmbHumiStat.Last;
tstRslt.AmbHumiMin = (float)AmbHumiStat.Min;
tstRslt.AmbHumiMax = (float)AmbHumiStat.Max;
tstRslt.PressUpMean = (float)PressUpStat.Average;
tstRslt.PressUpStart = (float)PressUpStat.First;
tstRslt.PressUpEnd = (float)PressUpStat.Last;
tstRslt.PressUpMin = (float)PressUpStat.Min;
tstRslt.PressUpMax = (float)PressUpStat.Max;
tstRslt.PressDownMean = (float)PressDownStat.Average;
tstRslt.PressDownStart = (float)PressDownStat.First;
tstRslt.PressDownEnd = (float)PressDownStat.Last;
tstRslt.PressDownMin = (float)PressDownStat.Min;
tstRslt.PressDownMax = (float)PressDownStat.Max;
tstRslt.PressDeltaMean = (float)PressDeltaStat.Average;
tstRslt.PressDeltaStart = (float)PressDeltaStat.First;
tstRslt.PressDeltaEnd = (float)PressDeltaStat.Last;
tstRslt.PressDeltaMin = (float)PressDeltaStat.Min;
tstRslt.PressDeltaMax = (float)PressDeltaStat.Max;
tstRslt.TempUpMean = (float)TempUpStat.Average;
tstRslt.TempUpStart = (float)TempUpStat.First;
tstRslt.TempUpEnd = (float)TempUpStat.Last;
tstRslt.TempUpMin = (float)TempUpStat.Min;
tstRslt.TempUpMax = (float)TempUpStat.Max;
tstRslt.TempDownMean = (float)TempDownStat.Average;
tstRslt.TempDownStart = (float)TempDownStat.First;
tstRslt.TempDownEnd = (float)TempDownStat.Last;
tstRslt.TempDownMin = (float)TempDownStat.Min;
tstRslt.TempDownMax = (float)TempDownStat.Max;
tstRslt.TempDivMean = (float)TempDivStat.Average;
tstRslt.TempDivStart = (float)TempDivStat.First;
tstRslt.TempDivEnd = (float)TempDivStat.Last;
tstRslt.TempDivMin = (float)TempDivStat.Min;
tstRslt.TempDivMax = (float)TempDivStat.Max;
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempUpMean); /// [kg/m3]
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempDownMean); /// [kg/m3]
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivMean); /// [kg/m3]
UpdateTempPressDensAmb(tstRslt);
/// Main results
tstRslt.StartTime = TestStartTime;
@@ -779,8 +729,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMin = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Min * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Min);
tstRslt.FlowMax = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Max * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Max);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
if (compoundTestParams != null)
{
@@ -133,8 +133,8 @@ namespace TBF.BenchControl.TestMethods.LeakTest
pressure_set:
ClearAllStatistics();
UpdateAllStatistics();
ClearAllStatistics(StateMachine.Time);
UpdateAllStatistics(StateMachine.Time);
startTime = StateMachine.Time;
int estimtdEndTime = startTime + testParams.DurationPMax;
@@ -159,7 +159,7 @@ namespace TBF.BenchControl.TestMethods.LeakTest
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
UpdateAllStatistics();
UpdateAllStatistics(StateMachine.Time);
int remainingTime = Math.Max(estimtdEndTime - StateMachine.Time, 0);
if (remainingTime > 60)
@@ -194,7 +194,7 @@ namespace TBF.BenchControl.TestMethods.LeakTest
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
UpdateAllStatistics();
UpdateAllStatistics(StateMachine.Time);
}
while (e.Contains(Event.ValvesBusy));
@@ -218,7 +218,7 @@ namespace TBF.BenchControl.TestMethods.LeakTest
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
UpdateAllStatistics();
UpdateAllStatistics(StateMachine.Time);
}
while (e.Contains(Event.ValvesBusy));
@@ -228,7 +228,7 @@ namespace TBF.BenchControl.TestMethods.LeakTest
TestStartTime = DateTime.Now;
startTime = StateMachine.Time;
estimtdEndTime = startTime + testParams.DurationLeak;
ClearAllStatistics();
ClearAllStatistics(StateMachine.Time);
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress);
@@ -249,7 +249,7 @@ namespace TBF.BenchControl.TestMethods.LeakTest
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
UpdateAllStatistics();
UpdateAllStatistics(StateMachine.Time);
int remainingTime = Math.Max(estimtdEndTime - StateMachine.Time, 0);
if (remainingTime > 60)
@@ -283,55 +283,8 @@ namespace TBF.BenchControl.TestMethods.LeakTest
if (tstRslt != null)
{
/// Auxiliary results
tstRslt.AmbTempMean = (float)AmbTempStat.Average;
tstRslt.AmbTempStart = (float)AmbTempStat.First;
tstRslt.AmbTempEnd = (float)AmbTempStat.Last;
tstRslt.AmbTempMin = (float)AmbTempStat.Min;
tstRslt.AmbTempMax = (float)AmbTempStat.Max;
tstRslt.AmbPressMean = (float)AmbPressStat.Average;
tstRslt.AmbPressStart = (float)AmbPressStat.First;
tstRslt.AmbPressEnd = (float)AmbPressStat.Last;
tstRslt.AmbPressMin = (float)AmbPressStat.Min;
tstRslt.AmbPressMax = (float)AmbPressStat.Max;
tstRslt.AmbHumiMean = (float)AmbHumiStat.Average;
tstRslt.AmbHumiStart = (float)AmbHumiStat.First;
tstRslt.AmbHumiEnd = (float)AmbHumiStat.Last;
tstRslt.AmbHumiMin = (float)AmbHumiStat.Min;
tstRslt.AmbHumiMax = (float)AmbHumiStat.Max;
tstRslt.PressUpMean = (float)PressUpStat.Average;
tstRslt.PressUpStart = (float)PressUpStat.First;
tstRslt.PressUpEnd = (float)PressUpStat.Last;
tstRslt.PressUpMin = (float)PressUpStat.Min;
tstRslt.PressUpMax = (float)PressUpStat.Max;
tstRslt.PressDownMean = (float)PressDownStat.Average;
tstRslt.PressDownStart = (float)PressDownStat.First;
tstRslt.PressDownEnd = (float)PressDownStat.Last;
tstRslt.PressDownMin = (float)PressDownStat.Min;
tstRslt.PressDownMax = (float)PressDownStat.Max;
tstRslt.PressDeltaMean = (float)PressDeltaStat.Average;
tstRslt.PressDeltaStart = (float)PressDeltaStat.First;
tstRslt.PressDeltaEnd = (float)PressDeltaStat.Last;
tstRslt.PressDeltaMin = (float)PressDeltaStat.Min;
tstRslt.PressDeltaMax = (float)PressDeltaStat.Max;
tstRslt.TempUpMean = (float)TempUpStat.Average;
tstRslt.TempUpStart = (float)TempUpStat.First;
tstRslt.TempUpEnd = (float)TempUpStat.Last;
tstRslt.TempUpMin = (float)TempUpStat.Min;
tstRslt.TempUpMax = (float)TempUpStat.Max;
tstRslt.TempDownMean = (float)TempDownStat.Average;
tstRslt.TempDownStart = (float)TempDownStat.First;
tstRslt.TempDownEnd = (float)TempDownStat.Last;
tstRslt.TempDownMin = (float)TempDownStat.Min;
tstRslt.TempDownMax = (float)TempDownStat.Max;
tstRslt.TempDivMean = (float)TempDivStat.Average;
tstRslt.TempDivStart = (float)TempDivStat.First;
tstRslt.TempDivEnd = (float)TempDivStat.Last;
tstRslt.TempDivMin = (float)TempDivStat.Min;
tstRslt.TempDivMax = (float)TempDivStat.Max;
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempUpMean); /// [kg/m3]
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempDownMean); /// [kg/m3]
tstRslt.DensityDiv = 0;
UpdateTempPressDensAmb(tstRslt);
tstRslt.DensityDiv = 0;
/// Main results
tstRslt.StartTime = TestStartTime;
@@ -134,8 +134,8 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
pressure_set:
ClearAllStatistics();
UpdateAllStatistics();
ClearAllStatistics(StateMachine.Time);
UpdateAllStatistics(StateMachine.Time);
startTime = StateMachine.Time;
int endTime = startTime + testParams.DurationPMax;
@@ -160,7 +160,7 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
UpdateAllStatistics();
UpdateAllStatistics(StateMachine.Time);
int remainingTime = Math.Max(endTime - StateMachine.Time, 0);
if (remainingTime > 60)
@@ -194,55 +194,8 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
if (tstRslt != null)
{
/// Auxiliary results
tstRslt.AmbTempMean = (float)AmbTempStat.Average;
tstRslt.AmbTempStart = (float)AmbTempStat.First;
tstRslt.AmbTempEnd = (float)AmbTempStat.Last;
tstRslt.AmbTempMin = (float)AmbTempStat.Min;
tstRslt.AmbTempMax = (float)AmbTempStat.Max;
tstRslt.AmbPressMean = (float)AmbPressStat.Average;
tstRslt.AmbPressStart = (float)AmbPressStat.First;
tstRslt.AmbPressEnd = (float)AmbPressStat.Last;
tstRslt.AmbPressMin = (float)AmbPressStat.Min;
tstRslt.AmbPressMax = (float)AmbPressStat.Max;
tstRslt.AmbHumiMean = (float)AmbHumiStat.Average;
tstRslt.AmbHumiStart = (float)AmbHumiStat.First;
tstRslt.AmbHumiEnd = (float)AmbHumiStat.Last;
tstRslt.AmbHumiMin = (float)AmbHumiStat.Min;
tstRslt.AmbHumiMax = (float)AmbHumiStat.Max;
tstRslt.PressUpMean = (float)PressUpStat.Average;
tstRslt.PressUpStart = (float)PressUpStat.First;
tstRslt.PressUpEnd = (float)PressUpStat.Last;
tstRslt.PressUpMin = (float)PressUpStat.Min;
tstRslt.PressUpMax = (float)PressUpStat.Max;
tstRslt.PressDownMean = (float)PressDownStat.Average;
tstRslt.PressDownStart = (float)PressDownStat.First;
tstRslt.PressDownEnd = (float)PressDownStat.Last;
tstRslt.PressDownMin = (float)PressDownStat.Min;
tstRslt.PressDownMax = (float)PressDownStat.Max;
tstRslt.PressDeltaMean = (float)PressDeltaStat.Average;
tstRslt.PressDeltaStart = (float)PressDeltaStat.First;
tstRslt.PressDeltaEnd = (float)PressDeltaStat.Last;
tstRslt.PressDeltaMin = (float)PressDeltaStat.Min;
tstRslt.PressDeltaMax = (float)PressDeltaStat.Max;
tstRslt.TempUpMean = (float)TempUpStat.Average;
tstRslt.TempUpStart = (float)TempUpStat.First;
tstRslt.TempUpEnd = (float)TempUpStat.Last;
tstRslt.TempUpMin = (float)TempUpStat.Min;
tstRslt.TempUpMax = (float)TempUpStat.Max;
tstRslt.TempDownMean = (float)TempDownStat.Average;
tstRslt.TempDownStart = (float)TempDownStat.First;
tstRslt.TempDownEnd = (float)TempDownStat.Last;
tstRslt.TempDownMin = (float)TempDownStat.Min;
tstRslt.TempDownMax = (float)TempDownStat.Max;
tstRslt.TempDivMean = (float)TempDivStat.Average;
tstRslt.TempDivStart = (float)TempDivStat.First;
tstRslt.TempDivEnd = (float)TempDivStat.Last;
tstRslt.TempDivMin = (float)TempDivStat.Min;
tstRslt.TempDivMax = (float)TempDivStat.Max;
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempUpMean); /// [kg/m3]
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempDownMean); /// [kg/m3]
tstRslt.DensityDiv = 0;
UpdateTempPressDensAmb(tstRslt);
tstRslt.DensityDiv = 0;
/// Main results
tstRslt.StartTime = TestStartTime;
@@ -217,7 +217,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
queryEnd1 = cBrd.QueryMeasurementEndOp();
queryEnd2 = cBrd.QueryMeasurementEndOp();
ClearAllStatistics();
ClearAllStatistics(StateMachine.Time);
/// Measurement loop - begin
while (true)
@@ -232,7 +232,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
UpdateAllStatistics();
UpdateAllStatistics(StateMachine.Time);
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
@@ -305,55 +305,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
if (tstRslt != null)
{
/// Auxiliary results
tstRslt.AmbTempMean = (float)AmbTempStat.Average;
tstRslt.AmbTempStart = (float)AmbTempStat.First;
tstRslt.AmbTempEnd = (float)AmbTempStat.Last;
tstRslt.AmbTempMin = (float)AmbTempStat.Min;
tstRslt.AmbTempMax = (float)AmbTempStat.Max;
tstRslt.AmbPressMean = (float)AmbPressStat.Average;
tstRslt.AmbPressStart = (float)AmbPressStat.First;
tstRslt.AmbPressEnd = (float)AmbPressStat.Last;
tstRslt.AmbPressMin = (float)AmbPressStat.Min;
tstRslt.AmbPressMax = (float)AmbPressStat.Max;
tstRslt.AmbHumiMean = (float)AmbHumiStat.Average;
tstRslt.AmbHumiStart = (float)AmbHumiStat.First;
tstRslt.AmbHumiEnd = (float)AmbHumiStat.Last;
tstRslt.AmbHumiMin = (float)AmbHumiStat.Min;
tstRslt.AmbHumiMax = (float)AmbHumiStat.Max;
tstRslt.PressUpMean = (float)PressUpStat.Average;
tstRslt.PressUpStart = (float)PressUpStat.First;
tstRslt.PressUpEnd = (float)PressUpStat.Last;
tstRslt.PressUpMin = (float)PressUpStat.Min;
tstRslt.PressUpMax = (float)PressUpStat.Max;
tstRslt.PressDownMean = (float)PressDownStat.Average;
tstRslt.PressDownStart = (float)PressDownStat.First;
tstRslt.PressDownEnd = (float)PressDownStat.Last;
tstRslt.PressDownMin = (float)PressDownStat.Min;
tstRslt.PressDownMax = (float)PressDownStat.Max;
tstRslt.PressDeltaMean = (float)PressDeltaStat.Average;
tstRslt.PressDeltaStart = (float)PressDeltaStat.First;
tstRslt.PressDeltaEnd = (float)PressDeltaStat.Last;
tstRslt.PressDeltaMin = (float)PressDeltaStat.Min;
tstRslt.PressDeltaMax = (float)PressDeltaStat.Max;
tstRslt.TempUpMean = (float)TempUpStat.Average;
tstRslt.TempUpStart = (float)TempUpStat.First;
tstRslt.TempUpEnd = (float)TempUpStat.Last;
tstRslt.TempUpMin = (float)TempUpStat.Min;
tstRslt.TempUpMax = (float)TempUpStat.Max;
tstRslt.TempDownMean = (float)TempDownStat.Average;
tstRslt.TempDownStart = (float)TempDownStat.First;
tstRslt.TempDownEnd = (float)TempDownStat.Last;
tstRslt.TempDownMin = (float)TempDownStat.Min;
tstRslt.TempDownMax = (float)TempDownStat.Max;
tstRslt.TempDivMean = (float)TempDivStat.Average;
tstRslt.TempDivStart = (float)TempDivStat.First;
tstRslt.TempDivEnd = (float)TempDivStat.Last;
tstRslt.TempDivMin = (float)TempDivStat.Min;
tstRslt.TempDivMax = (float)TempDivStat.Max;
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempUpMean); /// [kg/m3]
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempDownMean); /// [kg/m3]
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivMean); /// [kg/m3]
UpdateTempPressDensAmb(tstRslt);
/// Main results
tstRslt.StartTime = TestStartTime;
@@ -372,8 +324,9 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMin = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Min * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Min);
tstRslt.FlowMax = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Max * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Max);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
/// Update flowmeter constant with the measured one
if (outPath.FlowMeter.Idx1 > 0 && outPath.FlowMeter.Idx1 <= ReferenceFlowmetersCount)
@@ -208,6 +208,56 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
tstRslt.Components = oriTestRslt.Components;
/// Auxiliary results, as in SequenceBase.UpdateTemoPressDensAmb()
tstRslt.AmbTempMean = oriTestRslt.AmbTempMean;
tstRslt.AmbTempStart = oriTestRslt.AmbTempStart;
tstRslt.AmbTempEnd = oriTestRslt.AmbTempEnd;
tstRslt.AmbTempMin = oriTestRslt.AmbTempMin;
tstRslt.AmbTempMax = oriTestRslt.AmbTempMax;
tstRslt.AmbPressMean = oriTestRslt.AmbPressMean;
tstRslt.AmbPressStart = oriTestRslt.AmbPressStart;
tstRslt.AmbPressEnd = oriTestRslt.AmbPressEnd;
tstRslt.AmbPressMin = oriTestRslt.AmbPressMin;
tstRslt.AmbPressMax = oriTestRslt.AmbPressMax;
tstRslt.AmbHumiMean = oriTestRslt.AmbHumiMean;
tstRslt.AmbHumiStart = oriTestRslt.AmbHumiStart;
tstRslt.AmbHumiEnd = oriTestRslt.AmbHumiEnd;
tstRslt.AmbHumiMin = oriTestRslt.AmbHumiMin;
tstRslt.AmbHumiMax = oriTestRslt.AmbHumiMax;
tstRslt.PressUpMean = oriTestRslt.PressUpMean;
tstRslt.PressUpStart = oriTestRslt.PressUpStart;
tstRslt.PressUpEnd = oriTestRslt.PressUpEnd;
tstRslt.PressUpMin = oriTestRslt.PressUpMin;
tstRslt.PressUpMax = oriTestRslt.PressUpMax;
tstRslt.PressDownMean = oriTestRslt.PressDownMean;
tstRslt.PressDownStart = oriTestRslt.PressDownStart;
tstRslt.PressDownEnd = oriTestRslt.PressDownEnd;
tstRslt.PressDownMin = oriTestRslt.PressDownMin;
tstRslt.PressDownMax = oriTestRslt.PressDownMax;
tstRslt.PressDeltaMean = oriTestRslt.PressDeltaMean;
tstRslt.PressDeltaStart = oriTestRslt.PressDeltaStart;
tstRslt.PressDeltaEnd = oriTestRslt.PressDeltaEnd;
tstRslt.PressDeltaMin = oriTestRslt.PressDeltaMin;
tstRslt.PressDeltaMax = oriTestRslt.PressDeltaMax;
tstRslt.TempUpMean = oriTestRslt.TempUpMean;
tstRslt.TempUpStart = oriTestRslt.TempUpStart;
tstRslt.TempUpEnd = oriTestRslt.TempUpEnd;
tstRslt.TempUpMin = oriTestRslt.TempUpMin;
tstRslt.TempUpMax = oriTestRslt.TempUpMax;
tstRslt.TempDownMean = oriTestRslt.TempDownMean;
tstRslt.TempDownStart = oriTestRslt.TempDownStart;
tstRslt.TempDownEnd = oriTestRslt.TempDownEnd;
tstRslt.TempDownMin = oriTestRslt.TempDownMin;
tstRslt.TempDownMax = oriTestRslt.TempDownMax;
tstRslt.TempDivMean = oriTestRslt.TempDivMean;
tstRslt.TempDivStart = oriTestRslt.TempDivStart;
tstRslt.TempDivEnd = oriTestRslt.TempDivEnd;
tstRslt.TempDivMin = oriTestRslt.TempDivMin;
tstRslt.TempDivMax = oriTestRslt.TempDivMax;
tstRslt.DensityIn = oriTestRslt.DensityIn;
tstRslt.DensityOut = oriTestRslt.DensityOut;
tstRslt.DensityDiv = oriTestRslt.DensityDiv;
tstRslt.StartTime = oriTestRslt.StartTime;
tstRslt.EndTime = oriTestRslt.EndTime;
tstRslt.FlowSetTime = oriTestRslt.FlowSetTime;
@@ -218,45 +268,14 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
tstRslt.MassStart = oriTestRslt.MassStart;
tstRslt.MassEndRaw = oriTestRslt.MassEndRaw;
tstRslt.MassEnd = oriTestRslt.MassEnd;
tstRslt.DensityIn = oriTestRslt.DensityIn;
tstRslt.DensityOut = oriTestRslt.DensityOut;
tstRslt.DensityDiv = oriTestRslt.DensityDiv;
tstRslt.Buoyancy = oriTestRslt.Buoyancy;
tstRslt.FlowMass = oriTestRslt.FlowMass;
tstRslt.FlowVolume = oriTestRslt.FlowVolume;
tstRslt.VolumeCTV = oriTestRslt.VolumeCTV;
tstRslt.VolumeMaster = oriTestRslt.VolumeMaster;
tstRslt.ErrorMaster = oriTestRslt.ErrorMaster;
tstRslt.AmbTempMean = oriTestRslt.AmbTempMean;
tstRslt.AmbPressMean = oriTestRslt.AmbPressMean;
tstRslt.AmbHumiMean = oriTestRslt.AmbHumiMean;
tstRslt.PressUpMean = oriTestRslt.PressUpMean;
tstRslt.PressUpStart = oriTestRslt.PressUpStart;
tstRslt.PressUpEnd = oriTestRslt.PressUpEnd;
tstRslt.PressUpMin = oriTestRslt.PressUpMin;
tstRslt.PressUpMax = oriTestRslt.PressUpMax;
tstRslt.PressDownMean = oriTestRslt.PressDownMean;
tstRslt.PressDownStart = oriTestRslt.PressDownStart;
tstRslt.PressDownEnd = oriTestRslt.PressDownEnd;
tstRslt.PressDownMin = oriTestRslt.PressDownMin;
tstRslt.PressDownMax = oriTestRslt.PressDownMax;
tstRslt.TempUpMean = oriTestRslt.TempUpMean;
tstRslt.TempUpStart = oriTestRslt.TempUpStart;
tstRslt.TempUpEnd = oriTestRslt.TempUpEnd;
tstRslt.TempUpMin = oriTestRslt.TempUpMin;
tstRslt.TempUpMax = oriTestRslt.TempUpMax;
tstRslt.TempDownMean = oriTestRslt.TempDownMean;
tstRslt.TempDownStart = oriTestRslt.TempDownStart;
tstRslt.TempDownEnd = oriTestRslt.TempDownEnd;
tstRslt.TempDownMin = oriTestRslt.TempDownMin;
tstRslt.TempDownMax = oriTestRslt.TempDownMax;
tstRslt.TempDivMean = oriTestRslt.TempDivMean;
tstRslt.TempDivStart = oriTestRslt.TempDivStart;
tstRslt.TempDivEnd = oriTestRslt.TempDivEnd;
tstRslt.TempDivMin = oriTestRslt.TempDivMin;
tstRslt.TempDivMax = oriTestRslt.TempDivMax;
tstRslt.FlowMin = oriTestRslt.FlowMin;
tstRslt.FlowMean = oriTestRslt.FlowMean;
tstRslt.FlowMax = oriTestRslt.FlowMax;
tstRslt.Custom1 = oriTestRslt.Custom1;
@@ -8,6 +8,8 @@ using Results.Entities;
using NHibernate;
using log4net;
using TBF.Resources;
using TBF.BenchControl.DB.SensusOracle;
using Oracle.DataAccess.Client;
namespace TBF.Forms
{
@@ -187,8 +189,9 @@ namespace TBF.Forms
dlg.TestsArrangement = Program.LocalSettings.ResultsConfigTests;
dlg.NrMetersInOneGroup = Math.Max(1, Program.LocalSettings.ResultsConfigMetersInOneGroup);
dlg.RsltItems_Screen_SingleWM = Results.ItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Screen_SingleWM);
dlg.RsltItems_Screen_CombinedWM = Results.ItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Screen_CombinedWM);
dlg.RsltItems_Screen_SingleWM = Results.WMeterRsltItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Screen_SingleWM);
dlg.RsltItems_Screen_CombinedWM = Results.WMeterRsltItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Screen_CombinedWM);
dlg.RsltItems_Screen_HeatM = Results.WMeterRsltItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Screen_HeatM);
dlg.RsltsClmnWidths = Program.LocalSettings.RsltsClmnWidths;
foreach (var b in batches)
+221
View File
@@ -0,0 +1,221 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
namespace TBF.Forms
{
partial class ResultsArrangementDlg
{
/// <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.testsRowsRadioButton = new System.Windows.Forms.RadioButton();
this.testsColumnsRadioButton = new System.Windows.Forms.RadioButton();
this.testsArangementGroupBox = new System.Windows.Forms.GroupBox();
this.metersArangementGroupBox = new System.Windows.Forms.GroupBox();
this.nrMetersTextBox = new System.Windows.Forms.TextBox();
this.nrMetersLabel = new System.Windows.Forms.Label();
this.verticallyRadioButton = new System.Windows.Forms.RadioButton();
this.horizontallyRadioButton = new System.Windows.Forms.RadioButton();
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.unlockButton = new System.Windows.Forms.Button();
this.resultsConfigCtrl = new Results.Forms.ResultsConfigCtrl();
this.testsArangementGroupBox.SuspendLayout();
this.metersArangementGroupBox.SuspendLayout();
this.SuspendLayout();
//
// testsRowsRadioButton
//
this.testsRowsRadioButton.AutoSize = true;
this.testsRowsRadioButton.Enabled = false;
this.testsRowsRadioButton.Location = new System.Drawing.Point(21, 21);
this.testsRowsRadioButton.Name = "testsRowsRadioButton";
this.testsRowsRadioButton.Size = new System.Drawing.Size(120, 17);
this.testsRowsRadioButton.TabIndex = 0;
this.testsRowsRadioButton.TabStop = true;
this.testsRowsRadioButton.Text = "Tests are table rows";
this.testsRowsRadioButton.UseVisualStyleBackColor = true;
//
// testsColumnsRadioButton
//
this.testsColumnsRadioButton.AutoSize = true;
this.testsColumnsRadioButton.Enabled = false;
this.testsColumnsRadioButton.Location = new System.Drawing.Point(21, 43);
this.testsColumnsRadioButton.Name = "testsColumnsRadioButton";
this.testsColumnsRadioButton.Size = new System.Drawing.Size(137, 17);
this.testsColumnsRadioButton.TabIndex = 1;
this.testsColumnsRadioButton.TabStop = true;
this.testsColumnsRadioButton.Text = "Tests are table columns";
this.testsColumnsRadioButton.UseVisualStyleBackColor = true;
//
// testsArangementGroupBox
//
this.testsArangementGroupBox.Controls.Add(this.testsColumnsRadioButton);
this.testsArangementGroupBox.Controls.Add(this.testsRowsRadioButton);
this.testsArangementGroupBox.Location = new System.Drawing.Point(14, 12);
this.testsArangementGroupBox.Name = "testsArangementGroupBox";
this.testsArangementGroupBox.Size = new System.Drawing.Size(305, 70);
this.testsArangementGroupBox.TabIndex = 2;
this.testsArangementGroupBox.TabStop = false;
this.testsArangementGroupBox.Text = "Arangement of tests";
//
// metersArangementGroupBox
//
this.metersArangementGroupBox.Controls.Add(this.nrMetersTextBox);
this.metersArangementGroupBox.Controls.Add(this.nrMetersLabel);
this.metersArangementGroupBox.Controls.Add(this.verticallyRadioButton);
this.metersArangementGroupBox.Controls.Add(this.horizontallyRadioButton);
this.metersArangementGroupBox.Location = new System.Drawing.Point(325, 12);
this.metersArangementGroupBox.Name = "metersArangementGroupBox";
this.metersArangementGroupBox.Size = new System.Drawing.Size(593, 70);
this.metersArangementGroupBox.TabIndex = 3;
this.metersArangementGroupBox.TabStop = false;
this.metersArangementGroupBox.Text = "Arangement of tested meters";
//
// nrMetersTextBox
//
this.nrMetersTextBox.Enabled = false;
this.nrMetersTextBox.Location = new System.Drawing.Point(409, 23);
this.nrMetersTextBox.Name = "nrMetersTextBox";
this.nrMetersTextBox.Size = new System.Drawing.Size(41, 20);
this.nrMetersTextBox.TabIndex = 5;
//
// nrMetersLabel
//
this.nrMetersLabel.AutoSize = true;
this.nrMetersLabel.Location = new System.Drawing.Point(263, 23);
this.nrMetersLabel.Name = "nrMetersLabel";
this.nrMetersLabel.Size = new System.Drawing.Size(108, 13);
this.nrMetersLabel.TabIndex = 4;
this.nrMetersLabel.Text = "Nr. meters in a group:";
//
// verticallyRadioButton
//
this.verticallyRadioButton.AutoSize = true;
this.verticallyRadioButton.Enabled = false;
this.verticallyRadioButton.Location = new System.Drawing.Point(21, 21);
this.verticallyRadioButton.Name = "verticallyRadioButton";
this.verticallyRadioButton.Size = new System.Drawing.Size(67, 17);
this.verticallyRadioButton.TabIndex = 3;
this.verticallyRadioButton.TabStop = true;
this.verticallyRadioButton.Text = "Vertically";
this.verticallyRadioButton.UseVisualStyleBackColor = true;
//
// horizontallyRadioButton
//
this.horizontallyRadioButton.AutoSize = true;
this.horizontallyRadioButton.Enabled = false;
this.horizontallyRadioButton.Location = new System.Drawing.Point(21, 43);
this.horizontallyRadioButton.Name = "horizontallyRadioButton";
this.horizontallyRadioButton.Size = new System.Drawing.Size(79, 17);
this.horizontallyRadioButton.TabIndex = 2;
this.horizontallyRadioButton.TabStop = true;
this.horizontallyRadioButton.Text = "Horizontally";
this.horizontallyRadioButton.UseVisualStyleBackColor = true;
//
// okButton
//
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.Location = new System.Drawing.Point(937, 57);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(104, 30);
this.okButton.TabIndex = 4;
this.okButton.Text = "Close";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(937, 94);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(104, 30);
this.cancelButton.TabIndex = 5;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Visible = false;
//
// unlockButton
//
this.unlockButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.unlockButton.Location = new System.Drawing.Point(937, 21);
this.unlockButton.Name = "unlockButton";
this.unlockButton.Size = new System.Drawing.Size(104, 30);
this.unlockButton.TabIndex = 47;
this.unlockButton.Text = "Unlock";
this.unlockButton.UseVisualStyleBackColor = true;
this.unlockButton.Click += new System.EventHandler(this.unlockButton_Click);
//
// resultsConfigCtrl
//
this.resultsConfigCtrl.Location = new System.Drawing.Point(3, 85);
this.resultsConfigCtrl.Name = "resultsConfigCtrl";
this.resultsConfigCtrl.Size = new System.Drawing.Size(925, 496);
this.resultsConfigCtrl.TabIndex = 53;
this.resultsConfigCtrl.Unlocked = false;
//
// ResultsArrangementDlg
//
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(1056, 579);
this.Controls.Add(this.resultsConfigCtrl);
this.Controls.Add(this.unlockButton);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Controls.Add(this.metersArangementGroupBox);
this.Controls.Add(this.testsArangementGroupBox);
this.Name = "ResultsArrangementDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "ResultsConfig";
this.Load += new System.EventHandler(this.ResultsConfig_Load);
this.testsArangementGroupBox.ResumeLayout(false);
this.testsArangementGroupBox.PerformLayout();
this.metersArangementGroupBox.ResumeLayout(false);
this.metersArangementGroupBox.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.RadioButton testsRowsRadioButton;
private System.Windows.Forms.RadioButton testsColumnsRadioButton;
private System.Windows.Forms.GroupBox testsArangementGroupBox;
private System.Windows.Forms.GroupBox metersArangementGroupBox;
private System.Windows.Forms.RadioButton verticallyRadioButton;
private System.Windows.Forms.RadioButton horizontallyRadioButton;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Button unlockButton;
private System.Windows.Forms.TextBox nrMetersTextBox;
private System.Windows.Forms.Label nrMetersLabel;
private Results.Forms.ResultsConfigCtrl resultsConfigCtrl;
}
}
@@ -0,0 +1,131 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Config.Entities;
using Results;
using TBF.Resources;
namespace TBF.Forms
{
public partial class ResultsArrangementDlg : Form
{
/// <summary>
/// Required access rights to make changes with this form
/// </summary>
const Users.Grp.GID RequiredGroupMembership = Users.Grp.GID.Metrologists;
public bool Unlocked; /// true = changes enabled
public TestsArrangement TestsArrangement;
public MetersArrangement MetersArrangement;
public int NrMetersInOneGroup;
public IList<WMeterRsltItemSpec> SelectedItems
{
set { resultsConfigCtrl.SelectedItems = value; }
get { return resultsConfigCtrl.SelectedItems; }
}
public MetersKind MetersKind
{
set
{
resultsConfigCtrl.MetersKind = mtrsKind = value;
Text = string.Format("{0} ({1})", Strings.Configuration, mtrsKind.ToDescription());
}
}
MetersKind mtrsKind;
public ResultsArrangementDlg()
{
InitializeComponent();
Unlocked = false;
cancelButton.Visible = false;
}
void Localize()
{
Text = string.Format("{0} ({1})", Strings.Configuration, mtrsKind.ToDescription());
testsArangementGroupBox.Text = Strings.Arrangement_of_tests;
metersArangementGroupBox.Text = Strings.Arrangement_of_meters;
testsRowsRadioButton.Text = Strings.Tests_are_rows;
testsColumnsRadioButton.Text = Strings.Tests_are_columns;
horizontallyRadioButton.Text = Strings.Horizontally;
verticallyRadioButton.Text = Strings.Vertically;
nrMetersLabel.Text = Strings.Nr_meters_in_a_group;
unlockButton.Text = Strings.UnlockBtnText;
okButton.Text = Strings.CloseBtnText;
cancelButton.Text = Strings.CancelBtnText;
}
void ResultsConfig_Load(object sender, EventArgs e)
{
Localize();
testsRowsRadioButton.Checked = (TestsArrangement == TestsArrangement.Rows);
testsColumnsRadioButton.Checked = (TestsArrangement == TestsArrangement.Columns);
horizontallyRadioButton.Checked = (MetersArrangement == MetersArrangement.Horizontally);
verticallyRadioButton.Checked = (MetersArrangement == MetersArrangement.Vertically);
nrMetersTextBox.Text = NrMetersInOneGroup.ToString();
}
void unlockButton_Click(object sender, EventArgs e)
{
if (!Unlocked)
{
if (!Users.GlobalData.CurrentUser.IsMemberOf(RequiredGroupMembership))
{
if ((new Users.Forms.LoginDlg(RequiredGroupMembership)).ShowDialog() != DialogResult.OK)
return;
}
else if (Program.LocalSettings.AlwaysAskPasswdWhenUnlocking)
{
if ((new Users.Forms.LoginDlg(Users.GlobalData.CurrentUser.UserName, RequiredGroupMembership)).ShowDialog() != DialogResult.OK)
return;
}
if (Program.MainWnd != null) Program.MainWnd.UpdateUser();
Unlocked = true;
///
/// Unlock user interface controls
///
unlockButton.Enabled = false;
okButton.Text = Strings.OkBtnText;
cancelButton.Visible = true;
testsRowsRadioButton.Enabled = true;
testsColumnsRadioButton.Enabled = true;
verticallyRadioButton.Enabled = true;
horizontallyRadioButton.Enabled = true;
nrMetersTextBox.Enabled = true;
resultsConfigCtrl.Unlocked = true;
}
}
void okButton_Click(object sender, EventArgs e)
{
if (testsColumnsRadioButton.Checked) TestsArrangement = TestsArrangement.Columns;
else TestsArrangement = TestsArrangement.Rows;
if (horizontallyRadioButton.Checked) MetersArrangement = MetersArrangement.Horizontally;
else MetersArrangement = MetersArrangement.Vertically;
int nrInGroup;
if (int.TryParse(nrMetersTextBox.Text, out nrInGroup) && nrInGroup > 0)
{
NrMetersInOneGroup = nrInGroup;
}
DialogResult = DialogResult.OK;
Close();
}
}
}
-411
View File
@@ -1,411 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
namespace TBF.Forms
{
partial class ResultsConfig
{
/// <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.testsRowsRadioButton = new System.Windows.Forms.RadioButton();
this.testsColumnsRadioButton = new System.Windows.Forms.RadioButton();
this.testsArangementGroupBox = new System.Windows.Forms.GroupBox();
this.metersArangementGroupBox = new System.Windows.Forms.GroupBox();
this.nrMetersTextBox = new System.Windows.Forms.TextBox();
this.nrMetersLabel = new System.Windows.Forms.Label();
this.verticallyRadioButton = new System.Windows.Forms.RadioButton();
this.horizontallyRadioButton = new System.Windows.Forms.RadioButton();
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.availableResultsListBox = new System.Windows.Forms.ListBox();
this.selectedResultsListBox = new System.Windows.Forms.ListBox();
this.availableResultsLabel = new System.Windows.Forms.Label();
this.selectedResultsLabel = new System.Windows.Forms.Label();
this.removeAllButton = new System.Windows.Forms.Button();
this.removeButton = new System.Windows.Forms.Button();
this.addButton = new System.Windows.Forms.Button();
this.unlockButton = new System.Windows.Forms.Button();
this.singleRadioButton = new System.Windows.Forms.RadioButton();
this.combinedRadioButton = new System.Windows.Forms.RadioButton();
this.screenRadioButton = new System.Windows.Forms.RadioButton();
this.printerRadioButton = new System.Windows.Forms.RadioButton();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.heatRadioButton = new System.Windows.Forms.RadioButton();
this.testsArangementGroupBox.SuspendLayout();
this.metersArangementGroupBox.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// testsRowsRadioButton
//
this.testsRowsRadioButton.AutoSize = true;
this.testsRowsRadioButton.Enabled = false;
this.testsRowsRadioButton.Location = new System.Drawing.Point(21, 21);
this.testsRowsRadioButton.Name = "testsRowsRadioButton";
this.testsRowsRadioButton.Size = new System.Drawing.Size(120, 17);
this.testsRowsRadioButton.TabIndex = 0;
this.testsRowsRadioButton.TabStop = true;
this.testsRowsRadioButton.Text = "Tests are table rows";
this.testsRowsRadioButton.UseVisualStyleBackColor = true;
//
// testsColumnsRadioButton
//
this.testsColumnsRadioButton.AutoSize = true;
this.testsColumnsRadioButton.Enabled = false;
this.testsColumnsRadioButton.Location = new System.Drawing.Point(21, 43);
this.testsColumnsRadioButton.Name = "testsColumnsRadioButton";
this.testsColumnsRadioButton.Size = new System.Drawing.Size(137, 17);
this.testsColumnsRadioButton.TabIndex = 1;
this.testsColumnsRadioButton.TabStop = true;
this.testsColumnsRadioButton.Text = "Tests are table columns";
this.testsColumnsRadioButton.UseVisualStyleBackColor = true;
//
// testsArangementGroupBox
//
this.testsArangementGroupBox.Controls.Add(this.testsColumnsRadioButton);
this.testsArangementGroupBox.Controls.Add(this.testsRowsRadioButton);
this.testsArangementGroupBox.Location = new System.Drawing.Point(12, 12);
this.testsArangementGroupBox.Name = "testsArangementGroupBox";
this.testsArangementGroupBox.Size = new System.Drawing.Size(254, 70);
this.testsArangementGroupBox.TabIndex = 2;
this.testsArangementGroupBox.TabStop = false;
this.testsArangementGroupBox.Text = "Arangement of tests";
//
// metersArangementGroupBox
//
this.metersArangementGroupBox.Controls.Add(this.nrMetersTextBox);
this.metersArangementGroupBox.Controls.Add(this.nrMetersLabel);
this.metersArangementGroupBox.Controls.Add(this.verticallyRadioButton);
this.metersArangementGroupBox.Controls.Add(this.horizontallyRadioButton);
this.metersArangementGroupBox.Location = new System.Drawing.Point(12, 87);
this.metersArangementGroupBox.Name = "metersArangementGroupBox";
this.metersArangementGroupBox.Size = new System.Drawing.Size(254, 70);
this.metersArangementGroupBox.TabIndex = 3;
this.metersArangementGroupBox.TabStop = false;
this.metersArangementGroupBox.Text = "Arangement of tested meters";
//
// nrMetersTextBox
//
this.nrMetersTextBox.Location = new System.Drawing.Point(169, 40);
this.nrMetersTextBox.Name = "nrMetersTextBox";
this.nrMetersTextBox.Size = new System.Drawing.Size(41, 20);
this.nrMetersTextBox.TabIndex = 5;
//
// nrMetersLabel
//
this.nrMetersLabel.AutoSize = true;
this.nrMetersLabel.Location = new System.Drawing.Point(138, 23);
this.nrMetersLabel.Name = "nrMetersLabel";
this.nrMetersLabel.Size = new System.Drawing.Size(108, 13);
this.nrMetersLabel.TabIndex = 4;
this.nrMetersLabel.Text = "Nr. meters in a group:";
//
// verticallyRadioButton
//
this.verticallyRadioButton.AutoSize = true;
this.verticallyRadioButton.Enabled = false;
this.verticallyRadioButton.Location = new System.Drawing.Point(21, 21);
this.verticallyRadioButton.Name = "verticallyRadioButton";
this.verticallyRadioButton.Size = new System.Drawing.Size(67, 17);
this.verticallyRadioButton.TabIndex = 3;
this.verticallyRadioButton.TabStop = true;
this.verticallyRadioButton.Text = "Vertically";
this.verticallyRadioButton.UseVisualStyleBackColor = true;
//
// horizontallyRadioButton
//
this.horizontallyRadioButton.AutoSize = true;
this.horizontallyRadioButton.Enabled = false;
this.horizontallyRadioButton.Location = new System.Drawing.Point(21, 43);
this.horizontallyRadioButton.Name = "horizontallyRadioButton";
this.horizontallyRadioButton.Size = new System.Drawing.Size(79, 17);
this.horizontallyRadioButton.TabIndex = 2;
this.horizontallyRadioButton.TabStop = true;
this.horizontallyRadioButton.Text = "Horizontally";
this.horizontallyRadioButton.UseVisualStyleBackColor = true;
//
// okButton
//
this.okButton.Location = new System.Drawing.Point(283, 57);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(104, 30);
this.okButton.TabIndex = 4;
this.okButton.Text = "Close";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(283, 94);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(104, 30);
this.cancelButton.TabIndex = 5;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Visible = false;
//
// availableResultsListBox
//
this.availableResultsListBox.Enabled = false;
this.availableResultsListBox.FormattingEnabled = true;
this.availableResultsListBox.Location = new System.Drawing.Point(12, 272);
this.availableResultsListBox.Name = "availableResultsListBox";
this.availableResultsListBox.Size = new System.Drawing.Size(135, 186);
this.availableResultsListBox.TabIndex = 6;
this.availableResultsListBox.DoubleClick += new System.EventHandler(this.availableResultsListBox_DoubleClick);
//
// selectedResultsListBox
//
this.selectedResultsListBox.Enabled = false;
this.selectedResultsListBox.FormattingEnabled = true;
this.selectedResultsListBox.Location = new System.Drawing.Point(252, 272);
this.selectedResultsListBox.Name = "selectedResultsListBox";
this.selectedResultsListBox.Size = new System.Drawing.Size(135, 186);
this.selectedResultsListBox.TabIndex = 7;
this.selectedResultsListBox.DoubleClick += new System.EventHandler(this.selectedResultsListBox_DoubleClick);
//
// availableResultsLabel
//
this.availableResultsLabel.AutoSize = true;
this.availableResultsLabel.Location = new System.Drawing.Point(12, 250);
this.availableResultsLabel.Name = "availableResultsLabel";
this.availableResultsLabel.Size = new System.Drawing.Size(86, 13);
this.availableResultsLabel.TabIndex = 8;
this.availableResultsLabel.Text = "Available results:";
//
// selectedResultsLabel
//
this.selectedResultsLabel.AutoSize = true;
this.selectedResultsLabel.Location = new System.Drawing.Point(249, 250);
this.selectedResultsLabel.Name = "selectedResultsLabel";
this.selectedResultsLabel.Size = new System.Drawing.Size(85, 13);
this.selectedResultsLabel.TabIndex = 9;
this.selectedResultsLabel.Text = "Selected results:";
//
// removeAllButton
//
this.removeAllButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.removeAllButton.Enabled = false;
this.removeAllButton.Location = new System.Drawing.Point(153, 385);
this.removeAllButton.Name = "removeAllButton";
this.removeAllButton.Size = new System.Drawing.Size(94, 30);
this.removeAllButton.TabIndex = 46;
this.removeAllButton.Text = "<< R&emove all";
this.removeAllButton.UseVisualStyleBackColor = true;
this.removeAllButton.Click += new System.EventHandler(this.removeAllButton_Click);
//
// removeButton
//
this.removeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.removeButton.Enabled = false;
this.removeButton.Location = new System.Drawing.Point(153, 350);
this.removeButton.Name = "removeButton";
this.removeButton.Size = new System.Drawing.Size(93, 30);
this.removeButton.TabIndex = 45;
this.removeButton.Text = "< &Remove";
this.removeButton.UseVisualStyleBackColor = true;
this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
//
// addButton
//
this.addButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.addButton.Enabled = false;
this.addButton.Location = new System.Drawing.Point(153, 315);
this.addButton.Name = "addButton";
this.addButton.Size = new System.Drawing.Size(93, 30);
this.addButton.TabIndex = 44;
this.addButton.Text = "&Add >";
this.addButton.UseVisualStyleBackColor = true;
this.addButton.Click += new System.EventHandler(this.addButton_Click);
//
// unlockButton
//
this.unlockButton.Location = new System.Drawing.Point(283, 21);
this.unlockButton.Name = "unlockButton";
this.unlockButton.Size = new System.Drawing.Size(104, 30);
this.unlockButton.TabIndex = 47;
this.unlockButton.Text = "Unlock";
this.unlockButton.UseVisualStyleBackColor = true;
this.unlockButton.Click += new System.EventHandler(this.unlockButton_Click);
//
// singleRadioButton
//
this.singleRadioButton.Appearance = System.Windows.Forms.Appearance.Button;
this.singleRadioButton.AutoSize = true;
this.singleRadioButton.Checked = true;
this.singleRadioButton.Location = new System.Drawing.Point(18, 24);
this.singleRadioButton.Name = "singleRadioButton";
this.singleRadioButton.Size = new System.Drawing.Size(46, 23);
this.singleRadioButton.TabIndex = 48;
this.singleRadioButton.TabStop = true;
this.singleRadioButton.Text = "Single";
this.singleRadioButton.UseVisualStyleBackColor = true;
this.singleRadioButton.CheckedChanged += new System.EventHandler(this.singleRadioButton_CheckedChanged);
//
// combinedRadioButton
//
this.combinedRadioButton.Appearance = System.Windows.Forms.Appearance.Button;
this.combinedRadioButton.AutoSize = true;
this.combinedRadioButton.Location = new System.Drawing.Point(75, 24);
this.combinedRadioButton.Name = "combinedRadioButton";
this.combinedRadioButton.Size = new System.Drawing.Size(64, 23);
this.combinedRadioButton.TabIndex = 49;
this.combinedRadioButton.Text = "Combined";
this.combinedRadioButton.UseVisualStyleBackColor = true;
this.combinedRadioButton.CheckedChanged += new System.EventHandler(this.combinedRadioButton_CheckedChanged);
//
// screenRadioButton
//
this.screenRadioButton.Appearance = System.Windows.Forms.Appearance.Button;
this.screenRadioButton.AutoSize = true;
this.screenRadioButton.Checked = true;
this.screenRadioButton.Location = new System.Drawing.Point(11, 24);
this.screenRadioButton.Name = "screenRadioButton";
this.screenRadioButton.Size = new System.Drawing.Size(51, 23);
this.screenRadioButton.TabIndex = 50;
this.screenRadioButton.TabStop = true;
this.screenRadioButton.Text = "Screen";
this.screenRadioButton.UseVisualStyleBackColor = true;
this.screenRadioButton.CheckedChanged += new System.EventHandler(this.screenRadioButton_CheckedChanged);
//
// printerRadioButton
//
this.printerRadioButton.Appearance = System.Windows.Forms.Appearance.Button;
this.printerRadioButton.AutoSize = true;
this.printerRadioButton.Location = new System.Drawing.Point(75, 24);
this.printerRadioButton.Name = "printerRadioButton";
this.printerRadioButton.Size = new System.Drawing.Size(47, 23);
this.printerRadioButton.TabIndex = 51;
this.printerRadioButton.Text = "Printer";
this.printerRadioButton.UseVisualStyleBackColor = true;
this.printerRadioButton.CheckedChanged += new System.EventHandler(this.printerRadioButton_CheckedChanged);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.heatRadioButton);
this.groupBox1.Controls.Add(this.combinedRadioButton);
this.groupBox1.Controls.Add(this.singleRadioButton);
this.groupBox1.Location = new System.Drawing.Point(17, 176);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(229, 60);
this.groupBox1.TabIndex = 52;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Water Meter";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.printerRadioButton);
this.groupBox2.Controls.Add(this.screenRadioButton);
this.groupBox2.Location = new System.Drawing.Point(252, 176);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(134, 60);
this.groupBox2.TabIndex = 0;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Device";
//
// heatRadioButton
//
this.heatRadioButton.Appearance = System.Windows.Forms.Appearance.Button;
this.heatRadioButton.AutoSize = true;
this.heatRadioButton.Location = new System.Drawing.Point(149, 24);
this.heatRadioButton.Name = "heatRadioButton";
this.heatRadioButton.Size = new System.Drawing.Size(40, 23);
this.heatRadioButton.TabIndex = 50;
this.heatRadioButton.Text = "Heat";
this.heatRadioButton.UseVisualStyleBackColor = true;
this.heatRadioButton.CheckedChanged += new System.EventHandler(this.heatRadioButton_CheckedChanged);
//
// ResultsConfig
//
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(399, 468);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.unlockButton);
this.Controls.Add(this.removeAllButton);
this.Controls.Add(this.removeButton);
this.Controls.Add(this.addButton);
this.Controls.Add(this.selectedResultsLabel);
this.Controls.Add(this.availableResultsLabel);
this.Controls.Add(this.selectedResultsListBox);
this.Controls.Add(this.availableResultsListBox);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Controls.Add(this.metersArangementGroupBox);
this.Controls.Add(this.testsArangementGroupBox);
this.Name = "ResultsConfig";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "ResultsConfig";
this.Load += new System.EventHandler(this.ResultsConfig_Load);
this.testsArangementGroupBox.ResumeLayout(false);
this.testsArangementGroupBox.PerformLayout();
this.metersArangementGroupBox.ResumeLayout(false);
this.metersArangementGroupBox.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.RadioButton testsRowsRadioButton;
private System.Windows.Forms.RadioButton testsColumnsRadioButton;
private System.Windows.Forms.GroupBox testsArangementGroupBox;
private System.Windows.Forms.GroupBox metersArangementGroupBox;
private System.Windows.Forms.RadioButton verticallyRadioButton;
private System.Windows.Forms.RadioButton horizontallyRadioButton;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.ListBox availableResultsListBox;
private System.Windows.Forms.ListBox selectedResultsListBox;
private System.Windows.Forms.Label availableResultsLabel;
private System.Windows.Forms.Label selectedResultsLabel;
private System.Windows.Forms.Button removeAllButton;
private System.Windows.Forms.Button removeButton;
private System.Windows.Forms.Button addButton;
private System.Windows.Forms.Button unlockButton;
private System.Windows.Forms.RadioButton singleRadioButton;
private System.Windows.Forms.RadioButton combinedRadioButton;
private System.Windows.Forms.RadioButton screenRadioButton;
private System.Windows.Forms.RadioButton printerRadioButton;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox nrMetersTextBox;
private System.Windows.Forms.Label nrMetersLabel;
private System.Windows.Forms.RadioButton heatRadioButton;
}
}
-333
View File
@@ -1,333 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Config;
using Config.Entities;
using TBF.Resources;
namespace TBF.Forms
{
public partial class ResultsConfig : Form
{
/// <summary>
/// Required access rights to make changes with this form
/// </summary>
const Users.Grp.GID RequiredGroupMembership = Users.Grp.GID.Metrologists;
public TestsArrangement TestsArrangement;
public MetersArrangement MetersArrangement;
public int NrMetersInOneGroup;
public IList<Results.ItemSpec> currentlyAvailableItems;
public IList<Results.ItemSpec> RsltItems_Screen_SingleWM;
public IList<Results.ItemSpec> RsltItems_Screen_CombinedWM;
public IList<Results.ItemSpec> RsltItems_Screen_HeatM;
public IList<Results.ItemSpec> RsltItems_Printer_SingleWM;
public IList<Results.ItemSpec> RsltItems_Printer_CombinedWM;
public IList<Results.ItemSpec> RsltItems_Printer_HeatM;
MetersKind mtrsKind; /// false = single meter items, true = combined meter items
Device device; /// Screen, Printer or Disk
bool unlocked; /// true = changes enabled
public ResultsConfig(MetersKind mtrsKind)
{
InitializeComponent();
this.mtrsKind = mtrsKind;
device = Device.Screen;
unlocked = false;
cancelButton.Visible = false;
}
void Localize()
{
Text = Strings.Configuration;
testsArangementGroupBox.Text = Strings.Arrangement_of_tests;
metersArangementGroupBox.Text = Strings.Arrangement_of_meters;
testsRowsRadioButton.Text = Strings.Tests_are_rows;
testsColumnsRadioButton.Text = Strings.Tests_are_columns;
horizontallyRadioButton.Text = Strings.Horizontally;
verticallyRadioButton.Text = Strings.Vertically;
nrMetersLabel.Text = Strings.Nr_meters_in_a_group;
groupBox1.Text = Strings.Water_Meter;
singleRadioButton.Text = Strings.SingleBtnText;
combinedRadioButton.Text = Strings.Compound;
groupBox2.Text = Strings.Device;
screenRadioButton.Text = Strings.ScreenBtnText;
printerRadioButton.Text = Strings.PrinterBtnText;
availableResultsLabel.Text = Strings.Available_results;
selectedResultsLabel.Text = Strings.Selected_results;
addButton.Text = Strings.Add;
removeButton.Text = Strings.Remove;
removeAllButton.Text = Strings.Remove_all;
unlockButton.Text = Strings.UnlockBtnText;
okButton.Text = Strings.CloseBtnText;
cancelButton.Text = Strings.CancelBtnText;
}
void ResultsConfig_Load(object sender, EventArgs e)
{
Localize();
singleRadioButton.Checked = (mtrsKind == MetersKind.Single);
combinedRadioButton.Checked = (mtrsKind == MetersKind.Combined);
heatRadioButton.Checked = (mtrsKind == MetersKind.HeatMeter);
testsRowsRadioButton.Checked = (TestsArrangement == TestsArrangement.Rows);
testsColumnsRadioButton.Checked = (TestsArrangement == TestsArrangement.Columns);
horizontallyRadioButton.Checked = (MetersArrangement == MetersArrangement.Horizontally);
verticallyRadioButton.Checked = (MetersArrangement == MetersArrangement.Vertically);
nrMetersTextBox.Text = NrMetersInOneGroup.ToString();
RedrawAvailable();
RedrawSelected();
}
/// <summary>
/// Gets the list of selected items based on watermeter type and device selections
/// </summary>
/// <returns>List of selected result items</returns>
IList<Results.ItemSpec> GetSelectedItems()
{
if (mtrsKind == MetersKind.Combined)
{
switch (device)
{
default:
case Device.Screen: return RsltItems_Screen_CombinedWM;
case Device.Printer: return RsltItems_Printer_CombinedWM;
}
}
else if (mtrsKind == MetersKind.Single)
{
switch (device)
{
default:
case Device.Screen: return RsltItems_Screen_SingleWM;
case Device.Printer: return RsltItems_Printer_SingleWM;
}
}
else
{
switch (device)
{
default:
case Device.Screen: return RsltItems_Screen_HeatM;
case Device.Printer: return RsltItems_Printer_HeatM;
}
}
}
/// <summary>
/// Redraw selected items (right hand side)
/// </summary>
void RedrawAvailable()
{
availableResultsListBox.Items.Clear();
currentlyAvailableItems = new List<Results.ItemSpec>();
foreach (var item in Results.ItemSpec.AllItems)
{
if (!GetSelectedItems().Contains(item) &&
((mtrsKind == MetersKind.Single && item.CanPrintSingle) ||
(mtrsKind == MetersKind.Combined && item.CanPrintCompoundMeter) ||
(mtrsKind == MetersKind.HeatMeter && item.CanPrintHeatMeter)))
{
currentlyAvailableItems.Add(item);
availableResultsListBox.Items.Add(item.ClmnHeaderText);
}
}
}
/// <summary>
/// Redraw selected items (right hand side)
/// </summary>
void RedrawSelected()
{
selectedResultsListBox.Items.Clear();
foreach (var item in GetSelectedItems())
{
selectedResultsListBox.Items.Add(item.ClmnHeaderText);
}
}
void unlockButton_Click(object sender, EventArgs e)
{
if (!unlocked)
{
if (!Users.GlobalData.CurrentUser.IsMemberOf(RequiredGroupMembership))
{
if ((new Users.Forms.LoginDlg(RequiredGroupMembership)).ShowDialog() != DialogResult.OK)
return;
}
else if (Program.LocalSettings.AlwaysAskPasswdWhenUnlocking)
{
if ((new Users.Forms.LoginDlg(Users.GlobalData.CurrentUser.UserName, RequiredGroupMembership)).ShowDialog() != DialogResult.OK)
return;
}
if (Program.MainWnd != null) Program.MainWnd.UpdateUser();
unlocked = true;
///
/// Unlock user interface controls
///
unlockButton.Enabled = false;
okButton.Text = Strings.OkBtnText;
cancelButton.Visible = true;
testsRowsRadioButton.Enabled = true;
testsColumnsRadioButton.Enabled = true;
verticallyRadioButton.Enabled = true;
horizontallyRadioButton.Enabled = true;
availableResultsListBox.Enabled = true;
selectedResultsListBox.Enabled = true;
addButton.Enabled = true;
removeButton.Enabled = true;
removeAllButton.Enabled = true;
}
}
void okButton_Click(object sender, EventArgs e)
{
if (testsColumnsRadioButton.Checked) TestsArrangement = TestsArrangement.Columns;
else TestsArrangement = TestsArrangement.Rows;
if (horizontallyRadioButton.Checked) MetersArrangement = MetersArrangement.Horizontally;
else MetersArrangement = MetersArrangement.Vertically;
int nrInGroup;
if (int.TryParse(nrMetersTextBox.Text, out nrInGroup) && nrInGroup > 0)
{
NrMetersInOneGroup = nrInGroup;
}
DialogResult = DialogResult.OK;
Close();
}
void availableResultsListBox_DoubleClick(object sender, EventArgs e)
{
/// Double click works when just one item is selected
IList<Results.ItemSpec> itemsToRemove = new List<Results.ItemSpec>();
if (availableResultsListBox.SelectedIndices.Count == 1)
{
var item = currentlyAvailableItems[availableResultsListBox.SelectedIndices[0]];
GetSelectedItems().Add(item);
RedrawAvailable();
RedrawSelected();
}
}
void addButton_Click(object sender, EventArgs e)
{
/// Append at the end, this code supports multiple selected items,
/// although ListBox control settings may limit the max.number of selected items to one.
for (int i = availableResultsListBox.SelectedIndices.Count - 1; i >= 0; i--)
{
var item = currentlyAvailableItems[availableResultsListBox.SelectedIndices[i]];
GetSelectedItems().Add(item);
}
RedrawAvailable();
RedrawSelected();
}
private void selectedResultsListBox_DoubleClick(object sender, EventArgs e)
{
/// Double click works when just one item is selected
if (selectedResultsListBox.SelectedIndices.Count == 1)
{
GetSelectedItems().RemoveAt(selectedResultsListBox.SelectedIndices[0]);
RedrawAvailable();
RedrawSelected();
}
}
void removeButton_Click(object sender, EventArgs e)
{
/// Remove from the list (the last selected item first so that the indexes are not affected)
for (int i = selectedResultsListBox.SelectedIndices.Count - 1; i >= 0; i--)
{
GetSelectedItems().RemoveAt(selectedResultsListBox.SelectedIndices[i]);
}
RedrawAvailable();
RedrawSelected();
}
void removeAllButton_Click(object sender, EventArgs e)
{
/// Remove all items from 'Selected' list
GetSelectedItems().Clear();
RedrawAvailable();
RedrawSelected();
}
/// <summary>
/// Get 'mtrsKind' value from radio buttons
/// </summary>
/// <returns>true on 'mtrsKind' change</returns>
private bool GetMtrsKindFromRadioButtons()
{
MetersKind ori = mtrsKind;
if (singleRadioButton.Checked) mtrsKind = MetersKind.Single;
else if (combinedRadioButton.Checked) mtrsKind = MetersKind.Combined;
else if (heatRadioButton.Checked) mtrsKind = MetersKind.HeatMeter;
return (mtrsKind != ori);
}
private void singleRadioButton_CheckedChanged(object sender, EventArgs e)
{
if (GetMtrsKindFromRadioButtons())
{
RedrawAvailable();
RedrawSelected();
}
}
private void combinedRadioButton_CheckedChanged(object sender, EventArgs e)
{
if (GetMtrsKindFromRadioButtons())
{
RedrawAvailable();
RedrawSelected();
}
}
private void heatRadioButton_CheckedChanged(object sender, EventArgs e)
{
if (GetMtrsKindFromRadioButtons())
{
RedrawAvailable();
RedrawSelected();
}
}
private void screenRadioButton_CheckedChanged(object sender, EventArgs e)
{
if (screenRadioButton.Checked) device = Device.Screen;
RedrawAvailable();
RedrawSelected();
}
private void printerRadioButton_CheckedChanged(object sender, EventArgs e)
{
if (printerRadioButton.Checked) device = Device.Printer;
RedrawAvailable();
RedrawSelected();
}
}
}
+4 -5
View File
@@ -203,11 +203,10 @@ namespace TBF
public string[] RsltItems_Screen_SingleWM;
public string[] RsltItems_Screen_CombinedWM;
public string[] RsltItems_Screen_HeatM;
public string[] RsltItems_Printer_SingleWM;
public string[] RsltItems_Printer_CombinedWM;
public string[] RsltItems_Printer_HeatM;
public string[] RsltItems_Disk_SingleWM; /// Legacy, can optionally be used to initialize file writer settings
public string[] RsltItems_Disk_CombinedWM; /// Legacy, can optionally be used to initialize file writer settings
public string[] RsltItems_Printer_SingleWM; /// obsolete
public string[] RsltItems_Printer_CombinedWM; /// obsolete
public string[] RsltItems_Printer_HeatM; /// obsolete
[XmlArrayAttribute("RsltsClmnWidths")]
public int[] RsltsClmnWidths;
+2 -2
View File
@@ -54,9 +54,9 @@ namespace TBF
this.horizontalSplitContainer = new System.Windows.Forms.SplitContainer();
this.mainTabControl = new System.Windows.Forms.TabControl();
this.homeTabPage = new System.Windows.Forms.TabPage();
this.ctrlBrdComponent = new ControlComponent3Munich.UserControl1();
this.ctrlBrdComponent = new ControlComponent_Torino2015.UserControl1();
this.processTabPage = new System.Windows.Forms.TabPage();
this.processTabPageCtrl = new TBF.Screens.ProcessTabPageCtrl6();
this.processTabPageCtrl = new TBF.Screens.ProcessTabPageCtrl24();
this.insertTabPage = new System.Windows.Forms.TabPage();
this.resultsTabPage = new System.Windows.Forms.TabPage();
this.resultsTabPageCtrl = new TBF.Screens.ResultsTabPageCtrl();
+45 -2
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -7,6 +7,7 @@ using System.Globalization;
using System.Windows.Forms;
using NHibernate;
using log4net;
using Config.Entities;
using TBF.UiControls;
using TBF.BenchControl.GenericDevices;
using TBF.Resources;
@@ -34,6 +35,8 @@ namespace TBF
public IList<IValve> Valves;
public IList<IRegulValve> FeedingRegulValves;
public ISession Session; /// One common DB session passed also to the controls inside tab pages
public IList<Procedure> Procedures;
public IList<Test> Tests;
#if HEAT_METERS
private System.Windows.Forms.TabPage heatMetersTabPage;
@@ -79,6 +82,9 @@ namespace TBF
/// Create the database session for paths
Session = Config.FluentCommon.CreateSession(Users.Entities.DBKind.Config);
Procedures = Session.QueryOver<Procedure>().List();
Tests = Session.QueryOver<Test>().List();
pathsTabControl.TabPages[(int)PathsDlgTabs.Feeding].Tag = pathsFeedingCtrl;
pathsTabControl.TabPages[(int)PathsDlgTabs.Bench].Tag = pathsBenchCtrl;
pathsTabControl.TabPages[(int)PathsDlgTabs.Output].Tag = pathsOutputCtrl;
@@ -118,7 +124,6 @@ namespace TBF
this.heatMetersTabPage.ResumeLayout(false);
this.ResumeLayout(false);
pathsTabControl.TabPages[(int)PathsDlgTabs.HeatMeters].Text = Strings.Heat_meter_sensors; /// Localization
pathsTabControl.TabPages[(int)PathsDlgTabs.HeatMeters].Tag = pathsHeatMetersCtrl;
// Requires 'Session' to be created
@@ -143,6 +148,9 @@ namespace TBF
pathsTabControl.TabPages[(int)PathsDlgTabs.Bench].Text = Strings.BenchTabPageTitle;
pathsTabControl.TabPages[(int)PathsDlgTabs.Output].Text = Strings.OutputTabPageTitle;
pathsTabControl.TabPages[(int)PathsDlgTabs.WaterMeters].Text = Strings.MetersTabPageTitle;
#if HEAT_METERS
pathsTabControl.TabPages[(int)PathsDlgTabs.HeatMeters].Text = Strings.Heat_meter_sensors; /// Localization
#endif
}
private void Unlocked(object sender, EventArgs e)
@@ -155,11 +163,46 @@ namespace TBF
private void okButton_Click(object sender, EventArgs e)
{
string warnings = string.Empty;
Dictionary<string, string> renameInfo = new Dictionary<string, string>();
foreach (TabPage tab in pathsTabControl.TabPages)
{
if (tab.Tag is ITabWithListViewEx)
{
warnings += (tab.Tag as ITabWithListViewEx).GetWarningsBeforeSaving(ref renameInfo);
}
}
if (!string.IsNullOrEmpty(warnings))
{
string message = string.Format("{0}{1}{2}", warnings, Environment.NewLine,
Strings.Do_you_want_to_update_related_tests_and_procedures);
DialogResult dr = MessageBox.Show(message, Strings.Warning, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation);
if (dr == DialogResult.Cancel)
{
DialogResult = DialogResult.Cancel;
return;
}
else if (dr == DialogResult.Yes)
{
Cursor.Current = Cursors.WaitCursor;
foreach (TabPage tab in pathsTabControl.TabPages)
{
if (tab.Tag is ITabWithListViewEx) (tab.Tag as ITabWithListViewEx).UpdateRelatedItems(renameInfo);
}
}
}
Cursor.Current = Cursors.WaitCursor;
foreach (TabPage tab in pathsTabControl.TabPages)
{
(tab.Tag as ITabWithListViewEx).OkBtnClicked();
}
Cursor.Current = Cursors.Default;
Program.LocalSettings.PathsDlgLeft = Location.X;
Program.LocalSettings.PathsDlgTop = Location.Y;
Program.LocalSettings.PathsDlgWidth = Size.Width;
+1 -1
View File
@@ -940,7 +940,7 @@ namespace TBF
processListViewEx.Items.Add(lviProcess);
///
/// Process subitems FeedingPath, ...
/// Parameters subitems FeedingPath, ...
///
lviParameters.SubItems.Add(test.PumpPower.ToString("F1"));
lviParameters.SubItems.Add((test.MassRepeats < 4 ? 5 : test.MassRepeats).ToString());
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.12.555.1")]
[assembly: AssemblyFileVersion("2.12.555.1")]
[assembly: AssemblyVersion("2.12.567.1")]
[assembly: AssemblyFileVersion("2.12.567.1")]
+54
View File
@@ -78,6 +78,24 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to {0} path &apos;{1}&apos; used by {2} tests will be removed.{3}.
/// </summary>
internal static string _0_path_1_used_by_2_tests_will_be_removed_3 {
get {
return ResourceManager.GetString("_0_path_1_used_by_2_tests_will_be_removed_3", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {0} path &apos;{1}&apos; used by {2} tests will be renamed.{3}.
/// </summary>
internal static string _0_path_1_used_by_2_tests_will_be_renamed_3 {
get {
return ResourceManager.GetString("_0_path_1_used_by_2_tests_will_be_renamed_3", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {0} - wait until the tank is empty.
/// </summary>
@@ -420,6 +438,24 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Batch.
/// </summary>
internal static string Batch {
get {
return ResourceManager.GetString("Batch", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Batch nr..
/// </summary>
internal static string Batch_nr {
get {
return ResourceManager.GetString("Batch_nr", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Bench.
/// </summary>
@@ -1158,6 +1194,15 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Do you want to update related tests and procedures?.
/// </summary>
internal static string Do_you_want_to_update_related_tests_and_procedures {
get {
return ResourceManager.GetString("Do_you_want_to_update_related_tests_and_procedures", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Down.
/// </summary>
@@ -1734,6 +1779,15 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Heat meters.
/// </summary>
internal static string HeatMetersTabPageTitle {
get {
return ResourceManager.GetString("HeatMetersTabPageTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to History of changes.
/// </summary>
+4 -1
View File
@@ -1281,4 +1281,7 @@
<data name="Show" xml:space="preserve">
<value>Zobrazit</value>
</data>
</root>
<data name="Batch_nr" xml:space="preserve">
<value>Číslo dávky</value>
</data>
</root>
+6 -3
View File
@@ -466,7 +466,7 @@
<value>Schließe das Entleerventil</value>
</data>
<data name="Get_mass_of_water_in_the_tank" xml:space="preserve">
<value>Ermittle das Gewicht des Wassers im Tank</value>
<value>Ermittle das Gewicht des Wassers im Behälter</value>
</data>
<data name="Ignore" xml:space="preserve">
<value>Ignorieren</value>
@@ -475,13 +475,13 @@
<value>Laden des Prüfvorgangs</value>
</data>
<data name="Make_tank_empty" xml:space="preserve">
<value>Tank leeren</value>
<value>Behälter leeren</value>
</data>
<data name="Measure_the_mass" xml:space="preserve">
<value>wiegen</value>
</data>
<data name="Please_select_a_procedure" xml:space="preserve">
<value>Wählen Sie einen Prüfvorlage</value>
<value>Wählen Sie eine Prüfvorlage</value>
</data>
<data name="Please_select_a_test" xml:space="preserve">
<value>Bitte wählen Sie eine Prüfung aus.</value>
@@ -1416,4 +1416,7 @@
<data name="Restore" xml:space="preserve">
<value>Wiederherstellen</value>
</data>
<data name="Batch_nr" xml:space="preserve">
<value>Stapel Nr.</value>
</data>
</root>
+18
View File
@@ -1756,4 +1756,22 @@
<data name="_0_wait_until_the_tank_is_empty" xml:space="preserve">
<value>{0} - wait until the tank is empty</value>
</data>
<data name="Batch" xml:space="preserve">
<value>Batch</value>
</data>
<data name="Batch_nr" xml:space="preserve">
<value>Batch nr.</value>
</data>
<data name="HeatMetersTabPageTitle" xml:space="preserve">
<value>Heat meters</value>
</data>
<data name="_0_path_1_used_by_2_tests_will_be_removed_3" xml:space="preserve">
<value>{0} path '{1}' used by {2} tests will be removed.{3}</value>
</data>
<data name="_0_path_1_used_by_2_tests_will_be_renamed_3" xml:space="preserve">
<value>{0} path '{1}' used by {2} tests will be renamed.{3}</value>
</data>
<data name="Do_you_want_to_update_related_tests_and_procedures" xml:space="preserve">
<value>Do you want to update related tests and procedures?</value>
</data>
</root>
+97 -185
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -23,17 +23,10 @@ namespace TBF.Screens
public TestsArrangement TestsArrangement;
public int NrMetersInOneGroup;
public IList<Results.ItemSpec> RsltItems_Screen_SingleWM;
public IList<Results.ItemSpec> RsltItems_Screen_CombinedWM;
public IList<Results.ItemSpec> RsltItems_Screen_HeatM;
public IList<Results.ItemSpec> RsltItems_Printer_SingleWM;
public IList<Results.ItemSpec> RsltItems_Printer_CombinedWM;
public IList<Results.ItemSpec> RsltItems_Printer_HeatM;
public IList<Results.ItemSpec> RsltItems_Disk_SingleWM;
public IList<Results.ItemSpec> RsltItems_Disk_CombinedWM;
public IList<Results.WMeterRsltItemSpec> RsltItems_Screen_SingleWM;
public IList<Results.WMeterRsltItemSpec> RsltItems_Screen_CombinedWM;
public IList<Results.WMeterRsltItemSpec> RsltItems_Screen_HeatM;
Procedure procedure;
IList<TestResult> testResults;
MetersKind metersKind;
ListView firstListView;
@@ -97,59 +90,71 @@ namespace TBF.Screens
MetersArrangement = Program.LocalSettings.ResultsConfigMeters;
TestsArrangement = Program.LocalSettings.ResultsConfigTests;
NrMetersInOneGroup = Math.Max(1, Program.LocalSettings.ResultsConfigMetersInOneGroup);
RsltItems_Screen_SingleWM = Results.ItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Screen_SingleWM);
RsltItems_Screen_CombinedWM = Results.ItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Screen_CombinedWM);
RsltItems_Screen_HeatM = Results.ItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Screen_HeatM);
RsltItems_Printer_SingleWM = Results.ItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Printer_SingleWM);
RsltItems_Printer_CombinedWM = Results.ItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Printer_CombinedWM);
RsltItems_Printer_HeatM = Results.ItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Printer_HeatM);
RsltItems_Screen_SingleWM = Results.WMeterRsltItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Screen_SingleWM);
RsltItems_Screen_CombinedWM = Results.WMeterRsltItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Screen_CombinedWM);
RsltItems_Screen_HeatM = Results.WMeterRsltItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Screen_HeatM);
RedrawAll(TBF.BenchControl.Sequences.ProcessData.BatchRslts);
}
IList<Results.WMeterRsltItemSpec> GetRsltItems(MetersKind metersKind)
{
IList<Results.WMeterRsltItemSpec> srcItems;
switch (metersKind)
{
default:
case MetersKind.Single: srcItems = RsltItems_Screen_SingleWM; break;
case MetersKind.Combined: srcItems = RsltItems_Screen_CombinedWM; break;
case MetersKind.HeatMeter: srcItems = RsltItems_Screen_HeatM; break;
}
IList<Results.WMeterRsltItemSpec> copiedItems = new List<Results.WMeterRsltItemSpec>();
foreach (var it in srcItems) copiedItems.Add(it.Clone());
return copiedItems;
}
/// <summary>
/// Invoke a configuration dialog
/// </summary>
private void configureButton_Click(object sender, EventArgs e)
{
TBF.Forms.ResultsConfig dlg = new TBF.Forms.ResultsConfig(metersKind);
TBF.Forms.ResultsArrangementDlg dlg = new TBF.Forms.ResultsArrangementDlg();
dlg.MetersKind = metersKind;
dlg.TestsArrangement = TestsArrangement;
dlg.MetersArrangement = MetersArrangement;
dlg.NrMetersInOneGroup = NrMetersInOneGroup;
dlg.SelectedItems = GetRsltItems(metersKind);
dlg.RsltItems_Screen_SingleWM = RsltItems_Screen_SingleWM;
dlg.RsltItems_Screen_CombinedWM = RsltItems_Screen_CombinedWM;
dlg.RsltItems_Screen_HeatM = RsltItems_Screen_HeatM;
dlg.RsltItems_Printer_SingleWM = RsltItems_Printer_SingleWM;
dlg.RsltItems_Printer_CombinedWM = RsltItems_Printer_CombinedWM;
dlg.RsltItems_Printer_HeatM = RsltItems_Printer_HeatM;
if (DialogResult.OK == dlg.ShowDialog())
DialogResult dr = dlg.ShowDialog();
if (dr == DialogResult.OK && dlg.Unlocked)
{
MetersArrangement = dlg.MetersArrangement;
TestsArrangement = dlg.TestsArrangement;
NrMetersInOneGroup = dlg.NrMetersInOneGroup;
Program.LocalSettings.ResultsConfigMeters = MetersArrangement = dlg.MetersArrangement;;
Program.LocalSettings.ResultsConfigTests = TestsArrangement = dlg.TestsArrangement;
Program.LocalSettings.ResultsConfigMetersInOneGroup = NrMetersInOneGroup = dlg.NrMetersInOneGroup;
RsltItems_Screen_SingleWM = dlg.RsltItems_Screen_SingleWM;
RsltItems_Screen_CombinedWM = dlg.RsltItems_Screen_CombinedWM;
RsltItems_Screen_HeatM = dlg.RsltItems_Screen_HeatM;
RsltItems_Printer_SingleWM = dlg.RsltItems_Printer_SingleWM;
RsltItems_Printer_CombinedWM = dlg.RsltItems_Printer_CombinedWM;
RsltItems_Printer_HeatM = dlg.RsltItems_Printer_HeatM;
switch (metersKind)
{
default:
case MetersKind.Single:
RsltItems_Screen_SingleWM = dlg.SelectedItems;
Program.LocalSettings.RsltItems_Screen_SingleWM = Results.WMeterRsltItemSpec.ToStrArray(RsltItems_Screen_SingleWM);
break;
case MetersKind.Combined:
RsltItems_Screen_CombinedWM = dlg.SelectedItems;
Program.LocalSettings.RsltItems_Screen_CombinedWM = Results.WMeterRsltItemSpec.ToStrArray(RsltItems_Screen_CombinedWM);
break;
case MetersKind.HeatMeter:
RsltItems_Screen_HeatM = dlg.SelectedItems;
Program.LocalSettings.RsltItems_Screen_HeatM = Results.WMeterRsltItemSpec.ToStrArray(RsltItems_Screen_HeatM);
break;
}
Program.LocalSettings.ResultsConfigMeters = MetersArrangement;
Program.LocalSettings.ResultsConfigTests = TestsArrangement;
Program.LocalSettings.ResultsConfigMetersInOneGroup = NrMetersInOneGroup;
Program.LocalSettings.RsltItems_Screen_SingleWM = Results.ItemSpec.ToStrArray(RsltItems_Screen_SingleWM);
Program.LocalSettings.RsltItems_Screen_CombinedWM = Results.ItemSpec.ToStrArray(RsltItems_Screen_CombinedWM);
Program.LocalSettings.RsltItems_Screen_HeatM = Results.ItemSpec.ToStrArray(RsltItems_Screen_HeatM);
Program.LocalSettings.RsltItems_Printer_SingleWM = Results.ItemSpec.ToStrArray(RsltItems_Printer_SingleWM);
Program.LocalSettings.RsltItems_Printer_CombinedWM = Results.ItemSpec.ToStrArray(RsltItems_Printer_CombinedWM);
Program.LocalSettings.RsltItems_Printer_HeatM = Results.ItemSpec.ToStrArray(RsltItems_Printer_HeatM);
Program.LocalSettings.Save();
}
RedrawAll(TBF.BenchControl.Sequences.ProcessData.BatchRslts);
}
@@ -188,7 +193,7 @@ namespace TBF.Screens
}
int metersInOneGroup = Math.Max(1, Math.Min(enabledWMsCount, NrMetersInOneGroup));
int nrGroups = Math.Max(1, (enabledWMsCount + NrMetersInOneGroup - 1) / metersInOneGroup);
int nrGroups = Math.Max(1, (enabledWMsCount + metersInOneGroup - 1) / metersInOneGroup);
if (MetersArrangement == MetersArrangement.Horizontally)
{
@@ -294,25 +299,18 @@ namespace TBF.Screens
ListView lview = GetListView();
IList<Results.ItemSpec> items;
switch (metersKind)
{
default:
case MetersKind.Single: items = RsltItems_Screen_SingleWM; break;
case MetersKind.Combined: items = RsltItems_Screen_CombinedWM; break;
case MetersKind.HeatMeter: items = RsltItems_Screen_HeatM; break;
}
IList<Results.WMeterRsltItemSpec> items = GetRsltItems(metersKind);
if (items == null || items.Count == 0) return lview;
// Header
TBF.LocalSettings ls = Program.LocalSettings;
lview.Columns.Add(printedWMNr.ToString(), (ls.RsltsClmnCount > 0) ? ls.RsltsClmnWidths[0] : 40);
int i = 1;
int col = 1;
foreach (var item in items)
{
lview.Columns.Add(item.ClmnHeaderText, (ls.RsltsClmnCount > i) ? ls.RsltsClmnWidths[i] : 70);
i++;
lview.Columns.Add(item.Caption, (ls.RsltsClmnCount > col) ? ls.RsltsClmnWidths[col] : 70);
col++;
}
@@ -320,38 +318,21 @@ namespace TBF.Screens
int ix = 0;
foreach (var mtr in wMtr.MeterTestRslts)
{
if ((mtr.CompoundMeterId == (byte)CompoundMeterId.Single
|| mtr.CompoundMeterId == (byte)CompoundMeterId.Compound
|| mtr.CompoundMeterId == (byte)CompoundMeterId.HeatMeterEnergy)
&& mtr.TestDone
&& (mtr.Publish() != Config.Entities.Publish.Never)
&& (mtr.Publish() != Config.Entities.Publish.Internal))
{
if (mtr != null &&
(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)
{
ListViewItem lvi = new ListViewItem(testNames[ix++]);
foreach (var item in items)
for (int i = 0; i < items.Count; i++)
{
string str;
if (metersKind == MetersKind.Combined)
{
var main = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
var aux = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
str = (item.CanPrintCompoundMeter && main != null && aux != null)
? item.PrintCombined(main, aux, mtr)
: string.Empty;
}
else if (metersKind == MetersKind.HeatMeter)
{
var volumeMtr = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.HeatMeterVolume);
str = (item.CanPrintHeatMeter && volumeMtr != null)
? item.PrintHeatMeter(volumeMtr, mtr)
: string.Empty;
}
else /// MetersKind.Single, default
{
str = item.CanPrintSingle ? item.Print(mtr) : string.Empty;
}
string str = items[i].Print(wMtr, mtr.Name());
/// Extract and use color information
string[] texts = str.Split(new char[] { '|' });
if (texts.Length == 1)
{
@@ -389,14 +370,8 @@ namespace TBF.Screens
ListView lview = GetListView();
IList<Results.ItemSpec> items;
switch (metersKind)
{
default:
case MetersKind.Single: items = RsltItems_Screen_SingleWM; break;
case MetersKind.Combined: items = RsltItems_Screen_CombinedWM; break;
case MetersKind.HeatMeter: items = RsltItems_Screen_HeatM; break;
}
IList<Results.WMeterRsltItemSpec> items = GetRsltItems(metersKind);
if (items == null || items.Count == 0) return lview;
// Header
@@ -411,102 +386,39 @@ namespace TBF.Screens
foreach (var item in items)
{
ListViewItem lvi = new ListViewItem(item.ClmnHeaderText);
if (metersKind == MetersKind.Combined)
{
foreach (var mtr in wMtr.MeterTestRslts)
{
if (mtr.CompoundMeterId == (byte)CompoundMeterId.Compound && mtr.TestDone
&& (mtr.Publish() != Config.Entities.Publish.Never)
&& (mtr.Publish() != Config.Entities.Publish.Internal))
ListViewItem lvi = new ListViewItem(item.Caption);
foreach (var mtr in wMtr.MeterTestRslts)
{
if (mtr != null &&
(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)
{
string str = items[i].Print(wMtr, mtr.Name());
string[] texts = str.Split(new char[] { '|' });
if (texts.Length == 1)
{
var main = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
var aux = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
string str = (item.CanPrintCompoundMeter && main != null && aux != null)
? item.PrintCombined(main, aux, mtr)
: string.Empty;
string[] texts = str.Split(new char[] { '|' });
if (texts.Length == 1)
{
lvi.SubItems.Add(str);
}
else if (texts.Length == 2)
{
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
lvi.UseItemStyleForSubItems = false;
lvi.SubItems.Add(texts[0]);
lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
}
else
{
lvi.SubItems.Add(string.Empty);
}
lvi.SubItems.Add(str);
}
else if (texts.Length == 2)
{
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
lvi.UseItemStyleForSubItems = false;
lvi.SubItems.Add(texts[0]);
lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
}
else
{
lvi.SubItems.Add(string.Empty);
}
}
}
else if (metersKind == MetersKind.HeatMeter)
{
foreach (var mtr in wMtr.MeterTestRslts)
{
if (mtr.CompoundMeterId == (byte)CompoundMeterId.HeatMeterEnergy && mtr.TestDone
&& (mtr.Publish() != Config.Entities.Publish.Never)
&& (mtr.Publish() != Config.Entities.Publish.Internal))
{
var volumeMtr = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.HeatMeterVolume);
}
string str = (item.CanPrintHeatMeter && volumeMtr != null)
? item.PrintHeatMeter(volumeMtr, mtr)
: string.Empty;
string[] texts = str.Split(new char[] { '|' });
if (texts.Length == 1)
{
lvi.SubItems.Add(str);
}
else if (texts.Length == 2)
{
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
lvi.UseItemStyleForSubItems = false;
lvi.SubItems.Add(texts[0]);
lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
}
else
{
lvi.SubItems.Add(string.Empty);
}
}
}
}
else /// MetersKind.Single, default
{
foreach (var mtr in wMtr.MeterTestRslts)
{
if (mtr.TestDone && (mtr.Publish() != Config.Entities.Publish.Never)
&& (mtr.Publish() != Config.Entities.Publish.Internal))
{
string str = !item.CanPrintSingle ? string.Empty : item.Print(mtr);
string[] texts = str.Split(new char[] { '|' });
if (texts.Length == 1)
{
lvi.SubItems.Add(str);
}
else if (texts.Length == 2)
{
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
lvi.UseItemStyleForSubItems = false;
lvi.SubItems.Add(texts[0]);
lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
}
else
{
lvi.SubItems.Add(string.Empty);
}
}
}
}
lview.Items.Add(lvi);
}
+12 -26
View File
@@ -39,7 +39,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;STABLE_MASS_EXTRAS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -49,7 +49,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;MUNICH</DefineConstants>
<DefineConstants>TRACE;SLM_50;HEAT_METERS;LANG_SK;STABLE_MASS_EXTRAS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
@@ -58,7 +58,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
<DefineConstants>TRACE;DEBUG;SLM_50;HEAT_METERS;LANG_SK;STABLE_MASS_EXTRAS</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
@@ -67,7 +67,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;MUNICH</DefineConstants>
<DefineConstants>TRACE;SLM_50;HEAT_METERS;LANG_SK;STABLE_MASS_EXTRAS</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
@@ -97,8 +97,9 @@
<SignManifests>false</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="ControlComponent3Munich">
<HintPath>..\packages\ControlBoard\Munich\ControlComponent3Munich.dll</HintPath>
<Reference Include="ControlComponent3U, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\ControlBoard\SLM-PT50\ControlComponent3U.dll</HintPath>
</Reference>
<Reference Include="FluentNHibernate">
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
@@ -1204,18 +1205,6 @@
<Compile Include="BenchControl\Operations\SetAllRegulValvesOp.cs" />
<Compile Include="BenchControl\OutputPath.cs" />
<Compile Include="BenchControl\ProcedureParamsBase.cs" />
<Compile Include="BenchControl\ResultsPrinters\Basic\Printer.cs" />
<Compile Include="BenchControl\ResultsPrinters\Basic\PrinterCfg.cs" />
<Compile Include="BenchControl\ResultsPrinters\Basic\PrinterCfgCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="BenchControl\ResultsPrinters\Basic\PrinterCfgCtrl.Designer.cs">
<DependentUpon>PrinterCfgCtrl.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\ResultsPrinters\Basic\PrinterFactory.cs" />
<Compile Include="BenchControl\ResultsPrinters\Basic\BasicPrintDocument.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="BenchControl\ResultsPrinters\Munich\Printer.cs" />
<Compile Include="BenchControl\ResultsPrinters\Munich\PrinterCfg.cs" />
<Compile Include="BenchControl\ResultsPrinters\Munich\PrinterCfgCtrl.cs">
@@ -1305,11 +1294,11 @@
<Compile Include="Forms\PrintOrderForm.Designer.cs">
<DependentUpon>PrintOrderForm.cs</DependentUpon>
</Compile>
<Compile Include="Forms\ResultsConfig.cs">
<Compile Include="Forms\ResultsArrangementDlg.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\ResultsConfig.Designer.cs">
<DependentUpon>ResultsConfig.cs</DependentUpon>
<Compile Include="Forms\ResultsArrangementDlg.Designer.cs">
<DependentUpon>ResultsArrangementDlg.cs</DependentUpon>
</Compile>
<Compile Include="Forms\TabNameDlg.cs">
<SubType>Form</SubType>
@@ -2024,9 +2013,6 @@
<EmbeddedResource Include="BenchControl\Output\Printers\Enhanced\PrinterCfgCtrl.resx">
<DependentUpon>PrinterCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\ResultsPrinters\Basic\PrinterCfgCtrl.resx">
<DependentUpon>PrinterCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\ResultsPrinters\Cevak\PrinterCfgCtrl.resx">
<DependentUpon>PrinterCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
@@ -2147,8 +2133,8 @@
<EmbeddedResource Include="Forms\PrintOrderForm.resx">
<DependentUpon>PrintOrderForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\ResultsConfig.resx">
<DependentUpon>ResultsConfig.cs</DependentUpon>
<EmbeddedResource Include="Forms\ResultsArrangementDlg.resx">
<DependentUpon>ResultsArrangementDlg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\TabNameDlg.resx">
<DependentUpon>TabNameDlg.cs</DependentUpon>
+187 -4
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -28,6 +28,12 @@ namespace TBF
/// </summary>
public ISession Session;
IList<Procedure> procedures;
IList<Test> tests;
Dictionary<string, string> renameInfo; /// Pairs original name / new name
/// <summary>
/// Transition sequences to be updated by this dialog.
/// Set by the constructor or updated by the parent after creation and before loading.
@@ -96,13 +102,24 @@ namespace TBF
/// Note: Each sequence (in both sequences together) has a unique ItemNr (0 .. N-1)
TransitionSequences = Session.QueryOver<TransitionSequence>().OrderBy(x => x.ItemNr).Asc.List();
VirtualBenchSequences = Session.QueryOver<VirtualBenchSequence>().OrderBy(x => x.ItemNr).Asc.List();
procedures = Session.QueryOver<Procedure>().List();
tests = Session.QueryOver<Test>().List();
RemovedTransitionSequences = new List<TransitionSequence>();
RemovedVirtualBenchSequences = new List<VirtualBenchSequence>();
/// Create a tab with sequence steps for each sequence ordered by ItemNr.
foreach (var transSeq in TransitionSequences) AddTransitionSeqTab(transSeq);
foreach (var vBenchSeq in VirtualBenchSequences) AddVirtualBenchSeqTab(vBenchSeq);
foreach (var transSeq in TransitionSequences)
{
transSeq.OriName = transSeq.Name;
AddTransitionSeqTab(transSeq);
}
foreach (var vBenchSeq in VirtualBenchSequences)
{
vBenchSeq.OriName = vBenchSeq.Name;
AddVirtualBenchSeqTab(vBenchSeq);
}
}
void AddTransitionSeqTab(TransitionSequence sequence)
@@ -271,14 +288,175 @@ namespace TBF
}
}
void RetrieveData()
{
if (seqStepsCtrls.Count > slctdTab) seqStepsCtrls[slctdTab].OkBtnClicked();
}
string GetWarningsBeforeSaving(ref Dictionary<string, string> renmInfo)
{
string warnings = string.Empty;
renmInfo = new Dictionary<string, string>();
foreach (var seq in RemovedTransitionSequences)
{
if (!string.IsNullOrEmpty(seq.OriName))
{
int occurances = 0;
foreach (var test in tests)
{
if (!string.IsNullOrEmpty(test.RelTransBefore) && test.RelTransBefore == seq.OriName) occurances++;
if (!string.IsNullOrEmpty(test.TransitionAfter) && test.TransitionAfter == seq.OriName) occurances++;
}
foreach (var proc in procedures)
{
if (!string.IsNullOrEmpty(proc.TransitionStart) && proc.TransitionStart == seq.OriName) occurances++;
if (!string.IsNullOrEmpty(proc.TransitionEnd) && proc.TransitionEnd == seq.OriName) occurances++;
}
if (occurances > 0)
{
warnings += string.Format("Deleting transition sequence {0} used in {1} tests and procedures{2}", seq.OriName, occurances, Environment.NewLine);
renmInfo.Add(seq.OriName, string.Empty);
}
}
}
foreach (var seq in RemovedVirtualBenchSequences)
{
if (!string.IsNullOrEmpty(seq.OriName))
{
int occurances = 0;
foreach (var test in tests)
{
if (!string.IsNullOrEmpty(test.RelTransBefore) && test.RelTransBefore == seq.OriName) occurances++;
if (!string.IsNullOrEmpty(test.TransitionAfter) && test.TransitionAfter == seq.OriName) occurances++;
}
foreach (var proc in procedures)
{
if (!string.IsNullOrEmpty(proc.TransitionStart) && proc.TransitionStart == seq.OriName) occurances++;
if (!string.IsNullOrEmpty(proc.TransitionEnd) && proc.TransitionEnd == seq.OriName) occurances++;
}
if (occurances > 0)
{
warnings += string.Format("Deleting virtual bench sequence {0} used in {1} tests and procedures{2}", seq.OriName, occurances, Environment.NewLine);
renmInfo.Add(seq.OriName, string.Empty);
}
}
}
foreach (var seq in TransitionSequences)
{
if (!string.IsNullOrEmpty(seq.OriName) && seq.OriName != seq.Name)
{
int occurances = 0;
foreach (var test in tests)
{
if (!string.IsNullOrEmpty(test.RelTransBefore) && test.RelTransBefore == seq.OriName) occurances++;
if (!string.IsNullOrEmpty(test.TransitionAfter) && test.TransitionAfter == seq.OriName) occurances++;
}
foreach (var proc in procedures)
{
if (!string.IsNullOrEmpty(proc.TransitionStart) && proc.TransitionStart == seq.OriName) occurances++;
if (!string.IsNullOrEmpty(proc.TransitionEnd) && proc.TransitionEnd == seq.OriName) occurances++;
}
if (occurances > 0)
{
warnings += string.Format("Renaming transition sequence {0} used in {1} tests and procedures{2}", seq.OriName, occurances, Environment.NewLine);
renmInfo.Add(seq.OriName, seq.Name);
}
}
}
foreach (var seq in VirtualBenchSequences)
{
if (!string.IsNullOrEmpty(seq.OriName) && seq.OriName != seq.Name)
{
int occurances = 0;
foreach (var test in tests)
{
if (!string.IsNullOrEmpty(test.RelTransBefore) && test.RelTransBefore == seq.OriName) occurances++;
if (!string.IsNullOrEmpty(test.TransitionAfter) && test.TransitionAfter == seq.OriName) occurances++;
}
foreach (var proc in procedures)
{
if (!string.IsNullOrEmpty(proc.TransitionStart) && proc.TransitionStart == seq.OriName) occurances++;
if (!string.IsNullOrEmpty(proc.TransitionEnd) && proc.TransitionEnd == seq.OriName) occurances++;
}
if (occurances > 0)
{
warnings += string.Format("Renaming virtual bench sequence {0} used in {1} tests and procedures{2}", seq.OriName, occurances, Environment.NewLine);
renmInfo.Add(seq.OriName, seq.Name);
}
}
}
return warnings;
}
private void okButton_Click(object sender, EventArgs e)
{
if (seqStepsCtrls.Count > slctdTab) seqStepsCtrls[slctdTab].OkBtnClicked();
RetrieveData();
string warnings = GetWarningsBeforeSaving(ref renameInfo);
bool updateRelatedItems = false;
if (!string.IsNullOrEmpty(warnings))
{
string message = string.Format("{0}{1}{2}", warnings, Environment.NewLine,
Strings.Do_you_want_to_update_related_tests_and_procedures);
DialogResult dr = MessageBox.Show(message, Strings.Warning, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation);
if (dr == DialogResult.Cancel)
{
DialogResult = DialogResult.Cancel;
return;
}
else if (dr == DialogResult.Yes)
{
updateRelatedItems = true;
}
}
Cursor.Current = Cursors.WaitCursor;
using (var transaction = Session.BeginTransaction())
{
try
{
if (updateRelatedItems)
{
foreach (var item in tests)
{
bool updated = false;
string newSeqName;
if (!string.IsNullOrEmpty(item.RelTransBefore) && renameInfo.TryGetValue(item.RelTransBefore, out newSeqName))
{
item.RelTransBefore = newSeqName;
updated = true;
}
if (!string.IsNullOrEmpty(item.TransitionAfter) && renameInfo.TryGetValue(item.TransitionAfter, out newSeqName))
{
item.TransitionAfter = newSeqName;
updated = true;
}
if (updated) Session.SaveOrUpdate(item);
}
foreach (var item in procedures)
{
bool updated = false;
string newSeqName;
if (!string.IsNullOrEmpty(item.TransitionStart) && renameInfo.TryGetValue(item.TransitionStart, out newSeqName))
{
item.TransitionStart = newSeqName;
updated = true;
}
if (!string.IsNullOrEmpty(item.TransitionEnd) && renameInfo.TryGetValue(item.TransitionEnd, out newSeqName))
{
item.TransitionEnd = newSeqName;
updated = true;
}
if (updated) Session.SaveOrUpdate(item);
}
}
foreach (var transSeq in RemovedTransitionSequences)
{
foreach (var step in transSeq.TransitionSteps) Session.Delete(step);
@@ -307,11 +485,14 @@ namespace TBF
}
catch (Exception e2)
{
Cursor.Current = Cursors.Default;
MessageBox.Show(Strings.Cannot_save_changes, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
log.ErrorFormat("Update of sequences in the database failed: {0}", e2.Message);
}
}
Cursor.Current = Cursors.Default;
Program.LocalSettings.TransitionsDlgLeft = Location.X;
Program.LocalSettings.TransitionsDlgTop = Location.Y;
Program.LocalSettings.TransitionsDlgWidth = Size.Width;
@@ -336,6 +517,8 @@ namespace TBF
return;
}
int slctdTab;
private void tabControl_SelectedIndexChanged(object sender, EventArgs e)
@@ -117,22 +117,13 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="stopBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>116, 168</value>
</data>
<data name="stopBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>82, 70</value>
</data>
<data name="startTestBtn.Text" xml:space="preserve">
<value>Spustit test</value>
</data>
<data name="startCycleBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>102, 70</value>
</data>
<data name="startCycleBtn.Text" xml:space="preserve">
<value>Spustit cyklus</value>
<value>Spustit postup</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="purgeBeginBtn.Font" type="System.Drawing.Font, System.Drawing">
<value>Verdana, 12pt</value>
</data>
@@ -145,27 +136,15 @@
<data name="purgeEndBtn.Text" xml:space="preserve">
<value>Vypustit</value>
</data>
<data name="breakBtn.Font" type="System.Drawing.Font, System.Drawing">
<value>Verdana, 11.25pt</value>
</data>
<data name="breakBtn.Text" xml:space="preserve">
<value>Přestávka</value>
</data>
<data name="resetResultsBtn.Font" type="System.Drawing.Font, System.Drawing">
<value>Verdana, 9.75pt</value>
<value>Zrušit</value>
</data>
<data name="resetResultsBtn.Text" xml:space="preserve">
<value>Zamítnout</value>
</data>
<data name="cameraTestBtn.Font" type="System.Drawing.Font, System.Drawing">
<value>Verdana, 11.25pt</value>
</data>
<data name="cameraTestBtn.Text" xml:space="preserve">
<value>Test kamery</value>
</data>
<data name="sensitivityTestBtn.Font" type="System.Drawing.Font, System.Drawing">
<value>Verdana, 11.25pt</value>
</data>
<data name="sensitivityTestBtn.Text" xml:space="preserve">
<value>Citlivost</value>
</data>
@@ -181,13 +160,13 @@
<data name="otherGroupBox.Text" xml:space="preserve">
<value>Pomocné funkce</value>
</data>
<data name="acceptResultsBtn.Font" type="System.Drawing.Font, System.Drawing">
<value>Verdana, 9.75pt</value>
</data>
<data name="acceptResultsBtn.Text" xml:space="preserve">
<value>Akceptovat</value>
<value>Uložit a ukončit</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Výsledky</value>
</data>
<data name="testGroupBox.Text" xml:space="preserve">
<value>Relace</value>
</data>
</root>
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -17,5 +17,7 @@ namespace TBF.UiControls
void RemoveSelected();
void MoveUpSelected();
void MoveDownSelected();
}
string GetWarningsBeforeSaving(ref Dictionary<string, string> renameInfo);
void UpdateRelatedItems(Dictionary<string, string> renameInfo);
}
}
@@ -346,5 +346,14 @@ namespace TBF.UiControls
correctedTextBox.Text = corrected.ToString();
}
}
}
public string GetWarningsBeforeSaving(ref Dictionary<string, string> renmInfo)
{
return string.Empty;
}
public void UpdateRelatedItems(Dictionary<string, string> renameInfo)
{
}
}
}
@@ -105,5 +105,14 @@ namespace TBF.UiControls
public void MoveDownSelected()
{
}
}
public string GetWarningsBeforeSaving(ref Dictionary<string, string> renmInfo)
{
return string.Empty;
}
public void UpdateRelatedItems(Dictionary<string, string> renameInfo)
{
}
}
}
@@ -327,5 +327,14 @@ namespace TBF.UiControls
correctedTextBox.Text = corrected.ToString();
}
}
}
public string GetWarningsBeforeSaving(ref Dictionary<string, string> renmInfo)
{
return string.Empty;
}
public void UpdateRelatedItems(Dictionary<string, string> renameInfo)
{
}
}
}
@@ -217,6 +217,15 @@ namespace TBF.UiControls
public void MoveDownSelected()
{
}
public string GetWarningsBeforeSaving(ref Dictionary<string, string> renmInfo)
{
return string.Empty;
}
public void UpdateRelatedItems(Dictionary<string, string> renameInfo)
{
}
}
}
@@ -277,5 +277,14 @@ namespace TBF.UiControls
correctedTextBox.Text = corrected.ToString();
}
}
}
public string GetWarningsBeforeSaving(ref Dictionary<string, string> renmInfo)
{
return string.Empty;
}
public void UpdateRelatedItems(Dictionary<string, string> renameInfo)
{
}
}
}
+82 -28
View File
@@ -1,6 +1,7 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
@@ -9,6 +10,7 @@ using log4net;
using TBF.BenchControl;
using TBF.BenchControl.GenericDevices;
using TBF.Resources;
using NHibernate;
namespace TBF.UiControls
{
@@ -54,6 +56,8 @@ namespace TBF.UiControls
.OrderBy(x => x.ItemNr).Asc
.List();
foreach (var path in MyItems) path.OriName = path.Name;
SubItemClicked += new Results.Forms.SubItemEventHandler(listViewEx_SubItemClicked);
SubItemRightClicked += new Results.Forms.SubItemEventHandler(listViewEx_SubItemRightClicked);
SubItemEndEditing += new Results.Forms.SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing);
@@ -272,32 +276,6 @@ namespace TBF.UiControls
entity.ValvesClose = valvesClose;
}
/// <summary>
/// Update the entities and save them to the database
/// </summary>
public new void OkBtnClicked()
{
base.OkBtnClicked();
/// Update the database
foreach (var entity in ToBeRemovedItems)
{
Config.FluentCommon.DeleteFromDb(parent.Session, entity);
}
foreach (var entity in MyItems)
{
Config.FluentCommon.SaveToDb(parent.Session, entity);
}
/// Update the column widths
Program.LocalSettings.BenchColumnWidths = new int[Columns.Count];
for (int i = 0; i < Columns.Count; i++)
{
Program.LocalSettings.BenchColumnWidths[i] = Columns[i].Width;
}
Program.LocalSettings.Save();
}
public void AddOne()
{
Config.Entities.BenchPath entity;
@@ -331,5 +309,81 @@ namespace TBF.UiControls
parent.UpdateButtonStates(SharedButtons.SelectedItemPos.None);
}
}
}
public string GetWarningsBeforeSaving(ref Dictionary<string, string> renmInfo)
{
base.OkBtnClicked(); /// = UpdateAll()
string warnings = string.Empty;
foreach (var entity in ToBeRemovedItems)
{
if (!string.IsNullOrEmpty(entity.OriName))
{
int occurances = 0;
foreach (var tst in parent.Tests) if (!string.IsNullOrEmpty(tst.BenchPath) && tst.BenchPath.Equals(entity.OriName)) occurances++;
if (occurances > 0)
{
warnings += string.Format(Strings._0_path_1_used_by_2_tests_will_be_removed_3, Strings.BenchTabPageTitle, entity.Name, occurances, Environment.NewLine);
}
}
}
foreach (var entity in MyItems)
{
if (!string.IsNullOrEmpty(entity.OriName) && entity.OriName != entity.Name)
{
int occurances = 0;
foreach (var tst in parent.Tests) if (!string.IsNullOrEmpty(tst.BenchPath) && tst.BenchPath.Equals(entity.OriName)) occurances++;
if (occurances > 0)
{
warnings += string.Format(Strings._0_path_1_used_by_2_tests_will_be_renamed_3, Strings.BenchTabPageTitle, entity.Name, occurances, Environment.NewLine);
}
}
}
return warnings;
}
public void UpdateRelatedItems(Dictionary<string, string> renameInfo)
{
foreach (var tst in parent.Tests)
{
string newPathName;
if (!string.IsNullOrEmpty(tst.BenchPath) && renameInfo.TryGetValue(tst.BenchPath, out newPathName))
{
tst.BenchPath = newPathName;
Config.FluentCommon.SaveToDb(parent.Session, tst);
}
}
}
/// <summary>
/// Update the entities and save them to the database
/// </summary>
public new void OkBtnClicked()
{
base.OkBtnClicked();
/// Update the database
foreach (var entity in ToBeRemovedItems)
{
Config.FluentCommon.DeleteFromDb(parent.Session, entity);
}
foreach (var entity in MyItems)
{
Config.FluentCommon.SaveToDb(parent.Session, entity);
}
/// Update the column widths
Program.LocalSettings.BenchColumnWidths = new int[Columns.Count];
for (int i = 0; i < Columns.Count; i++)
{
Program.LocalSettings.BenchColumnWidths[i] = Columns[i].Width;
}
Program.LocalSettings.Save();
}
}
}
@@ -1,6 +1,7 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
@@ -51,6 +52,8 @@ namespace TBF.UiControls
.OrderBy(x => x.ItemNr).Asc
.List();
foreach (var path in MyItems) path.OriName = path.Name;
SubItemClicked += new Results.Forms.SubItemEventHandler(listViewEx_SubItemClicked);
SubItemRightClicked += new Results.Forms.SubItemEventHandler(listViewEx_SubItemRightClicked);
SubItemEndEditing += new Results.Forms.SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing);
@@ -281,33 +284,6 @@ namespace TBF.UiControls
entity.ValvesClose = valvesClose;
}
/// <summary>
/// Update the entities and save them to the database
/// </summary>
public new void OkBtnClicked()
{
base.OkBtnClicked();
/// Update the database
foreach (var entity in ToBeRemovedItems)
{
Config.FluentCommon.DeleteFromDb(parent.Session, entity);
}
foreach (var entity in MyItems)
{
Config.FluentCommon.SaveToDb(parent.Session, entity);
}
parent.Session.Flush();
/// Update the column widths
Program.LocalSettings.FeedingColumnWidths = new int[Columns.Count];
for (int i = 0; i < Columns.Count; i++)
{
Program.LocalSettings.FeedingColumnWidths[i] = Columns[i].Width;
}
Program.LocalSettings.Save();
}
public void AddOne()
{
Config.Entities.FeedingPath entity;
@@ -341,5 +317,84 @@ namespace TBF.UiControls
parent.UpdateButtonStates(SharedButtons.SelectedItemPos.None);
}
}
}
public string GetWarningsBeforeSaving(ref Dictionary<string, string> renmInfo)
{
base.OkBtnClicked(); /// = UpdateAll()
string warnings = string.Empty;
foreach (var entity in ToBeRemovedItems)
{
if (!string.IsNullOrEmpty(entity.OriName))
{
int occurances = 0;
foreach (var tst in parent.Tests) if (!string.IsNullOrEmpty(tst.FeedingPath) && tst.FeedingPath.Equals(entity.OriName)) occurances++;
if (occurances > 0)
{
warnings += string.Format(Strings._0_path_1_used_by_2_tests_will_be_removed_3, Strings.FeedingTabPageTitle, entity.Name, occurances, Environment.NewLine);
renmInfo.Add(entity.OriName, string.Empty);
}
}
}
foreach (var entity in MyItems)
{
if (!string.IsNullOrEmpty(entity.OriName) && entity.OriName != entity.Name)
{
int occurances = 0;
foreach (var tst in parent.Tests) if (!string.IsNullOrEmpty(tst.FeedingPath) && tst.FeedingPath.Equals(entity.OriName)) occurances++;
if (occurances > 0)
{
warnings += string.Format(Strings._0_path_1_used_by_2_tests_will_be_renamed_3, Strings.FeedingTabPageTitle, entity.Name, occurances, Environment.NewLine);
renmInfo.Add(entity.OriName, entity.Name);
}
}
}
return warnings;
}
public void UpdateRelatedItems(Dictionary<string, string> renameInfo)
{
foreach (var tst in parent.Tests)
{
string newPathName;
if (!string.IsNullOrEmpty(tst.FeedingPath) && renameInfo.TryGetValue(tst.FeedingPath, out newPathName))
{
tst.FeedingPath = newPathName;
Config.FluentCommon.SaveToDb(parent.Session, tst);
}
}
}
/// <summary>
/// Update the entities and save them to the database
/// </summary>
public new void OkBtnClicked()
{
base.OkBtnClicked();
/// Update the database
foreach (var entity in ToBeRemovedItems)
{
Config.FluentCommon.DeleteFromDb(parent.Session, entity);
}
foreach (var entity in MyItems)
{
Config.FluentCommon.SaveToDb(parent.Session, entity);
}
parent.Session.Flush();
/// Update the column widths
Program.LocalSettings.FeedingColumnWidths = new int[Columns.Count];
for (int i = 0; i < Columns.Count; i++)
{
Program.LocalSettings.FeedingColumnWidths[i] = Columns[i].Width;
}
Program.LocalSettings.Save();
}
}
}
@@ -1,6 +1,7 @@
///
/// Copyright (c) 2016 Sensus Metering Systems
/// Copyright (c) 2016-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Windows.Forms;
@@ -57,6 +58,8 @@ namespace TBF.UiControls
.OrderBy(x => x.ItemNr).Asc
.List();
foreach (var path in MyItems) path.OriName = path.Name;
SubItemClicked += new Results.Forms.SubItemEventHandler(listViewEx_SubItemClicked);
SubItemRightClicked += new Results.Forms.SubItemEventHandler(listViewEx_SubItemRightClicked);
SubItemEndEditing += new Results.Forms.SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing);
@@ -220,34 +223,6 @@ namespace TBF.UiControls
entity.TMeterWorkCold2 = lvi.SubItems[(int)Column.TMWrkC2].Text == "---" ? null : lvi.SubItems[(int)Column.TMWrkC2].Text;
}
/// <summary>
/// Update the entities and save them to the database
/// </summary>
public new void OkBtnClicked()
{
base.OkBtnClicked();
#if HEAT_METERS
/// Update the database
foreach (var entity in ToBeRemovedItems)
{
Config.FluentCommon.DeleteFromDb(parent.Session, entity);
}
foreach (var entity in MyItems)
{
Config.FluentCommon.SaveToDb(parent.Session, entity);
}
/// Update the column widths
Program.LocalSettings.HeatMetersColumnWidths = new int[Columns.Count];
for (int i = 0; i < Columns.Count; i++)
{
Program.LocalSettings.HeatMetersColumnWidths[i] = Columns[i].Width;
}
Program.LocalSettings.Save();
#endif
}
public void AddOne()
{
/// Find an unused test name
@@ -273,5 +248,86 @@ namespace TBF.UiControls
parent.UpdateButtonStates(SharedButtons.SelectedItemPos.None);
}
}
}
public string GetWarningsBeforeSaving(ref Dictionary<string, string> renmInfo)
{
base.OkBtnClicked(); /// = UpdateAll()
string warnings = string.Empty;
#if HEAT_METERS
foreach (var entity in ToBeRemovedItems)
{
if (!string.IsNullOrEmpty(entity.OriName))
{
int occurances = 0;
foreach (var tst in parent.Tests) if (!string.IsNullOrEmpty(tst.HeatMetersPath) && tst.HeatMetersPath.Equals(entity.OriName)) occurances++;
if (occurances > 0)
{
warnings += string.Format(Strings._0_path_1_used_by_2_tests_will_be_removed_3, Strings.Heat_meter_sensors, entity.Name, occurances, Environment.NewLine);
}
}
}
foreach (var entity in MyItems)
{
if (!string.IsNullOrEmpty(entity.OriName) && entity.OriName != entity.Name)
{
int occurances = 0;
foreach (var tst in parent.Tests) if (!string.IsNullOrEmpty(tst.HeatMetersPath) && tst.HeatMetersPath.Equals(entity.OriName)) occurances++;
if (occurances > 0)
{
warnings += string.Format(Strings._0_path_1_used_by_2_tests_will_be_renamed_3, Strings.Heat_meter_sensors, entity.Name, occurances, Environment.NewLine);
}
}
}
#endif
return warnings;
}
public void UpdateRelatedItems(Dictionary<string, string> renameInfo)
{
#if HEAT_METERS
foreach (var tst in parent.Tests)
{
string newPathName;
if (!string.IsNullOrEmpty(tst.HeatMetersPath) && renameInfo.TryGetValue(tst.HeatMetersPath, out newPathName))
{
tst.HeatMetersPath = newPathName;
Config.FluentCommon.SaveToDb(parent.Session, tst);
}
}
#endif
}
/// <summary>
/// Update the entities and save them to the database
/// </summary>
public new void OkBtnClicked()
{
base.OkBtnClicked();
#if HEAT_METERS
/// Update the database
foreach (var entity in ToBeRemovedItems)
{
Config.FluentCommon.DeleteFromDb(parent.Session, entity);
}
foreach (var entity in MyItems)
{
Config.FluentCommon.SaveToDb(parent.Session, entity);
}
/// Update the column widths
Program.LocalSettings.HeatMetersColumnWidths = new int[Columns.Count];
for (int i = 0; i < Columns.Count; i++)
{
Program.LocalSettings.HeatMetersColumnWidths[i] = Columns[i].Width;
}
Program.LocalSettings.Save();
#endif
}
}
}
@@ -1,6 +1,7 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Windows.Forms;
@@ -44,6 +45,8 @@ namespace TBF.UiControls
.OrderBy(x => x.ItemNr).Asc
.List();
foreach (var path in MyItems) path.OriName = path.Name;
SubItemClicked += new Results.Forms.SubItemEventHandler(listViewEx_SubItemClicked);
SubItemRightClicked += new Results.Forms.SubItemEventHandler(listViewEx_SubItemRightClicked);
SubItemEndEditing += new Results.Forms.SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing);
@@ -157,32 +160,6 @@ namespace TBF.UiControls
}
}
/// <summary>
/// Update the entities and save them to the database
/// </summary>
public new void OkBtnClicked()
{
base.OkBtnClicked();
/// Update the database
foreach (var entity in ToBeRemovedItems)
{
Config.FluentCommon.DeleteFromDb(parent.Session, entity);
}
foreach (var entity in MyItems)
{
Config.FluentCommon.SaveToDb(parent.Session, entity);
}
/// Update the column widths
Program.LocalSettings.MetersColumnWidths = new int[Columns.Count];
for (int i = 0; i < Columns.Count; i++)
{
Program.LocalSettings.MetersColumnWidths[i] = Columns[i].Width;
}
Program.LocalSettings.Save();
}
public void AddOne()
{
/// Find an unused test name
@@ -208,5 +185,81 @@ namespace TBF.UiControls
parent.UpdateButtonStates(SharedButtons.SelectedItemPos.None);
}
}
}
public string GetWarningsBeforeSaving(ref Dictionary<string, string> renmInfo)
{
base.OkBtnClicked(); /// = UpdateAll()
string warnings = string.Empty;
foreach (var entity in ToBeRemovedItems)
{
if (!string.IsNullOrEmpty(entity.OriName))
{
int occurances = 0;
foreach (var tst in parent.Tests) if (!string.IsNullOrEmpty(tst.MetersPath) && tst.MetersPath.Equals(entity.OriName)) occurances++;
if (occurances > 0)
{
warnings += string.Format(Strings._0_path_1_used_by_2_tests_will_be_removed_3, Strings.MetersTabPageTitle, entity.Name, occurances, Environment.NewLine);
}
}
}
foreach (var entity in MyItems)
{
if (!string.IsNullOrEmpty(entity.OriName) && entity.OriName != entity.Name)
{
int occurances = 0;
foreach (var tst in parent.Tests) if (!string.IsNullOrEmpty(tst.MetersPath) && tst.MetersPath.Equals(entity.OriName)) occurances++;
if (occurances > 0)
{
warnings += string.Format(Strings._0_path_1_used_by_2_tests_will_be_renamed_3, Strings.MetersTabPageTitle, entity.Name, occurances, Environment.NewLine);
}
}
}
return warnings;
}
public void UpdateRelatedItems(Dictionary<string, string> renameInfo)
{
foreach (var tst in parent.Tests)
{
string newPathName;
if (!string.IsNullOrEmpty(tst.MetersPath) && renameInfo.TryGetValue(tst.MetersPath, out newPathName))
{
tst.MetersPath = newPathName;
Config.FluentCommon.SaveToDb(parent.Session, tst);
}
}
}
/// <summary>
/// Update the entities and save them to the database
/// </summary>
public new void OkBtnClicked()
{
base.OkBtnClicked();
/// Update the database
foreach (var entity in ToBeRemovedItems)
{
Config.FluentCommon.DeleteFromDb(parent.Session, entity);
}
foreach (var entity in MyItems)
{
Config.FluentCommon.SaveToDb(parent.Session, entity);
}
/// Update the column widths
Program.LocalSettings.MetersColumnWidths = new int[Columns.Count];
for (int i = 0; i < Columns.Count; i++)
{
Program.LocalSettings.MetersColumnWidths[i] = Columns[i].Width;
}
Program.LocalSettings.Save();
}
}
}
@@ -1,6 +1,7 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Drawing;
using System.Windows.Forms;
using log4net;
@@ -8,6 +9,7 @@ using Config.Entities;
using TBF.BenchControl;
using TBF.BenchControl.GenericDevices;
using TBF.Resources;
using System.Collections.Generic;
namespace TBF.UiControls
{
@@ -54,6 +56,8 @@ namespace TBF.UiControls
.OrderBy(x => x.ItemNr).Asc
.List();
foreach (var path in MyItems) path.OriName = path.Name;
SubItemClicked += new Results.Forms.SubItemEventHandler(listViewEx_SubItemClicked);
SubItemRightClicked += new Results.Forms.SubItemEventHandler(listViewEx_SubItemRightClicked);
SubItemEndEditing += new Results.Forms.SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing);
@@ -279,32 +283,6 @@ namespace TBF.UiControls
entity.ValvesClose = valvesClose;
}
/// <summary>
/// Update the entities and save them to the database
/// </summary>
public new void OkBtnClicked()
{
base.OkBtnClicked();
/// Update the database
foreach (var entity in ToBeRemovedItems)
{
Config.FluentCommon.DeleteFromDb(parent.Session, entity);
}
foreach (var entity in MyItems)
{
Config.FluentCommon.SaveToDb(parent.Session, entity);
}
/// Update the column widths
Program.LocalSettings.OutputColumnWidths = new int[Columns.Count];
for (int i = 0; i < Columns.Count; i++)
{
Program.LocalSettings.OutputColumnWidths[i] = Columns[i].Width;
}
Program.LocalSettings.Save();
}
public void AddOne()
{
Config.Entities.OutputPath entity;
@@ -338,5 +316,81 @@ namespace TBF.UiControls
parent.UpdateButtonStates(SharedButtons.SelectedItemPos.None);
}
}
}
public string GetWarningsBeforeSaving(ref Dictionary<string, string> renmInfo)
{
base.OkBtnClicked(); /// = UpdateAll()
string warnings = string.Empty;
foreach (var entity in ToBeRemovedItems)
{
if (!string.IsNullOrEmpty(entity.OriName))
{
int occurances = 0;
foreach (var tst in parent.Tests) if (!string.IsNullOrEmpty(tst.OutputPath) && tst.OutputPath.Equals(entity.OriName)) occurances++;
if (occurances > 0)
{
warnings += string.Format(Strings._0_path_1_used_by_2_tests_will_be_removed_3, Strings.OutputTabPageTitle, entity.Name, occurances, Environment.NewLine);
}
}
}
foreach (var entity in MyItems)
{
if (!string.IsNullOrEmpty(entity.OriName) && entity.OriName != entity.Name)
{
int occurances = 0;
foreach (var tst in parent.Tests) if (!string.IsNullOrEmpty(tst.OutputPath) && tst.OutputPath.Equals(entity.OriName)) occurances++;
if (occurances > 0)
{
warnings += string.Format(Strings._0_path_1_used_by_2_tests_will_be_renamed_3, Strings.OutputTabPageTitle, entity.Name, occurances, Environment.NewLine);
}
}
}
return warnings;
}
public void UpdateRelatedItems(Dictionary<string, string> renameInfo)
{
foreach (var tst in parent.Tests)
{
string newPathName;
if (!string.IsNullOrEmpty(tst.OutputPath) && renameInfo.TryGetValue(tst.OutputPath, out newPathName))
{
tst.OutputPath = newPathName;
Config.FluentCommon.SaveToDb(parent.Session, tst);
}
}
}
/// <summary>
/// Update the entities and save them to the database
/// </summary>
public new void OkBtnClicked()
{
base.OkBtnClicked();
/// Update the database
foreach (var entity in ToBeRemovedItems)
{
Config.FluentCommon.DeleteFromDb(parent.Session, entity);
}
foreach (var entity in MyItems)
{
Config.FluentCommon.SaveToDb(parent.Session, entity);
}
/// Update the column widths
Program.LocalSettings.OutputColumnWidths = new int[Columns.Count];
for (int i = 0; i < Columns.Count; i++)
{
Program.LocalSettings.OutputColumnWidths[i] = Columns[i].Width;
}
Program.LocalSettings.Save();
}
}
}
@@ -357,6 +357,15 @@ namespace TBF.UiControls
MessageBoxIcon.Information);
}
}
}
public string GetWarningsBeforeSaving(ref Dictionary<string, string> renmInfo)
{
return string.Empty;
}
public void UpdateRelatedItems(Dictionary<string, string> renameInfo)
{
}
}
}
@@ -503,5 +503,14 @@ namespace TBF.UiControls
parent.UpdateButtonStates(SharedButtons.SelectedItemPos.None);
}
}
}
public string GetWarningsBeforeSaving(ref Dictionary<string, string> renmInfo)
{
return string.Empty;
}
public void UpdateRelatedItems(Dictionary<string, string> renameInfo)
{
}
}
}
@@ -258,5 +258,14 @@ namespace TBF.UiControls
parent.UpdateButtonStates(SharedButtons.SelectedItemPos.None);
}
}
public string GetWarningsBeforeSaving(ref Dictionary<string, string> renmInfo)
{
return string.Empty;
}
public void UpdateRelatedItems(Dictionary<string, string> renameInfo)
{
}
}
}