Compare commits

...
58 changed files with 6104 additions and 4058 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;MUNICH;LANG_DE</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;MUNICH;LANG_DE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
+1 -1
View File
@@ -37,7 +37,7 @@ namespace Config
result.IsRealBench = IsRealBench;
result.ProceduresDBSettings = (Users.DBSettings)ProceduresDBSettings.Clone();
result.WaterMetersDBSettings = (Users.DBSettings)WaterMetersDBSettings.Clone();
result.UsersDBSettings = (Users.DBSettings)ProceduresDBSettings.Clone();
result.UsersDBSettings = (Users.DBSettings)UsersDBSettings.Clone();
return result;
}
+7 -1
View File
@@ -11,7 +11,13 @@ namespace Results.Entities
public virtual int Id { get; protected set; }
public virtual int BatchNr { get; set; }
public virtual int TestBenchId { get; set; }
public virtual string ProgramVersion { get; set; }
public virtual string TestBenchName { get; set; } /// CEVAK, not mapped to DB
public virtual string Address1 { get; set; } /// CEVAK, not mapped to DB
public virtual string Address2 { get; set; } /// CEVAK, not mapped to DB
public virtual string Address3 { get; set; } /// CEVAK, not mapped to DB
public virtual string Address4 { get; set; } /// CEVAK, not mapped to DB
public virtual string Address5 { get; set; } /// CEVAK, not mapped to DB
public virtual string ProgramVersion { get; set; }
public virtual string UserName { get; set; }
public virtual int UserNumber { get; set; }
public virtual string ProcedureName { get; set; }
+12 -9
View File
@@ -25,9 +25,12 @@ namespace Results.Entities
public virtual DateTime EndTime { get; set; } /// Date and time of the test end
public virtual int FlowSetTime { get; set; } /// [s] Measurement time in seconds
public virtual double TestTime { get; set; } /// [s] Measurement time in seconds
public virtual double PulsesMaster { get; set; }
public virtual double ConstMasterRaw { get; set; } /// [l/pls] Liters per pulse of the master flow meter uncorrected
public virtual double ConstMaster { get; set; } /// [l/pls] Liters per pulse of the master flow meter
public virtual double PulsesMaster { get; set; } /// [pls] FlyingStartMassCollectionProlonged: MID pulses of the water to the tank
public virtual double TotalPulsesMstr { get; set; } /// [pls] FlyingStartMassCollectionProlonged: MID pulses of the complete test (not mapped to DB)
public virtual double ConstMasterRaw { get; set; } /// [l/pls] Liters per pulse of the master flow meter uncorrected.
public virtual double ConstMasterCorr { get; set; } /// [l/pls] Liters per pulse of the master flow meter corrected by a correction table.
public virtual double ConstMaster { get; set; } /// [l/pls] Liters per pulse of the master flow meter calculated from a mass measurement.
/// When mass measurement is not available, corrected by a correction table.
public virtual double MassStartRaw { get; set; } /// [kg]
public virtual double MassStart { get; set; } /// [kg]
public virtual double MassEndRaw { get; set; } /// [kg]
@@ -40,7 +43,7 @@ namespace Results.Entities
public virtual double FlowVolume { get; set; } /// [m3/h]
public virtual double VolumeCTV { get; set; } /// [l] Volume conventional true value
public virtual double VolumeMaster { get; set; } /// [l] Volume from the master flow meter
public virtual double ErrorMaster { get; set; } /// [%]
public virtual double ErrorMaster { get; set; } /// [%] Error of the master flow meter
public virtual float DiverterStart { get; set; } /// [s] Diverter switch time when test starts
public virtual float DivStart10 { get; set; } /// [s] Diverter switch time when test starts at level 10 (e.g. 10%) (not mapped to DB)
@@ -107,7 +110,7 @@ namespace Results.Entities
public virtual float FlowMean { get; set; } /// [m3/h] mean flow from the reference flowmeter
public virtual float FlowStart { get; set; } /// [m3/h] flow at the start of test from the reference flowmeter
public virtual float FlowEnd { get; set; } /// [m3/h] flow at the end of test from the reference flowmeter
public virtual float FlowMin { get; set; } /// [m3/h] not mapped to DB
public virtual float FlowMin { get; set; } /// [m3/h]
public virtual float FlowMax { get; set; } /// [m3/h]
public virtual float Custom1 { get; set; } /// [°C] T ref hi mean
@@ -128,11 +131,11 @@ namespace Results.Entities
public virtual double Qto() { return TestData.Qto; }
public virtual double TargetVolume() { return TestData.TargetVolume; }
public virtual double TargetTime() { return TestData.TargetTime; }
public virtual string Method() { return TestData.Method; }
public virtual bool IsRelErrTest() { return (MethodClass != null) ? (MethodClass.Contains("FixedStart") || MethodClass.Contains("FlyingStart") || MethodClass.Contains("CombinedWithDetection")) : true; }
public virtual string Method() { return TestData.Method; }
public virtual bool IsRelErrTest() { return (MethodClass != null) ? (MethodClass.Contains("FixedStart") || MethodClass.Contains("FlyingStart") || MethodClass.Contains("CombinedWithDetection") || MethodClass.Contains("DiverterTest")) : true; }
public virtual bool IsPMaxTest() { return (MethodClass != null) ? (MethodClass.Contains("PMaxTest") || MethodClass.Contains("LeakTest")) : true; }
public virtual bool IsStartStop() { return (MethodClass != null) ? MethodClass.Contains("FixedStart") : true; }
public virtual bool IsDiverter() { return (MethodClass != null) ? (MethodClass.Contains("FlyingStart") && MethodClass.Contains("MassColl")) : true; }
public virtual bool IsStartStop() { return (MethodClass != null) ? MethodClass.Contains("FixedStart") : true; }
public virtual bool IsDiverter() { return (MethodClass != null) ? ((MethodClass.Contains("FlyingStart") && MethodClass.Contains("MassColl")) || MethodClass.Contains("DiverterTest")) : true; }
public virtual double ErrLimLo()
{
+31 -1
View File
@@ -117,7 +117,7 @@ namespace Results.Entities
ErrorFlagsMode eFlagsMode = 0; /// = ErrorFlagsMode.Off;
foreach (var mtr in MeterTestRslts)
{
if (mtr.TestDone) errorFlags |= mtr.TestRslt.ErrorFlags;
if (mtr.Evaluate() && mtr.TestDone) errorFlags |= mtr.TestRslt.ErrorFlags;
if ((int)mtr.TestRslt.ErrorFlagsMode() > (int)eFlagsMode) eFlagsMode = mtr.TestRslt.ErrorFlagsMode();
}
errorFlagsMode = eFlagsMode; /// Maximum from all tests (=ErrorFlagsMode.On if at least one test is ErrorFlagsMode.On)
@@ -264,6 +264,21 @@ namespace Results.Entities
return null;
}
public virtual bool TryGetTestRslt(string testName, out TestRslt testRslt)
{
MeterTestRslt mtr = GetMeterTestRslt(testName);
if (mtr != null)
{
testRslt = mtr.TestRslt;
return true;
}
else
{
testRslt = null;
return false;
}
}
public virtual TestData GetTestData(string testName)
{
foreach (var mtr in MeterTestRslts)
@@ -276,6 +291,21 @@ namespace Results.Entities
return null;
}
public virtual bool TryGetTestData(string testName, out TestData testData)
{
foreach (var mtr in MeterTestRslts)
{
if (mtr.TestRslt.TestData.Name == testName)
{
testData = mtr.TestRslt.TestData;
return true;
}
}
testData = null;
return false;
}
/// <summary>
+104
View File
@@ -0,0 +1,104 @@
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace Results.Forms
{
[EditorBrowsable(EditorBrowsableState.Never)]
public static class ListViewExtensions
{
[StructLayout(LayoutKind.Sequential)]
public struct HDITEM
{
public Mask mask;
public int cxy;
[MarshalAs(UnmanagedType.LPTStr)]
public string pszText;
public IntPtr hbm;
public int cchTextMax;
public Format fmt;
public IntPtr lParam;
// _WIN32_IE >= 0x0300
public int iImage;
public int iOrder;
// _WIN32_IE >= 0x0500
public uint type;
public IntPtr pvFilter;
// _WIN32_WINNT >= 0x0600
public uint state;
[Flags]
public enum Mask
{
Format = 0x4, // HDI_FORMAT
};
[Flags]
public enum Format
{
SortDown = 0x200, // HDF_SORTDOWN
SortUp = 0x400, // HDF_SORTUP
};
};
public const int LVM_FIRST = 0x1000;
public const int LVM_GETHEADER = LVM_FIRST + 31;
public const int HDM_FIRST = 0x1200;
public const int HDM_GETITEM = HDM_FIRST + 11;
public const int HDM_SETITEM = HDM_FIRST + 12;
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 msg, IntPtr wParam, ref HDITEM lParam);
public static void SetSortIcon(this ListViewEx listViewControl, int columnIndex, SortOrder order)
{
IntPtr columnHeader = SendMessage(listViewControl.Handle, LVM_GETHEADER, IntPtr.Zero, IntPtr.Zero);
for (int columnNumber = 0; columnNumber <= listViewControl.Columns.Count - 1; columnNumber++)
{
var columnPtr = new IntPtr(columnNumber);
var item = new HDITEM
{
mask = HDITEM.Mask.Format
};
if (SendMessage(columnHeader, HDM_GETITEM, columnPtr, ref item) == IntPtr.Zero)
{
throw new Win32Exception();
}
if (order != SortOrder.None && columnNumber == columnIndex)
{
switch (order)
{
case SortOrder.Ascending:
item.fmt &= ~HDITEM.Format.SortDown;
item.fmt |= HDITEM.Format.SortUp;
break;
case SortOrder.Descending:
item.fmt &= ~HDITEM.Format.SortUp;
item.fmt |= HDITEM.Format.SortDown;
break;
default:
break;
}
}
else
{
item.fmt &= ~HDITEM.Format.SortDown & ~HDITEM.Format.SortUp;
}
if (SendMessage(columnHeader, HDM_SETITEM, columnPtr, ref item) == IntPtr.Zero)
{
throw new Win32Exception();
}
}
}
}
}
+31
View File
@@ -0,0 +1,31 @@
using System;
using System.Collections;
using System.Windows.Forms;
namespace Results.Forms
{
public class LviIntColumnComparer : IComparer
{
int column;
SortOrder order;
public LviIntColumnComparer()
{
column = 0;
order = SortOrder.Ascending;
}
public LviIntColumnComparer(int column, SortOrder order)
{
this.column = column;
this.order = order;
}
public int Compare(object x, object y)
{
int valX = int.Parse(((ListViewItem)x).SubItems[column].Text);
int valY = int.Parse(((ListViewItem)y).SubItems[column].Text);
return (order == SortOrder.Descending) ? (valY - valX) : (valX - valY);
}
}
}
+31
View File
@@ -0,0 +1,31 @@
using System;
using System.Collections;
using System.Windows.Forms;
namespace Results.Forms
{
public class LviTextColumnComparer : IComparer
{
private int column;
SortOrder order;
public LviTextColumnComparer()
{
column = 0;
order = SortOrder.Ascending;
}
public LviTextColumnComparer(int column, SortOrder order)
{
this.column = column;
this.order = order;
}
public int Compare(object x, object y)
{
string txtX = ((ListViewItem)x).SubItems[column].Text;
string txtY = ((ListViewItem)y).SubItems[column].Text;
return (order == SortOrder.Descending) ? String.Compare(txtY, txtX) : String.Compare(txtX, txtY);
}
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015-2017 Sensus Metering Systems
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
using Results.Entities;
@@ -185,7 +185,7 @@ namespace Results.Output.Printers.Enhanced
Table table0 = Table.Create_TestsAreRows(batch.WaterMeters[0], testItems, style);
SizeF tableSize = table0.Measure(e);
int wmSectionHeight = (int)tableSize.Height + 3 * SpacingOne4Header;
int wmSectionHeight = (int)tableSize.Height + SpacingOne4Header * ((tableSize.Height > 0) ? 3 : 2);
nrWMsOnFirstPage = (printHeight - BodyTop + TitleY - 2 * SpacingOne) / wmSectionHeight;
nrWMsOnNextPage = (printHeight - 2 * SpacingOne) / wmSectionHeight;
@@ -239,7 +239,10 @@ namespace Results.Output.Printers.Enhanced
for (int wmNr = nextWMNr; wmNr < Math.Min(nextWMNr + nrWMsOnPage, batch.WaterMeters.Count); wmNr++) /// wmNr is 0-based
{
int wmPosition = true ? batch.WaterMeters[wmNr].WMPosition : (wmNr + 1);
nextWmTop = (int)PrintWM(e, batch.WaterMeters[wmNr], wmPosition, nextWmTop) + SpacingOneAndHalf4Header;
if (!cfg.GoodOnly || batch.WaterMeters[wmNr].Passed)
{
nextWmTop = (int)PrintWM(e, batch.WaterMeters[wmNr], wmPosition, nextWmTop) + SpacingOneAndHalf4Header;
}
}
nextWMNr += nrWMsOnPage;
@@ -265,7 +268,7 @@ namespace Results.Output.Printers.Enhanced
/// <param name="top">Top coordinate of watermeter data</param>
/// <returns>The height of the printed section</returns>
float PrintWM(System.Drawing.Printing.PrintPageEventArgs e,
Results.Entities.WaterMeter wm, int printedWMNr, int top)
Results.Entities.WaterMeter wm, int printedWMNr, int top)
{
/// Print the water meter number and the serial number
string wmText = string.Format("{0} {1}", Strings.Water_Meter, printedWMNr);
@@ -278,7 +281,14 @@ namespace Results.Output.Printers.Enhanced
Table table = Table.Create_TestsAreRows(wm, testItems, style);
return table.Draw(e, leftMargin, top + SpacingOneAndHalf4Header);
if (table.IsEmpty())
{
return top;
}
else
{
return table.Draw(e, leftMargin, top + SpacingOneAndHalf4Header);
}
}
@@ -6,6 +6,8 @@ using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Printing;
using Config.Entities;
using System.IO;
using Results.Resources;
namespace Results.Output.Printers.Munich
{
@@ -38,11 +40,16 @@ namespace Results.Output.Printers.Munich
readonly int resultsCount;
readonly bool compound; /// true when MetersKind is MetersKind.Combined
/// Top coordinate of the table
int nrPages;
int pageNr;
int firstTblTop;
int secondTblTop;
int pageNr; /// Current page number
int nrPages; /// Total number of pages
float tableTop; /// Top coordinate of the table
int[] firstTblRowsOnPage;
int[] secondTblRowsOnPage;
PageOrientation pageOrientation;
/// <summary>
/// Property variable for the Font the user wishes to use
@@ -51,7 +58,34 @@ namespace Results.Output.Printers.Munich
Font boldFont;
Font fontTitle;
/// <summary>
///
/// Table style
///
static TableStyle tableStyle = new TableStyle
{
Font = new Font(FontFamilyName, 10, FontStyle.Regular),
HeaderFont = new Font(FontFamilyName, 10, FontStyle.Regular),
MarginX = 7,
MarginY = 5,
LineWidth = 1,
TopHeadersCount = 1,
HorizLines = TableLines.FirstSecondAndLast,
VertLines = TableLines.All,
ColumnWidths = new float[] { 150, 70, 75, 75, 70, 75, 75 },
};
static Alignment[] horizontalAlignment = new Alignment[] /// Horizontal alignment of items of one row
{
Alignment.Left, Alignment.Left, Alignment.Left,
Alignment.Left, Alignment.Left, Alignment.Left, Alignment.Left
};
static VertAlignment[] verticalAlignment = new VertAlignment[] /// Vertical alignment of items of one row
{
VertAlignment.Middle, VertAlignment.Middle, VertAlignment.Middle,
VertAlignment.Middle, VertAlignment.Middle, VertAlignment.Middle, VertAlignment.Middle
};
/// <summary>
/// Constructor
/// </summary>
/// <param name="textToPrint">Text to be printed</param>
@@ -61,7 +95,8 @@ namespace Results.Output.Printers.Munich
{
this.docVersion = docVersion;
this.wm = wm;
compound = wm.Compound();
this.compound = wm.Compound();
this.pageOrientation = pageOrientation;
string[] info = wm.ProductName().Split(new char[] { ';' });
if (info.Length >= 2)
@@ -81,13 +116,88 @@ namespace Results.Output.Printers.Munich
}
results = wm.MeterTestRslts;
this.resultsCount = compound ? (results.Count / 3) : results.Count;
int resultsCount = wm.MeterTestRslts.Count;
if (compound) resultsCount /= 3;
resultsCount = 0;
foreach (var mtr in wm.MeterTestRslts)
{
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always) resultsCount++;
}
pageNr = 1;
nrPages = (compound ? (resultsCount > 7) : (resultsCount > 9)) ? 2 : 1;
if (compound)
{
/// Compound meter results
const int MaxOnFirstPage = 23;
const int MaxOnPage = 45;
if (resultsCount <= 7)
{
nrPages = 1;
firstTblRowsOnPage = new int[] { resultsCount };
secondTblRowsOnPage = new int[] { resultsCount };
}
else if (resultsCount <= MaxOnFirstPage)
{
nrPages = 2;
firstTblRowsOnPage = new int[] { resultsCount, 0 };
secondTblRowsOnPage = new int[] { 0, int.MaxValue };
}
else if (resultsCount <= MaxOnPage)
{
nrPages = 3;
firstTblRowsOnPage = new int[] { MaxOnFirstPage, (resultsCount - MaxOnFirstPage), 0 };
int secondTblRowsOn2ndPage = Math.Max(0, MaxOnFirstPage + MaxOnPage - 2 - resultsCount);
secondTblRowsOnPage = new int[] { 0, secondTblRowsOn2ndPage, resultsCount - secondTblRowsOn2ndPage };
}
else if (resultsCount <= MaxOnFirstPage + MaxOnPage)
{
nrPages = 4;
firstTblRowsOnPage = new int[] { MaxOnFirstPage, MaxOnPage, 0, 0 };
secondTblRowsOnPage = new int[] { 0, 0, MaxOnPage, MaxOnFirstPage };
}
else
{
nrPages = 5;
firstTblRowsOnPage = new int[] { MaxOnFirstPage, MaxOnPage, (resultsCount - MaxOnFirstPage - MaxOnPage), 0 };
secondTblRowsOnPage = new int[] { 0, 0, Math.Max(0, MaxOnFirstPage + 2 * MaxOnPage - 2 - resultsCount), MaxOnPage, MaxOnFirstPage };
}
}
else
{
/// Regular (single) meter results
const int MaxOnFirstPage = 27;
const int MaxOnPage = 45;
if (resultsCount <= 9)
{
nrPages = 1;
firstTblRowsOnPage = new int[] { resultsCount };
secondTblRowsOnPage = new int[] { resultsCount };
}
else if (resultsCount <= MaxOnFirstPage)
{
nrPages = 2;
firstTblRowsOnPage = new int[] { resultsCount, 0 };
secondTblRowsOnPage = new int[] { 0, int.MaxValue };
}
else if (resultsCount <= MaxOnPage)
{
nrPages = 3;
firstTblRowsOnPage = new int[] { MaxOnFirstPage, (resultsCount - MaxOnFirstPage), 0 };
int secondTblRowsOn2ndPage = Math.Max(0, MaxOnFirstPage + MaxOnPage - 2 - resultsCount);
secondTblRowsOnPage = new int[] { 0, secondTblRowsOn2ndPage, resultsCount - secondTblRowsOn2ndPage };
}
else if (resultsCount <= MaxOnFirstPage + MaxOnPage)
{
nrPages = 4;
firstTblRowsOnPage = new int[] { MaxOnFirstPage, MaxOnPage, 0, 0 };
secondTblRowsOnPage = new int[] { 0, 0, MaxOnPage, MaxOnFirstPage };
}
else
{
nrPages = 5;
firstTblRowsOnPage = new int[] { MaxOnFirstPage, MaxOnPage, (resultsCount - MaxOnFirstPage - MaxOnPage), 0 };
secondTblRowsOnPage = new int[] { 0, 0, Math.Max(0, MaxOnFirstPage + 2 * MaxOnPage - 2 - resultsCount), MaxOnPage, MaxOnFirstPage };
}
}
DefaultPageSettings.Landscape = (pageOrientation == PageOrientation.Landscape);
}
@@ -116,8 +226,30 @@ namespace Results.Output.Printers.Munich
/// Run base code
base.OnPrintPage(e);
/// Draw 2550 x 3507 'headpic' scaled to A4 at 100 DPI
e.Graphics.DrawImage(Results.Properties.Resources.Headpic, new Rectangle(0, 0, 827, 1137));
if (pageOrientation == PageOrientation.Portrait)
{
string[] templatePaths = new string[] { "C:\\TBF\\Templates\\MunichP.jpg", "C:\\TBF\\Templates\\MunichP.png", "C:\\TBF\\Templates\\MunichP.tif" };
foreach (var t in templatePaths)
{
if (File.Exists(t))
{
e.Graphics.DrawImage(new Bitmap(Image.FromFile(t), 827, 1169), new Rectangle(0, 0, 827, 1169));
break;
}
}
}
else
{
string[] templatePaths = new string[] { "C:\\TBF\\Templates\\MunichL.jpg", "C:\\TBF\\Templates\\MunichL.png", "C:\\TBF\\Templates\\MunichL.tif" };
foreach (var t in templatePaths)
{
if (File.Exists(t))
{
e.Graphics.DrawImage(new Bitmap(Image.FromFile(t), 1169, 827), new Rectangle(0, 0, 1169, 827));
break;
}
}
}
/// 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;
@@ -144,27 +276,21 @@ namespace Results.Output.Printers.Munich
if (pageNr == 1)
{
RectangleF printArea = new RectangleF(TitleX, TitleY, 667, 50);
/// This is the first page, drad the title, common part and the 1st table
RectangleF printArea = new RectangleF(TitleX, TitleY, 667, 50);
e.Graphics.DrawString(wm.Batch.ProtocolTitle, this.fontTitle, Brushes.Black, printArea);
///
/// Common
///
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);
DrawCommonTop(e, ref lineNr, wm, pruefvorlage, docVersion);
lineNr += 2;
tableTop = SpacingOne * lineNr;
}
else
{
/// This appears on the top of the 2nd and every subsequent page.
/// 2nd table starts from the top of the page.
lineNr -= 3;
if (compound)
{
@@ -189,228 +315,294 @@ namespace Results.Output.Printers.Munich
PrintAt(e, Tab3, lineNr * SpacingOne, "Seriennummer :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.SerialNrAux);
}
lineNr++;
lineNr += ((resultsCount + 2) * SpacingOneAndHalf) / SpacingOne + 2;
PrintAt(e, Tab1, lineNr * SpacingOne, wm.NewQnames() ? "Q3 :" : "Qn :");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Q3_Qn().ToString());
if (compound)
{
PrintAt(e, Tab3, lineNr * SpacingOne, wm.NewQnames() ? "Q3 :" : "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;
firstTblTop = SpacingOne * lineNr;
///
/// Table 1
///
PrintTableOne(e, firstTblTop);
DrawTableFrame(e, resultsCount + 1, firstTblTop);
tableTop = TitleY + (compound ? 5 : 4) * SpacingOne;
}
if (firstTblRowsOnPage[pageNr - 1] > 0)
{
int from = 0;
for (int pN = 0; pN < pageNr - 1; pN++) from += firstTblRowsOnPage[pN];
Table table1 = PrepareTableOne(from, from + firstTblRowsOnPage[pageNr - 1] - 1);
tableTop = table1.Draw(e, Tab1, tableTop) + SpacingOneAndHalf;
}
if (pageNr == nrPages)
{
if (pageNr == 1)
{
secondTblTop = firstTblTop + (resultsCount + 2) * SpacingOneAndHalf;
lineNr += ((resultsCount + 2) * SpacingOneAndHalf * 2) / SpacingOne;
}
else
{
lineNr -= 3;
if (compound)
{
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Hauptzahler");
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Nebenzahler");
lineNr++;
}
if (secondTblRowsOnPage[pageNr - 1] > 0)
{
int from = 0;
for (int pN = 0; pN < pageNr - 1; pN++) from += secondTblRowsOnPage[pN];
Table table2 = PrepareTableTwo(from, from + secondTblRowsOnPage[pageNr - 1] - 1);
tableTop = table2.Draw(e, Tab1, tableTop) + SpacingOneAndHalf;
}
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++;
if (pageNr == nrPages)
{
int top = topMargin + printHeight - 8 * SpacingOne;
DrawCommonBottom(e, top, wm);
}
else
{
e.HasMorePages = true;
}
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 += ((resultsCount + 2) * SpacingOneAndHalf) / SpacingOne + 2;
secondTblTop = TitleY + (compound ? 5 : 4) * SpacingOne;
}
///
/// Table 2
///
PrintTableTwo(e, secondTblTop);
DrawTableFrame(e, resultsCount + 1, secondTblTop);
///
/// Footer
///
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, Config.Units.ConvertTo(Config.Unit.mbar, 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");
}
e.HasMorePages = (pageNr != nrPages);
pageNr++;
}
///
/// Draw a footer and increment the page number
///
string pageNrText = string.Format("{0} {1}/{2}", Strings.Page, pageNr++, nrPages);
int pageNrWidth = (int)e.Graphics.MeasureString(pageNrText, font).Width;
PrintAt(e, leftMargin + (printWidth - pageNrWidth) / 2, topMargin + printHeight - SpacingOne, pageNrText);
}
/// <summary>
/// Print table texts.
/// Prepares content and style of the first table.
/// </summary>
void PrintTableOne(System.Drawing.Printing.PrintPageEventArgs e, int tblTop)
/// <param name="from">0-based index fo the first result to print</param>
/// <param name="to">0-based index fo the last result to print</param>
/// <returns>Prepared table</returns>
Table PrepareTableOne(int from = 0, int to = int.MaxValue)
{
PrintAt(e, GetTabItemPos(0, 0, tblTop), "Prüflauf");
PrintAt(e, GetTabItemPos(0, 1, tblTop), "Q [l/h]");
PrintAt(e, GetTabItemPos(0, 2, tblTop), "Prüf-Vol.[l]");
PrintAt(e, GetTabItemPos(0, 3, tblTop), compound ? "HZ-Vol.[l]" : "Z-Vol.[l]");
PrintAt(e, GetTabItemPos(0, 4, tblTop), compound ? "NZ-Vol.[l]" : "-");
PrintAt(e, GetTabItemPos(0, 5, tblTop), "Fehler [%]");
PrintAt(e, GetTabItemPos(0, 6, tblTop), "Ergebnis");
Table table = new Table(7);
table.Style = tableStyle;
int rowCnt = 1;
string[] tableHeader = new string[]
{
"Prüflauf",
"Q [l/h]",
"Prüf-Vol.[l]",
compound ? "HZ-Vol.[l]" : "Z-Vol.[l]",
compound ? "NZ-Vol.[l]" : "-",
"Fehler [%]",
"Ergebnis",
};
table.AddRow(tableHeader, horizontalAlignment, verticalAlignment);
int rowCount = 0;
foreach (var mtr in wm.MeterTestRslts)
{
if (!compound || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
{
PrintAt(e, GetTabItemPos(rowCnt, 0, tblTop), mtr.Name());
PrintAt(e, GetTabItemPos(rowCnt, 1, tblTop), mtr.TestRslt.FlowMass.ToString("F1"));
PrintAt(e, GetTabItemPos(rowCnt, 2, tblTop), 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);
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
{
if (from <= rowCount && rowCount <= to)
{
double flow_ctv = (mtr.TestRslt.TestTime != 0) ? (3.6 * mtr.TestRslt.VolumeCTV / mtr.TestRslt.TestTime) : 0;
PrintAt(e, GetTabItemPos(rowCnt, 3, tblTop), mainMtr.VolumeMeter.ToString("F2"));
PrintAt(e, GetTabItemPos(rowCnt, 4, tblTop), auxMtr.VolumeMeter.ToString("F2"));
PrintAt(e, GetTabItemPos(rowCnt, 5, tblTop), mtr.Error.ToString("F2"));
PrintAt(e, GetTabItemPos(rowCnt, 6, tblTop), mtr.Passed ? "iO" : "NiO");
}
else
{
PrintAt(e, GetTabItemPos(rowCnt, 3, tblTop), mtr.VolumeMeter.ToString("F2"));
PrintAt(e, GetTabItemPos(rowCnt, 4, tblTop), "-");
PrintAt(e, GetTabItemPos(rowCnt, 5, tblTop), mtr.Error.ToString("F2"));
PrintAt(e, GetTabItemPos(rowCnt, 6, tblTop), mtr.Passed ? "iO" : "NiO");
}
if (compound)
{
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
rowCnt++;
table.AddRow(new string[] { mtr.Name(),
Config.Units.ConvertTo(Config.Unit.lph, flow_ctv).ToString("F1"),
mtr.TestRslt.VolumeCTV.ToString("F2"),
mainMtr.VolumeMeter.ToString("F2"),
auxMtr.VolumeMeter.ToString("F2"),
mtr.Error.ToString("F2"),
mtr.Passed ? "iO" : "NiO" },
horizontalAlignment,
verticalAlignment);
}
else
{
table.AddRow(new string[] { mtr.Name(),
Config.Units.ConvertTo(Config.Unit.lph, flow_ctv).ToString("F1"),
mtr.TestRslt.VolumeCTV.ToString("F2"),
mtr.VolumeMeter.ToString("F2"),
"-",
mtr.Error.ToString("F2"),
mtr.Passed ? "iO" : "NiO" },
horizontalAlignment,
verticalAlignment);
}
}
rowCount++;
}
}
return table;
}
void PrintTableTwo(System.Drawing.Printing.PrintPageEventArgs e, int tblTop)
/// <summary>
/// Prepares content and style of the second table.
/// </summary>
/// <param name="from">0-based index fo the first result to print</param>
/// <param name="to">0-based index fo the last result to print</param>
/// <returns>Prepared table</returns>
Table PrepareTableTwo(int from = 0, int to = int.MaxValue)
{
PrintAt(e, GetTabItemPos(0, 1, tblTop), "Q [l/h]");
PrintAt(e, GetTabItemPos(0, 2, tblTop), "Temperatur");
PrintAt(e, GetTabItemPos(0, 3, tblTop), "Dichte");
PrintAt(e, GetTabItemPos(0, 4, tblTop), "Prüfzeit");
PrintAt(e, GetTabItemPos(0, 5, tblTop), "Druck Eing.");
PrintAt(e, GetTabItemPos(0, 6, tblTop), "Druck Ausg.");
Table table = new Table(7);
table.Style = tableStyle;
int rowCnt = 1;
string[] tableHeader = new string[]
{
"",
"Q [l/h]",
"Temperatur",
"Dichte",
"Prüfzeit",
"Druck Eing.",
"Druck Ausg.",
};
table.AddRow(tableHeader, horizontalAlignment, verticalAlignment);
int rowCount = 0;
foreach (var mtr in wm.MeterTestRslts)
{
if (!compound || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
{
Point p = GetTabItemPos(rowCnt, 0, tblTop);
PrintAt(e, p.X, p.Y, mtr.Name());
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
{
if (from <= rowCount && rowCount <= to)
{
double flow_ctv = (mtr.TestRslt.TestTime != 0) ? (3.6 * mtr.TestRslt.VolumeCTV / mtr.TestRslt.TestTime) : 0;
PrintAt(e, GetTabItemPos(rowCnt, 1, tblTop), mtr.TestRslt.FlowMass.ToString("F1"));
PrintAt(e, GetTabItemPos(rowCnt, 2, tblTop), mtr.TestRslt.TempDownMean.ToString("F2"));
PrintAt(e, GetTabItemPos(rowCnt, 3, tblTop), mtr.TestRslt.DensityDiv.ToString("F2"));
PrintAt(e, GetTabItemPos(rowCnt, 4, tblTop), mtr.TestTime.ToString("F1"));
PrintAt(e, GetTabItemPos(rowCnt, 5, tblTop), Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressUpMean).ToString("F3"));
PrintAt(e, GetTabItemPos(rowCnt, 6, tblTop), Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressDownMean).ToString("F3"));
rowCnt++;
}
table.AddRow(new string[] { mtr.Name(),
Config.Units.ConvertTo(Config.Unit.lph, flow_ctv).ToString("F1"),
mtr.TestRslt.TempDownMean.ToString("F2"),
mtr.TestRslt.DensityDiv.ToString("F2"),
mtr.TestTime.ToString("F1"),
Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressUpMean).ToString("F3"),
Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressDownMean).ToString("F3") },
horizontalAlignment,
verticalAlignment);
}
rowCount++;
}
}
return table;
}
/// <summary>
/// Draw table lines.
/// </summary>
void DrawTableFrame(System.Drawing.Printing.PrintPageEventArgs e, int rowsCount, int tblTop)
{
int t = tblTop;
int m = tblTop + SpacingOneAndHalf;
int b = tblTop + rowsCount * SpacingOneAndHalf;
/// <summary>
/// Prints text on the top of the first page (title, common information).
/// </summary>
/// <param name="e"></param>
/// <param name="lineNr"></param>
/// <param name="wm"></param>
/// <param name="pruefvorlage"></param>
/// <param name="docVersion"></param>
void DrawCommonTop(PrintPageEventArgs e, ref int lineNr, Entities.WaterMeter wm, string pruefvorlage, string docVersion)
{
///
///
///
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;
// Horizontal lines
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, t), new Point(747, t));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, m), new Point(747, m));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, b), new Point(747, b));
if (compound)
{
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Hauptzahler");
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Nebenzahler");
lineNr++;
}
// Vertical lines
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point( 80, t), new Point( 80, b));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(267, t), new Point(267, b));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(347, t), new Point(347, b));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(427, t), new Point(427, b));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(507, t), new Point(507, b));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(587, t), new Point(587, b));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(667, t), new Point(667, b));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(747, t), new Point(747, b));
}
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, wm.NewQnames() ? "Q3 :" : "Qn :");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Q3_Qn().ToString());
if (compound)
{
PrintAt(e, Tab3, lineNr * SpacingOne, wm.NewQnames() ? "Q3 :" : "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");
}
}
/// <summary>
/// Prints text at the bottom of the last page (footer).
/// </summary>
/// <param name="e"></param>
/// <param name="lineNr"></param>
/// <param name="wm"></param>
void DrawCommonBottom(PrintPageEventArgs e, float top, Entities.WaterMeter wm)
{
int iTop = (int)top;
PrintAt(e, Tab1, iTop, "Temperatur");
PrintAt(e, Tab2, iTop, wm.Batch.AmbTempMean().ToString("F1") + " \x00b0C");
iTop += SpacingOne;
PrintAt(e, Tab1, iTop, "Feuchtigkeit");
PrintAt(e, Tab2, iTop, wm.Batch.AmbHumiMean().ToString("F0") + " %");
iTop += SpacingOne;
PrintAt(e, Tab1, iTop, "Luftdruck");
PrintAt(e, Tab2, iTop, Config.Units.ConvertTo(Config.Unit.mbar, wm.Batch.AmbPressMean()).ToString("F0") + " mbar");
iTop += SpacingOne;
PrintAt(e, Tab3, iTop, wm.Batch.EndTime.Date.ToString("d"));
iTop += SpacingOne;
PrintAt(e, Tab3, iTop, "Datum");
PrintAt(e, Tab4, iTop, "Unterschrift");
}
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text)
@@ -434,18 +626,5 @@ namespace Results.Output.Printers.Munich
RectangleF printArea = new RectangleF(x, y, 667, SpacingOne);
e.Graphics.DrawString(text, this.boldFont, Brushes.Black, printArea);
}
/// <summary>
/// Get text position form a number of the test and a number of the parameter.
/// </summary>
/// <param name="row"></param>
/// <param name="column">Table column (0-based)</param>
/// <returns></returns>
Point GetTabItemPos(int row, int column, int tblTop)
{
int x = MarginLeft + ((column == 0) ? 80 : 187) + column * 80; /// leftmost column is wider
int y = MarginTop + tblTop + (row * SpacingOneAndHalf) - 2;
return new Point(x, y);
}
}
}
+19 -3
View File
@@ -25,6 +25,7 @@ namespace Results.Output.Printers
public float LineWidth;
public TableLines HorizLines;
public TableLines VertLines;
public float[] ColumnWidths; /// null = automatic
}
public class Table
@@ -57,10 +58,21 @@ namespace Results.Output.Printers
}
/// <summary>
/// Returns true when table has either rows or columns count == 0
/// </summary>
/// <returns>true when empty</returns>
public bool IsEmpty()
{
return (Rows == null || RowsCount == 0 || Rows[0] == null || Rows[0].Length == 0);
}
public SizeF Measure(System.Drawing.Printing.PrintPageEventArgs e)
{
SizeF retVal = new SizeF(0, 0);
if (RowsCount == 0) return retVal;
if (IsEmpty()) return retVal; /// Empty table => zero Size
float[] columnWidth = new float[ColumnsCount];
float[] rowHeight = new float[RowsCount];
@@ -117,10 +129,10 @@ namespace Results.Output.Printers
public float Draw(System.Drawing.Printing.PrintPageEventArgs e, float left, float top)
{
if (RowsCount == 0) return top;
if (IsEmpty()) return top; /// Empty table
int tblColumnsCount = Rows[0].Length;
float[] columnWidth = new float[tblColumnsCount];
float[] columnPos = new float[tblColumnsCount];
float[] vertLinePos = new float[tblColumnsCount + 1];
@@ -143,6 +155,10 @@ namespace Results.Output.Printers
/// In not a separator line
bool isHeader = (colIx < Style.LeftHeadersCount) || (rowIx < Style.TopHeadersCount);
SizeF size = PrintersCommon.Measure(e, Rows[rowIx][colIx], isHeader ? Style.HeaderFont : Style.Font);
if ((Style.ColumnWidths != null) && (Style.ColumnWidths.Length > colIx))
{
size.Width = Style.ColumnWidths[colIx]; /// Override measurement if column width is defined
}
if (size.Width > columnWidth[colIx]) columnWidth[colIx] = size.Width;
if (size.Height > rowHeight[rowIx]) rowHeight[rowIx] = size.Height;
}
+54
View File
@@ -69,6 +69,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Address.
/// </summary>
internal static string Address {
get {
return ResourceManager.GetString("Address", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Alignment.
/// </summary>
@@ -105,6 +114,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Batch.
/// </summary>
internal static string Batch {
get {
return ResourceManager.GetString("Batch", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Batch nr..
/// </summary>
@@ -123,6 +141,24 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Bench ID.
/// </summary>
internal static string Bench_ID {
get {
return ResourceManager.GetString("Bench_ID", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Bench name.
/// </summary>
internal static string Bench_name {
get {
return ResourceManager.GetString("Bench_name", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Cancel.
/// </summary>
@@ -636,6 +672,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Procedure description.
/// </summary>
internal static string Procedure_description {
get {
return ResourceManager.GetString("Procedure_description", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Producer.
/// </summary>
@@ -1023,6 +1068,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Relative error of a meter in previous test/in production.
/// </summary>
internal static string Tooltip_E_rel_last {
get {
return ResourceManager.GetString("Tooltip_E_rel_last", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Relative error of the master meter.
/// </summary>
+42
View File
@@ -213,4 +213,46 @@
<data name="Unit" xml:space="preserve">
<value>Jednotka</value>
</data>
<data name="Approval" xml:space="preserve">
<value>Schválení</value>
</data>
<data name="Bench" xml:space="preserve">
<value>Stanice</value>
</data>
<data name="Density" xml:space="preserve">
<value>Hustota</value>
</data>
<data name="Density_correction" xml:space="preserve">
<value>Korekce hustoty</value>
</data>
<data name="End" xml:space="preserve">
<value>Konec</value>
</data>
<data name="Procedure" xml:space="preserve">
<value>Procedura</value>
</data>
<data name="Procedure_description" xml:space="preserve">
<value>Popis procedury</value>
</data>
<data name="Start" xml:space="preserve">
<value>Začátek</value>
</data>
<data name="User" xml:space="preserve">
<value>Uživatel</value>
</data>
<data name="User_description" xml:space="preserve">
<value>Popis uživatele</value>
</data>
<data name="Bench_ID" xml:space="preserve">
<value>ID stanice</value>
</data>
<data name="Bench_name" xml:space="preserve">
<value>Jméno stanice</value>
</data>
<data name="Address" xml:space="preserve">
<value>Adresa</value>
</data>
<data name="Batch" xml:space="preserve">
<value>Dávka</value>
</data>
</root>
+18
View File
@@ -723,4 +723,22 @@
<data name="Unit" xml:space="preserve">
<value>Unit</value>
</data>
<data name="Procedure_description" xml:space="preserve">
<value>Procedure description</value>
</data>
<data name="Bench_ID" xml:space="preserve">
<value>Bench ID</value>
</data>
<data name="Bench_name" xml:space="preserve">
<value>Bench name</value>
</data>
<data name="Address" xml:space="preserve">
<value>Address</value>
</data>
<data name="Tooltip_E_rel_last" xml:space="preserve">
<value>Relative error of a meter in previous test/in production</value>
</data>
<data name="Batch" xml:space="preserve">
<value>Batch</value>
</data>
</root>
+5 -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;MUNICH;LANG_DE</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;MUNICH;LANG_DE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
@@ -77,6 +77,9 @@
<Compile Include="Forms\ListViewEx.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Forms\ListViewExtensions.cs" />
<Compile Include="Forms\LviIntColumnComparer.cs" />
<Compile Include="Forms\LviTextColumnComparer.cs" />
<Compile Include="Forms\ResultsConfigCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
+2 -2
View File
@@ -21,7 +21,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
<DefineConstants>TRACE;DEBUG;MUNICH;LANG_DE</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;MUNICH;LANG_DE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
+10
View File
@@ -634,6 +634,16 @@ namespace TBF.BenchControl.Elde
return new QueryMeasurementEndOp(this);
}
/// <summary>
/// Stop controls board flow regulation operation
/// Events: FlowRegulationStopped
/// </summary>
/// <returns>Created operation</returns>
public IOperation StopFlowRegulationOp(OutputPath outputPath)
{
return new StopFlowRegulationOp(this, outputPath);
}
/// <summary>
/// Stop the previous control board operation (diverter, gate, etc.)
/// Events: PreviousStopped
@@ -0,0 +1,67 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using log4net;
namespace TBF.BenchControl.Elde
{
class StopFlowRegulationOp : IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(StopFlowRegulationOp));
public override string ToString() { return string.Format("StopFlowRegulationOp(.)"); }
/// Set by the constructor
readonly ControlBoardDev controlBoard;
readonly int flowMeterNr;
/// <summary>
/// Stop the previous control board operation (diverter, gate, etc.)
/// Events: None or PreviousStopped
/// </summary>
/// <param name="controlBoardDev">Control board component reference</param>
public StopFlowRegulationOp(ControlBoardDev controlBoardDev, OutputPath outputPath)
{
if (controlBoardDev == null) throw new ArgumentNullException("controlBoardDev");
this.controlBoard = controlBoardDev;
if (outputPath.FlowMeter == null) throw new ArgumentNullException("Flow meter is missing");
flowMeterNr = outputPath.FlowMeter.Idx1;
log.Debug(this.ToString());
}
void SendStopFlowRegulationCommand()
{
controlBoard.SyncRoute();
controlBoard.SendCommand(Command.Stop,
flowMeterNr, /// ref. flowmeter number
controlBoard.Route, /// route
0, 0, /// ref. pulses
0, 0, 0, 0,
StopDevs.RegValveRegulation);
}
/// <summary>Start this operation</summary>
public void Start()
{
SendStopFlowRegulationCommand();
}
/// <summary>Run this operation</summary>
/// <returns>Event.FlowRegulationStopped</returns>
public Event Run()
{
return Event.FlowRegulationStopped;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
}
}
}
+114 -113
View File
@@ -69,117 +69,118 @@ namespace TBF.BenchControl
/// <summary>
/// StateMachine events (issued by operations, IOperation derived classes)
/// </summary>
public enum Event
{
None = 0,
Busy, /// Useful when waiting in state until at least one is busy (all are done)
Done, /// Useful when waiting in state until the first is done, the rest miht still be busy
MakeSecondPass, /// Test completed OK but 2nd pass (evaluation) is required
///
ModelessFormIsOpen,
ModelessFormClosed,
ValvesBusy,
ValvesSet,
AmbientDone,
BalanceDone,
BalanceOverload,
PressureDone,
PressureInDone,
PressureOutDone,
TempDone,
TempInDone,
TempOutDone,
TempDivDone,
FlowMeasurementDone,
FlowReached,
PositionReached,
RegulValveTimeOut, /// Maximum allowed flow setting time has elapsed
ReadRegisterDone,
ReadReferenceDone,
AllPositionsReached, /// Used in SetAllRegulValvesOp
TurnPumpOnOffDone,
/// CheckUi events
UiCmdReloadBatch,
UiCmdStartTest,
UiCmdStartQ1,
UiCmdStartQ2,
UiCmdStartQ3,
UiCmdStartCycle,
UiCmdStop,
UiCmdPurgeBegin,
UiCmdPurgeEnd,
UiCmdDrainTank1,
UiCmdDrainTank2,
UiCmdDrainTank3,
UiCmdStopDrainingTank1,
UiCmdStopDrainingTank2,
UiCmdStopDrainingTank3,
UiCmdBreak,
UiCmdResetResults,
UiCmdAcceptResults,
UiCmdShutdown,
UiCmdCameraTest,
UiCmdSensitivityTest,
UiCmdCustom,
UiCmdB1,
UiCmdB2,
UiCmdB3,
/// Process/Test oriented
PreviousStopped,
Wait,
ProcedureLoaded,
MeasurementStarted,
ReadAllRegistersDone,
MeasurementCompleted,
CommandCompleted,
/// At the end of cycle when saving /printing resultss
ResultsPrinted,
ResultsWritten,
ResultsNotWritten,
/// Timer events
TimerExpired,
/// Process camera events
CameraBusy,
GrabPassed,
GrabFailed,
RoiDetectionPassed,
RoiDetectionFailed,
RoiDetectionPreviousFailed,
/// Generic
Error, /// Many ops.: Fatal error occurred
OpArgumentError,
ConfigurationError,
Yes,
No,
Next, /// To move to the next state when debugging
OK,
Retry,
Abort,
TimerBusy,
SetOutputsDone,
/// Sequence conditions
ConditionNotMet,
ConditionMet,
/// Outer loop control
OuterLoopStart,
OuterLoopEnd,
/// Production monitoring
CheckDone,
CheckNotDone,
/// Error evaluation
ErrorConditionsDone,
}
/// </summary>
public enum Event
{
None = 0,
Busy, /// Useful when waiting in state until at least one is busy (all are done)
Done, /// Useful when waiting in state until the first is done, the rest miht still be busy
MakeSecondPass, /// Test completed OK but 2nd pass (evaluation) is required
///
ModelessFormIsOpen,
ModelessFormClosed,
ValvesBusy,
ValvesSet,
AmbientDone,
BalanceDone,
BalanceOverload,
PressureDone,
PressureInDone,
PressureOutDone,
TempDone,
TempInDone,
TempOutDone,
TempDivDone,
FlowMeasurementDone,
FlowReached,
PositionReached,
RegulValveTimeOut, /// Maximum allowed flow setting time has elapsed
ReadRegisterDone,
ReadReferenceDone,
AllPositionsReached, /// Used in SetAllRegulValvesOp
TurnPumpOnOffDone,
/// CheckUi events
UiCmdReloadBatch,
UiCmdStartTest,
UiCmdStartQ1,
UiCmdStartQ2,
UiCmdStartQ3,
UiCmdStartCycle,
UiCmdStop,
UiCmdPurgeBegin,
UiCmdPurgeEnd,
UiCmdDrainTank1,
UiCmdDrainTank2,
UiCmdDrainTank3,
UiCmdStopDrainingTank1,
UiCmdStopDrainingTank2,
UiCmdStopDrainingTank3,
UiCmdBreak,
UiCmdResetResults,
UiCmdAcceptResults,
UiCmdShutdown,
UiCmdCameraTest,
UiCmdSensitivityTest,
UiCmdCustom,
UiCmdB1,
UiCmdB2,
UiCmdB3,
/// Process/Test oriented
FlowRegulationStopped,
PreviousStopped,
Wait,
ProcedureLoaded,
MeasurementStarted,
ReadAllRegistersDone,
MeasurementCompleted,
CommandCompleted,
/// At the end of cycle when saving /printing resultss
ResultsPrinted,
ResultsWritten,
ResultsNotWritten,
/// Timer events
TimerExpired,
/// Process camera events
CameraBusy,
GrabPassed,
GrabFailed,
RoiDetectionPassed,
RoiDetectionFailed,
RoiDetectionPreviousFailed,
/// Generic
Error, /// Many ops.: Fatal error occurred
OpArgumentError,
ConfigurationError,
Yes,
No,
Next, /// To move to the next state when debugging
OK,
Retry,
Abort,
TimerBusy,
SetOutputsDone,
/// Sequence conditions
ConditionNotMet,
ConditionMet,
/// Outer loop control
OuterLoopStart,
OuterLoopEnd,
/// Production monitoring
CheckDone,
CheckNotDone,
/// Error evaluation
ErrorConditionsDone,
}
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -15,6 +15,13 @@ namespace TBF.BenchControl.Operations
SequenceBase sequenceBase;
bool heatMeters;
/// Constructor: No heat meters
public ProcessDataLoggingOp(ILog logger, SequenceBase sequenceBase)
: this (logger, sequenceBase, false)
{
}
/// Constructor: Heat meters are optional
public ProcessDataLoggingOp(ILog logger, SequenceBase sequenceBase, bool heatMeters)
{
this.logger = logger;
@@ -253,9 +253,11 @@ namespace TBF.BenchControl.Output.FileWriters.Basic
{
writer = File.AppendText(GetFilename(destination, batch.EndTime));
WriteRsltsEx(batch, writer);
log.WarnFormat("Batch {0} written by {1} to file {2}", batch.BatchNr, Name, destination);
}
catch
{
log.ErrorFormat("Error writing batch {0} by {1} to file {2}", batch.BatchNr, Name, destination);
}
finally
{
@@ -242,20 +242,24 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
{
if (batch == null || batch.WaterMeters == null || batch.WaterMeters.Count <= 0) return;
StreamWriter writer = StreamWriter.Null;
if (!string.IsNullOrEmpty(destination))
{
StreamWriter writer = StreamWriter.Null;
try
{
writer = File.AppendText(GetFilename(destination, batch.EndTime));
WriteRsltsEx(batch, writer);
log.WarnFormat("Batch {0} written by {1} to file {2}", batch.BatchNr, Name, destination);
}
catch
{
log.ErrorFormat("Error writing batch {0} by {1} to file {2}", batch.BatchNr, Name, destination);
}
finally
{
writer.Close();
}
}
WriteRsltsEx(batch, writer);
writer.Close();
}
@@ -241,20 +241,24 @@ namespace TBF.BenchControl.Output.FileWriters.OneFilePerMeter
void WriteRslts(Results.Entities.Batch batch, string destination)
{
StreamWriter writer = StreamWriter.Null;
if (!string.IsNullOrEmpty(destination))
{
StreamWriter writer = StreamWriter.Null;
try
{
writer = File.AppendText(GetFilename(destination, batch.EndTime));
WriteRsltsEx(batch, writer);
log.WarnFormat("Batch {0} written by {1} to file {2}", batch.BatchNr, Name, destination);
}
catch
{
log.ErrorFormat("Error writing batch {0} by {1} to file {2}", batch.BatchNr, Name, destination);
}
finally
{
writer.Close();
}
}
WriteRsltsEx(batch, writer);
writer.Close();
}
@@ -222,14 +222,20 @@ namespace TBF.BenchControl.Output.FileWriters.Xml
foreach (var wm in batch.WaterMeters)
{
StreamWriter writer = StreamWriter.Null;
try
{
StreamWriter writer = File.AppendText(GetFilename(destination, batch.EndTime, wm.WMPosition));
writer = File.AppendText(GetFilename(destination, batch.EndTime, wm.WMPosition));
WriteWM(writer, wm);
writer.Close();
log.WarnFormat("Batch {0}/watermeter {1} written by {2} to file {3}", batch.BatchNr, wm.WMPosition, Name, destination);
}
catch
{
log.ErrorFormat("Error writing batch {0}/watermeter {1} by {2} to file {3}", batch.BatchNr, wm.WMPosition, Name, destination);
}
finally
{
writer.Close();
}
}
}
@@ -227,14 +227,20 @@ namespace TBF.BenchControl.Output.FileWriters.XmlBatch
if (string.IsNullOrEmpty(destination)) return;
if (batch.WaterMeters == null || batch.WaterMeters.Count == 0) return;
StreamWriter writer = StreamWriter.Null;
try
{
StreamWriter writer = File.AppendText(GetFilename(destination, batch.EndTime));
writer = File.AppendText(GetFilename(destination, batch.EndTime));
WriteBatch(writer);
writer.Close();
log.WarnFormat("Batch {0} written by {1} to file {2}", batch.BatchNr, Name, destination);
}
catch
{
log.ErrorFormat("Error writing batch {0} by {1} to file {2}", batch.BatchNr, Name, destination);
}
finally
{
writer.Close();
}
}
@@ -3,6 +3,7 @@
///
using System;
using System.Collections.Generic;
using System.Drawing.Printing;
using System.Globalization;
using System.Threading;
using Results.Output.Printers.Enhanced;
@@ -99,6 +100,7 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
printerCfg.Footer = newCfg.Footer;
printerCfg.DocName = newCfg.DocName;
printerCfg.NrOfCopies = newCfg.NrOfCopies;
ApplyConfig();
}
@@ -164,34 +166,38 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
if (batch.WaterMeters.Count > 0)
{
EnhancedPrinterCfg cfg = new EnhancedPrinterCfg
{
PageOrientation = printerCfg.PageOrientation,
Template = printerCfg.Template,
TopMargin = printerCfg.TopMargin,
BottomMargin = printerCfg.BottomMargin,
LeftMargin = printerCfg.LeftMargin,
TitFntFml = printerCfg.TitFntFml,
TitFntSz = printerCfg.TitFntSz,
TitFntSty = printerCfg.TitFntSty,
HdrFntFml = printerCfg.HdrFntFml,
HdrFntSz = printerCfg.HdrFntSz,
HdrFntSty = printerCfg.HdrFntSty,
BodyFntFml = printerCfg.BodyFntFml,
BodyFntSz = printerCfg.BodyFntSz,
BodyFntSty = printerCfg.BodyFntSty,
FooterFntFml = printerCfg.FooterFntFml,
FooterFntSz = printerCfg.FooterFntSz,
FooterFntSty = printerCfg.FooterFntSty,
GoodOnly = printerCfg.GoodOnly,
SupressPrinting = printerCfg.SupressPrinting,
CultureInfo = (printerCfg.Culture == Culture.system) ? Thread.CurrentThread.CurrentCulture : new CultureInfo(printerCfg.Culture.ToString()),
Header = printerCfg.Header,
CommonItems = printerCfg.CommonItems,
TestItems = printerCfg.SelectedItems,
Footer = printerCfg.Footer,
};
{
PageOrientation = printerCfg.PageOrientation,
Template = printerCfg.Template,
TopMargin = printerCfg.TopMargin,
BottomMargin = printerCfg.BottomMargin,
LeftMargin = printerCfg.LeftMargin,
TitFntFml = printerCfg.TitFntFml,
TitFntSz = printerCfg.TitFntSz,
TitFntSty = printerCfg.TitFntSty,
HdrFntFml = printerCfg.HdrFntFml,
HdrFntSz = printerCfg.HdrFntSz,
HdrFntSty = printerCfg.HdrFntSty,
BodyFntFml = printerCfg.BodyFntFml,
BodyFntSz = printerCfg.BodyFntSz,
BodyFntSty = printerCfg.BodyFntSty,
FooterFntFml = printerCfg.FooterFntFml,
FooterFntSz = printerCfg.FooterFntSz,
FooterFntSty = printerCfg.FooterFntSty,
GoodOnly = printerCfg.GoodOnly,
SupressPrinting = printerCfg.SupressPrinting,
CultureInfo = (printerCfg.Culture == Culture.system) ? Thread.CurrentThread.CurrentCulture : new CultureInfo(printerCfg.Culture.ToString()),
Header = printerCfg.Header,
CommonItems = printerCfg.CommonItems,
TestItems = printerCfg.SelectedItems,
Footer = printerCfg.Footer,
};
new Results.Output.Printers.Enhanced.EnhancedPrintDocument(batch, cfg, documentName).Print();
for (int i = 1; i <= printerCfg.NrOfCopies; i++)
{
string docName = string.Format(((printerCfg.NrOfCopies == 1) ? "{0}" : "{0}-{1}"), documentName, i);
new Results.Output.Printers.Enhanced.EnhancedPrintDocument(batch, cfg, docName).Print();
}
}
}
}
@@ -42,6 +42,7 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
public string Header; /// =Title
public string Footer;
public string DocName;
public int NrOfCopies;
[XmlIgnore]
public Config.Entities.MetersKind MetersKind;
@@ -81,6 +82,7 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
Header = string.Empty;
Footer = string.Empty;
DocName = string.Empty;
NrOfCopies = 1;
}
public string ToString(int i)
@@ -74,6 +74,8 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
this.headerFontLabel = new System.Windows.Forms.Label();
this.templateTextBox = new System.Windows.Forms.TextBox();
this.templateLabel = new System.Windows.Forms.Label();
this.nrOfCopiesTextBox = new System.Windows.Forms.TextBox();
this.nrOfCopiesLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// nameTextBox
@@ -128,7 +130,7 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
this.orientationComboBox.FormattingEnabled = true;
this.orientationComboBox.Location = new System.Drawing.Point(142, 83);
this.orientationComboBox.Name = "orientationComboBox";
this.orientationComboBox.Size = new System.Drawing.Size(218, 21);
this.orientationComboBox.Size = new System.Drawing.Size(146, 21);
this.orientationComboBox.TabIndex = 6;
//
// topMarginTextBox
@@ -475,10 +477,29 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
this.templateLabel.TabIndex = 3;
this.templateLabel.Text = "Template";
//
// nrOfCopiesTextBox
//
this.nrOfCopiesTextBox.Enabled = false;
this.nrOfCopiesTextBox.Location = new System.Drawing.Point(340, 83);
this.nrOfCopiesTextBox.Name = "nrOfCopiesTextBox";
this.nrOfCopiesTextBox.Size = new System.Drawing.Size(20, 20);
this.nrOfCopiesTextBox.TabIndex = 43;
//
// nrOfCopiesLabel
//
this.nrOfCopiesLabel.AutoSize = true;
this.nrOfCopiesLabel.Location = new System.Drawing.Point(291, 86);
this.nrOfCopiesLabel.Name = "nrOfCopiesLabel";
this.nrOfCopiesLabel.Size = new System.Drawing.Size(48, 13);
this.nrOfCopiesLabel.TabIndex = 44;
this.nrOfCopiesLabel.Text = "# copies";
//
// PrinterCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.nrOfCopiesLabel);
this.Controls.Add(this.nrOfCopiesTextBox);
this.Controls.Add(this.templateTextBox);
this.Controls.Add(this.templateLabel);
this.Controls.Add(this.footerItalicCheckBox);
@@ -575,5 +596,7 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
private System.Windows.Forms.Label headerFontLabel;
private System.Windows.Forms.TextBox templateTextBox;
private System.Windows.Forms.Label templateLabel;
private System.Windows.Forms.TextBox nrOfCopiesTextBox;
private System.Windows.Forms.Label nrOfCopiesLabel;
}
}
@@ -113,6 +113,7 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
cultureComboBox.Text = config.Culture.ToString();
docNameTextBox.Text = config.DocName;
nrOfCopiesTextBox.Text = config.NrOfCopies.ToString();
}
public void Unlock()
@@ -147,6 +148,7 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
testItemsButton.Enabled = true;
footerButton.Enabled = true;
docNameTextBox.Enabled = true;
nrOfCopiesTextBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
@@ -204,9 +206,15 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
if (!cultureComboBox.Items.Contains(cultureComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Invalid culture";
}
flags |= CfgUpdateFlags.Error;
}
if (!int.TryParse(nrOfCopiesTextBox.Text, out dummy) || dummy < 1 || dummy > 9)
{
message += Environment.NewLine + "'Copies' should be between 1 and 9";
flags |= CfgUpdateFlags.Error;
}
return flags;
}
@@ -282,6 +290,7 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
flags |= UpdateDifferent(ref config.Footer, footer, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.DocName, docNameTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.NrOfCopies, nrOfCopiesTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
{
+16 -11
View File
@@ -21,11 +21,16 @@ namespace TBF.BenchControl.Sequences
/// </summary>
public class SequenceBase : ProcessData
{
private static readonly ILog log = LogManager.GetLogger(typeof(SequenceBase));
private static readonly ILog log = LogManager.GetLogger(typeof(SequenceBase));
protected static readonly ILog processDataLogger = LogManager.GetLogger("ProcessData");
protected static readonly ILog allResults = LogManager.GetLogger("AllResults");
protected static readonly ILog summaryResults = LogManager.GetLogger("SummaryResults");
protected static readonly ILog summaryResults = LogManager.GetLogger("SummaryResults");
public const int FlowSettingTimeoutSec = 990; /// Flow setting timeout = 16.5 min.
public const int StableMassMsrmntTimeoutSec = 300; /// Stable mass measurement timeout = 5 min.
///------------------------------------------------------------
/// Global static variables set only once.
@@ -741,16 +746,16 @@ namespace TBF.BenchControl.Sequences
.AddOperation(checkUiOp)
.AddOperations(measureOperations)
.AddOperation(readRegistersOp)
.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.TempMtrUp == null ? null : benchPath.TempMtrUp.ReadTempOp(ref TempUp))
.AddOperation(benchPath.TempMtrDown == null ? null : benchPath.TempMtrDown.ReadTempOp(ref TempDown))
.AddOperation(outPath.TempDiv == null ? null : outPath.TempDiv.ReadTempOp(ref TempDiv))
.AddOperation(benchPath.PressMtrUp == null ? null : benchPath.PressMtrUp.ReadPressureOp(ref PressUp))
.AddOperation(benchPath.PressMtrDown == null ? null : benchPath.PressMtrDown.ReadPressureOp(ref PressDown))
.AddOperation(benchPath.PressMtrDelta == null ? null : benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta))
.AddOperation(heatMetersPath == null ? null : heatMetersPath.TMeterRefWarm1.ReadTempOp(ref TempRefHi1))
.AddOperation(heatMetersPath == null ? null : heatMetersPath.TMeterRefWarm2.ReadTempOp(ref TempRefHi2))
.AddOperation(heatMetersPath == null ? null : heatMetersPath.TMeterRefCold1.ReadTempOp(ref TempRefLo1))
.AddOperation(heatMetersPath == null ? null : heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2))
.AddOperation(heatMetersPath == null ? null : heatMetersPath.TMeterRefWarm1.ReadTempOp(ref TempRefHi1))
.AddOperation(heatMetersPath == null ? null : heatMetersPath.TMeterRefWarm2.ReadTempOp(ref TempRefHi2))
.AddOperation(heatMetersPath == null ? null : heatMetersPath.TMeterRefCold1.ReadTempOp(ref TempRefLo1))
.AddOperation(heatMetersPath == null ? null : heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2))
.AddOperation(realTest ? outPath.Scale.ReadMassOp(ref Mass) : null)
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
.AddOperation((StateMachine.Ambient != null)
+3 -3
View File
@@ -146,10 +146,10 @@ namespace TBF.BenchControl.Sequences
sum += filteredValue;
if (count == 0) first = filteredValue;
last = filteredValue;
if (value < min) min = filteredValue;
if (value > max) max = filteredValue;
if (filteredValue < min) min = filteredValue;
if (filteredValue > max) max = filteredValue;
plotter.UpdateGraph(graphId, (float)(count + SkippedSamplesCount + FilterSize / 2), (float)value);
plotter.UpdateGraph(graphId, (float)(count + SkippedSamplesCount + FilterSize / 2), (float)filteredValue);
count++;
}
+6 -2
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using Config.Entities;
@@ -45,6 +45,7 @@ namespace TBF.BenchControl
Factories.Add(new Elde.FlowMeterTriplet.FlowMeterFactory());
Factories.Add(new TestMethods.Adjustment.Factory());
Factories.Add(new TestMethods.CombinedWithDetection.TestMethodFactory());
Factories.Add(new TestMethods.DiverterTest.Factory());
Factories.Add(new TestMethods.Endurance.Factory());
Factories.Add(new TestMethods.FixedStart.Single.Factory());
Factories.Add(new TestMethods.FixedStart.Compound.Factory());
@@ -170,7 +171,10 @@ namespace TBF.BenchControl
public static IComponentCfg CmpntCfgFromCmpntEntity(Component entity)
{
IComponentFactory cmpntFactory = CmpntFactoryFromClassName(entity.ClassName);
return (cmpntFactory != null) ? cmpntFactory.CmpntCfgFromCmpntEntity(entity) : null;
if (cmpntFactory == null) return null;
try { return cmpntFactory.CmpntCfgFromCmpntEntity(entity); }
catch { return null; }
}
@@ -0,0 +1,40 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using log4net;
using Config.Entities;
namespace TBF.BenchControl.TestMethods.DiverterTest
{
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; }
readonly TestMethodCfg testMethodCfg;
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 DiverterTestSeq()).Execute(test, repetNr, isLastRepetition, testMethodCfg.TestParams);
}
}
}
@@ -0,0 +1,873 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Text;
using log4net;
using TBF.BenchControl;
using TBF.Boxes;
using TBF.Resources;
using TBF.UiBridge;
using TBF.BenchControl.GenericDevices;
namespace TBF.BenchControl.TestMethods.DiverterTest
{
public class DiverterTestSeq : Sequences.SequenceBase
{
private static readonly ILog log = LogManager.GetLogger(typeof(DiverterTestSeq));
/// <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, TestParams testParams)
{
IScale scale = outPath.Scale as IScale;
if (scale == null)
{
Bridge.OnError(this, "Configuration error");
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter)
{
Elde.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Elde.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
}
if (test.Volume > scale.Capacity * Constants.TankFullFactor)
{
Bridge.OnError(this, Strings.Test_volume_exceeds_the_scale_capacity);
return new List<Event> { Event.ConfigurationError };
}
IList<Event> e; /// Events from currently running operations
Event retVal = Event.Done;
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this);
//int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
//if (sensPath != null && sensPath.RegisterReaders != null)
//{
// foreach (var rr in sensPath.RegisterReaders)
// {
// TBF.BenchControl.Elde.RegisterReader.RegisterReader eldeRR = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
// if ((eldeRR != null) && (eldeRR.Position >= 1) && (eldeRR.Position <= 8))
// {
// filters[eldeRR.Position - 1] = eldeRR.Filter;
// }
// }
//}
//
//cBrd.SetFiltersPidShortPulses(filters, outPath.PidCoef, (test.TolerRed == 0) ? 0 : 1);
IList<IOperation> readTempPressOps = new List<IOperation>();
if(benchPath.TempMtrUp != null) readTempPressOps.Add(benchPath.TempMtrUp.ReadTempOp(ref TempUp));
if(benchPath.TempMtrDown != null) readTempPressOps.Add(benchPath.TempMtrDown.ReadTempOp(ref TempDown));
if(outPath.TempDiv != null) readTempPressOps.Add(outPath.TempDiv.ReadTempOp(ref TempDiv));
if(benchPath.PressMtrUp != null) readTempPressOps.Add(benchPath.PressMtrUp.ReadPressureOp(ref PressUp));
if(benchPath.PressMtrDown != null) readTempPressOps.Add(benchPath.PressMtrDown.ReadPressureOp(ref PressDown));
if(benchPath.PressMtrDelta != null) readTempPressOps.Add(benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta));
FloatBox switchTimeStart = new FloatBox(0.001f); /// in seconds, initial value is 1 ms
FloatBox switchTimeEnd = new FloatBox(0.001f); /// in seconds, initial value is 1 ms
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse;
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
//====================================
loop:
/// Read pressure and temperature once before calling Bridge.OnTestSelected(...)
State.Create(string.Format("{0}({1}) : Measuring process data", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.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.Busy));
/// 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.OnActivity(this, Strings.Checking_tank_capacity);
//------------------------------------------------
bool drainTheTank = test.DoDraining;
if (!drainTheTank) /// If condition met => skip measuring and force emptying
{
///
/// Measure the weight and skip emptying if there is enough room in the tank
///
State.Create(string.Format("{0}({1}) : Checking available tank capacity", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(scale.ReadMassOp(ref Mass))
.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));
double estimatedEndMass = Mass.Val + test.Volume;
if (estimatedEndMass >= scale.Capacity * Constants.TankFullFactor)
{
drainTheTank = true;
}
}
///
if (drainTheTank)
{
#if BERLIN || SENTEC
switch (DrainTheTank(outPath.Scale, readTempPressOps))
{
case Event.Error: { retVal = Event.Error; goto stopTest; }
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
}
drainTheTank = false;
#else
State.Create(string.Format("{0}({1}) : Open the drain valve", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(StateMachine.ControlBoard.SetValvesOp(scale.DrainValve, null))
.AddOperations(readTempPressOps)
.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.ValvesBusy));
#endif
}
//------------------------------------------------
Bridge.OnActivity(this, Strings.Starting_the_pump);
//------------------------------------------------
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
int flowSetTime0 = StateMachine.Time;
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
///
State.Create(string.Format("{0}({1}) : Starting the pump", test.Method, test.Name))
.AddOperation(checkUiOp)
// .AddOperation(new Operations.SetAllRegulValvesOp(inPath.RegulValves, inPath.RegulValvesPct, 60))
.AddOperations(readTempPressOps)
.AddOperation(inPath.Pump != null ? cBrd.SetValvesOp(inPath.Pump, null) : 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; }
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
}
while (e.Contains(Event.ValvesBusy) /* || !e.Contains(Event.AllPositionsReached)*/);
if (test.TimePump2StartV > 0)
{
State.Create(string.Format("{0}({1}) : Waiting after the pump started", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(new Operations.TimerOp(test.TimePump2StartV))
.AddOperations(readTempPressOps)
.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));
}
if (benchPath.StopBFValve != null)
{
State.Create(string.Format("{0}({1}) : Opening the stop backflow valve", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(StateMachine.ControlBoard.SetValvesOp(benchPath.StopBFValve, null))
.AddOperations(readTempPressOps)
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
}
while (!e.Contains(Event.ValvesSet));
}
if (test.TimeBeforeFlow > 0)
{
State.Create(string.Format("{0}({1}) : Waiting before flow setting process starts", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(new Operations.TimerOp(test.TimeBeforeFlow))
.AddOperations(readTempPressOps)
.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));
}
setting_flow:
//------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_the_flow);
//------------------------------------------------
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec))
.AddOperations(readTempPressOps)
.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.Flow_adjustment_failed);
retVal = Event.UiCmdStop;
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;
if (test.DoControlWaterTemp && (benchPath.TempMtrUp != null) && (benchPath.TempMtrDown != null))
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);
//---------------------------------------------------
State.Create(string.Format("{0}({1}) : Wait until the water temperature is within limits", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (e.Contains(Event.Next)) goto temperature_set;
if ((test.TempLimLo <= TempUp.Val) && (TempUp.Val <= test.TempLimHi) &&
(test.TempLimLo <= TempDown.Val) && (TempDown.Val <= test.TempLimHi))
{
goto temperature_set;
}
}
while (true);
}
temperature_set:
///
/// Prepare cameras, ROI-s and measurementOperations
///
/// Find successfully detected ROI-s
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
foreach (var rr in sensPath.RegisterReaders)
{
GenericDevices.IRoi cameraRoI = rr as GenericDevices.IRoi;
if ((cameraRoI != null) && cameraRoI.Detected)
{
rois.Add(cameraRoI);
}
}
/// Find cameras
IList<GenericDevices.ICamera> cameras = new List<GenericDevices.ICamera>();
foreach (var roi in rois)
{
if (roi.Camera != null && !cameras.Contains(roi.Camera))
{
cameras.Add(roi.Camera);
roi.Camera.ClearRoiParams();
}
}
/// Register ROI-parameters to cameras
foreach (var roi in rois) roi.RegisterRoiToCamera();
/// Prepare measurementOperations
IList<IOperation> measureOperations = new List<IOperation>();
foreach (var camera in cameras) measureOperations.Add(camera.MeasurementOp());
if (drainTheTank)
{
//------------------------------------------------
Bridge.OnActivity(this, Strings.Closing_the_tank);
//------------------------------------------------
///
/// Make sure tank draining completed
///
switch (DrainTheTank(outPath.Scale.DrainValve, outPath.Scale, readTempPressOps))
{
case Event.Error: { retVal = Event.Error; goto stopTest; }
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
}
drainTheTank = false;
}
else
{
/// Close the drain valve anyway
State.Create(string.Format("{0}({1}) : Close the drain valve", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, scale.DrainValve))
.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.ValvesBusy));
}
//------------------------------------------------
Bridge.OnActivity(this, Strings.Measuring_the_weight);
//------------------------------------------------
if (test.TimeFlow2Mass > 0)
{
State.Create(string.Format("{0}({1}) : Waiting before 1st mass measurement", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(new Operations.TimerOp(test.TimeFlow2Mass))
.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));
}
LogProcessDataTestInfo(processDataLogger, test.Procedure.Name, test.Name);
LogProcessDataHeader(processDataLogger, "Start mass");
State.Create(string.Format("{0}({1}) : Measuring the start mass", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(measureOperations)
.AddOperation(processDataLoggingOp)
.AddOperation(scale.ReadStableMassOp(ref StartMass, test.MassRepeats, test.MassSpread, test.MassMethod))
.AddOperations(readTempPressOps)
.AddOperation(new Operations.TimerOp(StableMassMsrmntTimeoutSec))
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (e.Contains(Event.TimerExpired))
{
Bridge.OnError(this, "Timeout");
retVal = Event.UiCmdStop;
goto stopTest;
}
}
while (!e.Contains(Event.BalanceDone));
Mass.Val = StartMass.Val;
log.WarnFormat("Start mass = {0}kg", StartMass);
///
/// Initialize cumulated reference and water metert pulses
///
int[] cumulativeEtPulses = new int[Config.Data.WMsCount + 1]; /// 0 .. Config.Data.WMsCount
int[] cumulativeWMPulses = new int[Config.Data.WMsCount + 1]; /// 1 .. Config.Data.WMsCount
double[] cumulativeTestTime = new double[Config.Data.WMsCount + 1]; /// 0 .. Config.Data.WMsCount
for (int i = 0; i <= Config.Data.WMsCount; i++)
{
cumulativeEtPulses[i] = 0;
if (i > 0) cumulativeWMPulses[i] = 0;
cumulativeTestTime[i] = 0;
}
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr);
///
/// Diverter test loop
///
for (int divRepetNr = 1; divRepetNr <= testParams.DivRepetitions; divRepetNr++)
{
LogProcessDataHeader(processDataLogger, string.Format("Measurement {0}", divRepetNr + 1));
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress);
//------------------------------------------------
State.Create(string.Format("{0}({1}) : Starting the test", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperations(measureOperations)
.AddOperation(processDataLoggingOp)
.AddOperation(cBrd.StartMeasurementOp(outPath, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro, test.Qfrom, test.Qto, totalPulses / testParams.DivRepetitions, (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));
foreach (var rr in sensPath.RegisterReaders)
{
GenericDevices.IHasTestName readerWithTstName = rr as GenericDevices.IHasTestName;
if (readerWithTstName != null)
{
readerWithTstName.TestName = test.Name;
readerWithTstName.TestRepeats = test.Repeats;
readerWithTstName.RepetitionNr = repetitionNr;
}
}
/// Measurement loop - preparation
readRegistersOp = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders);
int estimtdEndTime = StateMachine.Time + (int)(test.TstTime / testParams.DivRepetitions);
/// Measurement loop - begin
State.Create(string.Format("{0}({1}) : Reading watermeters {2}", test.Method, test.Name, divRepetNr))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperations(measureOperations)
.AddOperation(readRegistersOp)
.AddOperation(scale.ReadMassOp(ref Mass))
//.AddOperation(cBrd.ReadDiverterTransitionOp(outPath.Diverter, 2, 4, switchTimeStart, DiverterStart, BatchRslts.Batch.BatchNr, test.Name, repetitionNr))
.AddOperation(cBrd.QueryMeasurementEndOp())
.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; }
//------------------------------------------------
int remainingTime = Math.Max(estimtdEndTime - StateMachine.Time, 0);
if (remainingTime > 60)
{
Bridge.OnActivity(this, string.Format("{0}. {1} ... {2} {3} {4} {5}", divRepetNr, Strings.Test_in_progress, remainingTime / 60, "min", remainingTime % 60, Strings.sec));
}
else
{
Bridge.OnActivity(this, string.Format("{0}. {1} ... {2} s", divRepetNr, Strings.Test_in_progress, remainingTime));
}
//------------------------------------------------
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));
if (e.Contains(Event.MeasurementCompleted)) break;
}
while (!e.Contains(Event.Next)); /// 'Next' button can be used in Debug version
LogProcessDataHeader(processDataLogger, string.Format("Delay {0}", divRepetNr));
if (divRepetNr < testParams.DivRepetitions)
{
/// This is not the last diverter repetition
/// Delay 5s
State.Create(string.Format("{0}({1}) : Delay {2}", test.Method, test.Name, divRepetNr))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(processDataLoggingOp)
.AddOperation(new Operations.TimerOp(5))
.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));
/// Accumulate partial pulses
cumulativeEtPulses[0] += cBrd.EtPulses(0);
cumulativeTestTime[0] += cBrd.TTime;
for (int i = 1; i <= Config.Data.WMsCount; i++)
{
cumulativeEtPulses[i] += cBrd.EtPulses(i);
cumulativeWMPulses[i] += cBrd.WMeterPulses(i);
cumulativeTestTime[i] += cBrd.ImpulseTime(i);
}
}
} /// end for ... diverter test loop
/// Measurement loop - end
test_completed:
StopRecordingStatistics();
//State.Create(string.Format("{0}({1}) : Stopping flow regulation", test.Method, test.Name))
// .AddOperation(checkUiOp)
// .AddOperations(readTempPressOps)
// .AddOperation(cBrd.StopFlowRegulationOp(outPath))
// .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.FlowRegulationStopped));
///
/// (Berlin:) Water is stopped immediately after the test and before the 2nd mass measurement in case:
/// - no 'transition sequence after test' is used
/// - this is the last (or the only) test repetition or test is a part of an 'outer loop'
///
#if !CEVAK_200
if (isLastRepetition && transitionAfter == null)
#endif
{
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOff();
State.Create("SequenceBase : Transition : TestEnd - Default action")
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(new MettlerToledo.KeepReadingMassesOp())
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose))
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.ValvesSet));
}
//------------------------------------------------
Bridge.OnActivity(this, Strings.Measuring_the_weight);
//------------------------------------------------
State.Create(string.Format("{0}({1}) : Waiting before the 2nd mass measurement", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(scale.ReadMassOp(ref Mass))
.AddOperation(cBrd.ReadDiverterTransitionOp(outPath.Diverter, 2, 4, switchTimeEnd, DiverterEnd, BatchRslts.Batch.BatchNr, test.Name, repetitionNr))
.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) || !e.Contains(Event.BalanceDone));
LogProcessDataHeader(processDataLogger, "End mass");
State.Create(string.Format("{0}({1}) : Measuring the end mass", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(scale.ReadStableMassOp(ref EndMass, test.MassRepeats, test.MassSpread, test.MassMethod))
.AddOperation(new Operations.TimerOp(StableMassMsrmntTimeoutSec))
.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; }
if (e.Contains(Event.TimerExpired))
{
Bridge.OnError(this, "Timeout");
retVal = Event.UiCmdStop;
goto stopTest;
}
}
while (!e.Contains(Event.BalanceDone));
///
log.WarnFormat("End mass = {0}kg", EndMass);
TestEndTime = DateTime.Now;
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_completed);
//------------------------------------------------
///
/// Accumulate partial pulses from the last diverter repetition
///
cumulativeEtPulses[0] += cBrd.EtPulses(0);
cumulativeTestTime[0] += cBrd.TTime;
for (int i = 1; i <= Config.Data.WMsCount; i++)
{
cumulativeEtPulses[i] += cBrd.EtPulses(i);
cumulativeWMPulses[i] += cBrd.WMeterPulses(i);
cumulativeTestTime[i] += cBrd.ImpulseTime(i);
}
///
/// Populate TestResult data entity with data
///
Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part);
if (tstRslt != null)
{
UpdateTempPressDensAmb(tstRslt);
/// Main results
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cumulativeTestTime[0]; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cumulativeEtPulses[0]); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassStart = Config.Formulas.CorrectedValue(tstRslt.MassStartRaw, scale.Corrections);
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = Config.Formulas.CorrectedValue(tstRslt.MassEndRaw, 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 = Config.Formulas.Buoyancy();
tstRslt.VolumeCTV = 1000 * tstRslt.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.DensityLine; /// [l] commercially true volume
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
tstRslt.ErrorMaster = Config.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.Val;
tstRslt.DivStart10 = 0;
tstRslt.DivStart50 = 0;
tstRslt.DivStart90 = 0;
tstRslt.DiverterEnd = switchTimeEnd.Val;
tstRslt.DivEnd90 = 0;
tstRslt.DivEnd50 = 0;
tstRslt.DivEnd10 = 0;
log.DebugFormat("Diverter switch time [s]: Start: {0}ms ({1} {2} {3}) End: {4}ms ({5} {6} {7})",
(tstRslt.DiverterStart * 1000).ToString("F0"), tstRslt.DivStart10, tstRslt.DivStart50, tstRslt.DivStart90,
(tstRslt.DiverterEnd * 1000).ToString("F0"), tstRslt.DivEnd90, tstRslt.DivEnd50, tstRslt.DivEnd10);
tstRslt.ErrorFlagsMd = (ErrorFlagsComp != null) ? (sbyte)ErrorFlagsComp.Mode : (sbyte)0;
tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, tstRslt.DiverterStart, tstRslt.DiverterEnd) : 0;
///
/// Single meters
///
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue;
/// MetersKind.Single meters
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);
GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i];
GenericDevices.IDatastreamReader dstrReader = regReader as GenericDevices.IDatastreamReader;
TestMethods.iPerlCommunication.iPerlHead.IperlHead iPerl = regReader as TestMethods.iPerlCommunication.iPerlHead.IperlHead;
GenericDevices.IRoi cameraRoi = regReader as GenericDevices.IRoi;
if (meterRslt != null && regReader != null)
{
meterRslt.RegReaderType = (int)regReader.RegisterReaderType;
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
meterRslt.PulsesMeter = Convert.ToDouble(regReader.WMPulses);
if (dstrReader != null)
{
meterRslt.TimestampStart = dstrReader.TimestampSecStart;
meterRslt.TimestampEnd = dstrReader.NoSamples ? (dstrReader.TimestampSecStart + tstRslt.TestTime) : dstrReader.TimestampSecEnd;
meterRslt.TestTime = meterRslt.TimestampEnd - meterRslt.TimestampStart;
meterRslt.VolumeStart = dstrReader.VolumeLtrStart; /// liter
meterRslt.VolumeEnd = dstrReader.VolumeLtrEnd; /// liter
meterRslt.VolumeMeter = Math.Abs(dstrReader.VolumeLtrEnd - dstrReader.VolumeLtrStart);
meterRslt.VolumeRef = tstRslt.VolumeCTV * meterRslt.TestTime / tstRslt.TestTime;
meterRslt.PulsesMaster = tstRslt.PulsesMaster * meterRslt.TestTime / tstRslt.TestTime;
if (iPerl != null)
{
if (iPerl.ResultCode != 0 && (meterRslt.WaterMeter.ResultCode & (int)Results.Entities.ResultCode.OptoErrorCodeMask) == 0)
{
meterRslt.WaterMeter.ResultCode |= iPerl.ResultCode;
}
#if IPERL
meterRslt.WaterMeter.CalibFactor = iPerl.CalibFactor;
#endif
iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result
iPerl.LastTestResult = meterRslt; /// Save this test result
}
}
else if (cameraRoi != null)
{
meterRslt.TimestampStart = cameraRoi.TimestampStart; /// second
meterRslt.TimestampEnd = cameraRoi.TimestampEnd; /// second
meterRslt.VolumeStart = cameraRoi.VolumeStart; /// liter
meterRslt.VolumeEnd = cameraRoi.VolumeEnd; /// liter
meterRslt.VolumeMeter = cameraRoi.VolumeEnd - cameraRoi.VolumeStart; /// liter
if (meterRslt.VolumeMeter != 0)
{
/// Normal measurement with camera
meterRslt.TestTime = cameraRoi.TimestampEnd - cameraRoi.TimestampStart; /// second
meterRslt.VolumeRef = tstRslt.VolumeCTV * meterRslt.TestTime / tstRslt.TestTime;
meterRslt.PulsesMaster = tstRslt.PulsesMaster * meterRslt.TestTime / tstRslt.TestTime;
}
else
{
/// None or one pulse from the water meter using camera
meterRslt.TestTime = tstRslt.TestTime;
meterRslt.VolumeRef = tstRslt.VolumeCTV;
meterRslt.PulsesMaster = tstRslt.PulsesMaster;
}
}
else
{
meterRslt.PulsesMaster = Convert.ToDouble(cumulativeEtPulses[i + 1]);
meterRslt.VolumeMeter = cumulativeWMPulses[i + 1] * regReader.LtrsPerPulse; /// liter
meterRslt.VolumeStart = 0; /// liter
meterRslt.VolumeEnd = meterRslt.VolumeMeter; /// liter
if (regReader.WMPulses >= 1)
{
/// Normal measurement
meterRslt.TestTime = cumulativeTestTime[i + 1];
meterRslt.VolumeRef = meterRslt.PulsesMaster * tstRslt.ConstMaster; /// liter
}
else
{
/// None or one pulse from the water meter
meterRslt.TestTime = cumulativeTestTime[0];
meterRslt.VolumeRef = tstRslt.VolumeCTV; /// liter
}
}
meterRslt.Error = Config.Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);
meterRslt.Passed = (meterRslt.Error >= test.GetErrLimLo(tstRslt.FlowMean) + test.Uncertainty)
&& (meterRslt.Error <= test.GetErrLimHi(tstRslt.FlowMean) - test.Uncertainty)
&& (tstRslt.ErrorFlags == 0 || tstRslt.ErrorFlagsMode() != Config.Entities.ErrorFlagsMode.On);
meterRslt.TestDone = true;
tstRslt.TestDone = true;
}
}
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,
scale != null ? 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));
stopTest:
StopRecordingStatistics(); /// Make sure graph files are closed
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError
|| retVal == Event.Error || retVal == Event.ConfigurationError)
{
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) break;
}
while (!e.Contains(Event.PreviousStopped));
}
stopTestWOStoppingDivGateEtc:
return new List<Event> { retVal };
}
}
}
@@ -0,0 +1,26 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.TestMethods.DiverterTest
{
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,49 @@
///
/// Copyright (c) 2019 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.DiverterTest
{
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// <summary> Test parameters </summary>
[XmlIgnore]
public TestParams TestParams;
public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
public override IParamsProvider CreateTestParamsProvider() { return new TestParams(true); }
public override IParamsProvider GetUITestParamsProvider(Test test)
{
return (test.Method == Name) ? base.GetUITestParamsProvider(test) : null;
}
/// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg()
{
TestParams = new TestParams(true);
}
public TestMethodCfg(string name, IComponentFactory factory)
: this()
{
Name = name;
ParentName = string.Empty;
Factory = factory;
}
public string ToString(int i)
{
return string.Format("Name={0}", Name);
}
}
}
@@ -0,0 +1,69 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using System.Windows.Forms;
using Config.Entities;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.TestMethods.DiverterTest
{
public partial class TestMethodCfgCtrl : UserControl, IComponentCfgCtrl
{
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) 2019 Sensus Slovensko a.s.
///
namespace TBF.BenchControl.TestMethods.DiverterTest
{
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,119 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using System.IO;
using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
using TBF.Resources;
namespace TBF.BenchControl.TestMethods.DiverterTest
{
public class TestParams : TestParamsBase, IParamsProvider, ITestParams
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public int DivRepetitions; /// Duration of the test in [s]
public override void InitializeAll()
{
DivRepetitions = 10;
}
string[] paramNames = new string[]
{
Strings.Repeats_nr_chdr,
};
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 DivRepetitions.ToString();
default: return string.Empty;
}
}
public CfgUpdateFlags UpdateParam(int i, string strValue)
{
switch (i)
{
case 0: DivRepetitions = int.Parse(strValue); return CfgUpdateFlags.None;
default: return CfgUpdateFlags.None;
}
}
public bool ValidateParam(int i, string strValue, out string message)
{
message = string.Empty;
int iDummy;
switch (i)
{
case 0:
if (int.TryParse(strValue, out iDummy) && (iDummy > 0)) return true;
break;
default:
message = "Invalid index";
return false;
}
message = ParamName(i) + " is invalid";
return false;
}
void CopyContentTo(TestParams prms)
{
prms.DivRepetitions = this.DivRepetitions;
}
public IParamsProvider Clone()
{
TestParams pars = new TestParams();
CopyContentTo(pars);
return pars;
}
public override void UpdateFromDbEntity(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;
}
}
}
@@ -121,8 +121,8 @@ namespace TBF.BenchControl.TestMethods.Endurance
//------------------------------------------------
int flowSetTime0 = StateMachine.Time;
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 990)) /// timeout = 16.5 min.
.AddOperation(checkUiOp)
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec)) /// timeout = 16.5 min.
.EnterState();
do
{
@@ -232,8 +232,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
//------------------------------------------------
int flowSetTime0 = StateMachine.Time;
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 990)) /// timeout = 16.5 min.
.AddOperation(checkUiOp)
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec)) /// timeout = 16.5 min.
.AddOperation(heatMetersPromptOp)
.EnterState();
do
@@ -288,8 +288,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
//------------------------------------------------
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 990)) /// timeout = 16.5 min.
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec)) /// timeout = 16.5 min.
.AddOperation(heatMetersPromptOp)
.EnterState();
do
@@ -294,8 +294,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
//------------------------------------------------
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 990)) /// timeout = 16.5 min.
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec)) /// timeout = 16.5 min.
.AddOperation(heatMetersPromptOp)
.EnterState();
do
@@ -344,8 +344,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
//------------------------------------------------
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 990)) /// timeout = 16.5 min.
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec)) /// timeout = 16.5 min.
.AddOperation(heatMetersPromptOp)
.EnterState();
do
+10 -5
View File
@@ -560,11 +560,12 @@ namespace TBF
{
TBF.LocalSettings ls = Program.LocalSettings;
historyListViewEx.Columns.Add(Strings.Name, (ls.HistoryColumnCount > 0) ? ls.HistoryColumnWidths[0] : 80);
historyListViewEx.Columns.Add(Strings.Revision, (ls.HistoryColumnCount > 0) ? ls.HistoryColumnWidths[0] : 80);
historyListViewEx.Columns.Add(Strings.Date_and_time, (ls.HistoryColumnCount > 1) ? ls.HistoryColumnWidths[1] : 120);
historyListViewEx.Columns.Add(Strings.User, (ls.HistoryColumnCount > 2) ? ls.HistoryColumnWidths[2] : 55);
historyListViewEx.Columns.Add(Strings.DescriptionColHdr, (ls.HistoryColumnCount > 3) ? ls.HistoryColumnWidths[3] : 300);
historyListViewEx.Columns.Add(Strings.Name, (ls.HistoryColumnCount > 0) ? ls.HistoryColumnWidths[0] : 80);
historyListViewEx.Columns.Add(Strings.Revision, (ls.HistoryColumnCount > 1) ? ls.HistoryColumnWidths[1] : 80);
historyListViewEx.Columns.Add(Strings.Date_and_time, (ls.HistoryColumnCount > 2) ? ls.HistoryColumnWidths[2] : 120);
historyListViewEx.Columns.Add(Strings.User, (ls.HistoryColumnCount > 3) ? ls.HistoryColumnWidths[3] : 55);
historyListViewEx.Columns.Add(Strings.DescriptionColHdr, (ls.HistoryColumnCount > 4) ? ls.HistoryColumnWidths[4] : 150);
RefreshHistoryTab();
}
@@ -721,6 +722,7 @@ namespace TBF
Test entity = (Test)lvi.Tag;
entity.Name = lvi.Text;
entity.ItemNr = i;
int part = entity.Part;
if (lvi.SubItems[(int)MtrlgyClmn.Part].Text.Equals("-"))
@@ -992,6 +994,7 @@ namespace TBF
Test entity = (Test)lvi.Tag;
entity.Name = lvi.Text;
entity.ItemNr = i;
int part = entity.Part;
if (lvi.SubItems[(int)Mtrlgy2Clmn.Part].Text.Equals("-"))
@@ -1238,6 +1241,7 @@ namespace TBF
Test entity = (Test)lvi.Tag;
entity.Name = lvi.Text;
entity.ItemNr = i;
int part = entity.Part;
if (lvi.SubItems[(int)ProcessClmn.Part].Text.Equals("-"))
@@ -1480,6 +1484,7 @@ namespace TBF
Test entity = (Test)lvi.Tag;
entity.Name = lvi.Text;
entity.ItemNr = i;
int part = entity.Part;
if (lvi.SubItems[(int)ParametersClmn.Part].Text.Equals("-"))
+2 -2
View File
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.18.955.0")]
[assembly: AssemblyFileVersion("2.18.955.0")]
[assembly: AssemblyVersion("2.18.1266.0")]
[assembly: AssemblyFileVersion("2.18.1266.0")]
+9
View File
@@ -3489,6 +3489,15 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Reload previous results.
/// </summary>
internal static string Reload_previous_results {
get {
return ResourceManager.GetString("Reload_previous_results", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to remaining time.
/// </summary>
+3
View File
@@ -1446,4 +1446,7 @@
<data name="Flow_adjustment_failed" xml:space="preserve">
<value>Durchfluss nicht erreicht</value>
</data>
<data name="Reload_previous_results" xml:space="preserve">
<value>Vorherige Ergebnisse Herunterladen</value>
</data>
</root>
+3
View File
@@ -1846,4 +1846,7 @@
<data name="Value" xml:space="preserve">
<value>Value</value>
</data>
<data name="Reload_previous_results" xml:space="preserve">
<value>Reload previous results</value>
</data>
</root>
+18 -4
View File
@@ -2,8 +2,10 @@
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using TBF.Resources;
using TBF.UiBridge;
@@ -125,12 +127,24 @@ namespace TBF.Screens
try
{
string[] batches = Directory.GetDirectories(Program.GraphsDir);
int[] batchNrs = new int[batches.Length];
int i = 0;
foreach (var b in batches)
{
int nr;
if (int.TryParse(Path.GetFileName(b), out nr))
{
batchNrs[i++] = nr;
}
}
Array.Sort(batchNrs);
treeView.Nodes.Clear();
for (int i = batches.Length - 1; i >= Math.Max(0, batches.Length - 20); i--)
for (int j = batchNrs.Length - 1; j >= Math.Max(0, batchNrs.Length - 40); j--)
{
string b = batches[i];
string batchNrSstr = Path.GetFileName(b);
string rootNodeName = Path.GetFileName(b);
string batchNrSstr = batchNrs[j].ToString();
string b = Path.Combine(Program.GraphsDir, batchNrSstr);
string rootNodeName = batchNrSstr;
if ((TBF.BenchControl.Sequences.ProcessData.BatchRslts != null) && rootNodeName.Equals(TBF.BenchControl.Sequences.ProcessData.BatchRslts.Batch.BatchNr.ToString()))
{
rootNodeName = Strings.current;
+102 -102
View File
@@ -31,108 +31,108 @@ namespace TBF.Screens
/// </summary>
private void InitializeComponent()
{
this.splitContainer = new System.Windows.Forms.SplitContainer();
this.reloadPreviousResultsButton = new System.Windows.Forms.Button();
this.columnWidthsButton = new System.Windows.Forms.Button();
this.showPreviousResultsButton = new System.Windows.Forms.Button();
this.configureButton = new System.Windows.Forms.Button();
this.flowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
this.splitContainer.Panel1.SuspendLayout();
this.splitContainer.Panel2.SuspendLayout();
this.splitContainer.SuspendLayout();
this.SuspendLayout();
//
// splitContainer
//
this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer.IsSplitterFixed = true;
this.splitContainer.Location = new System.Drawing.Point(0, 0);
this.splitContainer.Name = "splitContainer";
this.splitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer.Panel1
//
this.splitContainer.Panel1.BackColor = System.Drawing.SystemColors.Control;
this.splitContainer.Panel1.Controls.Add(this.reloadPreviousResultsButton);
this.splitContainer.Panel1.Controls.Add(this.columnWidthsButton);
this.splitContainer.Panel1.Controls.Add(this.showPreviousResultsButton);
this.splitContainer.Panel1.Controls.Add(this.configureButton);
//
// splitContainer.Panel2
//
this.splitContainer.Panel2.Controls.Add(this.flowLayoutPanel);
this.splitContainer.Size = new System.Drawing.Size(1057, 706);
this.splitContainer.SplitterDistance = 42;
this.splitContainer.TabIndex = 0;
//
// reloadPreviousResultsButton
//
this.reloadPreviousResultsButton.Enabled = false;
this.reloadPreviousResultsButton.Location = new System.Drawing.Point(405, 10);
this.reloadPreviousResultsButton.Name = "reloadPreviousResultsButton";
this.reloadPreviousResultsButton.Size = new System.Drawing.Size(147, 30);
this.reloadPreviousResultsButton.TabIndex = 3;
this.reloadPreviousResultsButton.Text = "Reload previous results";
this.reloadPreviousResultsButton.UseVisualStyleBackColor = true;
this.reloadPreviousResultsButton.Click += new System.EventHandler(this.reloadPreviousResultsButton_Click);
//
// columnWidthsButton
//
this.columnWidthsButton.Location = new System.Drawing.Point(126, 10);
this.columnWidthsButton.Name = "columnWidthsButton";
this.columnWidthsButton.Size = new System.Drawing.Size(120, 30);
this.columnWidthsButton.TabIndex = 1;
this.columnWidthsButton.Text = "Save column widths";
this.columnWidthsButton.UseVisualStyleBackColor = true;
this.columnWidthsButton.Click += new System.EventHandler(this.columnWidthsButton_Click);
//
// showPreviousResultsButton
//
this.showPreviousResultsButton.Location = new System.Drawing.Point(252, 10);
this.showPreviousResultsButton.Name = "showPreviousResultsButton";
this.showPreviousResultsButton.Size = new System.Drawing.Size(147, 30);
this.showPreviousResultsButton.TabIndex = 2;
this.showPreviousResultsButton.Text = "Show previous results";
this.showPreviousResultsButton.UseVisualStyleBackColor = true;
this.showPreviousResultsButton.Click += new System.EventHandler(this.showPreviousResultsButton_Click);
//
// configureButton
//
this.configureButton.Location = new System.Drawing.Point(20, 10);
this.configureButton.Name = "configureButton";
this.configureButton.Size = new System.Drawing.Size(100, 30);
this.configureButton.TabIndex = 0;
this.configureButton.Text = "Configure";
this.configureButton.UseVisualStyleBackColor = true;
this.configureButton.Click += new System.EventHandler(this.configureButton_Click);
//
// flowLayoutPanel
//
this.flowLayoutPanel.AutoScroll = true;
this.flowLayoutPanel.BackColor = System.Drawing.SystemColors.Control;
this.flowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel.Location = new System.Drawing.Point(0, 0);
this.flowLayoutPanel.Name = "flowLayoutPanel";
this.flowLayoutPanel.Size = new System.Drawing.Size(1057, 660);
this.flowLayoutPanel.TabIndex = 0;
//
// ResultsTabPageCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Silver;
this.Controls.Add(this.splitContainer);
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.Name = "ResultsTabPageCtrl";
this.Size = new System.Drawing.Size(1057, 706);
this.Load += new System.EventHandler(this.ResultsTabPageCtrl_Load);
this.splitContainer.Panel1.ResumeLayout(false);
this.splitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
this.splitContainer.ResumeLayout(false);
this.ResumeLayout(false);
this.splitContainer = new System.Windows.Forms.SplitContainer();
this.reloadPreviousResultsButton = new System.Windows.Forms.Button();
this.columnWidthsButton = new System.Windows.Forms.Button();
this.showPreviousResultsButton = new System.Windows.Forms.Button();
this.configureButton = new System.Windows.Forms.Button();
this.flowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
this.splitContainer.Panel1.SuspendLayout();
this.splitContainer.Panel2.SuspendLayout();
this.splitContainer.SuspendLayout();
this.SuspendLayout();
//
// splitContainer
//
this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer.IsSplitterFixed = true;
this.splitContainer.Location = new System.Drawing.Point(0, 0);
this.splitContainer.Name = "splitContainer";
this.splitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer.Panel1
//
this.splitContainer.Panel1.BackColor = System.Drawing.SystemColors.Control;
this.splitContainer.Panel1.Controls.Add(this.reloadPreviousResultsButton);
this.splitContainer.Panel1.Controls.Add(this.columnWidthsButton);
this.splitContainer.Panel1.Controls.Add(this.showPreviousResultsButton);
this.splitContainer.Panel1.Controls.Add(this.configureButton);
//
// splitContainer.Panel2
//
this.splitContainer.Panel2.Controls.Add(this.flowLayoutPanel);
this.splitContainer.Size = new System.Drawing.Size(1057, 706);
this.splitContainer.SplitterDistance = 42;
this.splitContainer.TabIndex = 0;
//
// reloadPreviousResultsButton
//
this.reloadPreviousResultsButton.Enabled = false;
this.reloadPreviousResultsButton.Location = new System.Drawing.Point(405, 10);
this.reloadPreviousResultsButton.Name = "reloadPreviousResultsButton";
this.reloadPreviousResultsButton.Size = new System.Drawing.Size(185, 30);
this.reloadPreviousResultsButton.TabIndex = 3;
this.reloadPreviousResultsButton.Text = "Reload previous results";
this.reloadPreviousResultsButton.UseVisualStyleBackColor = true;
this.reloadPreviousResultsButton.Click += new System.EventHandler(this.reloadPreviousResultsButton_Click);
//
// columnWidthsButton
//
this.columnWidthsButton.Location = new System.Drawing.Point(126, 10);
this.columnWidthsButton.Name = "columnWidthsButton";
this.columnWidthsButton.Size = new System.Drawing.Size(120, 30);
this.columnWidthsButton.TabIndex = 1;
this.columnWidthsButton.Text = "Save column widths";
this.columnWidthsButton.UseVisualStyleBackColor = true;
this.columnWidthsButton.Click += new System.EventHandler(this.columnWidthsButton_Click);
//
// showPreviousResultsButton
//
this.showPreviousResultsButton.Location = new System.Drawing.Point(252, 10);
this.showPreviousResultsButton.Name = "showPreviousResultsButton";
this.showPreviousResultsButton.Size = new System.Drawing.Size(147, 30);
this.showPreviousResultsButton.TabIndex = 2;
this.showPreviousResultsButton.Text = "Show previous results";
this.showPreviousResultsButton.UseVisualStyleBackColor = true;
this.showPreviousResultsButton.Click += new System.EventHandler(this.showPreviousResultsButton_Click);
//
// configureButton
//
this.configureButton.Location = new System.Drawing.Point(20, 10);
this.configureButton.Name = "configureButton";
this.configureButton.Size = new System.Drawing.Size(100, 30);
this.configureButton.TabIndex = 0;
this.configureButton.Text = "Configure";
this.configureButton.UseVisualStyleBackColor = true;
this.configureButton.Click += new System.EventHandler(this.configureButton_Click);
//
// flowLayoutPanel
//
this.flowLayoutPanel.AutoScroll = true;
this.flowLayoutPanel.BackColor = System.Drawing.SystemColors.Control;
this.flowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel.Location = new System.Drawing.Point(0, 0);
this.flowLayoutPanel.Name = "flowLayoutPanel";
this.flowLayoutPanel.Size = new System.Drawing.Size(1057, 660);
this.flowLayoutPanel.TabIndex = 0;
//
// ResultsTabPageCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Silver;
this.Controls.Add(this.splitContainer);
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.Name = "ResultsTabPageCtrl";
this.Size = new System.Drawing.Size(1057, 706);
this.Load += new System.EventHandler(this.ResultsTabPageCtrl_Load);
this.splitContainer.Panel1.ResumeLayout(false);
this.splitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
this.splitContainer.ResumeLayout(false);
this.ResumeLayout(false);
}
+1 -4
View File
@@ -40,10 +40,6 @@ namespace TBF.Screens
{
InitializeComponent();
#if MUNICH
reloadPreviousResultsButton.Visible = false;
#endif
if (Program.LocalSettings != null)
{
MetersArrangement = Program.LocalSettings.ResultsConfigMeters;
@@ -100,6 +96,7 @@ namespace TBF.Screens
configureButton.Text = Strings.Configure;
columnWidthsButton.Text = Strings.Save_column_widths;
showPreviousResultsButton.Text = Strings.Previous_results;
reloadPreviousResultsButton.Text = Strings.Reload_previous_results;
RedrawAll(TBF.BenchControl.Sequences.ProcessData.BatchRslts);
}
+2937 -2922
View File
File diff suppressed because it is too large Load Diff
+286 -286
View File
@@ -31,292 +31,292 @@ namespace TBF.TestWizard
/// </summary>
private void InitializeComponent()
{
this.horizSplitContainer = new System.Windows.Forms.SplitContainer();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.qFromLabel = new System.Windows.Forms.Label();
this.qToLabel = new System.Windows.Forms.Label();
this.qFromTextBox = new System.Windows.Forms.TextBox();
this.qToTextBox = new System.Windows.Forms.TextBox();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.q2TextBox = new System.Windows.Forms.TextBox();
this.dQTextBox = new System.Windows.Forms.TextBox();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.q3TextBox = new System.Windows.Forms.TextBox();
this.dQpctTextBox = new System.Windows.Forms.TextBox();
this.sensorsComboBox = new System.Windows.Forms.ComboBox();
this.sensorsLabel = new System.Windows.Forms.Label();
this.cancelButton = new System.Windows.Forms.Button();
this.nextButton = new System.Windows.Forms.Button();
this.backButton = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).BeginInit();
this.horizSplitContainer.Panel1.SuspendLayout();
this.horizSplitContainer.Panel2.SuspendLayout();
this.horizSplitContainer.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.SuspendLayout();
//
// horizSplitContainer
//
this.horizSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.horizSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.horizSplitContainer.Location = new System.Drawing.Point(0, 0);
this.horizSplitContainer.Name = "horizSplitContainer";
this.horizSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// horizSplitContainer.Panel1
//
this.horizSplitContainer.Panel1.Controls.Add(this.tabControl1);
this.horizSplitContainer.Panel1.Controls.Add(this.sensorsComboBox);
this.horizSplitContainer.Panel1.Controls.Add(this.sensorsLabel);
//
// horizSplitContainer.Panel2
//
this.horizSplitContainer.Panel2.Controls.Add(this.cancelButton);
this.horizSplitContainer.Panel2.Controls.Add(this.nextButton);
this.horizSplitContainer.Panel2.Controls.Add(this.backButton);
this.horizSplitContainer.Size = new System.Drawing.Size(284, 262);
this.horizSplitContainer.SplitterDistance = 182;
this.horizSplitContainer.TabIndex = 1;
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Location = new System.Drawing.Point(0, 3);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(284, 123);
this.tabControl1.TabIndex = 11;
this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
//
// tabPage1
//
this.tabPage1.BackColor = System.Drawing.SystemColors.Control;
this.tabPage1.Controls.Add(this.qFromLabel);
this.tabPage1.Controls.Add(this.qToLabel);
this.tabPage1.Controls.Add(this.qFromTextBox);
this.tabPage1.Controls.Add(this.qToTextBox);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(276, 97);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Q from / Q to";
//
// qFromLabel
//
this.qFromLabel.AutoSize = true;
this.qFromLabel.Location = new System.Drawing.Point(18, 35);
this.qFromLabel.Name = "qFromLabel";
this.qFromLabel.Size = new System.Drawing.Size(72, 13);
this.qFromLabel.TabIndex = 1;
this.qFromLabel.Text = "Q from [m3/h]";
//
// qToLabel
//
this.qToLabel.AutoSize = true;
this.qToLabel.Location = new System.Drawing.Point(18, 61);
this.qToLabel.Name = "qToLabel";
this.qToLabel.Size = new System.Drawing.Size(61, 13);
this.qToLabel.TabIndex = 2;
this.qToLabel.Text = "Q to [m3/h]";
//
// qFromTextBox
//
this.qFromTextBox.Location = new System.Drawing.Point(134, 32);
this.qFromTextBox.Name = "qFromTextBox";
this.qFromTextBox.Size = new System.Drawing.Size(124, 20);
this.qFromTextBox.TabIndex = 4;
this.qFromTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
//
// qToTextBox
//
this.qToTextBox.Location = new System.Drawing.Point(134, 58);
this.qToTextBox.Name = "qToTextBox";
this.qToTextBox.Size = new System.Drawing.Size(124, 20);
this.qToTextBox.TabIndex = 5;
this.qToTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
//
// tabPage2
//
this.tabPage2.BackColor = System.Drawing.SystemColors.Control;
this.tabPage2.Controls.Add(this.label1);
this.tabPage2.Controls.Add(this.label2);
this.tabPage2.Controls.Add(this.q2TextBox);
this.tabPage2.Controls.Add(this.dQTextBox);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(276, 97);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Q +/- dQ";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(18, 35);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(49, 13);
this.label1.TabIndex = 6;
this.label1.Text = "Q [m3/h]";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(18, 61);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(55, 13);
this.label2.TabIndex = 7;
this.label2.Text = "dQ [m3/h]";
//
// q2TextBox
//
this.q2TextBox.Location = new System.Drawing.Point(134, 32);
this.q2TextBox.Name = "q2TextBox";
this.q2TextBox.Size = new System.Drawing.Size(124, 20);
this.q2TextBox.TabIndex = 8;
this.q2TextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
//
// dQTextBox
//
this.dQTextBox.Location = new System.Drawing.Point(134, 58);
this.dQTextBox.Name = "dQTextBox";
this.dQTextBox.Size = new System.Drawing.Size(124, 20);
this.dQTextBox.TabIndex = 9;
this.dQTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
//
// tabPage3
//
this.tabPage3.BackColor = System.Drawing.SystemColors.Control;
this.tabPage3.Controls.Add(this.label3);
this.tabPage3.Controls.Add(this.label4);
this.tabPage3.Controls.Add(this.q3TextBox);
this.tabPage3.Controls.Add(this.dQpctTextBox);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(276, 97);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "Q +/- delta [%]";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(18, 35);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(49, 13);
this.label3.TabIndex = 6;
this.label3.Text = "Q [m3/h]";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(18, 61);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(38, 13);
this.label4.TabIndex = 7;
this.label4.Text = "dQ [%]";
//
// q3TextBox
//
this.q3TextBox.Location = new System.Drawing.Point(134, 32);
this.q3TextBox.Name = "q3TextBox";
this.q3TextBox.Size = new System.Drawing.Size(124, 20);
this.q3TextBox.TabIndex = 8;
this.q3TextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
//
// dQpctTextBox
//
this.dQpctTextBox.Location = new System.Drawing.Point(134, 58);
this.dQpctTextBox.Name = "dQpctTextBox";
this.dQpctTextBox.Size = new System.Drawing.Size(124, 20);
this.dQpctTextBox.TabIndex = 9;
this.dQpctTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
//
// sensorsComboBox
//
this.sensorsComboBox.FormattingEnabled = true;
this.sensorsComboBox.Location = new System.Drawing.Point(137, 145);
this.sensorsComboBox.Name = "sensorsComboBox";
this.sensorsComboBox.Size = new System.Drawing.Size(124, 21);
this.sensorsComboBox.TabIndex = 7;
this.sensorsComboBox.SelectedIndexChanged += new System.EventHandler(this.anyTextBox_TextChanged);
//
// sensorsLabel
//
this.sensorsLabel.AutoSize = true;
this.sensorsLabel.Location = new System.Drawing.Point(21, 148);
this.sensorsLabel.Name = "sensorsLabel";
this.sensorsLabel.Size = new System.Drawing.Size(45, 13);
this.sensorsLabel.TabIndex = 6;
this.sensorsLabel.Text = "Sensors";
//
// 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(186, 17);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(75, 42);
this.cancelButton.TabIndex = 27;
this.cancelButton.Text = "&Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// nextButton
//
this.nextButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.nextButton.Location = new System.Drawing.Point(105, 17);
this.nextButton.Name = "nextButton";
this.nextButton.Size = new System.Drawing.Size(75, 42);
this.nextButton.TabIndex = 26;
this.nextButton.Text = "&Next >";
this.nextButton.UseVisualStyleBackColor = true;
this.nextButton.Click += new System.EventHandler(this.nextButton_Click);
//
// backButton
//
this.backButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.backButton.DialogResult = System.Windows.Forms.DialogResult.Retry;
this.backButton.Location = new System.Drawing.Point(24, 17);
this.backButton.Name = "backButton";
this.backButton.Size = new System.Drawing.Size(75, 42);
this.backButton.TabIndex = 25;
this.backButton.Text = "< &Back";
this.backButton.UseVisualStyleBackColor = true;
this.backButton.Click += new System.EventHandler(this.backButton_Click);
//
// FlowSelection
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 262);
this.Controls.Add(this.horizSplitContainer);
this.Name = "FlowSelection";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "FlowSelection";
this.Load += new System.EventHandler(this.FlowSelection_Load);
this.horizSplitContainer.Panel1.ResumeLayout(false);
this.horizSplitContainer.Panel1.PerformLayout();
this.horizSplitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).EndInit();
this.horizSplitContainer.ResumeLayout(false);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout();
this.tabPage3.ResumeLayout(false);
this.tabPage3.PerformLayout();
this.ResumeLayout(false);
this.horizSplitContainer = new System.Windows.Forms.SplitContainer();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.qFromLabel = new System.Windows.Forms.Label();
this.qToLabel = new System.Windows.Forms.Label();
this.qFromTextBox = new System.Windows.Forms.TextBox();
this.qToTextBox = new System.Windows.Forms.TextBox();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.q2TextBox = new System.Windows.Forms.TextBox();
this.dQTextBox = new System.Windows.Forms.TextBox();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.q3TextBox = new System.Windows.Forms.TextBox();
this.dQpctTextBox = new System.Windows.Forms.TextBox();
this.sensorsComboBox = new System.Windows.Forms.ComboBox();
this.sensorsLabel = new System.Windows.Forms.Label();
this.cancelButton = new System.Windows.Forms.Button();
this.nextButton = new System.Windows.Forms.Button();
this.backButton = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).BeginInit();
this.horizSplitContainer.Panel1.SuspendLayout();
this.horizSplitContainer.Panel2.SuspendLayout();
this.horizSplitContainer.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.SuspendLayout();
//
// horizSplitContainer
//
this.horizSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.horizSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.horizSplitContainer.Location = new System.Drawing.Point(0, 0);
this.horizSplitContainer.Name = "horizSplitContainer";
this.horizSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// horizSplitContainer.Panel1
//
this.horizSplitContainer.Panel1.Controls.Add(this.tabControl1);
this.horizSplitContainer.Panel1.Controls.Add(this.sensorsComboBox);
this.horizSplitContainer.Panel1.Controls.Add(this.sensorsLabel);
//
// horizSplitContainer.Panel2
//
this.horizSplitContainer.Panel2.Controls.Add(this.cancelButton);
this.horizSplitContainer.Panel2.Controls.Add(this.nextButton);
this.horizSplitContainer.Panel2.Controls.Add(this.backButton);
this.horizSplitContainer.Size = new System.Drawing.Size(284, 262);
this.horizSplitContainer.SplitterDistance = 182;
this.horizSplitContainer.TabIndex = 1;
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Location = new System.Drawing.Point(0, 3);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(284, 123);
this.tabControl1.TabIndex = 11;
this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
//
// tabPage1
//
this.tabPage1.BackColor = System.Drawing.SystemColors.Control;
this.tabPage1.Controls.Add(this.qFromLabel);
this.tabPage1.Controls.Add(this.qToLabel);
this.tabPage1.Controls.Add(this.qFromTextBox);
this.tabPage1.Controls.Add(this.qToTextBox);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(276, 97);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Q von / Q bis";
//
// qFromLabel
//
this.qFromLabel.AutoSize = true;
this.qFromLabel.Location = new System.Drawing.Point(18, 35);
this.qFromLabel.Name = "qFromLabel";
this.qFromLabel.Size = new System.Drawing.Size(72, 13);
this.qFromLabel.TabIndex = 1;
this.qFromLabel.Text = "Q from [m3/h]";
//
// qToLabel
//
this.qToLabel.AutoSize = true;
this.qToLabel.Location = new System.Drawing.Point(18, 61);
this.qToLabel.Name = "qToLabel";
this.qToLabel.Size = new System.Drawing.Size(61, 13);
this.qToLabel.TabIndex = 2;
this.qToLabel.Text = "Q to [m3/h]";
//
// qFromTextBox
//
this.qFromTextBox.Location = new System.Drawing.Point(134, 32);
this.qFromTextBox.Name = "qFromTextBox";
this.qFromTextBox.Size = new System.Drawing.Size(124, 20);
this.qFromTextBox.TabIndex = 4;
this.qFromTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
//
// qToTextBox
//
this.qToTextBox.Location = new System.Drawing.Point(134, 58);
this.qToTextBox.Name = "qToTextBox";
this.qToTextBox.Size = new System.Drawing.Size(124, 20);
this.qToTextBox.TabIndex = 5;
this.qToTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
//
// tabPage2
//
this.tabPage2.BackColor = System.Drawing.SystemColors.Control;
this.tabPage2.Controls.Add(this.label1);
this.tabPage2.Controls.Add(this.label2);
this.tabPage2.Controls.Add(this.q2TextBox);
this.tabPage2.Controls.Add(this.dQTextBox);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(276, 97);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Q +/- dQ";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(18, 35);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(49, 13);
this.label1.TabIndex = 6;
this.label1.Text = "Q [m3/h]";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(18, 61);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(55, 13);
this.label2.TabIndex = 7;
this.label2.Text = "dQ [m3/h]";
//
// q2TextBox
//
this.q2TextBox.Location = new System.Drawing.Point(134, 32);
this.q2TextBox.Name = "q2TextBox";
this.q2TextBox.Size = new System.Drawing.Size(124, 20);
this.q2TextBox.TabIndex = 8;
this.q2TextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
//
// dQTextBox
//
this.dQTextBox.Location = new System.Drawing.Point(134, 58);
this.dQTextBox.Name = "dQTextBox";
this.dQTextBox.Size = new System.Drawing.Size(124, 20);
this.dQTextBox.TabIndex = 9;
this.dQTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
//
// tabPage3
//
this.tabPage3.BackColor = System.Drawing.SystemColors.Control;
this.tabPage3.Controls.Add(this.label3);
this.tabPage3.Controls.Add(this.label4);
this.tabPage3.Controls.Add(this.q3TextBox);
this.tabPage3.Controls.Add(this.dQpctTextBox);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(276, 97);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "Q +/- delta [%]";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(18, 35);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(49, 13);
this.label3.TabIndex = 6;
this.label3.Text = "Q [m3/h]";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(18, 61);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(38, 13);
this.label4.TabIndex = 7;
this.label4.Text = "dQ [%]";
//
// q3TextBox
//
this.q3TextBox.Location = new System.Drawing.Point(134, 32);
this.q3TextBox.Name = "q3TextBox";
this.q3TextBox.Size = new System.Drawing.Size(124, 20);
this.q3TextBox.TabIndex = 8;
this.q3TextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
//
// dQpctTextBox
//
this.dQpctTextBox.Location = new System.Drawing.Point(134, 58);
this.dQpctTextBox.Name = "dQpctTextBox";
this.dQpctTextBox.Size = new System.Drawing.Size(124, 20);
this.dQpctTextBox.TabIndex = 9;
this.dQpctTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
//
// sensorsComboBox
//
this.sensorsComboBox.FormattingEnabled = true;
this.sensorsComboBox.Location = new System.Drawing.Point(137, 145);
this.sensorsComboBox.Name = "sensorsComboBox";
this.sensorsComboBox.Size = new System.Drawing.Size(124, 21);
this.sensorsComboBox.TabIndex = 7;
this.sensorsComboBox.SelectedIndexChanged += new System.EventHandler(this.anyTextBox_TextChanged);
//
// sensorsLabel
//
this.sensorsLabel.AutoSize = true;
this.sensorsLabel.Location = new System.Drawing.Point(21, 148);
this.sensorsLabel.Name = "sensorsLabel";
this.sensorsLabel.Size = new System.Drawing.Size(45, 13);
this.sensorsLabel.TabIndex = 6;
this.sensorsLabel.Text = "Sensors";
//
// 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(186, 17);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(75, 42);
this.cancelButton.TabIndex = 27;
this.cancelButton.Text = "&Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// nextButton
//
this.nextButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.nextButton.Location = new System.Drawing.Point(105, 17);
this.nextButton.Name = "nextButton";
this.nextButton.Size = new System.Drawing.Size(75, 42);
this.nextButton.TabIndex = 26;
this.nextButton.Text = "&Next >";
this.nextButton.UseVisualStyleBackColor = true;
this.nextButton.Click += new System.EventHandler(this.nextButton_Click);
//
// backButton
//
this.backButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.backButton.DialogResult = System.Windows.Forms.DialogResult.Retry;
this.backButton.Location = new System.Drawing.Point(24, 17);
this.backButton.Name = "backButton";
this.backButton.Size = new System.Drawing.Size(75, 42);
this.backButton.TabIndex = 25;
this.backButton.Text = "< &Back";
this.backButton.UseVisualStyleBackColor = true;
this.backButton.Click += new System.EventHandler(this.backButton_Click);
//
// FlowSelection
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 262);
this.Controls.Add(this.horizSplitContainer);
this.Name = "FlowSelection";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "FlowSelection";
this.Load += new System.EventHandler(this.FlowSelection_Load);
this.horizSplitContainer.Panel1.ResumeLayout(false);
this.horizSplitContainer.Panel1.PerformLayout();
this.horizSplitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).EndInit();
this.horizSplitContainer.ResumeLayout(false);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout();
this.tabPage3.ResumeLayout(false);
this.tabPage3.PerformLayout();
this.ResumeLayout(false);
}
+214 -280
View File
@@ -31,280 +31,219 @@ namespace TBF.TestWizard
/// </summary>
private void InitializeComponent()
{
this.horizSplitContainer = new System.Windows.Forms.SplitContainer();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.errLoPctLabel = new System.Windows.Forms.Label();
this.errHiPctLabel = new System.Windows.Forms.Label();
this.errHiPctTextBox = new System.Windows.Forms.TextBox();
this.errLoPctTextBox = new System.Windows.Forms.TextBox();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.classComboBox = new System.Windows.Forms.ComboBox();
this.classLabel = new System.Windows.Forms.Label();
this.qpLabel = new System.Windows.Forms.Label();
this.qpTextBox = new System.Windows.Forms.TextBox();
this.uncertaintyTextBox = new System.Windows.Forms.TextBox();
this.durationTextBox = new System.Windows.Forms.TextBox();
this.volumeTextBox = new System.Windows.Forms.TextBox();
this.uncertaintyLabel = new System.Windows.Forms.Label();
this.durationLabel = new System.Windows.Forms.Label();
this.volumeLabel = new System.Windows.Forms.Label();
this.cancelButton = new System.Windows.Forms.Button();
this.nextButton = new System.Windows.Forms.Button();
this.backButton = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).BeginInit();
this.horizSplitContainer.Panel1.SuspendLayout();
this.horizSplitContainer.Panel2.SuspendLayout();
this.horizSplitContainer.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.SuspendLayout();
//
// horizSplitContainer
//
this.horizSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.horizSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.horizSplitContainer.Location = new System.Drawing.Point(0, 0);
this.horizSplitContainer.Name = "horizSplitContainer";
this.horizSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// horizSplitContainer.Panel1
//
this.horizSplitContainer.Panel1.Controls.Add(this.tabControl1);
this.horizSplitContainer.Panel1.Controls.Add(this.uncertaintyTextBox);
this.horizSplitContainer.Panel1.Controls.Add(this.durationTextBox);
this.horizSplitContainer.Panel1.Controls.Add(this.volumeTextBox);
this.horizSplitContainer.Panel1.Controls.Add(this.uncertaintyLabel);
this.horizSplitContainer.Panel1.Controls.Add(this.durationLabel);
this.horizSplitContainer.Panel1.Controls.Add(this.volumeLabel);
//
// horizSplitContainer.Panel2
//
this.horizSplitContainer.Panel2.Controls.Add(this.cancelButton);
this.horizSplitContainer.Panel2.Controls.Add(this.nextButton);
this.horizSplitContainer.Panel2.Controls.Add(this.backButton);
this.horizSplitContainer.Size = new System.Drawing.Size(284, 262);
this.horizSplitContainer.SplitterDistance = 182;
this.horizSplitContainer.TabIndex = 1;
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(284, 93);
this.tabControl1.TabIndex = 0;
this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
//
// tabPage1
//
this.tabPage1.BackColor = System.Drawing.SystemColors.Control;
this.tabPage1.Controls.Add(this.errLoPctLabel);
this.tabPage1.Controls.Add(this.errHiPctLabel);
this.tabPage1.Controls.Add(this.errHiPctTextBox);
this.tabPage1.Controls.Add(this.errLoPctTextBox);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(276, 67);
this.tabPage1.TabIndex = 0;
//
// errLoPctLabel
//
this.errLoPctLabel.AutoSize = true;
this.errLoPctLabel.Location = new System.Drawing.Point(31, 16);
this.errLoPctLabel.Name = "errLoPctLabel";
this.errLoPctLabel.Size = new System.Drawing.Size(85, 13);
this.errLoPctLabel.TabIndex = 0;
this.errLoPctLabel.Text = "Error low limit [%]";
//
// errHiPctLabel
//
this.errHiPctLabel.AutoSize = true;
this.errHiPctLabel.Location = new System.Drawing.Point(31, 41);
this.errHiPctLabel.Name = "errHiPctLabel";
this.errHiPctLabel.Size = new System.Drawing.Size(89, 13);
this.errHiPctLabel.TabIndex = 2;
this.errHiPctLabel.Text = "Error high limit [%]";
//
// errHiPctTextBox
//
this.errHiPctTextBox.Location = new System.Drawing.Point(146, 38);
this.errHiPctTextBox.Name = "errHiPctTextBox";
this.errHiPctTextBox.Size = new System.Drawing.Size(86, 20);
this.errHiPctTextBox.TabIndex = 3;
this.errHiPctTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
//
// errLoPctTextBox
//
this.errLoPctTextBox.Location = new System.Drawing.Point(146, 13);
this.errLoPctTextBox.Name = "errLoPctTextBox";
this.errLoPctTextBox.Size = new System.Drawing.Size(86, 20);
this.errLoPctTextBox.TabIndex = 1;
this.errLoPctTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
//
// tabPage2
//
this.tabPage2.BackColor = System.Drawing.SystemColors.Control;
this.tabPage2.Controls.Add(this.classComboBox);
this.tabPage2.Controls.Add(this.classLabel);
this.tabPage2.Controls.Add(this.qpLabel);
this.tabPage2.Controls.Add(this.qpTextBox);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(276, 67);
this.tabPage2.TabIndex = 1;
//
// classComboBox
//
this.classComboBox.FormattingEnabled = true;
this.classComboBox.Items.AddRange(new object[] {
"1",
"2",
"3"});
this.classComboBox.Location = new System.Drawing.Point(146, 13);
this.classComboBox.Name = "classComboBox";
this.classComboBox.Size = new System.Drawing.Size(86, 21);
this.classComboBox.TabIndex = 1;
this.classComboBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
//
// classLabel
//
this.classLabel.AutoSize = true;
this.classLabel.Location = new System.Drawing.Point(31, 17);
this.classLabel.Name = "classLabel";
this.classLabel.Size = new System.Drawing.Size(32, 13);
this.classLabel.TabIndex = 0;
this.classLabel.Text = "Class";
//
// qpLabel
//
this.qpLabel.AutoSize = true;
this.qpLabel.Location = new System.Drawing.Point(31, 42);
this.qpLabel.Name = "qpLabel";
this.qpLabel.Size = new System.Drawing.Size(55, 13);
this.qpLabel.TabIndex = 2;
this.qpLabel.Text = "Qp [m3/h]";
//
// qpTextBox
//
this.qpTextBox.Location = new System.Drawing.Point(146, 39);
this.qpTextBox.Name = "qpTextBox";
this.qpTextBox.Size = new System.Drawing.Size(86, 20);
this.qpTextBox.TabIndex = 3;
this.qpTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
//
// uncertaintyTextBox
//
this.uncertaintyTextBox.Location = new System.Drawing.Point(150, 100);
this.uncertaintyTextBox.Name = "uncertaintyTextBox";
this.uncertaintyTextBox.Size = new System.Drawing.Size(86, 20);
this.uncertaintyTextBox.TabIndex = 2;
this.uncertaintyTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
//
// durationTextBox
//
this.durationTextBox.Location = new System.Drawing.Point(150, 149);
this.durationTextBox.Name = "durationTextBox";
this.durationTextBox.Size = new System.Drawing.Size(86, 20);
this.durationTextBox.TabIndex = 6;
this.durationTextBox.TextChanged += new System.EventHandler(this.durationTextBox_TextChanged);
//
// volumeTextBox
//
this.volumeTextBox.Location = new System.Drawing.Point(150, 124);
this.volumeTextBox.Name = "volumeTextBox";
this.volumeTextBox.Size = new System.Drawing.Size(86, 20);
this.volumeTextBox.TabIndex = 4;
this.volumeTextBox.TextChanged += new System.EventHandler(this.volumeTextBox_TextChanged);
//
// uncertaintyLabel
//
this.uncertaintyLabel.AutoSize = true;
this.uncertaintyLabel.Location = new System.Drawing.Point(35, 103);
this.uncertaintyLabel.Name = "uncertaintyLabel";
this.uncertaintyLabel.Size = new System.Drawing.Size(78, 13);
this.uncertaintyLabel.TabIndex = 1;
this.uncertaintyLabel.Text = "Uncertainty [%]";
//
// durationLabel
//
this.durationLabel.AutoSize = true;
this.durationLabel.Location = new System.Drawing.Point(35, 152);
this.durationLabel.Name = "durationLabel";
this.durationLabel.Size = new System.Drawing.Size(83, 13);
this.durationLabel.TabIndex = 5;
this.durationLabel.Text = "Test duration [s]";
//
// volumeLabel
//
this.volumeLabel.AutoSize = true;
this.volumeLabel.Location = new System.Drawing.Point(35, 127);
this.volumeLabel.Name = "volumeLabel";
this.volumeLabel.Size = new System.Drawing.Size(53, 13);
this.volumeLabel.TabIndex = 3;
this.volumeLabel.Text = "Volume [l]";
//
// 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(186, 17);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(75, 42);
this.cancelButton.TabIndex = 2;
this.cancelButton.Text = "&Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// nextButton
//
this.nextButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.nextButton.Location = new System.Drawing.Point(105, 17);
this.nextButton.Name = "nextButton";
this.nextButton.Size = new System.Drawing.Size(75, 42);
this.nextButton.TabIndex = 1;
this.nextButton.Text = "&Next >";
this.nextButton.UseVisualStyleBackColor = true;
this.nextButton.Click += new System.EventHandler(this.nextButton_Click);
//
// backButton
//
this.backButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.backButton.DialogResult = System.Windows.Forms.DialogResult.Retry;
this.backButton.Location = new System.Drawing.Point(24, 17);
this.backButton.Name = "backButton";
this.backButton.Size = new System.Drawing.Size(75, 42);
this.backButton.TabIndex = 0;
this.backButton.Text = "< &Back";
this.backButton.UseVisualStyleBackColor = true;
this.backButton.Click += new System.EventHandler(this.backButton_Click);
//
// VolumeAndErrorSelection
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 262);
this.Controls.Add(this.horizSplitContainer);
this.Name = "VolumeAndErrorSelection";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "VolumeAndErrorSelection";
this.Load += new System.EventHandler(this.VolumeAndErrorSelection_Load);
this.horizSplitContainer.Panel1.ResumeLayout(false);
this.horizSplitContainer.Panel1.PerformLayout();
this.horizSplitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).EndInit();
this.horizSplitContainer.ResumeLayout(false);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout();
this.ResumeLayout(false);
this.horizSplitContainer = new System.Windows.Forms.SplitContainer();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.errLoPctLabel = new System.Windows.Forms.Label();
this.errHiPctLabel = new System.Windows.Forms.Label();
this.errHiPctTextBox = new System.Windows.Forms.TextBox();
this.errLoPctTextBox = new System.Windows.Forms.TextBox();
this.uncertaintyTextBox = new System.Windows.Forms.TextBox();
this.durationTextBox = new System.Windows.Forms.TextBox();
this.volumeTextBox = new System.Windows.Forms.TextBox();
this.uncertaintyLabel = new System.Windows.Forms.Label();
this.durationLabel = new System.Windows.Forms.Label();
this.volumeLabel = new System.Windows.Forms.Label();
this.cancelButton = new System.Windows.Forms.Button();
this.nextButton = new System.Windows.Forms.Button();
this.backButton = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).BeginInit();
this.horizSplitContainer.Panel1.SuspendLayout();
this.horizSplitContainer.Panel2.SuspendLayout();
this.horizSplitContainer.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.SuspendLayout();
//
// horizSplitContainer
//
this.horizSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.horizSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.horizSplitContainer.Location = new System.Drawing.Point(0, 0);
this.horizSplitContainer.Name = "horizSplitContainer";
this.horizSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// horizSplitContainer.Panel1
//
this.horizSplitContainer.Panel1.Controls.Add(this.tabControl1);
this.horizSplitContainer.Panel1.Controls.Add(this.uncertaintyTextBox);
this.horizSplitContainer.Panel1.Controls.Add(this.durationTextBox);
this.horizSplitContainer.Panel1.Controls.Add(this.volumeTextBox);
this.horizSplitContainer.Panel1.Controls.Add(this.uncertaintyLabel);
this.horizSplitContainer.Panel1.Controls.Add(this.durationLabel);
this.horizSplitContainer.Panel1.Controls.Add(this.volumeLabel);
//
// horizSplitContainer.Panel2
//
this.horizSplitContainer.Panel2.Controls.Add(this.cancelButton);
this.horizSplitContainer.Panel2.Controls.Add(this.nextButton);
this.horizSplitContainer.Panel2.Controls.Add(this.backButton);
this.horizSplitContainer.Size = new System.Drawing.Size(284, 262);
this.horizSplitContainer.SplitterDistance = 182;
this.horizSplitContainer.TabIndex = 1;
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(284, 93);
this.tabControl1.TabIndex = 0;
this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
//
// tabPage1
//
this.tabPage1.BackColor = System.Drawing.SystemColors.Control;
this.tabPage1.Controls.Add(this.errLoPctLabel);
this.tabPage1.Controls.Add(this.errHiPctLabel);
this.tabPage1.Controls.Add(this.errHiPctTextBox);
this.tabPage1.Controls.Add(this.errLoPctTextBox);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(276, 67);
this.tabPage1.TabIndex = 0;
//
// errLoPctLabel
//
this.errLoPctLabel.AutoSize = true;
this.errLoPctLabel.Location = new System.Drawing.Point(31, 16);
this.errLoPctLabel.Name = "errLoPctLabel";
this.errLoPctLabel.Size = new System.Drawing.Size(85, 13);
this.errLoPctLabel.TabIndex = 0;
this.errLoPctLabel.Text = "Error low limit [%]";
//
// errHiPctLabel
//
this.errHiPctLabel.AutoSize = true;
this.errHiPctLabel.Location = new System.Drawing.Point(31, 41);
this.errHiPctLabel.Name = "errHiPctLabel";
this.errHiPctLabel.Size = new System.Drawing.Size(89, 13);
this.errHiPctLabel.TabIndex = 2;
this.errHiPctLabel.Text = "Error high limit [%]";
//
// errHiPctTextBox
//
this.errHiPctTextBox.Location = new System.Drawing.Point(146, 38);
this.errHiPctTextBox.Name = "errHiPctTextBox";
this.errHiPctTextBox.Size = new System.Drawing.Size(86, 20);
this.errHiPctTextBox.TabIndex = 3;
this.errHiPctTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
//
// errLoPctTextBox
//
this.errLoPctTextBox.Location = new System.Drawing.Point(146, 13);
this.errLoPctTextBox.Name = "errLoPctTextBox";
this.errLoPctTextBox.Size = new System.Drawing.Size(86, 20);
this.errLoPctTextBox.TabIndex = 1;
this.errLoPctTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
//
// uncertaintyTextBox
//
this.uncertaintyTextBox.Location = new System.Drawing.Point(150, 100);
this.uncertaintyTextBox.Name = "uncertaintyTextBox";
this.uncertaintyTextBox.Size = new System.Drawing.Size(86, 20);
this.uncertaintyTextBox.TabIndex = 2;
this.uncertaintyTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged);
//
// durationTextBox
//
this.durationTextBox.Location = new System.Drawing.Point(150, 149);
this.durationTextBox.Name = "durationTextBox";
this.durationTextBox.Size = new System.Drawing.Size(86, 20);
this.durationTextBox.TabIndex = 6;
this.durationTextBox.TextChanged += new System.EventHandler(this.durationTextBox_TextChanged);
//
// volumeTextBox
//
this.volumeTextBox.Location = new System.Drawing.Point(150, 124);
this.volumeTextBox.Name = "volumeTextBox";
this.volumeTextBox.Size = new System.Drawing.Size(86, 20);
this.volumeTextBox.TabIndex = 4;
this.volumeTextBox.TextChanged += new System.EventHandler(this.volumeTextBox_TextChanged);
//
// uncertaintyLabel
//
this.uncertaintyLabel.AutoSize = true;
this.uncertaintyLabel.Location = new System.Drawing.Point(35, 103);
this.uncertaintyLabel.Name = "uncertaintyLabel";
this.uncertaintyLabel.Size = new System.Drawing.Size(78, 13);
this.uncertaintyLabel.TabIndex = 1;
this.uncertaintyLabel.Text = "Uncertainty [%]";
//
// durationLabel
//
this.durationLabel.AutoSize = true;
this.durationLabel.Location = new System.Drawing.Point(35, 152);
this.durationLabel.Name = "durationLabel";
this.durationLabel.Size = new System.Drawing.Size(83, 13);
this.durationLabel.TabIndex = 5;
this.durationLabel.Text = "Test duration [s]";
//
// volumeLabel
//
this.volumeLabel.AutoSize = true;
this.volumeLabel.Location = new System.Drawing.Point(35, 127);
this.volumeLabel.Name = "volumeLabel";
this.volumeLabel.Size = new System.Drawing.Size(53, 13);
this.volumeLabel.TabIndex = 3;
this.volumeLabel.Text = "Volume [l]";
//
// 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(186, 17);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(75, 42);
this.cancelButton.TabIndex = 2;
this.cancelButton.Text = "&Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// nextButton
//
this.nextButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.nextButton.Location = new System.Drawing.Point(105, 17);
this.nextButton.Name = "nextButton";
this.nextButton.Size = new System.Drawing.Size(75, 42);
this.nextButton.TabIndex = 1;
this.nextButton.Text = "&Next >";
this.nextButton.UseVisualStyleBackColor = true;
this.nextButton.Click += new System.EventHandler(this.nextButton_Click);
//
// backButton
//
this.backButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.backButton.DialogResult = System.Windows.Forms.DialogResult.Retry;
this.backButton.Location = new System.Drawing.Point(24, 17);
this.backButton.Name = "backButton";
this.backButton.Size = new System.Drawing.Size(75, 42);
this.backButton.TabIndex = 0;
this.backButton.Text = "< &Back";
this.backButton.UseVisualStyleBackColor = true;
this.backButton.Click += new System.EventHandler(this.backButton_Click);
//
// VolumeAndErrorSelection
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 262);
this.Controls.Add(this.horizSplitContainer);
this.Name = "VolumeAndErrorSelection";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "VolumeAndErrorSelection";
this.Load += new System.EventHandler(this.VolumeAndErrorSelection_Load);
this.horizSplitContainer.Panel1.ResumeLayout(false);
this.horizSplitContainer.Panel1.PerformLayout();
this.horizSplitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).EndInit();
this.horizSplitContainer.ResumeLayout(false);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.ResumeLayout(false);
}
@@ -325,11 +264,6 @@ namespace TBF.TestWizard
private System.Windows.Forms.TextBox uncertaintyTextBox;
private System.Windows.Forms.Label uncertaintyLabel;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.Label classLabel;
private System.Windows.Forms.Label qpLabel;
private System.Windows.Forms.TextBox qpTextBox;
private System.Windows.Forms.ComboBox classComboBox;
private System.Windows.Forms.TabPage tabPage1;
}
}
+10 -9
View File
@@ -35,9 +35,9 @@ namespace TBF.TestWizard
nextButton.Text = Strings.FinishBtnText;
cancelButton.Text = Strings.CancelBtnText;
tabPage1.Text = Strings.Water_Meter;
tabPage2.Text = Strings.Heat_meter;
classLabel.Text = Strings.Metrological_class;
qpLabel.Text = "Qp [m3/h]";
//tabPage2.Text = Strings.Heat_meter;
//classLabel.Text = Strings.Metrological_class;
//qpLabel.Text = "Qp [m3/h]";
}
public VolumeAndErrorSelection(bool first, bool last, Test test)
@@ -58,7 +58,7 @@ namespace TBF.TestWizard
errLoPctTextBox.Text = test.ErrLimLo.ToString();
errHiPctTextBox.Text = test.ErrLimHi.ToString();
uncertaintyTextBox.Text = test.Uncertainty.ToString();
classComboBox.Text = "2";
//classComboBox.Text = "2";
nextButton.Enabled = IsFormValid();
}
@@ -77,9 +77,10 @@ namespace TBF.TestWizard
&& Utils.TryParseSFloat(errHiPctTextBox.Text, out dummy);
break;
case TabId.HeatMeterTab:
tabsValid = int.TryParse(classComboBox.Text, out idummy)
&& idummy >= 1 && idummy <= 3
&& Utils.TryParseUFloat(qpTextBox.Text, out dummy);
//tabsValid = int.TryParse(classComboBox.Text, out idummy)
// && idummy >= 1 && idummy <= 3
// && Utils.TryParseUFloat(qpTextBox.Text, out dummy);
tabsValid = true;
break;
}
@@ -103,8 +104,8 @@ namespace TBF.TestWizard
test.ErrLimHi = Utils.ParseSFloat(errHiPctTextBox.Text);
break;
case TabId.HeatMeterTab:
test.ErrLimLo = (float)int.Parse(classComboBox.Text);
test.ErrLimHi = -Utils.ParseUFloat(qpTextBox.Text);
//test.ErrLimLo = (float)int.Parse(classComboBox.Text);
//test.ErrLimHi = -Utils.ParseUFloat(qpTextBox.Text);
break;
}
}