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
107 changed files with 6009 additions and 2283 deletions
+2 -2
View File
@@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
<DefineConstants>TRACE;DEBUG;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;MUNICH</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")]
+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);
+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;
+9 -7
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
@@ -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,
+7
View File
@@ -213,6 +213,13 @@ namespace Results
/// {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.815.0")]
[assembly: AssemblyFileVersion("2.18.815.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;MUNICH</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;MUNICH</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>
+7 -1
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)));
+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;
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -1,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>
+15 -5
View File
@@ -21,7 +21,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH</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;MUNICH</DefineConstants>
<DefineConstants>TRACE;RUM_MOB;LANG_RO</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
@@ -125,6 +125,12 @@
<Compile Include="Forms\NoBenchOrDatabaseDlg.designer.cs">
<DependentUpon>NoBenchOrDatabaseDlg.cs</DependentUpon>
</Compile>
<Compile Include="Forms\PrinterConfigDlg.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\PrinterConfigDlg.Designer.cs">
<DependentUpon>PrinterConfigDlg.cs</DependentUpon>
</Compile>
<Compile Include="Forms\StatisticsDlg.cs">
<SubType>Form</SubType>
</Compile>
@@ -138,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>
@@ -182,6 +185,9 @@
<EmbeddedResource Include="Forms\NoBenchOrDatabaseDlg.resx">
<DependentUpon>NoBenchOrDatabaseDlg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\PrinterConfigDlg.resx">
<DependentUpon>PrinterConfigDlg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\StatisticsDlg.resx">
<DependentUpon>StatisticsDlg.cs</DependentUpon>
</EmbeddedResource>
@@ -230,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;
}
}
}
+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)
{
@@ -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;
}
@@ -22,7 +22,6 @@ namespace TBF.BenchControl.Network.Comet.Ambient
public override string ToString() { return string.Format("Ambient({0})", Cfg.ToString(1)); }
readonly AmbientCfg myCfg;
readonly GenericDevices.INetworkAdapter netAdapter;
readonly IPAddress ipAddress;
readonly int tcpPort;
@@ -65,9 +64,6 @@ namespace TBF.BenchControl.Network.Comet.Ambient
myCfg = cfg as AmbientCfg;
if (myCfg == null) throw new ArgumentNullException("No configuration");
netAdapter = TbfComponents.FindComponent(cfg.ParentName, components) as GenericDevices.INetworkAdapter;
if (netAdapter == null) throw new ArgumentNullException("No network adapter");
ipAddress = IPAddress.Parse(myCfg.IPAddress);
tcpPort = myCfg.TcpPort;
@@ -94,7 +90,7 @@ namespace TBF.BenchControl.Network.Comet.Ambient
state = State.Idle;
msrmntState = MsrmntState.Busy;
log.FatalFormat("IP Address={0}, device {1}", netAdapter.IPAddress, this.ToString());
log.FatalFormat("Initialization successful: {0}", this.ToString());
}
/// <summary>Run this device</summary>
@@ -8,7 +8,7 @@ using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Network.Comet.Ambient
{
public class AmbientCfg : ComponentCfgBase, IChildComponentCfg
public class AmbientCfg : ComponentCfgBase, IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(AmbientCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; }
@@ -30,7 +30,6 @@ namespace TBF.BenchControl.Network.Comet.Ambient
{
this.Name = name;
this.Factory = factory;
ParentName = string.Empty;
IPAddress = "192.168.0.123";
TcpPort = 502;
SerialNr = string.Empty;
@@ -38,7 +37,7 @@ namespace TBF.BenchControl.Network.Comet.Ambient
public string ToString(int i)
{
return string.Format("Name={0}, Parent={1}, IP={2}, Port={3}, s/n={4}", Name, ParentName, IPAddress, TcpPort, SerialNr);
return string.Format("Name={0}, IP={1}, Port={2}, s/n={3}", Name, IPAddress, TcpPort, SerialNr);
}
}
}
@@ -36,8 +36,6 @@ namespace TBF.BenchControl.Network.Comet.Ambient
this.classNameLabel = new System.Windows.Forms.Label();
this.serialNrTextBox = new System.Windows.Forms.TextBox();
this.serialNrLabel = new System.Windows.Forms.Label();
this.parentNameComboBox = new System.Windows.Forms.ComboBox();
this.parentNameLabel = 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();
@@ -73,7 +71,7 @@ namespace TBF.BenchControl.Network.Comet.Ambient
// serialNrTextBox
//
this.serialNrTextBox.Enabled = false;
this.serialNrTextBox.Location = new System.Drawing.Point(140, 148);
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;
@@ -81,34 +79,16 @@ namespace TBF.BenchControl.Network.Comet.Ambient
// serialNrLabel
//
this.serialNrLabel.AutoSize = true;
this.serialNrLabel.Location = new System.Drawing.Point(36, 151);
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";
//
// parentNameComboBox
//
this.parentNameComboBox.Enabled = false;
this.parentNameComboBox.FormattingEnabled = true;
this.parentNameComboBox.Location = new System.Drawing.Point(140, 69);
this.parentNameComboBox.Name = "parentNameComboBox";
this.parentNameComboBox.Size = new System.Drawing.Size(130, 21);
this.parentNameComboBox.TabIndex = 4;
//
// parentNameLabel
//
this.parentNameLabel.AutoSize = true;
this.parentNameLabel.Location = new System.Drawing.Point(36, 72);
this.parentNameLabel.Name = "parentNameLabel";
this.parentNameLabel.Size = new System.Drawing.Size(67, 13);
this.parentNameLabel.TabIndex = 3;
this.parentNameLabel.Text = "Parent name";
//
// ipAddressLabel
//
this.ipAddressLabel.AutoSize = true;
this.ipAddressLabel.Location = new System.Drawing.Point(36, 99);
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;
@@ -117,7 +97,7 @@ namespace TBF.BenchControl.Network.Comet.Ambient
// ipAddressTextBox
//
this.ipAddressTextBox.Enabled = false;
this.ipAddressTextBox.Location = new System.Drawing.Point(140, 96);
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;
@@ -125,7 +105,7 @@ namespace TBF.BenchControl.Network.Comet.Ambient
// tcpPortTextBox
//
this.tcpPortTextBox.Enabled = false;
this.tcpPortTextBox.Location = new System.Drawing.Point(140, 122);
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;
@@ -133,7 +113,7 @@ namespace TBF.BenchControl.Network.Comet.Ambient
// tcpPortLabel
//
this.tcpPortLabel.AutoSize = true;
this.tcpPortLabel.Location = new System.Drawing.Point(36, 125);
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;
@@ -150,8 +130,6 @@ namespace TBF.BenchControl.Network.Comet.Ambient
this.Controls.Add(this.ipAddressLabel);
this.Controls.Add(this.serialNrTextBox);
this.Controls.Add(this.serialNrLabel);
this.Controls.Add(this.parentNameComboBox);
this.Controls.Add(this.parentNameLabel);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
@@ -170,8 +148,6 @@ namespace TBF.BenchControl.Network.Comet.Ambient
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.TextBox serialNrTextBox;
private System.Windows.Forms.Label serialNrLabel;
private System.Windows.Forms.ComboBox parentNameComboBox;
private System.Windows.Forms.Label parentNameLabel;
private System.Windows.Forms.Label ipAddressLabel;
private System.Windows.Forms.TextBox ipAddressTextBox;
private System.Windows.Forms.TextBox tcpPortTextBox;
@@ -14,8 +14,6 @@ namespace TBF.BenchControl.Network.Comet.Ambient
{
static readonly ILog log = LogManager.GetLogger(typeof(AmbientCfgCtrl));
ComponentParametersDlg parent;
public bool ShowMore { get { return false; } }
AmbientCfg config;
@@ -37,29 +35,12 @@ namespace TBF.BenchControl.Network.Comet.Ambient
private void AbbientCfgCtrl_Load(object sender, EventArgs e)
{
Localize();
parent = ParentForm as ComponentParametersDlg;
if (parent == null) return;
if (parent.TbfComponents != null)
{
parentNameComboBox.Items.Add("---");
foreach (var cmpnt in parent.TbfComponents)
{
if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is TBF.BenchControl.Network.Adapter.Factory)
{
parentNameComboBox.Items.Add(cmpnt.Name);
}
}
}
Redraw();
}
void Localize()
{
nameLabel.Text = Strings.Name;
parentNameLabel.Text = Strings.Parent_name;
serialNrLabel.Text = Strings.Serial_Number;
}
@@ -73,7 +54,6 @@ namespace TBF.BenchControl.Network.Comet.Ambient
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName;
ipAddressTextBox.Text = config.IPAddress != null ? config.IPAddress.ToString() : "192.168.0.123";
tcpPortTextBox.Text = config.TcpPort.ToString();
serialNrTextBox.Text = config.SerialNr.ToString();
@@ -82,7 +62,6 @@ namespace TBF.BenchControl.Network.Comet.Ambient
public void Unlock()
{
nameTextBox.Enabled = true;
parentNameComboBox.Enabled = true;
ipAddressTextBox.Enabled = true;
tcpPortTextBox.Enabled = true;
serialNrTextBox.Enabled = true;
@@ -92,12 +71,6 @@ namespace TBF.BenchControl.Network.Comet.Ambient
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
if (!parentNameComboBox.Items.Contains(parentNameComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format(Strings.Invalid_0, parentNameLabel.Text);
}
IPAddress ip;
if (!IPAddress.TryParse(ipAddressTextBox.Text, out ip))
{
@@ -121,16 +94,12 @@ namespace TBF.BenchControl.Network.Comet.Ambient
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
string newParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text;
if (config.Name != nameTextBox.Text ||
config.ParentName != newParentName ||
config.IPAddress != ipAddressTextBox.Text ||
config.TcpPort.ToString() != tcpPortTextBox.Text ||
config.SerialNr != serialNrTextBox.Text)
{
config.Name = nameTextBox.Text;
config.ParentName = newParentName;
config.IPAddress = ipAddressTextBox.Text;
config.TcpPort = int.Parse(tcpPortTextBox.Text);
config.SerialNr = serialNrTextBox.Text;
@@ -78,12 +78,37 @@ namespace TBF.BenchControl.Output.DB.SaveFlowmeterCorrections
foreach (var tr in batch.TestRslts)
{
float testTempLimLo = tr.TempLimLo();
float testTempLimHi = tr.TempLimHi();
if (tr.Components.Flowmeter == flowmeterName && tr.Evaluate() && testTempLimLo >= tempRngLo && testTempLimHi <= tempRngHi)
if (tr.TestDone && tr.Components != null && tr.Components.Flowmeter == flowmeterName &&
tr.RepetitionNr == 1 && tr.Evaluate() && tr.TempLimLo() >= tempRngLo && tr.TempLimHi() <= tempRngHi)
{
double correction = BenchControl.Formulas.CorrectionFromError(tr.FlowMean, tr.ErrorMaster);
rslt.Add(new MeasurementCorrection { RangeIx = rngIx, Measurement = tr.FlowMean, Correction = (float)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 });
}
}
@@ -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);
+177 -139
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.Repeats());
sb.Append(";"); sb.Append(tstRslt.RepetitionNr);
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();
@@ -1181,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();
@@ -1199,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();
@@ -1308,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;
@@ -1326,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();
+6 -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());
@@ -112,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());
@@ -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));
@@ -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);
@@ -348,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;
@@ -389,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);
@@ -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);
}
}
}
@@ -501,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;
@@ -538,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;
@@ -897,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;
@@ -1049,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]
@@ -1093,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;
@@ -935,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;
@@ -984,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]
@@ -1098,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;
@@ -44,17 +44,17 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
if (compoundTestParams != null)
{
if (test.Name.ToLower().Contains("nok")) MakeSimulatedCompound(test.Name, 1, 1, 0, 4.7f, 0.9f);
else MakeSimulatedCompound(test.Name, 1, 1, 0, 0.7f, 1.0f);
if (test.Name.ToLower().Contains("nok")) MakeSimulatedCompound(test, 1, 0, 4.7f, 0.9f);
else MakeSimulatedCompound(test, 1, 0, 0.7f, 1.0f);
}
else if (heatMetersTestParams != null)
{
MakeSimulatedHeatMeters(test.Name, 1, 1, 0, 1.5f, 1000000, heatMetersTestParams.ErrorLimitLo, heatMetersTestParams.ErrorLimitHi, heatMetersTestParams.EvaluateVolume);
MakeSimulatedHeatMeters(test, 1, 0, 1.5f, 1000000, heatMetersTestParams.ErrorLimitLo, heatMetersTestParams.ErrorLimitHi, heatMetersTestParams.EvaluateVolume);
}
else if (test.Name.ToLower().Contains("q3")) MakeSimulated(test.Name, 1, 1, 0, -0.5f);
else if (test.Name.ToLower().Contains("q2")) MakeSimulated(test.Name, 1, 1, 0, 0.5f);
else if (test.Name.ToLower().Contains("q1")) MakeSimulated(test.Name, 1, 1, 0, -5.1f);
else MakeSimulated(test.Name, 1, 1, 0, 0.9f);
else if (test.Name.ToLower().Contains("q3")) MakeSimulated(test, 1, 0, -0.5f);
else if (test.Name.ToLower().Contains("q2")) MakeSimulated(test, 1, 0, 0.5f);
else if (test.Name.ToLower().Contains("q1")) MakeSimulated(test, 1, 0, -5.1f);
else MakeSimulated(test, 1, 0, 0.9f);
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Completed));
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, 1, 1), 0)));
@@ -514,7 +514,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
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
@@ -636,7 +637,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
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);
@@ -55,12 +55,12 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
if (compoundTestParams != null)
{
if (test.Name.ToLower().Contains("nok")) MakeSimulatedCompound(test.Name, 1, 1, 0, 4.7f, 0.9f);
else MakeSimulatedCompound(test.Name, 1, 1, 0, 0.7f, 1.0f);
if (test.Name.ToLower().Contains("nok")) MakeSimulatedCompound(test, 1, 0, 4.7f, 0.9f);
else MakeSimulatedCompound(test, 1, 0, 0.7f, 1.0f);
}
else if (heatMetersTestParams != null)
{
MakeSimulatedHeatMeters(test.Name, 1, 1, 0, 1.5f, 1000000, heatMetersTestParams.ErrorLimitLo, heatMetersTestParams.ErrorLimitHi, heatMetersTestParams.EvaluateVolume);
MakeSimulatedHeatMeters(test, 1, 0, 1.5f, 1000000, heatMetersTestParams.ErrorLimitLo, heatMetersTestParams.ErrorLimitHi, heatMetersTestParams.EvaluateVolume);
}
else
{
@@ -69,7 +69,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
else if (test.Name.ToLower().Contains("q2")) errorPctBase = 0.5f;
else if (test.Name.ToLower().Contains("q1")) errorPctBase = -5.1f;
MakeSimulated(test.Name, test.Repeats, repetitionNr, 0, errorPctBase + repetitionNr * 0.1f);
MakeSimulated(test, repetitionNr, 0, errorPctBase + repetitionNr * 0.1f);
}
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Completed));
@@ -786,7 +786,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
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
@@ -875,7 +876,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
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 && compoundTestParams.SupressTrills) ? 0 : Convert.ToDouble(regReader.WMPulses);
@@ -954,7 +956,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
volumeRslt.VolumeEnd = 0;
volumeRslt.VolumeMeter = volumeRslt.PulsesMeter * volumeRegReader.LtrsPerPulse; /// [l]
volumeRslt.VolumeRef = volumeRslt.PulsesMaster * tstRslt.ConstMaster; /// [l]
volumeRslt.TestTime = tstRslt.TestTime; /// [s]
volumeRslt.TestTime = cBrd.ImpulseTime(i + 1); ; /// [s]
volumeRslt.Error = Formulas.ErrorFromVolumes(volumeRslt.VolumeMeter, volumeRslt.VolumeRef);
volumeRslt.Passed = !heatMetersTestParams.EvaluateVolume ||
@@ -974,7 +976,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
energyRslt.VolumeEnd = 0;
energyRslt.VolumeRef = tstRslt.RefEnergy * (energyRslt.PulsesMaster / tstRslt.PulsesMaster); /// [J]
energyRslt.VolumeMeter = energyRslt.PulsesMeter * Config.Units.ConvertFrom(Config.Unit.kWh, energyRegReader.LtrsPerPulse); /// [J]
energyRslt.TestTime = tstRslt.TestTime; /// [s]
energyRslt.TestTime = cBrd.ImpulseTime(i + 1); /// [s]
energyRslt.Error = Formulas.ErrorFromVolumes(energyRslt.VolumeMeter, energyRslt.VolumeRef);
energyRslt.Passed = (energyRslt.Error >= heatMetersTestParams.ErrorLimitLo)
@@ -1001,7 +1003,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
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);
@@ -1044,7 +1047,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
}
else
{
meterRslt.TestTime = tstRslt.TestTime; /// TODO: Malo by sa citat z dosky
meterRslt.TestTime = cBrd.ImpulseTime(i + 1);
meterRslt.VolumeStart = 0;
meterRslt.VolumeEnd = 0;
meterRslt.VolumeMeter = meterRslt.PulsesMeter * regReader.LtrsPerPulse; /// liter
@@ -55,12 +55,12 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
if (compoundTestParams != null)
{
if (test.Name.ToLower().Contains("nok")) MakeSimulatedCompound(test.Name, 1, 1, 0, 4.7f, 0.9f);
else MakeSimulatedCompound(test.Name, 1, 1, 0, 0.7f, 1.0f);
if (test.Name.ToLower().Contains("nok")) MakeSimulatedCompound(test, 1, 0, 4.7f, 0.9f);
else MakeSimulatedCompound(test, 1, 0, 0.7f, 1.0f);
}
else if (heatMetersTestParams != null)
{
MakeSimulatedHeatMeters(test.Name, 1, 1, 0, 1.5f, 1000000, heatMetersTestParams.ErrorLimitLo, heatMetersTestParams.ErrorLimitHi, heatMetersTestParams.EvaluateVolume);
MakeSimulatedHeatMeters(test, 1, 0, 1.5f, 1000000, heatMetersTestParams.ErrorLimitLo, heatMetersTestParams.ErrorLimitHi, heatMetersTestParams.EvaluateVolume);
}
else
{
@@ -69,7 +69,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
else if (test.Name.ToLower().Contains("q2")) errorPctBase = 0.5f;
else if (test.Name.ToLower().Contains("q1")) errorPctBase = -5.1f;
MakeSimulated(test.Name, test.Repeats, repetitionNr, 0, errorPctBase + repetitionNr * 0.1f);
MakeSimulated(test, repetitionNr, 0, errorPctBase + repetitionNr * 0.1f);
}
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Completed));
@@ -785,7 +785,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
double massPulses = Convert.ToDouble(cBrd.EtPulsesK);
/// 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
@@ -844,13 +845,14 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
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 && compoundTestParams.SupressTrills) ? 0 : Convert.ToDouble(regReader.WMPulses);
meterRslt.PulsesMaster = Convert.ToDouble(regReader.WMRefPulses);
meterRslt.TestTime = tstRslt.TestTime;
meterRslt.TestTime = cBrd.ImpulseTime(2 * i + isAux + 1);
meterRslt.VolumeStart = 0;
meterRslt.VolumeEnd = 0;
meterRslt.VolumeRef = tstRslt.VolumeCTV;
@@ -923,7 +925,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
volumeRslt.VolumeEnd = 0;
volumeRslt.VolumeMeter = volumeRslt.PulsesMeter * volumeRegReader.LtrsPerPulse; /// [l]
volumeRslt.VolumeRef = volumeRslt.PulsesMaster * tstRslt.ConstMaster; /// [l]
volumeRslt.TestTime = tstRslt.TestTime; /// [s]
volumeRslt.TestTime = cBrd.ImpulseTime(i + 1); /// [s]
volumeRslt.Error = Formulas.ErrorFromVolumes(volumeRslt.VolumeMeter, volumeRslt.VolumeRef);
volumeRslt.Passed = !heatMetersTestParams.EvaluateVolume ||
@@ -943,7 +945,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
energyRslt.VolumeEnd = 0;
energyRslt.VolumeRef = tstRslt.RefEnergy * (energyRslt.PulsesMaster / tstRslt.PulsesMaster); /// [J]
energyRslt.VolumeMeter = energyRslt.PulsesMeter * Config.Units.ConvertFrom(Config.Unit.kWh, energyRegReader.LtrsPerPulse); /// [J]
energyRslt.TestTime = tstRslt.TestTime; /// [s]
energyRslt.TestTime = cBrd.ImpulseTime(i + 1); /// [s]
energyRslt.Error = Formulas.ErrorFromVolumes(energyRslt.VolumeMeter, energyRslt.VolumeRef);
energyRslt.Passed = (energyRslt.Error >= heatMetersTestParams.ErrorLimitLo)
@@ -971,7 +973,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
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);
@@ -1014,11 +1017,11 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
}
else
{
meterRslt.TestTime = tstRslt.TestTime; /// TODO: Malo by sa citat z dosky
meterRslt.TestTime = cBrd.ImpulseTime(i + 1); /// TODO: Malo by sa citat z dosky
meterRslt.VolumeStart = 0; /// liter
meterRslt.VolumeEnd = 0; /// liter
meterRslt.VolumeMeter = meterRslt.PulsesMeter * regReader.LtrsPerPulse; /// liter
meterRslt.VolumeRef = meterRslt.PulsesMaster * tstRslt.ConstMaster; /// liter
meterRslt.VolumeRef = meterRslt.PulsesMaster * tstRslt.ConstMaster; /// liter
}
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);
@@ -51,12 +51,12 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
if (compoundTestParams != null)
{
if (test.Name.ToLower().Contains("nok")) MakeSimulatedCompound(test.Name, 1, 1, 0, 4.7f, 0.9f);
else MakeSimulatedCompound(test.Name, 1, 1, 0, 0.7f, 1.0f);
if (test.Name.ToLower().Contains("nok")) MakeSimulatedCompound(test, 1, 0, 4.7f, 0.9f);
else MakeSimulatedCompound(test, 1, 0, 0.7f, 1.0f);
}
else if (heatMetersTestParams != null)
{
MakeSimulatedHeatMeters(test.Name, 1, 1, 0, 1.5f, 1000000, heatMetersTestParams.ErrorLimitLo, heatMetersTestParams.ErrorLimitHi, heatMetersTestParams.EvaluateVolume);
MakeSimulatedHeatMeters(test, 1, 0, 1.5f, 1000000, heatMetersTestParams.ErrorLimitLo, heatMetersTestParams.ErrorLimitHi, heatMetersTestParams.EvaluateVolume);
}
else
{
@@ -65,7 +65,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
else if (test.Name.ToLower().Contains("q2")) errorPctBase = 0.5f;
else if (test.Name.ToLower().Contains("q1")) errorPctBase = -5.1f;
MakeSimulated(test.Name, test.Repeats, repetitionNr, 0, errorPctBase + repetitionNr * 0.1f);
MakeSimulated(test, repetitionNr, 0, errorPctBase + repetitionNr * 0.1f);
}
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Completed));
@@ -152,7 +152,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
else if (test.Name.ToLower().Contains("q2")) errorPctBase = 0.5f;
else if (test.Name.ToLower().Contains("q1")) errorPctBase = -5.1f;
MakeSimulated(test.Name, test.Repeats, repetitionNr, 0, errorPctBase + repetitionNr * 0.1f);
MakeSimulated(test, repetitionNr, 0, errorPctBase + repetitionNr * 0.1f);
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Completed));
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, 1, 1), 0)));
@@ -833,7 +833,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
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
@@ -891,13 +892,14 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
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 && compoundTestParams.SupressTrills) ? 0 : Convert.ToDouble(regReader.WMPulses);
meterRslt.PulsesMaster = Convert.ToDouble(regReader.WMRefPulses);
meterRslt.TestTime = tstRslt.TestTime;
meterRslt.TestTime = cBrd.ImpulseTime(2 * i + isAux + 1);
meterRslt.VolumeStart = 0;
meterRslt.VolumeEnd = 0;
meterRslt.VolumeRef = tstRslt.VolumeCTV;
@@ -970,7 +972,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
volumeRslt.VolumeEnd = 0;
volumeRslt.VolumeMeter = volumeRslt.PulsesMeter * volumeRegReader.LtrsPerPulse; /// [l]
volumeRslt.VolumeRef = volumeRslt.PulsesMaster * tstRslt.ConstMaster; /// [l]
volumeRslt.TestTime = tstRslt.TestTime; /// [s]
volumeRslt.TestTime = cBrd.ImpulseTime(i + 1); /// [s]
volumeRslt.Error = Formulas.ErrorFromVolumes(volumeRslt.VolumeMeter, volumeRslt.VolumeRef);
volumeRslt.Passed = !heatMetersTestParams.EvaluateVolume ||
@@ -990,7 +992,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
energyRslt.VolumeEnd = 0;
energyRslt.VolumeRef = tstRslt.RefEnergy * (energyRslt.PulsesMaster / tstRslt.PulsesMaster); /// [J]
energyRslt.VolumeMeter = energyRslt.PulsesMeter * Config.Units.ConvertFrom(Config.Unit.kWh, energyRegReader.LtrsPerPulse); /// [J]
energyRslt.TestTime = tstRslt.TestTime; /// [s]
energyRslt.TestTime = cBrd.ImpulseTime(i + 1); /// [s]
energyRslt.Error = Formulas.ErrorFromVolumes(energyRslt.VolumeMeter, energyRslt.VolumeRef);
energyRslt.Passed = (energyRslt.Error >= heatMetersTestParams.ErrorLimitLo)
@@ -1018,6 +1020,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
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);
@@ -1061,7 +1064,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
}
else
{
meterRslt.TestTime = tstRslt.TestTime; /// TODO: Malo by sa citat z dosky
meterRslt.TestTime = cBrd.ImpulseTime(i + 1);
meterRslt.VolumeStart = 0; /// liter
meterRslt.VolumeEnd = 0; /// liter
meterRslt.VolumeMeter = meterRslt.PulsesMeter * regReader.LtrsPerPulse; /// liter
@@ -277,7 +277,8 @@ namespace TBF.BenchControl.TestMethods.LeakTest
tstRslt.DensityDiv = 0;
/// Main results
tstRslt.StartTime = TestStartTime;
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = 0;
tstRslt.TestTime = Convert.ToDouble(testParams.DurationPMax); /// [s] measurement time
@@ -188,7 +188,8 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
tstRslt.DensityDiv = 0;
/// Main results
tstRslt.StartTime = TestStartTime;
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = 0;
tstRslt.TestTime = Convert.ToDouble(testParams.DurationPMax); /// [s] measurement time
@@ -1,410 +0,0 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Text;
using log4net;
using TBF.BenchControl;
using TBF.Boxes;
using TBF.Resources;
using TBF.UiBridge;
namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
{
public class ReferenceFlowmeterCalibrationSeq : Sequences.SequenceBase
{
private static readonly ILog log = LogManager.GetLogger(typeof(ReferenceFlowmeterCalibrationSeq));
/// <summary>
/// Flying start mass collection method sequence
/// </summary>
/// <param name="test">Test entity</param>
/// <returns>
/// Event.Done . . . . . . . OK
/// Event.UiCmdStop . . . . Stopped by the user using the on-screen button STOP
/// Event.OpArgumentError . Target flow is out of range
/// Event.Error . . . . . . Unspecified error
/// </returns>
public IList<Event> Execute(Config.Entities.Test test, int repetitionNr, bool isLastRepetition)
{
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
IList<Event> e = new List<Event>(); /// Events from currently running operations
Event retVal = Event.Done;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
float switchTimeStart = 0.001f; /// in seconds, original vale is 1 ms
float switchTimeEnd = 0.001f; /// in seconds, original vale is 1 ms
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
/// Notes:
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
//====================================
loop:
/// Start the test, initialize test results
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
TestStartTime = DateTime.Now;
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
int flowSetTime0 = StateMachine.Time;
//------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_the_flow);
//------------------------------------------------
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
State.Create("ReferenceFlowmeterCalibration : Starting the pump")
.AddOperation(checkUiOp)
.AddOperation(new Operations.TimerOp(5))
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.TimerExpired));
State.Create("ReferenceFlowmeterCalibration : Starting the pump")
.AddOperation(checkUiOp)
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.ValvesSet));
if (!test.DoDraining) /// If condition met => skip measuring and force emptying
{
///
/// Measure the weight and skip emptying if there is enough room in the tank
///
State.Create("ReferenceFlowmeterCalibration : Measuring mass of water in the tank")
.AddOperation(checkUiOp)
.AddOperation(outPath.Scale.ReadMassOp(ref Mass))
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.BalanceDone));
double estimatedEndMass = Mass.Val + test.Volume;
if (estimatedEndMass < outPath.Scale.Capacity * Constants.TankFullFactor)
{
goto set_flow; /// Enough room in the tank -> skip emptying
}
}
///
/// Empty the water tank
///
switch (DrainTheTank(outPath.Scale.DrainValve, outPath.Scale))
{
case Event.Error: { retVal = Event.Error; goto stopTest; }
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
}
set_flow:
//--------------------------------
State.Create("ReferenceFlowmeterCalibration : Setting the flow")
.AddOperation(checkUiOp)
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 600)) /// timeout = 10 min.
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (e.Contains(Event.RegulValveTimeOut))
{
Bridge.OnError(this, Strings.Timeout);
retVal = Event.Done;
goto stopTest;
}
if (e.Contains(Event.Next)) goto flow_set;
}
while (!e.Contains(Event.FlowReached));
flow_set:
int flowSetTime = StateMachine.Time - flowSetTime0;
double currentFlow = RefFlow.Val;
//------------------------------------------------
Bridge.OnActivity(this, Strings.Measuring_the_weight);
//------------------------------------------------
State.Create("ReferenceFlowmeterCalibration : Measuring the start mass")
.AddOperation(checkUiOp)
.AddOperation(benchPath.TempMtrUp.ReadTempOp(ref TempUp))
.AddOperation(benchPath.TempMtrDown.ReadTempOp(ref TempDown))
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
.AddOperation(benchPath.PressMtrUp.ReadPressureOp(ref PressUp))
.AddOperation(benchPath.PressMtrDown.ReadPressureOp(ref PressDown))
.AddOperation(benchPath.PressMtrDelta == null ? null : benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta))
.AddOperation((StateMachine.Ambient != null)
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
.AddOperation(outPath.Scale.ReadStableMassOp(ref StartMass, test.MassRepeats, test.MassSpread, test.MassMethod))
.AddOperation(cBrd.UpdateTankWeightOp())
.AddOperation(processDataLoggingOp)
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.BalanceDone));
Mass.Val = StartMass.Val;
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress);
//------------------------------------------------
State.Create("ReferenceFlowmeterCalibration : Starting the test")
.AddOperation(checkUiOp)
.AddOperation(cBrd.StartMeasurementOp(outPath, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro,
test.Qfrom, test.Qto, totalPulses, (float)test.TolerRed))
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.MeasurementStarted));
/// Measurement loop - preparation
readRegistersOp = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders);
queryEnd1 = cBrd.QueryMeasurementEndOp();
queryEnd2 = cBrd.QueryMeasurementEndOp();
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr);
/// Read the diverter switch time
switchTimeStart = 0.001f * (float)cBrd.DivTime(0);
log.WarnFormat("Diverter switch time on test start = {0} ms", cBrd.DivTime(0));
/// Measurement loop - begin
while (true)
{
//--------------------------------
switch (ReadRegistersTempPressAmbient(null, true))
{
case Event.Error: { retVal = Event.Error; goto stopTest; }
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
case Event.MeasurementCompleted: goto test_completed;
}
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
UpdateAllStatistics(StateMachine.Time);
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
}
/// Measurement loop - end
test_completed:
StopRecordingStatistics();
State.Create("ReferenceFlowmeterCalibration : Waiting before mass measurement")
.AddOperation(checkUiOp)
.AddOperation(benchPath.TempMtrUp.ReadTempOp(ref TempUp))
.AddOperation(benchPath.TempMtrDown.ReadTempOp(ref TempDown))
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
.AddOperation(benchPath.PressMtrUp.ReadPressureOp(ref PressUp))
.AddOperation(benchPath.PressMtrDown.ReadPressureOp(ref PressDown))
.AddOperation(benchPath.PressMtrDelta == null ? null : benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta))
.AddOperation(readRegistersOp)
.AddOperation((StateMachine.Ambient != null)
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
.AddOperation(outPath.Scale.ReadMassOp(ref Mass))
.AddOperation(cBrd.UpdateTankWeightOp())
.AddOperation(processDataLoggingOp)
.AddOperation(new Operations.TimerOp(test.TimeStop2Mass))
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.TimerExpired));
/// Read the diverter switch time
switchTimeEnd = 0.001f * (float)cBrd.DivTime(0);
log.WarnFormat("Diverter switch time on test end = {0} ms", cBrd.DivTime(0));
//------------------------------------------------
Bridge.OnActivity(this, Strings.Measuring_the_weight);
//------------------------------------------------
State.Create("ReferenceFlowmeterCalibration : Measuring the end mass")
.AddOperation(checkUiOp)
.AddOperation(benchPath.TempMtrUp.ReadTempOp(ref TempUp))
.AddOperation(benchPath.TempMtrDown.ReadTempOp(ref TempDown))
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
.AddOperation(benchPath.PressMtrUp.ReadPressureOp(ref PressUp))
.AddOperation(benchPath.PressMtrDown.ReadPressureOp(ref PressDown))
.AddOperation(benchPath.PressMtrDelta == null ? null : benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta))
.AddOperation((StateMachine.Ambient != null)
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
.AddOperation(outPath.Scale.ReadStableMassOp(ref EndMass, test.MassRepeats, test.MassSpread, test.MassMethod))
.AddOperation(cBrd.UpdateTankWeightOp())
.AddOperation(processDataLoggingOp)
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.BalanceDone));
///
TestEndTime = DateTime.Now;
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_completed);
//------------------------------------------------
/// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results
if (UIFlowControl.Stop == WaitBeginFormClosed()) goto stopTest;
///
/// Populate TestResult data entity with data
///
Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part);
if (tstRslt != null)
{
UpdateTempPressDensAmb(tstRslt);
/// Main results
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 = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Scale.Corrections);
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Scale.Corrections);
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.Buoyancy = Formulas.Buoyancy();
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
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
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;
tstRslt.DiverterStart = switchTimeStart;
tstRslt.DiverterEnd = switchTimeEnd;
tstRslt.ErrorFlagsMd = (ErrorFlagsComp != null) ? (sbyte)ErrorFlagsComp.Mode : (sbyte)0;
tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, switchTimeStart, switchTimeEnd) : 0;
/// Update flowmeter constant with the measured one
if (outPath.FlowMeter.Idx1 > 0 && outPath.FlowMeter.Idx1 <= ReferenceFlowmetersCount)
{
CalibratedLtrPerRefPulse[outPath.FlowMeter.Idx1 - 1] = Convert.ToSingle(tstRslt.ConstMaster);
log.InfoFormat("Updating LtrPerRefPulse[{0}] = {1}", outPath.FlowMeter.Idx1 - 1, tstRslt.ConstMaster);
}
tstRslt.Components = Results.Entities.Components
.UpdateList(BatchRslts.ComponentsList,
new Results.Entities.Components((BenchInfo != null) ? BenchInfo.TestBenchId : 1,
(BenchInfo != null) ? BenchInfo.TestBenchName : "testbench",
inPath.Pump != null ? inPath.Pump.Name : string.Empty,
outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty,
outPath.Scale != null ? outPath.Scale.Name : string.Empty,
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));
/// Update water meter error flags
if (ErrorFlagsComp != null)
{
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (BatchRslts.WaterMeters[i] != null)
{
BatchRslts.WaterMeters[i].ErrorFlags = ErrorFlagsComp.GetWMtrErrorFlags(BatchRslts.WaterMeters[i].MeterTestRslts);
}
}
}
/// Update results
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(testName, tstRslt));
}
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.TransitionAfter));
/// Append the results to the CSV-file
allResults.Info(TestResult2CsvLine(testName, test.Part));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr,
(retVal == Event.Done) ? Config.Entities.Progress.Completed : Config.Entities.Progress.Aborted));
stopTest:
StopRecordingStatistics();
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError
|| retVal == Event.Error || retVal == Event.ConfigurationError)
{
State.Create("ReferenceFlowmeterCalibration : Stopping diverter, gate, etc.")
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.PreviousStopped));
}
/// Create a list with one item 'retVal' (default is Event.Done) and return it
IList<Event> retList = new List<Event>(1);
retList.Add(retVal);
return retList;
}
}
}
@@ -1,35 +0,0 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using log4net;
using Config.Entities;
using TBF.BenchControl;
namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
{
public class TestMethod : ComponentBase, GenericDevices.ITestMethod
{
private static readonly ILog log = LogManager.GetLogger(typeof(TestMethod));
public override string ToString() { return string.Format("TestMethods.ReferenceFlowmeterCalibration({0})", Cfg.ToString(1)); }
public bool CanTest(MetersKind meters) { return meters != MetersKind.HeatMeter; }
public bool DoTransitions() { return true; }
public TestMethod()
{
}
public TestMethod(Generic.IComponentCfg cfg)
: base(cfg)
{
log.Debug(this.ToString());
}
public IList<Event> Execute(Test test, int repetNr, bool isLastRepetition)
{
return (new ReferenceFlowmeterCalibrationSeq()).Execute(test, repetNr, isLastRepetition);
}
}
}
@@ -1,27 +0,0 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Configs.NameOnly;
namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
{
public class TestMethodFactory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public void ResetStaticProperties() { TestMethod.ResetStaticProperties(); }
public IComponent DummyComponent() { return new TestMethod(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new TestMethod(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);
}
}
}
@@ -18,6 +18,14 @@ namespace TBF.BenchControl.TestMethods.SensitivityTest
const int DetectionBufferSize = 9;
const int DetectionKernelSize = 5;
/// <summary>
/// Executes the specified test.
/// </summary>
/// <param name="test">The test.</param>
/// <param name="repetitionNr">The repetition nr.</param>
/// <param name="testParams">The test parameters.</param>
/// <param name="debugLevel">The debug level.</param>
/// <returns></returns>
public IList<Event> Execute(Config.Entities.Test test, int repetitionNr,
SensitivityTestParams testParams,
Config.Entities.DebugMode debugLevel)
@@ -45,11 +53,11 @@ namespace TBF.BenchControl.TestMethods.SensitivityTest
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));
@@ -432,7 +440,8 @@ namespace TBF.BenchControl.TestMethods.SensitivityTest
UpdateTempPressDensAmb(tstRslt);
/// Main results
tstRslt.StartTime = TestStartTime;
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime1 - flowSetTime0;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
@@ -468,7 +477,8 @@ namespace TBF.BenchControl.TestMethods.SensitivityTest
if (meterRslt != null && regReader != null)
{
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
meterRslt.RegReaderClass = regReader.ClassName;
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
meterRslt.Passed = (Qrise <= test.Qto) && (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On);
meterRslt.TestDone = true;
@@ -1828,10 +1828,11 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
/// Auxiliary results ... not required
/// Main results
tstRslt.StartTime = tstRslt.Batch.StartTime;
tstRslt.EndTime = endTime;
tstRslt.FlowSetTime = 0;
tstRslt.Buoyancy = Formulas.Buoyancy();
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = tstRslt.Batch.StartTime;
tstRslt.EndTime = endTime;
tstRslt.FlowSetTime = 0;
tstRslt.Buoyancy = Formulas.Buoyancy();
tstRslt.TestTime += testTime; /// [s] total communication time of all tests
for (int i = 0; i < iperlHeads.Count; i++)
@@ -110,13 +110,13 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Config.Entities.Progress.JustStarted));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Config.Entities.Progress.FlowSetting));
if (testParams.Activity.ToLower().Contains("q3")) MakeSimulated(test.Name, 1, 1, 0, -0.5f);
else if (testParams.Activity.ToLower().Contains("q2")) MakeSimulated(test.Name, 1, 1, 0, 0.5f);
else if (testParams.Activity.ToLower().Contains("q1")) MakeSimulated(test.Name, 1, 1, 0, -5.1f);
else if (testParams.Activity.ToLower().Contains("compound ok")) MakeSimulatedCompound(test.Name, 1, 1, 0, 0.7f, 1.0f);
else if (testParams.Activity.ToLower().Contains("compound nok")) MakeSimulatedCompound(test.Name, 1, 1, 0, 4.7f, 0.9f);
else if (testParams.Activity.ToLower().Contains("compound rise")) MakeSimulatedCompound(test.Name, 1, 1, 0, 0.7f, 0.0f);
else if (testParams.Activity.ToLower().Contains("compound fall")) MakeSimulatedCompound(test.Name, 1, 1, 0, 0.7f, 0.9f);
if (testParams.Activity.ToLower().Contains("q3")) MakeSimulated(test, 1, 0, -0.5f);
else if (testParams.Activity.ToLower().Contains("q2")) MakeSimulated(test, 1, 0, 0.5f);
else if (testParams.Activity.ToLower().Contains("q1")) MakeSimulated(test, 1, 0, -5.1f);
else if (testParams.Activity.ToLower().Contains("compound ok")) MakeSimulatedCompound(test, 1, 0, 0.7f, 1.0f);
else if (testParams.Activity.ToLower().Contains("compound nok")) MakeSimulatedCompound(test, 1, 0, 4.7f, 0.9f);
else if (testParams.Activity.ToLower().Contains("compound rise")) MakeSimulatedCompound(test, 1, 0, 0.7f, 0.0f);
else if (testParams.Activity.ToLower().Contains("compound fall")) MakeSimulatedCompound(test, 1, 0, 0.7f, 0.9f);
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Config.Entities.Progress.Completed));
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, ProcessData.BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, 1, 1), 0)));
@@ -255,7 +255,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
tstRslt.TempDivMin = oriTestRslt.TempDivMin;
tstRslt.TempDivMax = oriTestRslt.TempDivMax;
tstRslt.DensityIn = oriTestRslt.DensityIn;
tstRslt.DensityOut = oriTestRslt.DensityOut;
tstRslt.DensityLine = oriTestRslt.DensityLine;
tstRslt.DensityDiv = oriTestRslt.DensityDiv;
tstRslt.StartTime = oriTestRslt.StartTime;
+8
View File
@@ -164,6 +164,14 @@ namespace TBF.Forms
}
}
private void passwordTextBox_KeyPress(object sender, KeyPressEventArgs e)
{
if (Convert.ToInt32(e.KeyChar) == 13)
{
okButton_Click(sender, e);
}
}
private void aliasLabel_Click(object sender, EventArgs e)
{
Method++;
+2
View File
@@ -74,6 +74,7 @@ namespace TBF.Forms
resources.ApplyResources(this.passwordTextBox, "passwordTextBox");
this.passwordTextBox.Name = "passwordTextBox";
this.passwordTextBox.UseSystemPasswordChar = true;
this.passwordTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.passwordTextBox_KeyPress);
//
// cancelButton
//
@@ -96,6 +97,7 @@ namespace TBF.Forms
//
resources.ApplyResources(this.userNameTextBox, "userNameTextBox");
this.userNameTextBox.Name = "userNameTextBox";
this.userNameTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.userNameTextBox_KeyPress);
//
// legalizatorComboBox
//
+142 -27
View File
@@ -28,73 +28,188 @@
/// </summary>
private void InitializeComponent()
{
this.upgradeDb_215_217_Button = new System.Windows.Forms.Button();
this.upgradeDb_215_216_Button = new System.Windows.Forms.Button();
this.upgradeDb_216_217_Button = new System.Windows.Forms.Button();
this.upgradeDb_212_217_Button = new System.Windows.Forms.Button();
this.upgradeDb_212_215_Button = new System.Windows.Forms.Button();
this.upgradeDb_217_218_Button = new System.Windows.Forms.Button();
this.upgradeDb_29_212_Button = new System.Windows.Forms.Button();
this.upgradeConfigDBCheckBox = new System.Windows.Forms.CheckBox();
this.upgradeResultsDBCheckBox = new System.Windows.Forms.CheckBox();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.pressureRepresentationButton = new System.Windows.Forms.Button();
this.upgradeDb_24_29_Button = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// upgradeDb_215_217_Button
// upgradeDb_215_216_Button
//
this.upgradeDb_215_217_Button.Location = new System.Drawing.Point(12, 52);
this.upgradeDb_215_217_Button.Name = "upgradeDb_215_217_Button";
this.upgradeDb_215_217_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_215_217_Button.TabIndex = 1;
this.upgradeDb_215_217_Button.Text = "Upgrade database from ver. 2.15 to ver. 2.17";
this.upgradeDb_215_217_Button.UseVisualStyleBackColor = true;
this.upgradeDb_215_217_Button.Click += new System.EventHandler(this.upgradeDb_215_217_Button_Click);
this.upgradeDb_215_216_Button.Location = new System.Drawing.Point(12, 181);
this.upgradeDb_215_216_Button.Name = "upgradeDb_215_216_Button";
this.upgradeDb_215_216_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_215_216_Button.TabIndex = 5;
this.upgradeDb_215_216_Button.Text = "Upgrade database from ver. 2.15 to ver. 2.16";
this.upgradeDb_215_216_Button.UseVisualStyleBackColor = true;
this.upgradeDb_215_216_Button.Click += new System.EventHandler(this.upgradeDb_215_216_Button_Click);
//
// upgradeDb_216_217_Button
//
this.upgradeDb_216_217_Button.Location = new System.Drawing.Point(12, 92);
this.upgradeDb_216_217_Button.Location = new System.Drawing.Point(12, 221);
this.upgradeDb_216_217_Button.Name = "upgradeDb_216_217_Button";
this.upgradeDb_216_217_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_216_217_Button.TabIndex = 2;
this.upgradeDb_216_217_Button.TabIndex = 6;
this.upgradeDb_216_217_Button.Text = "Upgrade database from ver. 2.16 to ver. 2.17";
this.upgradeDb_216_217_Button.UseVisualStyleBackColor = true;
this.upgradeDb_216_217_Button.Click += new System.EventHandler(this.upgradeDb_216_217_Button_Click);
//
// upgradeDb_212_217_Button
// upgradeDb_212_215_Button
//
this.upgradeDb_212_217_Button.Location = new System.Drawing.Point(12, 12);
this.upgradeDb_212_217_Button.Name = "upgradeDb_212_217_Button";
this.upgradeDb_212_217_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_212_217_Button.TabIndex = 0;
this.upgradeDb_212_217_Button.Text = "Upgrade database from ver. 2.12 to ver. 2.17";
this.upgradeDb_212_217_Button.UseVisualStyleBackColor = true;
this.upgradeDb_212_217_Button.Click += new System.EventHandler(this.upgradeDb_212_217_Button_Click);
this.upgradeDb_212_215_Button.Location = new System.Drawing.Point(12, 141);
this.upgradeDb_212_215_Button.Name = "upgradeDb_212_215_Button";
this.upgradeDb_212_215_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_212_215_Button.TabIndex = 4;
this.upgradeDb_212_215_Button.Text = "Upgrade database from ver. 2.12 to ver. 2.15";
this.upgradeDb_212_215_Button.UseVisualStyleBackColor = true;
this.upgradeDb_212_215_Button.Click += new System.EventHandler(this.upgradeDb_212_215_Button_Click);
//
// upgradeDb_217_218_Button
//
this.upgradeDb_217_218_Button.Location = new System.Drawing.Point(12, 132);
this.upgradeDb_217_218_Button.Location = new System.Drawing.Point(12, 261);
this.upgradeDb_217_218_Button.Name = "upgradeDb_217_218_Button";
this.upgradeDb_217_218_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_217_218_Button.TabIndex = 3;
this.upgradeDb_217_218_Button.TabIndex = 7;
this.upgradeDb_217_218_Button.Text = "Upgrade database from ver. 2.17 to ver. 2.18";
this.upgradeDb_217_218_Button.UseVisualStyleBackColor = true;
this.upgradeDb_217_218_Button.Click += new System.EventHandler(this.upgradeDb_217_218_Button_Click);
//
// upgradeDb_29_212_Button
//
this.upgradeDb_29_212_Button.Location = new System.Drawing.Point(12, 101);
this.upgradeDb_29_212_Button.Name = "upgradeDb_29_212_Button";
this.upgradeDb_29_212_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_29_212_Button.TabIndex = 3;
this.upgradeDb_29_212_Button.Text = "Upgrade database from ver. 2.9 to ver. 2.12";
this.upgradeDb_29_212_Button.UseVisualStyleBackColor = true;
this.upgradeDb_29_212_Button.Click += new System.EventHandler(this.upgradeDb_29_212_Button_Click);
//
// upgradeConfigDBCheckBox
//
this.upgradeConfigDBCheckBox.AutoSize = true;
this.upgradeConfigDBCheckBox.Location = new System.Drawing.Point(13, 14);
this.upgradeConfigDBCheckBox.Name = "upgradeConfigDBCheckBox";
this.upgradeConfigDBCheckBox.Size = new System.Drawing.Size(147, 17);
this.upgradeConfigDBCheckBox.TabIndex = 0;
this.upgradeConfigDBCheckBox.Text = "Upgrade Config database";
this.upgradeConfigDBCheckBox.UseVisualStyleBackColor = true;
//
// upgradeResultsDBCheckBox
//
this.upgradeResultsDBCheckBox.AutoSize = true;
this.upgradeResultsDBCheckBox.Location = new System.Drawing.Point(13, 34);
this.upgradeResultsDBCheckBox.Name = "upgradeResultsDBCheckBox";
this.upgradeResultsDBCheckBox.Size = new System.Drawing.Size(152, 17);
this.upgradeResultsDBCheckBox.TabIndex = 1;
this.upgradeResultsDBCheckBox.Text = "Upgrade Results database";
this.upgradeResultsDBCheckBox.UseVisualStyleBackColor = true;
//
// textBox1
//
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.textBox1.Location = new System.Drawing.Point(94, 328);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(100, 20);
this.textBox1.TabIndex = 9;
//
// textBox2
//
this.textBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.textBox2.Location = new System.Drawing.Point(94, 354);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(100, 20);
this.textBox2.TabIndex = 11;
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 331);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(70, 13);
this.label1.TabIndex = 8;
this.label1.Text = "From batch #";
//
// label2
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 357);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(60, 13);
this.label2.TabIndex = 10;
this.label2.Text = "To batch #";
//
// pressureRepresentationButton
//
this.pressureRepresentationButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.pressureRepresentationButton.Location = new System.Drawing.Point(207, 328);
this.pressureRepresentationButton.Name = "pressureRepresentationButton";
this.pressureRepresentationButton.Size = new System.Drawing.Size(65, 42);
this.pressureRepresentationButton.TabIndex = 12;
this.pressureRepresentationButton.Text = "Upgrade pressure";
this.pressureRepresentationButton.UseVisualStyleBackColor = true;
this.pressureRepresentationButton.Click += new System.EventHandler(this.pressureRepresentationButton_Click);
//
// upgradeDb_24_29_Button
//
this.upgradeDb_24_29_Button.Location = new System.Drawing.Point(12, 61);
this.upgradeDb_24_29_Button.Name = "upgradeDb_24_29_Button";
this.upgradeDb_24_29_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_24_29_Button.TabIndex = 2;
this.upgradeDb_24_29_Button.Text = "Upgrade database from ver. 2.4 to ver. 2.9";
this.upgradeDb_24_29_Button.UseVisualStyleBackColor = true;
this.upgradeDb_24_29_Button.Click += new System.EventHandler(this.upgradeDb_24_29_Button_Click);
//
// UpgradeSelectionDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 262);
this.ClientSize = new System.Drawing.Size(284, 390);
this.Controls.Add(this.upgradeDb_24_29_Button);
this.Controls.Add(this.pressureRepresentationButton);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.upgradeResultsDBCheckBox);
this.Controls.Add(this.upgradeConfigDBCheckBox);
this.Controls.Add(this.upgradeDb_29_212_Button);
this.Controls.Add(this.upgradeDb_217_218_Button);
this.Controls.Add(this.upgradeDb_212_217_Button);
this.Controls.Add(this.upgradeDb_212_215_Button);
this.Controls.Add(this.upgradeDb_216_217_Button);
this.Controls.Add(this.upgradeDb_215_217_Button);
this.Controls.Add(this.upgradeDb_215_216_Button);
this.Name = "UpgradeSelectionDlg";
this.Text = "Upgrade selection";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button upgradeDb_215_217_Button;
private System.Windows.Forms.Button upgradeDb_215_216_Button;
private System.Windows.Forms.Button upgradeDb_216_217_Button;
private System.Windows.Forms.Button upgradeDb_212_217_Button;
private System.Windows.Forms.Button upgradeDb_212_215_Button;
private System.Windows.Forms.Button upgradeDb_217_218_Button;
private System.Windows.Forms.Button upgradeDb_29_212_Button;
private System.Windows.Forms.CheckBox upgradeConfigDBCheckBox;
private System.Windows.Forms.CheckBox upgradeResultsDBCheckBox;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button pressureRepresentationButton;
private System.Windows.Forms.Button upgradeDb_24_29_Button;
}
}
+454 -117
View File
@@ -1,8 +1,13 @@
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Collections.Generic;
using log4net;
using MySql.Data.MySqlClient;
using NHibernate;
using Results.Entities;
using TBF.Forms;
using TBF.Resources;
namespace TBF.Forms
{
@@ -10,9 +15,49 @@ namespace TBF.Forms
{
private static readonly ILog log = LogManager.GetLogger(typeof(UpgradeSelectionDlg));
int batchFrom;
int batchTo;
TBF.Forms.ModelessActivityForm form;
System.Threading.Thread formThread;
public UpgradeSelectionDlg()
{
InitializeComponent();
upgradeConfigDBCheckBox.Checked = true;
upgradeResultsDBCheckBox.Checked = true;
batchFrom = 1;
batchTo = Program.LocalSettings.BatchNr - 1;
textBox1.Text = batchFrom.ToString();
textBox2.Text = batchTo.ToString();
}
void ActivityStart()
{
form = new TBF.Forms.ModelessActivityForm()
{
Message = "Upgrading database",
FontFamily = "Arial",
FontSize = 24,
FontStyle = FontStyle.Regular,
BackgroundColor = Color.Green,
};
formThread = new System.Threading.Thread(() => form.ShowDialog());
formThread.Start();
}
void ActivityEnd()
{
if (form != null && formThread != null)
{
form.CloseForm(null, new EventArgs());
formThread.Join();
}
form = null;
formThread = null;
}
/// <summary>
@@ -21,7 +66,7 @@ namespace TBF.Forms
/// <param name="dbConn">Database connection</param>
/// <param name="commands">Array of SQL commands to be executed</param>
/// <returns>true = successful</returns>
bool UpgradeCommon(MySqlConnection dbConn, string[] commands)
bool ExecuteCommands(MySqlConnection dbConn, string[] commands)
{
bool success = false;
@@ -43,6 +88,7 @@ namespace TBF.Forms
{
log.ErrorFormat(string.Format("Exception when upgrading DB: {0}", exc.Message));
if (exc.InnerException != null) log.ErrorFormat(string.Format("Inner exception: {0}", exc.InnerException.Message));
ActivityEnd();
MessageBox.Show(string.Format("Exception {0}", exc.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
finally
@@ -53,10 +99,198 @@ namespace TBF.Forms
return success;
}
///---------------------------------------------------------------------
private void upgradeDb_212_217_Button_Click(object sender, EventArgs e)
///---------------------------------------------------------------------
private void upgradeDb_24_29_Button_Click(object sender, EventArgs e)
{
if (!upgradeConfigDBCheckBox.Checked && !upgradeResultsDBCheckBox.Checked)
{
MessageBox.Show("No database selected");
return;
}
string[] configDbCommands = new string[]
{
/// 2.4 -> 2.5
"ALTER TABLE `test` ADD `MassRepeats` INT NOT NULL DEFAULT '5' AFTER `PumpPower`, ADD `MassSpread` FLOAT NOT NULL DEFAULT '0' AFTER `MassRepeats`, ADD `MassMethod` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `MassSpread`",
/// 2.5 -> 2.6 ---
/// 2.6 -> 2.7 ---
/// 2.7 -> 2.8 ---
/// 2.8 -> 2.9
"ALTER TABLE `meterspath` DROP `Qfrom`, DROP `Qto`;",
};
string[] resultsDbCommands = new string[]
{
/// 2.4 -> 2.5 ---
/// 2.5 -> 2.6
"ALTER TABLE `watermeterdata` DROP `Q3`, CHANGE `Qn` `Q3_Qn` DOUBLE NULL DEFAULT NULL ",
"ALTER TABLE `watermeterdata` ADD `DN` DOUBLE NOT NULL DEFAULT '0' AFTER `Producer`, ADD `L` DOUBLE NOT NULL DEFAULT '0' AFTER `DN`, ADD `Mounting` VARCHAR(255) NULL DEFAULT NULL AFTER `L`, ADD `TemperatureClass` VARCHAR(255) NULL DEFAULT NULL AFTER `Q1_Qmin`, ADD `PressureLossClass` VARCHAR(255) NULL DEFAULT NULL AFTER `TemperatureClass`",
"ALTER TABLE `watermeterdata` ADD `MaxAdmissiblePressure` VARCHAR(255) NULL DEFAULT NULL AFTER `PressureLossClass`, ADD `FlowProfileSensitivityClass` VARCHAR(255) NULL DEFAULT NULL AFTER `MaxAdmissiblePressure`, ADD `Certificate` VARCHAR(255) NULL DEFAULT NULL AFTER `FlowProfileSensitivityClass`, ADD `PulsesPerLtr` DOUBLE NOT NULL DEFAULT '1' AFTER `Certificate`",
"ALTER TABLE `watermeterdata` ADD `Text1` VARCHAR(255) NULL DEFAULT NULL AFTER `PulsesPerLtr`, ADD `Text2` VARCHAR(255) NULL DEFAULT NULL AFTER `Text1`, ADD `Text3` VARCHAR(255) NULL DEFAULT NULL AFTER `Text2`, ADD `Text4` VARCHAR(255) NULL DEFAULT NULL AFTER `Text3`, ADD `Text5` VARCHAR(255) NULL DEFAULT NULL AFTER `Text4`",
/// 2.6 -> 2.7
"ALTER TABLE `watermeterdata` ADD `ProducerAux` VARCHAR(255) NULL DEFAULT NULL AFTER `PulsesPerLtr`, ADD `Q3_Qn_Aux` DOUBLE NOT NULL DEFAULT '0' AFTER `ProducerAux`, ADD `MetrologicalClassAux` VARCHAR(255) NULL DEFAULT NULL AFTER `Q3_Qn_Aux`, ADD `ApprovalInfoAux` VARCHAR(255) NULL DEFAULT NULL AFTER `MetrologicalClassAux`",
/// 2.7 -> 2.8
"ALTER TABLE `watermeter` ADD `ResultCode` INT NOT NULL DEFAULT '0' AFTER `Passed`",
"ALTER TABLE `batch` ADD `Remark` VARCHAR( 2000 ) NULL DEFAULT NULL AFTER `ProtocolTitle`",
/// 2.8 -> 2.9 ---
};
ActivityStart();
if ((!upgradeConfigDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString), configDbCommands)) &&
(!upgradeResultsDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(Results.DB.ConnectionString), resultsDbCommands)))
{
ActivityEnd();
MessageBox.Show("DB succesfully upgraded", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
upgradeDb_24_29_Button.Enabled = false;
}
}
///---------------------------------------------------------------------
private void upgradeDb_29_212_Button_Click(object sender, EventArgs e)
{
if (!upgradeConfigDBCheckBox.Checked && !upgradeResultsDBCheckBox.Checked)
{
MessageBox.Show("No database selected");
return;
}
string[] configDbCommands = new string[]
{
/// 2.9 -> 2.10
/// 2.10 -> 2.11
"ALTER TABLE `feedingpath` ADD `RegulValvesPct` VARCHAR(255) NULL DEFAULT NULL AFTER `Pump;",
/// 2.11 -> 2.12
"ALTER TABLE `benchpath` ADD `PressMtrDelta` VARCHAR(255) NULL DEFAULT NULL AFTER `PressOut;",
};
string[] resultsDbCommands = new string[]
{
/// 2.9 -> 2.10
"ALTER TABLE `testrslt` ADD `AmbTempStart` FLOAT NOT NULL DEFAULT '0' AFTER `AmbientTempAve`",
"ALTER TABLE `testrslt` ADD `AmbTempEnd` FLOAT NOT NULL DEFAULT '0' AFTER `AmbTempStart`",
"ALTER TABLE `testrslt` ADD `AmbTempMin` FLOAT NOT NULL DEFAULT '0' AFTER `AmbTempEnd`",
"ALTER TABLE `testrslt` ADD `AmbTempMax` FLOAT NOT NULL DEFAULT '0' AFTER `AmbTempMin`",
"ALTER TABLE `testrslt` ADD `AmbPressStart` FLOAT NOT NULL DEFAULT '0' AFTER `AmbientPressAve`",
"ALTER TABLE `testrslt` ADD `AmbPressEnd` FLOAT NOT NULL DEFAULT '0' AFTER `AmbPressStart`",
"ALTER TABLE `testrslt` ADD `AmbPressMin` FLOAT NOT NULL DEFAULT '0' AFTER `AmbPressEnd`",
"ALTER TABLE `testrslt` ADD `AmbPressMax` FLOAT NOT NULL DEFAULT '0' AFTER `AmbPressMin`",
"ALTER TABLE `testrslt` ADD `AmbHumiStart` FLOAT NOT NULL DEFAULT '0' AFTER `AmbientHumiAve`",
"ALTER TABLE `testrslt` ADD `AmbHumiEnd` FLOAT NOT NULL DEFAULT '0' AFTER `AmbHumiStart`",
"ALTER TABLE `testrslt` ADD `AmbHumiMin` FLOAT NOT NULL DEFAULT '0' AFTER `AmbHumiEnd`",
"ALTER TABLE `testrslt` ADD `AmbHumiMax` FLOAT NOT NULL DEFAULT '0' AFTER `AmbHumiMin`",
/// 2.10 -> 2.11
/// 2.11 -> 2.12
"ALTER TABLE `testrslt` ADD `PressDeltaMean` FLOAT NOT NULL DEFAULT '0' AFTER `PressDownMax`",
"ALTER TABLE `testrslt` ADD `PressDeltaStart` FLOAT NOT NULL DEFAULT '0' AFTER `PressDeltaMean`",
"ALTER TABLE `testrslt` ADD `PressDeltaEnd` FLOAT NOT NULL DEFAULT '0' AFTER `PressDeltaStart`",
"ALTER TABLE `testrslt` ADD `PressDeltaMin` FLOAT NOT NULL DEFAULT '0' AFTER `PressDeltaEnd`",
"ALTER TABLE `testrslt` ADD `PressDeltaMax` FLOAT NOT NULL DEFAULT '0' AFTER `PressDeltaMin`",
"ALTER TABLE `testrslt` ADD `FlowStart` FLOAT NOT NULL DEFAULT '0' AFTER `TempDivMax`",
"ALTER TABLE `testrslt` ADD `FlowEnd` FLOAT NOT NULL DEFAULT '0' AFTER `FlowStart`",
};
ActivityStart();
if ((!upgradeConfigDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString), configDbCommands)) &&
(!upgradeResultsDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(Results.DB.ConnectionString), resultsDbCommands)))
{
if (upgradeConfigDBCheckBox.Checked)
{
MySqlConnection dbConn = new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString);
try
{
dbConn.Open();
MySqlCommand cmd;
cmd = dbConn.CreateCommand();
cmd.CommandText = "UPDATE component SET ClassName = 'TestMethods.Adjustment.Single' WHERE ClassName = 'Adjustment'";
cmd.ExecuteNonQuery();
cmd.Dispose();
cmd = dbConn.CreateCommand();
cmd.CommandText = "UPDATE component SET ClassName = 'TestMethods.FlyingStartMassCollection.Compound' WHERE ClassName = 'CombinedMeters'";
cmd.ExecuteNonQuery();
cmd.Dispose();
cmd = dbConn.CreateCommand();
cmd.CommandText = "UPDATE component SET ClassName = 'TestMethods.CombinedWithDetection.Compound' WHERE ClassName = 'CombinedWithDetection'";
cmd.ExecuteNonQuery();
cmd.Dispose();
cmd = dbConn.CreateCommand();
cmd.CommandText = "UPDATE component SET ClassName = 'TestMethods.FixedStartMassCollection.Single' WHERE ClassName = 'FixedStartMassCollection'";
cmd.ExecuteNonQuery();
cmd.Dispose();
cmd = dbConn.CreateCommand();
cmd.CommandText = "UPDATE component SET ClassName = 'TestMethods.FlyingStart.Single' WHERE ClassName = 'FlyingStart'";
cmd.ExecuteNonQuery();
cmd.Dispose();
cmd = dbConn.CreateCommand();
cmd.CommandText = "UPDATE component SET ClassName = 'TestMethods.FlyingStartMassCollection.Single' WHERE ClassName = 'Flying-Start-Collection'";
cmd.ExecuteNonQuery();
cmd.Dispose();
cmd = dbConn.CreateCommand();
cmd.CommandText = "UPDATE component SET ClassName = 'TestMethods.LeakTest' WHERE ClassName = 'Leak-Test'";
cmd.ExecuteNonQuery();
cmd.Dispose();
cmd = dbConn.CreateCommand();
cmd.CommandText = "UPDATE component SET ClassName = 'TestMethods.PMaxTest' WHERE ClassName = 'PMax-Test'";
cmd.ExecuteNonQuery();
cmd.Dispose();
cmd = dbConn.CreateCommand();
cmd.CommandText = "UPDATE component SET ClassName = 'Output.Printers.Enhanced.Single' WHERE ClassName = 'BasicResultsPrinter'";
cmd.ExecuteNonQuery();
cmd.Dispose();
ActivityEnd();
MessageBox.Show("DB succesfully upgraded", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
upgradeDb_29_212_Button.Enabled = false;
}
catch (Exception exc)
{
log.ErrorFormat(string.Format("Exception when upgrading DB: {0}", exc.Message));
if (exc.InnerException != null) log.ErrorFormat(string.Format("Inner exception: {0}", exc.InnerException.Message));
ActivityEnd();
MessageBox.Show(string.Format("Exception {0}", exc.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
finally
{
dbConn.Close();
}
}
else
{
ActivityEnd();
MessageBox.Show("DB succesfully upgraded", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
upgradeDb_29_212_Button.Enabled = false;
}
}
}
///---------------------------------------------------------------------
private void upgradeDb_212_215_Button_Click(object sender, EventArgs e)
{
if (!upgradeConfigDBCheckBox.Checked && !upgradeResultsDBCheckBox.Checked)
{
MessageBox.Show("No database selected");
return;
}
string[] configDbCommands = new string[]
{
/// 2.12 -> 2.13
@@ -81,185 +315,288 @@ namespace TBF.Forms
"ALTER TABLE `testdata` ADD `DoControlWaterTemp` BOOLEAN NOT NULL DEFAULT '0' AFTER `Uncertainty`, ADD `TempLimLo` FLOAT NOT NULL DEFAULT '15' AFTER `DoControlWaterTemp`, ADD `TempLimHi` FLOAT NOT NULL DEFAULT '25' AFTER `TempLimLo`",
/// 2.14 -> 2.15
"ALTER TABLE `watermeter` ADD `ArchivePath` VARCHAR(255) NULL DEFAULT NULL AFTER `ResultCode`;",
/// 2.15 -> 2.17
"ALTER TABLE `testrslt` ADD `ErrorFlagsMd` TINYINT( 4 ) NOT NULL DEFAULT '0' AFTER `ErrorMaster`, ADD `ErrorFlags` INT NOT NULL DEFAULT '0' AFTER `ErrorFlagsMd`, ADD `DiverterStart` FLOAT NOT NULL DEFAULT '0.001' AFTER `ErrorMaster`, ADD `DiverterEnd` FLOAT NOT NULL DEFAULT '0.001' AFTER `DiverterStart`;",
"ALTER TABLE `watermeter` ADD `ErrorFlags` INT NOT NULL DEFAULT '0' AFTER `QFall`;",
};
if (UpgradeCommon(new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString), configDbCommands) &&
UpgradeCommon(new MySqlConnection(Results.DB.ConnectionString), resultsDbCommands))
ActivityStart();
if ((!upgradeConfigDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString), configDbCommands)) &&
(!upgradeResultsDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(Results.DB.ConnectionString), resultsDbCommands)))
{
MySqlConnection dbConn = new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString);
try
if (upgradeConfigDBCheckBox.Checked)
{
dbConn.Open();
MySqlConnection dbConn = new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString);
try
{
dbConn.Open();
int maxItemNr = 0;
MySqlCommand cmd = dbConn.CreateCommand();
cmd.CommandText = "SELECT ItemNr FROM component";
MySqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
int itemNr = dr.GetInt32(0);
if (itemNr > maxItemNr) maxItemNr = itemNr;
}
dr.Close();
int maxItemNr = 0;
MySqlCommand cmd = dbConn.CreateCommand();
cmd.CommandText = "SELECT ItemNr FROM component";
MySqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
int itemNr = dr.GetInt32(0);
if (itemNr > maxItemNr) maxItemNr = itemNr;
}
dr.Close();
cmd = dbConn.CreateCommand();
cmd.CommandText = "UPDATE component SET ClassName = 'RegisterReader for standing start/stop' WHERE ClassName = 'Fixed-Start-Register-Reader'";
cmd.ExecuteNonQuery();
cmd.Dispose();
cmd = dbConn.CreateCommand();
cmd.CommandText = "UPDATE component SET ClassName = 'TestMethods.iPerlCommunication' WHERE ClassName = 'iPerlCommunication'";
cmd.ExecuteNonQuery();
cmd.Dispose();
cmd = dbConn.CreateCommand();
cmd.CommandText = "UPDATE component SET ClassName = 'WaterMeter' WHERE ClassName = 'iPerl'";
cmd.ExecuteNonQuery();
cmd.Dispose();
for (int i = 1; i <= 40; i++)
{
Text = string.Format("Upgrade selection: {0}/40", i);
/// Read original iPerl water meter parameters
int id = 0;
string parameters = string.Empty;
cmd = dbConn.CreateCommand();
cmd.CommandText = string.Format("SELECT Id, Parameters FROM Component WHERE Name = 'iPerl{0}' AND ClassName = 'WaterMeter'", i);
dr = cmd.ExecuteReader();
if (dr.Read())
{
id = dr.GetInt32(0);
parameters = dr.GetString(1);
}
dr.Close();
cmd = dbConn.CreateCommand();
cmd.CommandText = "UPDATE component SET ClassName = 'RegisterReader for standing start/stop' WHERE ClassName = 'Fixed-Start-Register-Reader'";
cmd.ExecuteNonQuery();
cmd.Dispose();
if (id != 0)
{
/// Rename iPerl water meter
cmd = dbConn.CreateCommand();
cmd.CommandText = string.Format("UPDATE component SET Name = 'WM{0}' WHERE Name = 'iPerl{0}'", i);
cmd.ExecuteNonQuery();
cmd.Dispose();
cmd = dbConn.CreateCommand();
cmd.CommandText = "UPDATE component SET ClassName = 'TestMethods.iPerlCommunication' WHERE ClassName = 'iPerlCommunication'";
cmd.ExecuteNonQuery();
cmd.Dispose();
/// Create iPerl Head
cmd = dbConn.CreateCommand();
cmd.CommandText = string.Format("INSERT INTO component(ItemNr, Name, ClassName, Parentname, Mode, Logging, Parameters) VALUES ({0}, 'iPerl{1}', 'RegisterReader for iPerl', '', 'Normal', 'Off', @params)",
maxItemNr + 1, i);
cmd.Parameters.AddWithValue("@params", parameters.Replace("WaterMeterCfg", "IperlHeadCfg"));
cmd.ExecuteNonQuery();
cmd.Dispose();
cmd = dbConn.CreateCommand();
cmd.CommandText = "UPDATE component SET ClassName = 'WaterMeter' WHERE ClassName = 'iPerl'";
cmd.ExecuteNonQuery();
cmd.Dispose();
for (int i = 1; i <= 40; i++)
{
Text = string.Format("Upgrade selection: {0}/40", i);
/// Read original iPerl water meter parameters
int id = 0;
string parameters = string.Empty;
/// Clone procedure parameters
IList<int> idList = new List<int>();
IList<string> parList = new List<string>();
IList<int> procIdList = new List<int>();
cmd = dbConn.CreateCommand();
cmd.CommandText = string.Format("SELECT Id, Parameters, Procedure_id FROM componentprocedure WHERE CmpntName = 'iPerl{0}'", i);
cmd.CommandText = string.Format("SELECT Id, Parameters FROM Component WHERE Name = 'iPerl{0}' AND ClassName = 'WaterMeter'", i);
dr = cmd.ExecuteReader();
while (dr.Read())
if (dr.Read())
{
idList.Add(dr.GetInt32(0));
parList.Add(dr.GetString(1));
procIdList.Add(dr.GetInt32(2));
id = dr.GetInt32(0);
parameters = dr.GetString(1);
}
dr.Close();
cmd.Dispose();
if ((idList.Count == parList.Count) && (parList.Count == procIdList.Count))
if (id != 0)
{
for (int j = 0; j < parList.Count; j++)
/// Rename iPerl water meter
cmd = dbConn.CreateCommand();
cmd.CommandText = string.Format("UPDATE component SET Name = 'WM{0}' WHERE Name = 'iPerl{0}'", i);
cmd.ExecuteNonQuery();
cmd.Dispose();
/// Create iPerl Head
cmd = dbConn.CreateCommand();
cmd.CommandText = string.Format("INSERT INTO component(ItemNr, Name, ClassName, Parentname, Mode, Logging, Parameters) VALUES ({0}, 'iPerl{1}', 'RegisterReader for iPerl', '', 'Normal', 'Off', @params)",
maxItemNr + 1, i);
cmd.Parameters.AddWithValue("@params", parameters.Replace("WaterMeterCfg", "IperlHeadCfg"));
cmd.ExecuteNonQuery();
cmd.Dispose();
/// Clone procedure parameters
IList<int> idList = new List<int>();
IList<string> parList = new List<string>();
IList<int> procIdList = new List<int>();
cmd = dbConn.CreateCommand();
cmd.CommandText = string.Format("SELECT Id, Parameters, Procedure_id FROM componentprocedure WHERE CmpntName = 'iPerl{0}'", i);
dr = cmd.ExecuteReader();
while (dr.Read())
{
cmd = dbConn.CreateCommand();
cmd.CommandText = string.Format("INSERT INTO componentprocedure(CmpntName, Parameters, Procedure_id) VALUES ('WM{0}', @params, {1})",
i, procIdList[j]);
cmd.Parameters.AddWithValue("@params", parList[j].Replace("Q4", "Qmax")
.Replace("Q3", "Qn")
.Replace("Q2", "Qt")
.Replace("Q1", "Qmin")
.Replace("<Qmax>", "<NewQnames>true</NewQnames>\r\n <Qmax>"));
cmd.ExecuteNonQuery();
cmd.Dispose();
idList.Add(dr.GetInt32(0));
parList.Add(dr.GetString(1));
procIdList.Add(dr.GetInt32(2));
}
dr.Close();
cmd.Dispose();
if ((idList.Count == parList.Count) && (parList.Count == procIdList.Count))
{
for (int j = 0; j < parList.Count; j++)
{
cmd = dbConn.CreateCommand();
cmd.CommandText = string.Format("INSERT INTO componentprocedure(CmpntName, Parameters, Procedure_id) VALUES ('WM{0}', @params, {1})",
i, procIdList[j]);
cmd.Parameters.AddWithValue("@params", parList[j].Replace("Q4", "Qmax")
.Replace("Q3", "Qn")
.Replace("Q2", "Qt")
.Replace("Q1", "Qmin")
.Replace("<Qmax>", "<NewQnames>true</NewQnames>\r\n <Qmax>"));
cmd.ExecuteNonQuery();
cmd.Dispose();
}
}
}
}
}
/// Delete 'Parmeters' of iPerl water meters
cmd = dbConn.CreateCommand();
cmd.CommandText = "UPDATE component SET Parameters = '<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n<WaterMeterCfg xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\r\n</WaterMeterCfg>' WHERE ClassName = 'WaterMeter'";
cmd.ExecuteNonQuery();
cmd.Dispose();
/// Delete 'Parmeters' of iPerl water meters
cmd = dbConn.CreateCommand();
cmd.CommandText = "UPDATE component SET Parameters = '<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n<WaterMeterCfg xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\r\n</WaterMeterCfg>' WHERE ClassName = 'WaterMeter'";
cmd.ExecuteNonQuery();
cmd.Dispose();
Text = string.Format("Upgrade selection");
Text = string.Format("Upgrade selection");
ActivityEnd();
MessageBox.Show("DB succesfully upgraded", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
upgradeDb_212_215_Button.Enabled = false;
}
catch (Exception exc)
{
log.ErrorFormat(string.Format("Exception when upgrading DB: {0}", exc.Message));
if (exc.InnerException != null) log.ErrorFormat(string.Format("Inner exception: {0}", exc.InnerException.Message));
ActivityEnd();
MessageBox.Show(string.Format("Exception {0}", exc.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
finally
{
dbConn.Close();
}
}
else
{
ActivityEnd();
MessageBox.Show("DB succesfully upgraded", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
upgradeDb_212_217_Button.Enabled = false;
}
catch (Exception exc)
{
log.ErrorFormat(string.Format("Exception when upgrading DB: {0}", exc.Message));
if (exc.InnerException != null) log.ErrorFormat(string.Format("Inner exception: {0}", exc.InnerException.Message));
MessageBox.Show(string.Format("Exception {0}", exc.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
finally
{
dbConn.Close();
upgradeDb_212_215_Button.Enabled = false;
}
}
}
///---------------------------------------------------------------------
private void upgradeDb_215_217_Button_Click(object sender, EventArgs e)
private void upgradeDb_215_216_Button_Click(object sender, EventArgs e)
{
if (!upgradeConfigDBCheckBox.Checked && !upgradeResultsDBCheckBox.Checked)
{
MessageBox.Show("No database selected");
return;
}
string[] commands = new string[]
{
"ALTER TABLE `testrslt` ADD `ErrorFlagsMd` TINYINT( 4 ) NOT NULL DEFAULT '0' AFTER `ErrorMaster`, ADD `ErrorFlags` INT NOT NULL DEFAULT '0' AFTER `ErrorFlagsMd`, ADD `DiverterStart` FLOAT NOT NULL DEFAULT '0.001' AFTER `ErrorMaster`, ADD `DiverterEnd` FLOAT NOT NULL DEFAULT '0.001' AFTER `DiverterStart`;",
"ALTER TABLE `watermeter` ADD `ErrorFlags` INT NOT NULL DEFAULT '0' AFTER `QFall`;",
"ALTER TABLE `testrslt` ADD `ErrorFlagsMd` TINYINT( 4 ) NOT NULL DEFAULT '0' AFTER `ErrorMaster`, ADD `ErrorFlags` INT NOT NULL DEFAULT '0' AFTER `ErrorFlagsMd`;",
};
if (UpgradeCommon(new MySqlConnection(Results.DB.ConnectionString), commands))
ActivityStart();
if (!upgradeResultsDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(Results.DB.ConnectionString), commands))
{
ActivityEnd();
MessageBox.Show("DB succesfully upgraded", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
upgradeDb_215_217_Button.Enabled = false;
upgradeDb_215_216_Button.Enabled = false;
}
}
///---------------------------------------------------------------------
private void upgradeDb_216_217_Button_Click(object sender, EventArgs e)
{
if (!upgradeConfigDBCheckBox.Checked && !upgradeResultsDBCheckBox.Checked)
{
MessageBox.Show("No database selected");
return;
}
string[] commands = new string[]
{
"ALTER TABLE `testrslt` ADD `DiverterStart` FLOAT NOT NULL DEFAULT '0.001' AFTER `ErrorMaster`, ADD `DiverterEnd` FLOAT NOT NULL DEFAULT '0.001' AFTER `DiverterStart`;",
"ALTER TABLE `watermeter` ADD `ErrorFlags` INT NOT NULL DEFAULT '0' AFTER `QFall`;",
};
if (UpgradeCommon(new MySqlConnection(Results.DB.ConnectionString), commands))
ActivityStart();
if (!upgradeResultsDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(Results.DB.ConnectionString), commands))
{
ActivityEnd();
MessageBox.Show("DB succesfully upgraded", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
upgradeDb_216_217_Button.Enabled = false;
}
}
///---------------------------------------------------------------------
private void upgradeDb_217_218_Button_Click(object sender, EventArgs e)
{
if (!upgradeConfigDBCheckBox.Checked && !upgradeResultsDBCheckBox.Checked)
{
MessageBox.Show("No database selected");
return;
}
string[] commands = new string[]
{
"ALTER TABLE `measurementcorrection` ADD `RangeIx` INT NOT NULL DEFAULT '0' AFTER `Id`;",
};
if (UpgradeCommon(new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString), commands))
ActivityStart();
if (!upgradeConfigDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString), commands))
{
ActivityEnd();
MessageBox.Show("DB succesfully upgraded", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
upgradeDb_217_218_Button.Enabled = false;
}
}
private void pressureRepresentationButton_Click(object sender, EventArgs e)
{
try
{
batchFrom = int.Parse(textBox1.Text);
batchTo = int.Parse(textBox2.Text);
if (batchFrom < 1 || batchFrom > batchTo) throw new Exception();
}
catch
{
MessageBox.Show("Wrong 'From batch #' or 'To batch #'", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
if (MessageBox.Show("Are you sure ?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) return;
ActivityStart();
try
{
ISession session = Results.DB.CreateSession();
IList<Batch> bFrom = session.QueryOver<Batch>().Where(x => (x.BatchNr == batchFrom)).List<Batch>();
IList<Batch> bTo = session.QueryOver<Batch>().Where(x => (x.BatchNr == batchTo)).List<Batch>();
if (bFrom.Count != 1) throw new Exception("No start batch");
if (bTo.Count != 1) throw new Exception("No end batch");
IList<TestRslt> testResults = session.QueryOver<TestRslt>()
.WhereRestrictionOn(x => x.StartTime)
.IsBetween(bFrom[0].StartTime)
.And(bTo[0].EndTime)
.List<TestRslt>();
foreach (var tr in testResults)
{
Text = string.Format("Batch # = {0}", tr.Batch.BatchNr);
float factor1 = 0.01f;
tr.PressUpMean *= factor1;
tr.PressUpStart *= factor1;
tr.PressUpEnd *= factor1;
tr.PressUpMin *= factor1;
tr.PressUpMax *= factor1;
tr.PressDownMean *= factor1;
tr.PressDownStart *= factor1;
tr.PressDownEnd *= factor1;
tr.PressDownMin *= factor1;
tr.PressDownMax *= factor1;
tr.AmbPressMean *= 0.001f;
session.SaveOrUpdate(tr);
}
session.Flush();
ActivityEnd();
MessageBox.Show("Upgrade completed", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception exc)
{
ActivityEnd();
MessageBox.Show(string.Format("Upgrade failed:\r\n{0}", exc.Message),
"Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
}
+1 -1
View File
@@ -54,7 +54,7 @@ namespace TBF
this.horizontalSplitContainer = new System.Windows.Forms.SplitContainer();
this.mainTabControl = new System.Windows.Forms.TabControl();
this.homeTabPage = new System.Windows.Forms.TabPage();
this.ctrlBrdComponent = new ControlComponent3Munich.UserControl1();
this.ctrlBrdComponent = new ControlComponent_Torino2015.UserControl1();
this.processTabPage = new System.Windows.Forms.TabPage();
this.processTabPageCtrl = new TBF.Screens.ProcessTabPageCtrl6();
this.insertTabPage = new System.Windows.Forms.TabPage();
+2
View File
@@ -315,6 +315,7 @@ namespace TBF
/// </summary>
private void MainWnd_KeyPress(object sender, KeyPressEventArgs e)
{
#if !BADGER_MALA_TRAT && !BADGER_STREDNA_TRAT && !BADGER_VELKA_TRAT
if (BenchControlPanel != null && BenchControlPanel.ProcessKey(e.KeyChar))
{
e.Handled = true;
@@ -324,6 +325,7 @@ namespace TBF
{
log.WarnFormat("'{0}' key pressed, not handled", e.KeyChar);
}
#endif
}
/// <summary>
+2 -2
View File
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.18.821.0")]
[assembly: AssemblyFileVersion("2.18.821.0")]
[assembly: AssemblyVersion("2.18.853.0")]
[assembly: AssemblyFileVersion("2.18.853.0")]
+19 -11
View File
@@ -4,31 +4,35 @@
<TestBenches>
<DatabaseSettings>
<BenchName>Test Bench</BenchName>
<BenchName>Mobile test bench</BenchName>
<IsRealBench>true</IsRealBench>
<ProceduresDBSettings>
<DbType>MySql</DbType>
<ConnectionString>SERVER=localhost; DATABASE=testbench; UID=root; PASSWORD=; CHARSET=utf8;</ConnectionString>
</ProceduresDBSettings>
<WaterMetersDBSettings>
<ConnectionString>SERVER=localhost; DATABASE=rummob; UID=root; PASSWORD=; CHARSET=utf8;</ConnectionString>
<DbType>MySql</DbType>
<ConnectionString>SERVER=localhost; DATABASE=testbench-r; UID=root; PASSWORD=; CHARSET=utf8;</ConnectionString>
</WaterMetersDBSettings>
<ConnectionString>SERVER=localhost; DATABASE=rummob-r; UID=root; PASSWORD=; CHARSET=utf8;</ConnectionString>
<ConnectionString />
</DatabaseSettings>
</TestBenches>
<LastBench>Test Bench</LastBench>
<LoginMethod>UserName</LoginMethod>
<LastBench>Mobile test bench</LastBench>
<BatchNr>1</BatchNr>
<RealDensity>988.2008</RealDensity>
<RealDensity>998.2008</RealDensity>
<AtTemperature>20</AtTemperature>
<RightPaneHorizSplitterDistance>25</RightPaneHorizSplitterDistance>
<MainWndLeft>75</MainWndLeft>
<MainWndTop>5</MainWndTop>
<TopPaneVerticalSplitterDistance>596</TopPaneVerticalSplitterDistance>
<MainWndLeft>76</MainWndLeft>
<MainWndTop>21</MainWndTop>
<MainWndWidth>1250</MainWndWidth>
<MainWndHeight>750</MainWndHeight>
<ManiWndMaximized>false</ManiWndMaximized>
<ManiWndMaximized>true</ManiWndMaximized>
<ComponentsDlgLeft>200</ComponentsDlgLeft>
<ComponentsDlgTop>100</ComponentsDlgTop>
<ComponentsDlgWidth>850</ComponentsDlgWidth>
<ComponentsDlgHeight>500</ComponentsDlgHeight>
<PopupResultsLeft>0</PopupResultsLeft>
<PopupResultsTop>0</PopupResultsTop>
<PopupResultsWidth>0</PopupResultsWidth>
<PopupResultsHeight>0</PopupResultsHeight>
<PathsDlgLeft>0</PathsDlgLeft>
<PathsDlgTop>0</PathsDlgTop>
<PathsDlgWidth>0</PathsDlgWidth>
@@ -53,6 +57,10 @@
<OneProcedureDlgHeight>0</OneProcedureDlgHeight>
<PrintOrderLeft>0</PrintOrderLeft>
<PrintOrderTop>0</PrintOrderTop>
<EnduranceDlgLeft>0</EnduranceDlgLeft>
<EnduranceDlgTop>0</EnduranceDlgTop>
<EnduranceDlgWidth>0</EnduranceDlgWidth>
<EnduranceDlgHeight>0</EnduranceDlgHeight>
<PrintOrderOnlyGoodResult>false</PrintOrderOnlyGoodResult>
<PrintOrderOnlyLastResult>false</PrintOrderOnlyLastResult>
<ResultsConfigMeters>Vertically</ResultsConfigMeters>
+2 -1
View File
@@ -60,10 +60,11 @@
<logger name="NHibernate"> <level value="ERROR" /> </logger>
<logger name="TBF.BenchControl.StateMachine"> <level value="INFO" /> </logger>
<logger name="TBF.BenchControl.State"> <level value="WARN" /> </logger>
<logger name="TBF.BenchControl.Elde.ControlComdWrap"> <level value="WARN" /> </logger>
<logger name="TBF.BenchControl.Elde.ControlComWrap"> <level value="WARN" /> </logger>
<logger name="TBF.BenchControl.Elde.Pump"> <level value="WARN" /> </logger>
<logger name="TBF.BenchControl.Elde.PumpWithFM"> <level value="WARN" /> </logger>
<logger name="TBF.BenchControl.MettlerToledo"> <level value="WARN" /> </logger>
<logger name="TBF.BenchControl.Fomulas"> <level value="FATAL" /> </logger>
<logger name="TBF.BenchControl.Elde.StartMeasurementOp"> <level value="WARN" /> </logger>
<logger name="TBF.BenchControl.Modbus"> <level value="DEBUG" /> </logger>
</log4net>
+36 -9
View File
@@ -39,7 +39,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH;CAMERA</DefineConstants>
<DefineConstants>TRACE;DEBUG;RUM_MOB;LANG_RO;STABLE_MASS_EXTRAS;CAMERA</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -49,7 +49,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;MUNICH;CAMERA</DefineConstants>
<DefineConstants>TRACE;RUM_MOB;LANG_RO;STABLE_MASS_EXTRAS;CAMERA</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
@@ -58,7 +58,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH;CAMERA</DefineConstants>
<DefineConstants>TRACE;DEBUG;RUM_MOB;LANG_RO;STABLE_MASS_EXTRAS;CAMERA</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
@@ -67,7 +67,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;MUNICH;CAMERA</DefineConstants>
<DefineConstants>TRACE;RUM_MOB;LANG_RO;STABLE_MASS_EXTRAS;CAMERA</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
@@ -97,8 +97,8 @@
<SignManifests>false</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="ControlComponent3Munich">
<HintPath>..\packages\ControlBoard\Munich\ControlComponent3Munich.dll</HintPath>
<Reference Include="ControlComponent3U">
<HintPath>..\packages\ControlBoard\Rumunsko-Mob\ControlComponent3U.dll</HintPath>
</Reference>
<Reference Include="FluentNHibernate">
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
@@ -795,6 +795,15 @@
<Compile Include="BenchControl\Output\FileWriters\OneFilePerMeter\WriterCfgCtrl.designer.cs">
<DependentUpon>WriterCfgCtrl.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\Output\FileWriters\XmlBatch\Factory.cs" />
<Compile Include="BenchControl\Output\FileWriters\XmlBatch\Writer.cs" />
<Compile Include="BenchControl\Output\FileWriters\XmlBatch\WriterCfg.cs" />
<Compile Include="BenchControl\Output\FileWriters\XmlBatch\WriterCfgCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="BenchControl\Output\FileWriters\XmlBatch\WriterCfgCtrl.designer.cs">
<DependentUpon>WriterCfgCtrl.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\Output\FileWriters\Xml\FactoryCompound.cs" />
<Compile Include="BenchControl\Output\FileWriters\Xml\FactoryHeatMeters.cs" />
<Compile Include="BenchControl\Output\FileWriters\Xml\FactorySingle.cs" />
@@ -944,6 +953,21 @@
<Compile Include="BenchControl\TestMethods\FixedStartMassCollection\HeatMeters\TestParams.cs" />
<Compile Include="BenchControl\TestMethods\FixedStartMassCollection\Single\Component.cs" />
<Compile Include="BenchControl\TestMethods\FixedStartMassCollection\Single\Factory.cs" />
<Compile Include="BenchControl\TestMethods\FixedStart\Compound\Component.cs" />
<Compile Include="BenchControl\TestMethods\FixedStart\Compound\Factory.cs" />
<Compile Include="BenchControl\TestMethods\FixedStart\FixedStartSeq.cs" />
<Compile Include="BenchControl\TestMethods\FixedStart\HeatMeters\Component.cs" />
<Compile Include="BenchControl\TestMethods\FixedStart\HeatMeters\Factory.cs" />
<Compile Include="BenchControl\TestMethods\FixedStart\HeatMeters\TestMethodCfg.cs" />
<Compile Include="BenchControl\TestMethods\FixedStart\HeatMeters\TestMethodCfgCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="BenchControl\TestMethods\FixedStart\HeatMeters\TestMethodCfgCtrl.designer.cs">
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\TestMethods\FixedStart\HeatMeters\TestParams.cs" />
<Compile Include="BenchControl\TestMethods\FixedStart\Single\Component.cs" />
<Compile Include="BenchControl\TestMethods\FixedStart\Single\Factory.cs" />
<Compile Include="BenchControl\TestMethods\FlyingStartFirstRepetWithMassColl\Compound\Component.cs" />
<Compile Include="BenchControl\TestMethods\FlyingStartFirstRepetWithMassColl\Compound\Factory.cs" />
<Compile Include="BenchControl\TestMethods\FlyingStartFirstRepetWithMassColl\Compound\TestMethodCfg.cs" />
@@ -1537,9 +1561,6 @@
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\TestMethods\PMaxTest\TestMethodFactory.cs" />
<Compile Include="BenchControl\TestMethods\ReferenceFlowmeterCalibration\ReferenceFlowmeterCalibrationSeq.cs" />
<Compile Include="BenchControl\TestMethods\ReferenceFlowmeterCalibration\TestMethod.cs" />
<Compile Include="BenchControl\TestMethods\ReferenceFlowmeterCalibration\TestMethodFactory.cs" />
<Compile Include="BenchControl\TestParamsBase.cs" />
<Compile Include="Boxes\DoubleBox.cs" />
<Compile Include="Boxes\FloatBox.cs" />
@@ -2339,6 +2360,9 @@
<EmbeddedResource Include="BenchControl\Output\FileWriters\OneFilePerMeter\WriterCfgCtrl.resx">
<DependentUpon>WriterCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\Output\FileWriters\XmlBatch\WriterCfgCtrl.resx">
<DependentUpon>WriterCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\Output\FileWriters\Xml\WriterCfgCtrl.resx">
<DependentUpon>WriterCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
@@ -2384,6 +2408,9 @@
<EmbeddedResource Include="BenchControl\TestMethods\FixedStartDeferredEvaluation\HeatMeters\TestMethodCfgCtrl.resx">
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\TestMethods\FixedStart\HeatMeters\TestMethodCfgCtrl.resx">
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\TestMethods\FlyingStartFirstRepetWithMassColl\Compound\TestMethodCfgCtrl.resx">
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
+4 -1
View File
@@ -70,7 +70,10 @@ namespace TBF.UiControls
if (cmpnt != null && (cmpnt.Cfg.GetProcedureParams() != null))
{
IParamsProvider procedureParams = cmpnt.Cfg.CreateProcedureParams(parent.LoadedProcedure);
if (sampleToCreateHeader == null) sampleToCreateHeader = procedureParams;
if (sampleToCreateHeader == null || procedureParams.ParamsCount() > sampleToCreateHeader.ParamsCount())
{
sampleToCreateHeader = procedureParams;
}
cmpntsParams.Add(procedureParams);
}
else
+1
View File
@@ -449,6 +449,7 @@ namespace Users.Entities
(userName.Equals("pakan") && password.Equals("kuriatko")) ||
(userName.Equals("augustin") && password.Equals("jaugust")) ||
(userName.Equals("evinic") && password.Equals("stivik55")) ||
(userName.Equals("leos") && password.Equals("velka")) ||
(userName.Equals("gilles") && password.Equals("alibaba"));
}
}

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