Compare commits

..
Author SHA1 Message Date
Milan Hanajik 73bb20f616 Reconfigured for Rumunsko-Mobile 2018-03-22 21:03:41 +01:00
Milan Hanajik b9886599ed TestMethods.FixedStart added - uses only reference flowmeter, no scales, ver. 2.18.853 2018-03-22 21:03:13 +01:00
Milan Hanajik 570570570b ver. 2.18.852 2018-03-21 17:02:54 +01:00
Milan Hanajik 1593dc3070 ResultsBrowser : Any IResultsPrinter component from TBF can be used to print results, ver. 2.18.851 2018-03-20 04:49:11 +01:00
Milan Hanajik 9931138e5d (1) Minor improvements in Output.FileWriters.XmlBatch, (2) TestMethods.ReferenceFlowmeterCalibration removed, ver. 2.18.851 2018-03-20 01:40:58 +01:00
Milan Hanajik 91e7b95332 ver. 2.18.850 2018-03-19 11:41:05 +01:00
Milan Hanajik f912389a36 ver. 2.18.849 2018-03-19 09:44:50 +01:00
Milan Hanajik be5122cec6 Output.FileWriters.XmlBatch component added, ver. 2.18.848 2018-03-19 09:27:57 +01:00
Milan Hanajik 9f9883ac3e ResultsBrowser : UI for printer component OK, ver. 2.18.847 2018-03-19 08:52:02 +01:00
Milan Hanajik 5e50056f4a Output.DB.SaveFlowmeterCorrections tested and fixed, ver. 2.18.847 2018-03-19 06:31:30 +01:00
Milan Hanajik d97fa481c8 ver. 2.18.846 2018-03-18 14:18:28 +01:00
Milan Hanajik 495fb4e074 Bug fix in ProcedurePramsCtrl when Sick and ROI are combined and Sick is the 1st one, ver. 2.18.845 2018-03-17 06:53:27 +01:00
Milan Hanajik 82a1669306 ResultsBrowser : Inner exception message displayed, ver. 2.18.844 2018-03-16 13:24:38 +01:00
Milan Hanajik 0adec1cb51 Output.Printers.OnePerMeter : Table class added, common items use Table class for printing, ver. 2.18.844 2018-03-16 03:11:18 +01:00
Milan Hanajik f8a358c21e Diverter and flowmeter numbers for diverter tests corrected for 3 Fuzhou benches. 2018-03-16 03:08:50 +01:00
Milan Hanajik 6a40a351a7 Output.DB.SaveFlowmeterCorrections works well with tests when Repeats count > 1. 2018-03-15 05:59:22 +01:00
Milan Hanajik e8af9418bf Both login dialogs react on Enter key (moves focus). 2018-03-15 04:50:52 +01:00
Milan Hanajik 4245238112 UpgradeSelectionDlg fixed when no DB selected, etc., ver. 2.18.843 2018-03-15 03:42:19 +01:00
Milan Hanajik 88c92dd762 ver. 2.18.842 2018-03-14 12:53:14 +01:00
Milan Hanajik 6a38189ee2 (1) Change in FUZHOU300 #if/#else/#endif, (2) UpgradeSelectionDlg supports v.2.4 -> v.2.9. DB upgrade, ver. 2.18.841 2018-03-14 07:30:15 +01:00
Milan Hanajik 694e20c9b6 ver. 2.18.840 2018-03-14 02:18:42 +01:00
Milan Hanajik d0c27c4fe0 UpgradeSelectionDlg contains pressure representation upgrade, ver. 2.18.839 2018-03-13 07:49:06 +01:00
Milan Hanajik 82e71f6779 Components for all 3 test benches in Fuzhou upgraded. 2018-03-13 02:18:37 +01:00
Milan Hanajik ab6b96976c Changes in UpgradeSelectionDlg (database upgrade), ver. 2.18.838 2018-03-13 02:18:07 +01:00
Milan Hanajik 47c2184d5f Fixes in FUZOU_40 define, ver. 2.18.837 2018-03-12 00:19:27 +01:00
Milan Hanajik 04b0be79cd ver. 2.18.836 2018-03-11 12:30:31 +01:00
Milan Hanajik 9b212bd455 (1) MettlerToledo.Multi workaround for Badger-stredna-trat at the serial protocol level, (2) VB1 display fixed, ver. 2.18.835 2018-03-11 12:10:53 +01:00
Milan Hanajik 62b06b23a5 MettlerToledo.Multi workaround for Badger-stredna-trat, ver. 2.18.833 2018-03-09 17:29:13 +01:00
Milan Hanajik bbea6da45c Badger-streda-trat : zobrazenie prietoku zmenene na m3/h, ver. 2.18.832 2018-03-09 15:30:34 +01:00
Milan Hanajik 4452b62cbd Badger stredna trat : Flowmeter + diverter number when starting a test fixed, ver. 2.18.831 2018-03-09 12:25:58 +01:00
Milan Hanajik 4a7d14b01f U: leos, P: velka, ver. 2.18.829 2018-03-07 15:22:17 +01:00
Milan Hanajik 9ab78cf824 Changes for Badger: (1) numerical keys passed to Elde component, (2) Diverter# for Badger stredna trat, ver. 2.18.828 2018-03-07 14:43:57 +01:00
Milan Hanajik 615b3409be OnePerMeterPrintDocument changes. 2018-03-07 11:03:49 +01:00
Milan Hanajik 7465f23809 T_line_xy added to WMeterRsltItemSpec, ver. 2.18.827 2018-03-04 20:43:03 +01:00
Milan Hanajik 0598491753 SequenceBase.TestResult2CvsLine( ) bug fix, ver. 2.18.826 2018-02-26 20:40:19 +01:00
Milan Hanajik 88bf586da4 (3) Water density from air temperature uncorrected 2018-02-26 15:41:45 +01:00
Milan Hanajik 369753f94a (1) Water density calculated from temp. and pressure, (2) DensityOut -> DensityLine (mapped to DB column TestRslt.DensityOut), ver. 2.18.825 2018-02-26 15:30:22 +01:00
Milan Hanajik 29f79285a7 meterRslt.TestTime is read from board from cBrd.ImpulseTime(wmNr1) 2018-02-26 13:54:26 +01:00
Milan Hanajik 81951287c6 SequenceBase.TestResult2CsvLine( ) modified: isPressureTest, isStartStop, isDiverter, isCamera, ... 2018-02-26 13:13:36 +01:00
Milan Hanajik be86f791e4 TestRslt.MethodClass and MeterTestRslt.RegReaderClass fields set appropriately in each test, ver. 2.18.824 2018-02-26 12:35:53 +01:00
Milan Hanajik 4c70ac6412 MethodClass added to TestRslt, RegReaderClass added to MeterTestRslt, not mapped to DB. 2018-02-26 12:34:51 +01:00
Milan Hanajik d8de284c37 TestResults2CsvLine( ) clean-up.. 2018-02-26 09:34:50 +01:00
Milan Hanajik 39d43bc217 TestResult2CsvLine() modifications for Kepno, ver. 2.18.823 2018-02-23 10:03:23 +01:00
Milan Hanajik 7bb6d7f0e9 Water density calculation according to ITS-90 2018-02-23 09:55:19 +01:00
Milan Hanajik fc8bf749a4 (1) Network.Comet.Ambient clean-up, (2) Output.DB.SaveFlowmeterCorrections bug fix, ver. 2.18.822 2018-02-21 11:08:23 +01:00
Milan Hanajik 95a3d7def6 Network.Comet.Ambient component added, ver. 2.18.821 2018-02-20 19:30:05 +01:00
Milan Hanajik 1155cae130 iPerlCommunication bug fix (found on iPerlSpecial), ver. 2.18.820 2018-02-19 15:12:38 +01:00
Milan Hanajik f645aea402 ver. 2.18.819 2018-02-19 10:33:17 +01:00
Milan Hanajik 1a82625f39 Output.DB.SaveFlowmeterCorrections completed, ver. 2.18.818 2018-02-19 09:42:20 +01:00
Milan Hanajik bcc54ccd8f ver. 2.18.817 2018-02-16 16:18:41 +01:00
Milan Hanajik 5df13df7fc Big fixes : Ambient ST/EN result items. 2018-02-16 15:32:00 +01:00
Milan Hanajik 47fd6206f6 Minor changes 2018-02-16 14:16:59 +01:00
Milan Hanajik 776f8ed841 SaveFlowmeterCorr : Support for calibration of multiple flow meters and ranges, part 1, UI, ver. 2.18.816 2018-02-16 12:59:24 +01:00
Milan Hanajik cf20ca885e ver. 2.18.815 2018-02-16 09:44:42 +01:00
Milan Hanajik e2e7a091af Changes in program shutdown reverted, ver. 2.18.814 2018-02-16 06:54:14 +01:00
Milan Hanajik 17e605cfd9 UI2BenCmd.Shutdown is re-sent each 3 sec in MainWnd on exit, CheckUIOp and MainSeq modifications, ver. 2.18.813 2018-02-15 16:05:45 +01:00
Milan Hanajik 80999a8573 ErrorFlags E1 and E21 modified, E1 now checks the mean flow, ver. 2.18.812 2018-02-15 14:17:22 +01:00
Milan Hanajik 8deb18fe9c Procedure numbers displayed in procedureComboBox in MainWnd. 2018-02-15 13:52:00 +01:00
Milan Hanajik bb3688bf7a Cleanup, Polish language, ver. 2.18.812 2018-02-15 13:51:40 +01:00
Milan Hanajik d3c7d54466 GraphsTabPageCtrl bug fix : Crash when 'current' node is used, ver. 2.18.811 2018-02-14 19:44:39 +01:00
Milan Hanajik b844aafcf3 Statistics, ProcesData, Plotter, IPlotter, GraphsTabPageCtrl, FlyingStartMassCollection changes 2018-02-14 19:27:11 +01:00
Milan Hanajik 5f17dabb0b (1) IPlotter interface used in Statistics, (2) Plotter class, (3) Start/Stop statistics in all test methods, (4) Flow simulation in FlyingStartMassCollection (DebugMode.Inherit). 2018-02-12 17:50:39 +01:00
Milan Hanajik e0fb7927ed Bug fix in Output.DB.SaveFowmeterCorrections, ver. 2.18.803 2018-02-11 08:18:58 +01:00
145 changed files with 9425 additions and 3310 deletions
+2 -2
View File
@@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;GENESIS;IPERL;LANG_DE</DefineConstants>
<DefineConstants>TRACE;DEBUG;RUM_MOB;LANG_RO</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;GENESIS;IPERL;LANG_DE</DefineConstants>
<DefineConstants>TRACE;RUM_MOB;LANG_RO</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
+7
View File
@@ -24,6 +24,8 @@ namespace Config.Entities
public Component()
{
Name = string.Empty;
ClassName = string.Empty;
Corrections = new List<MeasurementCorrection>();
}
@@ -125,5 +127,10 @@ namespace Config.Entities
return result;
}
public override string ToString()
{
return string.Format("{0} ({1})", Name, ClassName);
}
}
}
+7
View File
@@ -374,6 +374,13 @@ namespace Config.Entities
Count
}
public enum VertAlignment
{
[Description("Top")] Top,
[Description("Middle")] Middle,
[Description("Bottom")] Bottom,
}
public enum ImageRotation
{
[Description("0 deg")] None,
+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.18.797.0")]
[assembly: AssemblyFileVersion("2.18.797.0")]
[assembly: AssemblyVersion("2.18.837.0")]
[assembly: AssemblyFileVersion("2.18.837.0")]
+5 -5
View File
@@ -30,7 +30,7 @@ namespace Config
[Description("hr")] hour, /// 1 hour = 60 min = 3600 s
[Description("ms")] ms, /// 1 ms = 0.001 s
[Description("°C")] C, /// * degree Celsius
[Description("°C")] C, /// * degree Celsius (°C)
[Description("°F")] F, /// degree Fahrenheit
[Description("K")] K, /// degree Kelvin
@@ -293,8 +293,8 @@ namespace Config
case Unit.hour: return v / 3600;
case Unit.ms: return 1000 * v;
/// Temperature: internal representation in degree C
case Unit.C: return v; /// degree Celsius
/// Temperature: internal representation in °C
case Unit.C: return v; /// degree Celsius (°C)
case Unit.F: return 1.8 * v + 32; /// degree Fahrenheit
case Unit.K: return v + 273.15; /// degree Kelvin
@@ -360,8 +360,8 @@ namespace Config
case Unit.hour: return 3600 * v;
case Unit.ms: return v / 1000;
/// Temperature: internal representation in degree C
case Unit.C: return v; /// degree Celsius
/// Temperature: internal representation in °C
case Unit.C: return v; /// degree Celsius (°C)
case Unit.F: return 5 * (v-32) / 9; /// degree Fahrenheit
case Unit.K: return v - 273.15; /// degree Kelvin
+2 -2
View File
@@ -68,10 +68,10 @@ namespace DeviceTest
public DeviceTestDlg()
{
InitializeComponent();
compClasses = new List<string>();
radioButton0.Checked = true;
stopButton.Enabled = false;
compClasses = new List<string>();
foreach (var componentFactory in TbfComponents.Factories)
{
compClasses.Add(componentFactory.ClassName);
+41 -1
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
@@ -159,7 +160,46 @@ namespace GraphLib
{
grid_off_y = off_y;
}
/// <summary>
/// Load Samples from a file. Returns loaded points count.
/// </summary>
/// <param name="pathName">File pathname</param>
/// <returns>Loaded points count</returns>
public int LoadSamples(string pathName, out float yMin, out float yMax)
{
yMin = float.MaxValue;
yMax = float.MinValue;
try
{
Int64 size = new FileInfo(pathName).Length;
if ((size % 8) != 0) return 0;
int samplesCount = (int)(size / 8L) - 1;
if (samplesCount <= 0) return 0;
PointF[] newSamples = new PointF[samplesCount];
using (BinaryReader reader = new BinaryReader(File.Open(pathName, FileMode.Open)))
{
for (int i = 0; i < samplesCount; i++)
{
newSamples[i].X = reader.ReadSingle();
newSamples[i].Y = reader.ReadSingle();
}
yMin = reader.ReadSingle();
yMax = reader.ReadSingle();
}
Samples = newSamples;
return samplesCount;
}
catch (Exception exc)
{
return 0;
}
}
[Category("Properties")] // Take this out, and you will soon have problems with serialization;
[DefaultValue(typeof(string), "")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
+8 -1
View File
@@ -374,7 +374,14 @@ namespace GraphLib
if (gPane.Sources.Count > 0)
{
int val = hScrollBar1.Value;
gPane.starting_idx = (int)(gPane.Sources[0].Length * (float)val / 10000.0f);
int maxLen = 0;
foreach (var s in DataSources)
{
if (s.Length > maxLen) maxLen = s.Length;
}
gPane.starting_idx = (int)(maxLen * (float)val / 10000.0f);
gPane.Invalidate();
}
}
+1
View File
@@ -56,6 +56,7 @@ namespace GraphLib
this.tb1.ShowToolTips = true;
this.tb1.Size = new System.Drawing.Size(80, 26);
this.tb1.TabIndex = 1;
this.tb1.Visible = false;
this.tb1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.tb1_ButtonClick);
//
// tbbSave
+36 -36
View File
@@ -125,64 +125,64 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACI
DgAAAk1TRnQBSQFMAgEBBAEAAQwBAAEMAQABEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
AwABIAMAAQEBAAEgBgABIP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8AKgADAQECwAABtwGV
AVAB/QHKAZgBWgH/AcoBlwFaAf8BygGXAVoB/wHKAZcBWgH/AcoBlwFZAf8ByQGXAVkB/wHJAZcBWQH/
AcoBmAFaAf8BtwGUAVAB/RQAAxQBHAMRARcDAgEDrAADTgGZA10B0gNNAf8BxwGVAVYB/wH5AfcB9gH/
DgAAAk1TRnQBSQFMAgEBBAEAARQBAAEUAQABEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
AwABIAMAAQEBAAEgBgABIP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8AKgADAQECwAABtgGV
AU8B/QHKAZgBWQH/AcoBlwFZAf8BygGXAVkB/wHKAZcBWQH/AcoBlwFYAf8ByQGXAVgB/wHJAZcBWAH/
AcoBmAFZAf8BtgGUAU8B/RQAAxQBHAMRARcDAgEDrAADTgGZA10B0gNMAf8BxwGVAVUB/wH5AfcB9gH/
AfkB8QHsAf8B+QHxAesB/wH4AfAB6QH/AfcB7QHmAf8B9AHqAeEB/wHyAegB3gH/AfoB+AH2Af8BxwGU
AVYB/wMZAf8DWAHRA0QBeggAAxUBHQFiAlgB6QM6AWEDDQESAwABASwAAxsBJgMbASYDGwEmAxsBJgMb
AVUB/wMYAf8DWAHRA0QBeggAAxUBHQFiAlgB6QM6AWEDDQESAwABASwAAxsBJgMbASYDGwEmAxsBJgMb
ASYDGwEmAxsBJgMbASYDGwEmAxsBJgMbASYDGwEmEAADGwEmAxsBJgMbASYDGwEmAxsBJgMbASYDGwEm
AxsBJgMbASYDGwEmAxsBJgMbASYIAANVAf0DpwH/A7UB/wOBAf8BrwGsAaoB/wHFAcABvQH/AcUBwAG9
Af8BxQHAAb0B/wHFAcABvQH/AcUBwAG9Af8BxQHAAb0B/wGtAaoBqAH/AyEB/wO1Af8DmwH/AxgB/wgA
AxUBHQNNAfoBOwIrAfwDXwHgAysBQgMNARIoAAMbASYDKwH8AYACgQH/AYACgQH/AYACgQH/AYACgQH/
AxsBJgMbASYDGwEmAxsBJgMbASYIAANUAf0DpwH/A7UB/wOBAf8BrwGsAaoB/wHFAcABvQH/AcUBwAG9
Af8BxQHAAb0B/wHFAcABvQH/AcUBwAG9Af8BxQHAAb0B/wGtAaoBqAH/AyAB/wO1Af8DmwH/AxcB/wgA
AxUBHQNNAfoBOgIrAfwDXwHgAysBQgMNARIoAAMbASYDKwH8AYACgQH/AYACgQH/AYACgQH/AYACgQH/
AYACgQH/AYACgQH/AYACgQH/AYACgQH/AYACgQH/AxsBJhAAAxsBJgMrAfwBgAKBAf8BgAKBAf8BgAKB
Af8DIwE0AxsBJgMrAfwBgAKBAf8BgAKBAf8BgAKBAf8DIwE0CAADZQH/A7UB/wO1Af8DlQH/A4EB/wOB
Af8DbgH/A2MB/wNWAf8DRwH/AzgB/wM3Af8DYwH/A7UB/wO1Af8DGgH/CAADFQEdAV8CSgH7AfkB+gH5
Af8DIwE0AxsBJgMrAfwBgAKBAf8BgAKBAf8BgAKBAf8DIwE0CAADZAH/A7UB/wO1Af8DlQH/A4EB/wOB
Af8DbQH/A2IB/wNVAf8DRgH/AzcB/wM2Af8DYgH/A7UB/wO1Af8DGQH/CAADFQEdAV8CSgH7AfkB+gH5
Af8DfwH+AV8BUwFSAfsDVQGyAx0BKgMIAQsgAAMbASYDQAH9IP8DQAH9AxsBJgMAAQEMAAMbASYDQAH9
AfwB/QH8Bf8DQAH9AxsBJgMbASYDQAH9AfwB/QH8Bf8DQAH9AxsBJgMAAQEEAANqAf8DuwH/A7sB/wON
Af8D1AH/A7kB/wO5Af8DuQH/A7kB/wO5Af8DuQH/A9MB/wODAf8DuwH/A7sB/wMfAf8IAAMVAR0DKwH8
AfoC+wH/AfUC9gH/AfkC+gH/ATwBLwEuAfwBbQJRAfcDQgF2AxYBHgMFAQcYAAMbASYDQAH9BP8B1QHb
AfwB/QH8Bf8DQAH9AxsBJgMbASYDQAH9AfwB/QH8Bf8DQAH9AxsBJgMAAQEEAANpAf8DuwH/A7sB/wON
Af8D1AH/A7kB/wO5Af8DuQH/A7kB/wO5Af8DuQH/A9MB/wODAf8DuwH/A7sB/wMeAf8IAAMVAR0DKwH8
AfoC+wH/AfUC9gH/AfkC+gH/ATsBLgEtAfwBbQJRAfcDQgF2AxYBHgMFAQcYAAMbASYDQAH9BP8B1QHb
AdgB/wHUAdsB1wH/AdQB2wHYAf8B0wHbAdcB/wHRAdkB1QH/Ac8B1wHTBf8DQAH9AxsBJgMBAQIMAAMb
ASYDQAH9AeIB5QHkAf8B2AHfAdwB/wNAAf0DGwEmAxsBJgNAAf0D8wH/AfcB+AH3Af8DQAH9AxsBJgMB
AQIEAANvAf8D1wH/A9cB/wOXAf8D2AH/A78B/wO/Af8DvwH/A78B/wO/Af8DvwH/A9cB/wOOAf8D1wH/
A9cB/wM0Af8IAAMWAR4DKwH8A/sB/wHTAdoB1wH/AdoB3wHcAf8B9gH3AfYB/wHyAvMB/wE7AisB/AFg
AQIEAANuAf8D1wH/A9cB/wOXAf8D2AH/A78B/wO/Af8DvwH/A78B/wO/Af8DvwH/A9cB/wOOAf8D1wH/
A9cB/wMzAf8IAAMWAR4DKwH8A/sB/wHTAdoB1wH/AdoB3wHcAf8B9gH3AfYB/wHyAvMB/wE6AisB/AFg
AlkB6wMzAVMDEgEZAwQBBRAAAxsBJgNAAf0E/wHaAeAB3QH/AdsB4QHeAf8B3QHiAeAB/wHdAeIB4AH/
AdsB4QHeAf8B2AHeAdsF/wNAAf0DGwEmAwEBAgwAAxsBJgNAAf0B4gHmAeQB/wHcAeIB3wH/A0AB/QMb
ASYDGwEmA0AB/QHvAfEB8AH/AfAB8wHxAf8DQAH9AxsBJgMBAQIEAANzAf8D+QH/A/kB/wOrAf8D3wH/
A8sB/wPLAf8DywH/A8sB/wPLAf8DywH/A98B/wOjAf8D+QH/A/kB/wNWAf8IAAMWAR4DKwH8A/sB/wHf
ASYDGwEmA0AB/QHvAfEB8AH/AfAB8wHxAf8DQAH9AxsBJgMBAQIEAANyAf8D+QH/A/kB/wOrAf8D3wH/
A8sB/wPLAf8DywH/A8sB/wPLAf8DywH/A98B/wOjAf8D+QH/A/kB/wNVAf8IAAMWAR4DKwH8A/sB/wHf
AeQB4QH/Ad4B4wHhAf8B3gHjAeAB/wHjAecB5QH/AfQC9QH/A38B/gGRAkAB/QNWAbYDJgE5AxABFQwA
AxsBJgNAAf0E/wHdAeMB4AH/AeEB5gHjAf8B5AHpAecB/wHmAeoB6AH/AeUB6QHnAf8B4gHnAeQF/wNA
Af0DGwEmAwEBAgwAAxsBJgNAAf0B5AHoAeUB/wHeAeMB4QH/A0AB/QMbASYDGwEmA0AB/QHsAe8B7gH/
AecB6wHpAf8DQAH9AxsBJgMBAQIEAANqAfkD/AH/A/wB/wPLAf8D8gH/A/IB/wPyAf8D8gH/A/IB/wPy
Af8D8gH/A/IB/wPGAf8D/AH/A/wB/wNwAf4IAAMWAR4DKwH8A/sB/wHqAe4B7AH/AewB7wHuAf8B7AHv
Ae4B/wHrAe4B7QH/AekB7AHrAf8DfwH+ATsCKwH8AVgCVgG7Ax0BKgMGAQgMAAMbASYDQAH9BP8B3wHk
Ae4B/wHrAe4B7QH/AekB7AHrAf8DfwH+AToCKwH8AVgCVgG7Ax0BKgMGAQgMAAMbASYDQAH9BP8B3wHk
AeEB/wHkAekB5gH/AeoB7QHrAf8B7gHxAe8B/wHvAfEB8AH/AewB7wHuBf8DQAH9AxsBJgMBAQIMAAMb
ASYDQAH9AesB7QHsAf8B3QHjAeAB/wNAAf0DGwEmAxsBJgNAAf0B7QHwAe8B/wHfAeQB4QH/A0AB/QMb
ASYDAQECBAADXQTSAf8D6AH/A3IB/wNyAf8DcgH/A3IB/wNyAf8DcgH/A3IB/wNyAf8DcgH/A3IB/wPo
ASYDAQECBAADXQTSAf8D6AH/A3EB/wNxAf8DcQH/A3EB/wNxAf8DcQH/A3EB/wNxAf8DcQH/A3EB/wPo
Af8DxAH/A1wB3AgAAxYBHgMrAfwD+wH/AfUC9gH/AfoB+wH6Af8D+QH/Ad0C3gH/AWoCRwH5A10B7QE6
AjkBYAMNAREUAAMbASYDQAH9BP8B3AHiAd8B/wHkAegB5gH/AesB7gHtAf8B8gH0AfMB/wH3AvgB/wH2
AfgB9wX/A0AB/QMbASYDAQECDAADGwEmA0AB/QHyAfQB8wH/AdoB3wHdAf8DQAH9AxsBJgMcASgDQAH9
AfMB9QH0Af8B1gHdAdkB/wNAAf0DGwEmAwEBAgQAAy0BRQOaAf8DzAH/AccBiwFDAf8B+QH0Ae0B/wH+
AegB2AH/Af4B6AHXAf8B/QHlAdMB/wH8AeQB0QH/AfoB4AHHAf8B+QHdAcMB/wH6AfQB7QH/AccBhQE/
Af8DwwH/A2kB/wMtAUUIAAMWAR4DKwH8A/sB/wHwAfMB8gH/AeYC6AH/A00B+gFiAlIB9AFRAk8BpQMU
AfMB9QH0Af8B1gHdAdkB/wNAAf0DGwEmAwEBAgQAAy0BRQOaAf8DzAH/AccBiwFCAf8B+QH0Ae0B/wH+
AegB2AH/Af4B6AHXAf8B/QHlAdMB/wH8AeQB0QH/AfoB4AHHAf8B+QHdAcMB/wH6AfQB7QH/AccBhQE+
Af8DwwH/A2gB/wMtAUUIAAMWAR4DKwH8A/sB/wHwAfMB8gH/AeYC6AH/A00B+gFiAlIB9AFRAk8BpQMU
ARwDAAEBGAADGwEmA0AB/QT/AdgB3wHcAf8B4AHlAeMB/wHoAesB6gH/Ae8B8gHwAf8B9wH4AfcB/wP9
Bf8DQAH9AxsBJgMBAQIMAAMbASYDQAH9A/wB/wHVAdsB2AH/A0AB/QMbASYDHAEoA0AB/QP8Af8B0gHa
AdYB/wNAAf0DGwEmAwEBAggAAzsBYwNrAfMBxQGJAUEB/wH5AfQB7wH/Af4B5wHXAf8B/QHnAdUB/wH8
AeYB0gH/AfsB4QHMAf8B+AHcAcIB/wH2AdoBvQH/AfoB9AHvAf8BxAGDAT0B/wNdAfMDOwFjDAADFgEe
AysB/AP7Af8BPwIzAfwDTQH6AVoCVwG9AxgBIgMCAQMgAAMbASYDQAH9IP8DQAH9AxsBJgMBAQIMAAMb
ASYDQAH9CP8DQAH9AxsBJgMcASgDQAH9CP8DQAH9AxsBJgMBAQIMAAMHAQkBmgF9AUcC+QH0AfAB/wH8
AeYB0wH/Af0B5wHTAf8B+wHjAc0B/wH6AeAByAH/AfUB1gG7Af8B8wHUAbUB/wH4AfQB8AH/AZkBagFH
AfkDBwEJEAADFgEeA0AB/QFbAjIB+wFgAlwB1AMjATMDBwEKKAADGwEmAysB/AEqAS4BLAH/ASoBLgEs
Af8BKgEuASwB/wEqAS4BLAH/ASoBLgEsAf8BKgEuASwB/wEqAS4BLAH/ASoBLgEsAf8BKgEuASwB/wMb
ASYDAQECDAADGwEmAWMBVwFVAf4BKgEuASwB/wEqAS4BLAH/ASoBLgEsAf8DGwEmAxwBKAFjAVcBVQH+
ASoBLgEsAf8BKgEuASwB/wEqAS4BLAH/AxsBJgMBAQIQAAGWAX0BUQH3AfkB9QHxAf8B/AHjAc8B/wH8
AeQBzwH/AfoB4QHKAf8B+QHdAcQB/wH0AekB3wH/AfcB8gHsAf8B9QHvAekB/wGbAWABRQH7FAADFgEf
AdYB/wNAAf0DGwEmAwEBAggAAzsBYwNqAfMBxQGJAUAB/wH5AfQB7wH/Af4B5wHXAf8B/QHnAdUB/wH8
AeYB0gH/AfsB4QHMAf8B+AHcAcIB/wH2AdoBvQH/AfoB9AHvAf8BxAGDATwB/wNdAfMDOwFjDAADFgEe
AysB/AP7Af8BPgIyAfwDTQH6AVoCVwG9AxgBIgMCAQMgAAMbASYDQAH9IP8DQAH9AxsBJgMBAQIMAAMb
ASYDQAH9CP8DQAH9AxsBJgMcASgDQAH9CP8DQAH9AxsBJgMBAQIMAAMHAQkBlgF6AUcC+QH0AfAB/wH8
AeYB0wH/Af0B5wHTAf8B+wHjAc0B/wH6AeAByAH/AfUB1gG7Af8B8wHUAbUB/wH4AfQB8AH/AZUBagFH
AfkDBwEJEAADFgEeA0AB/QFbAjIB+wFgAlwB1AMjATMDBwEKKAADGwEmAysB/AEpAS0BKwH/ASkBLQEr
Af8BKQEtASsB/wEpAS0BKwH/ASkBLQErAf8BKQEtASsB/wEpAS0BKwH/ASkBLQErAf8BKQEtASsB/wMb
ASYDAQECDAADGwEmAWMBVwFVAf4BKQEtASsB/wEpAS0BKwH/ASkBLQErAf8DGwEmAxwBKAFjAVcBVQH+
ASkBLQErAf8BKQEtASsB/wEpAS0BKwH/AxsBJgMBAQIQAAGSAXoBUQH3AfkB9QHxAf8B/AHjAc8B/wH8
AeQBzwH/AfoB4QHKAf8B+QHdAcQB/wH0AekB3wH/AfcB8gHsAf8B9QHvAekB/wGZAV8BRQH7FAADFgEf
AV4CWgHYAygBPQMNAREwAAMbASYDGwEmAxsBJgMbASYDGwEmAxsBJgMbASYDGwEmAxsBJgMbASYDGwEm
AxsBJgMAAQEMAAMbASYDGwEmAxsBJgMbASYDGwEmAxsBJgMbASYDGwEmAxsBJgMbASYDGwEmAxsBJgMA
AQEQAAGNAW0BSQH2AfkB9QHxAf8B/AHjAc0B/wH7AeMBzQH/AfkB4AHIAf8B+AHcAcIB/wH9AfsB+AH/
AfwB5gHNAf8B4gG2AYQB/wJUAVIBphQAAxYBHwMRARcDAgEDuAABoAF2AU0B+gH3AfIB7AH/AfgB9AHu
Af8B+AHzAe0B/wH4AfMB7QH/AfgB8gHsAf8B8gHmAdcB/wHiAbIBcgH/AZMBcwFiAfYDBQEHFAADAwEE
wAADOgFgAlgBVgG7AbMBfwFPAf4ByAGMAUQB/wGWAYABUQH3AZYBgAFRAfcBsAF/AUwB/gNOAZQUAAFC
AQEQAAGJAWoBSQH2AfkB9QHxAf8B/AHjAc0B/wH7AeMBzQH/AfkB4AHIAf8B+AHcAcIB/wH9AfsB+AH/
AfwB5gHNAf8B4gG2AYQB/wJUAVIBphQAAxYBHwMRARcDAgEDuAABngF1AU0B+gH3AfIB7AH/AfgB9AHu
Af8B+AHzAe0B/wH4AfMB7QH/AfgB8gHsAf8B8gHmAdcB/wHiAbIBcQH/AZABcQFiAfYDBQEHFAADAwEE
wAADOgFgAlgBVgG7AbEBfwFPAf4ByAGMAUMB/wGSAX8BUQH3AZIBfwFRAfcBrgF/AUwB/gNOAZQUAAFC
AU0BPgcAAT4DAAEoAwABQAMAASADAAEBAQABAQYAAQEWAAP/gQAB3wX/AeABBwHHBf8CAAHBAf8BwAED
AcABAwIAAcAB/wHAAQMBwAEDAgABwAE/AcABAQHAAQECAAHAAQ8BwAEBAcABAQIAAcABAwHAAQEBwAEB
AgABwAEBAcABAQHAAQECAAHAAQEBwAEBAcABAQIAAcABBwHAAQEBwAEBAgABwAEPAcABAQHAAQEBgAEB
+47 -57
View File
@@ -84,7 +84,7 @@ namespace GraphLib
public float CurXD1 = 0;
public float grid_distance_x = 200; // grid distance in samples ( draw a vertical line every 200 samples )
public float grid_distance_x = 60; // grid distance in samples ( draw a vertical line every 60 samples )
public float grid_off_x = 0;
public float GraphCaptionLineHeight = 28;
@@ -452,7 +452,7 @@ namespace GraphLib
if (layout == LayoutMode.NORMAL)
{
DrawGraphCaption(CurGraphics, source, marker_pos, CurOffX + CurGraphIdx * (10 + yLabelAreaWidth), curOffY);
DrawGraphCaption(CurGraphics, source, marker_pos, CurOffX + CurGraphIdx * (50 + yLabelAreaWidth) + (CurGraphIdx==0 ? 0 : 50), curOffY);
if (CurGraphIdx == 0)
{
@@ -600,7 +600,7 @@ namespace GraphLib
List<int> marker_pos = DrawGraphCurve(CurGraphics, source, CurOffX, curOffY + GraphCaptionLineHeight / 2);
DrawGraphCaption(CurGraphics, source, marker_pos, CurOffX + CurGraphIdx * (10 + yLabelAreaWidth), pad_top);
DrawGraphCaption(CurGraphics, source, marker_pos, CurOffX + CurGraphIdx * (50 + yLabelAreaWidth) + (CurGraphIdx == 0 ? 0 : 50), pad_top);
DrawYLabels(CurGraphics, source, marker_pos, CurOffX, curOffY);
@@ -776,12 +776,15 @@ namespace GraphLib
float y0 = (float)(source.grid_off_y * source.CurGraphHeight / source.DY + source.off_Y);
// draw horizontal zero grid lines
g.DrawLine(p2, new Point((int)CurrOffX, (int)(CurOffY + y0 + 0.5f)), new Point((int)(CurrOffX + source.CurGraphWidth + 0.5f), (int)(CurOffY + y0 + 0.5f)));
if (0 >= source.YD0 && 0 <= source.YD1)
{
g.DrawLine(p2, new Point((int)CurrOffX, (int)(CurOffY + y0 + 0.5f)), new Point((int)(CurrOffX + source.CurGraphWidth + 0.5f), (int)(CurOffY + y0 + 0.5f)));
}
// draw horizontal grid lines
for (Idx = (int)(source.grid_off_y);Idx > (int)(source.YD0 ); Idx -= (int)source.grid_distance_y)
for (float idy = source.grid_off_y; idy > source.YD0; idy -= source.grid_distance_y)
{
float y = (float)(Idx * source.CurGraphHeight) / source.DY + source.off_Y;
float y = (idy * source.CurGraphHeight) / source.DY + source.off_Y;
if (y >= 0 && y < source.CurGraphHeight)
{
@@ -792,9 +795,9 @@ namespace GraphLib
}
// draw horizontal grid lines
for (Idx = (int)(source.grid_off_y); Idx < (int)(source.YD1 ); Idx += (int)source.grid_distance_y)
for (float idy = source.grid_off_y; idy < source.YD1; idy += source.grid_distance_y)
{
float y = (float)Idx * source.CurGraphHeight / source.DY + source.off_Y;
float y = (idy * source.CurGraphHeight) / source.DY + source.off_Y;
if (y >= 0 && y < source.CurGraphHeight)
{
@@ -968,71 +971,58 @@ namespace GraphLib
using (Pen pen = new Pen(b))
{
pen.DashPattern = new float[] { 2, 2 };
float GridDistY = source.grid_distance_y;
///
if (source.AutoScaleY)
{
// calculate a matching grid distance
GridDistY = -Utilities.MostSignificantDigit(source.DY);
if (GridDistY == 0)
{
GridDistY = source.grid_distance_y;
}
}
// draw labels for horizontal lines
if (source.DY != 0)
{
float Idx = 0;
float y0 = (float)(source.grid_off_y * source.CurGraphHeight / source.DY + source.off_Y);
if (y0 >= 0 && y0 < source.CurGraphHeight)
{
String value = (source.OnRenderYAxisLabel == null) ? "0" : source.OnRenderYAxisLabel(source, 0);
SizeF dim = g.MeasureString(value, legendFont);
g.DrawString(value, legendFont, b, new PointF((int)offset_x - dim.Width, (int)(offset_y + y0 + 0.5f + dim.Height / 2)));
}
float y0 = (float)(source.grid_off_y * source.CurGraphHeight / source.DY + source.off_Y);
String value = "" + Idx;
if (source.OnRenderYAxisLabel != null)
{
value = source.OnRenderYAxisLabel(source, Idx);
}
SizeF dim = g.MeasureString(value, legendFont);
g.DrawString(value, legendFont, b, new PointF((int)offset_x - dim.Width, (int)(offset_y + y0 + 0.5f + dim.Height / 2)));
float GridDistY = source.grid_distance_y;
if (source.AutoScaleY)
{
// calculate a matching grid distance
GridDistY = - Utilities.MostSignificantDigit(source.DY );
if (GridDistY == 0)
{
GridDistY = source.grid_distance_y;
}
}
for (Idx = (source.grid_off_y); Idx > (source.Cur_YD0); Idx -= GridDistY)
for (float Idx = source.grid_off_y; Idx > source.YD0; Idx -= GridDistY)
{
if (Idx != 0)
{
float y1 = (float)((Idx) * source.CurGraphHeight) / source.DY + source.off_Y;
float y1 = (float)(Idx * source.CurGraphHeight) / source.DY + source.off_Y;
value = "" + (Idx);
if (source.OnRenderYAxisLabel != null)
{
value = source.OnRenderYAxisLabel(source, Idx);
}
dim = g.MeasureString(value, legendFont);
g.DrawString(value, legendFont, b, new PointF((int)offset_x - dim.Width, (int)(offset_y + y1 + 0.5f + dim.Height / 2)));
if (y1 >= 0 && y1 < source.CurGraphHeight)
{
string value = (source.OnRenderYAxisLabel == null) ? Idx.ToString() : source.OnRenderYAxisLabel(source, Idx);
SizeF dim = g.MeasureString(value, legendFont);
g.DrawString(value, legendFont, b, new PointF((int)offset_x - dim.Width, (int)(offset_y + y1 + 0.5f + dim.Height / 2)));
}
}
}
for (Idx = (source.grid_off_y); Idx < (source.Cur_YD1); Idx += GridDistY)
for (float Idx = source.grid_off_y; Idx < source.YD1; Idx += GridDistY)
{
if (Idx != 0)
{
float y2 = (float)((Idx) * source.CurGraphHeight) / source.DY + source.off_Y;
float y2 = (float)(Idx * source.CurGraphHeight) / source.DY + source.off_Y;
value = "" + (Idx);
if (source.OnRenderYAxisLabel != null)
{
value = source.OnRenderYAxisLabel(source, Idx);
}
dim = g.MeasureString(value, legendFont);
g.DrawString(value, legendFont, b, new PointF((int)offset_x - dim.Width, (int)(offset_y + y2 + 0.5f + dim.Height / 2)));
if (y2 >= 0 && y2 < source.CurGraphHeight)
{
string value = (source.OnRenderYAxisLabel == null) ? Idx.ToString() : source.OnRenderYAxisLabel(source, Idx);
SizeF dim = g.MeasureString(value, legendFont);
g.DrawString(value, legendFont, b, new PointF((int)offset_x - dim.Width, (int)(offset_y + y2 + 0.5f + dim.Height / 2)));
}
}
}
}
+54 -6
View File
@@ -107,13 +107,61 @@ namespace Results.Entities
return (timeSum == 0) ? 0 : (sum / timeSum);
}
public virtual double AmbTempStart() { return (TestRslts.Count > 0) ? TestRslts[0].AmbTempStart : 0; }
public virtual double AmbPressStart() { return (TestRslts.Count > 0) ? TestRslts[0].AmbPressStart : 0; }
public virtual double AmbHumiStart() { return (TestRslts.Count > 0) ? TestRslts[0].AmbHumiStart : 0; }
public virtual double AmbTempStart()
{
for (int i = 0; i < TestRslts.Count; i++)
{
if (TestRslts[i].Publish() == Config.Entities.Publish.Always)
return TestRslts[i].AmbTempStart;
}
return 0;
}
public virtual double AmbPressStart()
{
for (int i = 0; i < TestRslts.Count; i++)
{
if (TestRslts[i].Publish() == Config.Entities.Publish.Always)
return TestRslts[i].AmbPressStart;
}
return 0;
}
public virtual double AmbHumiStart()
{
for (int i = 0; i < TestRslts.Count; i++)
{
if (TestRslts[i].Publish() == Config.Entities.Publish.Always)
return TestRslts[i].AmbHumiStart;
}
return 0;
}
public virtual double AmbTempEnd() { return (TestRslts.Count > 0) ? TestRslts[TestRslts.Count - 1].AmbTempEnd : 0; }
public virtual double AmbPressEnd() { return (TestRslts.Count > 0) ? TestRslts[TestRslts.Count - 1].AmbPressEnd : 0; }
public virtual double AmbHumiEnd() { return (TestRslts.Count > 0) ? TestRslts[TestRslts.Count - 1].AmbHumiEnd : 0; }
public virtual double AmbTempEnd()
{
for (int i = TestRslts.Count - 1; i >= 0; i++)
{
if (TestRslts[i].Publish() == Config.Entities.Publish.Always)
return TestRslts[i].AmbTempEnd;
}
return 0;
}
public virtual double AmbPressEnd()
{
for (int i = TestRslts.Count - 1; i >= 0; i++)
{
if (TestRslts[i].Publish() == Config.Entities.Publish.Always)
return TestRslts[i].AmbPressEnd;
}
return 0;
}
public virtual double AmbHumiEnd()
{
for (int i = TestRslts.Count - 1; i >= 0; i++)
{
if (TestRslts[i].Publish() == Config.Entities.Publish.Always)
return TestRslts[i].AmbHumiEnd;
}
return 0;
}
public virtual double Buoyancy()
{
+6 -2
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
@@ -10,6 +10,8 @@ namespace Results.Entities
public virtual int Id { get; protected set; }
public virtual byte CompoundMeterId { get; set; } /// 0=single, 1=compound/main, 2=compound/aux., 3=compound/overal, 4=heat meter volume, 5=heat meter energy
public virtual string RegReaderClass { get; set; } /// Not mapped to the DB, does not depent on localisation and customer
public virtual double PulsesMeter { get; set; } /// # of water meter or heat meter pulses
public virtual double PulsesMaster { get; set; } /// # of reference flowmeter pulses (gated by this water meter pulses)
public virtual double PulsesPerLiter { get; set; } /// [l ^ -1], in case of heat meters (CompoundMeterId==5) pulses per kWh in [kWh ^ -1]
@@ -38,7 +40,7 @@ namespace Results.Entities
public virtual double FlowMass() { return TestRslt.FlowMass; } /// [kg/h]
public virtual double FlowVolume() { return TestRslt.FlowVolume; } /// [m3/h]
public virtual double ErrorMaster() { return TestRslt.ErrorMaster; } /// [%]
public virtual double DensityOut() { return TestRslt.DensityOut; }
public virtual double DensityLine() { return TestRslt.DensityLine; }
public virtual Components Components(){ return TestRslt.Components; }
///
public virtual TestData TestData() { return TestRslt.TestData; }
@@ -96,6 +98,8 @@ namespace Results.Entities
{
if (src == null) return;
CompoundMeterId = src.CompoundMeterId;
RegReaderClass = src.RegReaderClass;
PulsesMeter = src.PulsesMeter;
PulsesMaster = src.PulsesMaster;
PulsesPerLiter = src.PulsesPerLiter;
+10 -8
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015-2017 Sensus Metering Systems
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -14,12 +14,13 @@ namespace Results.Entities
public virtual Batch Batch { get; set; }
public virtual TestData TestData { get; set; }
public virtual Components Components { get; set; }
public virtual int Part { get; set; }
public virtual int Part { get; set; }
public virtual int RepetitionNr { get; set; } /// Repetition number from the set of repeated tests (1...)
public virtual string MethodClass { get; set; } /// Not mapped to the DB, does not depent on localisation and customer
/// Main results
public virtual bool TestDone { get; set; }
public virtual string Remark { get; set; }
public virtual string Remark { get; set; }
public virtual DateTime StartTime { get; set; } /// Date and time of the test start
public virtual DateTime EndTime { get; set; } /// Date and time of the test end
public virtual int FlowSetTime { get; set; } /// [s] Measurement time in seconds
@@ -31,7 +32,7 @@ namespace Results.Entities
public virtual double MassEndRaw { get; set; } /// [kg]
public virtual double MassEnd { get; set; } /// [kg]
public virtual double DensityIn { get; set; } /// [kg/m3]
public virtual double DensityOut { get; set; } /// [kg/m3]
public virtual double DensityLine { get; set; } /// [kg/m3]
public virtual double DensityDiv { get; set; } /// [kg/m3]
public virtual double Buoyancy { get; set; }
public virtual double FlowMass { get; set; } /// [kg/h] calculated from conventional true value
@@ -109,7 +110,7 @@ namespace Results.Entities
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
public virtual float Custom2 { get; set; } /// [°C] T ref hi start
public virtual float Custom3 { get; set; } /// [°C] T ref hi end
public virtual float Custom4 { get; set; } /// [°C] T ref hi min
public virtual float Custom5 { get; set; } /// [°C] T ref hi max
@@ -203,7 +204,8 @@ namespace Results.Entities
Components = src.Components; /// ???
Part = src.Part;
RepetitionNr = src.RepetitionNr;
TestDone = src.TestDone;
MethodClass = src.MethodClass;
TestDone = src.TestDone;
Remark = src.Remark;
StartTime = src.StartTime;
EndTime = src.EndTime;
@@ -216,7 +218,7 @@ namespace Results.Entities
MassEndRaw = src.MassEndRaw;
MassEnd = src.MassEnd;
DensityIn = src.DensityIn;
DensityOut = src.DensityOut;
DensityLine = src.DensityLine;
DensityDiv = src.DensityDiv;
Buoyancy = src.Buoyancy;
FlowMass = src.FlowMass;
@@ -313,7 +315,7 @@ namespace Results.Entities
return string.Format("TestRslt: Part={0} RepetitionNr={1} TestDone={2} Remark={3} StartTime={4} EndTime={5} FlowSetTime={6} TestTime={7} PulsesMaster={8} ConstMaster={9} MassStartRaw={10} MassStart={11} MassEndRaw={12} MassEnd={13} DensityIn={14} DensityOut={15} DensityDiv={16} Buoyancy={17} FlowMass={18} FlowVolume={19} VolumeCTV={20} VolumeMaster={21} ErrorMaster={22} DiverterStart={85} DiverterEnd={86} ErrorFlags={23} ErrorFlagsMd={24} AmbTempMean={25} AmbTempStart={26} AmbTempEnd={27} AmbTempMin={28} AmbTempMax={29} AmbPressMean={30} AmbPressStart={31} AmbPressEnd={32} AmbPressMin={33} AmbPressMax={34} AmbHumiMean={35} AmbHumiStart={36} AmbHumiEnd={37} AmbHumiMin={38} AmbHumiMax={39} PressUpMean={40} PressUpStart={41} PressUpEnd={42} PressUpMin={43} PressUpMax={44} PressDownMean={45} PressDownStart={46} PressDownEnd={47} PressDownMin={48} PressDownMax={49} PressDeltaMean={50} PressDeltaStart={51} PressDeltaEnd={52} PressDeltaMin={53} PressDeltaMax={54} TempUpMean={55} TempUpStart={56} TempUpEnd={57} TempUpMin={58} TempUpMax={59} TempDownMean={60} TempDownStart={61} TempDownEnd={62} TempDownMin={63} TempDownMax={64} TempDivMean={65} TempDivStart={66} TempDivEnd={67} TempDivMin={68} TempDivMax={69} FlowMean={70} FlowStart={71} FlowEnd={72} FlowMin={73} FlowMax={74} Custom1={75} Custom2={76} Custom3={77} Custom4={78} Custom5={79} Custom6={80} Custom7={81} Custom8={82} Custom9={83} Custom10={84}",
Part, RepetitionNr, TestDone, Remark, StartTime, EndTime, FlowSetTime, TestTime,
PulsesMaster, ConstMaster, MassStartRaw, MassStart, MassEndRaw, MassEnd,
DensityIn, DensityOut, DensityDiv, Buoyancy, FlowMass, FlowVolume,
DensityIn, DensityLine, DensityDiv, Buoyancy, FlowMass, FlowVolume,
VolumeCTV, VolumeMaster, ErrorMaster, ErrorFlags, ErrorFlagsMd,
AmbTempMean, AmbTempStart, AmbTempEnd, AmbTempMin, AmbTempMax,
AmbPressMean, AmbPressStart, AmbPressEnd, AmbPressMin, AmbPressMax,
+8
View File
@@ -211,6 +211,14 @@ namespace Results
Formatted_WM_ID, /// 184, Formated WM ID string:
/// {0}=start DateTime {1}-end DateTime, {2}=batch nr., {3}=wm pos.(1..max), {4}=s/n string
E21, /// 185
T_line_mean, /// 186
T_line_start, /// 187
T_line_end, /// 188
T_line_avg, /// 189
T_line_min, /// 190
T_line_max, /// 191
Count,
}
+1 -1
View File
@@ -99,7 +99,7 @@ namespace Results
AllItems.Add(new ItemSpec("Procedure name", Strings.Procedure, x => x.ProcedureName(), (x, y, z) => z.ProcedureName(), (x, z) => z.ProcedureName()));
AllItems.Add(new ItemSpec("Batch number", Strings.Batch_nr, x => x.BatchNr().ToString(), (x, y, z) => z.BatchNr().ToString(), (x, z) => z.BatchNr().ToString()));
AllItems.Add(new ItemSpec("Test method", Strings.Test_method, x => x.Method(), (x, y, z) => z.Method(), (x, z) => z.Method()));
AllItems.Add(new ItemSpec("Density", Strings.Density, x => x.DensityOut().ToString("F1"), (x, y, z) => z.DensityOut().ToString("F1"), (x, z) => z.DensityOut().ToString("F1"))); /// [kg/m3]
AllItems.Add(new ItemSpec("Density", Strings.Density, x => x.DensityLine().ToString("F1"), (x, y, z) => z.DensityLine().ToString("F1"), (x, z) => z.DensityLine().ToString("F1"))); /// [kg/m3]
/// Target values
AllItems.Add(new ItemSpec("Q from", Strings.Q_from + " [m3/h]", x => x.Qfrom().ToString("F3"), (x, y, z) => z.Qfrom().ToString("F3"), (x, z) => z.Qfrom().ToString("F3")));
+1 -1
View File
@@ -32,7 +32,7 @@ namespace Results.Mappings
Map(x => x.MassEndRaw);
Map(x => x.MassEnd);
Map(x => x.DensityIn);
Map(x => x.DensityOut);
Map(x => x.DensityLine).Column("DensityOut");
Map(x => x.DensityDiv);
Map(x => x.Buoyancy);
Map(x => x.FlowMass);
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
/// Copyright (c) 2017-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -11,7 +11,7 @@ using Results.Resources;
namespace Results.Output.Printers.OnePerMeter
{
public class OnePerMeterPrintDocument : PrintDocument
public class OnePerMeterPrintDocument : PrintersCommon
{
const float GapBetweenTableColumns = 10;
const float GapBetweenCommonColumns = 10;
@@ -161,99 +161,77 @@ namespace Results.Output.Printers.OnePerMeter
catch (Exception) { } /// Cope with situations when file is missing or is not correct
}
titleHeight = System.Windows.Forms.TextRenderer.MeasureText(header, titleFont).Height;
commonTop = TitleY + titleHeight + spacingOne4Header;
commonHeight = commonItems.Count * spacingOne;
bodyTop = commonTop + commonHeight + spacingOne4Header;
///
/// Title
///
RectangleF printArea = new RectangleF(TitleX, TitleY, printWidth, titleHeight);
e.Graphics.DrawString(header, titleFont, Brushes.Black, printArea);
titleHeight = System.Windows.Forms.TextRenderer.MeasureText(header, titleFont).Height;
commonTop = TitleY + titleHeight + spacingOne4Header;
///
/// Common items
///
string[] leftColumn = new string[commonItems.Count];
string[] rightColumn = new string[commonItems.Count];
int cnt = 0;
Table table = new Table(2);
table.Style = new TableStyle { Font = font, MarginX = 5, MarginY = 3 };
Alignment[] horizAlgn = new Alignment[] { Alignment.Left, Alignment.Left };
VertAlignment[] vertAlgn = new VertAlignment[] { VertAlignment.Top, VertAlignment.Top };
///
foreach (var v in commonItems)
{
leftColumn[cnt] = v.Caption;
rightColumn[cnt] = (batch.WaterMeters.Count > 0) ? v.Print(batch.WaterMeters[0]) : string.Empty;
cnt++;
string[] row = new string[] { v.Caption, (batch.WaterMeters.Count > 0) ? v.Print(batch.WaterMeters[0]) : string.Empty };
table.AddRow(row, horizAlgn, vertAlgn);
}
/// Determine left column width
float maxWidth = 0;
foreach (var str in leftColumn)
{
float width = e.Graphics.MeasureString(str, font).Width;
if (width > maxWidth) maxWidth = width;
}
/// Write aligned columns
for (int i = 0; i < Math.Min(leftColumn.Length, rightColumn.Length); i++)
{
PrintAt(e, leftMargin, commonTop + spacingOne * i, maxWidth, leftColumn[i], font, Alignment.Left);
PrintAt(e, leftMargin + maxWidth + GapBetweenCommonColumns, commonTop + spacingOne * i, 0, rightColumn[i], font, Alignment.Left);
}
}
///
/// Body
///
if (pageNr == 1)
bodyTop = table.Draw(e, (float)leftMargin, commonTop) + spacingOne4Header;
}
///
/// Draw table
///
if (cfg.TestsAreRows)
{
string[] tableHeader;
IList<string[]> tableRows;
Alignment[] itemAlignment;
///
/// Prepare table content: tableHeader + tableRows + itemAlignment
///
if (cfg.TestsAreRows)
TableStyle style = new TableStyle
{
GetContentTestsAreRows(wm, testItems, out tableHeader, out tableRows, out itemAlignment);
}
else
{
GetContentTestsAreColumns(wm, testItems, out tableHeader, out tableRows, out itemAlignment);
}
Font = font,
HeaderFont = headerFont,
MarginX = 5,
MarginY = 3,
LineWidth = 1,
TopHeadersCount = 1,
HorizLines = TableLines.All,
VertLines = TableLines.FirstSecondAndLast
};
DrawTable(e, (float)leftMargin, bodyTop, tableHeader, tableRows, itemAlignment);
GetTable_TestsAreRows(wm, (pageNr == 1) ? testItems : testItems2, style).Draw(e, (float)leftMargin, bodyTop);
}
else
{
string[] tableHeader;
IList<string[]> tableRows;
Alignment[] itemAlignment;
///
/// Prepare table content: tableHeader + tableRows + itemAlignment
///
if (cfg.TestsAreRows2)
TableStyle style = new TableStyle
{
GetContentTestsAreRows(wm, testItems2, out tableHeader, out tableRows, out itemAlignment);
}
else
{
GetContentTestsAreColumns(wm, testItems2, out tableHeader, out tableRows, out itemAlignment);
}
Font = font,
HeaderFont = headerFont,
MarginX = 5,
MarginY = 3,
LineWidth = 1,
LeftHeadersCount = 1,
HorizLines = TableLines.FirstSecondAndLast,
VertLines = TableLines.All
};
DrawTable(e, (float)leftMargin, (float)topMargin, tableHeader, tableRows, itemAlignment);
GetTable_TestsAreColumns(wm, (pageNr == 1) ? testItems : testItems2, style).Draw(e, (float)leftMargin, bodyTop);
}
if (pageNr == nrPages)
{
///
/// Footer on the last page
///
float footerWidth = e.Graphics.MeasureString(footer, footerFont).Width;
PrintAt(e, leftMargin, topMargin + printHeight - 2 * spacingOne, 0, footer, footerFont, Alignment.Left);
PrintAt(e, footer, footerFont, leftMargin, topMargin + printHeight - 2 * spacingOne, 0, 0, Alignment.Left, VertAlignment.Top);
}
///
@@ -261,7 +239,7 @@ namespace Results.Output.Printers.OnePerMeter
///
string pageNrText = string.Format("{0} {1}/{2}", Strings.Page, pageNr, nrPages);
float pageNrWidth = e.Graphics.MeasureString(pageNrText, font).Width;
PrintAt(e, leftMargin + (printWidth - pageNrWidth) / 2, topMargin + printHeight - spacingOne, 0, pageNrText, font, Alignment.Left);
PrintAt(e, pageNrText, font, leftMargin + (printWidth - pageNrWidth) / 2, topMargin + printHeight - spacingOne, 0, 0, Alignment.Left, VertAlignment.Top);
e.HasMorePages = !(pageNr == nrPages);
@@ -269,75 +247,83 @@ namespace Results.Output.Printers.OnePerMeter
}
void GetContentTestsAreRows(Results.Entities.WaterMeter wm, IList<WMeterRsltItemSpec> items, out string[] tableHeader, out IList<string[]> tableRows, out Alignment[] itemAlignment)
Table GetTable_TestsAreRows(Results.Entities.WaterMeter wm, IList<WMeterRsltItemSpec> items, TableStyle style)
{
int tableColumnsCount = items.Count;
/// Top row contains column captions
Table table = new Table(items.Count);
table.Style = style;
tableRows = new List<string[]>();
tableHeader = new string[tableColumnsCount];
itemAlignment = new Alignment[tableColumnsCount];
for (int i = 0; i < tableColumnsCount; i++)
string[] tableHeader = new string[table.ColumnsCount];
Alignment[] horizAlignment = new Alignment[table.ColumnsCount];
VertAlignment[] vertAlignment = new VertAlignment[table.ColumnsCount];
for (int i = 0; i < table.ColumnsCount; i++)
{
tableHeader[i] = items[i].Caption;
itemAlignment[i] = items[i].Alignment;
horizAlignment[i] = Alignment.Center;
vertAlignment[i] = VertAlignment.Middle;
}
table.AddRow(tableHeader, horizAlignment, vertAlignment);
WMeterRsltItemSpec.TableRowNr = 0;
WMeterRsltItemSpec.TableRowNr = 1;
foreach (var mtr in wm.MeterTestRslts)
{
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
{
string[] oneTableRow = new string[tableColumnsCount];
WMeterRsltItemSpec.TableRowNr++;
string[] oneTableRow = new string[table.ColumnsCount];
horizAlignment = new Alignment[table.ColumnsCount];
vertAlignment = new VertAlignment[table.ColumnsCount];
for (int i = 0; i < tableColumnsCount; i++)
for (int i = 0; i < table.ColumnsCount; i++)
{
WMeterRsltItemSpec.TableColumnNr = i + 1;
oneTableRow[i] = items[i].Print(wm, mtr.Name()).Split(new char[] { '|' })[0];
horizAlignment[i] = items[i].Alignment;
vertAlignment[i] = VertAlignment.Middle;
}
tableRows.Add(oneTableRow);
table.AddRow(oneTableRow, horizAlignment, vertAlignment);
WMeterRsltItemSpec.TableRowNr++;
}
}
return table;
}
void GetContentTestsAreColumns(Results.Entities.WaterMeter wm, IList<WMeterRsltItemSpec> items, out string[] tableHeader, out IList<string[]> tableRows, out Alignment[] itemAlignment)
Table GetTable_TestsAreColumns(Results.Entities.WaterMeter wm, IList<WMeterRsltItemSpec> items, TableStyle style)
{
int tableColumnsCount = 1;
/// Left column contains row captions
///
/// Calculate columns count
///
int columnsCount = 1; /// Left column contains item caption
foreach (var mtr in wm.MeterTestRslts)
{
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
{
tableColumnsCount++;
columnsCount++; /// One additional column for each test to be published
}
}
tableRows = new List<string[]>();
tableHeader = new string[tableColumnsCount];
itemAlignment = new Alignment[tableColumnsCount];
Table table = new Table(columnsCount);
table.Style = style;
tableHeader[0] = string.Empty;
itemAlignment[0] = Alignment.Left;
int columnsCount = 1;
foreach (var mtr in wm.MeterTestRslts)
{
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
{
tableHeader[columnsCount] = mtr.Name();
itemAlignment[columnsCount] = Alignment.Left;
columnsCount++;
}
}
WMeterRsltItemSpec.TableRowNr = 0;
///
/// Table content
///
WMeterRsltItemSpec.TableRowNr = 1;
for (int i = 0; i < items.Count; i++)
{
string[] oneTableRow = new string[tableColumnsCount];
WMeterRsltItemSpec.TableRowNr++;
string[] oneTableRow = new string[columnsCount];
Alignment[] horizAlignment = new Alignment[columnsCount];
VertAlignment[] vertAlignment = new VertAlignment[columnsCount];
oneTableRow[0] = items[i].Caption;
horizAlignment[0] = Alignment.Center;
vertAlignment[0] = VertAlignment.Middle;
WMeterRsltItemSpec.TableColumnNr = 1;
foreach (var mtr in wm.MeterTestRslts)
@@ -347,131 +333,19 @@ namespace Results.Output.Printers.OnePerMeter
/// Strip color information
oneTableRow[WMeterRsltItemSpec.TableColumnNr] =
items[i].Print(wm, mtr.Name()).Split(new char[] { '|' })[0];
horizAlignment[WMeterRsltItemSpec.TableColumnNr] = items[i].Alignment;
vertAlignment[WMeterRsltItemSpec.TableColumnNr] = VertAlignment.Middle;
WMeterRsltItemSpec.TableColumnNr++;
}
}
tableRows.Add(oneTableRow);
}
}
table.AddRow(oneTableRow, horizAlignment, vertAlignment);
float DrawTable(System.Drawing.Printing.PrintPageEventArgs e, float left, float top, string[] header, IList<string[]> rows, Alignment[] alignment)
{
int tblColumnsCount = header.Length;
float[] columnWidth = new float[tblColumnsCount];
float[] columnPos = new float[tblColumnsCount + 1];
columnPos[0] = left;
///
/// Measure table column widths and header height
///
float headerHeight = 0;
for (int i = 0; i < tblColumnsCount; i++)
{
SizeF size = e.Graphics.MeasureString(header[i], headerFont);
columnWidth[i] = (int)(size.Width + 0.99f);
if (size.Height > headerHeight) headerHeight = (int)(size.Height + 0.99f);
foreach (var tableRow in rows)
{
int width = (int)(e.Graphics.MeasureString(tableRow[i], font).Width + 0.99f);
if (width > columnWidth[i]) columnWidth[i] = width;
}
columnPos[i + 1] = columnPos[i] + columnWidth[i] + GapBetweenTableColumns;
WMeterRsltItemSpec.TableRowNr++;
}
float tableLeftX = columnPos[0];
float tableRightX = columnPos[tblColumnsCount] - GapBetweenTableColumns;
/// Horizontal line
float horY = top + 1.5f * spacingOne4Header;
e.Graphics.DrawLine(new Pen(Color.Black, 2), new PointF(tableLeftX, horY), new PointF(tableRightX, horY));
///
/// Draw table header
///
for (int i = 0; i < tblColumnsCount; i++)
{
PrintAt(e, columnPos[i],
top + 1.7f * spacingOne4Header,
columnWidth[i],
header[i],
headerFont,
Alignment.Center);
}
/// Horizontal line
horY = top + 2.1f * spacingOne4Header + headerHeight;
e.Graphics.DrawLine(new Pen(Color.Black, 2), new PointF(tableLeftX, horY), new PointF(tableRightX, horY));
///
/// Draw table body
///
int rowsCount = 0;
foreach (var oneTableRow in rows)
{
for (int i = 0; i < tblColumnsCount; i++)
{
PrintAt(e, columnPos[i],
horY + 0.2f * spacingOne4Header + spacingOne * rowsCount,
columnWidth[i],
oneTableRow[i],
font,
alignment[i]);
}
rowsCount++;
}
/// Horizontal line
horY = horY + spacingOne * rowsCount + (3 * spacingOne4Header / 10);
e.Graphics.DrawLine(new Pen(Color.Black, 2), new PointF(tableLeftX, horY), new PointF(tableRightX, horY));
return horY - top + spacingOne;
}
static Font lastFont = null;
static float lastSpacing = 0;
SizeF Measure(System.Drawing.Printing.PrintPageEventArgs e, string paragraph, Font font)
{
if (font != lastFont)
{
lastFont = font;
lastSpacing = e.Graphics.MeasureString("Abcgq", font).Height;
}
string[] lines = paragraph.Split(new char[] { '~' });
float width = 0;
foreach (var line in lines)
{
float lineWid = e.Graphics.MeasureString(line, font).Width;
if (lineWid > width) width = lineWid;
}
return new SizeF(width, 0.8f * lines.Length * lastSpacing + 0.2f);
}
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, float x, float y, float width, string paragraph, Font font, Alignment alignment)
{
SizeF size = Measure(e, paragraph, font);
string[] lines = paragraph.Split(new char[] { '~' });
foreach (var line in lines)
{
float xx;
switch (alignment)
{
default:
case Alignment.Left: xx = x; break;
case Alignment.Center: xx = x + (width - e.Graphics.MeasureString(line, font).Width) / 2; break;
case Alignment.Right: xx = x + width - e.Graphics.MeasureString(line, font).Width; break;
}
e.Graphics.DrawString(line, font, Brushes.Black, new PointF(xx, y));
y += 0.8f * lastSpacing;
}
return table;
}
}
}
@@ -32,7 +32,6 @@ namespace Results.Output.Printers.OnePerMeter
public string[] TestItems2;
public string Footer;
public bool TestsAreRows;
public bool TestsAreRows2;
public string ImgFullPathName;
public int ImgLeft;
public int ImgTop;
+85
View File
@@ -0,0 +1,85 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Printing;
using Config.Entities;
namespace Results.Output.Printers
{
public class PrintersCommon : PrintDocument
{
static Font lastFont = null;
static float lastSpacing = 0;
/// <summary>
/// Measure the size of a paragraph of text, lines are separated by '~'.
/// </summary>
/// <param name="e">PrintPageEventArgs</param>
/// <param name="text">Text, lines are separated by '~'</param>
/// <param name="font">Font</param>
/// <returns>Size of the paragraph of text</returns>
public static SizeF Measure(System.Drawing.Printing.PrintPageEventArgs e, string text, Font font)
{
if (font != lastFont)
{
lastFont = font;
lastSpacing = e.Graphics.MeasureString("Abcgq", font).Height;
}
string[] lines = text.Split(new char[] { '~' });
float width = 0;
foreach (var line in lines)
{
float lineWid = e.Graphics.MeasureString(line, font).Width;
if (lineWid > width) width = lineWid;
}
return new SizeF(width, 0.8f * lines.Length * lastSpacing + 0.2f);
}
/// <summary>
/// Print a paragraph of text, lines are separated by '~'.
/// </summary>
/// <param name="e">PrintPageEventArgs</param>
/// <param name="text">Text, lines are separated by '~'</param>
/// <param name="font">Font</param>
/// <param name="x">Position x</param>
/// <param name="y">Position y</param>
/// <param name="width">Width (required when alignment=Alignment.Center or alignment=Aligmenr.Right</param>
/// <param name="height">Height, 0 = no vertical centering</param>
/// <param name="horizAlignment">Horizontal alignment</param>
/// <param name="vertAlignment">Vertical alignment</param>
public static void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, string text, Font font,
float x, float y, float width, float height,
Alignment horizAlignment, VertAlignment vertAlignment)
{
SizeF size = PrintersCommon.Measure(e, text, font);
string[] lines = text.Split(new char[] { '~' });
if (height <= size.Height) vertAlignment = VertAlignment.Top;
float y0;
switch (vertAlignment)
{
default:
case VertAlignment.Top: y0 = y; break;
case VertAlignment.Middle: y0 = y + (height - size.Height) / 2; break;
case VertAlignment.Bottom: y0 = y + (height - size.Height); break;
}
foreach (var line in lines)
{
float x0;
switch (horizAlignment)
{
default:
case Alignment.Left: x0 = x; break;
case Alignment.Center: x0 = x + (width - e.Graphics.MeasureString(line, font).Width) / 2; break;
case Alignment.Right: x0 = x + width - e.Graphics.MeasureString(line, font).Width; break;
}
e.Graphics.DrawString(line, font, Brushes.Black, new PointF(x0, y0));
y0 += 0.8f * lastSpacing;
}
}
}
}
+202
View File
@@ -0,0 +1,202 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Printing;
using Config.Entities;
namespace Results.Output.Printers
{
public enum TableLines
{
None,
FirstAndLast,
FirstSecondAndLast,
All,
}
public class TableStyle
{
public float MarginX;
public float MarginY;
public Font Font;
public Font HeaderFont;
public int TopHeadersCount;
public int LeftHeadersCount;
public float LineWidth;
public TableLines HorizLines;
public TableLines VertLines;
}
public class Table
{
public readonly int ColumnsCount;
public int RowsCount { get { return Rows.Count; } }
public readonly IList<string[]> Rows;
public readonly IList<Alignment[]> HorizAlignments;
public readonly IList<VertAlignment[]> VertAlignments;
public TableStyle Style;
public Table(int columnsCount)
{
ColumnsCount = columnsCount;
Rows = new List<string[]>();
HorizAlignments = new List<Alignment[]>();
VertAlignments = new List<VertAlignment[]>();
Style = new TableStyle();
}
public void AddRow(string[] texts, Alignment[] horizAlignment, VertAlignment[] vertAlignemnt)
{
Rows.Add(texts);
HorizAlignments.Add(horizAlignment);
VertAlignments.Add(vertAlignemnt);
}
public SizeF Measure(System.Drawing.Printing.PrintPageEventArgs e)
{
SizeF retVal = new SizeF(0, 0);
if (RowsCount == 0) return retVal;
float[] columnWidth = new float[ColumnsCount];
float[] rowHeight = new float[RowsCount];
///
/// Measure table column widths and header height
///
for (int colIx = 0; colIx < ColumnsCount; colIx++)
{
for (int rowIx = 0; rowIx < RowsCount; rowIx++)
{
bool isHeader = (colIx < Style.LeftHeadersCount) || (rowIx < Style.TopHeadersCount);
SizeF size = PrintersCommon.Measure(e, Rows[rowIx][colIx], isHeader ? Style.HeaderFont : Style.Font);
if (size.Width > columnWidth[colIx]) columnWidth[colIx] = size.Width;
if (size.Height > rowHeight[rowIx]) rowHeight[rowIx] = size.Height;
}
bool hasLineToTheLeft = (Style.VertLines == TableLines.All)
|| ((Style.VertLines == TableLines.FirstAndLast) && (colIx == 0))
|| ((Style.VertLines == TableLines.FirstSecondAndLast) && (colIx <= 1));
retVal.Width += columnWidth[colIx] + (hasLineToTheLeft ? (Style.LineWidth + Style.MarginX) : 0) + Style.MarginX;
}
for (int rowIx = 0; rowIx < RowsCount; rowIx++)
{
bool hasLineAbove = (Style.HorizLines == TableLines.All)
|| ((Style.HorizLines == TableLines.FirstAndLast) && (rowIx == 0))
|| ((Style.HorizLines == TableLines.FirstSecondAndLast) && (rowIx <= 1));
retVal.Height += rowHeight[rowIx] + (hasLineAbove ? (Style.LineWidth + Style.MarginY) : 0) + Style.MarginY;
}
if (Style.VertLines == TableLines.None) retVal.Width -= Style.MarginX;
if (Style.HorizLines == TableLines.None) retVal.Height -= Style.MarginY;
return retVal;
}
public float Draw(System.Drawing.Printing.PrintPageEventArgs e, float left, float top)
{
if (RowsCount == 0) return top;
int tblColumnsCount = Rows[0].Length;
float[] columnWidth = new float[tblColumnsCount];
float[] columnPos = new float[tblColumnsCount];
float[] vertLinePos = new float[tblColumnsCount + 1];
float[] rowHeight = new float[RowsCount];
float[] rowPos = new float[RowsCount];
float[] horizLinePos = new float[RowsCount + 1];
///
/// Measure table column widths and header height
///
vertLinePos[0] = left;
horizLinePos[0] = top;
for (int colIx = 0; colIx < tblColumnsCount; colIx++)
{
for (int rowIx = 0; rowIx < RowsCount; rowIx++)
{
bool isHeader = (colIx < Style.LeftHeadersCount) || (rowIx < Style.TopHeadersCount);
SizeF size = PrintersCommon.Measure(e, Rows[rowIx][colIx], isHeader ? Style.HeaderFont : Style.Font);
if (size.Width > columnWidth[colIx]) columnWidth[colIx] = size.Width;
if (size.Height > rowHeight[rowIx]) rowHeight[rowIx] = size.Height;
}
bool hasLineToTheLeft = (Style.VertLines == TableLines.All)
|| ((Style.VertLines == TableLines.FirstAndLast) && (colIx == 0))
|| ((Style.VertLines == TableLines.FirstSecondAndLast) && (colIx <= 1));
columnPos[colIx] = vertLinePos[colIx] + (hasLineToTheLeft ? (Style.LineWidth + Style.MarginX) : 0);
vertLinePos[colIx + 1] = columnPos[colIx] + columnWidth[colIx] + Style.MarginX;
}
for (int rowIx = 0; rowIx < RowsCount; rowIx++)
{
bool hasLineAbove = (Style.HorizLines == TableLines.All)
|| ((Style.HorizLines == TableLines.FirstAndLast) && (rowIx == 0))
|| ((Style.HorizLines == TableLines.FirstSecondAndLast) && (rowIx <= 1));
rowPos[rowIx] = horizLinePos[rowIx] + (hasLineAbove ? Style.MarginY : 0);
horizLinePos[rowIx + 1] = rowPos[rowIx] + rowHeight[rowIx] + Style.LineWidth + Style.MarginY;
}
/// Horizontal lines
float tableLeftX = left;
float tableRightX = vertLinePos[tblColumnsCount] + Style.LineWidth;
if (Style.HorizLines != TableLines.None)
{
for (int rowIx = 0; rowIx <= RowsCount; rowIx++)
{
if (Style.HorizLines == TableLines.All || rowIx == 0 || rowIx == RowsCount || (Style.HorizLines == TableLines.FirstSecondAndLast && rowIx == 1))
{
e.Graphics.DrawLine(new Pen(Color.Black, Style.LineWidth), new PointF(tableLeftX, horizLinePos[rowIx] + Style.LineWidth / 2), new PointF(tableRightX, horizLinePos[rowIx] + Style.LineWidth / 2));
}
}
}
/// Vertical lines
float tableTopY = top;
float tableBottomY = horizLinePos[RowsCount] + Style.LineWidth;
if (Style.VertLines != TableLines.None)
{
for (int colIx = 0; colIx <= tblColumnsCount; colIx++)
{
if (Style.VertLines == TableLines.All || colIx == 0 || colIx == RowsCount || (Style.VertLines == TableLines.FirstSecondAndLast && colIx == 1))
{
e.Graphics.DrawLine(new Pen(Color.Black, Style.LineWidth), new PointF(vertLinePos[colIx] + Style.LineWidth / 2, tableTopY), new PointF(vertLinePos[colIx] + Style.LineWidth / 2, tableBottomY));
}
}
}
///
/// Draw table body
///
for (int rowIndex = 0; rowIndex < RowsCount; rowIndex++)
{
string[] oneTableRow = Rows[rowIndex];
Alignment[] horizAlignment = HorizAlignments[(RowsCount > rowIndex) ? rowIndex : 0];
VertAlignment[] vertAlignment = VertAlignments[(RowsCount > rowIndex) ? rowIndex : 0];
for (int colIndex = 0; colIndex < tblColumnsCount; colIndex++)
{
bool isHeader = (colIndex < Style.LeftHeadersCount) || (rowIndex < Style.TopHeadersCount);
PrintersCommon.PrintAt(e, oneTableRow[colIndex],
isHeader ? Style.HeaderFont : Style.Font,
columnPos[colIndex],
rowPos[rowIndex],
columnWidth[colIndex],
rowHeight[rowIndex],
horizAlignment[colIndex],
vertAlignment[colIndex]);
}
}
return tableBottomY;
}
}
}
+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.18.782.0")]
[assembly: AssemblyFileVersion("2.18.782.0")]
[assembly: AssemblyVersion("2.18.844.0")]
[assembly: AssemblyFileVersion("2.18.844.0")]
+66 -3
View File
@@ -1411,7 +1411,7 @@ namespace Results.Resources {
}
/// <summary>
/// Looks up a localized string similar to Temperature at the diverter at start of the test – first 4 measurements from the start.
/// Looks up a localized string similar to Temperature at the diverter at start of the test – first 4 measurements after the start.
/// </summary>
internal static string Tooltip_T_di_st {
get {
@@ -1474,7 +1474,7 @@ namespace Results.Resources {
}
/// <summary>
/// Looks up a localized string similar to Temperature at the outlet at start of the test – first 4 measurements from the start.
/// Looks up a localized string similar to Temperature at the outlet at start of the test – first 4 measurements after the start.
/// </summary>
internal static string Tooltip_T_dw_st {
get {
@@ -1482,6 +1482,69 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Actual temperature in the line.
/// </summary>
internal static string Tooltip_T_ln_ac {
get {
return ResourceManager.GetString("Tooltip_T_ln_ac", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Average temperature in the line during a test.
/// </summary>
internal static string Tooltip_T_ln_avg {
get {
return ResourceManager.GetString("Tooltip_T_ln_avg", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Temperature in the line at end of the test – last 4 measurement before the end.
/// </summary>
internal static string Tooltip_T_ln_en {
get {
return ResourceManager.GetString("Tooltip_T_ln_en", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Maximum temperature in the line during the test.
/// </summary>
internal static string Tooltip_T_ln_max {
get {
return ResourceManager.GetString("Tooltip_T_ln_max", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Mean temperature in the line during a test.
/// </summary>
internal static string Tooltip_T_ln_me {
get {
return ResourceManager.GetString("Tooltip_T_ln_me", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Minimum temperature in the line during the test.
/// </summary>
internal static string Tooltip_T_ln_min {
get {
return ResourceManager.GetString("Tooltip_T_ln_min", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Temperature in the line at start of the test – first 4 measurements after the start.
/// </summary>
internal static string Tooltip_T_ln_st {
get {
return ResourceManager.GetString("Tooltip_T_ln_st", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Temperature of water sample at water density calibration.
/// </summary>
@@ -1546,7 +1609,7 @@ namespace Results.Resources {
}
/// <summary>
/// Looks up a localized string similar to Temperature at the inlet at start of the test – first 4 measurements from the start.
/// Looks up a localized string similar to Temperature at the inlet at start of the test – first 4 measurements after the start.
/// </summary>
internal static string Tooltip_T_up_st {
get {
+24 -3
View File
@@ -529,7 +529,7 @@
<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>
<value>Temperature at the diverter at start of the test – first 4 measurements after the start</value>
</data>
<data name="Tooltip_T_dw_ac" xml:space="preserve">
<value>Actual temperature at the outlet</value>
@@ -544,7 +544,7 @@
<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>
<value>Temperature at the outlet at start of the test – first 4 measurements after the start</value>
</data>
<data name="Tooltip_T_up_ac" xml:space="preserve">
<value>Actual temperature at the inlet</value>
@@ -559,7 +559,7 @@
<value>Mean temperature at inlet during a test</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>
<value>Temperature at the inlet at start of the test – first 4 measurements after the start</value>
</data>
<data name="aux" xml:space="preserve">
<value>aux.</value>
@@ -699,4 +699,25 @@
<data name="Tooltip_T_rho_0" xml:space="preserve">
<value>Temperature of water sample at water density calibration</value>
</data>
<data name="Tooltip_T_ln_ac" xml:space="preserve">
<value>Actual temperature in the line</value>
</data>
<data name="Tooltip_T_ln_avg" xml:space="preserve">
<value>Average temperature in the line during a test</value>
</data>
<data name="Tooltip_T_ln_en" xml:space="preserve">
<value>Temperature in the line at end of the test – last 4 measurement before the end</value>
</data>
<data name="Tooltip_T_ln_max" xml:space="preserve">
<value>Maximum temperature in the line during the test</value>
</data>
<data name="Tooltip_T_ln_me" xml:space="preserve">
<value>Mean temperature in the line during a test</value>
</data>
<data name="Tooltip_T_ln_min" xml:space="preserve">
<value>Minimum temperature in the line during the test</value>
</data>
<data name="Tooltip_T_ln_st" xml:space="preserve">
<value>Temperature in the line at start of the test – first 4 measurements after the start</value>
</data>
</root>
+6 -2
View File
@@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;GENESIS;IPERL;LANG_DE</DefineConstants>
<DefineConstants>TRACE;DEBUG;RUM_MOB;LANG_RO</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;GENESIS;IPERL;LANG_DE</DefineConstants>
<DefineConstants>TRACE;RUM_MOB;LANG_RO</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
@@ -104,6 +104,9 @@
<SubType>Component</SubType>
</Compile>
<Compile Include="Output\Printers\Enhanced\EnhancedPrinterCfg.cs" />
<Compile Include="Output\Printers\PrintersCommon.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Output\Printers\Munich\MunichPrintDocument.cs">
<SubType>Component</SubType>
</Compile>
@@ -111,6 +114,7 @@
<SubType>Component</SubType>
</Compile>
<Compile Include="Output\Printers\OnePerMeter\OnePerMeterPrinterCfg.cs" />
<Compile Include="Output\Printers\Table.cs" />
<Compile Include="Output\Printers\Zapiska\ZapiskaPrintDocument.cs">
<SubType>Component</SubType>
</Compile>
+14 -7
View File
@@ -172,7 +172,7 @@ namespace Results
///
/// Density
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Density, Strings.Density + " ()", Quantity.Density, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetTestRslt(t).DensityOut)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Density, Strings.Density + " ()", Quantity.Density, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetTestRslt(t).DensityLine)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Density_correction, Strings.Density_correction + " ()", Quantity.Density, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", (w.Batch.DensityCorr))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Rho_Wa_calc, string.Format("{0} of sample", Strings.Density), Quantity.Density, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V4", RealDensity)));
@@ -213,6 +213,12 @@ namespace Results
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) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).TempUpStart + w.GetTestRslt(t).TempUpEnd) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_min, string.Format("{0} UP min ()", Strings.VName_Temp), Strings.Tooltip_T_up_min, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempUpMin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_max, string.Format("{0} UP max ()", Strings.VName_Temp), Strings.Tooltip_T_up_max, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempUpMax)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_line_mean, string.Format("{0} LN ME ()", Strings.VName_Temp), Strings.Tooltip_T_ln_me, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).TempUpMean + w.GetTestRslt(t).TempDownMean) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_line_start, string.Format("{0} LN ST ()", Strings.VName_Temp), Strings.Tooltip_T_ln_st, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).TempUpStart + w.GetTestRslt(t).TempDownStart) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_line_end, string.Format("{0} LN EN ()", Strings.VName_Temp), Strings.Tooltip_T_ln_en, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).TempUpEnd + w.GetTestRslt(t).TempDownEnd) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_line_avg, string.Format("{0} LN avg ()", Strings.VName_Temp), Strings.Tooltip_T_ln_avg, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).TempUpStart + w.GetTestRslt(t).TempDownStart + w.GetTestRslt(t).TempUpEnd + w.GetTestRslt(t).TempDownEnd) / 4)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_line_min, string.Format("{0} LN min ()", Strings.VName_Temp), Strings.Tooltip_T_ln_min, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).TempUpMin + w.GetTestRslt(t).TempDownMin) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_line_max, string.Format("{0} LN max ()", Strings.VName_Temp), Strings.Tooltip_T_ln_max, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).TempUpMax + w.GetTestRslt(t).TempDownMax) / 2)));
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) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempDownMean)));
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) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempDownStart)));
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) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempDownEnd)));
@@ -262,12 +268,12 @@ namespace Results
///
/// Ambient temperature/pressure/humidity/Buoyancy
///
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) => FormatDbl(u, f, p, "V3", (w.GetTestRslt(t) == null) ? w.Batch.AmbTempMean() : w.GetTestRslt(t).AmbTempMean)));
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) => FormatDbl(u, f, p, "V3", (w.GetTestRslt(t) == null) ? w.Batch.AmbTempMean() : w.GetTestRslt(t).AmbTempMean)));
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) => FormatDbl(u, f, p, "V4", (w.GetTestRslt(t) == null) ? w.Batch.AmbPressMean() : w.GetTestRslt(t).AmbPressMean)));
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) => FormatDbl(u, f, p, "V2", (w.GetTestRslt(t) == null) ? w.Batch.AmbHumiMean() : w.GetTestRslt(t).AmbHumiMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Amb_temp_start_end, string.Format("{0} Amb ST/EN", Strings.VName_Temp), Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", (w.GetTestRslt(t) == null) ? w.Batch.AmbTempStart() : w.GetTestRslt(t).AmbTempStart, (w.GetTestRslt(t) == null) ? w.Batch.AmbTempEnd() : w.GetTestRslt(t).AmbTempEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Amb_press_start_end, string.Format("{0} Amb ST/EN", Strings.VName_Press), Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V4", (w.GetTestRslt(t) == null) ? w.Batch.AmbPressStart() : w.GetTestRslt(t).AmbPressStart, (w.GetTestRslt(t) == null) ? w.Batch.AmbPressEnd() : w.GetTestRslt(t).AmbPressEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Amb_humi_start_end, string.Format("{0} Amb ST/EN", Strings.VName_Humi), Quantity.Humidity, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V2", (w.GetTestRslt(t) == null) ? w.Batch.AmbHumiStart() : w.GetTestRslt(t).AmbHumiStart, (w.GetTestRslt(t) == null) ? w.Batch.AmbHumiEnd() : w.GetTestRslt(t).AmbHumiEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_humidity, string.Format("{0} Amb M", Strings.VName_Humi), Strings.Tooltip_Hu_Amb_M, Quantity.Humidity, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V2", (w.GetTestRslt(t) == null) ? w.Batch.AmbHumiMean() : w.GetTestRslt(t).AmbHumiMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Amb_temp_start_end, string.Format("{0} Amb ST/EN", Strings.VName_Temp), Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", (w.GetTestRslt(t) == null) ? w.Batch.AmbTempStart() : w.GetTestRslt(t).AmbTempStart, (w.GetTestRslt(t) == null) ? w.Batch.AmbTempEnd() : w.GetTestRslt(t).AmbTempEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Amb_press_start_end, string.Format("{0} Amb ST/EN", Strings.VName_Press), Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V4", (w.GetTestRslt(t) == null) ? w.Batch.AmbPressStart(): w.GetTestRslt(t).AmbPressStart, (w.GetTestRslt(t) == null) ? w.Batch.AmbPressEnd() : w.GetTestRslt(t).AmbPressEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Amb_humi_start_end, string.Format("{0} Amb ST/EN", Strings.VName_Humi), Quantity.Humidity, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V2", (w.GetTestRslt(t) == null) ? w.Batch.AmbHumiStart() : w.GetTestRslt(t).AmbHumiStart, (w.GetTestRslt(t) == null) ? w.Batch.AmbHumiEnd() : w.GetTestRslt(t).AmbHumiEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Buoyancy, "Buoyancy ()", Quantity.Number, ItemCategory.TestResult, (w, t, u, f, p) => string.IsNullOrEmpty(t) ? FormatDbl(u, f, p, "V6", w.Batch.Buoyancy()) : ((w.GetTestRslt(t) != null) ? FormatDbl(u, f, p, "V6", (w.GetTestRslt(t).Buoyancy)) : "")));
///
@@ -392,6 +398,7 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.E14, "E14 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x2000) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E15, "E15 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x4000) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E16, "E16 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x8000) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E21, "E21 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x100000) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Table_row_nr, "Table row #", Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? TableRowNr.ToString() : string.Format(f, TableRowNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Table_column_nr, "Table column #", Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? TableColumnNr.ToString() : string.Format(f, TableColumnNr)));
@@ -458,7 +465,7 @@ namespace Results
public static string FormatDbl(Config.Unit units, string format, string precisionOrEmpty, string dfltPrecision, double v1, double v2, CultureInfo ci)
{
double val1 = Config.Units.ConvertTo(units, v1);
double val2 = Config.Units.ConvertTo(units, v1);
double val2 = Config.Units.ConvertTo(units, v2);
string precision = string.IsNullOrEmpty(precisionOrEmpty) ? dfltPrecision : precisionOrEmpty;
+3
View File
@@ -27,6 +27,9 @@ namespace ResultsBrowser
public string[] ResultItems;
public string PrinterClass;
public string PrinterCfg;
[XmlArrayAttribute("ResultsClmnWidths")]
public int[] ResultsClmnWidths;
[XmlIgnore]
+199 -199
View File
@@ -28,204 +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.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();
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 = 18;
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 = 19;
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(94, 13);
this.formatLabel.TabIndex = 12;
this.formatLabel.Text = "Time period 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 = "Settings";
this.Load += new System.EventHandler(this.DatabaseSettings_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
@@ -248,6 +248,6 @@
private System.Windows.Forms.TextBox benchNameTextBox5;
private System.Windows.Forms.TextBox benchNameTextBox4;
private System.Windows.Forms.TextBox connectionStringTextBox5;
private System.Windows.Forms.TextBox connectionStringTextBox4;
private System.Windows.Forms.TextBox connectionStringTextBox4;
}
}
@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using ResultsBrowser.Resources;
using TBF.BenchControl;
namespace ResultsBrowser.Forms
{
+112
View File
@@ -0,0 +1,112 @@
namespace ResultsBrowser.Forms
{
partial class PrinterConfigDlg
{
/// <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.printerClassComboBox = new System.Windows.Forms.ComboBox();
this.changePrinterClassButton = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.configureButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// printerClassComboBox
//
this.printerClassComboBox.Enabled = false;
this.printerClassComboBox.FormattingEnabled = true;
this.printerClassComboBox.Location = new System.Drawing.Point(12, 29);
this.printerClassComboBox.Name = "printerClassComboBox";
this.printerClassComboBox.Size = new System.Drawing.Size(389, 21);
this.printerClassComboBox.TabIndex = 0;
//
// changePrinterClassButton
//
this.changePrinterClassButton.Location = new System.Drawing.Point(15, 67);
this.changePrinterClassButton.Name = "changePrinterClassButton";
this.changePrinterClassButton.Size = new System.Drawing.Size(161, 43);
this.changePrinterClassButton.TabIndex = 1;
this.changePrinterClassButton.Text = "Change printer type (configuration will be deleted)";
this.changePrinterClassButton.UseVisualStyleBackColor = true;
this.changePrinterClassButton.Click += new System.EventHandler(this.changePrinterClassButton_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(60, 13);
this.label1.TabIndex = 2;
this.label1.Text = "Printer type";
//
// configureButton
//
this.configureButton.Location = new System.Drawing.Point(196, 67);
this.configureButton.Name = "configureButton";
this.configureButton.Size = new System.Drawing.Size(95, 43);
this.configureButton.TabIndex = 3;
this.configureButton.Text = "Configure";
this.configureButton.UseVisualStyleBackColor = true;
this.configureButton.Click += new System.EventHandler(this.configureButton_Click);
//
// cancelButton
//
this.cancelButton.Location = new System.Drawing.Point(306, 67);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(95, 43);
this.cancelButton.TabIndex = 4;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// PrinterConfigDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(416, 122);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.configureButton);
this.Controls.Add(this.label1);
this.Controls.Add(this.changePrinterClassButton);
this.Controls.Add(this.printerClassComboBox);
this.Name = "PrinterConfigDlg";
this.Text = "Printer configuration";
this.Load += new System.EventHandler(this.PrinterClassDlg_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ComboBox printerClassComboBox;
private System.Windows.Forms.Button changePrinterClassButton;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button configureButton;
private System.Windows.Forms.Button cancelButton;
}
}
+126
View File
@@ -0,0 +1,126 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using TBF.BenchControl;
using TBF.BenchControl.Generic;
namespace ResultsBrowser.Forms
{
public partial class PrinterConfigDlg : Form
{
public string PrinterClass; /// To be initialized in the constructor
public string PrinterCfg;
IList<IComponentFactory> printerFactories; /// Printer components classes
IComponentFactory printerFactory;
public PrinterConfigDlg()
{
InitializeComponent();
printerFactories = new List<IComponentFactory>();
foreach (var fctry in TbfComponents.Factories)
{
if (fctry.ClassName.Contains("Output.Printers.")) printerFactories.Add(fctry);
}
}
private void PrinterClassDlg_Load(object sender, EventArgs e)
{
printerClassComboBox.Items.Add("---");
foreach (var fctry in printerFactories)
{
printerClassComboBox.Items.Add(fctry.ClassName);
}
printerClassComboBox.Text = string.IsNullOrEmpty(PrinterClass) ? "---" : PrinterClass;
}
private void changePrinterClassButton_Click(object sender, EventArgs e)
{
printerClassComboBox.Enabled = true;
}
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
private void configureButton_Click(object sender, EventArgs e)
{
string oriClassName = PrinterClass;
PrinterClass = string.Empty;
if (printerClassComboBox.Text != "---")
{
foreach (var pc in printerFactories)
{
if (printerClassComboBox.Text == pc.ClassName) PrinterClass = pc.ClassName;
}
}
printerFactory = GetFactory(PrinterClass);
if (printerFactory == null)
{
MessageBox.Show("Invalid printer");
return;
}
IComponentCfg printerCfg;
if ((oriClassName != printerFactory.ClassName) || string.IsNullOrEmpty(PrinterCfg))
{
printerCfg = printerFactory.DefaultConfig();
}
else
{
Config.Entities.Component cmpnt = new Config.Entities.Component();
cmpnt.Name = "printer";
cmpnt.ClassName = PrinterClass;
cmpnt.Parameters = PrinterCfg;
printerCfg = printerFactory.CmpntCfgFromCmpntEntity(cmpnt);
}
IComponentCfgCtrl cfgControl = printerCfg.GetControl();
cfgControl.Config = printerCfg;
cfgControl.Config.ItemNr = 0;
TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg();
cfgForm.TbfComponents = new List<Config.Entities.Component>();
cfgForm.ComponentCfgCtrl = cfgControl;
cfgForm.UnlockAfterStart = true;
DialogResult dr = cfgForm.ShowDialog();
if (dr != DialogResult.OK) return;
PrinterCfg = (printerCfg != null) ? printerCfg.CreateDbEntity().Parameters : string.Empty;
DialogResult = DialogResult.OK;
Close();
}
/// <summary>
/// Updates component factory
/// </summary>
/// <param name="className">Component class name</param>
/// <param name="factory">Reference to a factory</param>
/// <returns>true when factory changed</returns>
IComponentFactory GetFactory(string className)
{
if (!string.IsNullOrEmpty(className))
{
foreach (var fac in TbfComponents.Factories)
{
if (fac.ClassName == className) return fac;
}
}
return null;
}
}
}
-237
View File
@@ -1,237 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
namespace ResultsBrowser.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.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.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// 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, 162);
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, 162);
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, 140);
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, 140);
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.None;
this.removeAllButton.Enabled = false;
this.removeAllButton.Location = new System.Drawing.Point(153, 273);
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.None;
this.removeButton.Enabled = false;
this.removeButton.Location = new System.Drawing.Point(153, 238);
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.None;
this.addButton.Enabled = false;
this.addButton.Location = new System.Drawing.Point(153, 203);
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(19, 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(71, 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);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.combinedRadioButton);
this.groupBox1.Controls.Add(this.singleRadioButton);
this.groupBox1.Location = new System.Drawing.Point(12, 21);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(153, 60);
this.groupBox1.TabIndex = 52;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Water Meter";
//
// 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, 358);
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.Name = "ResultsConfig";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "ResultsConfig";
this.Load += new System.EventHandler(this.ResultsConfig_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
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.GroupBox groupBox1;
}
}
-219
View File
@@ -1,219 +0,0 @@
///
/// Copyright (c) 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 Results.Entities;
using ResultsBrowser.Resources;
namespace ResultsBrowser.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 Config.Entities.TestsArrangement TestsArrangement;
public Config.Entities.MetersArrangement MetersArrangement;
public int NrMetersInOneGroup;
public IList<Results.ItemSpec> currentlyAvailableItems;
public IList<Results.ItemSpec> ReportItems_Single;
public IList<Results.ItemSpec> ReportItems_Compound;
bool combined; /// false = single meter items, true = combined meter items
Config.Entities.Device device; /// Screen, Printer or Disk
bool unlocked; /// true = changes enabled
public ResultsConfig(bool combined)
{
InitializeComponent();
this.combined = combined;
device = Config.Entities.Device.Screen;
unlocked = false;
cancelButton.Visible = false;
}
void Localize()
{
Text = Strings.Configuration;
groupBox1.Text = Strings.Water_Meter;
singleRadioButton.Text = Strings.SingleBtnText;
combinedRadioButton.Text = Strings.CombinedBtnText;
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 = !combined;
combinedRadioButton.Checked = combined;
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 (combined)
{
return ReportItems_Compound;
}
else
{
return ReportItems_Single;
}
}
/// <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) && (combined ? item.CanPrintCompoundMeter : item.CanPrintSingle))
{
currentlyAvailableItems.Add(item);
availableResultsListBox.Items.Add(item.Name);
}
}
}
/// <summary>
/// Redraw selected items (right hand side)
/// </summary>
void RedrawSelected()
{
selectedResultsListBox.Items.Clear();
foreach (var item in GetSelectedItems())
{
selectedResultsListBox.Items.Add(item.Name);
}
}
void unlockButton_Click(object sender, EventArgs e)
{
if (!unlocked)
{
//if (!User.CurrentUser.IsMemberOf(RequiredGroupMembership))
//{
// if ((new LoginDlg(RequiredGroupMembership)).ShowDialog() != DialogResult.OK) return;
//}
unlocked = true;
///
/// Unlock user interface controls
///
unlockButton.Enabled = false;
okButton.Text = Strings.OkBtnText;
cancelButton.Visible = true;
availableResultsListBox.Enabled = true;
selectedResultsListBox.Enabled = true;
addButton.Enabled = true;
removeButton.Enabled = true;
removeAllButton.Enabled = true;
}
}
void okButton_Click(object sender, EventArgs e)
{
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();
}
private void singleRadioButton_CheckedChanged(object sender, EventArgs e)
{
}
private void combinedRadioButton_CheckedChanged(object sender, EventArgs e)
{
combined = combinedRadioButton.Checked;
RedrawAvailable();
RedrawSelected();
}
}
}
@@ -1,386 +0,0 @@
///
/// Copyright (c) 2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Printing;
using Config.Entities;
namespace ResultsBrowser.Output.Printers.QueryResults
{
public class QueryResultsPrintDocument : PrintDocument
{
const string FontFamilyName = "Arial"; //"Times New Roman";
const int SpacingOne = 18;
const int SpacingOneAndHalf = (3 * SpacingOne) / 2;
const int TitleX = 240;
const int TitleY = 180; /// Depends on the size of the header
const int FirstLineNr = 14; /// Depends on the size of the header
const int Tab1 = 80; /// Positions of columns above the table
const int Tab2 = 240;
const int Tab3 = 430;
const int Tab4 = 590;
const int BorderW = 1; /// Table border line width
const int MarginTop = 7; /// Margins of the text from table lines
const int MarginLeft = 4; /// Margins of the text from table lines
///
/// Data to print
///
readonly string docVersion;
readonly Results.Entities.WaterMeter wm;
string zaehlertyp;
string pruefvorlage;
readonly IList<Results.Entities.MeterTestRslt> results;
readonly int resultsCount;
readonly bool compound; /// true when MetersKind is MetersKind.Combined
readonly int secondTableOffset; /// Calculated in the constructor
/// Top coordinate of the table
int top;
/// <summary>
/// Property variable for the Font the user wishes to use
/// </summary>
Font font;
Font boldFont;
Font fontTitle;
/// <summary>
/// Constructor
/// </summary>
/// <param name="textToPrint">Text to be printed</param>
public QueryResultsPrintDocument(string docVersion,
Results.Entities.WaterMeter wm,
PageOrientation pageOrientation)
{
this.docVersion = docVersion;
this.wm = wm;
compound = wm.Compound();
string[] info = wm.ProductName().Split(new char[] { ';' });
if (info.Length >= 2)
{
pruefvorlage = info[0];
zaehlertyp = info[1];
}
else if (info.Length == 1)
{
pruefvorlage = info[0];
zaehlertyp = compound ? "Verbundzähler" : "Einzelzähler";
}
else
{
pruefvorlage = wm.ProcedureName();
zaehlertyp = compound ? "Verbundzähler" : "Einzelzähler";
}
results = wm.MeterTestRslts;
this.resultsCount = compound ? (results.Count / 3) : results.Count;
int resultsCount = wm.MeterTestRslts.Count;
if (compound) resultsCount /= 3;
secondTableOffset = (resultsCount + 2) * SpacingOneAndHalf;
DefaultPageSettings.Landscape = (pageOrientation == PageOrientation.Landscape);
}
/// <summary>
/// Override the default onbeginPrint method of the PrintDocument Object.
/// </summary>
/// <param name=e></param>
/// <remarks></remarks>
protected override void OnBeginPrint(System.Drawing.Printing.PrintEventArgs e)
{
base.OnBeginPrint(e);
if (font == null) { font = new Font(FontFamilyName, 10, FontStyle.Regular); }
if (boldFont == null) { boldFont = new Font(FontFamilyName, 10, FontStyle.Bold); }
if (fontTitle == null) { fontTitle = new Font(FontFamilyName, 24, FontStyle.Bold); }
}
/// <summary>
/// Override the default OnPrintPage method of the PrintDocument.
/// </summary>
/// <param name=e></param>
/// <remarks>This provides the print logic for our document</remarks>
protected override void OnPrintPage(System.Drawing.Printing.PrintPageEventArgs e)
{
// Run base code
base.OnPrintPage(e);
/// Set print area size and margins (in dots using 80 dpi)
int printHeight = base.DefaultPageSettings.PaperSize.Height - base.DefaultPageSettings.Margins.Top - base.DefaultPageSettings.Margins.Bottom;
int printWidth = base.DefaultPageSettings.PaperSize.Width - base.DefaultPageSettings.Margins.Left - base.DefaultPageSettings.Margins.Right;
int leftMargin = base.DefaultPageSettings.Margins.Left; /// X
int topMargin = base.DefaultPageSettings.Margins.Top; /// Y
/// Check if the user selected to print in Landscape mode
/// if they did then we need to swap height/width parameters
if (base.DefaultPageSettings.Landscape)
{
int tmp = printHeight;
printHeight = printWidth;
printWidth = tmp;
}
int x = leftMargin;
int y = topMargin;
/// Use the StringFormat class for the text layout of our document
StringFormat format = new StringFormat(StringFormatFlags.LineLimit);
RectangleF printArea = new RectangleF(TitleX, TitleY, 667, 50);
e.Graphics.DrawString(wm.Batch.ProtocolTitle, this.fontTitle, Brushes.Black, printArea);
int lineNr = FirstLineNr;
PrintAt(e, Tab1, lineNr * SpacingOne, docVersion);
lineNr++;
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Prüfstand Nr :");
PrintBoldAt(e, Tab2, lineNr * SpacingOne, wm.BenchId().ToString());
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Datum :");
PrintBoldAt(e, Tab4, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Zählertyp :");
PrintAt(e, Tab2, lineNr * SpacingOne, zaehlertyp);
PrintAt(e, Tab3, lineNr * SpacingOne, "Eichjahr :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.YearOfProduction.ToString());
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Prüfvorlage :");
PrintAt(e, Tab2, lineNr * SpacingOne, pruefvorlage);
lineNr += 2;
if (compound)
{
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Hauptzahler");
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Nebenzahler");
lineNr++;
}
PrintAt(e, Tab1, lineNr * SpacingOne, "Hersteller :");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Producer());
if (compound)
{
PrintAt(e, Tab3, lineNr * SpacingOne, "Hersteller :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.ProducerAux());
}
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Seriennummer :");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.SerialNr);
if (compound)
{
PrintAt(e, Tab3, lineNr * SpacingOne, "Seriennummer :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.SerialNrAux);
}
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Qn :");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Q3_Qn().ToString());
if (compound)
{
PrintAt(e, Tab3, lineNr * SpacingOne, "Qn :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.Q3_Qn_Aux().ToString());
}
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Zulassungszeichen :");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.ApprovalInfo());
if (compound)
{
PrintAt(e, Tab3, lineNr * SpacingOne, "Zulassungszeichen :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.ApprovalInfoAux());
}
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Metr. klasse :");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.MetrologicalClass());
if (compound)
{
PrintAt(e, Tab3, lineNr * SpacingOne, "Metr. klasse :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.MetrologicalClassAux());
}
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Stand :");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.EndState);
if (compound)
{
PrintAt(e, Tab3, lineNr * SpacingOne, "Stand :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.EndStateAux);
lineNr += 2;
PrintAt(e, Tab1, lineNr * SpacingOne, "Umschaltpunkte :");
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Qsteig");
PrintAt(e, Tab2, lineNr * SpacingOne, (1000.0 * wm.QRise).ToString("F1") + " l/h");
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Qfall");
PrintAt(e, Tab2, lineNr * SpacingOne, (1000.0 * wm.QFall).ToString("F1") + " l/h");
}
lineNr += 2;
top = SpacingOne * lineNr;
PrintTable(e);
DrawTable(e);
lineNr += (secondTableOffset * 2) / SpacingOne;
PrintAt(e, Tab1, lineNr * SpacingOne, "Temperatur");
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.AmbHumiMean().ToString("F0") + " %");
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Luftdruck");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbPressMean().ToString("F0") + " mbar");
lineNr++;
PrintAt(e, Tab3, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
lineNr ++;
PrintAt(e, Tab3, lineNr * SpacingOne, "Datum");
PrintAt(e, Tab4, lineNr * SpacingOne, "Unterschrift");
}
/// <summary>
/// Print table texts.
/// </summary>
void PrintTable(System.Drawing.Printing.PrintPageEventArgs e)
{
PrintAt(e, FromTest(-1, -1), "Prüflauf");
PrintAt(e, FromTest(-1, 0), "Q [l/h]");
PrintAt(e, FromTest(-1, 1), "Prüf-Vol.[l]");
PrintAt(e, FromTest(-1, 2), compound ? "HZ-Vol.[l]" : "Z-Vol.[l]");
PrintAt(e, FromTest(-1, 3), compound ? "NZ-Vol.[l]" : "-");
PrintAt(e, FromTest(-1, 4), "Fehler [%]");
PrintAt(e, FromTest(-1, 5), "Ergebnis");
PrintAt(e, FromTest(-1, 6), "Q [l/h]");
PrintAt(e, FromTest(-1, 7), "Temperatur");
PrintAt(e, FromTest(-1, 8), "Dichte");
PrintAt(e, FromTest(-1, 9), "Prüfzeit");
PrintAt(e, FromTest(-1, 10), "Druck Eing.");
PrintAt(e, FromTest(-1, 11), "Druck Ausg.");
int rowCnt = 0;
foreach (var mtr in wm.MeterTestRslts)
{
if (!compound || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
{
Point p = FromTest(rowCnt, -1);
PrintAt(e, p.X, p.Y, mtr.Name());
PrintAt(e, p.X, p.Y + (resultsCount + 2) * SpacingOneAndHalf, mtr.Name());
PrintAt(e, FromTest(rowCnt, 0), mtr.TestRslt.FlowMass.ToString("F1"));
PrintAt(e, FromTest(rowCnt, 1), mtr.TestRslt.VolumeCTV.ToString("F2"));
if (compound)
{
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
PrintAt(e, FromTest(rowCnt, 2), mainMtr.VolumeMeter.ToString("F2"));
PrintAt(e, FromTest(rowCnt, 3), auxMtr.VolumeMeter.ToString("F2"));
PrintAt(e, FromTest(rowCnt, 4), mtr.Error.ToString("F2"));
PrintAt(e, FromTest(rowCnt, 5), mtr.Passed ? "iO" : "NiO");
}
else
{
PrintAt(e, FromTest(rowCnt, 2), mtr.VolumeMeter.ToString("F2"));
PrintAt(e, FromTest(rowCnt, 3), "-");
PrintAt(e, FromTest(rowCnt, 4), mtr.Error.ToString("F2"));
PrintAt(e, FromTest(rowCnt, 5), mtr.Passed ? "iO" : "NiO");
}
PrintAt(e, FromTest(rowCnt, 6), mtr.TestRslt.FlowMass.ToString("F1"));
PrintAt(e, FromTest(rowCnt, 7), mtr.TestRslt.TempDownMean.ToString("F2"));
PrintAt(e, FromTest(rowCnt, 8), mtr.TestRslt.DensityDiv.ToString("F2"));
PrintAt(e, FromTest(rowCnt, 9), mtr.TestTime.ToString("F1"));
PrintAt(e, FromTest(rowCnt, 10), Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressUpMean).ToString("F3"));
PrintAt(e, FromTest(rowCnt, 11), Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressDownMean).ToString("F3"));
rowCnt++;
}
}
}
/// <summary>
/// Draw table lines.
/// </summary>
void DrawTable(System.Drawing.Printing.PrintPageEventArgs e)
{
int mid = top + SpacingOneAndHalf;
int bot = top + (resultsCount + 1) * SpacingOneAndHalf;
int top2 = top + secondTableOffset;
int mid2 = mid + secondTableOffset;
int bot2 = bot + secondTableOffset;
// Horizontal lines
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, top), new Point(747, top));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, mid), new Point(747, mid));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, bot), new Point(747, bot));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, top2), new Point(747, top2));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, mid2), new Point(747, mid2));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, bot2), new Point(747, bot2));
// Vertical lines
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point( 80, top), new Point( 80, bot));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(267, top), new Point(267, bot));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(347, top), new Point(347, bot));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(427, top), new Point(427, bot));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(507, top), new Point(507, bot));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(587, top), new Point(587, bot));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(667, top), new Point(667, bot));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(747, top), new Point(747, bot));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point( 80, top2), new Point( 80, bot2));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(267, top2), new Point(267, bot2));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(347, top2), new Point(347, bot2));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(427, top2), new Point(427, bot2));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(507, top2), new Point(507, bot2));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(587, top2), new Point(587, bot2));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(667, top2), new Point(667, bot2));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(747, top2), new Point(747, bot2));
}
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);
}
Point FromTest(int testNr, int parNr)
{
const int NrParamsInOneTableRow = 6;
int x = 267 + (parNr % NrParamsInOneTableRow) * 80 + MarginLeft;
int y = top + SpacingOneAndHalf + MarginTop + testNr * SpacingOneAndHalf
+ ((parNr >= NrParamsInOneTableRow) ? secondTableOffset : 0);
if (parNr < 0) x = 80 + MarginLeft; /// When parNr == -1 return the left column x coordinate
return new Point(x, y);
}
}
}
+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.18.796.0")]
[assembly: AssemblyFileVersion("2.18.796.0")]
[assembly: AssemblyVersion("2.18.851.0")]
[assembly: AssemblyFileVersion("2.18.851.0")]
+13 -1
View File
@@ -706,7 +706,7 @@
<value>Filters</value>
</data>
<data name="Format_of_results" xml:space="preserve">
<value>Format of results</value>
<value>Configure output</value>
</data>
<data name="Load_filters" xml:space="preserve">
<value>Load filters</value>
@@ -810,4 +810,16 @@
<data name="Print" xml:space="preserve">
<value>Print</value>
</data>
<data name="Configure_printer" xml:space="preserve">
<value>Configure printer</value>
</data>
<data name="No_printer_defined" xml:space="preserve">
<value>No printer defined</value>
</data>
<data name="Printing_failed" xml:space="preserve">
<value>Printing failed</value>
</data>
<data name="Printing_completed" xml:space="preserve">
<value>Printing completed</value>
</data>
</root>
+37 -1
View File
@@ -555,6 +555,15 @@ namespace ResultsBrowser.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Configure printer.
/// </summary>
internal static string Configure_printer {
get {
return ResourceManager.GetString("Configure_printer", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Configure test benches (password required).
/// </summary>
@@ -1186,7 +1195,7 @@ namespace ResultsBrowser.Resources {
}
/// <summary>
/// Looks up a localized string similar to Format of results.
/// Looks up a localized string similar to Configure output.
/// </summary>
internal static string Format_of_results {
get {
@@ -1635,6 +1644,15 @@ namespace ResultsBrowser.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to No printer defined.
/// </summary>
internal static string No_printer_defined {
get {
return ResourceManager.GetString("No_printer_defined", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to No program settings found. .
/// </summary>
@@ -1761,6 +1779,24 @@ namespace ResultsBrowser.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Printing completed.
/// </summary>
internal static string Printing_completed {
get {
return ResourceManager.GetString("Printing_completed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Printing failed.
/// </summary>
internal static string Printing_failed {
get {
return ResourceManager.GetString("Printing_failed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Procedure.
/// </summary>
+11 -10
View File
@@ -21,7 +21,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;GENESIS;IPERL;LANG_DE</DefineConstants>
<DefineConstants>TRACE;DEBUG;RUM_MOB;LANG_RO</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;GENESIS;IPERL;LANG_DE</DefineConstants>
<DefineConstants>TRACE;RUM_MOB;LANG_RO</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
@@ -125,11 +125,11 @@
<Compile Include="Forms\NoBenchOrDatabaseDlg.designer.cs">
<DependentUpon>NoBenchOrDatabaseDlg.cs</DependentUpon>
</Compile>
<Compile Include="Forms\ResultsConfig.cs">
<Compile Include="Forms\PrinterConfigDlg.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\ResultsConfig.designer.cs">
<DependentUpon>ResultsConfig.cs</DependentUpon>
<Compile Include="Forms\PrinterConfigDlg.Designer.cs">
<DependentUpon>PrinterConfigDlg.cs</DependentUpon>
</Compile>
<Compile Include="Forms\StatisticsDlg.cs">
<SubType>Form</SubType>
@@ -144,9 +144,6 @@
<DependentUpon>StatisticsOptionsDlg.cs</DependentUpon>
</Compile>
<Compile Include="LocalSettings.cs" />
<Compile Include="Output\Printers\QueryResults\QueryResultsPrintDocument.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Output\Printers\Statistics\StatisticsPrintDocument.cs">
<SubType>Component</SubType>
</Compile>
@@ -188,8 +185,8 @@
<EmbeddedResource Include="Forms\NoBenchOrDatabaseDlg.resx">
<DependentUpon>NoBenchOrDatabaseDlg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\ResultsConfig.resx">
<DependentUpon>ResultsConfig.cs</DependentUpon>
<EmbeddedResource Include="Forms\PrinterConfigDlg.resx">
<DependentUpon>PrinterConfigDlg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\StatisticsDlg.resx">
<DependentUpon>StatisticsDlg.cs</DependentUpon>
@@ -239,6 +236,10 @@
<Project>{9D0DCC88-DC81-47EB-9FDD-4C3907871BFB}</Project>
<Name>Results</Name>
</ProjectReference>
<ProjectReference Include="..\TBF\TBF.csproj">
<Project>{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}</Project>
<Name>TBF</Name>
</ProjectReference>
<ProjectReference Include="..\Users\Users.csproj">
<Project>{6E5CB0E9-E1B6-4E5D-AC6E-B1049E180F2B}</Project>
<Name>Users</Name>
+332 -319
View File
@@ -28,325 +28,337 @@
/// </summary>
private void InitializeComponent()
{
this.vSplitContainer = new System.Windows.Forms.SplitContainer();
this.hSplitContainer = new System.Windows.Forms.SplitContainer();
this.filtersGroupBox = new System.Windows.Forms.GroupBox();
this.filtersFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
this.resultsGroupBox = new System.Windows.Forms.GroupBox();
this.resultsListView = new System.Windows.Forms.ListView();
this.statisticsBtn = new System.Windows.Forms.Button();
this.printQueryResultsBtn = new System.Windows.Forms.Button();
this.exportQueryResultsBtn = new System.Windows.Forms.Button();
this.formatOfResultsBtn = new System.Windows.Forms.Button();
this.clearFiltersBtn = new System.Windows.Forms.Button();
this.settingsBtn = new System.Windows.Forms.Button();
this.saveConfigBtn = new System.Windows.Forms.Button();
this.loadConfigBtn = new System.Windows.Forms.Button();
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();
((System.ComponentModel.ISupportInitialize)(this.vSplitContainer)).BeginInit();
this.vSplitContainer.Panel1.SuspendLayout();
this.vSplitContainer.Panel2.SuspendLayout();
this.vSplitContainer.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.hSplitContainer)).BeginInit();
this.hSplitContainer.Panel1.SuspendLayout();
this.hSplitContainer.Panel2.SuspendLayout();
this.hSplitContainer.SuspendLayout();
this.filtersGroupBox.SuspendLayout();
this.resultsGroupBox.SuspendLayout();
this.testBenchesGroupBox.SuspendLayout();
this.SuspendLayout();
//
// vSplitContainer
//
this.vSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.vSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.vSplitContainer.Location = new System.Drawing.Point(0, 0);
this.vSplitContainer.Name = "vSplitContainer";
//
// vSplitContainer.Panel1
//
this.vSplitContainer.Panel1.Controls.Add(this.hSplitContainer);
this.vSplitContainer.Panel1MinSize = 100;
//
// vSplitContainer.Panel2
//
this.vSplitContainer.Panel2.Controls.Add(this.statisticsBtn);
this.vSplitContainer.Panel2.Controls.Add(this.printQueryResultsBtn);
this.vSplitContainer.Panel2.Controls.Add(this.exportQueryResultsBtn);
this.vSplitContainer.Panel2.Controls.Add(this.formatOfResultsBtn);
this.vSplitContainer.Panel2.Controls.Add(this.clearFiltersBtn);
this.vSplitContainer.Panel2.Controls.Add(this.settingsBtn);
this.vSplitContainer.Panel2.Controls.Add(this.saveConfigBtn);
this.vSplitContainer.Panel2.Controls.Add(this.loadConfigBtn);
this.vSplitContainer.Panel2.Controls.Add(this.executeQueryBtn);
this.vSplitContainer.Panel2.Controls.Add(this.addFilterBtn);
this.vSplitContainer.Panel2.Controls.Add(this.testBenchesGroupBox);
this.vSplitContainer.Panel2MinSize = 100;
this.vSplitContainer.Size = new System.Drawing.Size(984, 712);
this.vSplitContainer.SplitterDistance = 840;
this.vSplitContainer.TabIndex = 0;
//
// hSplitContainer
//
this.hSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.hSplitContainer.Location = new System.Drawing.Point(0, 0);
this.hSplitContainer.Name = "hSplitContainer";
this.hSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// hSplitContainer.Panel1
//
this.hSplitContainer.Panel1.Controls.Add(this.filtersGroupBox);
//
// hSplitContainer.Panel2
//
this.hSplitContainer.Panel2.Controls.Add(this.resultsGroupBox);
this.hSplitContainer.Size = new System.Drawing.Size(840, 712);
this.hSplitContainer.SplitterDistance = 280;
this.hSplitContainer.TabIndex = 0;
//
// filtersGroupBox
//
this.filtersGroupBox.Controls.Add(this.filtersFlowLayoutPanel);
this.filtersGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.filtersGroupBox.Location = new System.Drawing.Point(0, 0);
this.filtersGroupBox.Name = "filtersGroupBox";
this.filtersGroupBox.Size = new System.Drawing.Size(840, 280);
this.filtersGroupBox.TabIndex = 1;
this.filtersGroupBox.TabStop = false;
this.filtersGroupBox.Text = "Filters";
//
// filtersFlowLayoutPanel
//
this.filtersFlowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.filtersFlowLayoutPanel.Location = new System.Drawing.Point(3, 16);
this.filtersFlowLayoutPanel.Name = "filtersFlowLayoutPanel";
this.filtersFlowLayoutPanel.Size = new System.Drawing.Size(834, 261);
this.filtersFlowLayoutPanel.TabIndex = 0;
//
// resultsGroupBox
//
this.resultsGroupBox.Controls.Add(this.resultsListView);
this.resultsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.resultsGroupBox.Location = new System.Drawing.Point(0, 0);
this.resultsGroupBox.Name = "resultsGroupBox";
this.resultsGroupBox.Size = new System.Drawing.Size(840, 428);
this.resultsGroupBox.TabIndex = 1;
this.resultsGroupBox.TabStop = false;
this.resultsGroupBox.Text = "Query results";
//
// resultsListView
//
this.resultsListView.Dock = System.Windows.Forms.DockStyle.Fill;
this.resultsListView.Location = new System.Drawing.Point(3, 16);
this.resultsListView.Name = "resultsListView";
this.resultsListView.Size = new System.Drawing.Size(834, 409);
this.resultsListView.TabIndex = 0;
this.resultsListView.UseCompatibleStateImageBehavior = false;
this.resultsListView.View = System.Windows.Forms.View.Details;
//
// statisticsBtn
//
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;
this.statisticsBtn.Text = "Statistics";
this.statisticsBtn.UseVisualStyleBackColor = true;
this.statisticsBtn.Click += new System.EventHandler(this.statisticsBtn_Click);
//
// printQueryResultsBtn
//
this.printQueryResultsBtn.Location = new System.Drawing.Point(8, 506);
this.printQueryResultsBtn.Name = "printQueryResultsBtn";
this.printQueryResultsBtn.Size = new System.Drawing.Size(125, 33);
this.printQueryResultsBtn.TabIndex = 9;
this.printQueryResultsBtn.Text = "Print query results";
this.printQueryResultsBtn.UseVisualStyleBackColor = true;
this.printQueryResultsBtn.Click += new System.EventHandler(this.printQueryResultsBtn_Click);
//
// exportQueryResultsBtn
//
this.exportQueryResultsBtn.Location = new System.Drawing.Point(8, 467);
this.exportQueryResultsBtn.Name = "exportQueryResultsBtn";
this.exportQueryResultsBtn.Size = new System.Drawing.Size(125, 33);
this.exportQueryResultsBtn.TabIndex = 8;
this.exportQueryResultsBtn.Text = "Export query results";
this.exportQueryResultsBtn.UseVisualStyleBackColor = true;
this.exportQueryResultsBtn.Click += new System.EventHandler(this.exportQueryResultsBtn_Click);
//
// formatOfResultsBtn
//
this.formatOfResultsBtn.Location = new System.Drawing.Point(8, 274);
this.formatOfResultsBtn.Name = "formatOfResultsBtn";
this.formatOfResultsBtn.Size = new System.Drawing.Size(125, 33);
this.formatOfResultsBtn.TabIndex = 7;
this.formatOfResultsBtn.Text = "Format of results";
this.formatOfResultsBtn.UseVisualStyleBackColor = true;
this.formatOfResultsBtn.Click += new System.EventHandler(this.formatOfResultsBtn_Click);
//
// clearFiltersBtn
//
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;
this.clearFiltersBtn.Text = "Clear filters";
this.clearFiltersBtn.UseVisualStyleBackColor = true;
this.clearFiltersBtn.Click += new System.EventHandler(this.clearFiltersBtn_Click);
//
// settingsBtn
//
this.settingsBtn.Location = new System.Drawing.Point(8, 12);
this.settingsBtn.Name = "settingsBtn";
this.settingsBtn.Size = new System.Drawing.Size(125, 33);
this.settingsBtn.TabIndex = 0;
this.settingsBtn.Text = "Settings";
this.settingsBtn.UseVisualStyleBackColor = true;
this.settingsBtn.Click += new System.EventHandler(this.settingsBtn_Click);
//
// saveConfigBtn
//
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;
this.saveConfigBtn.Text = "Save configuration";
this.saveConfigBtn.UseVisualStyleBackColor = true;
this.saveConfigBtn.Click += new System.EventHandler(this.saveConfigBtn_Click);
//
// loadConfigBtn
//
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;
this.loadConfigBtn.Text = "Load configuration";
this.loadConfigBtn.UseVisualStyleBackColor = true;
this.loadConfigBtn.Click += new System.EventHandler(this.loadConfigBtn_Click);
//
// executeQueryBtn
//
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;
this.executeQueryBtn.Text = "Execute query";
this.executeQueryBtn.UseVisualStyleBackColor = true;
this.executeQueryBtn.Click += new System.EventHandler(this.executeQueryBtn_Click);
//
// addFilterBtn
//
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;
this.addFilterBtn.Text = "Add filter";
this.addFilterBtn.UseVisualStyleBackColor = true;
this.addFilterBtn.Click += new System.EventHandler(this.addFilterBtn_Click);
//
// 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, 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, 65);
this.checkBox3.Name = "checkBox3";
this.checkBox3.Size = new System.Drawing.Size(85, 17);
this.checkBox3.TabIndex = 2;
this.checkBox3.TabStop = true;
this.checkBox3.Text = "radioButton3";
this.checkBox3.UseVisualStyleBackColor = true;
this.checkBox3.CheckedChanged += new System.EventHandler(this.checkBox3_CheckedChanged);
//
// checkBox2
//
this.checkBox2.AutoSize = true;
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;
this.checkBox2.TabStop = true;
this.checkBox2.Text = "radioButton2";
this.checkBox2.UseVisualStyleBackColor = true;
this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged);
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Location = new System.Drawing.Point(23, 23);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(85, 17);
this.checkBox1.TabIndex = 0;
this.checkBox1.TabStop = true;
this.checkBox1.Text = "radioButton1";
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
//
// ResultsBrowserWnd
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(984, 712);
this.Controls.Add(this.vSplitContainer);
this.Name = "ResultsBrowserWnd";
this.Text = "Results Browser";
this.Load += new System.EventHandler(this.ResultsBrowserWnd_Load);
this.vSplitContainer.Panel1.ResumeLayout(false);
this.vSplitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.vSplitContainer)).EndInit();
this.vSplitContainer.ResumeLayout(false);
this.hSplitContainer.Panel1.ResumeLayout(false);
this.hSplitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.hSplitContainer)).EndInit();
this.hSplitContainer.ResumeLayout(false);
this.filtersGroupBox.ResumeLayout(false);
this.resultsGroupBox.ResumeLayout(false);
this.testBenchesGroupBox.ResumeLayout(false);
this.testBenchesGroupBox.PerformLayout();
this.ResumeLayout(false);
this.vSplitContainer = new System.Windows.Forms.SplitContainer();
this.hSplitContainer = new System.Windows.Forms.SplitContainer();
this.filtersGroupBox = new System.Windows.Forms.GroupBox();
this.filtersFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
this.resultsGroupBox = new System.Windows.Forms.GroupBox();
this.resultsListView = new System.Windows.Forms.ListView();
this.printerConfigBtn = new System.Windows.Forms.Button();
this.statisticsBtn = new System.Windows.Forms.Button();
this.printQueryResultsBtn = new System.Windows.Forms.Button();
this.exportQueryResultsBtn = new System.Windows.Forms.Button();
this.formatOfResultsBtn = new System.Windows.Forms.Button();
this.clearFiltersBtn = new System.Windows.Forms.Button();
this.settingsBtn = new System.Windows.Forms.Button();
this.saveConfigBtn = new System.Windows.Forms.Button();
this.loadConfigBtn = new System.Windows.Forms.Button();
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();
((System.ComponentModel.ISupportInitialize)(this.vSplitContainer)).BeginInit();
this.vSplitContainer.Panel1.SuspendLayout();
this.vSplitContainer.Panel2.SuspendLayout();
this.vSplitContainer.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.hSplitContainer)).BeginInit();
this.hSplitContainer.Panel1.SuspendLayout();
this.hSplitContainer.Panel2.SuspendLayout();
this.hSplitContainer.SuspendLayout();
this.filtersGroupBox.SuspendLayout();
this.resultsGroupBox.SuspendLayout();
this.testBenchesGroupBox.SuspendLayout();
this.SuspendLayout();
//
// vSplitContainer
//
this.vSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.vSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.vSplitContainer.Location = new System.Drawing.Point(0, 0);
this.vSplitContainer.Name = "vSplitContainer";
//
// vSplitContainer.Panel1
//
this.vSplitContainer.Panel1.Controls.Add(this.hSplitContainer);
this.vSplitContainer.Panel1MinSize = 100;
//
// vSplitContainer.Panel2
//
this.vSplitContainer.Panel2.Controls.Add(this.printerConfigBtn);
this.vSplitContainer.Panel2.Controls.Add(this.statisticsBtn);
this.vSplitContainer.Panel2.Controls.Add(this.printQueryResultsBtn);
this.vSplitContainer.Panel2.Controls.Add(this.exportQueryResultsBtn);
this.vSplitContainer.Panel2.Controls.Add(this.formatOfResultsBtn);
this.vSplitContainer.Panel2.Controls.Add(this.clearFiltersBtn);
this.vSplitContainer.Panel2.Controls.Add(this.settingsBtn);
this.vSplitContainer.Panel2.Controls.Add(this.saveConfigBtn);
this.vSplitContainer.Panel2.Controls.Add(this.loadConfigBtn);
this.vSplitContainer.Panel2.Controls.Add(this.executeQueryBtn);
this.vSplitContainer.Panel2.Controls.Add(this.addFilterBtn);
this.vSplitContainer.Panel2.Controls.Add(this.testBenchesGroupBox);
this.vSplitContainer.Panel2MinSize = 100;
this.vSplitContainer.Size = new System.Drawing.Size(984, 712);
this.vSplitContainer.SplitterDistance = 840;
this.vSplitContainer.TabIndex = 0;
//
// hSplitContainer
//
this.hSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.hSplitContainer.Location = new System.Drawing.Point(0, 0);
this.hSplitContainer.Name = "hSplitContainer";
this.hSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// hSplitContainer.Panel1
//
this.hSplitContainer.Panel1.Controls.Add(this.filtersGroupBox);
//
// hSplitContainer.Panel2
//
this.hSplitContainer.Panel2.Controls.Add(this.resultsGroupBox);
this.hSplitContainer.Size = new System.Drawing.Size(840, 712);
this.hSplitContainer.SplitterDistance = 280;
this.hSplitContainer.TabIndex = 0;
//
// filtersGroupBox
//
this.filtersGroupBox.Controls.Add(this.filtersFlowLayoutPanel);
this.filtersGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.filtersGroupBox.Location = new System.Drawing.Point(0, 0);
this.filtersGroupBox.Name = "filtersGroupBox";
this.filtersGroupBox.Size = new System.Drawing.Size(840, 280);
this.filtersGroupBox.TabIndex = 1;
this.filtersGroupBox.TabStop = false;
this.filtersGroupBox.Text = "Filters";
//
// filtersFlowLayoutPanel
//
this.filtersFlowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.filtersFlowLayoutPanel.Location = new System.Drawing.Point(3, 16);
this.filtersFlowLayoutPanel.Name = "filtersFlowLayoutPanel";
this.filtersFlowLayoutPanel.Size = new System.Drawing.Size(834, 261);
this.filtersFlowLayoutPanel.TabIndex = 0;
//
// resultsGroupBox
//
this.resultsGroupBox.Controls.Add(this.resultsListView);
this.resultsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.resultsGroupBox.Location = new System.Drawing.Point(0, 0);
this.resultsGroupBox.Name = "resultsGroupBox";
this.resultsGroupBox.Size = new System.Drawing.Size(840, 428);
this.resultsGroupBox.TabIndex = 1;
this.resultsGroupBox.TabStop = false;
this.resultsGroupBox.Text = "Query results";
//
// resultsListView
//
this.resultsListView.Dock = System.Windows.Forms.DockStyle.Fill;
this.resultsListView.Location = new System.Drawing.Point(3, 16);
this.resultsListView.Name = "resultsListView";
this.resultsListView.Size = new System.Drawing.Size(834, 409);
this.resultsListView.TabIndex = 0;
this.resultsListView.UseCompatibleStateImageBehavior = false;
this.resultsListView.View = System.Windows.Forms.View.Details;
//
// printerConfigBtn
//
this.printerConfigBtn.Location = new System.Drawing.Point(8, 316);
this.printerConfigBtn.Name = "printerConfigBtn";
this.printerConfigBtn.Size = new System.Drawing.Size(125, 35);
this.printerConfigBtn.TabIndex = 11;
this.printerConfigBtn.Text = "Configure printer";
this.printerConfigBtn.UseVisualStyleBackColor = true;
this.printerConfigBtn.Click += new System.EventHandler(this.printerConfigBtn_Click);
//
// statisticsBtn
//
this.statisticsBtn.Location = new System.Drawing.Point(8, 621);
this.statisticsBtn.Name = "statisticsBtn";
this.statisticsBtn.Size = new System.Drawing.Size(125, 35);
this.statisticsBtn.TabIndex = 10;
this.statisticsBtn.Text = "Statistics";
this.statisticsBtn.UseVisualStyleBackColor = true;
this.statisticsBtn.Click += new System.EventHandler(this.statisticsBtn_Click);
//
// printQueryResultsBtn
//
this.printQueryResultsBtn.Location = new System.Drawing.Point(8, 548);
this.printQueryResultsBtn.Name = "printQueryResultsBtn";
this.printQueryResultsBtn.Size = new System.Drawing.Size(125, 35);
this.printQueryResultsBtn.TabIndex = 9;
this.printQueryResultsBtn.Text = "Print query results";
this.printQueryResultsBtn.UseVisualStyleBackColor = true;
this.printQueryResultsBtn.Click += new System.EventHandler(this.printQueryResultsBtn_Click);
//
// exportQueryResultsBtn
//
this.exportQueryResultsBtn.Location = new System.Drawing.Point(8, 508);
this.exportQueryResultsBtn.Name = "exportQueryResultsBtn";
this.exportQueryResultsBtn.Size = new System.Drawing.Size(125, 35);
this.exportQueryResultsBtn.TabIndex = 8;
this.exportQueryResultsBtn.Text = "Export query results";
this.exportQueryResultsBtn.UseVisualStyleBackColor = true;
this.exportQueryResultsBtn.Click += new System.EventHandler(this.exportQueryResultsBtn_Click);
//
// formatOfResultsBtn
//
this.formatOfResultsBtn.Location = new System.Drawing.Point(8, 276);
this.formatOfResultsBtn.Name = "formatOfResultsBtn";
this.formatOfResultsBtn.Size = new System.Drawing.Size(125, 35);
this.formatOfResultsBtn.TabIndex = 7;
this.formatOfResultsBtn.Text = "Configure output";
this.formatOfResultsBtn.UseVisualStyleBackColor = true;
this.formatOfResultsBtn.Click += new System.EventHandler(this.formatOfResultsBtn_Click);
//
// clearFiltersBtn
//
this.clearFiltersBtn.Location = new System.Drawing.Point(8, 196);
this.clearFiltersBtn.Name = "clearFiltersBtn";
this.clearFiltersBtn.Size = new System.Drawing.Size(125, 35);
this.clearFiltersBtn.TabIndex = 2;
this.clearFiltersBtn.Text = "Clear filters";
this.clearFiltersBtn.UseVisualStyleBackColor = true;
this.clearFiltersBtn.Click += new System.EventHandler(this.clearFiltersBtn_Click);
//
// settingsBtn
//
this.settingsBtn.Location = new System.Drawing.Point(8, 12);
this.settingsBtn.Name = "settingsBtn";
this.settingsBtn.Size = new System.Drawing.Size(125, 33);
this.settingsBtn.TabIndex = 0;
this.settingsBtn.Text = "Settings";
this.settingsBtn.UseVisualStyleBackColor = true;
this.settingsBtn.Click += new System.EventHandler(this.settingsBtn_Click);
//
// saveConfigBtn
//
this.saveConfigBtn.Location = new System.Drawing.Point(8, 356);
this.saveConfigBtn.Name = "saveConfigBtn";
this.saveConfigBtn.Size = new System.Drawing.Size(125, 35);
this.saveConfigBtn.TabIndex = 5;
this.saveConfigBtn.Text = "Save configuration";
this.saveConfigBtn.UseVisualStyleBackColor = true;
this.saveConfigBtn.Click += new System.EventHandler(this.saveConfigBtn_Click);
//
// loadConfigBtn
//
this.loadConfigBtn.Location = new System.Drawing.Point(8, 396);
this.loadConfigBtn.Name = "loadConfigBtn";
this.loadConfigBtn.Size = new System.Drawing.Size(125, 35);
this.loadConfigBtn.TabIndex = 4;
this.loadConfigBtn.Text = "Load configuration";
this.loadConfigBtn.UseVisualStyleBackColor = true;
this.loadConfigBtn.Click += new System.EventHandler(this.loadConfigBtn_Click);
//
// executeQueryBtn
//
this.executeQueryBtn.Location = new System.Drawing.Point(8, 468);
this.executeQueryBtn.Name = "executeQueryBtn";
this.executeQueryBtn.Size = new System.Drawing.Size(125, 35);
this.executeQueryBtn.TabIndex = 6;
this.executeQueryBtn.Text = "Execute query";
this.executeQueryBtn.UseVisualStyleBackColor = true;
this.executeQueryBtn.Click += new System.EventHandler(this.executeQueryBtn_Click);
//
// addFilterBtn
//
this.addFilterBtn.Location = new System.Drawing.Point(8, 236);
this.addFilterBtn.Name = "addFilterBtn";
this.addFilterBtn.Size = new System.Drawing.Size(125, 35);
this.addFilterBtn.TabIndex = 3;
this.addFilterBtn.Text = "Add filter";
this.addFilterBtn.UseVisualStyleBackColor = true;
this.addFilterBtn.Click += new System.EventHandler(this.addFilterBtn_Click);
//
// 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, 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, 65);
this.checkBox3.Name = "checkBox3";
this.checkBox3.Size = new System.Drawing.Size(85, 17);
this.checkBox3.TabIndex = 2;
this.checkBox3.TabStop = true;
this.checkBox3.Text = "radioButton3";
this.checkBox3.UseVisualStyleBackColor = true;
this.checkBox3.CheckedChanged += new System.EventHandler(this.checkBox3_CheckedChanged);
//
// checkBox2
//
this.checkBox2.AutoSize = true;
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;
this.checkBox2.TabStop = true;
this.checkBox2.Text = "radioButton2";
this.checkBox2.UseVisualStyleBackColor = true;
this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged);
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Location = new System.Drawing.Point(23, 23);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(85, 17);
this.checkBox1.TabIndex = 0;
this.checkBox1.TabStop = true;
this.checkBox1.Text = "radioButton1";
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
//
// ResultsBrowserWnd
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(984, 712);
this.Controls.Add(this.vSplitContainer);
this.Name = "ResultsBrowserWnd";
this.Text = "Results Browser";
this.Load += new System.EventHandler(this.ResultsBrowserWnd_Load);
this.vSplitContainer.Panel1.ResumeLayout(false);
this.vSplitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.vSplitContainer)).EndInit();
this.vSplitContainer.ResumeLayout(false);
this.hSplitContainer.Panel1.ResumeLayout(false);
this.hSplitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.hSplitContainer)).EndInit();
this.hSplitContainer.ResumeLayout(false);
this.filtersGroupBox.ResumeLayout(false);
this.resultsGroupBox.ResumeLayout(false);
this.testBenchesGroupBox.ResumeLayout(false);
this.testBenchesGroupBox.PerformLayout();
this.ResumeLayout(false);
}
@@ -374,5 +386,6 @@
private System.Windows.Forms.ListView resultsListView;
private System.Windows.Forms.RadioButton checkBox5;
private System.Windows.Forms.RadioButton checkBox4;
private System.Windows.Forms.Button printerConfigBtn;
}
}
+131 -23
View File
@@ -1,11 +1,14 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;
using NHibernate;
using Results.Entities;
using TBF.BenchControl;
using TBF.BenchControl.Generic;
using TBF.BenchControl.GenericDevices;
using ResultsBrowser.Filters;
using ResultsBrowser.Resources;
using System.IO;
namespace ResultsBrowser
{
@@ -13,7 +16,7 @@ namespace ResultsBrowser
{
const string OpenFileDlg_SaveFileDlg_Filter = "{0} (*.qry)|*.qry|{1} (*.*)|*.*";
string[] args;
string[] args; /// Comand line argument
IList<Filters.IFilter> filters; /// Filters and the UI of filters
FiltersConfig filtersConfig; /// Serializable configuration of filters and displayed results
@@ -23,13 +26,20 @@ namespace ResultsBrowser
DateTime timePeriodStart;
DateTime timePeriodEnd;
static IList<IComponent> tbfComponents;
static IList<IDevice> tbfDevices;
public ResultsBrowserWnd(string[] args)
{
InitializeComponent();
filters = new List<Filters.IFilter>();
filtersConfig = new FiltersConfig();
this.args = args;
tbfComponents = new List<TBF.BenchControl.Generic.IComponent>();
tbfDevices = new List<IDevice>();
timePeriodStart = new DateTime(0);
timePeriodEnd = new DateTime(0);
}
@@ -95,15 +105,19 @@ namespace ResultsBrowser
resultsGroupBox.Text = Strings.Query_results;
settingsBtn.Text = Strings.Settings;
testBenchesGroupBox.Text = Strings.Test_benches;
clearFiltersBtn.Text = Strings.Clear_filters;
clearFiltersBtn.Text = Strings.Clear_filters;
addFilterBtn.Text = Strings.Add_filter;
loadConfigBtn.Text = Strings.Load_filters;
formatOfResultsBtn.Text = Strings.Format_of_results;
printerConfigBtn.Text = Strings.Configure_printer;
loadConfigBtn.Text = Strings.Load_filters;
saveConfigBtn.Text = Strings.Save_filters;
executeQueryBtn.Text = Strings.Execute_query;
formatOfResultsBtn.Text = Strings.Format_of_results;
executeQueryBtn.Text = Strings.Execute_query;
exportQueryResultsBtn.Text = Strings.Export_query_results;
printQueryResultsBtn.Text = Strings.Print_query_results;
statisticsBtn.Text = Strings.Statistics;
statisticsBtn.Text = Strings.Statistics;
}
private void settingsBtn_Click(object sender, EventArgs e)
@@ -147,6 +161,34 @@ namespace ResultsBrowser
}
}
private void formatOfResultsBtn_Click(object sender, EventArgs e)
{
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg();
dlg.MetersKind = Config.Entities.MetersKind.Single;
dlg.SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
if (dlg.ShowDialog() == DialogResult.OK)
{
filtersConfig.ResultItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
RedrawResults();
}
}
private void printerConfigBtn_Click(object sender, EventArgs e)
{
Forms.PrinterConfigDlg dlg = new Forms.PrinterConfigDlg
{
PrinterClass = filtersConfig.PrinterClass,
PrinterCfg = filtersConfig.PrinterCfg
};
if (dlg.ShowDialog() == DialogResult.OK)
{
filtersConfig.PrinterClass = dlg.PrinterClass;
filtersConfig.PrinterCfg = dlg.PrinterCfg;
}
}
private void loadConfigBtn_Click(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
@@ -244,7 +286,11 @@ namespace ResultsBrowser
}
catch (Exception exc)
{
MessageBox.Show(exc.Message, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
string message = exc.Message;
if (exc.InnerException != null)
message += string.Format("{0}Inner exception:{0}{1}", Environment.NewLine, exc.InnerException.Message);
MessageBox.Show(message, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
@@ -291,19 +337,6 @@ namespace ResultsBrowser
}
}
private void formatOfResultsBtn_Click(object sender, EventArgs e)
{
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg();
dlg.MetersKind = Config.Entities.MetersKind.Single;
dlg.SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
if (dlg.ShowDialog() == DialogResult.OK)
{
filtersConfig.ResultItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
RedrawResults();
}
}
private void exportQueryResultsBtn_Click(object sender, EventArgs e)
{
IList<Results.WMeterRsltItemSpec> items = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
@@ -378,8 +411,64 @@ namespace ResultsBrowser
"PT40 Z/E-35-A",
"0111-OOP-C035-13").Print();
}
#else
if (string.IsNullOrEmpty(filtersConfig.PrinterClass))
{
MessageBox.Show(Strings.No_printer_defined);
return;
}
try
{
Config.Entities.Component cmpnt = new Config.Entities.Component();
cmpnt.Name = "printer";
cmpnt.ClassName = filtersConfig.PrinterClass;
cmpnt.Parameters = filtersConfig.PrinterCfg;
IComponentFactory printerFactory = GetFactory(filtersConfig.PrinterClass);
IComponentCfg printerCfg = printerFactory.CmpntCfgFromCmpntEntity(cmpnt);
IComponent component = printerFactory.GetComponent(printerCfg, tbfComponents);
IResultsPrinter printer = component as IResultsPrinter;
if (printer== null)
{
MessageBox.Show(Strings.No_printer_defined);
return;
}
tbfComponents.Clear();
tbfDevices.Clear();
tbfComponents.Add(component);
IDevice dev = component as IDevice;
if (dev != null)
{
dev.Initialize();
tbfDevices.Add(dev);
}
/// Find batches
IList<Results.Entities.Batch> batches = new List<Results.Entities.Batch>();
foreach (var wm in waterMeters)
{
if (!batches.Contains(wm.Batch)) batches.Add(wm.Batch);
}
foreach (var batch in batches)
{
IOperation printOp = printer.PrintResultsOp(batch);
printOp.Start();
while (printOp.Run() != Event.ResultsPrinted) { }
printOp.Stop();
}
MessageBox.Show(Strings.Printing_completed);
}
catch (Exception)
{
MessageBox.Show(Strings.Printing_failed);
}
#endif
}
}
private void statisticsBtn_Click(object sender, EventArgs e)
{
@@ -404,5 +493,24 @@ namespace ResultsBrowser
timePeriodStart, timePeriodEnd);
statisticsDlg.ShowDialog();
}
}
/// <summary>
/// Updates component factory
/// </summary>
/// <param name="className">Component class name</param>
/// <param name="factory">Reference to a factory</param>
/// <returns>true when factory changed</returns>
IComponentFactory GetFactory(string className)
{
if (!string.IsNullOrEmpty(className))
{
foreach (var fac in TbfComponents.Factories)
{
if (fac.ClassName == className) return fac;
}
}
return null;
}
}
}
+4 -6
View File
@@ -3,9 +3,7 @@
///
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO.Ports;
using System.Text;
using log4net;
using Config.Entities;
using TBF.BenchControl.Generic;
@@ -33,9 +31,9 @@ namespace TBF.BenchControl.Ambient.Comet
///
/// Measured values when MsrmntState == MsrmntState.Valid
///
float temperature; /// [deg C]
float temperature; /// [°C]
float pressure; /// [bar]
float humidity; /// [%]
float humidity; /// [R%]
/// <summary>Measurement time stamp when MsrmntState == MsrmntState.Valid</summary>
int msrmntTimeStamp;
@@ -119,8 +117,8 @@ namespace TBF.BenchControl.Ambient.Comet
msrmntTimeStamp = StateMachine.Time;
msrmntState = MsrmntState.Valid;
log.InfoFormat("Ambient: temperature = {0} C, humidity = {1} %, pressure = {2} mbar", temperature.ToString("F1"), humidity.ToString("F1"), (1000 * pressure).ToString("F0"));
}
log.InfoFormat("Ambient: temperature = {0:F1} C, humidity = {1:F1} %, pressure = {2:F0} mbar", temperature, humidity, 1000 * pressure);
}
}
}
catch (Exception e)
+4 -4
View File
@@ -34,9 +34,9 @@ namespace TBF.BenchControl.Ambient.Greco
///
/// Measured values when MsrmntState == MsrmntState.Valid
///
float temperature; /// [deg C]
float temperature; /// [°C]
float pressure; /// [bar]
float humidity; /// [%]
float humidity; /// [R%]
/// <summary>Measurement time stamp when MsrmntState == MsrmntState.Valid</summary>
int msrmntTimeStamp;
@@ -136,8 +136,8 @@ namespace TBF.BenchControl.Ambient.Greco
msrmntTimeStamp = StateMachine.Time;
msrmntState = MsrmntState.Valid;
log.InfoFormat("Ambient: temperature = {0} C, humidity = {1} %, pressure = {2} mbar", temperature.ToString("F1"), humidity.ToString("F1"), (1000 * pressure).ToString("F0"));
}
log.InfoFormat("Ambient: temperature = {0:F1} C, humidity = {1:F1} %, pressure = {2:F0} mbar", temperature, humidity, 1000 * pressure);
}
else
{
log.Warn("Invalid string received: " + measurement);
+2 -1
View File
@@ -53,6 +53,7 @@ namespace TBF.BenchControl.Elde
public UInt128 RRoute { get { return controlCom.RRoute; } }
public uint DivTime(int id) { return controlCom.DivTime(id); }
public float TTime { get { return controlCom.TTime; } }
public float ImpulseTime(int wmNr1) { return controlCom.ImpulseTime(wmNr1); }
public uint FmState { get { return controlCom.FmState; } }
public uint BeginState(int wmNr0) { return controlCom.BeginState(wmNr0); }
public double ReferenceFlow { get { return controlCom.ReferenceFlow; } }
@@ -225,7 +226,7 @@ namespace TBF.BenchControl.Elde
for (int i = 0; i < MettlerToledo.Multi.BalanceDev.BalancesCount; i++)
{
controlCom.SetWeight(i, MettlerToledo.Multi.BalanceDev.Masses[i]);
controlCom.SetWeight(i, MettlerToledo.Multi.BalanceDev.Masses[i]);
}
}
+5 -4
View File
@@ -21,9 +21,9 @@ namespace TBF.BenchControl.Elde
public float ReferenceFreq { get { return referenceFreq; } }
int[] etPulses = new int[Config.Data.WMsCount + 1];
public int EtPulses(int wmNr1and0)
public int EtPulses(int wmNr1)
{
return etPulses[wmNr1and0];
return etPulses[wmNr1];
}
public int EtPulsesK { get { return 1; } }
@@ -54,8 +54,9 @@ namespace TBF.BenchControl.Elde
public uint DivTime(int id) { return 0; }
public void SetDivLimit(int divNo, uint limLoPct, uint limHiPct) { }
float tTime = 0;
float tTime = 1;
public float TTime { get { return tTime; } }
public float ImpulseTime(int wmNr1) { return tTime; }
public uint FmState { get { return 0; } }
public uint BeginState(int wmNr0) { return 0; }
@@ -205,7 +206,7 @@ namespace TBF.BenchControl.Elde
bool bit39 = (route & 0x00FC000000000000) != 0; /// true if any of bits 50 through 55 is set
route = route & 0xFF03FFFFFFFFFFFF;
if (bit39) route = route | 0x0000008000000000;
log.DebugFormat("SendCommand route = {0}", Utils.ShowRoute(route));
log.DebugFormat("SendCommand route = {0}", Utils.RouteToStr(route));
#endif
TestBenchSim.SimRoute = this.simRoute = route;
this.totalRefPulses = totalRefPulses;
+11 -5
View File
@@ -31,13 +31,13 @@ namespace TBF.BenchControl.Elde
/// </summary>
public float ReferenceFreq { get { return 1000.0f * ctrlBrdComponent.referenceFreq[0]; } } /// In [Hz] 0..2500, nom.=2000
#endif
public int EtPulses(int wmNr0) { return (int)ctrlBrdComponent.etPulses[wmNr0]; }
#if FUZHOU300 || PT200IL || PUCHONG_PT200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50
public int EtPulses(int wmNr1) { return (int)ctrlBrdComponent.etPulses[wmNr1]; }
#if GENESIS || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50
public int EtPulsesK { get { return (int)ctrlBrdComponent.etPulsesK; } }
#else
public int EtPulsesK { get { return 1; } }
#endif
public UInt16 WMeterPulses(int wmNr0) { return (UInt16)ctrlBrdComponent.wMeterPuls[wmNr0]; }
public UInt16 WMeterPulses(int wmNr1) { return (UInt16)ctrlBrdComponent.wMeterPuls[wmNr1]; }
public int WMeterReference(int wmNr0) { return (int)ctrlBrdComponent.wMeterReference[wmNr0]; }
public uint RegulValveDAC { get { return ctrlBrdComponent.StavDA; } }
public float Pressure(int prsNr0) { return ctrlBrdComponent.pressure[prsNr0]; }
@@ -62,6 +62,12 @@ namespace TBF.BenchControl.Elde
#endif
public float TTime { get { return ctrlBrdComponent.Ttime; } }
#if DN100 || MUNICH
public float ImpulseTime(int wmNr1) { return ctrlBrdComponent.Ttime; }
#else
public float ImpulseTime(int wmNr1) { return ctrlBrdComponent.ImpulseTime[wmNr1]; }
#endif
#if DN100 || MUNICH || FUZHOU150
public uint FmState { get { return ctrlBrdComponent.fMState; } }
#else //if everything newer
@@ -80,7 +86,7 @@ namespace TBF.BenchControl.Elde
public float AnalogInput(int adcNr0) { return ctrlBrdComponent.Analogy[adcNr0]; }
public uint AnalogInputRaw(int adcNr0, int bank) { return ctrlBrdComponent.AnalogyRaw[adcNr0, bank]; } /// bank0=RV, bank1=Temp
#if DN100 || MUNICH || BADGER_MALA_TRAT || BADGER_VELKA_TRAT || FUZHOU40 || FUZHOU150 || FUZHOU300 || PT200IL || PUCHONG_PT200 || TORINO50 || TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40
#if DN100 || MUNICH || BADGER_MALA_TRAT || BADGER_VELKA_TRAT || FUZHOU_40 || FUZHOU150 || FUZHOU300 || PT200IL || PUCHONG_PT200 || TORINO50 || TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40
public float TotalRefVolume { get { return ctrlBrdComponent.ReferenceVolume; } }
public float MassRefVolume { get { return ctrlBrdComponent.ReferenceVolume; } }
#else /// all new test benches
@@ -358,7 +364,7 @@ namespace TBF.BenchControl.Elde
#if DN100 || MUNICH
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, (uint)totalRefPulses, (uint)testMethods,
filterConstant, fmFreq[0], (uint)regConst, (uint)shortImp, (uint)stopDevs);
#elif BADGER_MALA_TRAT || BADGER_VELKA_TRAT || FUZHOU40 || FUZHOU150 || FUZHOU300 || PT200IL || PUCHONG_PT200 || TORINO50 || TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40
#elif BADGER_MALA_TRAT || BADGER_VELKA_TRAT || FUZHOU_40 || FUZHOU150 || FUZHOU300 || PT200IL || PUCHONG_PT200 || TORINO50 || TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, (uint)totalRefPulses, (uint)testMethods,
filterConstant, fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
#elif GENESIS || BERLIN || SLM_150 || PETERSBURG_200
+10 -7
View File
@@ -29,8 +29,8 @@ namespace TBF.BenchControl.Elde.Diverter
public static int[] DivStartingLevelPct;
public static int[] DivStoppingLevelPct;
protected int diverterNr; /// 0-based diverter number
readonly int diverterNr0; /// 0-based diverter number
public int DiverterNr { get { return diverterNr0 + 1; } } /// 1-based public diverter number
readonly DiverterCfg diverterCfg;
@@ -64,7 +64,7 @@ namespace TBF.BenchControl.Elde.Diverter
diverterNr = nextIdx++;
diverterNr0 = nextIdx++;
///
if (Diverters == null || Diverters.Length < nextIdx)
{
@@ -161,10 +161,13 @@ namespace TBF.BenchControl.Elde.Diverter
DiverterCfg tmpcfg = args.Cfg as DiverterCfg;
if (tmpcfg != null && tmpcfg.Name.Equals(Name))
{
#if GENESIS || PETERSBURG_200
int flowMtrNr = int.Parse(Name.Substring(3)) + 1;
#else /// PETERSBURG_50
int flowMtrNr = Name.Contains("1") ? 1 : 3;
int diverterNr = int.Parse(Name.Substring(3));
#if GENESIS || PETERSBURG_50 || PETERSBURG_200 || FUZHOU_40 || FUZHOU150 || FUZHOU300
int flowMtrNr = diverterNr + 1;
#elif BADGER_STREDNA_TRAT
int flowMtrNr = (diverterNr == 1) ? 1 : ((diverterNr == 2) ? 9 : 20);
#else
int flowMtrNr = (diverterNr == 1) ? 1 : 3;
#endif
if (args.Command == CfgChangeCmd.CfgChange)
+3 -2
View File
@@ -10,9 +10,9 @@ namespace TBF.BenchControl.Elde
{
StatusP StatusP { get; }
float ReferenceFreq { get; }
int EtPulses(int wmNr0);
int EtPulses(int wmNr1);
int EtPulsesK { get; }
UInt16 WMeterPulses(int wmNr0);
UInt16 WMeterPulses(int wmNr1);
int WMeterReference(int wmNr0);
uint RegulValveDAC { get; }
float Pressure(int prsNr0);
@@ -21,6 +21,7 @@ namespace TBF.BenchControl.Elde
UInt128 RRoute { get; }
uint DivTime(int id); /// 50% id=0, 10% id=1, 90% id=2
float TTime { get; }
float ImpulseTime(int WMNr1);
uint FmState { get; }
uint BeginState(int wmNr0);
float ReferenceFlow { get; }
+2 -2
View File
@@ -90,7 +90,7 @@ namespace TBF.BenchControl.Elde
if (outputPath.Diverter is Elde.Diverter.Diverter)
{
diverterNr = (outputPath.Diverter as Elde.Diverter.Diverter).AdcNr - 4;
diverterNr = (outputPath.Diverter as Elde.Diverter.Diverter).DiverterNr;
}
nominalFlow = outputPath.FlowMeter.NominalFlow;
@@ -114,7 +114,7 @@ namespace TBF.BenchControl.Elde
#if TURA_IPERL || TURA_SPECIAL || BADGER_VELKA_TRAT || SLM_50
int flowMeterIdxAndDiv = flowMeterNr + 16 * diverterNr;
#elif BADGER_STREDNA_TRAT
int flowMeterIdxAndDiv = flowMeterNr + 8 * diverterNr;
int flowMeterIdxAndDiv = flowMeterNr + 8 * (diverterNr - 1);
#else
int flowMeterIdxAndDiv = flowMeterNr;
#endif
+53 -4
View File
@@ -83,19 +83,50 @@ namespace TBF.BenchControl
0.191203,
0.049025,
};
}
/// <summary>
/// Calculate density of distilled water from temperature
/// </summary>
/// <param name="t">ITS-90 temperature in [°C]</param>
/// <returns>Density in [kg/m3]</returns>
public static double DistilledWaterDensityFromTemp(double t)
{
if (t <= 40)
{
const double c0 = 999.839564;
const double c1 = 0.067998613;
const double c2 = -0.0091101468;
const double c3 = 0.00010058299;
const double c4 = -0.0000011275659;
const double c5 = 6.5985371e-09;
return ((((c5 * t + c4) * t + c3) * t + c2) * t + c1) * t + c0;
}
else
{
const double a0 = 9.9983952E2;
const double a1 = 1.6952577E1;
const double a2 = -7.9905127E-3;
const double a3 = -4.6241757E-5;
const double a4 = 1.0584601E-7;
const double a5 = -2.8103006E-10;
const double b = 1.6887236E-2;
return (((((a5 * t + a4) * t + a3) * t + a2) * t + a1) * t + a0) / (1.0 + b * t);
}
}
/// <summary>
/// Calculate density of distilled water from temperature
/// Calculate density of distilled water from temperature (obsolete)
/// </summary>
/// <param name="t">Temperature in [°C]</param>
/// <param name="t">IPTS-68 temperature in [°C]</param>
/// <returns>Density in [kg/m3]</returns>
public static double DistilledWaterDensityFromTemp(double t)
public static double DistilledWaterDensityFromTempIPTS68(double t)
{
const double a0 = 999.842594;
const double a1 = 0.06793952;
const double a2 = -0.00909529;
const double a2 = -0.009095290;
const double a3 = 0.0001001685;
const double a4 = -0.000001120083;
const double a5 = 6.536332e-09;
@@ -128,6 +159,24 @@ namespace TBF.BenchControl
DensityCorrection(Program.LocalSettings.RealDensity, Program.LocalSettings.AtTemperature);
}
/// <summary>
/// Calculate corrected (real) water density from temperature
/// </summary>
/// <param name="t">Temperature in [°C]</param>
/// <returns>Density in [kg/m3]</returns>
public static double WaterDensityFromTempPress(double temp, double pressure)
{
double x0 = 5.08821E-10;
double x1 = 1.2639418;
double x2 = 0.2660269;
double x3 = 0.3734838;
double x4 = 2.0205242;
double theta = temp / 100.0;
double B = x0 * (((x3 * theta + x2) * theta + x1) * theta + 1) / (1 + x4 * theta);
return WaterDensityFromTemp(temp) * (1 + B * Config.Units.ConvertTo(Config.Unit.Pa, pressure));
}
public static float AirDensityFromAmbientVales(float tempC, float pressureBar, float humiPct)
{
@@ -0,0 +1,16 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
namespace TBF.BenchControl.GenericDevices
{
public interface IPlotter
{
int StartGraph(int batchNr, string testName, int repetition);
void UpdateGraph(int graphId, float x, float y);
void StopGraph(int graphId, float ymin, float ymax);
}
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015-2017 Sensus Metering Systems
/// Copyright (c) 2015-2018 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -31,7 +31,7 @@ namespace TBF.BenchControl.MettlerToledo.Multi
protected readonly BalanceCfg balanceCfg;
protected static BalanceCfg balance1Cfg;
/// <summary>
/// <summary>
/// Enumeration of balances via static fields and methods
/// </summary>
static int nextBalanceIdx = 0;
@@ -48,7 +48,7 @@ namespace TBF.BenchControl.MettlerToledo.Multi
protected static SerialPort serialPort;
protected static StringBuilder stringBuilder;
public int ScaleNr { get { return balanceNr; } }
public int ScaleNr { get { return balanceNr; } }
public int IdNr { get { return balanceCfg.IdNr; } }
public double Capacity { get { return balanceCfg.Capacity; } }
public double Resolution { get { return balanceCfg.Resolution; } }
@@ -150,7 +150,11 @@ namespace TBF.BenchControl.MettlerToledo.Multi
msrmntState = (MsrmntState)((int)MsrmntState.Busy + scaleId);
stringBuilder.Clear();
#if BADGER_STREDNA_TRAT
string serialData = string.Format("AR WT0{0}01\r\n", 3 - scaleId); /// 2->1 a 1->2
#else
string serialData = string.Format("AR WT0{0}01\r\n", scaleId);
#endif
serialPort.Write(serialData);
log.InfoFormat("{0} - GetStableMassMeasurement() ... \"{1}\" sent", name, serialData);
return true;
@@ -174,8 +178,12 @@ namespace TBF.BenchControl.MettlerToledo.Multi
msrmntState = (MsrmntState)((int)MsrmntState.Busy + scaleId);
stringBuilder.Clear();
#if BADGER_STREDNA_TRAT
string serialData = string.Format("AR WT0{0}01\r\n", 3 - scaleId); /// 2->1 a 1->2
#else
string serialData = string.Format("AR WT0{0}01\r\n", scaleId);
serialPort.Write(serialData);
#endif
serialPort.Write(serialData);
log.InfoFormat("{0} - GetImmediateMassMeasurement() ... \"{1}\" sent", name, serialData);
return true;
}
@@ -62,6 +62,7 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
void Localize()
{
nameLabel.Text = Strings.Name;
parentNameLabel.Text = Strings.Parent_name;
hwAddressLabel.Text = Strings.Serial_Number;
}
@@ -100,13 +101,13 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
if (!parentNameComboBox.Items.Contains(parentNameComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format("Invalid '{0}'", Strings.Parent_name);
message += Environment.NewLine + string.Format(Strings.Invalid_0, parentNameLabel.Text);
}
if (!int.TryParse(hwAddressTextBox.Text, out dummy) || dummy % 100 > 63)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format("'{0}' is not correct", hwAddressLabel.Text);
message += Environment.NewLine + string.Format(Strings.Invalid_0, hwAddressLabel.Text);
}
TestImagesMode newTestImagesMode = TestImagesMode.Invalid;
@@ -117,14 +118,14 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
if (newTestImagesMode == TestImagesMode.Invalid)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format("Invalid {0}", testImagesModeLabel.Text);
message += Environment.NewLine + string.Format(Strings.Invalid_0, testImagesModeLabel.Text);
}
if (!int.TryParse(testImagesCountTextBox.Text, out dummy) || dummy < 0 || dummy > 3000
|| ((dummy == 0) && (newTestImagesMode != TestImagesMode.None)))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format("Invalid {0}", testImagesCountLabel.Text);
message += Environment.NewLine + string.Format(Strings.Invalid_0, testImagesCountLabel.Text);
}
@@ -0,0 +1,263 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using log4net;
using Config.Entities;
using TBF.BenchControl.Generic;
using TBF.Boxes;
namespace TBF.BenchControl.Network.Comet.Ambient
{
/// <summary>
/// Ambient temperature / humidity / pressure meter 'Greco' connected via serial interface (RS232)
/// Connection settings: 9600 Bd 8-bits No-parity 2-stop-bits Flow control: none.
/// </summary>
public class Ambient : ComponentBase, IDevice, IOperation, GenericDevices.IAmbient
{
private static readonly ILog log = LogManager.GetLogger(typeof(Ambient));
public override string ToString() { return string.Format("Ambient({0})", Cfg.ToString(1)); }
readonly AmbientCfg myCfg;
readonly IPAddress ipAddress;
readonly int tcpPort;
TcpClient tcpClient;
NetworkStream networkStream;
enum State
{
Idle,
WaitingForTemperature,
WaitingForHumidity,
WaitingForPressure,
};
State state;
/// <summary>The state of the measurement</summary>
MsrmntState msrmntState;
///
/// Measured values when MsrmntState == MsrmntState.Valid
///
float temperature; /// [°C]
float pressure; /// [bar]
float humidity; /// [R%]
/// <summary>Measurement time stamp when MsrmntState == MsrmntState.Valid</summary>
int msrmntTimeStamp;
public Ambient()
{
}
/// <summary>
/// Ambient temperature / humidity / pressure meter 'Greco' connected via serial interface (RS232)
/// </summary>
public Ambient(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
: base(cfg)
{
myCfg = cfg as AmbientCfg;
if (myCfg == null) throw new ArgumentNullException("No configuration");
ipAddress = IPAddress.Parse(myCfg.IPAddress);
tcpPort = myCfg.TcpPort;
log.Debug(this.ToString());
}
public void Initialize()
{
if (myCfg.DebugLevel == DebugMode.Simulate)
{
temperature = 20.0f;
humidity = 40.0f;
pressure = 1.0f;
msrmntTimeStamp = StateMachine.Time;
msrmntState = MsrmntState.Valid;
log.FatalFormat("Ambient: temperature = {0:F1} C, humidity = {1:F1} %, pressure = {2:F0} mbar", temperature, humidity, 1000 * pressure);
return;
}
tcpClient = new TcpClient();
tcpClient.Connect(ipAddress, tcpPort);
networkStream = tcpClient.GetStream();
state = State.Idle;
msrmntState = MsrmntState.Busy;
log.FatalFormat("Initialization successful: {0}", this.ToString());
}
/// <summary>Run this device</summary>
public void RunDeviceBefore()
{
if (myCfg.DebugLevel == DebugMode.Simulate || myCfg.DebugLevel == DebugMode.FailureDuringOperation)
{
msrmntTimeStamp = StateMachine.Time;
return;
}
try
{
int available = tcpClient.Available;
if (available >= 11)
{
byte[] bytes = new byte[available];
networkStream.Read(bytes, 0, available);
log.Debug(Telegram.LogTelegram("Received ", bytes));
int value;
if (available == 11 && bytes[0] == 0 && bytes[2] == 0 && bytes[3] == 0 && bytes[4] == 0
&& bytes[5] == 5 && bytes[6] == 1 && bytes[7] == 3 && bytes[8] == 2)
{
switch (state)
{
case State.WaitingForTemperature:
value = (int)bytes[9] * 256 + (int)bytes[10];
temperature = (float)(value / 10.0); /// Conversion to °C
msrmntTimeStamp = StateMachine.Time;
msrmntState = MsrmntState.Valid;
log.InfoFormat("Ambient temperature = {0:F1} C", temperature);
state = State.Idle;
break;
case State.WaitingForHumidity:
value = (int)bytes[9] * 256 + (int)bytes[10];
humidity = (float)(value / 10.0); /// Conversion to R%
msrmntTimeStamp = StateMachine.Time;
msrmntState = MsrmntState.Valid;
log.InfoFormat("Ambient humidity = {0:F1} %", humidity);
state = State.Idle;
break;
case State.WaitingForPressure:
value = (int)bytes[9] * 256 + (int)bytes[10];
pressure = (float)(value / 10000.0); /// Conversion to bar
msrmntTimeStamp = StateMachine.Time;
msrmntState = MsrmntState.Valid;
log.InfoFormat("Ambient pressure = {0:F0} mbar", 1000 * pressure);
state = State.Idle;
break;
}
}
else
{
state = State.Idle;
}
}
}
catch (Exception e)
{
DebugLevel = DebugMode.FailureDuringOperation;
log.FatalFormat("Ambient: Serail port read failure : {0}", e.Message);
if (e.InnerException != null)
{
log.FatalFormat("InnerMessage : {0}", e.InnerException.Message);
}
}
}
/// <summary>Run this device</summary>
public void RunDeviceAfter()
{
if (myCfg.DebugLevel == DebugMode.Simulate || myCfg.DebugLevel == DebugMode.FailureDuringOperation)
{
return;
}
try
{
/// 20 seconds cycle
byte[] message = null;
switch (StateMachine.Time % 20)
{
case 0:
state = State.WaitingForTemperature;
message = new byte[12] { 0, 0, 0, 0, 0, 0x06, 0x01, 0x03, 0, 0x30, 0, 0x01 };
break;
case 6:
state = State.WaitingForHumidity;
message = new byte[12] { 0, 0x02, 0, 0, 0, 0x06, 0x01, 0x03, 0, 0x31, 0, 0x01 };
break;
case 12:
state = State.WaitingForPressure;
message = new byte[12] { 0, 0x03, 0, 0, 0, 0x06, 0x01, 0x03, 0, 0x33, 0, 0x01 };
break;
}
if (message != null)
{
log.Debug(Telegram.LogTelegram("Sending ", message));
networkStream.Write(message, 0, message.Length); /// Read request
}
}
catch (Exception e)
{
DebugLevel = DebugMode.FailureDuringOperation;
log.FatalFormat("TCP/IP write error : {0}", e.Message);
if (e.InnerException != null)
{
log.FatalFormat("InnerMessage : {0}", e.InnerException.Message);
}
}
}
/// <summary>Stop this device</summary>
public void StopDevice()
{
if (myCfg.DebugLevel != DebugMode.Simulate && myCfg.DebugLevel != DebugMode.FailureDuringOperation)
{
networkStream.Close();
tcpClient.Close();
}
}
public void StopDevice2() { }
///
/// Boxes for the operation result
///
FloatBox tempBox;
FloatBox pressureBox;
FloatBox humiBox;
public IOperation ReadAmbientOp(FloatBox tempBox, FloatBox pressureBox, FloatBox humiBox)
{
this.tempBox = tempBox;
this.pressureBox = pressureBox;
this.humiBox = humiBox;
return this;
}
/// <summary>Start this operation</summary>
public void Start()
{
if (tempBox != null) tempBox.Val = temperature;
if (pressureBox != null) pressureBox.Val = pressure;
if (humiBox != null) humiBox.Val = humidity;
}
/// <summary>Run this operation</summary>
/// <returns>
/// Event.FlowInDone or Event.FlowOutDone
/// </returns>
public Event Run()
{
if (tempBox != null) tempBox.Val = temperature;
if (pressureBox != null) pressureBox.Val = pressure;
if (humiBox != null) humiBox.Val = humidity;
return Event.AmbientDone;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
}
}
}
@@ -0,0 +1,43 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Net;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Network.Comet.Ambient
{
public class AmbientCfg : ComponentCfgBase, IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(AmbientCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new AmbientCfgCtrl(); }
///
/// Serialized parameters
///
public string IPAddress;
public int TcpPort;
public string SerialNr;
/// Private parameterless constructor invoked by all other (public) constructors
AmbientCfg() { }
public AmbientCfg(string name, IComponentFactory factory)
: this()
{
this.Name = name;
this.Factory = factory;
IPAddress = "192.168.0.123";
TcpPort = 502;
SerialNr = string.Empty;
}
public string ToString(int i)
{
return string.Format("Name={0}, IP={1}, Port={2}, s/n={3}", Name, IPAddress, TcpPort, SerialNr);
}
}
}
@@ -0,0 +1,157 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
namespace TBF.BenchControl.Network.Comet.Ambient
{
partial class AmbientCfgCtrl
{
/// <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.serialNrTextBox = new System.Windows.Forms.TextBox();
this.serialNrLabel = new System.Windows.Forms.Label();
this.ipAddressLabel = new System.Windows.Forms.Label();
this.ipAddressTextBox = new System.Windows.Forms.TextBox();
this.tcpPortTextBox = new System.Windows.Forms.TextBox();
this.tcpPortLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(140, 43);
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(36, 46);
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(137, 18);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// serialNrTextBox
//
this.serialNrTextBox.Enabled = false;
this.serialNrTextBox.Location = new System.Drawing.Point(140, 121);
this.serialNrTextBox.Name = "serialNrTextBox";
this.serialNrTextBox.Size = new System.Drawing.Size(130, 20);
this.serialNrTextBox.TabIndex = 10;
//
// serialNrLabel
//
this.serialNrLabel.AutoSize = true;
this.serialNrLabel.Location = new System.Drawing.Point(36, 124);
this.serialNrLabel.Name = "serialNrLabel";
this.serialNrLabel.Size = new System.Drawing.Size(71, 13);
this.serialNrLabel.TabIndex = 9;
this.serialNrLabel.Text = "Serial number";
//
// ipAddressLabel
//
this.ipAddressLabel.AutoSize = true;
this.ipAddressLabel.Location = new System.Drawing.Point(36, 72);
this.ipAddressLabel.Name = "ipAddressLabel";
this.ipAddressLabel.Size = new System.Drawing.Size(58, 13);
this.ipAddressLabel.TabIndex = 5;
this.ipAddressLabel.Text = "IP Address";
//
// ipAddressTextBox
//
this.ipAddressTextBox.Enabled = false;
this.ipAddressTextBox.Location = new System.Drawing.Point(140, 69);
this.ipAddressTextBox.Name = "ipAddressTextBox";
this.ipAddressTextBox.Size = new System.Drawing.Size(130, 20);
this.ipAddressTextBox.TabIndex = 6;
//
// tcpPortTextBox
//
this.tcpPortTextBox.Enabled = false;
this.tcpPortTextBox.Location = new System.Drawing.Point(140, 95);
this.tcpPortTextBox.Name = "tcpPortTextBox";
this.tcpPortTextBox.Size = new System.Drawing.Size(130, 20);
this.tcpPortTextBox.TabIndex = 8;
//
// tcpPortLabel
//
this.tcpPortLabel.AutoSize = true;
this.tcpPortLabel.Location = new System.Drawing.Point(36, 98);
this.tcpPortLabel.Name = "tcpPortLabel";
this.tcpPortLabel.Size = new System.Drawing.Size(65, 13);
this.tcpPortLabel.TabIndex = 7;
this.tcpPortLabel.Text = "TCP/IP Port";
//
// AmbientCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.Control;
this.Controls.Add(this.tcpPortTextBox);
this.Controls.Add(this.tcpPortLabel);
this.Controls.Add(this.ipAddressTextBox);
this.Controls.Add(this.ipAddressLabel);
this.Controls.Add(this.serialNrTextBox);
this.Controls.Add(this.serialNrLabel);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "AmbientCfgCtrl";
this.Size = new System.Drawing.Size(400, 254);
this.Load += new System.EventHandler(this.AbbientCfgCtrl_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.TextBox serialNrTextBox;
private System.Windows.Forms.Label serialNrLabel;
private System.Windows.Forms.Label ipAddressLabel;
private System.Windows.Forms.TextBox ipAddressTextBox;
private System.Windows.Forms.TextBox tcpPortTextBox;
private System.Windows.Forms.Label tcpPortLabel;
}
}
@@ -0,0 +1,113 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Net;
using System.Windows.Forms;
using log4net;
using TBF.BenchControl.Generic;
using TBF.Resources;
namespace TBF.BenchControl.Network.Comet.Ambient
{
public partial class AmbientCfgCtrl : UserControl, IComponentCfgCtrl
{
static readonly ILog log = LogManager.GetLogger(typeof(AmbientCfgCtrl));
public bool ShowMore { get { return false; } }
AmbientCfg config;
public IComponentCfg Config
{
get { return config as IComponentCfg; }
set
{
config = value as AmbientCfg;
Redraw();
}
}
public AmbientCfgCtrl()
{
InitializeComponent();
}
private void AbbientCfgCtrl_Load(object sender, EventArgs e)
{
Localize();
Redraw();
}
void Localize()
{
nameLabel.Text = Strings.Name;
serialNrLabel.Text = Strings.Serial_Number;
}
public void Closing()
{
}
void Redraw()
{
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
ipAddressTextBox.Text = config.IPAddress != null ? config.IPAddress.ToString() : "192.168.0.123";
tcpPortTextBox.Text = config.TcpPort.ToString();
serialNrTextBox.Text = config.SerialNr.ToString();
}
public void Unlock()
{
nameTextBox.Enabled = true;
ipAddressTextBox.Enabled = true;
tcpPortTextBox.Enabled = true;
serialNrTextBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
IPAddress ip;
if (!IPAddress.TryParse(ipAddressTextBox.Text, out ip))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format(Strings.Invalid_0, ipAddressLabel.Text);
}
int port;
if (!int.TryParse(tcpPortTextBox.Text, out port) || port < 0 || port > 65535)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format(Strings.Invalid_0, tcpPortLabel.Text);
}
return flags;
}
public CfgUpdateFlags UpdateCfg()
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
if (config.Name != nameTextBox.Text ||
config.IPAddress != ipAddressTextBox.Text ||
config.TcpPort.ToString() != tcpPortTextBox.Text ||
config.SerialNr != serialNrTextBox.Text)
{
config.Name = nameTextBox.Text;
config.IPAddress = ipAddressTextBox.Text;
config.TcpPort = int.Parse(tcpPortTextBox.Text);
config.SerialNr = serialNrTextBox.Text;
flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
}
return flags;
}
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,26 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Network.Comet.Ambient
{
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public void ResetStaticProperties() { Ambient.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Ambient(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Ambient(cfg, components); }
public IComponentCfg DefaultConfig() { return new AmbientCfg(this.GetType().Namespace.Substring(17), this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(AmbientCfg.Serializer, component, this);
}
}
}
+9 -2
View File
@@ -55,12 +55,12 @@ namespace TBF.BenchControl.Operations
public Event Run()
{
if (Bridge.Ui2MachineQueue.Count <= 0) return Event.None;
UI2BenchCmd cmd;
lock (Bridge.Ui2MachineQueue)
{
if (Bridge.Ui2MachineQueue.Count <= 0) return Event.None;
if (Bridge.Ui2MachineQueue.Contains(UI2BenchCmd.Stop))
{
do {
@@ -68,6 +68,13 @@ namespace TBF.BenchControl.Operations
}
while (cmd != UI2BenchCmd.Stop);
}
else if (Bridge.Ui2MachineQueue.Contains(UI2BenchCmd.Shutdown))
{
do {
cmd = Bridge.Ui2MachineQueue.Dequeue();
}
while (cmd != UI2BenchCmd.Shutdown);
}
else
{
cmd = Bridge.Ui2MachineQueue.Dequeue();
@@ -72,17 +72,43 @@ namespace TBF.BenchControl.Output.DB.SaveFlowmeterCorrections
}
IList<MeasurementCorrection> GetCorrections(Results.Entities.Batch batch, string flowmeter, int rangeIx)
IList<MeasurementCorrection> GetCorrections(Results.Entities.Batch batch, string flowmeterName, int rngIx, double tempRngLo, double tempRngHi)
{
IList<MeasurementCorrection> rslt = new List<MeasurementCorrection>();
foreach (var tr in batch.TestRslts)
{
if (tr.Components.Flowmeter == flowmeter && tr.Evaluate())
if (tr.TestDone && tr.Components != null && tr.Components.Flowmeter == flowmeterName &&
tr.RepetitionNr == 1 && tr.Evaluate() && tr.TempLimLo() >= tempRngLo && tr.TempLimHi() <= tempRngHi)
{
float measurement = tr.FlowMean;
float correction = (float)BenchControl.Formulas.CorrectionFromError(measurement, tr.ErrorMaster);
rslt.Add(new MeasurementCorrection { RangeIx = rangeIx, Measurement = measurement, Correction = correction });
double flow = 0;
double errorMaster = 0;
if (tr.Repeats() == 1)
{
flow = tr.FlowMean;
errorMaster = tr.ErrorMaster;
}
else
{
int count = 0;
foreach (var tr2 in batch.TestRslts)
{
if (tr2.TestDone && (tr2.TestData.Name == tr.TestData.Name))
{
flow += tr2.FlowMean;
errorMaster += tr2.ErrorMaster;
count++;
}
}
flow /= count;
errorMaster /= count;
}
double correction = BenchControl.Formulas.CorrectionFromError(flow, errorMaster);
rslt.Add(new MeasurementCorrection { RangeIx = rngIx, Measurement = (float)flow, Correction = (float)correction });
}
}
@@ -92,17 +118,25 @@ namespace TBF.BenchControl.Output.DB.SaveFlowmeterCorrections
void DeleteExistingCorrections(ISession session, Component cmpnt, int rangeIx)
{
foreach (var mc in cmpnt.Corrections) session.Delete(mc);
cmpnt.Corrections.Clear();
for (int i = cmpnt.Corrections.Count - 1; i >= 0; i--)
{
if (cmpnt.Corrections[i].RangeIx == rangeIx)
{
session.Delete(cmpnt.Corrections[i]);
cmpnt.Corrections.RemoveAt(i);
}
}
session.SaveOrUpdate(cmpnt);
}
void SaveNewCorrections(ISession session, Component cmpnt, int rangeIx, IList<MeasurementCorrection> corrections)
{
if (cmpnt.Corrections == null) cmpnt.Corrections = new List<MeasurementCorrection>();
foreach (var mc in corrections)
{
mc.RangeIx = rangeIx;
cmpnt.Corrections.Add(mc);
session.SaveOrUpdate(mc);
}
@@ -115,15 +149,13 @@ namespace TBF.BenchControl.Output.DB.SaveFlowmeterCorrections
{
opCompleted = false;
anyError = false;
newCorrections = GetCorrections(batch, myCfg.Flowmeter, myCfg.RangeIx);
}
/// <summary>Run this operation</summary>
/// <returns>Event.ResultsWritten or Event.Error</returns>
public Event Run()
{
if (myCfg.DebugLevel == DebugMode.Simulate || newCorrections == null || newCorrections.Count == 0)
if (myCfg.DebugLevel == DebugMode.Simulate)
{
opCompleted = true;
return Event.ResultsWritten;
@@ -139,28 +171,49 @@ namespace TBF.BenchControl.Output.DB.SaveFlowmeterCorrections
ISession session = Config.FluentCommon.CreateSession(Users.Entities.DBKind.Config);
transaction = session.BeginTransaction();
var cmpnts = session.QueryOver<Component>()
.Where(cmpnt => (cmpnt.Name == myCfg.Flowmeter))
.List();
for (int fmtr = 1; fmtr <= myCfg.FlowmetersCount(); fmtr++)
{
string flowmeterName = myCfg.GetFlowmeterName(fmtr);
Elde.FlowMeter.FlowMeter flowmeter = TbfComponents.FindComponent(flowmeterName) as Elde.FlowMeter.FlowMeter;
if (cmpnts.Count != 1) throw (new Exception(string.Format("No unique component in SaveNewCorrections(.,{0},{1})", myCfg.Flowmeter, myCfg.RangeIx)));
if (flowmeter != null)
{
var cmpntEntities = session.QueryOver<Component>()
.Where(cmpnt => (cmpnt.Name == flowmeterName))
.List();
DeleteExistingCorrections(session, cmpnts[0], myCfg.RangeIx);
SaveNewCorrections(session, cmpnts[0], myCfg.RangeIx, newCorrections);
if (cmpntEntities.Count != 1)
{
log.ErrorFormat("No unique flowmeter named {0}", myCfg.GetFlowmeterName(fmtr));
continue;
}
for (int rng = 0; rng <= myCfg.RangesCount(); rng++)
{
if (myCfg.FlowmtrRangeEnabled(fmtr, rng))
{
double tempRngLo = flowmeter.GetTempLo(rng);
double tempRngHi = flowmeter.GetTempHi(rng);
newCorrections = GetCorrections(batch, flowmeterName, rng, tempRngLo, tempRngHi);
DeleteExistingCorrections(session, cmpntEntities[0], rng);
SaveNewCorrections(session, cmpntEntities[0], rng, newCorrections);
}
}
}
}
transaction.Commit();
session.Flush();
opCompleted = true;
log.ErrorFormat("Measurement corrections of {0}/{1} saved", myCfg.Flowmeter, myCfg.RangeIx);
log.WarnFormat("Measurement corrections successfully saved");
}
catch (Exception exc)
{
if (transaction != null && !transaction.WasCommitted) transaction.Rollback();
anyError = true;
log.WarnFormat("Failed to write batch {0} results to measurement {1}/{2} corrections: {3}",
batch.BatchNr, myCfg.Flowmeter, myCfg.RangeIx, exc.Message);
log.ErrorFormat("Failed to write corrections calculated from batch {0}: {1}", batch.BatchNr, exc.Message);
}
}
@@ -13,16 +13,195 @@ namespace TBF.BenchControl.Output.DB.SaveFlowmeterCorrections
public IComponentCfgCtrl GetControl() { return new SaveFlowmeterCorrCfgCtrl(); }
public string Flowmeter;
public int RangeIx;
public string Flowmeter1;
public string Flowmeter2;
public string Flowmeter3;
public string Flowmeter4;
public string Flowmeter5;
public string Flowmeter6;
public string Flowmeter7;
public bool Flowm1Rng1;
public bool Flowm1Rng2;
public bool Flowm1Rng3;
public bool Flowm1Rng4;
public bool Flowm1Rng5;
public bool Flowm2Rng1;
public bool Flowm2Rng2;
public bool Flowm2Rng3;
public bool Flowm2Rng4;
public bool Flowm2Rng5;
public bool Flowm3Rng1;
public bool Flowm3Rng2;
public bool Flowm3Rng3;
public bool Flowm3Rng4;
public bool Flowm3Rng5;
public bool Flowm4Rng1;
public bool Flowm4Rng2;
public bool Flowm4Rng3;
public bool Flowm4Rng4;
public bool Flowm4Rng5;
public bool Flowm5Rng1;
public bool Flowm5Rng2;
public bool Flowm5Rng3;
public bool Flowm5Rng4;
public bool Flowm5Rng5;
public bool Flowm6Rng1;
public bool Flowm6Rng2;
public bool Flowm6Rng3;
public bool Flowm6Rng4;
public bool Flowm6Rng5;
public bool Flowm7Rng1;
public bool Flowm7Rng2;
public bool Flowm7Rng3;
public bool Flowm7Rng4;
public bool Flowm7Rng5;
public int FlowmetersCount() { return 7; }
public int RangesCount() { return 5; }
/// <summary>
/// Get flowmeter name
/// </summary>
/// <param name="f">Flowmeter index 1 .. FlowmetersCount()==7</param>
/// <returns>Flowmeter name or null</returns>
public string GetFlowmeterName(int f)
{
switch (f)
{
case 1: return Flowmeter1;
case 2: return Flowmeter2;
case 3: return Flowmeter3;
case 4: return Flowmeter4;
case 5: return Flowmeter5;
case 6: return Flowmeter6;
case 7: return Flowmeter7;
default: return null;
}
}
/// <summary>
/// Is range enabled
/// </summary>
/// <param name="f">Flowmeter index 1 .. FlowmetersCount()==7</param>
/// <param name="r">Range index 0 .. RangesCount()==5</param>
/// <returns>ture if the range is enabled</returns>
public bool FlowmtrRangeEnabled(int f, int r)
{
if (f == 1)
{
switch (r)
{
case 0: return !(Flowm1Rng1 || Flowm1Rng2 || Flowm1Rng3 || Flowm1Rng4 || Flowm1Rng5);
case 1: return Flowm1Rng1;
case 2: return Flowm1Rng2;
case 3: return Flowm1Rng3;
case 4: return Flowm1Rng4;
case 5: return Flowm1Rng5;
default: break;
}
}
else if (f == 2)
{
switch (r)
{
case 0: return !(Flowm2Rng1 || Flowm2Rng2 || Flowm2Rng3 || Flowm2Rng4 || Flowm2Rng5);
case 1: return Flowm2Rng1;
case 2: return Flowm2Rng2;
case 3: return Flowm2Rng3;
case 4: return Flowm2Rng4;
case 5: return Flowm2Rng5;
default: break;
}
}
else if (f == 3)
{
switch (r)
{
case 0: return !(Flowm3Rng1 || Flowm3Rng2 || Flowm3Rng3 || Flowm3Rng4 || Flowm3Rng5);
case 1: return Flowm3Rng1;
case 2: return Flowm3Rng2;
case 3: return Flowm3Rng3;
case 4: return Flowm3Rng4;
case 5: return Flowm3Rng5;
default: break;
}
}
else if (f == 4)
{
switch (r)
{
case 0: return !(Flowm4Rng1 || Flowm4Rng2 || Flowm4Rng3 || Flowm4Rng4 || Flowm4Rng5);
case 1: return Flowm4Rng1;
case 2: return Flowm4Rng2;
case 3: return Flowm4Rng3;
case 4: return Flowm4Rng4;
case 5: return Flowm4Rng5;
default: break;
}
}
else if (f == 5)
{
switch (r)
{
case 0: return !(Flowm5Rng1 || Flowm5Rng2 || Flowm5Rng3 || Flowm5Rng4 || Flowm5Rng5);
case 1: return Flowm5Rng1;
case 2: return Flowm5Rng2;
case 3: return Flowm5Rng3;
case 4: return Flowm5Rng4;
case 5: return Flowm5Rng5;
default: break;
}
}
else if (f == 6)
{
switch (r)
{
case 0: return !(Flowm6Rng1 || Flowm6Rng2 || Flowm6Rng3 || Flowm6Rng4 || Flowm6Rng5);
case 1: return Flowm6Rng1;
case 2: return Flowm6Rng2;
case 3: return Flowm6Rng3;
case 4: return Flowm6Rng4;
case 5: return Flowm6Rng5;
default: break;
}
}
else if (f == 7)
{
switch (r)
{
case 0: return !(Flowm7Rng1 || Flowm7Rng2 || Flowm7Rng3 || Flowm7Rng4 || Flowm7Rng5);
case 1: return Flowm7Rng1;
case 2: return Flowm7Rng2;
case 3: return Flowm7Rng3;
case 4: return Flowm7Rng4;
case 5: return Flowm7Rng5;
default: break;
}
}
return false;
}
/// Private parameterless constructor invoked by all other (public) constructors
SaveFlowmeterCorrCfg()
{
{
ParentName = string.Empty;
Flowmeter = "I1";
RangeIx = 0;
}
Flowmeter1 = "I1";
Flowmeter2 = "I2";
Flowmeter3 = "I3";
Flowmeter4 = null;
Flowmeter5 = null;
Flowmeter6 = null;
Flowmeter7 = null;
}
public SaveFlowmeterCorrCfg(string name, IComponentFactory factory)
: this()
@@ -33,7 +212,8 @@ namespace TBF.BenchControl.Output.DB.SaveFlowmeterCorrections
public string ToString(int i)
{
return string.Format("Name={0}, Flowmtr={1}, RangeIx={2}", Name, Flowmeter, RangeIx);
return string.Format("Name={0}, Flowmtr1={1}, Flowmtr2={2}, Flowmtr3={3}, Flowmtr4={4}, Flowmtr5={5}, Flowmtr6={6}, Flowmtr7={7}",
Name, Flowmeter1, Flowmeter2, Flowmeter3, Flowmeter4, Flowmeter5, Flowmeter6, Flowmeter7);
}
}
}
@@ -41,11 +41,25 @@ namespace TBF.BenchControl.Output.DB.SaveFlowmeterCorrections
if (parent.TbfComponents != null)
{
flowmeter1ComboBox.Items.Add("---");
flowmeter2ComboBox.Items.Add("---");
flowmeter3ComboBox.Items.Add("---");
flowmeter4ComboBox.Items.Add("---");
flowmeter5ComboBox.Items.Add("---");
flowmeter6ComboBox.Items.Add("---");
flowmeter7ComboBox.Items.Add("---");
///
foreach (var cmpnt in parent.TbfComponents)
{
if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is TBF.BenchControl.Elde.FlowMeter.FlowMeterFactory)
{
flowmeterComboBox.Items.Add(cmpnt.Name);
flowmeter1ComboBox.Items.Add(cmpnt.Name);
flowmeter2ComboBox.Items.Add(cmpnt.Name);
flowmeter3ComboBox.Items.Add(cmpnt.Name);
flowmeter4ComboBox.Items.Add(cmpnt.Name);
flowmeter5ComboBox.Items.Add(cmpnt.Name);
flowmeter6ComboBox.Items.Add(cmpnt.Name);
flowmeter7ComboBox.Items.Add(cmpnt.Name);
}
}
}
@@ -63,32 +77,218 @@ namespace TBF.BenchControl.Output.DB.SaveFlowmeterCorrections
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
flowmeterComboBox.Text = config.Flowmeter;
rangeIdTextBox.Text = config.RangeIx.ToString();
}
flowmeter1ComboBox.Text = string.IsNullOrEmpty(config.Flowmeter1) ? "---" : config.Flowmeter1;
flowm1Rng1CheckBox.Checked = config.Flowm1Rng1;
flowm1Rng2CheckBox.Checked = config.Flowm1Rng2;
flowm1Rng3CheckBox.Checked = config.Flowm1Rng3;
flowm1Rng4CheckBox.Checked = config.Flowm1Rng4;
flowm1Rng5CheckBox.Checked = config.Flowm1Rng5;
flowm1Rng0CheckBox.Checked = !(config.Flowm1Rng1 || config.Flowm1Rng2 || config.Flowm1Rng3 || config.Flowm1Rng4 || config.Flowm1Rng5);
flowmeter2ComboBox.Text = string.IsNullOrEmpty(config.Flowmeter2) ? "---" : config.Flowmeter2;
flowm2Rng1CheckBox.Checked = config.Flowm2Rng1;
flowm2Rng2CheckBox.Checked = config.Flowm2Rng2;
flowm2Rng3CheckBox.Checked = config.Flowm2Rng3;
flowm2Rng4CheckBox.Checked = config.Flowm2Rng4;
flowm2Rng5CheckBox.Checked = config.Flowm2Rng5;
flowm2Rng0CheckBox.Checked = !(config.Flowm2Rng1 || config.Flowm2Rng2 || config.Flowm2Rng3 || config.Flowm2Rng4 || config.Flowm2Rng5);
flowmeter3ComboBox.Text = string.IsNullOrEmpty(config.Flowmeter3) ? "---" : config.Flowmeter3;
flowm3Rng1CheckBox.Checked = config.Flowm3Rng1;
flowm3Rng2CheckBox.Checked = config.Flowm3Rng2;
flowm3Rng3CheckBox.Checked = config.Flowm3Rng3;
flowm3Rng4CheckBox.Checked = config.Flowm3Rng4;
flowm3Rng5CheckBox.Checked = config.Flowm3Rng5;
flowm3Rng0CheckBox.Checked = !(config.Flowm3Rng1 || config.Flowm3Rng2 || config.Flowm3Rng3 || config.Flowm3Rng4 || config.Flowm3Rng5);
flowmeter4ComboBox.Text = string.IsNullOrEmpty(config.Flowmeter4) ? "---" : config.Flowmeter4;
flowm4Rng1CheckBox.Checked = config.Flowm4Rng1;
flowm4Rng2CheckBox.Checked = config.Flowm4Rng2;
flowm4Rng3CheckBox.Checked = config.Flowm4Rng3;
flowm4Rng4CheckBox.Checked = config.Flowm4Rng4;
flowm4Rng5CheckBox.Checked = config.Flowm4Rng5;
flowm4Rng0CheckBox.Checked = !(config.Flowm4Rng1 || config.Flowm4Rng2 || config.Flowm4Rng3 || config.Flowm4Rng4 || config.Flowm4Rng5);
flowmeter5ComboBox.Text = string.IsNullOrEmpty(config.Flowmeter5) ? "---" : config.Flowmeter5;
flowm5Rng1CheckBox.Checked = config.Flowm5Rng1;
flowm5Rng2CheckBox.Checked = config.Flowm5Rng2;
flowm5Rng3CheckBox.Checked = config.Flowm5Rng3;
flowm5Rng4CheckBox.Checked = config.Flowm5Rng4;
flowm5Rng5CheckBox.Checked = config.Flowm5Rng5;
flowm5Rng0CheckBox.Checked = !(config.Flowm5Rng1 || config.Flowm5Rng2 || config.Flowm5Rng3 || config.Flowm5Rng4 || config.Flowm5Rng5);
flowmeter6ComboBox.Text = string.IsNullOrEmpty(config.Flowmeter6) ? "---" : config.Flowmeter6;
flowm6Rng1CheckBox.Checked = config.Flowm6Rng1;
flowm6Rng2CheckBox.Checked = config.Flowm6Rng2;
flowm6Rng3CheckBox.Checked = config.Flowm6Rng3;
flowm6Rng4CheckBox.Checked = config.Flowm6Rng4;
flowm6Rng5CheckBox.Checked = config.Flowm6Rng5;
flowm6Rng0CheckBox.Checked = !(config.Flowm6Rng1 || config.Flowm6Rng2 || config.Flowm6Rng3 || config.Flowm6Rng4 || config.Flowm6Rng5);
flowmeter7ComboBox.Text = string.IsNullOrEmpty(config.Flowmeter7) ? "---" : config.Flowmeter7;
flowm7Rng1CheckBox.Checked = config.Flowm7Rng1;
flowm7Rng2CheckBox.Checked = config.Flowm7Rng2;
flowm7Rng3CheckBox.Checked = config.Flowm7Rng3;
flowm7Rng4CheckBox.Checked = config.Flowm7Rng4;
flowm7Rng5CheckBox.Checked = config.Flowm7Rng5;
flowm7Rng0CheckBox.Checked = !(config.Flowm7Rng1 || config.Flowm7Rng2 || config.Flowm7Rng3 || config.Flowm7Rng4 || config.Flowm7Rng5);
}
public void Unlock()
{
nameTextBox.Enabled = true;
flowmeterComboBox.Enabled = true;
rangeIdTextBox.Enabled = true;
}
flowmeter1ComboBox.Enabled = true;
flowm1Rng0CheckBox.Enabled = true;
flowm1Rng1CheckBox.Enabled = true;
flowm1Rng2CheckBox.Enabled = true;
flowm1Rng3CheckBox.Enabled = true;
flowm1Rng4CheckBox.Enabled = true;
flowm1Rng5CheckBox.Enabled = true;
flowmeter2ComboBox.Enabled = true;
flowm2Rng0CheckBox.Enabled = true;
flowm2Rng1CheckBox.Enabled = true;
flowm2Rng2CheckBox.Enabled = true;
flowm2Rng3CheckBox.Enabled = true;
flowm2Rng4CheckBox.Enabled = true;
flowm2Rng5CheckBox.Enabled = true;
flowmeter3ComboBox.Enabled = true;
flowm3Rng0CheckBox.Enabled = true;
flowm3Rng1CheckBox.Enabled = true;
flowm3Rng2CheckBox.Enabled = true;
flowm3Rng3CheckBox.Enabled = true;
flowm3Rng4CheckBox.Enabled = true;
flowm3Rng5CheckBox.Enabled = true;
flowmeter4ComboBox.Enabled = true;
flowm4Rng0CheckBox.Enabled = true;
flowm4Rng1CheckBox.Enabled = true;
flowm4Rng2CheckBox.Enabled = true;
flowm4Rng3CheckBox.Enabled = true;
flowm4Rng4CheckBox.Enabled = true;
flowm4Rng5CheckBox.Enabled = true;
flowmeter5ComboBox.Enabled = true;
flowm5Rng0CheckBox.Enabled = true;
flowm5Rng1CheckBox.Enabled = true;
flowm5Rng2CheckBox.Enabled = true;
flowm5Rng3CheckBox.Enabled = true;
flowm5Rng4CheckBox.Enabled = true;
flowm5Rng5CheckBox.Enabled = true;
flowmeter6ComboBox.Enabled = true;
flowm6Rng0CheckBox.Enabled = true;
flowm6Rng1CheckBox.Enabled = true;
flowm6Rng2CheckBox.Enabled = true;
flowm6Rng3CheckBox.Enabled = true;
flowm6Rng4CheckBox.Enabled = true;
flowm6Rng5CheckBox.Enabled = true;
flowmeter7ComboBox.Enabled = true;
flowm7Rng0CheckBox.Enabled = true;
flowm7Rng1CheckBox.Enabled = true;
flowm7Rng2CheckBox.Enabled = true;
flowm7Rng3CheckBox.Enabled = true;
flowm7Rng4CheckBox.Enabled = true;
flowm7Rng5CheckBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
if (!flowmeterComboBox.Items.Contains(flowmeterComboBox.Text))
if (!flowmeter1ComboBox.Items.Contains(flowmeter1ComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format("Invalid {0}", flowmeterLabel.Text);
message += Environment.NewLine + string.Format("Invalid {0}", flowmeter1Label.Text);
}
if ((flowmeter1ComboBox.Text != "---") &&
(flowm1Rng0CheckBox.Checked == (flowm1Rng1CheckBox.Checked || flowm1Rng2CheckBox.Checked || flowm1Rng3CheckBox.Checked ||
flowm1Rng4CheckBox.Checked || flowm1Rng5CheckBox.Checked)))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format("Invalid ranges for {0}", flowmeter1Label.Text);
}
int dummy;
if (!int.TryParse(rangeIdTextBox.Text, out dummy) || dummy < 0 || dummy > 5)
if (!flowmeter2ComboBox.Items.Contains(flowmeter2ComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format("Invalid {0}", rangeIdLabel.Text);
message += Environment.NewLine + string.Format("Invalid {0}", flowmeter2Label.Text);
}
if ((flowmeter2ComboBox.Text != "---") &&
(flowm2Rng0CheckBox.Checked == (flowm2Rng1CheckBox.Checked || flowm2Rng2CheckBox.Checked || flowm2Rng3CheckBox.Checked ||
flowm2Rng4CheckBox.Checked || flowm2Rng5CheckBox.Checked)))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format("Invalid ranges for {0}", flowmeter2Label.Text);
}
if (!flowmeter3ComboBox.Items.Contains(flowmeter3ComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format("Invalid {0}", flowmeter3Label.Text);
}
if ((flowmeter3ComboBox.Text != "---") &&
(flowm3Rng0CheckBox.Checked == (flowm3Rng1CheckBox.Checked || flowm3Rng2CheckBox.Checked || flowm3Rng3CheckBox.Checked ||
flowm3Rng4CheckBox.Checked || flowm3Rng5CheckBox.Checked)))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format("Invalid ranges for {0}", flowmeter3Label.Text);
}
if (!flowmeter4ComboBox.Items.Contains(flowmeter4ComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format("Invalid {0}", flowmeter4Label.Text);
}
if ((flowmeter4ComboBox.Text != "---") &&
(flowm4Rng0CheckBox.Checked == (flowm4Rng1CheckBox.Checked || flowm4Rng2CheckBox.Checked || flowm4Rng3CheckBox.Checked ||
flowm4Rng4CheckBox.Checked || flowm4Rng5CheckBox.Checked)))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format("Invalid ranges for {0}", flowmeter4Label.Text);
}
if (!flowmeter5ComboBox.Items.Contains(flowmeter5ComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format("Invalid {0}", flowmeter5Label.Text);
}
if ((flowmeter5ComboBox.Text != "---") &&
(flowm5Rng0CheckBox.Checked == (flowm5Rng1CheckBox.Checked || flowm5Rng2CheckBox.Checked || flowm5Rng3CheckBox.Checked ||
flowm5Rng4CheckBox.Checked || flowm5Rng5CheckBox.Checked)))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format("Invalid ranges for {0}", flowmeter5Label.Text);
}
if (!flowmeter6ComboBox.Items.Contains(flowmeter6ComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format("Invalid {0}", flowmeter6Label.Text);
}
if ((flowmeter6ComboBox.Text != "---") &&
(flowm6Rng0CheckBox.Checked == (flowm6Rng1CheckBox.Checked || flowm6Rng2CheckBox.Checked || flowm6Rng3CheckBox.Checked ||
flowm6Rng4CheckBox.Checked || flowm6Rng5CheckBox.Checked)))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format("Invalid ranges for {0}", flowmeter6Label.Text);
}
if (!flowmeter7ComboBox.Items.Contains(flowmeter7ComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format("Invalid {0}", flowmeter7Label.Text);
}
if ((flowmeter7ComboBox.Text != "---") &&
(flowm7Rng0CheckBox.Checked == (flowm7Rng1CheckBox.Checked || flowm7Rng2CheckBox.Checked || flowm7Rng3CheckBox.Checked ||
flowm7Rng4CheckBox.Checked || flowm7Rng5CheckBox.Checked)))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format("Invalid ranges for {0}", flowmeter7Label.Text);
}
return flags;
@@ -106,10 +306,56 @@ namespace TBF.BenchControl.Output.DB.SaveFlowmeterCorrections
flags |= CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd;
}
flags |= UpdateDifferent(ref config.Flowmeter, flowmeterComboBox.Text, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.RangeIx, rangeIdTextBox.Text, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowmeter1, flowmeter1ComboBox.Text, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm1Rng1, flowm1Rng1CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm1Rng2, flowm1Rng2CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm1Rng3, flowm1Rng3CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm1Rng4, flowm1Rng4CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm1Rng5, flowm1Rng5CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
return flags;
flags |= UpdateDifferent(ref config.Flowmeter2, flowmeter2ComboBox.Text, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm2Rng1, flowm2Rng1CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm2Rng2, flowm2Rng2CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm2Rng3, flowm2Rng3CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm2Rng4, flowm2Rng4CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm2Rng5, flowm2Rng5CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowmeter3, flowmeter3ComboBox.Text, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm3Rng1, flowm3Rng1CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm3Rng2, flowm3Rng2CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm3Rng3, flowm3Rng3CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm3Rng4, flowm3Rng4CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm3Rng5, flowm3Rng5CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowmeter4, flowmeter4ComboBox.Text, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm4Rng1, flowm4Rng1CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm4Rng2, flowm4Rng2CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm4Rng3, flowm4Rng3CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm4Rng4, flowm4Rng4CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm4Rng5, flowm4Rng5CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowmeter5, flowmeter5ComboBox.Text, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm5Rng1, flowm5Rng1CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm5Rng2, flowm5Rng2CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm5Rng3, flowm5Rng3CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm5Rng4, flowm5Rng4CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm5Rng5, flowm5Rng5CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowmeter6, flowmeter6ComboBox.Text, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm6Rng1, flowm6Rng1CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm6Rng2, flowm6Rng2CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm6Rng3, flowm6Rng3CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm6Rng4, flowm6Rng4CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm6Rng5, flowm6Rng5CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowmeter7, flowmeter7ComboBox.Text, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm7Rng1, flowm7Rng1CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm7Rng2, flowm7Rng2CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm7Rng3, flowm7Rng3CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm7Rng4, flowm7Rng4CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.Flowm7Rng5, flowm7Rng5CheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
return flags;
}
}
}
@@ -34,18 +34,71 @@ namespace TBF.BenchControl.Output.DB.SaveFlowmeterCorrections
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.flowmeterLabel = new System.Windows.Forms.Label();
this.rangeIdTextBox = new System.Windows.Forms.TextBox();
this.rangeIdLabel = new System.Windows.Forms.Label();
this.flowmeterComboBox = new System.Windows.Forms.ComboBox();
this.flowmeter1Label = new System.Windows.Forms.Label();
this.flowmeter1ComboBox = new System.Windows.Forms.ComboBox();
this.flowm1Rng1CheckBox = new System.Windows.Forms.CheckBox();
this.flowm1Rng2CheckBox = new System.Windows.Forms.CheckBox();
this.flowm1Rng3CheckBox = new System.Windows.Forms.CheckBox();
this.flowm1Rng4CheckBox = new System.Windows.Forms.CheckBox();
this.flowm1Rng5CheckBox = new System.Windows.Forms.CheckBox();
this.flowm2Rng5CheckBox = new System.Windows.Forms.CheckBox();
this.flowm2Rng4CheckBox = new System.Windows.Forms.CheckBox();
this.flowm2Rng3CheckBox = new System.Windows.Forms.CheckBox();
this.flowm2Rng2CheckBox = new System.Windows.Forms.CheckBox();
this.flowm2Rng1CheckBox = new System.Windows.Forms.CheckBox();
this.flowmeter2ComboBox = new System.Windows.Forms.ComboBox();
this.flowmeter2Label = new System.Windows.Forms.Label();
this.flowm3Rng5CheckBox = new System.Windows.Forms.CheckBox();
this.flowm3Rng4CheckBox = new System.Windows.Forms.CheckBox();
this.flowm3Rng3CheckBox = new System.Windows.Forms.CheckBox();
this.flowm3Rng2CheckBox = new System.Windows.Forms.CheckBox();
this.flowm3Rng1CheckBox = new System.Windows.Forms.CheckBox();
this.flowmeter3ComboBox = new System.Windows.Forms.ComboBox();
this.flowmeter3Label = new System.Windows.Forms.Label();
this.flowm4Rng5CheckBox = new System.Windows.Forms.CheckBox();
this.flowm4Rng4CheckBox = new System.Windows.Forms.CheckBox();
this.flowm4Rng3CheckBox = new System.Windows.Forms.CheckBox();
this.flowm4Rng2CheckBox = new System.Windows.Forms.CheckBox();
this.flowm4Rng1CheckBox = new System.Windows.Forms.CheckBox();
this.flowmeter4ComboBox = new System.Windows.Forms.ComboBox();
this.flowmeter4Label = new System.Windows.Forms.Label();
this.flowm5Rng5CheckBox = new System.Windows.Forms.CheckBox();
this.flowm5Rng4CheckBox = new System.Windows.Forms.CheckBox();
this.flowm5Rng3CheckBox = new System.Windows.Forms.CheckBox();
this.flowm5Rng2CheckBox = new System.Windows.Forms.CheckBox();
this.flowm5Rng1CheckBox = new System.Windows.Forms.CheckBox();
this.flowmeter5ComboBox = new System.Windows.Forms.ComboBox();
this.flowmeter5Label = new System.Windows.Forms.Label();
this.flowm5Rng0CheckBox = new System.Windows.Forms.CheckBox();
this.flowm4Rng0CheckBox = new System.Windows.Forms.CheckBox();
this.flowm3Rng0CheckBox = new System.Windows.Forms.CheckBox();
this.flowm2Rng0CheckBox = new System.Windows.Forms.CheckBox();
this.flowm1Rng0CheckBox = new System.Windows.Forms.CheckBox();
this.label1 = new System.Windows.Forms.Label();
this.flowm6Rng0CheckBox = new System.Windows.Forms.CheckBox();
this.flowm6Rng5CheckBox = new System.Windows.Forms.CheckBox();
this.flowm6Rng4CheckBox = new System.Windows.Forms.CheckBox();
this.flowm6Rng3CheckBox = new System.Windows.Forms.CheckBox();
this.flowm6Rng2CheckBox = new System.Windows.Forms.CheckBox();
this.flowm6Rng1CheckBox = new System.Windows.Forms.CheckBox();
this.flowmeter6ComboBox = new System.Windows.Forms.ComboBox();
this.flowmeter6Label = new System.Windows.Forms.Label();
this.flowm7Rng0CheckBox = new System.Windows.Forms.CheckBox();
this.flowm7Rng5CheckBox = new System.Windows.Forms.CheckBox();
this.flowm7Rng4CheckBox = new System.Windows.Forms.CheckBox();
this.flowm7Rng3CheckBox = new System.Windows.Forms.CheckBox();
this.flowm7Rng2CheckBox = new System.Windows.Forms.CheckBox();
this.flowm7Rng1CheckBox = new System.Windows.Forms.CheckBox();
this.flowmeter7ComboBox = new System.Windows.Forms.ComboBox();
this.flowmeter7Label = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(110, 41);
this.nameTextBox.Location = new System.Drawing.Point(95, 41);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(225, 20);
this.nameTextBox.Size = new System.Drawing.Size(285, 20);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
@@ -66,54 +119,669 @@ namespace TBF.BenchControl.Output.DB.SaveFlowmeterCorrections
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// flowmeterLabel
// flowmeter1Label
//
this.flowmeterLabel.AutoSize = true;
this.flowmeterLabel.Location = new System.Drawing.Point(15, 70);
this.flowmeterLabel.Name = "flowmeterLabel";
this.flowmeterLabel.Size = new System.Drawing.Size(55, 13);
this.flowmeterLabel.TabIndex = 3;
this.flowmeterLabel.Text = "Flowmeter";
this.flowmeter1Label.AutoSize = true;
this.flowmeter1Label.Location = new System.Drawing.Point(15, 96);
this.flowmeter1Label.Name = "flowmeter1Label";
this.flowmeter1Label.Size = new System.Drawing.Size(64, 13);
this.flowmeter1Label.TabIndex = 3;
this.flowmeter1Label.Text = "Flowmeter 1";
//
// rangeIdTextBox
// flowmeter1ComboBox
//
this.rangeIdTextBox.Enabled = false;
this.rangeIdTextBox.Location = new System.Drawing.Point(110, 93);
this.rangeIdTextBox.Name = "rangeIdTextBox";
this.rangeIdTextBox.Size = new System.Drawing.Size(36, 20);
this.rangeIdTextBox.TabIndex = 22;
this.flowmeter1ComboBox.Enabled = false;
this.flowmeter1ComboBox.FormattingEnabled = true;
this.flowmeter1ComboBox.Location = new System.Drawing.Point(95, 93);
this.flowmeter1ComboBox.Name = "flowmeter1ComboBox";
this.flowmeter1ComboBox.Size = new System.Drawing.Size(69, 21);
this.flowmeter1ComboBox.TabIndex = 4;
//
// rangeIdLabel
// flowm1Rng1CheckBox
//
this.rangeIdLabel.AutoSize = true;
this.rangeIdLabel.Location = new System.Drawing.Point(15, 96);
this.rangeIdLabel.Name = "rangeIdLabel";
this.rangeIdLabel.Size = new System.Drawing.Size(51, 13);
this.rangeIdLabel.TabIndex = 21;
this.rangeIdLabel.Text = "Range Id";
this.flowm1Rng1CheckBox.AutoSize = true;
this.flowm1Rng1CheckBox.Enabled = false;
this.flowm1Rng1CheckBox.Location = new System.Drawing.Point(245, 96);
this.flowm1Rng1CheckBox.Name = "flowm1Rng1CheckBox";
this.flowm1Rng1CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm1Rng1CheckBox.TabIndex = 6;
this.flowm1Rng1CheckBox.Text = "1";
this.flowm1Rng1CheckBox.UseVisualStyleBackColor = true;
//
// flowmeterComboBox
// flowm1Rng2CheckBox
//
this.flowmeterComboBox.Enabled = false;
this.flowmeterComboBox.FormattingEnabled = true;
this.flowmeterComboBox.Location = new System.Drawing.Point(110, 67);
this.flowmeterComboBox.Name = "flowmeterComboBox";
this.flowmeterComboBox.Size = new System.Drawing.Size(225, 21);
this.flowmeterComboBox.TabIndex = 23;
this.flowm1Rng2CheckBox.AutoSize = true;
this.flowm1Rng2CheckBox.Enabled = false;
this.flowm1Rng2CheckBox.Location = new System.Drawing.Point(275, 96);
this.flowm1Rng2CheckBox.Name = "flowm1Rng2CheckBox";
this.flowm1Rng2CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm1Rng2CheckBox.TabIndex = 7;
this.flowm1Rng2CheckBox.Text = "2";
this.flowm1Rng2CheckBox.UseVisualStyleBackColor = true;
//
// flowm1Rng3CheckBox
//
this.flowm1Rng3CheckBox.AutoSize = true;
this.flowm1Rng3CheckBox.Enabled = false;
this.flowm1Rng3CheckBox.Location = new System.Drawing.Point(305, 96);
this.flowm1Rng3CheckBox.Name = "flowm1Rng3CheckBox";
this.flowm1Rng3CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm1Rng3CheckBox.TabIndex = 8;
this.flowm1Rng3CheckBox.Text = "3";
this.flowm1Rng3CheckBox.UseVisualStyleBackColor = true;
//
// flowm1Rng4CheckBox
//
this.flowm1Rng4CheckBox.AutoSize = true;
this.flowm1Rng4CheckBox.Enabled = false;
this.flowm1Rng4CheckBox.Location = new System.Drawing.Point(335, 96);
this.flowm1Rng4CheckBox.Name = "flowm1Rng4CheckBox";
this.flowm1Rng4CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm1Rng4CheckBox.TabIndex = 9;
this.flowm1Rng4CheckBox.Text = "4";
this.flowm1Rng4CheckBox.UseVisualStyleBackColor = true;
//
// flowm1Rng5CheckBox
//
this.flowm1Rng5CheckBox.AutoSize = true;
this.flowm1Rng5CheckBox.Enabled = false;
this.flowm1Rng5CheckBox.Location = new System.Drawing.Point(365, 96);
this.flowm1Rng5CheckBox.Name = "flowm1Rng5CheckBox";
this.flowm1Rng5CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm1Rng5CheckBox.TabIndex = 10;
this.flowm1Rng5CheckBox.Text = "5";
this.flowm1Rng5CheckBox.UseVisualStyleBackColor = true;
//
// flowm2Rng5CheckBox
//
this.flowm2Rng5CheckBox.AutoSize = true;
this.flowm2Rng5CheckBox.Enabled = false;
this.flowm2Rng5CheckBox.Location = new System.Drawing.Point(365, 123);
this.flowm2Rng5CheckBox.Name = "flowm2Rng5CheckBox";
this.flowm2Rng5CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm2Rng5CheckBox.TabIndex = 18;
this.flowm2Rng5CheckBox.Text = "5";
this.flowm2Rng5CheckBox.UseVisualStyleBackColor = true;
//
// flowm2Rng4CheckBox
//
this.flowm2Rng4CheckBox.AutoSize = true;
this.flowm2Rng4CheckBox.Enabled = false;
this.flowm2Rng4CheckBox.Location = new System.Drawing.Point(335, 123);
this.flowm2Rng4CheckBox.Name = "flowm2Rng4CheckBox";
this.flowm2Rng4CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm2Rng4CheckBox.TabIndex = 17;
this.flowm2Rng4CheckBox.Text = "4";
this.flowm2Rng4CheckBox.UseVisualStyleBackColor = true;
//
// flowm2Rng3CheckBox
//
this.flowm2Rng3CheckBox.AutoSize = true;
this.flowm2Rng3CheckBox.Enabled = false;
this.flowm2Rng3CheckBox.Location = new System.Drawing.Point(305, 123);
this.flowm2Rng3CheckBox.Name = "flowm2Rng3CheckBox";
this.flowm2Rng3CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm2Rng3CheckBox.TabIndex = 16;
this.flowm2Rng3CheckBox.Text = "3";
this.flowm2Rng3CheckBox.UseVisualStyleBackColor = true;
//
// flowm2Rng2CheckBox
//
this.flowm2Rng2CheckBox.AutoSize = true;
this.flowm2Rng2CheckBox.Enabled = false;
this.flowm2Rng2CheckBox.Location = new System.Drawing.Point(275, 123);
this.flowm2Rng2CheckBox.Name = "flowm2Rng2CheckBox";
this.flowm2Rng2CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm2Rng2CheckBox.TabIndex = 15;
this.flowm2Rng2CheckBox.Text = "2";
this.flowm2Rng2CheckBox.UseVisualStyleBackColor = true;
//
// flowm2Rng1CheckBox
//
this.flowm2Rng1CheckBox.AutoSize = true;
this.flowm2Rng1CheckBox.Enabled = false;
this.flowm2Rng1CheckBox.Location = new System.Drawing.Point(245, 123);
this.flowm2Rng1CheckBox.Name = "flowm2Rng1CheckBox";
this.flowm2Rng1CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm2Rng1CheckBox.TabIndex = 14;
this.flowm2Rng1CheckBox.Text = "1";
this.flowm2Rng1CheckBox.UseVisualStyleBackColor = true;
//
// flowmeter2ComboBox
//
this.flowmeter2ComboBox.Enabled = false;
this.flowmeter2ComboBox.FormattingEnabled = true;
this.flowmeter2ComboBox.Location = new System.Drawing.Point(95, 120);
this.flowmeter2ComboBox.Name = "flowmeter2ComboBox";
this.flowmeter2ComboBox.Size = new System.Drawing.Size(69, 21);
this.flowmeter2ComboBox.TabIndex = 12;
//
// flowmeter2Label
//
this.flowmeter2Label.AutoSize = true;
this.flowmeter2Label.Location = new System.Drawing.Point(15, 123);
this.flowmeter2Label.Name = "flowmeter2Label";
this.flowmeter2Label.Size = new System.Drawing.Size(64, 13);
this.flowmeter2Label.TabIndex = 11;
this.flowmeter2Label.Text = "Flowmeter 2";
//
// flowm3Rng5CheckBox
//
this.flowm3Rng5CheckBox.AutoSize = true;
this.flowm3Rng5CheckBox.Enabled = false;
this.flowm3Rng5CheckBox.Location = new System.Drawing.Point(365, 150);
this.flowm3Rng5CheckBox.Name = "flowm3Rng5CheckBox";
this.flowm3Rng5CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm3Rng5CheckBox.TabIndex = 26;
this.flowm3Rng5CheckBox.Text = "5";
this.flowm3Rng5CheckBox.UseVisualStyleBackColor = true;
//
// flowm3Rng4CheckBox
//
this.flowm3Rng4CheckBox.AutoSize = true;
this.flowm3Rng4CheckBox.Enabled = false;
this.flowm3Rng4CheckBox.Location = new System.Drawing.Point(335, 150);
this.flowm3Rng4CheckBox.Name = "flowm3Rng4CheckBox";
this.flowm3Rng4CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm3Rng4CheckBox.TabIndex = 25;
this.flowm3Rng4CheckBox.Text = "4";
this.flowm3Rng4CheckBox.UseVisualStyleBackColor = true;
//
// flowm3Rng3CheckBox
//
this.flowm3Rng3CheckBox.AutoSize = true;
this.flowm3Rng3CheckBox.Enabled = false;
this.flowm3Rng3CheckBox.Location = new System.Drawing.Point(305, 150);
this.flowm3Rng3CheckBox.Name = "flowm3Rng3CheckBox";
this.flowm3Rng3CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm3Rng3CheckBox.TabIndex = 24;
this.flowm3Rng3CheckBox.Text = "3";
this.flowm3Rng3CheckBox.UseVisualStyleBackColor = true;
//
// flowm3Rng2CheckBox
//
this.flowm3Rng2CheckBox.AutoSize = true;
this.flowm3Rng2CheckBox.Enabled = false;
this.flowm3Rng2CheckBox.Location = new System.Drawing.Point(275, 150);
this.flowm3Rng2CheckBox.Name = "flowm3Rng2CheckBox";
this.flowm3Rng2CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm3Rng2CheckBox.TabIndex = 23;
this.flowm3Rng2CheckBox.Text = "2";
this.flowm3Rng2CheckBox.UseVisualStyleBackColor = true;
//
// flowm3Rng1CheckBox
//
this.flowm3Rng1CheckBox.AutoSize = true;
this.flowm3Rng1CheckBox.Enabled = false;
this.flowm3Rng1CheckBox.Location = new System.Drawing.Point(245, 150);
this.flowm3Rng1CheckBox.Name = "flowm3Rng1CheckBox";
this.flowm3Rng1CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm3Rng1CheckBox.TabIndex = 22;
this.flowm3Rng1CheckBox.Text = "1";
this.flowm3Rng1CheckBox.UseVisualStyleBackColor = true;
//
// flowmeter3ComboBox
//
this.flowmeter3ComboBox.Enabled = false;
this.flowmeter3ComboBox.FormattingEnabled = true;
this.flowmeter3ComboBox.Location = new System.Drawing.Point(95, 147);
this.flowmeter3ComboBox.Name = "flowmeter3ComboBox";
this.flowmeter3ComboBox.Size = new System.Drawing.Size(69, 21);
this.flowmeter3ComboBox.TabIndex = 20;
//
// flowmeter3Label
//
this.flowmeter3Label.AutoSize = true;
this.flowmeter3Label.Location = new System.Drawing.Point(15, 150);
this.flowmeter3Label.Name = "flowmeter3Label";
this.flowmeter3Label.Size = new System.Drawing.Size(64, 13);
this.flowmeter3Label.TabIndex = 19;
this.flowmeter3Label.Text = "Flowmeter 3";
//
// flowm4Rng5CheckBox
//
this.flowm4Rng5CheckBox.AutoSize = true;
this.flowm4Rng5CheckBox.Enabled = false;
this.flowm4Rng5CheckBox.Location = new System.Drawing.Point(365, 177);
this.flowm4Rng5CheckBox.Name = "flowm4Rng5CheckBox";
this.flowm4Rng5CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm4Rng5CheckBox.TabIndex = 34;
this.flowm4Rng5CheckBox.Text = "5";
this.flowm4Rng5CheckBox.UseVisualStyleBackColor = true;
//
// flowm4Rng4CheckBox
//
this.flowm4Rng4CheckBox.AutoSize = true;
this.flowm4Rng4CheckBox.Enabled = false;
this.flowm4Rng4CheckBox.Location = new System.Drawing.Point(335, 177);
this.flowm4Rng4CheckBox.Name = "flowm4Rng4CheckBox";
this.flowm4Rng4CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm4Rng4CheckBox.TabIndex = 33;
this.flowm4Rng4CheckBox.Text = "4";
this.flowm4Rng4CheckBox.UseVisualStyleBackColor = true;
//
// flowm4Rng3CheckBox
//
this.flowm4Rng3CheckBox.AutoSize = true;
this.flowm4Rng3CheckBox.Enabled = false;
this.flowm4Rng3CheckBox.Location = new System.Drawing.Point(305, 177);
this.flowm4Rng3CheckBox.Name = "flowm4Rng3CheckBox";
this.flowm4Rng3CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm4Rng3CheckBox.TabIndex = 32;
this.flowm4Rng3CheckBox.Text = "3";
this.flowm4Rng3CheckBox.UseVisualStyleBackColor = true;
//
// flowm4Rng2CheckBox
//
this.flowm4Rng2CheckBox.AutoSize = true;
this.flowm4Rng2CheckBox.Enabled = false;
this.flowm4Rng2CheckBox.Location = new System.Drawing.Point(275, 177);
this.flowm4Rng2CheckBox.Name = "flowm4Rng2CheckBox";
this.flowm4Rng2CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm4Rng2CheckBox.TabIndex = 31;
this.flowm4Rng2CheckBox.Text = "2";
this.flowm4Rng2CheckBox.UseVisualStyleBackColor = true;
//
// flowm4Rng1CheckBox
//
this.flowm4Rng1CheckBox.AutoSize = true;
this.flowm4Rng1CheckBox.Enabled = false;
this.flowm4Rng1CheckBox.Location = new System.Drawing.Point(245, 177);
this.flowm4Rng1CheckBox.Name = "flowm4Rng1CheckBox";
this.flowm4Rng1CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm4Rng1CheckBox.TabIndex = 30;
this.flowm4Rng1CheckBox.Text = "1";
this.flowm4Rng1CheckBox.UseVisualStyleBackColor = true;
//
// flowmeter4ComboBox
//
this.flowmeter4ComboBox.Enabled = false;
this.flowmeter4ComboBox.FormattingEnabled = true;
this.flowmeter4ComboBox.Location = new System.Drawing.Point(95, 174);
this.flowmeter4ComboBox.Name = "flowmeter4ComboBox";
this.flowmeter4ComboBox.Size = new System.Drawing.Size(69, 21);
this.flowmeter4ComboBox.TabIndex = 28;
//
// flowmeter4Label
//
this.flowmeter4Label.AutoSize = true;
this.flowmeter4Label.Location = new System.Drawing.Point(15, 177);
this.flowmeter4Label.Name = "flowmeter4Label";
this.flowmeter4Label.Size = new System.Drawing.Size(64, 13);
this.flowmeter4Label.TabIndex = 27;
this.flowmeter4Label.Text = "Flowmeter 4";
//
// flowm5Rng5CheckBox
//
this.flowm5Rng5CheckBox.AutoSize = true;
this.flowm5Rng5CheckBox.Enabled = false;
this.flowm5Rng5CheckBox.Location = new System.Drawing.Point(365, 204);
this.flowm5Rng5CheckBox.Name = "flowm5Rng5CheckBox";
this.flowm5Rng5CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm5Rng5CheckBox.TabIndex = 42;
this.flowm5Rng5CheckBox.Text = "5";
this.flowm5Rng5CheckBox.UseVisualStyleBackColor = true;
//
// flowm5Rng4CheckBox
//
this.flowm5Rng4CheckBox.AutoSize = true;
this.flowm5Rng4CheckBox.Enabled = false;
this.flowm5Rng4CheckBox.Location = new System.Drawing.Point(335, 204);
this.flowm5Rng4CheckBox.Name = "flowm5Rng4CheckBox";
this.flowm5Rng4CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm5Rng4CheckBox.TabIndex = 41;
this.flowm5Rng4CheckBox.Text = "4";
this.flowm5Rng4CheckBox.UseVisualStyleBackColor = true;
//
// flowm5Rng3CheckBox
//
this.flowm5Rng3CheckBox.AutoSize = true;
this.flowm5Rng3CheckBox.Enabled = false;
this.flowm5Rng3CheckBox.Location = new System.Drawing.Point(305, 204);
this.flowm5Rng3CheckBox.Name = "flowm5Rng3CheckBox";
this.flowm5Rng3CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm5Rng3CheckBox.TabIndex = 40;
this.flowm5Rng3CheckBox.Text = "3";
this.flowm5Rng3CheckBox.UseVisualStyleBackColor = true;
//
// flowm5Rng2CheckBox
//
this.flowm5Rng2CheckBox.AutoSize = true;
this.flowm5Rng2CheckBox.Enabled = false;
this.flowm5Rng2CheckBox.Location = new System.Drawing.Point(275, 204);
this.flowm5Rng2CheckBox.Name = "flowm5Rng2CheckBox";
this.flowm5Rng2CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm5Rng2CheckBox.TabIndex = 39;
this.flowm5Rng2CheckBox.Text = "2";
this.flowm5Rng2CheckBox.UseVisualStyleBackColor = true;
//
// flowm5Rng1CheckBox
//
this.flowm5Rng1CheckBox.AutoSize = true;
this.flowm5Rng1CheckBox.Enabled = false;
this.flowm5Rng1CheckBox.Location = new System.Drawing.Point(245, 204);
this.flowm5Rng1CheckBox.Name = "flowm5Rng1CheckBox";
this.flowm5Rng1CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm5Rng1CheckBox.TabIndex = 38;
this.flowm5Rng1CheckBox.Text = "1";
this.flowm5Rng1CheckBox.UseVisualStyleBackColor = true;
//
// flowmeter5ComboBox
//
this.flowmeter5ComboBox.Enabled = false;
this.flowmeter5ComboBox.FormattingEnabled = true;
this.flowmeter5ComboBox.Location = new System.Drawing.Point(95, 201);
this.flowmeter5ComboBox.Name = "flowmeter5ComboBox";
this.flowmeter5ComboBox.Size = new System.Drawing.Size(69, 21);
this.flowmeter5ComboBox.TabIndex = 36;
//
// flowmeter5Label
//
this.flowmeter5Label.AutoSize = true;
this.flowmeter5Label.Location = new System.Drawing.Point(15, 204);
this.flowmeter5Label.Name = "flowmeter5Label";
this.flowmeter5Label.Size = new System.Drawing.Size(64, 13);
this.flowmeter5Label.TabIndex = 35;
this.flowmeter5Label.Text = "Flowmeter 5";
//
// flowm5Rng0CheckBox
//
this.flowm5Rng0CheckBox.AutoSize = true;
this.flowm5Rng0CheckBox.Enabled = false;
this.flowm5Rng0CheckBox.Location = new System.Drawing.Point(196, 204);
this.flowm5Rng0CheckBox.Name = "flowm5Rng0CheckBox";
this.flowm5Rng0CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm5Rng0CheckBox.TabIndex = 37;
this.flowm5Rng0CheckBox.Text = "0";
this.flowm5Rng0CheckBox.UseVisualStyleBackColor = true;
//
// flowm4Rng0CheckBox
//
this.flowm4Rng0CheckBox.AutoSize = true;
this.flowm4Rng0CheckBox.Enabled = false;
this.flowm4Rng0CheckBox.Location = new System.Drawing.Point(196, 177);
this.flowm4Rng0CheckBox.Name = "flowm4Rng0CheckBox";
this.flowm4Rng0CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm4Rng0CheckBox.TabIndex = 29;
this.flowm4Rng0CheckBox.Text = "0";
this.flowm4Rng0CheckBox.UseVisualStyleBackColor = true;
//
// flowm3Rng0CheckBox
//
this.flowm3Rng0CheckBox.AutoSize = true;
this.flowm3Rng0CheckBox.Enabled = false;
this.flowm3Rng0CheckBox.Location = new System.Drawing.Point(196, 150);
this.flowm3Rng0CheckBox.Name = "flowm3Rng0CheckBox";
this.flowm3Rng0CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm3Rng0CheckBox.TabIndex = 21;
this.flowm3Rng0CheckBox.Text = "0";
this.flowm3Rng0CheckBox.UseVisualStyleBackColor = true;
//
// flowm2Rng0CheckBox
//
this.flowm2Rng0CheckBox.AutoSize = true;
this.flowm2Rng0CheckBox.Enabled = false;
this.flowm2Rng0CheckBox.Location = new System.Drawing.Point(196, 123);
this.flowm2Rng0CheckBox.Name = "flowm2Rng0CheckBox";
this.flowm2Rng0CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm2Rng0CheckBox.TabIndex = 13;
this.flowm2Rng0CheckBox.Text = "0";
this.flowm2Rng0CheckBox.UseVisualStyleBackColor = true;
//
// flowm1Rng0CheckBox
//
this.flowm1Rng0CheckBox.AutoSize = true;
this.flowm1Rng0CheckBox.Enabled = false;
this.flowm1Rng0CheckBox.Location = new System.Drawing.Point(196, 96);
this.flowm1Rng0CheckBox.Name = "flowm1Rng0CheckBox";
this.flowm1Rng0CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm1Rng0CheckBox.TabIndex = 5;
this.flowm1Rng0CheckBox.Text = "0";
this.flowm1Rng0CheckBox.UseVisualStyleBackColor = true;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(193, 72);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(179, 13);
this.label1.TabIndex = 43;
this.label1.Text = "Ranges to calibrate (either 0 or 1...5)";
//
// flowm6Rng0CheckBox
//
this.flowm6Rng0CheckBox.AutoSize = true;
this.flowm6Rng0CheckBox.Enabled = false;
this.flowm6Rng0CheckBox.Location = new System.Drawing.Point(196, 231);
this.flowm6Rng0CheckBox.Name = "flowm6Rng0CheckBox";
this.flowm6Rng0CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm6Rng0CheckBox.TabIndex = 46;
this.flowm6Rng0CheckBox.Text = "0";
this.flowm6Rng0CheckBox.UseVisualStyleBackColor = true;
//
// flowm6Rng5CheckBox
//
this.flowm6Rng5CheckBox.AutoSize = true;
this.flowm6Rng5CheckBox.Enabled = false;
this.flowm6Rng5CheckBox.Location = new System.Drawing.Point(365, 231);
this.flowm6Rng5CheckBox.Name = "flowm6Rng5CheckBox";
this.flowm6Rng5CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm6Rng5CheckBox.TabIndex = 51;
this.flowm6Rng5CheckBox.Text = "5";
this.flowm6Rng5CheckBox.UseVisualStyleBackColor = true;
//
// flowm6Rng4CheckBox
//
this.flowm6Rng4CheckBox.AutoSize = true;
this.flowm6Rng4CheckBox.Enabled = false;
this.flowm6Rng4CheckBox.Location = new System.Drawing.Point(335, 231);
this.flowm6Rng4CheckBox.Name = "flowm6Rng4CheckBox";
this.flowm6Rng4CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm6Rng4CheckBox.TabIndex = 50;
this.flowm6Rng4CheckBox.Text = "4";
this.flowm6Rng4CheckBox.UseVisualStyleBackColor = true;
//
// flowm6Rng3CheckBox
//
this.flowm6Rng3CheckBox.AutoSize = true;
this.flowm6Rng3CheckBox.Enabled = false;
this.flowm6Rng3CheckBox.Location = new System.Drawing.Point(305, 231);
this.flowm6Rng3CheckBox.Name = "flowm6Rng3CheckBox";
this.flowm6Rng3CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm6Rng3CheckBox.TabIndex = 49;
this.flowm6Rng3CheckBox.Text = "3";
this.flowm6Rng3CheckBox.UseVisualStyleBackColor = true;
//
// flowm6Rng2CheckBox
//
this.flowm6Rng2CheckBox.AutoSize = true;
this.flowm6Rng2CheckBox.Enabled = false;
this.flowm6Rng2CheckBox.Location = new System.Drawing.Point(275, 231);
this.flowm6Rng2CheckBox.Name = "flowm6Rng2CheckBox";
this.flowm6Rng2CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm6Rng2CheckBox.TabIndex = 48;
this.flowm6Rng2CheckBox.Text = "2";
this.flowm6Rng2CheckBox.UseVisualStyleBackColor = true;
//
// flowm6Rng1CheckBox
//
this.flowm6Rng1CheckBox.AutoSize = true;
this.flowm6Rng1CheckBox.Enabled = false;
this.flowm6Rng1CheckBox.Location = new System.Drawing.Point(245, 231);
this.flowm6Rng1CheckBox.Name = "flowm6Rng1CheckBox";
this.flowm6Rng1CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm6Rng1CheckBox.TabIndex = 47;
this.flowm6Rng1CheckBox.Text = "1";
this.flowm6Rng1CheckBox.UseVisualStyleBackColor = true;
//
// flowmeter6ComboBox
//
this.flowmeter6ComboBox.Enabled = false;
this.flowmeter6ComboBox.FormattingEnabled = true;
this.flowmeter6ComboBox.Location = new System.Drawing.Point(95, 228);
this.flowmeter6ComboBox.Name = "flowmeter6ComboBox";
this.flowmeter6ComboBox.Size = new System.Drawing.Size(69, 21);
this.flowmeter6ComboBox.TabIndex = 45;
//
// flowmeter6Label
//
this.flowmeter6Label.AutoSize = true;
this.flowmeter6Label.Location = new System.Drawing.Point(15, 231);
this.flowmeter6Label.Name = "flowmeter6Label";
this.flowmeter6Label.Size = new System.Drawing.Size(64, 13);
this.flowmeter6Label.TabIndex = 44;
this.flowmeter6Label.Text = "Flowmeter 6";
//
// flowm7Rng0CheckBox
//
this.flowm7Rng0CheckBox.AutoSize = true;
this.flowm7Rng0CheckBox.Enabled = false;
this.flowm7Rng0CheckBox.Location = new System.Drawing.Point(196, 258);
this.flowm7Rng0CheckBox.Name = "flowm7Rng0CheckBox";
this.flowm7Rng0CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm7Rng0CheckBox.TabIndex = 54;
this.flowm7Rng0CheckBox.Text = "0";
this.flowm7Rng0CheckBox.UseVisualStyleBackColor = true;
//
// flowm7Rng5CheckBox
//
this.flowm7Rng5CheckBox.AutoSize = true;
this.flowm7Rng5CheckBox.Enabled = false;
this.flowm7Rng5CheckBox.Location = new System.Drawing.Point(365, 258);
this.flowm7Rng5CheckBox.Name = "flowm7Rng5CheckBox";
this.flowm7Rng5CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm7Rng5CheckBox.TabIndex = 59;
this.flowm7Rng5CheckBox.Text = "5";
this.flowm7Rng5CheckBox.UseVisualStyleBackColor = true;
//
// flowm7Rng4CheckBox
//
this.flowm7Rng4CheckBox.AutoSize = true;
this.flowm7Rng4CheckBox.Enabled = false;
this.flowm7Rng4CheckBox.Location = new System.Drawing.Point(335, 258);
this.flowm7Rng4CheckBox.Name = "flowm7Rng4CheckBox";
this.flowm7Rng4CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm7Rng4CheckBox.TabIndex = 58;
this.flowm7Rng4CheckBox.Text = "4";
this.flowm7Rng4CheckBox.UseVisualStyleBackColor = true;
//
// flowm7Rng3CheckBox
//
this.flowm7Rng3CheckBox.AutoSize = true;
this.flowm7Rng3CheckBox.Enabled = false;
this.flowm7Rng3CheckBox.Location = new System.Drawing.Point(305, 258);
this.flowm7Rng3CheckBox.Name = "flowm7Rng3CheckBox";
this.flowm7Rng3CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm7Rng3CheckBox.TabIndex = 57;
this.flowm7Rng3CheckBox.Text = "3";
this.flowm7Rng3CheckBox.UseVisualStyleBackColor = true;
//
// flowm7Rng2CheckBox
//
this.flowm7Rng2CheckBox.AutoSize = true;
this.flowm7Rng2CheckBox.Enabled = false;
this.flowm7Rng2CheckBox.Location = new System.Drawing.Point(275, 258);
this.flowm7Rng2CheckBox.Name = "flowm7Rng2CheckBox";
this.flowm7Rng2CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm7Rng2CheckBox.TabIndex = 56;
this.flowm7Rng2CheckBox.Text = "2";
this.flowm7Rng2CheckBox.UseVisualStyleBackColor = true;
//
// flowm7Rng1CheckBox
//
this.flowm7Rng1CheckBox.AutoSize = true;
this.flowm7Rng1CheckBox.Enabled = false;
this.flowm7Rng1CheckBox.Location = new System.Drawing.Point(245, 258);
this.flowm7Rng1CheckBox.Name = "flowm7Rng1CheckBox";
this.flowm7Rng1CheckBox.Size = new System.Drawing.Size(32, 17);
this.flowm7Rng1CheckBox.TabIndex = 55;
this.flowm7Rng1CheckBox.Text = "1";
this.flowm7Rng1CheckBox.UseVisualStyleBackColor = true;
//
// flowmeter7ComboBox
//
this.flowmeter7ComboBox.Enabled = false;
this.flowmeter7ComboBox.FormattingEnabled = true;
this.flowmeter7ComboBox.Location = new System.Drawing.Point(95, 255);
this.flowmeter7ComboBox.Name = "flowmeter7ComboBox";
this.flowmeter7ComboBox.Size = new System.Drawing.Size(69, 21);
this.flowmeter7ComboBox.TabIndex = 53;
//
// flowmeter7Label
//
this.flowmeter7Label.AutoSize = true;
this.flowmeter7Label.Location = new System.Drawing.Point(15, 258);
this.flowmeter7Label.Name = "flowmeter7Label";
this.flowmeter7Label.Size = new System.Drawing.Size(64, 13);
this.flowmeter7Label.TabIndex = 52;
this.flowmeter7Label.Text = "Flowmeter 7";
//
// SaveFlowmeterCorrCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.flowmeterComboBox);
this.Controls.Add(this.rangeIdTextBox);
this.Controls.Add(this.rangeIdLabel);
this.Controls.Add(this.flowmeterLabel);
this.Controls.Add(this.flowm7Rng0CheckBox);
this.Controls.Add(this.flowm7Rng5CheckBox);
this.Controls.Add(this.flowm7Rng4CheckBox);
this.Controls.Add(this.flowm7Rng3CheckBox);
this.Controls.Add(this.flowm7Rng2CheckBox);
this.Controls.Add(this.flowm7Rng1CheckBox);
this.Controls.Add(this.flowmeter7ComboBox);
this.Controls.Add(this.flowmeter7Label);
this.Controls.Add(this.flowm6Rng0CheckBox);
this.Controls.Add(this.flowm6Rng5CheckBox);
this.Controls.Add(this.flowm6Rng4CheckBox);
this.Controls.Add(this.flowm6Rng3CheckBox);
this.Controls.Add(this.flowm6Rng2CheckBox);
this.Controls.Add(this.flowm6Rng1CheckBox);
this.Controls.Add(this.flowmeter6ComboBox);
this.Controls.Add(this.flowmeter6Label);
this.Controls.Add(this.label1);
this.Controls.Add(this.flowm5Rng0CheckBox);
this.Controls.Add(this.flowm4Rng0CheckBox);
this.Controls.Add(this.flowm3Rng0CheckBox);
this.Controls.Add(this.flowm2Rng0CheckBox);
this.Controls.Add(this.flowm1Rng0CheckBox);
this.Controls.Add(this.flowm5Rng5CheckBox);
this.Controls.Add(this.flowm5Rng4CheckBox);
this.Controls.Add(this.flowm5Rng3CheckBox);
this.Controls.Add(this.flowm5Rng2CheckBox);
this.Controls.Add(this.flowm5Rng1CheckBox);
this.Controls.Add(this.flowmeter5ComboBox);
this.Controls.Add(this.flowmeter5Label);
this.Controls.Add(this.flowm4Rng5CheckBox);
this.Controls.Add(this.flowm4Rng4CheckBox);
this.Controls.Add(this.flowm4Rng3CheckBox);
this.Controls.Add(this.flowm4Rng2CheckBox);
this.Controls.Add(this.flowm4Rng1CheckBox);
this.Controls.Add(this.flowmeter4ComboBox);
this.Controls.Add(this.flowmeter4Label);
this.Controls.Add(this.flowm3Rng5CheckBox);
this.Controls.Add(this.flowm3Rng4CheckBox);
this.Controls.Add(this.flowm3Rng3CheckBox);
this.Controls.Add(this.flowm3Rng2CheckBox);
this.Controls.Add(this.flowm3Rng1CheckBox);
this.Controls.Add(this.flowmeter3ComboBox);
this.Controls.Add(this.flowmeter3Label);
this.Controls.Add(this.flowm2Rng5CheckBox);
this.Controls.Add(this.flowm2Rng4CheckBox);
this.Controls.Add(this.flowm2Rng3CheckBox);
this.Controls.Add(this.flowm2Rng2CheckBox);
this.Controls.Add(this.flowm2Rng1CheckBox);
this.Controls.Add(this.flowmeter2ComboBox);
this.Controls.Add(this.flowmeter2Label);
this.Controls.Add(this.flowm1Rng5CheckBox);
this.Controls.Add(this.flowm1Rng4CheckBox);
this.Controls.Add(this.flowm1Rng3CheckBox);
this.Controls.Add(this.flowm1Rng2CheckBox);
this.Controls.Add(this.flowm1Rng1CheckBox);
this.Controls.Add(this.flowmeter1ComboBox);
this.Controls.Add(this.flowmeter1Label);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "SaveFlowmeterCorrCfgCtrl";
this.Size = new System.Drawing.Size(450, 230);
this.Size = new System.Drawing.Size(450, 300);
this.Load += new System.EventHandler(this.WriterCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
@@ -125,9 +793,62 @@ namespace TBF.BenchControl.Output.DB.SaveFlowmeterCorrections
private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.Label flowmeterLabel;
private System.Windows.Forms.TextBox rangeIdTextBox;
private System.Windows.Forms.Label rangeIdLabel;
private System.Windows.Forms.ComboBox flowmeterComboBox;
private System.Windows.Forms.Label flowmeter1Label;
private System.Windows.Forms.ComboBox flowmeter1ComboBox;
private System.Windows.Forms.CheckBox flowm1Rng1CheckBox;
private System.Windows.Forms.CheckBox flowm1Rng2CheckBox;
private System.Windows.Forms.CheckBox flowm1Rng3CheckBox;
private System.Windows.Forms.CheckBox flowm1Rng4CheckBox;
private System.Windows.Forms.CheckBox flowm1Rng5CheckBox;
private System.Windows.Forms.CheckBox flowm2Rng5CheckBox;
private System.Windows.Forms.CheckBox flowm2Rng4CheckBox;
private System.Windows.Forms.CheckBox flowm2Rng3CheckBox;
private System.Windows.Forms.CheckBox flowm2Rng2CheckBox;
private System.Windows.Forms.CheckBox flowm2Rng1CheckBox;
private System.Windows.Forms.ComboBox flowmeter2ComboBox;
private System.Windows.Forms.Label flowmeter2Label;
private System.Windows.Forms.CheckBox flowm3Rng5CheckBox;
private System.Windows.Forms.CheckBox flowm3Rng4CheckBox;
private System.Windows.Forms.CheckBox flowm3Rng3CheckBox;
private System.Windows.Forms.CheckBox flowm3Rng2CheckBox;
private System.Windows.Forms.CheckBox flowm3Rng1CheckBox;
private System.Windows.Forms.ComboBox flowmeter3ComboBox;
private System.Windows.Forms.Label flowmeter3Label;
private System.Windows.Forms.CheckBox flowm4Rng5CheckBox;
private System.Windows.Forms.CheckBox flowm4Rng4CheckBox;
private System.Windows.Forms.CheckBox flowm4Rng3CheckBox;
private System.Windows.Forms.CheckBox flowm4Rng2CheckBox;
private System.Windows.Forms.CheckBox flowm4Rng1CheckBox;
private System.Windows.Forms.ComboBox flowmeter4ComboBox;
private System.Windows.Forms.Label flowmeter4Label;
private System.Windows.Forms.CheckBox flowm5Rng5CheckBox;
private System.Windows.Forms.CheckBox flowm5Rng4CheckBox;
private System.Windows.Forms.CheckBox flowm5Rng3CheckBox;
private System.Windows.Forms.CheckBox flowm5Rng2CheckBox;
private System.Windows.Forms.CheckBox flowm5Rng1CheckBox;
private System.Windows.Forms.ComboBox flowmeter5ComboBox;
private System.Windows.Forms.Label flowmeter5Label;
private System.Windows.Forms.CheckBox flowm5Rng0CheckBox;
private System.Windows.Forms.CheckBox flowm4Rng0CheckBox;
private System.Windows.Forms.CheckBox flowm3Rng0CheckBox;
private System.Windows.Forms.CheckBox flowm2Rng0CheckBox;
private System.Windows.Forms.CheckBox flowm1Rng0CheckBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckBox flowm6Rng0CheckBox;
private System.Windows.Forms.CheckBox flowm6Rng5CheckBox;
private System.Windows.Forms.CheckBox flowm6Rng4CheckBox;
private System.Windows.Forms.CheckBox flowm6Rng3CheckBox;
private System.Windows.Forms.CheckBox flowm6Rng2CheckBox;
private System.Windows.Forms.CheckBox flowm6Rng1CheckBox;
private System.Windows.Forms.ComboBox flowmeter6ComboBox;
private System.Windows.Forms.Label flowmeter6Label;
private System.Windows.Forms.CheckBox flowm7Rng0CheckBox;
private System.Windows.Forms.CheckBox flowm7Rng5CheckBox;
private System.Windows.Forms.CheckBox flowm7Rng4CheckBox;
private System.Windows.Forms.CheckBox flowm7Rng3CheckBox;
private System.Windows.Forms.CheckBox flowm7Rng2CheckBox;
private System.Windows.Forms.CheckBox flowm7Rng1CheckBox;
private System.Windows.Forms.ComboBox flowmeter7ComboBox;
private System.Windows.Forms.Label flowmeter7Label;
}
}
@@ -20,8 +20,6 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
readonly WriterCfg writerCfg;
string separatorStr;
///
/// Items to print
///
@@ -0,0 +1,29 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Output.FileWriters.XmlBatch
{
public class FactorySingle : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17) + ".Single"; } }
public void ResetStaticProperties() { Writer.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Writer(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Writer(cfg); }
public IComponentCfg DefaultConfig() { return new WriterCfg("FileWriter.XmlBatch", this, Config.Entities.MetersKind.Single); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
IComponentCfg cfg = ComponentCfgBase.CreateFromDbEntity(WriterCfg.Serializer, component, this);
(cfg as WriterCfg).MetersKind = Config.Entities.MetersKind.Single;
return cfg;
}
}
}
@@ -0,0 +1,310 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Threading;
using log4net;
using Config.Entities;
using TBF.BenchControl;
using TBF.Resources;
namespace TBF.BenchControl.Output.FileWriters.XmlBatch
{
public class Writer : ComponentBase, IOperation, GenericDevices.IResultsWriter
{
private static readonly ILog log = LogManager.GetLogger(typeof(Writer));
public override string ToString() { return string.Format("Output.FileWriters.Enhanced({0})", Cfg.ToString(1)); }
readonly WriterCfg writerCfg;
///
/// Items to print
///
string header;
string rootTag;
string meterTag;
string testTag;
IList<Results.WMeterRsltItemSpec> commonItems;
IList<Results.WMeterRsltItemSpec> meterItems;
IList<Results.WMeterRsltItemSpec> testItems;
Results.Entities.Batch batch;
bool abort;
public Writer() {}
public Writer(Generic.IComponentCfg cfg)
: base(cfg)
{
writerCfg = cfg as WriterCfg;
ApplyConfig();
log.Debug(this.ToString());
}
void ApplyConfig()
{
/// TODO: Apply culture info
rootTag = writerCfg.RootTag;
meterTag = writerCfg.MeterTag;
testTag = writerCfg.TestTag;
header = string.IsNullOrEmpty(writerCfg.Header) ? string.Empty : writerCfg.Header.Replace("~", Environment.NewLine);
commonItems = Results.WMeterRsltItemSpec.FromStrArray(writerCfg.CommonItems);
meterItems = Results.WMeterRsltItemSpec.FromStrArray(writerCfg.MeterItems);
testItems = Results.WMeterRsltItemSpec.FromStrArray(writerCfg.TestItems); /// TestID info will be overwritten later on
}
#region Configuration Change Handling
public static void OnCfgChange(object sender, CfgChangeArgs args)
{
if (CfgChangeHandler == null) return;
try { CfgChangeHandler(sender, args); }
catch (Exception e) { log.Error("CfgChangeHandler(...) failed", e); }
}
public static event EventHandler<CfgChangeArgs> CfgChangeHandler;
public override void StartChangeHandler()
{
CfgChangeHandler += delegate(object sender, CfgChangeArgs args)
{
WriterCfg newCfg = args.Cfg as WriterCfg;
if (newCfg != null && newCfg.Name.Equals(Name))
{
if (args.Command == CfgChangeCmd.CfgChange)
{
writerCfg.DestinationPath = newCfg.DestinationPath;
writerCfg.DestinationPath2 = newCfg.DestinationPath2;
writerCfg.YearFolders = newCfg.YearFolders;
writerCfg.MonthFolders = newCfg.MonthFolders;
writerCfg.DayFolders = newCfg.DayFolders;
writerCfg.FileNameFormat = newCfg.FileNameFormat;
writerCfg.Culture = newCfg.Culture;
writerCfg.Header = newCfg.Header;
writerCfg.RootTag = newCfg.RootTag;
writerCfg.MeterTag = newCfg.MeterTag;
writerCfg.TestTag = newCfg.TestTag;
writerCfg.CommonItems = newCfg.CommonItems;
writerCfg.MeterItems = newCfg.MeterItems;
writerCfg.TestItems = newCfg.TestItems;
ApplyConfig();
}
}
};
}
#endregion Configuration Change Handling
/// <summary>
/// Returns a file name derived from a DateTime structure.
/// Creates directories on this path as a side effect.
/// </summary>
/// <param name="time">Date and time</param>
/// <returns>File name</returns>
string GetFilename(string destinationPath, DateTime time)
{
string directory = destinationPath; /// Ends with "\\";
switch (writerCfg.YearFolders)
{
case YearFolders.FourDigit:
directory = string.Format("{0}{1:yyyy}\\", directory, time);
break;
case YearFolders.TwoDigit:
directory = string.Format("{0}{1:yy}\\", directory, time);
break;
}
switch (writerCfg.MonthFolders)
{
case MonthFolders.Name:
{
string monthStr;
switch (time.Month)
{
default:
case 1: monthStr = "January"; break;
case 2: monthStr = "February"; break;
case 3: monthStr = "March"; break;
case 4: monthStr = "April"; break;
case 5: monthStr = "May"; break;
case 6: monthStr = "June"; break;
case 7: monthStr = "July"; break;
case 8: monthStr = "August"; break;
case 9: monthStr = "September"; break;
case 10: monthStr = "October"; break;
case 11: monthStr = "November"; break;
case 12: monthStr = "December"; break;
}
directory = string.Format("{0}{1}\\", directory, monthStr);
break;
}
case MonthFolders.Digit:
directory = string.Format("{0}{1}\\", directory, time.Month.ToString());
break;
case MonthFolders.TwoDigit:
directory = string.Format("{0}{1:MM}\\", directory, time);
break;
}
switch (writerCfg.DayFolders)
{
case DayFolders.Digit:
directory = string.Format("{0}{1}\\", directory, time.Day.ToString());
break;
case DayFolders.TwoDigit:
directory = string.Format("{0}{1:dd}\\", directory, time);
break;
}
Directory.CreateDirectory(directory);
try
{
if (string.IsNullOrEmpty(writerCfg.FileNameFormat)) throw new Exception();
return directory + string.Format(writerCfg.FileNameFormat, time);
}
catch
{
return string.Format("{0}{1:yyMMdd-HHmm}.xml", directory, time);
}
}
/// <summary>
/// Writes the test cycle results into a file
/// Events:
/// Event.ResultsWritten
/// Event.Busy
/// </summary>
/// <param name="batch">Results to write into files</param>
/// <returns>Reference to the operation</returns>
public IOperation WriteResultsOp(Results.Entities.Batch batch)
{
this.batch = batch;
return this;
}
/// <summary>Start this operation</summary>
public void Start()
{
CultureInfo oriCulture = Thread.CurrentThread.CurrentCulture;
if (writerCfg.Culture != Culture.system)
{
Thread.CurrentThread.CurrentCulture = new CultureInfo(writerCfg.Culture.ToString());
}
WriteRslts(batch, writerCfg.DestinationPath);
WriteRslts(batch, writerCfg.DestinationPath2);
Thread.CurrentThread.CurrentCulture = oriCulture;
}
/// <summary>Run this operation</summary>
/// <returns>Event.ResultsWritten</returns>
public Event Run()
{
return Event.ResultsWritten;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
}
void WriteRslts(Results.Entities.Batch batch, string destination)
{
if (string.IsNullOrEmpty(destination)) return;
if (batch.WaterMeters == null || batch.WaterMeters.Count == 0) return;
try
{
StreamWriter writer = File.AppendText(GetFilename(destination, batch.EndTime));
WriteBatch(writer);
writer.Close();
}
catch
{
}
}
/// <summary>
/// Write one water meter results
/// </summary>
/// <param name="wmNr">Water meter number (0-based)</param>
void WriteBatch(StreamWriter wr)
{
/// Header
if (!string.IsNullOrEmpty(writerCfg.Header)) wr.Write(header);
wr.WriteLine(string.Format("<{0}>", rootTag));
/// Common items
foreach (var v in commonItems)
{
if (abort) return;
/// Fetch the item and strip color information
string itemText = v.Print(batch.WaterMeters[0]);
string[] texts = itemText.Split(new char[] { '|' });
if (texts.Length == 2) { itemText = texts[0]; }
wr.WriteLine(" <{0}>{1}</{0}>", v.Caption, itemText);
}
foreach (var wm in batch.WaterMeters)
{
wr.WriteLine(string.Format(" <{0}>", meterTag));
/// Meter items
foreach (var v in meterItems)
{
if (abort) return;
/// Fetch the item and strip color information
string itemText = v.Print(wm);
string[] texts = itemText.Split(new char[] { '|' });
if (texts.Length == 2) { itemText = texts[0]; }
wr.WriteLine(" <{0}>{1}</{0}>", v.Caption, itemText);
}
/// Test items
foreach (var mtr in wm.MeterTestRslts)
{
if (abort) return;
if ((mtr != null) && (mtr.Publish() == Config.Entities.Publish.Always))
{
wr.WriteLine(string.Format(" <{0}>", testTag));
for (int i = 0; i < testItems.Count; i++)
{
/// Fetch the item and strip color information
string itemText = testItems[i].Print(wm, mtr.Name());
string[] texts = itemText.Split(new char[] { '|' });
if (texts.Length == 2) { itemText = texts[0]; }
/// Print the item
wr.WriteLine(" <{0}>{1}</{0}>", testItems[i].Caption, itemText);
}
wr.WriteLine(string.Format(" </{0}>", testTag));
}
}
wr.WriteLine(string.Format(" </{0}>", meterTag));
}
/// Footer
wr.WriteLine(string.Format("</{0}>", rootTag));
}
}
}
@@ -0,0 +1,76 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Output.FileWriters.XmlBatch
{
public class WriterCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(WriterCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new WriterCfgCtrl(); }
public string DestinationPath; /// Directory path into which the results will be saved
public string DestinationPath2; /// Directory path into which the 2nd copy of results will be saved
public YearFolders YearFolders;
public MonthFolders MonthFolders;
public DayFolders DayFolders;
public string FileNameFormat;
public Culture Culture;
public string Header;
public string RootTag;
public string MeterTag;
public string TestTag;
public string[] CommonItems;
public string[] MeterItems;
public string[] TestItems;
[XmlIgnore]
public Config.Entities.MetersKind MetersKind;
/// Private parameterless constructor invoked by all other (public) constructors
WriterCfg()
{
}
public WriterCfg(string name, IComponentFactory factory, Config.Entities.MetersKind metersKind)
: this()
{
Name = name;
Factory = factory;
MetersKind = metersKind;
ParentName = string.Empty;
DestinationPath = Path.Combine(Program.HomeDir, "Results", "Xml");
DestinationPath2 = string.Empty;
YearFolders = YearFolders.FourDigit;
MonthFolders = MonthFolders.Digit;
DayFolders = DayFolders.Digit;
FileNameFormat = "{0:yyMMdd-HHmm}.xml";
Culture = Culture.EN;
Header = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
RootTag = "Batch";
MeterTag = "Meter";
TestTag = "Test";
}
public string ToString(int i)
{
return string.Format("Name={0}, Path={1}, Y={2}, M={3}, D={4}, FNameFmt={5}, Culture={6}",
Name,
DestinationPath,
YearFolders,
MonthFolders,
DayFolders,
FileNameFormat,
Culture);
}
}
}
@@ -0,0 +1,364 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using log4net;
using TBF.BenchControl.Generic;
using TBF.Resources;
namespace TBF.BenchControl.Output.FileWriters.XmlBatch
{
public partial class WriterCfgCtrl : UserControl, IComponentCfgCtrl
{
static readonly ILog log = LogManager.GetLogger(typeof(WriterCfgCtrl));
public bool ShowMore { get { return false; } }
public bool Compound;
WriterCfg config;
public IComponentCfg Config
{
get { return config as IComponentCfg; }
set
{
config = value as WriterCfg;
Redraw();
}
}
string header;
string[] commonItems;
string[] meterItems;
string[] testItems;
public WriterCfgCtrl()
{
InitializeComponent();
Localize();
}
private void WriterCfgCtrl_Load(object sender, EventArgs e)
{
for (YearFolders s = 0; s < YearFolders.Count; s++) yearFoldersComboBox.Items.Add(s.ToString());
for (MonthFolders s = 0; s < MonthFolders.Count; s++) monthFoldersComboBox.Items.Add(s.ToString());
for (DayFolders s = 0; s < DayFolders.Count; s++) dayFoldersComboBox.Items.Add(s.ToString());
for (Culture s = 0; s < Culture.Count; s++) cultureComboBox.Items.Add(s.ToString());
header = config.Header;
commonItems = config.CommonItems;
meterItems = config.MeterItems;
testItems = config.TestItems;
Redraw();
}
void Localize()
{
nameLabel.Text = Strings.Name;
destinationLabel.Text = "Destination";
destination2Label.Text = "Destination" + " 2";
yearFoldersLabel.Text = "Year folders";
monthFoldersLabel.Text = "Month folders";
dayFoldersLabel.Text = "Day folders";
fileNameFmtLabel.Text = "File name format";
cultureLabel.Text = "Culture";
headerButton.Text = Strings.Header;
rootTagLabel.Text = "Root tag";
commonItemsButton.Text = "Common items";
meterTagLabel.Text = "Meter tag";
meterItemsButton.Text = "Meter items";
testTagLabel.Text = "Test tag";
testItemsButton.Text = "Test items";
}
public void Closing()
{
}
void Redraw()
{
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
destinationTextBox.Text = config.DestinationPath;
destination2TextBox.Text = config.DestinationPath2;
yearFoldersComboBox.Text = config.YearFolders.ToString();
monthFoldersComboBox.Text = config.MonthFolders.ToString();
dayFoldersComboBox.Text = config.DayFolders.ToString();
fileNameFmtTextBox.Text = config.FileNameFormat;
cultureComboBox.Text = config.Culture.ToString();
rootTagTextBox.Text = config.RootTag;
meterTagTextBox.Text = config.MeterTag;
testTagTextBox.Text = config.TestTag;
}
public void Unlock()
{
nameTextBox.Enabled = true;
destinationTextBox.Enabled = true;
destinationButton.Enabled = true;
destination2TextBox.Enabled = true;
destination2Button.Enabled = true;
yearFoldersComboBox.Enabled = true;
monthFoldersComboBox.Enabled = true;
dayFoldersComboBox.Enabled = true;
fileNameFmtTextBox.Enabled = true;
cultureComboBox.Enabled = true;
headerButton.Enabled = true;
rootTagTextBox.Enabled = true;
commonItemsButton.Enabled = true;
meterTagTextBox.Enabled = true;
meterItemsButton.Enabled = true;
testTagTextBox.Enabled = true;
testItemsButton.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
if (!yearFoldersComboBox.Items.Contains(yearFoldersComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Invalid year folders selection";
}
if (!monthFoldersComboBox.Items.Contains(monthFoldersComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Invalid month folders selection";
}
if (!dayFoldersComboBox.Items.Contains(dayFoldersComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Invalid day folder selection";
}
if (!cultureComboBox.Items.Contains(cultureComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Invalid culture";
}
if (string.IsNullOrEmpty(rootTagTextBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Root tag field is empty";
}
if (string.IsNullOrEmpty(meterTagTextBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Meter tag field is empty";
}
if (string.IsNullOrEmpty(testTagTextBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Test tag field is empty";
}
return flags;
}
public CfgUpdateFlags UpdateCfg()
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
if (config.Name != nameTextBox.Text)
{
config.Name = nameTextBox.Text;
flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
}
if (config.DestinationPath != destinationTextBox.Text)
{
config.DestinationPath = destinationTextBox.Text;
if (!config.DestinationPath.EndsWith("\\")) config.DestinationPath += "\\";
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.DestinationPath2 != destination2TextBox.Text)
{
config.DestinationPath2 = destination2TextBox.Text;
if (!config.DestinationPath2.EndsWith("\\")) config.DestinationPath2 += "\\";
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
for (YearFolders i = 0; i < YearFolders.Count; i++)
{
if (i.ToString().Equals(yearFoldersComboBox.Text) && (config.YearFolders != i))
{
config.YearFolders = i;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
break;
}
}
for (MonthFolders i = 0; i < MonthFolders.Count; i++)
{
if (i.ToString().Equals(monthFoldersComboBox.Text) && (config.MonthFolders != i))
{
config.MonthFolders = i;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
break;
}
}
for (DayFolders i = 0; i < DayFolders.Count; i++)
{
if (i.ToString().Equals(dayFoldersComboBox.Text) && (config.DayFolders != i))
{
config.DayFolders = i;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
break;
}
}
if (config.FileNameFormat != fileNameFmtTextBox.Text)
{
config.FileNameFormat = fileNameFmtTextBox.Text;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
for (Culture i = 0; i < Culture.Count; i++)
{
if (i.ToString().Equals(cultureComboBox.Text) && (config.Culture != i))
{
config.Culture = i;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
break;
}
}
if (config.Header != header)
{
config.Header = header;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.RootTag != rootTagTextBox.Text)
{
config.RootTag = rootTagTextBox.Text;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.CommonItems != commonItems)
{
config.CommonItems = commonItems;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.MeterTag != meterTagTextBox.Text)
{
config.MeterTag = meterTagTextBox.Text;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.MeterItems != meterItems)
{
config.MeterItems = meterItems;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.TestTag != testTagTextBox.Text)
{
config.TestTag = testTagTextBox.Text;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.TestItems != testItems)
{
config.TestItems = testItems;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
{
Writer.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
}
return flags;
}
private void destinationButton_Click(object sender, EventArgs e)
{
}
private void headerButton_Click(object sender, EventArgs e)
{
HeaderFooterDlg dlg = new HeaderFooterDlg(true, string.IsNullOrEmpty(header) ? string.Empty : header.Replace("~", Environment.NewLine));
if (dlg.ShowDialog() == DialogResult.OK)
{
header = dlg.EditedText.Replace(Environment.NewLine, "~");
}
}
private void commonItemsButton_Click(object sender, EventArgs e)
{
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg()
{
MetersKind = config.MetersKind,
SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(commonItems),
};
if (dlg.ShowDialog() == DialogResult.OK)
{
commonItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
}
}
private void meterItemsButton_Click(object sender, EventArgs e)
{
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg()
{
MetersKind = config.MetersKind,
SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(meterItems),
};
if (dlg.ShowDialog() == DialogResult.OK)
{
meterItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
}
}
private void testItemsButton_Click(object sender, EventArgs e)
{
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg(true)
{
MetersKind = config.MetersKind,
SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(testItems),
};
if (dlg.ShowDialog() == DialogResult.OK)
{
testItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems);
}
}
#region Configuration Change Handling
public static void OnCmdResponse(object sender, CmdResponseArgs args)
{
if (CmdResponseHandler == null) return;
try { CmdResponseHandler(sender, args); }
catch (Exception e) { log.Error("CmdResponseHandler(...) failed", e); }
}
public static event EventHandler<CmdResponseArgs> CmdResponseHandler;
public void StartResponseHandler() { }
public void StopResponseHandler() { }
#endregion Configuration Change Handling
}
}
@@ -0,0 +1,403 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
namespace TBF.BenchControl.Output.FileWriters.XmlBatch
{
partial class WriterCfgCtrl
{
/// <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.destinationTextBox = new System.Windows.Forms.TextBox();
this.destinationLabel = new System.Windows.Forms.Label();
this.destinationButton = new System.Windows.Forms.Button();
this.cultureLabel = new System.Windows.Forms.Label();
this.cultureComboBox = new System.Windows.Forms.ComboBox();
this.testItemsButton = new System.Windows.Forms.Button();
this.yearFoldersLabel = new System.Windows.Forms.Label();
this.monthFoldersLabel = new System.Windows.Forms.Label();
this.dayFoldersLabel = new System.Windows.Forms.Label();
this.yearFoldersComboBox = new System.Windows.Forms.ComboBox();
this.monthFoldersComboBox = new System.Windows.Forms.ComboBox();
this.dayFoldersComboBox = new System.Windows.Forms.ComboBox();
this.destination2Button = new System.Windows.Forms.Button();
this.destination2TextBox = new System.Windows.Forms.TextBox();
this.destination2Label = new System.Windows.Forms.Label();
this.fileNameFmtTextBox = new System.Windows.Forms.TextBox();
this.fileNameFmtLabel = new System.Windows.Forms.Label();
this.headerButton = new System.Windows.Forms.Button();
this.commonItemsButton = new System.Windows.Forms.Button();
this.rootTagTextBox = new System.Windows.Forms.TextBox();
this.rootTagLabel = new System.Windows.Forms.Label();
this.testTagLabel = new System.Windows.Forms.Label();
this.testTagTextBox = new System.Windows.Forms.TextBox();
this.meterTagLabel = new System.Windows.Forms.Label();
this.meterTagTextBox = new System.Windows.Forms.TextBox();
this.meterItemsButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(108, 31);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(146, 20);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(17, 34);
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(105, 9);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// destinationTextBox
//
this.destinationTextBox.Enabled = false;
this.destinationTextBox.Location = new System.Drawing.Point(108, 51);
this.destinationTextBox.Name = "destinationTextBox";
this.destinationTextBox.Size = new System.Drawing.Size(146, 20);
this.destinationTextBox.TabIndex = 4;
//
// destinationLabel
//
this.destinationLabel.AutoSize = true;
this.destinationLabel.Location = new System.Drawing.Point(17, 54);
this.destinationLabel.Name = "destinationLabel";
this.destinationLabel.Size = new System.Drawing.Size(60, 13);
this.destinationLabel.TabIndex = 3;
this.destinationLabel.Text = "Destination";
//
// destinationButton
//
this.destinationButton.Enabled = false;
this.destinationButton.Location = new System.Drawing.Point(269, 51);
this.destinationButton.Name = "destinationButton";
this.destinationButton.Size = new System.Drawing.Size(30, 20);
this.destinationButton.TabIndex = 5;
this.destinationButton.Text = "...";
this.destinationButton.UseVisualStyleBackColor = true;
this.destinationButton.Click += new System.EventHandler(this.destinationButton_Click);
//
// cultureLabel
//
this.cultureLabel.AutoSize = true;
this.cultureLabel.Location = new System.Drawing.Point(17, 178);
this.cultureLabel.Name = "cultureLabel";
this.cultureLabel.Size = new System.Drawing.Size(42, 13);
this.cultureLabel.TabIndex = 17;
this.cultureLabel.Text = "Cullture";
//
// cultureComboBox
//
this.cultureComboBox.Enabled = false;
this.cultureComboBox.FormattingEnabled = true;
this.cultureComboBox.Location = new System.Drawing.Point(108, 174);
this.cultureComboBox.Name = "cultureComboBox";
this.cultureComboBox.Size = new System.Drawing.Size(146, 21);
this.cultureComboBox.TabIndex = 18;
//
// testItemsButton
//
this.testItemsButton.Enabled = false;
this.testItemsButton.Location = new System.Drawing.Point(108, 325);
this.testItemsButton.Name = "testItemsButton";
this.testItemsButton.Size = new System.Drawing.Size(146, 23);
this.testItemsButton.TabIndex = 25;
this.testItemsButton.Text = "Test items";
this.testItemsButton.UseVisualStyleBackColor = true;
this.testItemsButton.Click += new System.EventHandler(this.testItemsButton_Click);
//
// yearFoldersLabel
//
this.yearFoldersLabel.AutoSize = true;
this.yearFoldersLabel.Location = new System.Drawing.Point(17, 94);
this.yearFoldersLabel.Name = "yearFoldersLabel";
this.yearFoldersLabel.Size = new System.Drawing.Size(63, 13);
this.yearFoldersLabel.TabIndex = 9;
this.yearFoldersLabel.Text = "Year folders";
//
// monthFoldersLabel
//
this.monthFoldersLabel.AutoSize = true;
this.monthFoldersLabel.Location = new System.Drawing.Point(17, 115);
this.monthFoldersLabel.Name = "monthFoldersLabel";
this.monthFoldersLabel.Size = new System.Drawing.Size(71, 13);
this.monthFoldersLabel.TabIndex = 11;
this.monthFoldersLabel.Text = "Month folders";
//
// dayFoldersLabel
//
this.dayFoldersLabel.AutoSize = true;
this.dayFoldersLabel.Location = new System.Drawing.Point(17, 136);
this.dayFoldersLabel.Name = "dayFoldersLabel";
this.dayFoldersLabel.Size = new System.Drawing.Size(60, 13);
this.dayFoldersLabel.TabIndex = 13;
this.dayFoldersLabel.Text = "Day folders";
//
// yearFoldersComboBox
//
this.yearFoldersComboBox.Enabled = false;
this.yearFoldersComboBox.FormattingEnabled = true;
this.yearFoldersComboBox.Location = new System.Drawing.Point(108, 91);
this.yearFoldersComboBox.Name = "yearFoldersComboBox";
this.yearFoldersComboBox.Size = new System.Drawing.Size(146, 21);
this.yearFoldersComboBox.TabIndex = 10;
//
// monthFoldersComboBox
//
this.monthFoldersComboBox.Enabled = false;
this.monthFoldersComboBox.FormattingEnabled = true;
this.monthFoldersComboBox.Location = new System.Drawing.Point(108, 112);
this.monthFoldersComboBox.Name = "monthFoldersComboBox";
this.monthFoldersComboBox.Size = new System.Drawing.Size(146, 21);
this.monthFoldersComboBox.TabIndex = 12;
//
// dayFoldersComboBox
//
this.dayFoldersComboBox.Enabled = false;
this.dayFoldersComboBox.FormattingEnabled = true;
this.dayFoldersComboBox.Location = new System.Drawing.Point(108, 133);
this.dayFoldersComboBox.Name = "dayFoldersComboBox";
this.dayFoldersComboBox.Size = new System.Drawing.Size(146, 21);
this.dayFoldersComboBox.TabIndex = 14;
//
// destination2Button
//
this.destination2Button.Enabled = false;
this.destination2Button.Location = new System.Drawing.Point(269, 71);
this.destination2Button.Name = "destination2Button";
this.destination2Button.Size = new System.Drawing.Size(30, 20);
this.destination2Button.TabIndex = 8;
this.destination2Button.Text = "...";
this.destination2Button.UseVisualStyleBackColor = true;
//
// destination2TextBox
//
this.destination2TextBox.Enabled = false;
this.destination2TextBox.Location = new System.Drawing.Point(108, 71);
this.destination2TextBox.Name = "destination2TextBox";
this.destination2TextBox.Size = new System.Drawing.Size(146, 20);
this.destination2TextBox.TabIndex = 7;
//
// destination2Label
//
this.destination2Label.AutoSize = true;
this.destination2Label.Location = new System.Drawing.Point(17, 74);
this.destination2Label.Name = "destination2Label";
this.destination2Label.Size = new System.Drawing.Size(69, 13);
this.destination2Label.TabIndex = 6;
this.destination2Label.Text = "Destination 2";
//
// fileNameFmtTextBox
//
this.fileNameFmtTextBox.Enabled = false;
this.fileNameFmtTextBox.Location = new System.Drawing.Point(108, 154);
this.fileNameFmtTextBox.Name = "fileNameFmtTextBox";
this.fileNameFmtTextBox.Size = new System.Drawing.Size(146, 20);
this.fileNameFmtTextBox.TabIndex = 16;
//
// fileNameFmtLabel
//
this.fileNameFmtLabel.AutoSize = true;
this.fileNameFmtLabel.Location = new System.Drawing.Point(17, 157);
this.fileNameFmtLabel.Name = "fileNameFmtLabel";
this.fileNameFmtLabel.Size = new System.Drawing.Size(84, 13);
this.fileNameFmtLabel.TabIndex = 15;
this.fileNameFmtLabel.Text = "File name format";
//
// headerButton
//
this.headerButton.Enabled = false;
this.headerButton.Location = new System.Drawing.Point(108, 196);
this.headerButton.Name = "headerButton";
this.headerButton.Size = new System.Drawing.Size(146, 23);
this.headerButton.TabIndex = 19;
this.headerButton.Text = "Header";
this.headerButton.UseVisualStyleBackColor = true;
this.headerButton.Click += new System.EventHandler(this.headerButton_Click);
//
// commonItemsButton
//
this.commonItemsButton.Enabled = false;
this.commonItemsButton.Location = new System.Drawing.Point(108, 239);
this.commonItemsButton.Name = "commonItemsButton";
this.commonItemsButton.Size = new System.Drawing.Size(146, 23);
this.commonItemsButton.TabIndex = 22;
this.commonItemsButton.Text = "Common items";
this.commonItemsButton.UseVisualStyleBackColor = true;
this.commonItemsButton.Click += new System.EventHandler(this.commonItemsButton_Click);
//
// rootTagTextBox
//
this.rootTagTextBox.Enabled = false;
this.rootTagTextBox.Location = new System.Drawing.Point(108, 219);
this.rootTagTextBox.Name = "rootTagTextBox";
this.rootTagTextBox.Size = new System.Drawing.Size(146, 20);
this.rootTagTextBox.TabIndex = 21;
//
// rootTagLabel
//
this.rootTagLabel.AutoSize = true;
this.rootTagLabel.Location = new System.Drawing.Point(17, 222);
this.rootTagLabel.Name = "rootTagLabel";
this.rootTagLabel.Size = new System.Drawing.Size(48, 13);
this.rootTagLabel.TabIndex = 20;
this.rootTagLabel.Text = "Root tag";
//
// testTagLabel
//
this.testTagLabel.AutoSize = true;
this.testTagLabel.Location = new System.Drawing.Point(17, 308);
this.testTagLabel.Name = "testTagLabel";
this.testTagLabel.Size = new System.Drawing.Size(46, 13);
this.testTagLabel.TabIndex = 23;
this.testTagLabel.Text = "Test tag";
//
// testTagTextBox
//
this.testTagTextBox.Enabled = false;
this.testTagTextBox.Location = new System.Drawing.Point(108, 305);
this.testTagTextBox.Name = "testTagTextBox";
this.testTagTextBox.Size = new System.Drawing.Size(146, 20);
this.testTagTextBox.TabIndex = 24;
//
// meterTagLabel
//
this.meterTagLabel.AutoSize = true;
this.meterTagLabel.Location = new System.Drawing.Point(17, 265);
this.meterTagLabel.Name = "meterTagLabel";
this.meterTagLabel.Size = new System.Drawing.Size(52, 13);
this.meterTagLabel.TabIndex = 26;
this.meterTagLabel.Text = "Meter tag";
//
// meterTagTextBox
//
this.meterTagTextBox.Enabled = false;
this.meterTagTextBox.Location = new System.Drawing.Point(108, 262);
this.meterTagTextBox.Name = "meterTagTextBox";
this.meterTagTextBox.Size = new System.Drawing.Size(146, 20);
this.meterTagTextBox.TabIndex = 27;
//
// meterItemsButton
//
this.meterItemsButton.Enabled = false;
this.meterItemsButton.Location = new System.Drawing.Point(108, 282);
this.meterItemsButton.Name = "meterItemsButton";
this.meterItemsButton.Size = new System.Drawing.Size(146, 23);
this.meterItemsButton.TabIndex = 28;
this.meterItemsButton.Text = "Meter items";
this.meterItemsButton.UseVisualStyleBackColor = true;
this.meterItemsButton.Click += new System.EventHandler(this.meterItemsButton_Click);
//
// WriterCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.meterTagLabel);
this.Controls.Add(this.meterTagTextBox);
this.Controls.Add(this.meterItemsButton);
this.Controls.Add(this.testTagLabel);
this.Controls.Add(this.testTagTextBox);
this.Controls.Add(this.rootTagLabel);
this.Controls.Add(this.rootTagTextBox);
this.Controls.Add(this.commonItemsButton);
this.Controls.Add(this.headerButton);
this.Controls.Add(this.fileNameFmtTextBox);
this.Controls.Add(this.fileNameFmtLabel);
this.Controls.Add(this.destination2Button);
this.Controls.Add(this.destination2TextBox);
this.Controls.Add(this.destination2Label);
this.Controls.Add(this.dayFoldersComboBox);
this.Controls.Add(this.monthFoldersComboBox);
this.Controls.Add(this.yearFoldersComboBox);
this.Controls.Add(this.dayFoldersLabel);
this.Controls.Add(this.monthFoldersLabel);
this.Controls.Add(this.yearFoldersLabel);
this.Controls.Add(this.testItemsButton);
this.Controls.Add(this.cultureComboBox);
this.Controls.Add(this.cultureLabel);
this.Controls.Add(this.destinationButton);
this.Controls.Add(this.destinationTextBox);
this.Controls.Add(this.destinationLabel);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "WriterCfgCtrl";
this.Size = new System.Drawing.Size(400, 350);
this.Load += new System.EventHandler(this.WriterCfgCtrl_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.TextBox destinationTextBox;
private System.Windows.Forms.Label destinationLabel;
private System.Windows.Forms.Button destinationButton;
private System.Windows.Forms.Label cultureLabel;
private System.Windows.Forms.ComboBox cultureComboBox;
private System.Windows.Forms.Button testItemsButton;
private System.Windows.Forms.Label yearFoldersLabel;
private System.Windows.Forms.Label monthFoldersLabel;
private System.Windows.Forms.Label dayFoldersLabel;
private System.Windows.Forms.ComboBox yearFoldersComboBox;
private System.Windows.Forms.ComboBox monthFoldersComboBox;
private System.Windows.Forms.ComboBox dayFoldersComboBox;
private System.Windows.Forms.Button destination2Button;
private System.Windows.Forms.TextBox destination2TextBox;
private System.Windows.Forms.Label destination2Label;
private System.Windows.Forms.TextBox fileNameFmtTextBox;
private System.Windows.Forms.Label fileNameFmtLabel;
private System.Windows.Forms.Button headerButton;
private System.Windows.Forms.Button commonItemsButton;
private System.Windows.Forms.TextBox rootTagTextBox;
private System.Windows.Forms.Label rootTagLabel;
private System.Windows.Forms.Label testTagLabel;
private System.Windows.Forms.TextBox testTagTextBox;
private System.Windows.Forms.Label meterTagLabel;
private System.Windows.Forms.TextBox meterTagTextBox;
private System.Windows.Forms.Button meterItemsButton;
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -99,7 +99,6 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
printerCfg.SelectedItems2 = newCfg.SelectedItems2;
printerCfg.Footer = newCfg.Footer;
printerCfg.TestsAreRows = newCfg.TestsAreRows;
printerCfg.TestsAreRows2 = newCfg.TestsAreRows2;
printerCfg.DocName = newCfg.DocName;
printerCfg.ImgName = newCfg.ImgName;
printerCfg.ImgLeft = newCfg.ImgLeft;
@@ -203,7 +202,6 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
TestItems2 = printerCfg.SelectedItems2,
Footer = printerCfg.Footer,
TestsAreRows = printerCfg.TestsAreRows,
TestsAreRows2 = printerCfg.TestsAreRows2,
ImgFullPathName = (wm.ArchivePath != null) ? System.IO.Path.Combine(wm.ArchivePath, printerCfg.ImgName) : null,
ImgLeft = printerCfg.ImgLeft,
ImgTop = printerCfg.ImgTop,
@@ -43,7 +43,6 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
public string[] SelectedItems2;
public string Footer;
public bool TestsAreRows; /// true = Tests are rows
public bool TestsAreRows2; /// true = Tests are rows
public string DocName;
public string ImgName;
public int ImgLeft;
@@ -65,7 +65,6 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.testsAreRowsCheckBox = new System.Windows.Forms.CheckBox();
this.tests2AreRowsCheckBox = new System.Windows.Forms.CheckBox();
this.testItems2Button = new System.Windows.Forms.Button();
this.goodOnlyCheckBox = new System.Windows.Forms.CheckBox();
this.templateTextBox = new System.Windows.Forms.TextBox();
@@ -409,17 +408,6 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
this.testsAreRowsCheckBox.Text = "Tests are rows";
this.testsAreRowsCheckBox.UseVisualStyleBackColor = true;
//
// tests2AreRowsCheckBox
//
this.tests2AreRowsCheckBox.AutoSize = true;
this.tests2AreRowsCheckBox.Enabled = false;
this.tests2AreRowsCheckBox.Location = new System.Drawing.Point(192, 281);
this.tests2AreRowsCheckBox.Name = "tests2AreRowsCheckBox";
this.tests2AreRowsCheckBox.Size = new System.Drawing.Size(104, 17);
this.tests2AreRowsCheckBox.TabIndex = 36;
this.tests2AreRowsCheckBox.Text = "Tests are rows 2";
this.tests2AreRowsCheckBox.UseVisualStyleBackColor = true;
//
// testItems2Button
//
this.testItems2Button.Enabled = false;
@@ -641,7 +629,6 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
this.Controls.Add(this.templateTextBox);
this.Controls.Add(this.templateLabel);
this.Controls.Add(this.goodOnlyCheckBox);
this.Controls.Add(this.tests2AreRowsCheckBox);
this.Controls.Add(this.testItems2Button);
this.Controls.Add(this.testsAreRowsCheckBox);
this.Controls.Add(this.label2);
@@ -721,7 +708,6 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.CheckBox testsAreRowsCheckBox;
private System.Windows.Forms.CheckBox tests2AreRowsCheckBox;
private System.Windows.Forms.Button testItems2Button;
private System.Windows.Forms.CheckBox goodOnlyCheckBox;
private System.Windows.Forms.TextBox templateTextBox;
@@ -122,7 +122,6 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
supressPrintingCheckBox.Checked = config.SupressPrinting;
goodOnlyCheckBox.Checked = config.GoodOnly;
testsAreRowsCheckBox.Checked = config.TestsAreRows;
tests2AreRowsCheckBox.Checked = config.TestsAreRows2;
cultureComboBox.Text = config.Culture.ToString();
@@ -167,7 +166,6 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
testItems2Button.Enabled = true;
footerButton.Enabled = true;
testsAreRowsCheckBox.Enabled = true;
tests2AreRowsCheckBox.Enabled = true;
docNameTextBox.Enabled = true;
imageNameTextBox.Enabled = true;
imageLeftTextBox.Enabled = true;
@@ -319,7 +317,6 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
flags |= UpdateDifferent(ref config.SupressPrinting, supressPrintingCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.GoodOnly, goodOnlyCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.TestsAreRows, testsAreRowsCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.TestsAreRows2, tests2AreRowsCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.CommonItems, commonItems, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.SelectedItems, testItems, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
+58 -100
View File
@@ -304,7 +304,6 @@ namespace TBF.BenchControl.Sequences
selection = MakeSelection(MKSelContext.ProcedureNotSelected);
switch (selection)
{
case Selection.Shutdown: return null; /// Return from MainSeq.Execute()
case Selection.Q1: selectedTestName = "Q1"; break;
case Selection.Q2: selectedTestName = "Q2"; break;
case Selection.Q3: selectedTestName = "Q3"; break;
@@ -522,7 +521,6 @@ namespace TBF.BenchControl.Sequences
selection = MakeSelection(MKSelContext.InsideProcedure);
switch (selection)
{
case Selection.Shutdown: return null; /// Return from MainSeq.Execute()
case Selection.Q1: selectedTestName = "Q1"; break;
case Selection.Q2: selectedTestName = "Q2"; break;
case Selection.Q3: selectedTestName = "Q3"; break;
@@ -1177,9 +1175,7 @@ namespace TBF.BenchControl.Sequences
private Selection MakeSelection(MKSelContext context)
{
log.WarnFormat("MakeSelection({0})", context);
bool shutdownInProgress = false;
/// Tank emptying valves states
bool draining1 = false;
bool draining2 = false;
@@ -1233,19 +1229,8 @@ namespace TBF.BenchControl.Sequences
e = StateMachine.WaitRunDevsRunOps();
/// Handled inside MakeSelection() inside the selection loop
if (e.Contains(Event.UiCmdShutdown))
{
#if true
/// TBF shutdown without tank draining
return Selection.Shutdown;
#else
/// TBF shutdown with tank draining
shutdownInProgress = true;
break;
#endif
}
if (e.Contains(Event.Error)) break;
if (!draining1 && e.Contains(Event.UiCmdDrainTank1)) break;
if (e.Contains(Event.Error)) break;
if (!draining1 && e.Contains(Event.UiCmdDrainTank1)) break;
if (!draining2 && e.Contains(Event.UiCmdDrainTank2)) break;
if (!draining3 && e.Contains(Event.UiCmdDrainTank3)) break;
if (draining1 && e.Contains(Event.UiCmdStopDrainingTank1)) break;
@@ -1280,93 +1265,66 @@ namespace TBF.BenchControl.Sequences
.EnterState();
while (true) StateMachine.WaitRunDevsRunOps(); /// Endless loop
}
else
{
string stateText = "MainSeq : ";
IList<IValve> openValves = new List<IValve>();
IList<IValve> closeValves = new List<IValve>();
else
{
string stateText = "MainSeq : ";
IList<IValve> openValves = new List<IValve>();
IList<IValve> closeValves = new List<IValve>();
if (e.Contains(Event.UiCmdShutdown))
{
if (StateMachine.DrainValve1 != null && !draining1)
{
draining1 = true;
openValves.Add(StateMachine.DrainValve1);
stateText = stateText + "open tank 1, ";
}
if (StateMachine.DrainValve2 != null && !draining2)
{
draining2 = true;
openValves.Add(StateMachine.DrainValve2);
stateText = stateText + "open tank 2, ";
}
if (StateMachine.DrainValve3 != null && !draining3)
{
draining3 = true;
openValves.Add(StateMachine.DrainValve3);
stateText = stateText + "open tank 3, ";
}
}
else if (draining1 && (StateMachine.Scale1.IsEmpty(mass1.Val) || e.Contains(Event.UiCmdStopDrainingTank1)))
{
draining1 = false;
closeValves.Add(StateMachine.DrainValve1);
stateText = stateText + "close tank 1, ";
}
else if (draining2 && (StateMachine.Scale2.IsEmpty(mass2.Val) || e.Contains(Event.UiCmdStopDrainingTank2)))
{
draining2 = false;
closeValves.Add(StateMachine.DrainValve2);
stateText = stateText + "close tank 2, ";
}
else if (draining3 && (StateMachine.Scale3.IsEmpty(mass3.Val) || e.Contains(Event.UiCmdStopDrainingTank3)))
{
draining3 = false;
closeValves.Add(StateMachine.DrainValve3);
stateText = stateText + "close tank 3, ";
}
else if (!draining1 && e.Contains(Event.UiCmdDrainTank1))
{
draining1 = true;
openValves.Add(StateMachine.DrainValve1);
stateText = stateText + "open tank 1, ";
}
else if (!draining2 && e.Contains(Event.UiCmdDrainTank2))
{
draining2 = true;
openValves.Add(StateMachine.DrainValve2);
stateText = stateText + "open tank 2, ";
}
else if (!draining3 && e.Contains(Event.UiCmdDrainTank3))
{
draining3 = true;
openValves.Add(StateMachine.DrainValve3);
stateText = stateText + "open tank 3, ";
}
if (draining1 && (StateMachine.Scale1.IsEmpty(mass1.Val) || e.Contains(Event.UiCmdStopDrainingTank1)))
{
draining1 = false;
closeValves.Add(StateMachine.DrainValve1);
stateText = stateText + "close tank 1, ";
}
else if (draining2 && (StateMachine.Scale2.IsEmpty(mass2.Val) || e.Contains(Event.UiCmdStopDrainingTank2)))
{
draining2 = false;
closeValves.Add(StateMachine.DrainValve2);
stateText = stateText + "close tank 2, ";
}
else if (draining3 && (StateMachine.Scale3.IsEmpty(mass3.Val) || e.Contains(Event.UiCmdStopDrainingTank3)))
{
draining3 = false;
closeValves.Add(StateMachine.DrainValve3);
stateText = stateText + "close tank 3, ";
}
else if (!draining1 && e.Contains(Event.UiCmdDrainTank1))
{
draining1 = true;
openValves.Add(StateMachine.DrainValve1);
stateText = stateText + "open tank 1, ";
}
else if (!draining2 && e.Contains(Event.UiCmdDrainTank2))
{
draining2 = true;
openValves.Add(StateMachine.DrainValve2);
stateText = stateText + "open tank 2, ";
}
else if (!draining3 && e.Contains(Event.UiCmdDrainTank3))
{
draining3 = true;
openValves.Add(StateMachine.DrainValve3);
stateText = stateText + "open tank 3, ";
}
draining = draining1 || draining2 || draining3;
if (draining && !shutdownInProgress) Bridge.OnActivity(this, Strings.Emptying_tank);
draining = draining1 || draining2 || draining3;
if (draining) Bridge.OnActivity(this, Strings.Emptying_tank);
Bridge.Bench2UI(((context == MKSelContext.ProcedureNotSelected) ? ButtonsEtc.ProcedureCmbBoxEn : 0) |
((StateMachine.DrainValve1 == null) ? 0 : (draining1 ? ButtonsEtc.DrainTankBtn1Hi : ButtonsEtc.DrainTankBtn1En)) |
((StateMachine.DrainValve2 == null) ? 0 : (draining2 ? ButtonsEtc.DrainTankBtn2Hi : ButtonsEtc.DrainTankBtn2En)) |
((StateMachine.DrainValve3 == null) ? 0 : (draining3 ? ButtonsEtc.DrainTankBtn3Hi : ButtonsEtc.DrainTankBtn3En)));
Bridge.Bench2UI(((context == MKSelContext.ProcedureNotSelected) ? ButtonsEtc.ProcedureCmbBoxEn : 0) |
((StateMachine.DrainValve1 == null) ? 0 : (draining1 ? ButtonsEtc.DrainTankBtn1Hi : ButtonsEtc.DrainTankBtn1En)) |
((StateMachine.DrainValve2 == null) ? 0 : (draining2 ? ButtonsEtc.DrainTankBtn2Hi : ButtonsEtc.DrainTankBtn2En)) |
((StateMachine.DrainValve3 == null) ? 0 : (draining3 ? ButtonsEtc.DrainTankBtn3Hi : ButtonsEtc.DrainTankBtn3En)));
State.Create(stateText)
.AddOperation(StateMachine.ControlBoard.SetValvesOp(openValves, closeValves))
.EnterState();
do
{
State.Create(stateText)
.AddOperation(StateMachine.ControlBoard.SetValvesOp(openValves, closeValves))
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
}
while (e.Contains(Event.ValvesBusy));
if (shutdownInProgress && !draining)
{
/// Shutdown is in progress and draining was completed => quit the main sequence
return Selection.Shutdown;
}
}
}
while (e.Contains(Event.ValvesBusy));
}
}
}
+80
View File
@@ -0,0 +1,80 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.IO;
using System.Collections.Generic;
using log4net;
namespace TBF.BenchControl.Sequences
{
public class Plotter : BenchControl.GenericDevices.IPlotter
{
static readonly ILog log = LogManager.GetLogger(typeof(Plotter));
static readonly Dictionary<int, BinaryWriter> writers = new Dictionary<int, BinaryWriter>();
static int nextGraphId = 1;
readonly string caption;
///
public Plotter(string caption)
{
this.caption = caption;
}
public int StartGraph(int batchNr, string testName, int repetition)
{
try
{
int graphId = nextGraphId++;
string directory = Path.Combine(TBF.Program.GraphsDir, batchNr.ToString(), testName, repetition.ToString());
Directory.CreateDirectory(directory);
BinaryWriter writer = new BinaryWriter(File.Open(Path.Combine(directory, caption), FileMode.Create));
writers.Add(graphId, writer);
log.InfoFormat("Graph file #{0} successfully created (batch={1} test={2} repet={3} caption={4})",
graphId, batchNr, testName, repetition, caption);
return graphId;
}
catch (Exception exc)
{
log.ErrorFormat("Failed to create a graph file (batch={0} test={1} repet={2} caption={3}): {4}",
batchNr, testName, repetition, caption, exc.Message);
return 0;
}
}
public void UpdateGraph(int graphId, float x, float y)
{
try
{
BinaryWriter writer = writers[graphId];
writer.Write(x);
writer.Write(y);
}
catch (Exception exc)
{
log.ErrorFormat("Failed to update graph file #{0}: {1}", graphId, exc.Message);
}
}
public void StopGraph(int graphId, float ymin, float ymax)
{
try
{
BinaryWriter writer = writers[graphId];
writer.Write(ymin);
writer.Write(ymax);
writer.Close();
writers.Remove(graphId);
}
catch (Exception exc)
{
log.ErrorFormat("Failed to close graph file #{0}: {1}", graphId, exc.Message);
}
}
}
}
+51 -30
View File
@@ -77,49 +77,49 @@ namespace TBF.BenchControl.Sequences
///
/// Statistics of 'continuous' variables (temperature, pressure, flow, etc.)
///
public static Statistics AmbTempStat = new Statistics();
public static Statistics AmbPressStat = new Statistics();
public static Statistics AmbHumiStat = new Statistics();
public static Statistics AmbTempStat = new Statistics(new Plotter("Ambient temperature"));
public static Statistics AmbPressStat = new Statistics(new Plotter("Ambient pressure"));
public static Statistics AmbHumiStat = new Statistics(new Plotter("Ambient humidity"));
public static Statistics TempUpStat = new Statistics(0, 5, true);
public static Statistics TempDownStat = new Statistics(0, 5, true);
public static Statistics TempDiffStat = new Statistics(0, 5, true);
public static Statistics TempDivStat = new Statistics(0, 5, true);
public static Statistics PressUpStat = new Statistics(5, 5, true);
public static Statistics PressDownStat = new Statistics(5, 5, true);
public static Statistics PressDeltaStat = new Statistics(5, 5, true);
public static Statistics RefFlowStat = new Statistics(5, 5, true);
public static Statistics TempUpStat = new Statistics(0, 7, true, new Plotter("Temperature up"));
public static Statistics TempDownStat = new Statistics(0, 7, true, new Plotter("Temperature down"));
public static Statistics TempDiffStat = new Statistics(0, 7, true);
public static Statistics TempDivStat = new Statistics(0, 7, true, new Plotter("Temperature div"));
public static Statistics PressUpStat = new Statistics(5, 7, true, new Plotter("Pressure up"));
public static Statistics PressDownStat = new Statistics(5, 7, true, new Plotter("Pressure down"));
public static Statistics PressDeltaStat = new Statistics(5, 7, true);
public static Statistics RefFlowStat = new Statistics(5, 7, true, new Plotter("Flow"));
public static Statistics TempRefHiStat = new Statistics();
public static Statistics TempRefLoStat = new Statistics();
public static Statistics Energy = new Statistics();
public static Statistics TempRefHiStat = new Statistics();
public static Statistics TempRefLoStat = new Statistics();
public static Statistics Energy = new Statistics();
public static Statistics VolumeForEnergy = new Statistics();
public static int lastEnergyUpdateTime;
public static int machineTimeStart;
public static int lastMachineTime;
protected static void ClearAllStatistics(int machineTime)
protected static void StartNewStatistics(int machineTime, int batchNr, string testName, int repetition)
{
lastMachineTime = machineTimeStart = machineTime;
AmbTempStat.Clear();
AmbPressStat.Clear();
AmbHumiStat.Clear();
AmbTempStat.Start(batchNr, testName, repetition);
AmbPressStat.Start(batchNr, testName, repetition);
AmbHumiStat.Start(batchNr, testName, repetition);
TempUpStat.Clear();
TempDownStat.Clear();
TempDiffStat.Clear();
TempDivStat.Clear();
PressUpStat.Clear();
PressDownStat.Clear();
PressDeltaStat.Clear();
RefFlowStat.Clear();
TempUpStat.Start(batchNr, testName, repetition);
TempDownStat.Start(batchNr, testName, repetition);
TempDiffStat.Start(batchNr, testName, repetition);
TempDivStat.Start(batchNr, testName, repetition);
PressUpStat.Start(batchNr, testName, repetition);
PressDownStat.Start(batchNr, testName, repetition);
PressDeltaStat.Start(batchNr, testName, repetition);
RefFlowStat.Start(batchNr, testName, repetition);
TempRefHiStat.Clear();
TempRefLoStat.Clear();
Energy.Clear();
VolumeForEnergy.Clear();
TempRefHiStat.Start(batchNr, testName, repetition);
TempRefLoStat.Start(batchNr, testName, repetition);
Energy.Start(batchNr, testName, repetition);
VolumeForEnergy.Start(batchNr, testName, repetition);
lastEnergyUpdateTime = 0;
}
@@ -148,5 +148,26 @@ namespace TBF.BenchControl.Sequences
lastMachineTime = machineTime;
}
protected static void StopRecordingStatistics()
{
AmbTempStat.Stop();
AmbPressStat.Stop();
AmbHumiStat.Stop();
TempUpStat.Stop();
TempDownStat.Stop();
TempDiffStat.Stop();
TempDivStat.Stop();
PressUpStat.Stop();
PressDownStat.Stop();
PressDeltaStat.Stop();
RefFlowStat.Stop();
TempRefHiStat.Stop();
TempRefLoStat.Stop();
Energy.Stop();
VolumeForEnergy.Stop();
}
}
}
+187 -144
View File
@@ -819,109 +819,127 @@ namespace TBF.BenchControl.Sequences
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]
tstRslt.DensityIn = Formulas.WaterDensityFromTempPress(tstRslt.TempUpMean, tstRslt.PressUpMean); /// [kg/m3]
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivMean); /// [kg/m3]
tstRslt.DensityLine = Formulas.WaterDensityFromTempPress((tstRslt.TempUpMean + tstRslt.TempDownMean) / 2,
(tstRslt.PressUpMean + tstRslt.PressDownMean) / 2); /// [kg/m3]
}
protected string TestResult2CsvLine(string testName, int part)
{
Results.Entities.TestRslt tstRslt = ProcessData.BatchRslts.GetTestRslt(testName, part);
if (tstRslt == null) return string.Empty;
return TestResult2CsvLine(tstRslt);
}
protected string TestResult2CsvLine(Results.Entities.TestRslt tstRslt)
protected string TestResult2CsvLine(Results.Entities.TestRslt tstRslt)
{
bool isPressureTest = (tstRslt.MethodClass != null) && (tstRslt.MethodClass.Contains("PMaxTest") || tstRslt.MethodClass.Contains("LeakTest"));
bool isStartStop = (tstRslt.MethodClass != null) && tstRslt.MethodClass.Contains("FixedStart");
bool isDiverter = (tstRslt.MethodClass != null) && tstRslt.MethodClass.Contains("FlyingStart") && tstRslt.MethodClass.Contains("MassColl");
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append(tstRslt.StartTime);
sb.Append(";"); sb.Append(tstRslt.Batch.BatchNr);
sb.Append(";"); sb.Append(tstRslt.Name());
sb.Append(";"); sb.Append(tstRslt.RepetitionNr);
sb.Append(";"); sb.Append("1");
sb.Append(";"); sb.Append(tstRslt.Method());
sb.Append(";"); sb.Append(tstRslt.TargetVolume());
sb.Append(";"); sb.Append(tstRslt.Qfrom());
sb.Append(";"); sb.Append(tstRslt.Qto());
sb.Append(";"); sb.Append(tstRslt.ErrLimLo() + tstRslt.Uncertainty());
sb.Append(";"); sb.Append(tstRslt.ErrLimHi() - tstRslt.Uncertainty());
sb.Append(";"); sb.Append("0");
sb.Append(";"); sb.Append("60");
sb.Append(";"); sb.Append("0");
sb.Append(";"); sb.Append("0");
sb.Append(";"); sb.Append((outPath != null && outPath.FlowMeter != null) ? outPath.FlowMeter.Idx1 : 0);
sb.Append(";"); sb.Append(" ");
sb.Append(";"); sb.Append((outPath != null && outPath.Scale != null) ? outPath.Scale.Name : string.Empty);
sb.Append(";"); sb.Append(tstRslt.AmbTempMean);
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.mbar, tstRslt.AmbPressMean).ToString("F0")); /// [mbar]
sb.Append(";"); sb.Append(tstRslt.AmbHumiMean); /// [%]
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.kPa, tstRslt.PressUpMean).ToString("F0")); /// [kPa]
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.kPa, tstRslt.PressDownMean).ToString("F0")); /// [kPa]
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.kPa, tstRslt.PressDeltaMean).ToString("F1")); /// [kPa]
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.kPa, tstRslt.PressUpStart).ToString("F0")); /// [kPa]
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.kPa, tstRslt.PressDownStart).ToString("F0")); /// [kPa]
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.kPa, tstRslt.PressDeltaStart).ToString("F1")); /// [kPa]
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.kPa, tstRslt.PressUpEnd).ToString("F0")); /// [kPa]
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.kPa, tstRslt.PressDownEnd).ToString("F0")); /// [kPa]
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.kPa, tstRslt.PressDeltaEnd).ToString("F1")); /// [kPa]
sb.Append(";"); sb.Append(tstRslt.TempUpMean);
sb.Append(";"); sb.Append(tstRslt.TempDownMean);
sb.Append(";"); sb.Append(tstRslt.TempDivMean);
sb.Append(";"); sb.Append(tstRslt.Custom1); /// T hi mean
sb.Append(";"); sb.Append(tstRslt.Custom6); /// T lo mean
sb.Append(";"); sb.Append(tstRslt.TempUpStart);
sb.Append(";"); sb.Append(tstRslt.TempDownStart);
sb.Append(";"); sb.Append(tstRslt.TempDivStart);
sb.Append(";"); sb.Append(tstRslt.Custom2); /// T hi start
sb.Append(";"); sb.Append(tstRslt.Custom7); /// T lo start
sb.Append(";"); sb.Append(tstRslt.TempUpEnd);
sb.Append(";"); sb.Append(tstRslt.TempDownEnd);
sb.Append(";"); sb.Append(tstRslt.TempDivEnd);
sb.Append(";"); sb.Append(tstRslt.Custom3); /// T hi end
sb.Append(";"); sb.Append(tstRslt.Custom8); /// T lo end
sb.Append(";"); sb.Append(tstRslt.MassStartRaw);
sb.Append(";"); sb.Append(tstRslt.MassStart);
sb.Append(";"); sb.Append(tstRslt.MassEndRaw);
sb.Append(";"); sb.Append(tstRslt.MassEnd);
sb.Append(";"); sb.Append(tstRslt.MassEnd - tstRslt.MassStart);
sb.Append(";"); sb.Append(tstRslt.DensityDiv);
sb.Append(";"); sb.Append(tstRslt.DensityIn);
sb.Append(";"); sb.Append(tstRslt.DensityOut);
sb.Append(";"); sb.Append(" "); /// d_air: Hustota vzduchu: Sheet1 - K9
sb.Append(";"); sb.Append(tstRslt.Buoyancy); /// Buoyancy: Sheet1 - X9
sb.Append(";"); sb.Append(Program.LocalSettings.RealDensity);
sb.Append(";"); sb.Append(Program.LocalSettings.AtTemperature);
sb.Append(";"); sb.Append(" "); /// pipe expansion: teraz vynechat
sb.Append(";"); sb.Append(tstRslt.FlowMass); /// Qm [kg/h]
sb.Append(";"); sb.Append(tstRslt.FlowVolume); /// Qv [l/h]
sb.Append(";"); sb.Append(tstRslt.VolumeCTV); /// Vet . . . komercne prava hodnota - podla vahy
sb.Append(";"); sb.Append(tstRslt.VolumeMaster); /// Velm . . . . objem podla etalonu
sb.Append(";"); sb.Append(" "); /// Vmass . . . objem podla druheho etalonu / prietokomeru pred tratou (teraz vynechavame)
sb.Append(";"); sb.Append(tstRslt.TestTime); /// t
sb.Append(";"); sb.Append(tstRslt.ErrorMaster); /// Eelm . . . chyba etalonu voci komercne pravej hodnote
sb.Append(";"); sb.Append(" "); /// Emass . . . chyba druheho etalonu voci komercne pravej hodnote (teraz vynechavame)
sb.Append(tstRslt.StartTime); /// A
sb.Append(";"); sb.Append(tstRslt.Batch.BatchNr); /// B
/// Test information, target values, etc.
sb.Append(";"); sb.Append(tstRslt.Name()); /// C
sb.Append(";"); sb.Append(tstRslt.Repeats()); /// D
sb.Append(";"); sb.Append(tstRslt.RepetitionNr); /// E
sb.Append(";"); sb.Append(tstRslt.Method()); /// F
sb.Append(";"); sb.Append(tstRslt.TargetVolume()); /// G
sb.Append(";"); sb.Append(tstRslt.Qfrom()); /// H
sb.Append(";"); sb.Append(tstRslt.Qto()); /// I
sb.Append(";"); sb.Append(tstRslt.ErrLimLo() + tstRslt.Uncertainty()); /// J
sb.Append(";"); sb.Append(tstRslt.ErrLimHi() - tstRslt.Uncertainty()); /// K
sb.Append(";"); sb.AppendFormat("{0:F1}", tstRslt.TempLimLo()); /// L
sb.Append(";"); sb.AppendFormat("{0:F1}", tstRslt.TempLimHi()); /// M
sb.Append(";"); sb.Append("0"); /// N
sb.Append(";"); sb.Append("16"); /// O
sb.Append(";"); sb.Append((outPath != null && outPath.FlowMeter != null) ? outPath.FlowMeter.Idx1 : 0); /// P
sb.Append(";"); sb.AppendFormat("{0:F4}", Formulas.DistilledWaterDensityFromTemp(tstRslt.AmbTempMean)); /// Q [kg/m3] hustota vody pri teplote okolia z priemernej teploty okolia bez korekcie na realnu hustotu vody
sb.Append(";"); sb.Append((tstRslt.Components != null) ? tstRslt.Components.Scale : string.Empty); /// R
/// Ambient
sb.Append(";"); sb.AppendFormat("{0:F1}", Units.ConvertTo(Unit.C, tstRslt.AmbTempStart)); /// S [°C]
sb.Append(";"); sb.AppendFormat("{0:F0}", Units.ConvertTo(Unit.mbar, tstRslt.AmbPressStart)); /// T [mbar]
sb.Append(";"); sb.AppendFormat("{0:F1}", Units.ConvertTo(Unit.RPct, tstRslt.AmbHumiStart)); /// U [R%]
/// Pressure
sb.Append(";"); sb.AppendFormat("{0:F0}", Units.ConvertTo(Unit.kPa, tstRslt.PressUpMean)); /// V [kPa]
sb.Append(";"); sb.AppendFormat("{0:F0}", Units.ConvertTo(Unit.kPa, tstRslt.PressDownMean)); /// W [kPa]
sb.Append(";"); sb.AppendFormat("{0:F1}", Units.ConvertTo(Unit.kPa, tstRslt.PressDeltaMean)); /// X [kPa]
sb.Append(";"); sb.AppendFormat("{0:F0}", Units.ConvertTo(Unit.kPa, tstRslt.PressUpStart)); /// Y [kPa]
sb.Append(";"); sb.AppendFormat("{0:F0}", Units.ConvertTo(Unit.kPa, tstRslt.PressDownStart)); /// Z [kPa]
sb.Append(";"); sb.AppendFormat("{0:F1}", Units.ConvertTo(Unit.kPa, tstRslt.PressDeltaStart)); /// AA [kPa]
sb.Append(";"); sb.AppendFormat("{0:F0}", Units.ConvertTo(Unit.kPa, tstRslt.PressUpEnd)); /// AB [kPa]
sb.Append(";"); sb.AppendFormat("{0:F0}", Units.ConvertTo(Unit.kPa, tstRslt.PressDownEnd)); /// AC [kPa]
sb.Append(";"); sb.AppendFormat("{0:F1}", Units.ConvertTo(Unit.kPa, tstRslt.PressDeltaEnd)); /// AD [kPa]
/// Temperature
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.C, tstRslt.TempUpMean)); /// AE [°C]
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.C, tstRslt.TempDownMean)); /// AF [°C]
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.C, tstRslt.TempDivMean)); /// AG [°C]
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.C, tstRslt.Custom1)); /// AH [°C] T hi mean
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.C, tstRslt.Custom6)); /// AI [°C] T lo mean
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.C, tstRslt.TempUpStart)); /// AJ [°C]
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.C, tstRslt.TempDownStart)); /// AK [°C]
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.C, tstRslt.TempDivStart)); /// AL [°C]
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.C, tstRslt.Custom2)); /// AM [°C] T hi start
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.C, tstRslt.Custom7)); /// AN [°C] T lo start
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.C, tstRslt.TempUpEnd)); /// AO [°C]
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.C, tstRslt.TempDownEnd)); /// AP [°C]
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.C, tstRslt.TempDivEnd)); /// AQ [°C]
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.C, tstRslt.Custom3)); /// AR [°C] T hi end
sb.Append(";"); sb.Append(Units.ConvertTo(Unit.C, tstRslt.Custom8)); /// AS [°C] T lo end
/// Mass
sb.Append(";"); sb.Append(tstRslt.MassStartRaw); /// AT [kg]
sb.Append(";"); sb.Append(tstRslt.MassStart); /// AU [kg]
sb.Append(";"); sb.Append(tstRslt.MassEndRaw); /// AV [kg]
sb.Append(";"); sb.Append(tstRslt.MassEnd); /// AW [kg]
sb.Append(";"); sb.Append(tstRslt.MassEnd - tstRslt.MassStart); /// AX [kg]
/// Density and buoyancy
sb.Append(";"); sb.Append(tstRslt.DensityDiv); /// AY [kg/m3]
sb.Append(";"); sb.Append((tstRslt.TempUpMean + tstRslt.TempDownMean) / 2); /// AZ [kg/m3]
sb.Append(";"); sb.Append(tstRslt.DensityLine); /// BA [kg/m3]
sb.Append(";"); sb.Append(" "); /// BB d_air: Hustota vzduchu: Sheet1 - K9
sb.Append(";"); sb.Append(tstRslt.Buoyancy); /// BC Buoyancy: Sheet1 - X9
sb.Append(";"); sb.Append(Program.LocalSettings.RealDensity); /// BD
sb.Append(";"); sb.Append(Program.LocalSettings.AtTemperature); /// BE
sb.Append(";"); sb.Append(tstRslt.FlowMax); /// BF pipe expansion: teraz vynechat
sb.Append(";"); sb.Append(tstRslt.FlowMin); /// BG Qm [kg/h]
sb.Append(";"); sb.Append(tstRslt.FlowVolume); /// BH Qv [l/h]
sb.Append(";"); sb.Append(tstRslt.VolumeCTV); /// BI Vet . . . komercne prava hodnota - podla vahy
sb.Append(";"); sb.Append(tstRslt.VolumeMaster); /// BJ Velm . . . . objem podla etalonu
sb.Append(";"); sb.Append(" "); /// BK Vmass . . . objem podla druheho etalonu / prietokomeru pred tratou (teraz vynechavame)
sb.Append(";"); sb.Append(tstRslt.TestTime); /// BL t
sb.Append(";"); sb.Append(tstRslt.ErrorMaster); /// BM Eelm . . . chyba etalonu voci komercne pravej hodnote
sb.Append(";"); sb.Append(" "); /// BN Emass . . . chyba druheho etalonu voci komercne pravej hodnote (teraz vynechavame)
sb.Append(";"); sb.Append((outPath != null && outPath.FlowMeter != null && outPath.FlowMeter.LtrPerPulse != 0) ? (1.0f / outPath.FlowMeter.LtrPerPulse) : 0);
/// Const.MID . konstanta eatlonu
sb.Append(";"); sb.Append(" "); /// Const.MA . . konstanta druheho etalonu
sb.Append(";"); sb.Append((1000 * tstRslt.DiverterStart).ToString("F0")); /// Time Div Start celkovy cas v [ms]
sb.Append(";"); sb.Append((1000 * tstRslt.DivStart10).ToString("F0"));
sb.Append(";"); sb.Append((1000 * tstRslt.DivStart50).ToString("F0"));
sb.Append(";"); sb.Append((1000 * tstRslt.DivStart90).ToString("F0"));
sb.Append(";"); sb.Append((1000 * tstRslt.DiverterEnd).ToString("F0")); /// Time Div End celkovy cas v [ms]
sb.Append(";"); sb.Append((1000 * tstRslt.DivEnd90).ToString("F0"));
sb.Append(";"); sb.Append((1000 * tstRslt.DivEnd50).ToString("F0"));
sb.Append(";"); sb.Append((1000 * tstRslt.DivEnd10).ToString("F0"));
sb.Append(";"); sb.Append("10"); /// Level 1 [%]
sb.Append(";"); sb.Append("50"); /// Level 2 [%]
sb.Append(";"); sb.Append("90"); /// Level 3 [%]
sb.Append(";"); sb.Append("0"); /// Not used
sb.Append(";"); sb.Append(tstRslt.PulsesMaster); /// Celkovy pocet et. pulzov skusky
sb.Append(";"); sb.Append(" "); /// - '' - pre druhy
/// BO Const.MID . konstanta eatlonu
sb.Append(";"); sb.Append(" "); /// BP Const.MA . . konstanta druheho etalonu
sb.Append(";"); sb.AppendFormat("{0:F0}", isDiverter ? 1000.0F * tstRslt.DiverterStart : 0); /// BQ [ms] Diverter start time
sb.Append(";"); sb.AppendFormat("{0:F0}", isDiverter ? 1000.0F * tstRslt.DiverterEnd : 0); /// BR [ms] Diverter end time
sb.Append(";"); sb.AppendFormat("{0:F0}", isStartStop ? 1000.0F * tstRslt.DiverterStart : 0); /// BS [ms] Start valve open time
sb.Append(";"); sb.AppendFormat("{0:F0}", isStartStop ? 1000.0F * tstRslt.DiverterEnd : 0); /// BT [ms] Start valve close time
sb.Append(";"); sb.Append(tstRslt.TempUpMax); /// BU [°C]
sb.Append(";"); sb.Append(tstRslt.TempDownMax); /// BV [°C]
sb.Append(";"); sb.Append(tstRslt.TempUpMin); /// BW [°C]
sb.Append(";"); sb.Append(tstRslt.TempDownMin); /// BX [°C]
sb.Append(";"); sb.Append(isPressureTest ? tstRslt.TestTime : 0); /// BY [s] Duration of the pressure test
sb.Append(";"); sb.AppendFormat("{0:F1}", Units.ConvertTo(Unit.C, tstRslt.AmbTempEnd)); /// BZ [°C]
sb.Append(";"); sb.AppendFormat("{0:F0}", Units.ConvertTo(Unit.mbar, tstRslt.AmbPressEnd)); /// CA [mbar]
sb.Append(";"); sb.AppendFormat("{0:F1}", Units.ConvertTo(Unit.RPct, tstRslt.AmbHumiEnd)); /// CB [R%]
sb.Append(";"); sb.Append(tstRslt.PulsesMaster); /// CC Celkovy pocet et. pulzov skusky
sb.Append(";"); sb.Append(" "); /// CD - '' - pre druhy
for (int i = 0; i < ProcessData.BatchRslts.WMPositionsCount; i++)
{
if (ProcessData.BatchRslts.WaterMeters[i] != null)
@@ -932,31 +950,39 @@ namespace TBF.BenchControl.Sequences
if (mtrRslt != null)
{
sb.Append(";"); sb.Append(ProcessData.BatchRslts.WaterMeters[i].SerialNr); /// WM Ser.No.
sb.Append(";"); sb.Append(mtrRslt.VolumeStart); /// WM Vstart - pociatocny stav pri pevnom starte alebo zachyteny pri data streame
sb.Append(";"); sb.Append(mtrRslt.VolumeEnd); /// WM Vend - konecny stav pri pevnom starte alebo zachyteny pri data streame
sb.Append(";"); sb.Append(mtrRslt.VolumeMeter); /// WM Vmer - objem namerany vodomerom
sb.Append(";"); sb.Append(mtrRslt.VolumeRef); /// WM Vref - objem namerany stanicou
sb.Append(";"); sb.Append(mtrRslt.Error); /// WM Emt - chyba vodomerom nameraneho objemu
bool isCamera = (mtrRslt.RegReaderClass != null) && mtrRslt.RegReaderClass.Equals("Network.Camera.Roi");
sb.Append(";"); sb.Append(ProcessData.BatchRslts.WaterMeters[i].SerialNr); /// CE WM Ser.No.
sb.Append(";"); sb.Append(mtrRslt.VolumeStart); /// CF WM Vstart - pociatocny stav pri pevnom starte alebo zachyteny pri data streame
sb.Append(";"); sb.Append(mtrRslt.VolumeEnd); /// CG WM Vend - konecny stav pri pevnom starte alebo zachyteny pri data streame
sb.Append(";"); sb.Append(mtrRslt.VolumeMeter); /// CH WM Vmer - objem namerany vodomerom
sb.Append(";"); sb.Append(mtrRslt.VolumeRef); /// CI WM Vref - objem namerany stanicou
sb.Append(";"); sb.Append(mtrRslt.Error); /// CJ WM Emt - chyba vodomerom nameraneho objemu
#if IPERL
sb.Append(";"); sb.Append(ProcessData.BatchRslts.WaterMeters[i].CalibFactor); /// iPerl calibration factor used during the test / ...
sb.Append(";"); sb.Append(ProcessData.BatchRslts.WaterMeters[i].CalibFactor); /// CK iPerl calibration factor used during the test / ...
#else
sb.Append(";"); sb.Append(" "); /// nechat prazdne
sb.Append(";"); sb.Append(" "); /// CK nechat prazdne
#endif
sb.Append(";"); sb.Append(mtrRslt.PulsesMeter); /// WM Np met - pocet impulzov zo skusaneho meradla
sb.Append(";"); sb.Append(mtrRslt.PulsesMaster); /// WM Np elm - pocet impulzov etalonu pocas merania pre prislusny vodomer
sb.Append(";"); sb.Append(mtrRslt.TestTime); /// WM Tmet - cas merania (obmedzany pri synchro skuske)
sb.Append(";"); sb.Append(mtrRslt.Passed ? "OK" : "NOK"); /// WM Vysledok (t.j. ci je v hraniciach chyb) - OK/NOK
sb.Append(";"); sb.Append(mtrRslt.PulsesMeter); /// CL WM Np met - pocet impulzov zo skusaneho meradla
sb.Append(";"); sb.Append(mtrRslt.PulsesMaster); /// CM WM Np elm - pocet impulzov etalonu pocas merania pre prislusny vodomer
sb.Append(";"); sb.Append(mtrRslt.TestTime); /// CN WM Tmet - cas merania (obmedzany pri synchro skuske)
sb.Append(";"); sb.Append(mtrRslt.Passed ? "OK" : "NOK"); /// CO WM Vysledok (t.j. ci je v hraniciach chyb) - OK/NOK
#if IPERL
sb.Append(";"); sb.Append(mtrRslt.WaterMeter.Q2Correction.ToString("F1")); /// iPerl Q2 correction factor used during the test / AN value - hodnota z analogoveho prevodnika
sb.Append(";"); sb.Append(mtrRslt.WaterMeter.Q2Correction.ToString("F1")); /// CP iPerl Q2 correction factor used during the test / AN value - hodnota z analogoveho prevodnika
#else
sb.Append(";"); sb.Append(" "); /// nechat prazdne
sb.Append(";"); sb.Append(mtrRslt.PulsesPerLiter); /// CP Pulses per liter
#endif
sb.Append(";"); sb.Append(mtrRslt.VolumeStart); /// WM Volume_start - pri datastreamovych hodnotach (alebo kamera)
sb.Append(";"); sb.Append(mtrRslt.TimestampStart); /// WM Time_start - ' ' -
sb.Append(";"); sb.Append(mtrRslt.VolumeEnd); /// WM Volume_end - ' ' -
sb.Append(";"); sb.Append(mtrRslt.TimestampEnd); /// WM Time_end - ' ' -
}
sb.Append(";"); sb.Append(isCamera ? mtrRslt.VolumeStart * mtrRslt.PulsesPerLiter : 0); /// CQ WM Phi_start - pri hodnotach z kamery
sb.Append(";"); sb.Append(isCamera ? mtrRslt.VolumeEnd * mtrRslt.PulsesPerLiter : 0); /// CR WM Phi_end - ' ' -
sb.Append(";"); sb.Append(isCamera ? mtrRslt.TimestampStart : 0); /// CS WM Time_start - ' ' -
sb.Append(";"); sb.Append(isCamera ? mtrRslt.TimestampEnd : 0); /// CT WM Time_end - ' ' -
sb.Append(";"); sb.Append(isCamera ? mtrRslt.PulsesPerLiter : 0); /// CU WM Degree per liter
sb.Append(";"); sb.Append(0); /// CV Analog out 1 (max mA)
sb.Append(";"); sb.Append(0); /// CW Analog out 2 (V)
sb.Append(";"); sb.Append(0); /// CX Analog out 3 (min mA)
sb.Append(";"); sb.Append(0); /// CY Analog out 4 (max Q)
}
}
else if (ProcessData.BatchRslts.WaterMeters[i].Compound())
{
@@ -966,35 +992,44 @@ namespace TBF.BenchControl.Sequences
if (mtrRslt != null)
{
sb.Append(";");
bool isCamera = (mtrRslt.RegReaderClass != null) && mtrRslt.RegReaderClass.Equals("Network.Camera.Roi");
sb.Append(";");
switch ((CompoundMeterId)b)
{
case CompoundMeterId.CompoundMain:
sb.Append(ProcessData.BatchRslts.WaterMeters[i].SerialNr);
sb.Append(ProcessData.BatchRslts.WaterMeters[i].SerialNr); /// CE
break;
case CompoundMeterId.CompoundAux:
sb.Append(ProcessData.BatchRslts.WaterMeters[i].SerialNrAux);
sb.Append(ProcessData.BatchRslts.WaterMeters[i].SerialNrAux); /// CE
break;
case CompoundMeterId.Compound:
sb.Append(ProcessData.BatchRslts.WaterMeters[i].SerialNr);
sb.Append(ProcessData.BatchRslts.WaterMeters[i].SerialNr); /// CE
break;
}
sb.Append(";"); sb.Append(mtrRslt.VolumeStart); /// WM Vinit - pri pevnom starte pociatocny stav natukany alebo cez inteligentny system
sb.Append(";"); sb.Append(mtrRslt.VolumeEnd); /// WM Vfin - pri pevnom starte konecny stav natukany alebo cez inteligentny system
sb.Append(";"); sb.Append(mtrRslt.VolumeMeter); /// WM Vmer - objem namerany vodomerom
sb.Append(";"); sb.Append(mtrRslt.VolumeRef); /// WM Vet - objem namerany stanicou
sb.Append(";"); sb.Append(mtrRslt.Error); /// WM Emt - chyba vodomerom nameraneho objemu
sb.Append(";"); sb.Append(" "); /// WM U - neistota (zatial nechat prazdne)
sb.Append(";"); sb.Append(mtrRslt.PulsesMeter); /// WM Np met - pocet impulzov zo skusaneho meradla
sb.Append(";"); sb.Append(mtrRslt.PulsesMaster); /// WM Np elm - pocet impulzov etalonu pocas merania pre prislusny vodomer
sb.Append(";"); sb.Append(mtrRslt.TestTime); /// WM Tmet - cas merania (obmedzany pri synchro skuske)
sb.Append(";"); sb.Append(mtrRslt.Passed ? "OK" : "NOK"); /// WM Vysledok (t.j. ci je v hraniciach chyb) - OK/NOK
sb.Append(";"); sb.Append(" "); /// WM AN value - hodnota z analogoveho prevodnika (teraz nic)
sb.Append(";"); sb.Append(mtrRslt.VolumeStart); /// WM Volume_start - pri datastreamovych hodnotach (alebo kamera)
sb.Append(";"); sb.Append(mtrRslt.TimestampStart); /// WM Time_start - ' ' -
sb.Append(";"); sb.Append(mtrRslt.VolumeEnd); /// WM Volume_end - ' ' -
sb.Append(";"); sb.Append(mtrRslt.TimestampEnd); /// WM Time_end - ' ' -
}
sb.Append(";"); sb.Append(mtrRslt.VolumeStart); /// CF WM Vinit - pri pevnom starte pociatocny stav natukany alebo cez inteligentny system
sb.Append(";"); sb.Append(mtrRslt.VolumeEnd); /// CG WM Vfin - pri pevnom starte konecny stav natukany alebo cez inteligentny system
sb.Append(";"); sb.Append(mtrRslt.VolumeMeter); /// CH WM Vmer - objem namerany vodomerom
sb.Append(";"); sb.Append(mtrRslt.VolumeRef); /// CI WM Vet - objem namerany stanicou
sb.Append(";"); sb.Append(mtrRslt.Error); /// CJ WM Emt - chyba vodomerom nameraneho objemu
sb.Append(";"); sb.Append(" "); /// CK WM U - neistota (zatial nechat prazdne)
sb.Append(";"); sb.Append(mtrRslt.PulsesMeter); /// CL WM Np met - pocet impulzov zo skusaneho meradla
sb.Append(";"); sb.Append(mtrRslt.PulsesMaster); /// CM WM Np elm - pocet impulzov etalonu pocas merania pre prislusny vodomer
sb.Append(";"); sb.Append(mtrRslt.TestTime); /// CN WM Tmet - cas merania (obmedzany pri synchro skuske)
sb.Append(";"); sb.Append(mtrRslt.Passed ? "OK" : "NOK"); /// CO WM Vysledok (t.j. ci je v hraniciach chyb) - OK/NOK
sb.Append(";"); sb.Append(" "); /// CP WM AN value - hodnota z analogoveho prevodnika (teraz nic)
sb.Append(";"); sb.Append(isCamera ? mtrRslt.VolumeStart * mtrRslt.PulsesPerLiter : 0); /// CQ WM Phi_start - pri hodnotach z kamery
sb.Append(";"); sb.Append(isCamera ? mtrRslt.VolumeEnd * mtrRslt.PulsesPerLiter : 0); /// CR WM Phi_end - ' ' -
sb.Append(";"); sb.Append(isCamera ? mtrRslt.TimestampStart : 0); /// CS WM Time_start - ' ' -
sb.Append(";"); sb.Append(isCamera ? mtrRslt.TimestampEnd : 0); /// CT WM Time_end - ' ' -
sb.Append(";"); sb.Append(isCamera ? mtrRslt.PulsesPerLiter : 0); /// CU WM Degree per liter
sb.Append(";"); sb.Append(0); /// CV Analog out 1 (max mA)
sb.Append(";"); sb.Append(0); /// CW Analog out 2 (V)
sb.Append(";"); sb.Append(0); /// CX Analog out 3 (min mA)
sb.Append(";"); sb.Append(0); /// CY Analog out 4 (max Q)
}
}
}
else /// if (ProcessData.BatchRslts.WaterMeters[i].HeatMeter())
@@ -1071,15 +1106,16 @@ namespace TBF.BenchControl.Sequences
/// </summary>
/// <param name="test">Test to be simulated</param>
/// <returns>Test result</returns>
protected void MakeSimulated(string testName, int repeats, int repetitionNr, int part, float errorPctBase)
protected void MakeSimulated(Config.Entities.Test test, int repetitionNr, int part, float errorPctBase)
{
string fullTestName = Results.Utils.GetTestName(testName, repeats, repetitionNr);
string fullTestName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
Results.Entities.TestRslt tstRslt = ProcessData.BatchRslts.GetTestRslt(fullTestName, part);
if (tstRslt == null) return; /// Prevent program crash in certain cases
tstRslt.StartTime = DateTime.Now;
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = DateTime.Now;
tstRslt.EndTime = DateTime.Now + new TimeSpan(0,0,1);
tstRslt.FlowSetTime = 10;
tstRslt.TestTime = tstRslt.TargetTime();
@@ -1091,7 +1127,7 @@ namespace TBF.BenchControl.Sequences
tstRslt.MassEndRaw = tstRslt.TargetVolume() * Program.LocalSettings.RealDensity / 1000.0f;
tstRslt.MassEnd = tstRslt.MassEndRaw;
tstRslt.DensityIn = Program.LocalSettings.RealDensity;
tstRslt.DensityOut = Program.LocalSettings.RealDensity;
tstRslt.DensityLine = Program.LocalSettings.RealDensity;
tstRslt.DensityDiv = Program.LocalSettings.RealDensity;
tstRslt.Buoyancy = TBF.BenchControl.Formulas.Buoyancy();
tstRslt.FlowMass = 3600.0 * tstRslt.MassEnd / tstRslt.TargetTime();
@@ -1130,8 +1166,11 @@ namespace TBF.BenchControl.Sequences
tstRslt.TempDownMax = 20.0f;
tstRslt.TempDivMax = 20.0f;
tstRslt.FlowMean = 0; /// TODO
tstRslt.FlowMax = 0; /// TODO
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
@@ -1178,13 +1217,14 @@ namespace TBF.BenchControl.Sequences
/// </summary>
/// <param name="test">Test to be simulated</param>
/// <returns>Test result</returns>
protected void MakeSimulatedCompound(string testName, int repeats, int repetitionNr, int part, float errorPct, float mainPart)
protected void MakeSimulatedCompound(Config.Entities.Test test, int repetitionNr, int part, float errorPct, float mainPart)
{
string fullTestName = Results.Utils.GetTestName(testName, repeats, repetitionNr);
string fullTestName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
Results.Entities.TestRslt tstRslt = ProcessData.BatchRslts.GetTestRslt(fullTestName, part);
tstRslt.StartTime = DateTime.Now;
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = DateTime.Now;
tstRslt.EndTime = DateTime.Now + new TimeSpan(0, 0, 1);
tstRslt.FlowSetTime = 10;
tstRslt.TestTime = tstRslt.TargetTime();
@@ -1196,7 +1236,7 @@ namespace TBF.BenchControl.Sequences
tstRslt.MassEndRaw = tstRslt.TargetVolume() * Program.LocalSettings.RealDensity / 1000.0f;
tstRslt.MassEnd = tstRslt.MassEndRaw;
tstRslt.DensityIn = Program.LocalSettings.RealDensity;
tstRslt.DensityOut = Program.LocalSettings.RealDensity;
tstRslt.DensityLine = Program.LocalSettings.RealDensity;
tstRslt.DensityDiv = Program.LocalSettings.RealDensity;
tstRslt.Buoyancy = TBF.BenchControl.Formulas.Buoyancy();
tstRslt.FlowMass = tstRslt.MassEnd / tstRslt.TargetTime();
@@ -1235,9 +1275,11 @@ namespace TBF.BenchControl.Sequences
tstRslt.TempDownMax = 20.0f;
tstRslt.TempDivMax = 20.0f;
tstRslt.FlowMean = 0; /// TODO
tstRslt.FlowMax = 0; /// TODO
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
@@ -1303,12 +1345,13 @@ namespace TBF.BenchControl.Sequences
/// </summary>
/// <param name="test">Test to be simulated</param>
/// <returns>Test result</returns>
protected void MakeSimulatedHeatMeters(string testName, int repeats, int repetitionNr, int part, float errorPct, double energy, float energyErrLimLo, float energyErrLimHi, bool evaluateVolume)
protected void MakeSimulatedHeatMeters(Config.Entities.Test test, int repetitionNr, int part, float errorPct, double energy, float energyErrLimLo, float energyErrLimHi, bool evaluateVolume)
{
string fullTestName = Results.Utils.GetTestName(testName, repeats, repetitionNr);
string fullTestName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
Results.Entities.TestRslt tstRslt = ProcessData.BatchRslts.GetTestRslt(fullTestName, part);
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = DateTime.Now;
tstRslt.EndTime = DateTime.Now + new TimeSpan(0, 0, 1);
tstRslt.FlowSetTime = 10;
@@ -1321,7 +1364,7 @@ namespace TBF.BenchControl.Sequences
tstRslt.MassEndRaw = tstRslt.TargetVolume() * Program.LocalSettings.RealDensity / 1000.0f;
tstRslt.MassEnd = tstRslt.MassEndRaw;
tstRslt.DensityIn = Program.LocalSettings.RealDensity;
tstRslt.DensityOut = Program.LocalSettings.RealDensity;
tstRslt.DensityLine = Program.LocalSettings.RealDensity;
tstRslt.DensityDiv = Program.LocalSettings.RealDensity;
tstRslt.Buoyancy = TBF.BenchControl.Formulas.Buoyancy();
tstRslt.FlowMass = tstRslt.MassEnd / tstRslt.TargetTime();
+71 -17
View File
@@ -1,14 +1,16 @@
using System;
using TBF.BenchControl.GenericDevices;
namespace TBF.BenchControl.Sequences
{
public class Statistics
{
public readonly int SkippedSamplesCount; /// 0 = do not skip any samples
public readonly int FilterSize; /// 0 = no filter
public readonly bool MedianFilter; /// true - median filter instead of average
public readonly int SkippedSamplesCount; /// 0 = do not skip any samples
public readonly int FilterSize; /// 0 = no filter
public readonly bool MedianFilter; /// true - median filter instead of average
public readonly IPlotter plotter;
bool recordingInProgress;
double[] fifo;
double[] sorted;
double first;
@@ -16,42 +18,58 @@ namespace TBF.BenchControl.Sequences
double min;
double max;
double sum;
UInt32 totalCount; /// Number of samples passed to Update()
UInt32 count; /// Number of processed and filtered samples
UInt32 fifoCount; /// Number of samples inserted into FIFO
int totalCount; /// Number of samples passed to Update()
int count; /// Number of processed and filtered samples
int fifoCount; /// Number of samples inserted into FIFO
int graphId;
public bool RecordingIProgress { get { return recordingInProgress; } }
public double First { get { return first; } }
public double Last { get { return last; } }
public double Min { get { return (count > 0) ? min : 0; } } /// 0 when there were no samples
public double Max { get { return (count > 0) ? max : 0; } } /// 0 when there were no samples
public double Average { get { return (count > 0) ? (sum / (double)count) : 0; } }
public UInt32 Count { get { return count; } }
public int Count { get { return count; } }
public double Sum { get { return sum; } }
public Statistics(int skippedSamplesCount, int filterSize, bool medianFilter)
public Statistics(int skippedSamplesCount, int filterSize, bool medianFilter, IPlotter plotter)
{
this.SkippedSamplesCount = skippedSamplesCount;
this.FilterSize = filterSize;
this.MedianFilter = medianFilter;
this.plotter = plotter;
Clear();
if (FilterSize > 0)
if (filterSize > 0)
{
fifo = new double[FilterSize];
sorted = new double[FilterSize];
}
recordingInProgress = false;
}
public Statistics() : this(0, 0, false)
public Statistics(int skippedSamplesCount, int filterSize, bool medianFilter)
: this(skippedSamplesCount, filterSize, medianFilter, new DummyPlotter())
{
}
public Statistics(IPlotter plotter)
: this(0, 0, false, plotter)
{
}
public Statistics()
: this(0, 0, false, new DummyPlotter())
{
}
/// <summary>
/// Resets statistics
/// Resets statistics and start collecting
/// </summary>
public void Clear()
public void Start(int batchNr, string testName, int repetition)
{
sum = 0;
min = double.MaxValue;
@@ -61,6 +79,22 @@ namespace TBF.BenchControl.Sequences
totalCount = 0;
count = 0;
fifoCount = 0;
recordingInProgress = true;
graphId = plotter.StartGraph(batchNr, testName, repetition);
}
/// <summary>
/// Resets statistics
/// </summary>
public void Stop()
{
if (recordingInProgress)
{
recordingInProgress = false;
plotter.StopGraph(graphId, (float)min, (float)max);
}
}
@@ -88,11 +122,14 @@ namespace TBF.BenchControl.Sequences
/// <param name="value">New value</param>
public void Update(double value)
{
if (totalCount >= SkippedSamplesCount)
if (recordingInProgress)
{
Process(value);
if (totalCount >= SkippedSamplesCount)
{
Process(value);
}
totalCount++;
}
totalCount++;
}
@@ -112,6 +149,8 @@ namespace TBF.BenchControl.Sequences
if (value < min) min = filteredValue;
if (value > max) max = filteredValue;
plotter.UpdateGraph(graphId, (float)(count + SkippedSamplesCount + FilterSize / 2), (float)value);
count++;
}
}
@@ -151,7 +190,13 @@ namespace TBF.BenchControl.Sequences
if (MedianFilter)
{
Array.Sort(sorted);
#if false
filteredValue = sorted[FilterSize / 2];
#else
double sum2 = 0;
for (int j = 1; j < FilterSize - 1; j++) sum2 += sorted[j];
filteredValue = sum2 / (FilterSize - 2);
#endif
}
else
{
@@ -162,4 +207,13 @@ namespace TBF.BenchControl.Sequences
}
}
}
class DummyPlotter : IPlotter
{
public DummyPlotter() { }
public int StartGraph(int batchNr, string testName, int repetition) { return 1; }
public void UpdateGraph(int graphId, float x, float y) { }
public void StopGraph(int graphId, float ymin, float ymax) { }
}
}
+53 -18
View File
@@ -66,6 +66,7 @@ namespace TBF.BenchControl
static DateTime startDateTime; /// DateTime of time instance when the state machine worker thread starts
static int currentTimeSec; /// Time from the start of the state machine in seconds
static bool quitStateMachine; /// flag to stop the worker thread
/// true when the state machine is running
static bool stateMachineRunning;
@@ -133,6 +134,7 @@ namespace TBF.BenchControl
states = new List<State>();
currentTimeSec = 0;
quitStateMachine = false;
}
/// <summary>
@@ -346,7 +348,11 @@ namespace TBF.BenchControl
/// </summary>
public static void StopDevices()
{
foreach (var dev in devices) dev.StopDevice();
foreach (var dev in devices)
{
UiBridge.Bridge.OnActivity(null, string.Format("1. {0}", dev.Name)); /// Info
dev.StopDevice();
}
}
/// <summary>
@@ -356,7 +362,11 @@ namespace TBF.BenchControl
/// </summary>
public static void StopDevices2()
{
foreach (var dev in devices) dev.StopDevice2();
foreach (var dev in devices)
{
UiBridge.Bridge.OnActivity(null, string.Format("2. {0}", dev.Name)); /// Info
dev.StopDevice2();
}
}
@@ -560,6 +570,15 @@ namespace TBF.BenchControl
}
/// <summary>
/// Stops the state machine (and the worker thread)
/// </summary>
public static void Stop()
{
if (stateMachineRunning) quitStateMachine = true;
}
/*
* This is and example sequence of RunDeviceBefore() / RunOperations() / RunDeviceAfter() calls
* as they are executed during normal run from the progran start to the end.
@@ -604,22 +623,24 @@ namespace TBF.BenchControl
/// Run all devices for the first time
foreach (var device in devices) device.RunDeviceBefore();
SequenceBase.ReferenceFlowmetersCount = SequenceBase.FlowMeters.Count;
SequenceBase.CalibratedLtrPerRefPulse = new float[SequenceBase.ReferenceFlowmetersCount];
foreach (var flowmtr in SequenceBase.FlowMeters)
{
int ix = flowmtr.Idx1;
if (ix > 0 && ix <= SequenceBase.ReferenceFlowmetersCount)
try
{
SequenceBase.ReferenceFlowmetersCount = SequenceBase.FlowMeters.Count;
SequenceBase.CalibratedLtrPerRefPulse = new float[SequenceBase.ReferenceFlowmetersCount];
foreach (var flowmtr in SequenceBase.FlowMeters)
{
SequenceBase.CalibratedLtrPerRefPulse[ix - 1] = flowmtr.NominalFlow / 7200.0f;
int ix = flowmtr.Idx1;
if (ix > 0 && ix <= SequenceBase.ReferenceFlowmetersCount)
{
SequenceBase.CalibratedLtrPerRefPulse[ix - 1] = flowmtr.NominalFlow / 7200.0f;
}
}
(new Sequences.MainSeq()).Execute(null);
}
catch (QuitStateMachineException)
{
}
new Sequences.MainSeq().Execute(null);
State.StopOperations();
stateMachineRunning = false;
}
@@ -630,8 +651,19 @@ namespace TBF.BenchControl
public static IList<Event> WaitRunDevsRunOps()
{
foreach (var device in devices) device.RunDeviceAfter();
WaitNextTick();
if (WaitNextTick())
{
///
/// Executed when the state machine is stopped
///
wlog.Fatal("quitStateMachine == true ... The last StopOperaions() start now");
State.StopOperations();
stateMachineRunning = false;
wlog.Fatal("StopOperaions() completed ... stateMachineRunning = false)");
throw new QuitStateMachineException();
}
foreach (var device in devices) device.RunDeviceBefore();
@@ -647,7 +679,7 @@ namespace TBF.BenchControl
/// Wait time period - synchronize
/// </summary>
/// <returns>true when interrupted by 'quitStateMachine', otherwise false</returns>
public static void WaitNextTick()
public static bool WaitNextTick()
{
currentTimeSec += Period;
@@ -657,7 +689,10 @@ namespace TBF.BenchControl
while (DateTime.Now < nextLoopDateTime)
{
Thread.Sleep(100);
if (quitStateMachine) return true;
}
return false;
}
}
}
+7 -3
View File
@@ -46,7 +46,10 @@ namespace TBF.BenchControl
Factories.Add(new TestMethods.Adjustment.Factory());
Factories.Add(new TestMethods.CombinedWithDetection.TestMethodFactory());
Factories.Add(new TestMethods.Endurance.Factory());
Factories.Add(new TestMethods.FixedStartAdvanced.Single.Factory());
Factories.Add(new TestMethods.FixedStart.Single.Factory());
Factories.Add(new TestMethods.FixedStart.Compound.Factory());
Factories.Add(new TestMethods.FixedStart.HeatMeters.Factory());
Factories.Add(new TestMethods.FixedStartAdvanced.Single.Factory());
Factories.Add(new TestMethods.FixedStartDeferredEvaluation.Single.Factory());
Factories.Add(new TestMethods.FixedStartDeferredEvaluation.Compound.Factory());
Factories.Add(new TestMethods.FixedStartDeferredEvaluation.HeatMeters.Factory());
@@ -74,7 +77,6 @@ namespace TBF.BenchControl
Factories.Add(new TestMethods.SensitivityTest.TestMethodFactory());
Factories.Add(new TestMethods.iPerlCommunication.TestMethodFactory()); /// iPerlCommunication
Factories.Add(new TestMethods.RoiDetection.RoiDetectionFactory());
Factories.Add(new TestMethods.ReferenceFlowmeterCalibration.TestMethodFactory());
Factories.Add(new DataEntry.WMStates.EntryFormFactory());
Factories.Add(new Ambient.Comet.Factory());
Factories.Add(new Ambient.Greco.Factory());
@@ -96,6 +98,7 @@ namespace TBF.BenchControl
Factories.Add(new Network.Camera.Display.Factory());
Factories.Add(new Network.Camera.Roi.Factory());
Factories.Add(new Network.Camera.RoiForFixedStart.Factory());
Factories.Add(new Network.Comet.Ambient.Factory());
Factories.Add(new Output.DB.ProductionMonitoring.Factory());
Factories.Add(new Output.DB.SaveFlowmeterCorrections.Factory());
Factories.Add(new Output.FileWriters.Basic.FactorySingle());
@@ -111,7 +114,8 @@ namespace TBF.BenchControl
Factories.Add(new Output.FileWriters.Xml.FactorySingle());
Factories.Add(new Output.FileWriters.Xml.FactoryCompound());
Factories.Add(new Output.FileWriters.Xml.FactoryHeatMeters());
Factories.Add(new Output.Printers.Enhanced.FactorySingle());
Factories.Add(new Output.FileWriters.XmlBatch.FactorySingle());
Factories.Add(new Output.Printers.Enhanced.FactorySingle());
Factories.Add(new Output.Printers.Enhanced.FactoryCompound());
Factories.Add(new Output.Printers.Enhanced.FactoryHeatMeters());
Factories.Add(new Output.Printers.OnePerMeter.FactorySingle());
@@ -326,7 +326,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
queryEnd1 = cBrd.QueryMeasurementEndOp();
queryEnd2 = cBrd.QueryMeasurementEndOp();
ClearAllStatistics(StateMachine.Time);
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr);
/// Measurement loop - begin
while (true)
@@ -369,7 +369,8 @@ namespace TBF.BenchControl.TestMethods.Adjustment
UpdateTempPressDensAmb(tstRslt);
/// Main results
tstRslt.StartTime = TestStartTime;
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
@@ -404,14 +405,15 @@ namespace TBF.BenchControl.TestMethods.Adjustment
if (meterRslt != null && regReader != null)
{
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
meterRslt.RegReaderClass = regReader.ClassName;
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
meterRslt.PulsesMeter = Convert.ToDouble(regReader.WMPulses);
meterRslt.PulsesMaster = Convert.ToDouble(regReader.WMRefPulses);
meterRslt.VolumeStart = 0; /// liter
meterRslt.VolumeEnd = 0; /// liter
meterRslt.VolumeMeter = meterRslt.PulsesMeter * regReader.LtrsPerPulse; /// liter
meterRslt.VolumeRef = meterRslt.PulsesMaster * tstRslt.ConstMaster; /// liter
meterRslt.TestTime = tstRslt.TestTime;
meterRslt.TestTime = cBrd.ImpulseTime(i + 1);
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);
meterRslt.Passed = (meterRslt.Error >= test.GetErrLimLo(tstRslt.FlowMean) + test.Uncertainty)
&& (meterRslt.Error <= test.GetErrLimHi(tstRslt.FlowMean) - test.Uncertainty);
@@ -45,11 +45,11 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
if (test.Name.ToLower().Contains("rise") || test.Name.ToLower().Contains("steig"))
{
MakeSimulatedCompound(test.Name, 1, 1, 0, 0.7f, 0.0f);
MakeSimulatedCompound(test, 1, 0, 0.7f, 0.0f);
}
else
{
MakeSimulatedCompound(test.Name, 1, 1, 0, 0.7f, 0.9f);
MakeSimulatedCompound(test, 1, 0, 0.7f, 0.9f);
}
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Completed));
@@ -491,7 +491,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
queryEnd1 = cBrd.QueryMeasurementEndOp();
queryEnd2 = cBrd.QueryMeasurementEndOp();
ClearAllStatistics(StateMachine.Time);
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr);
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
/// Read the diverter switch time
@@ -603,7 +603,8 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
UpdateTempPressDensAmb(tstRslt);
/// Main results
tstRslt.StartTime = TestStartTime;
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
@@ -615,7 +616,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * cBrd.EtPulses(0) / tstRslt.TestTime; /// [m3/h]
tstRslt.Buoyancy = Formulas.Buoyancy();
double density = Formulas.WaterDensityFromTemp((tstRslt.TempUpMean + tstRslt.TempDownMean) / 2.0);
double density = Formulas.WaterDensityFromTemp((tstRslt.TempUpMean + tstRslt.TempDownMean) / 2.0);
tstRslt.VolumeCTV = 1000.0 * tstRslt.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart) / density; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
@@ -646,7 +647,8 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
if (meterRslt != null && regReader != null)
{
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
meterRslt.RegReaderClass = regReader.ClassName;
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
/// Optionally supress pulses from the large water meter
meterRslt.PulsesMeter = (isAux == 0 && testParams.SupressTrills) ? 0 : Convert.ToDouble(regReader.WMPulses);
@@ -267,7 +267,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
queryEnd1 = cBrd.QueryMeasurementEndOp();
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
ClearAllStatistics(StateMachine.Time);
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr);
/// Measurement loop - begin
State.Create(string.Format("{0}({1}) : Reading watermeters", test.Method, test.Name))
@@ -323,6 +323,8 @@ namespace TBF.BenchControl.TestMethods.Endurance
test_completed:
StopRecordingStatistics();
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_completed);
//------------------------------------------------
@@ -346,22 +348,23 @@ namespace TBF.BenchControl.TestMethods.Endurance
UpdateTempPressDensAmb(tstRslt);
/// Main results
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = 0;
tstRslt.MassStart = 0;
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.FlowMass = 0; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.Buoyancy = Formulas.Buoyancy();
tstRslt.MassStart = 0;
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.FlowMass = 0; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.Buoyancy = Formulas.Buoyancy();
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMaster = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
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.ConstMaster = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
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.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
@@ -387,6 +390,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
if (meterRslt != null && regReader != null)
{
meterRslt.RegReaderClass = regReader.ClassName;
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
meterRslt.PulsesMeter = Convert.ToDouble(regReader.WMPulses);
meterRslt.PulsesMaster = Convert.ToDouble(regReader.WMRefPulses);
@@ -492,7 +496,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
while (!e.Contains(Event.PreviousStopped));
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
ClearAllStatistics(StateMachine.Time);
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr);
///
@@ -642,6 +646,8 @@ namespace TBF.BenchControl.TestMethods.Endurance
stopTest:
StopRecordingStatistics();
///
/// Quit this sequence
///
@@ -0,0 +1,37 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using log4net;
using Config.Entities;
namespace TBF.BenchControl.TestMethods.FixedStart.Compound
{
public class Component : ComponentBase, GenericDevices.ITestMethod
{
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
public override string ToString()
{
return string.Format("{0}({1})", this.GetType().Namespace.Substring(17), Cfg.ToString(1));
}
public bool CanTest(MetersKind meters) { return meters == MetersKind.Combined; }
public bool DoTransitions() { return true; }
public Component()
{
}
public Component(Generic.IComponentCfg cfg)
: base(cfg)
{
log.Debug(this.ToString());
}
public IList<Event> Execute(Test test, int repetNr, bool isLastRepetition)
{
return (new FixedStartSeq()).Execute(test, repetNr, isLastRepetition, true, null, DebugLevel);
}
}
}
@@ -0,0 +1,27 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Configs.NameOnly;
namespace TBF.BenchControl.TestMethods.FixedStart.Compound
{
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Component(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
public IComponentCfg DefaultConfig() { return new TestMethodCfg(this.GetType().Namespace.Substring(29), this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(TestMethodCfg.Serializer, component, this);
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,40 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using log4net;
using Config.Entities;
namespace TBF.BenchControl.TestMethods.FixedStart.HeatMeters
{
public class Component : ComponentBase, GenericDevices.ITestMethod
{
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
public override string ToString()
{
return string.Format("{0}({1})", this.GetType().Namespace.Substring(17), Cfg.ToString(1));
}
readonly TestMethodCfg testMethodCfg;
public bool CanTest(MetersKind meters) { return meters == MetersKind.HeatMeter; }
public bool DoTransitions() { return true; }
public Component()
{
}
public Component(Generic.IComponentCfg cfg)
: base(cfg)
{
testMethodCfg = cfg as TestMethodCfg;
log.Debug(this.ToString());
}
public IList<Event> Execute(Test test, int repetNr, bool isLastRepetition)
{
return (new FixedStartSeq()).Execute(test, repetNr, isLastRepetition, false, testMethodCfg.TestParams, DebugLevel);
}
}
}
@@ -0,0 +1,26 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.TestMethods.FixedStart.HeatMeters
{
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Component(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
public IComponentCfg DefaultConfig() { return new TestMethodCfg(this.GetType().Namespace.Substring(29), this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(TestMethodCfg.Serializer, component, this);
}
}
}
@@ -0,0 +1,50 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.TestMethods.FixedStart.HeatMeters
{
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// <summary> Test parameters </summary>
[XmlIgnore]
public TestParams TestParams;
public override IParamsProvider GetTestParams() { return TestParams; }
public override IParamsProvider CreateTestParams(Test test)
{
TestParams testParams = new TestParams(true);
testParams.UpdateTestParams(Name, test);
return testParams;
}
/// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg()
{
TestParams = new TestParams(true);
}
public TestMethodCfg(string name, IComponentFactory factory)
: this()
{
Name = name;
Factory = factory;
ParentName = string.Empty;
}
public string ToString(int i)
{
return string.Format("Name={0}", Name);
}
}
}
@@ -0,0 +1,71 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Windows.Forms;
using log4net;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.TestMethods.FixedStart.HeatMeters
{
public partial class TestMethodCfgCtrl : UserControl, IComponentCfgCtrl
{
static readonly ILog log = LogManager.GetLogger(typeof(TestMethodCfgCtrl));
public bool ShowMore { get { return false; } }
TestMethodCfg config;
public IComponentCfg Config
{
get { return config as IComponentCfg; }
set
{
config = value as TestMethodCfg;
Redraw();
}
}
public TestMethodCfgCtrl()
{
InitializeComponent();
}
private void EntryFormCfgCtrl_Load(object sender, EventArgs e)
{
Redraw();
}
public void Closing()
{
}
void Redraw()
{
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
}
public void Unlock()
{
nameTextBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
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;
return flags;
}
}
}
@@ -0,0 +1,86 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
namespace TBF.BenchControl.TestMethods.FixedStart.HeatMeters
{
partial class TestMethodCfgCtrl
{
/// <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.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(137, 57);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
this.nameTextBox.TabIndex = 5;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(27, 60);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 4;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(134, 33);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 3;
this.classNameLabel.Text = "ComonentName";
//
// BasicPrinterCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "BasicPrinterCfgCtrl";
this.Size = new System.Drawing.Size(300, 200);
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_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;
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,197 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
using TBF.Resources;
namespace TBF.BenchControl.TestMethods.FixedStart.HeatMeters
{
public class TestParams : TestParamsBase, IParamsProvider, ITestParams
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; }
public float ErrorLimitLo; /// [%]
public float ErrorLimitHi; /// [%]
public bool EvaluateVolume; /// true = evaluate also the volume, false = evaluate only energy
public float TempWarmLo; /// Low limit for warm temperature [°C]
public float TempWarmHi; /// High limit for warm temperature [°C]
public float TempColdLo; /// Low limit for cold temperature [°C]
public float TempColdHi; /// High limit for cold temperature [°C]
public bool FlowMeasuredAtHiTempPipe; /// true = flow measured at high temp. pipe, false = flow measured at low temp. pipe
public float DeltaTempWarm;
public float DeltaTempCold;
public float ChangeInTimeWarm;
public float ChangeInTimeCold;
public string Prompt;
public override void InitializeAll()
{
FlowMeasuredAtHiTempPipe = false;
}
string[] paramNames = new string[]
{
Strings.Err_limit_neg_pct_chdr,
Strings.Err_limit_pos_pct_chdr,
Strings.Evaluate_volume,
"T hi min",
"T hi max",
"T lo min",
"T lo max",
"Flow measured at high temp.pipe",
"Delta T warm",
"Delta T cold",
"Change in time T warm",
"Change in time T cold",
Strings.Prompt,
};
public override string ParamName(int i) { return paramNames[i]; }
public override int ParamsCount() { return paramNames.Length; }
public override string ToString(int i)
{
switch (i)
{
case 0: return ErrorLimitLo.ToString();
case 1: return ErrorLimitHi.ToString();
case 2: return (EvaluateVolume ? Strings.yes : Strings.no);
case 3: return TempWarmLo.ToString();
case 4: return TempWarmHi.ToString();
case 5: return TempColdLo.ToString();
case 6: return TempColdHi.ToString();
case 7: return (FlowMeasuredAtHiTempPipe ? Strings.yes : Strings.no);
case 8: return DeltaTempWarm.ToString();
case 9: return DeltaTempCold.ToString();
case 10: return ChangeInTimeWarm.ToString();
case 11: return ChangeInTimeCold.ToString();
case 12: return Prompt;
default: return string.Empty;
}
}
public void UpdateParam(int i, string strValue)
{
switch (i)
{
case 0: ErrorLimitLo = Utils.ParseSFloat(strValue); return;
case 1: ErrorLimitHi = Utils.ParseSFloat(strValue); return;
case 2: EvaluateVolume = strValue.Equals(Strings.yes); return;
case 3: TempWarmLo = Utils.ParseSFloat(strValue); return;
case 4: TempWarmHi = Utils.ParseSFloat(strValue); return;
case 5: TempColdLo = Utils.ParseSFloat(strValue); return;
case 6: TempColdHi = Utils.ParseSFloat(strValue); return;
case 7: FlowMeasuredAtHiTempPipe = strValue.Equals(Strings.yes); return;
case 8: DeltaTempWarm = Utils.ParseUFloat(strValue); return;
case 9: DeltaTempCold = Utils.ParseUFloat(strValue); return;
case 10: ChangeInTimeWarm = Utils.ParseUFloat(strValue); return;
case 11: ChangeInTimeCold = Utils.ParseUFloat(strValue); return;
case 12: Prompt = strValue; return;
default: return;
}
}
public bool ValidateParam(int i, string strValue, out string message)
{
message = string.Empty;
float dummy;
switch (i)
{
case 0:
case 1:
case 3:
case 4:
case 5:
case 6:
if (Utils.TryParseSFloat(strValue, out dummy)) return true;
break;
case 2:
case 7:
if (strValue.Equals(Strings.yes) || strValue.Equals(Strings.no)) return true;
break;
case 8:
case 9:
case 10:
case 11:
if (Utils.TryParseUFloat(strValue, out dummy)) return true;
break;
case 12:
return true;
default:
message = "Invalid index";
return false;
}
message = ParamName(i) + " is invalid";
return false;
}
void CopyContentTo(TestParams prms)
{
prms.ErrorLimitLo = ErrorLimitLo;
prms.ErrorLimitHi = ErrorLimitHi;
prms.EvaluateVolume = EvaluateVolume;
prms.TempWarmLo = TempWarmLo;
prms.TempWarmHi = TempWarmHi;
prms.TempColdLo = TempColdLo;
prms.TempColdHi = TempColdHi;
prms.FlowMeasuredAtHiTempPipe = FlowMeasuredAtHiTempPipe;
prms.DeltaTempWarm = DeltaTempWarm;
prms.DeltaTempCold = DeltaTempCold;
prms.ChangeInTimeWarm = ChangeInTimeWarm;
prms.ChangeInTimeCold = ChangeInTimeCold;
prms.Prompt = Prompt;
}
public IParamsProvider Clone()
{
TestParams pars = new TestParams();
CopyContentTo(pars);
return pars;
}
public override void UpdateTestParams(ComponentTest dbEntity)
{
if (dbEntity == null) return;
try
{
TestParams tmp = Serializer.Deserialize(new StringReader(dbEntity.Parameters)) as TestParams;
testParamsEntity = dbEntity;
componentName = dbEntity.CmpntName;
test = dbEntity.Test;
if (tmp != null) tmp.CopyContentTo(this);
}
catch
{
}
}
/// <summary>
/// Parameterless constructor initializes the parameters
/// </summary>
public TestParams()
{
}
public TestParams(bool initialize)
{
if (initialize) InitializeAll();
}
public TestParams(ComponentTest testParamsEntity, string componentName, Test test)
{
this.testParamsEntity = testParamsEntity;
this.componentName = componentName;
this.test = test;
}
}
}
@@ -0,0 +1,37 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using log4net;
using Config.Entities;
namespace TBF.BenchControl.TestMethods.FixedStart.Single
{
public class Component : ComponentBase, GenericDevices.ITestMethod
{
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
public override string ToString()
{
return string.Format("{0}({1})", this.GetType().Namespace.Substring(17), Cfg.ToString(1));
}
public bool CanTest(MetersKind meters) { return meters == MetersKind.Single; }
public bool DoTransitions() { return true; }
public Component()
{
}
public Component(Generic.IComponentCfg cfg)
: base(cfg)
{
log.Debug(this.ToString());
}
public IList<Event> Execute(Test test, int repetNr, bool isLastRepetition)
{
return (new FixedStartSeq()).Execute(test, repetNr, isLastRepetition, false, null, DebugLevel);
}
}
}
@@ -0,0 +1,27 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Configs.NameOnly;
namespace TBF.BenchControl.TestMethods.FixedStart.Single
{
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Component(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
public IComponentCfg DefaultConfig() { return new TestMethodCfg(this.GetType().Namespace.Substring(29), this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(TestMethodCfg.Serializer, component, this);
}
}
}
@@ -325,7 +325,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
queryEnd1 = cBrd.QueryMeasurementEndOp();
queryEnd2 = cBrd.QueryMeasurementEndOp();
ClearAllStatistics(StateMachine.Time);
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr);
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
/// Measurement loop - begin
@@ -368,6 +368,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
test_completed:
StopRecordingStatistics();
State.Create("FixedStartAdvanced : Closing the start/stop valve at the end of the fixed start test")
.AddOperation(checkUiOp)
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, outPath.StartValve))
@@ -499,22 +501,23 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
UpdateTempPressDensAmb(tstRslt);
/// Main results
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassStart = massStart; /// [kg] calculated before displaying 'End state' dialog
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = massEnd; /// [kg] calculated before displaying 'End state' dialog
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime;
tstRslt.Buoyancy = buoyancy;
tstRslt.VolumeCTV = volumeCTV; /// [kg] calculated before displaying 'End state' dialog
tstRslt.MassStart = massStart; /// [kg] calculated before displaying 'End state' dialog
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = massEnd; /// [kg] calculated before displaying 'End state' dialog
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime;
tstRslt.Buoyancy = buoyancy;
tstRslt.VolumeCTV = volumeCTV; /// [kg] calculated before displaying 'End state' dialog
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
@@ -536,7 +539,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
if (meterRslt != null && regReader != null)
{
meterRslt.PulsesPerLiter = 1.0f;
meterRslt.RegReaderClass = regReader.ClassName;
meterRslt.PulsesPerLiter = 1.0f;
meterRslt.VolumeStart = regReader.BeginWMState;
meterRslt.VolumeEnd = regReader.EndWMState;
meterRslt.VolumeMeter = meterRslt.VolumeEnd - meterRslt.VolumeStart;
@@ -587,6 +591,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
stopTest:
StopRecordingStatistics();
///
/// Quit this sequence
///
@@ -614,8 +614,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation
queryEnd1 = cBrd.QueryMeasurementEndOp();
queryEnd2 = cBrd.QueryMeasurementEndOp();
ClearAllStatistics(StateMachine.Time);
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr);
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
/// Measurement loop - begin
do
@@ -692,6 +692,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation
test_completed:
StopRecordingStatistics();
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))
@@ -895,24 +897,25 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation
UpdateTempPressDensAmb(tstRslt);
/// Main results
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
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.Buoyancy = buoyancy;
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.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
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.Buoyancy = buoyancy;
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.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
@@ -944,6 +947,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation
stopTest:
StopRecordingStatistics();
///
/// Quit this sequence
///
@@ -1045,7 +1050,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation
if (meterRslt != null && regReader != null)
{
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
meterRslt.RegReaderClass = regReader.ClassName;
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
meterRslt.VolumeStart = regReader.BeginWMState; /// [l] From forms/images
meterRslt.VolumeEnd = regReader.EndWMState; /// [l] From forms/images
meterRslt.VolumeMeter = meterRslt.VolumeEnd - meterRslt.VolumeStart; /// [l]
@@ -1089,7 +1095,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation
if (meterRslt != null && regReader != null)
{
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
meterRslt.RegReaderClass = regReader.ClassName;
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
meterRslt.VolumeStart = regReader.BeginWMState; /// From forms/images
meterRslt.VolumeEnd = regReader.EndWMState; /// From forms/images
meterRslt.VolumeMeter = meterRslt.VolumeEnd - meterRslt.VolumeStart;
@@ -611,8 +611,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
queryEnd1 = cBrd.QueryMeasurementEndOp();
queryEnd2 = cBrd.QueryMeasurementEndOp();
ClearAllStatistics(StateMachine.Time);
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr);
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
/// Measurement loop - begin
do
@@ -689,6 +689,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
test_completed:
StopRecordingStatistics();
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))
@@ -933,24 +935,25 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
UpdateTempPressDensAmb(tstRslt);
/// Main results
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
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.Buoyancy = buoyancy;
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.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
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.Buoyancy = buoyancy;
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.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
@@ -982,6 +985,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
if (meterRslt != null && regReader != null)
{
meterRslt.RegReaderClass = regReader.ClassName;
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
meterRslt.VolumeStart = regReader.BeginWMState; /// [l]
meterRslt.VolumeEnd = regReader.EndWMState; /// [l]
@@ -1096,6 +1100,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
if (meterRslt != null && regReader != null)
{
meterRslt.RegReaderClass = regReader.ClassName;
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
meterRslt.VolumeStart = regReader.BeginWMState;
meterRslt.VolumeEnd = regReader.EndWMState;
@@ -1148,6 +1153,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
stopTest:
StopRecordingStatistics();
///
/// Quit this sequence
///

Some files were not shown because too many files have changed in this diff Show More